diff --git a/resource-manager/advisor/2023-01-01/advisorscore/README.md b/resource-manager/advisor/2023-01-01/advisorscore/README.md index c9c449b8d9b..4c3fc7d869b 100644 --- a/resource-manager/advisor/2023-01-01/advisorscore/README.md +++ b/resource-manager/advisor/2023-01-01/advisorscore/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := advisorscore.NewAdvisorScoreID("12345678-1234-9876-4563-123456789012", "name") +id := advisorscore.NewAdvisorScoreID("12345678-1234-9876-4563-123456789012", "advisorScoreName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/advisor/2023-01-01/advisorscore/id_advisorscore.go b/resource-manager/advisor/2023-01-01/advisorscore/id_advisorscore.go index 5d0fd6ce535..c7e7c7ab1a6 100644 --- a/resource-manager/advisor/2023-01-01/advisorscore/id_advisorscore.go +++ b/resource-manager/advisor/2023-01-01/advisorscore/id_advisorscore.go @@ -107,7 +107,7 @@ func (id AdvisorScoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAdvisor", "Microsoft.Advisor", "Microsoft.Advisor"), resourceids.StaticSegment("staticAdvisorScore", "advisorScore", "advisorScore"), - resourceids.UserSpecifiedSegment("advisorScoreName", "name"), + resourceids.UserSpecifiedSegment("advisorScoreName", "advisorScoreName"), } } diff --git a/resource-manager/advisor/2023-01-01/advisorscore/id_advisorscore_test.go b/resource-manager/advisor/2023-01-01/advisorscore/id_advisorscore_test.go index 4741e1f5615..56079d118c4 100644 --- a/resource-manager/advisor/2023-01-01/advisorscore/id_advisorscore_test.go +++ b/resource-manager/advisor/2023-01-01/advisorscore/id_advisorscore_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &AdvisorScoreId{} func TestNewAdvisorScoreID(t *testing.T) { - id := NewAdvisorScoreID("12345678-1234-9876-4563-123456789012", "name") + id := NewAdvisorScoreID("12345678-1234-9876-4563-123456789012", "advisorScoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.AdvisorScoreName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'AdvisorScoreName'", id.AdvisorScoreName, "name") + if id.AdvisorScoreName != "advisorScoreName" { + t.Fatalf("Expected %q but got %q for Segment 'AdvisorScoreName'", id.AdvisorScoreName, "advisorScoreName") } } func TestFormatAdvisorScoreID(t *testing.T) { - actual := NewAdvisorScoreID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/name" + actual := NewAdvisorScoreID("12345678-1234-9876-4563-123456789012", "advisorScoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/advisorScoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseAdvisorScoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/advisorScoreName", Expected: &AdvisorScoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AdvisorScoreName: "name", + AdvisorScoreName: "advisorScoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/advisorScoreName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseAdvisorScoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/advisorScoreName", Expected: &AdvisorScoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AdvisorScoreName: "name", + AdvisorScoreName: "advisorScoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Advisor/advisorScore/advisorScoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aDvIsOr/aDvIsOrScOrE/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aDvIsOr/aDvIsOrScOrE/aDvIsOrScOrEnAmE", Expected: &AdvisorScoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AdvisorScoreName: "nAmE", + AdvisorScoreName: "aDvIsOrScOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aDvIsOr/aDvIsOrScOrE/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aDvIsOr/aDvIsOrScOrE/aDvIsOrScOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/advisor/2023-01-01/metadata/README.md b/resource-manager/advisor/2023-01-01/metadata/README.md index 3d3559b3699..df73270e0c2 100644 --- a/resource-manager/advisor/2023-01-01/metadata/README.md +++ b/resource-manager/advisor/2023-01-01/metadata/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := metadata.NewMetadataID("name") +id := metadata.NewMetadataID("metadataName") read, err := client.RecommendationMetadataGet(ctx, id) if err != nil { diff --git a/resource-manager/advisor/2023-01-01/metadata/id_metadata.go b/resource-manager/advisor/2023-01-01/metadata/id_metadata.go index ab431335ce6..f79d74f3a16 100644 --- a/resource-manager/advisor/2023-01-01/metadata/id_metadata.go +++ b/resource-manager/advisor/2023-01-01/metadata/id_metadata.go @@ -99,7 +99,7 @@ func (id MetadataId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAdvisor", "Microsoft.Advisor", "Microsoft.Advisor"), resourceids.StaticSegment("staticMetadata", "metadata", "metadata"), - resourceids.UserSpecifiedSegment("metadataName", "name"), + resourceids.UserSpecifiedSegment("metadataName", "metadataName"), } } diff --git a/resource-manager/advisor/2023-01-01/metadata/id_metadata_test.go b/resource-manager/advisor/2023-01-01/metadata/id_metadata_test.go index 3f2566e0430..e96a849a3a1 100644 --- a/resource-manager/advisor/2023-01-01/metadata/id_metadata_test.go +++ b/resource-manager/advisor/2023-01-01/metadata/id_metadata_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &MetadataId{} func TestNewMetadataID(t *testing.T) { - id := NewMetadataID("name") + id := NewMetadataID("metadataName") - if id.MetadataName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'MetadataName'", id.MetadataName, "name") + if id.MetadataName != "metadataName" { + t.Fatalf("Expected %q but got %q for Segment 'MetadataName'", id.MetadataName, "metadataName") } } func TestFormatMetadataID(t *testing.T) { - actual := NewMetadataID("name").ID() - expected := "/providers/Microsoft.Advisor/metadata/name" + actual := NewMetadataID("metadataName").ID() + expected := "/providers/Microsoft.Advisor/metadata/metadataName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseMetadataID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Advisor/metadata/name", + Input: "/providers/Microsoft.Advisor/metadata/metadataName", Expected: &MetadataId{ - MetadataName: "name", + MetadataName: "metadataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Advisor/metadata/name/extra", + Input: "/providers/Microsoft.Advisor/metadata/metadataName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseMetadataIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Advisor/metadata/name", + Input: "/providers/Microsoft.Advisor/metadata/metadataName", Expected: &MetadataId{ - MetadataName: "name", + MetadataName: "metadataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Advisor/metadata/name/extra", + Input: "/providers/Microsoft.Advisor/metadata/metadataName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.aDvIsOr/mEtAdAtA/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.aDvIsOr/mEtAdAtA/mEtAdAtAnAmE", Expected: &MetadataId{ - MetadataName: "nAmE", + MetadataName: "mEtAdAtAnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.aDvIsOr/mEtAdAtA/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.aDvIsOr/mEtAdAtA/mEtAdAtAnAmE/extra", Error: true, }, } diff --git a/resource-manager/advisor/2023-01-01/suppressions/README.md b/resource-manager/advisor/2023-01-01/suppressions/README.md index 33435276dd8..b1396e3e8c7 100644 --- a/resource-manager/advisor/2023-01-01/suppressions/README.md +++ b/resource-manager/advisor/2023-01-01/suppressions/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "name") +id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "suppressionName") payload := suppressions.SuppressionContract{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "name") +id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "suppressionName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "name") +id := suppressions.NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "suppressionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/advisor/2023-01-01/suppressions/id_scopedsuppression.go b/resource-manager/advisor/2023-01-01/suppressions/id_scopedsuppression.go index 4a1ec491377..767e49954a1 100644 --- a/resource-manager/advisor/2023-01-01/suppressions/id_scopedsuppression.go +++ b/resource-manager/advisor/2023-01-01/suppressions/id_scopedsuppression.go @@ -114,7 +114,7 @@ func (id ScopedSuppressionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), resourceids.UserSpecifiedSegment("recommendationId", "recommendationId"), resourceids.StaticSegment("staticSuppressions", "suppressions", "suppressions"), - resourceids.UserSpecifiedSegment("suppressionName", "name"), + resourceids.UserSpecifiedSegment("suppressionName", "suppressionName"), } } diff --git a/resource-manager/advisor/2023-01-01/suppressions/id_scopedsuppression_test.go b/resource-manager/advisor/2023-01-01/suppressions/id_scopedsuppression_test.go index d0774d2d67e..c6f003ef45b 100644 --- a/resource-manager/advisor/2023-01-01/suppressions/id_scopedsuppression_test.go +++ b/resource-manager/advisor/2023-01-01/suppressions/id_scopedsuppression_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScopedSuppressionId{} func TestNewScopedSuppressionID(t *testing.T) { - id := NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "name") + id := NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "suppressionName") if id.ResourceUri != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceUri'", id.ResourceUri, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") @@ -22,14 +22,14 @@ func TestNewScopedSuppressionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RecommendationId'", id.RecommendationId, "recommendationId") } - if id.SuppressionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SuppressionName'", id.SuppressionName, "name") + if id.SuppressionName != "suppressionName" { + t.Fatalf("Expected %q but got %q for Segment 'SuppressionName'", id.SuppressionName, "suppressionName") } } func TestFormatScopedSuppressionID(t *testing.T) { - actual := NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/name" + actual := NewScopedSuppressionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "recommendationId", "suppressionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -78,16 +78,16 @@ func TestParseScopedSuppressionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName", Expected: &ScopedSuppressionId{ ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", RecommendationId: "recommendationId", - SuppressionName: "name", + SuppressionName: "suppressionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName/extra", Error: true, }, } @@ -194,30 +194,30 @@ func TestParseScopedSuppressionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName", Expected: &ScopedSuppressionId{ ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", RecommendationId: "recommendationId", - SuppressionName: "name", + SuppressionName: "suppressionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.aDvIsOr/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNiD/sUpPrEsSiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.aDvIsOr/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNiD/sUpPrEsSiOnS/sUpPrEsSiOnNaMe", Expected: &ScopedSuppressionId{ ResourceUri: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", RecommendationId: "rEcOmMeNdAtIoNiD", - SuppressionName: "nAmE", + SuppressionName: "sUpPrEsSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.aDvIsOr/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNiD/sUpPrEsSiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.aDvIsOr/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNiD/sUpPrEsSiOnS/sUpPrEsSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_alertsmetadataproperties.go b/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_alertsmetadataproperties.go index 1a118bae36c..0a6c26ae26b 100644 --- a/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_alertsmetadataproperties.go +++ b/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_alertsmetadataproperties.go @@ -3,6 +3,7 @@ package alertsmanagements import ( "encoding/json" "fmt" + "strings" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,6 +53,14 @@ func UnmarshalAlertsMetaDataPropertiesImplementation(input []byte) (AlertsMetaDa value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "MonitorServiceList") { + var out MonitorServiceList + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MonitorServiceList: %+v", err) + } + return out, nil + } + var parent BaseAlertsMetaDataPropertiesImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseAlertsMetaDataPropertiesImpl: %+v", err) diff --git a/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_monitorservicedetails.go b/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_monitorservicedetails.go new file mode 100644 index 00000000000..55c070484ac --- /dev/null +++ b/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_monitorservicedetails.go @@ -0,0 +1,9 @@ +package alertsmanagements + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MonitorServiceDetails struct { + DisplayName *string `json:"displayName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_monitorservicelist.go b/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_monitorservicelist.go new file mode 100644 index 00000000000..1e8a59a01a6 --- /dev/null +++ b/resource-manager/alertsmanagement/2019-05-05-preview/alertsmanagements/model_monitorservicelist.go @@ -0,0 +1,50 @@ +package alertsmanagements + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ AlertsMetaDataProperties = MonitorServiceList{} + +type MonitorServiceList struct { + Data []MonitorServiceDetails `json:"data"` + + // Fields inherited from AlertsMetaDataProperties + + MetadataIdentifier MetadataIdentifier `json:"metadataIdentifier"` +} + +func (s MonitorServiceList) AlertsMetaDataProperties() BaseAlertsMetaDataPropertiesImpl { + return BaseAlertsMetaDataPropertiesImpl{ + MetadataIdentifier: s.MetadataIdentifier, + } +} + +var _ json.Marshaler = MonitorServiceList{} + +func (s MonitorServiceList) MarshalJSON() ([]byte, error) { + type wrapper MonitorServiceList + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MonitorServiceList: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MonitorServiceList: %+v", err) + } + + decoded["metadataIdentifier"] = "MonitorServiceList" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MonitorServiceList: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/README.md b/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/README.md index 1778fdc7007..17af8c965a1 100644 --- a/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/README.md +++ b/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := smartdetectoralertrules.NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") +id := smartdetectoralertrules.NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "smartDetectorAlertRuleName") payload := smartdetectoralertrules.AlertRule{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := smartdetectoralertrules.NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") +id := smartdetectoralertrules.NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "smartDetectorAlertRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := smartdetectoralertrules.NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") +id := smartdetectoralertrules.NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "smartDetectorAlertRuleName") read, err := client.Get(ctx, id, smartdetectoralertrules.DefaultGetOperationOptions()) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := smartdetectoralertrules.NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") +id := smartdetectoralertrules.NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "smartDetectorAlertRuleName") payload := smartdetectoralertrules.AlertRulePatchObject{ // ... diff --git a/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/id_smartdetectoralertrule.go b/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/id_smartdetectoralertrule.go index 687b9524fbd..b1b37537a7a 100644 --- a/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/id_smartdetectoralertrule.go +++ b/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/id_smartdetectoralertrule.go @@ -115,7 +115,7 @@ func (id SmartDetectorAlertRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAlertsManagement", "Microsoft.AlertsManagement", "Microsoft.AlertsManagement"), resourceids.StaticSegment("staticSmartDetectorAlertRules", "smartDetectorAlertRules", "smartDetectorAlertRules"), - resourceids.UserSpecifiedSegment("smartDetectorAlertRuleName", "alertRuleName"), + resourceids.UserSpecifiedSegment("smartDetectorAlertRuleName", "smartDetectorAlertRuleName"), } } diff --git a/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/id_smartdetectoralertrule_test.go b/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/id_smartdetectoralertrule_test.go index 0ba517260ea..1d46ef75fb9 100644 --- a/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/id_smartdetectoralertrule_test.go +++ b/resource-manager/alertsmanagement/2019-06-01/smartdetectoralertrules/id_smartdetectoralertrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SmartDetectorAlertRuleId{} func TestNewSmartDetectorAlertRuleID(t *testing.T) { - id := NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") + id := NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "smartDetectorAlertRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewSmartDetectorAlertRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SmartDetectorAlertRuleName != "alertRuleName" { - t.Fatalf("Expected %q but got %q for Segment 'SmartDetectorAlertRuleName'", id.SmartDetectorAlertRuleName, "alertRuleName") + if id.SmartDetectorAlertRuleName != "smartDetectorAlertRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'SmartDetectorAlertRuleName'", id.SmartDetectorAlertRuleName, "smartDetectorAlertRuleName") } } func TestFormatSmartDetectorAlertRuleID(t *testing.T) { - actual := NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/alertRuleName" + actual := NewSmartDetectorAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "smartDetectorAlertRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/smartDetectorAlertRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseSmartDetectorAlertRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/alertRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/smartDetectorAlertRuleName", Expected: &SmartDetectorAlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SmartDetectorAlertRuleName: "alertRuleName", + SmartDetectorAlertRuleName: "smartDetectorAlertRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/alertRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/smartDetectorAlertRuleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseSmartDetectorAlertRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/alertRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/smartDetectorAlertRuleName", Expected: &SmartDetectorAlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SmartDetectorAlertRuleName: "alertRuleName", + SmartDetectorAlertRuleName: "smartDetectorAlertRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/alertRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/smartDetectorAlertRules/smartDetectorAlertRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/sMaRtDeTeCtOrAlErTrUlEs/aLeRtRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/sMaRtDeTeCtOrAlErTrUlEs/sMaRtDeTeCtOrAlErTrUlEnAmE", Expected: &SmartDetectorAlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SmartDetectorAlertRuleName: "aLeRtRuLeNaMe", + SmartDetectorAlertRuleName: "sMaRtDeTeCtOrAlErTrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/sMaRtDeTeCtOrAlErTrUlEs/aLeRtRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/sMaRtDeTeCtOrAlErTrUlEs/sMaRtDeTeCtOrAlErTrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/README.md b/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/README.md index b3db1248b04..6979b8689e1 100644 --- a/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/README.md +++ b/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := alertprocessingrules.NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertProcessingRuleName") +id := alertprocessingrules.NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "actionRuleName") payload := alertprocessingrules.AlertProcessingRule{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alertprocessingrules.NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertProcessingRuleName") +id := alertprocessingrules.NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "actionRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alertprocessingrules.NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertProcessingRuleName") +id := alertprocessingrules.NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "actionRuleName") read, err := client.GetByName(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := alertprocessingrules.NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertProcessingRuleName") +id := alertprocessingrules.NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "actionRuleName") payload := alertprocessingrules.PatchObject{ // ... diff --git a/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/id_actionrule.go b/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/id_actionrule.go index cf730b20fdc..247d30c95b8 100644 --- a/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/id_actionrule.go +++ b/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/id_actionrule.go @@ -115,7 +115,7 @@ func (id ActionRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAlertsManagement", "Microsoft.AlertsManagement", "Microsoft.AlertsManagement"), resourceids.StaticSegment("staticActionRules", "actionRules", "actionRules"), - resourceids.UserSpecifiedSegment("actionRuleName", "alertProcessingRuleName"), + resourceids.UserSpecifiedSegment("actionRuleName", "actionRuleName"), } } diff --git a/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/id_actionrule_test.go b/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/id_actionrule_test.go index e6ffd8fe714..36cc1a434fe 100644 --- a/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/id_actionrule_test.go +++ b/resource-manager/alertsmanagement/2021-08-08/alertprocessingrules/id_actionrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ActionRuleId{} func TestNewActionRuleID(t *testing.T) { - id := NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertProcessingRuleName") + id := NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "actionRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewActionRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ActionRuleName != "alertProcessingRuleName" { - t.Fatalf("Expected %q but got %q for Segment 'ActionRuleName'", id.ActionRuleName, "alertProcessingRuleName") + if id.ActionRuleName != "actionRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'ActionRuleName'", id.ActionRuleName, "actionRuleName") } } func TestFormatActionRuleID(t *testing.T) { - actual := NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertProcessingRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/alertProcessingRuleName" + actual := NewActionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "actionRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/actionRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseActionRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/alertProcessingRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/actionRuleName", Expected: &ActionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ActionRuleName: "alertProcessingRuleName", + ActionRuleName: "actionRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/alertProcessingRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/actionRuleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseActionRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/alertProcessingRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/actionRuleName", Expected: &ActionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ActionRuleName: "alertProcessingRuleName", + ActionRuleName: "actionRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/alertProcessingRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/actionRules/actionRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/aCtIoNrUlEs/aLeRtPrOcEsSiNgRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/aCtIoNrUlEs/aCtIoNrUlEnAmE", Expected: &ActionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ActionRuleName: "aLeRtPrOcEsSiNgRuLeNaMe", + ActionRuleName: "aCtIoNrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/aCtIoNrUlEs/aLeRtPrOcEsSiNgRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/aCtIoNrUlEs/aCtIoNrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/README.md b/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/README.md index 30a8465a295..557ee8571bc 100644 --- a/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/README.md +++ b/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleGroupName") +id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName") payload := prometheusrulegroups.PrometheusRuleGroupResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleGroupName") +id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleGroupName") +id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName") read, err := client.Get(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleGroupName") +id := prometheusrulegroups.NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName") payload := prometheusrulegroups.PrometheusRuleGroupResourcePatchParameters{ // ... diff --git a/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/id_prometheusrulegroup.go b/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/id_prometheusrulegroup.go index 03b6af680df..454f8ef9255 100644 --- a/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/id_prometheusrulegroup.go +++ b/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/id_prometheusrulegroup.go @@ -115,7 +115,7 @@ func (id PrometheusRuleGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAlertsManagement", "Microsoft.AlertsManagement", "Microsoft.AlertsManagement"), resourceids.StaticSegment("staticPrometheusRuleGroups", "prometheusRuleGroups", "prometheusRuleGroups"), - resourceids.UserSpecifiedSegment("prometheusRuleGroupName", "ruleGroupName"), + resourceids.UserSpecifiedSegment("prometheusRuleGroupName", "prometheusRuleGroupName"), } } diff --git a/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/id_prometheusrulegroup_test.go b/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/id_prometheusrulegroup_test.go index 95bb86390ca..301dbb79f16 100644 --- a/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/id_prometheusrulegroup_test.go +++ b/resource-manager/alertsmanagement/2023-03-01/prometheusrulegroups/id_prometheusrulegroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrometheusRuleGroupId{} func TestNewPrometheusRuleGroupID(t *testing.T) { - id := NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleGroupName") + id := NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrometheusRuleGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrometheusRuleGroupName != "ruleGroupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrometheusRuleGroupName'", id.PrometheusRuleGroupName, "ruleGroupName") + if id.PrometheusRuleGroupName != "prometheusRuleGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'PrometheusRuleGroupName'", id.PrometheusRuleGroupName, "prometheusRuleGroupName") } } func TestFormatPrometheusRuleGroupID(t *testing.T) { - actual := NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName" + actual := NewPrometheusRuleGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "prometheusRuleGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/prometheusRuleGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrometheusRuleGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/prometheusRuleGroupName", Expected: &PrometheusRuleGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrometheusRuleGroupName: "ruleGroupName", + PrometheusRuleGroupName: "prometheusRuleGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/prometheusRuleGroupName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrometheusRuleGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/prometheusRuleGroupName", Expected: &PrometheusRuleGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrometheusRuleGroupName: "ruleGroupName", + PrometheusRuleGroupName: "prometheusRuleGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/ruleGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AlertsManagement/prometheusRuleGroups/prometheusRuleGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/pRoMeThEuSrUlEgRoUpS/rUlEgRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/pRoMeThEuSrUlEgRoUpS/pRoMeThEuSrUlEgRoUpNaMe", Expected: &PrometheusRuleGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrometheusRuleGroupName: "rUlEgRoUpNaMe", + PrometheusRuleGroupName: "pRoMeThEuSrUlEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/pRoMeThEuSrUlEgRoUpS/rUlEgRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aLeRtSmAnAgEmEnT/pRoMeThEuSrUlEgRoUpS/pRoMeThEuSrUlEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/analysisservices/2017-08-01/servers/README.md b/resource-manager/analysisservices/2017-08-01/servers/README.md index 6ef1168ef4d..9ef2d78a97d 100644 --- a/resource-manager/analysisservices/2017-08-01/servers/README.md +++ b/resource-manager/analysisservices/2017-08-01/servers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := servers.CheckServerNameAvailabilityParameters{ // ... diff --git a/resource-manager/analysisservices/2017-08-01/servers/id_location.go b/resource-manager/analysisservices/2017-08-01/servers/id_location.go index 0b63233bd85..e70c7106b74 100644 --- a/resource-manager/analysisservices/2017-08-01/servers/id_location.go +++ b/resource-manager/analysisservices/2017-08-01/servers/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAnalysisServices", "Microsoft.AnalysisServices", "Microsoft.AnalysisServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/analysisservices/2017-08-01/servers/id_location_test.go b/resource-manager/analysisservices/2017-08-01/servers/id_location_test.go index b6e0b1a0612..0597422f289 100644 --- a/resource-manager/analysisservices/2017-08-01/servers/id_location_test.go +++ b/resource-manager/analysisservices/2017-08-01/servers/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AnalysisServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aNaLySiSsErViCeS/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aNaLySiSsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aNaLySiSsErViCeS/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aNaLySiSsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/api/model_apicontractproperties.go b/resource-manager/apimanagement/2022-08-01/api/model_apicontractproperties.go index 642bf4735e2..f2a3268b1cd 100644 --- a/resource-manager/apimanagement/2022-08-01/api/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2022-08-01/api/model_apicontractproperties.go @@ -19,10 +19,10 @@ type ApiContractProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/api/model_apicontractupdateproperties.go b/resource-manager/apimanagement/2022-08-01/api/model_apicontractupdateproperties.go index fe0189ae882..40d76e9f414 100644 --- a/resource-manager/apimanagement/2022-08-01/api/model_apicontractupdateproperties.go +++ b/resource-manager/apimanagement/2022-08-01/api/model_apicontractupdateproperties.go @@ -18,9 +18,9 @@ type ApiContractUpdateProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/api/model_apicreateorupdateproperties.go b/resource-manager/apimanagement/2022-08-01/api/model_apicreateorupdateproperties.go index c5505b1bd80..deec3f9ee08 100644 --- a/resource-manager/apimanagement/2022-08-01/api/model_apicreateorupdateproperties.go +++ b/resource-manager/apimanagement/2022-08-01/api/model_apicreateorupdateproperties.go @@ -21,11 +21,11 @@ type ApiCreateOrUpdateProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` TranslateRequiredQueryParameters *TranslateRequiredQueryParametersConduct `json:"translateRequiredQueryParameters,omitempty"` Type *ApiType `json:"type,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/apimanagement/2022-08-01/apidiagnostic/constants.go b/resource-manager/apimanagement/2022-08-01/apidiagnostic/constants.go index 1afde676ffa..728fc412b28 100644 --- a/resource-manager/apimanagement/2022-08-01/apidiagnostic/constants.go +++ b/resource-manager/apimanagement/2022-08-01/apidiagnostic/constants.go @@ -136,13 +136,13 @@ type OperationNameFormat string const ( OperationNameFormatName OperationNameFormat = "Name" - OperationNameFormatUrl OperationNameFormat = "Url" + OperationNameFormatURL OperationNameFormat = "Url" ) func PossibleValuesForOperationNameFormat() []string { return []string{ string(OperationNameFormatName), - string(OperationNameFormatUrl), + string(OperationNameFormatURL), } } @@ -162,7 +162,7 @@ func (s *OperationNameFormat) UnmarshalJSON(bytes []byte) error { func parseOperationNameFormat(input string) (*OperationNameFormat, error) { vals := map[string]OperationNameFormat{ "name": OperationNameFormatName, - "url": OperationNameFormatUrl, + "url": OperationNameFormatURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_additionallocation.go b/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_additionallocation.go index 3283a7b8de1..713481d013f 100644 --- a/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_additionallocation.go +++ b/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_additionallocation.go @@ -9,7 +9,7 @@ import ( type AdditionalLocation struct { DisableGateway *bool `json:"disableGateway,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` Location string `json:"location"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` diff --git a/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_apimanagementserviceproperties.go b/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_apimanagementserviceproperties.go index 94fc6445376..b71b53afd11 100644 --- a/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_apimanagementserviceproperties.go +++ b/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_apimanagementserviceproperties.go @@ -15,18 +15,18 @@ type ApiManagementServiceProperties struct { Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` CreatedAtUtc *string `json:"createdAtUtc,omitempty"` CustomProperties *map[string]string `json:"customProperties,omitempty"` - DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"` + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` DisableGateway *bool `json:"disableGateway,omitempty"` EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` - GatewayUrl *string `json:"gatewayUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + GatewayURL *string `json:"gatewayUrl,omitempty"` HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` - ManagementApiUrl *string `json:"managementApiUrl,omitempty"` + ManagementApiURL *string `json:"managementApiUrl,omitempty"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` PlatformVersion *PlatformVersion `json:"platformVersion,omitempty"` - PortalUrl *string `json:"portalUrl,omitempty"` + PortalURL *string `json:"portalUrl,omitempty"` PrivateEndpointConnections *[]RemotePrivateEndpointConnectionWrapper `json:"privateEndpointConnections,omitempty"` PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -36,7 +36,7 @@ type ApiManagementServiceProperties struct { PublisherEmail string `json:"publisherEmail"` PublisherName string `json:"publisherName"` Restore *bool `json:"restore,omitempty"` - ScmUrl *string `json:"scmUrl,omitempty"` + ScmURL *string `json:"scmUrl,omitempty"` TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` VirtualNetworkType *VirtualNetworkType `json:"virtualNetworkType,omitempty"` diff --git a/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_apimanagementserviceupdateproperties.go b/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_apimanagementserviceupdateproperties.go index 17315556d2d..e23f20747ec 100644 --- a/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_apimanagementserviceupdateproperties.go +++ b/resource-manager/apimanagement/2022-08-01/apimanagementservice/model_apimanagementserviceupdateproperties.go @@ -15,18 +15,18 @@ type ApiManagementServiceUpdateProperties struct { Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` CreatedAtUtc *string `json:"createdAtUtc,omitempty"` CustomProperties *map[string]string `json:"customProperties,omitempty"` - DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"` + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` DisableGateway *bool `json:"disableGateway,omitempty"` EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` - GatewayUrl *string `json:"gatewayUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + GatewayURL *string `json:"gatewayUrl,omitempty"` HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` - ManagementApiUrl *string `json:"managementApiUrl,omitempty"` + ManagementApiURL *string `json:"managementApiUrl,omitempty"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` PlatformVersion *PlatformVersion `json:"platformVersion,omitempty"` - PortalUrl *string `json:"portalUrl,omitempty"` + PortalURL *string `json:"portalUrl,omitempty"` PrivateEndpointConnections *[]RemotePrivateEndpointConnectionWrapper `json:"privateEndpointConnections,omitempty"` PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -36,7 +36,7 @@ type ApiManagementServiceUpdateProperties struct { PublisherEmail *string `json:"publisherEmail,omitempty"` PublisherName *string `json:"publisherName,omitempty"` Restore *bool `json:"restore,omitempty"` - ScmUrl *string `json:"scmUrl,omitempty"` + ScmURL *string `json:"scmUrl,omitempty"` TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` VirtualNetworkType *VirtualNetworkType `json:"virtualNetworkType,omitempty"` diff --git a/resource-manager/apimanagement/2022-08-01/apioperationsbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2022-08-01/apioperationsbytag/model_apitagresourcecontractproperties.go index 29865d37c08..95eb4a2bed1 100644 --- a/resource-manager/apimanagement/2022-08-01/apioperationsbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2022-08-01/apioperationsbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/apirevision/model_apirevisioncontract.go b/resource-manager/apimanagement/2022-08-01/apirevision/model_apirevisioncontract.go index 3c366c0bef2..5a1d18799cc 100644 --- a/resource-manager/apimanagement/2022-08-01/apirevision/model_apirevisioncontract.go +++ b/resource-manager/apimanagement/2022-08-01/apirevision/model_apirevisioncontract.go @@ -16,7 +16,7 @@ type ApiRevisionContract struct { Description *string `json:"description,omitempty"` IsCurrent *bool `json:"isCurrent,omitempty"` IsOnline *bool `json:"isOnline,omitempty"` - PrivateUrl *string `json:"privateUrl,omitempty"` + PrivateURL *string `json:"privateUrl,omitempty"` UpdatedDateTime *string `json:"updatedDateTime,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/apirevision/predicates.go b/resource-manager/apimanagement/2022-08-01/apirevision/predicates.go index bd4911829a3..4f83cd3cb7b 100644 --- a/resource-manager/apimanagement/2022-08-01/apirevision/predicates.go +++ b/resource-manager/apimanagement/2022-08-01/apirevision/predicates.go @@ -10,7 +10,7 @@ type ApiRevisionContractOperationPredicate struct { Description *string IsCurrent *bool IsOnline *bool - PrivateUrl *string + PrivateURL *string UpdatedDateTime *string } @@ -40,7 +40,7 @@ func (p ApiRevisionContractOperationPredicate) Matches(input ApiRevisionContract return false } - if p.PrivateUrl != nil && (input.PrivateUrl == nil || *p.PrivateUrl != *input.PrivateUrl) { + if p.PrivateURL != nil && (input.PrivateURL == nil || *p.PrivateURL != *input.PrivateURL) { return false } diff --git a/resource-manager/apimanagement/2022-08-01/apisbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2022-08-01/apisbytag/model_apitagresourcecontractproperties.go index 33076efa3d1..18046859f0c 100644 --- a/resource-manager/apimanagement/2022-08-01/apisbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2022-08-01/apisbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/apitagdescription/model_tagdescriptionbaseproperties.go b/resource-manager/apimanagement/2022-08-01/apitagdescription/model_tagdescriptionbaseproperties.go index cb5c534f1af..06bd84a2665 100644 --- a/resource-manager/apimanagement/2022-08-01/apitagdescription/model_tagdescriptionbaseproperties.go +++ b/resource-manager/apimanagement/2022-08-01/apitagdescription/model_tagdescriptionbaseproperties.go @@ -6,5 +6,5 @@ package apitagdescription type TagDescriptionBaseProperties struct { Description *string `json:"description,omitempty"` ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` - ExternalDocsUrl *string `json:"externalDocsUrl,omitempty"` + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/apitagdescription/model_tagdescriptioncontractproperties.go b/resource-manager/apimanagement/2022-08-01/apitagdescription/model_tagdescriptioncontractproperties.go index 071eefae7d3..e3261d6e864 100644 --- a/resource-manager/apimanagement/2022-08-01/apitagdescription/model_tagdescriptioncontractproperties.go +++ b/resource-manager/apimanagement/2022-08-01/apitagdescription/model_tagdescriptioncontractproperties.go @@ -7,6 +7,6 @@ type TagDescriptionContractProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` - ExternalDocsUrl *string `json:"externalDocsUrl,omitempty"` + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` TagId *string `json:"tagId,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/authorizationloginlinks/model_authorizationloginrequestcontract.go b/resource-manager/apimanagement/2022-08-01/authorizationloginlinks/model_authorizationloginrequestcontract.go index e324153247b..cb17aba4abd 100644 --- a/resource-manager/apimanagement/2022-08-01/authorizationloginlinks/model_authorizationloginrequestcontract.go +++ b/resource-manager/apimanagement/2022-08-01/authorizationloginlinks/model_authorizationloginrequestcontract.go @@ -4,5 +4,5 @@ package authorizationloginlinks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AuthorizationLoginRequestContract struct { - PostLoginRedirectUrl *string `json:"postLoginRedirectUrl,omitempty"` + PostLoginRedirectURL *string `json:"postLoginRedirectUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/authorizationprovider/model_authorizationprovideroauth2settings.go b/resource-manager/apimanagement/2022-08-01/authorizationprovider/model_authorizationprovideroauth2settings.go index cfcb9d0c4c2..3ff39bd7622 100644 --- a/resource-manager/apimanagement/2022-08-01/authorizationprovider/model_authorizationprovideroauth2settings.go +++ b/resource-manager/apimanagement/2022-08-01/authorizationprovider/model_authorizationprovideroauth2settings.go @@ -5,5 +5,5 @@ package authorizationprovider type AuthorizationProviderOAuth2Settings struct { GrantTypes *AuthorizationProviderOAuth2GrantTypes `json:"grantTypes,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/authorizationserver/README.md b/resource-manager/apimanagement/2022-08-01/authorizationserver/README.md index 4288d6e3cef..d7b822e3e57 100644 --- a/resource-manager/apimanagement/2022-08-01/authorizationserver/README.md +++ b/resource-manager/apimanagement/2022-08-01/authorizationserver/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") payload := authorizationserver.AuthorizationServerContract{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.Delete(ctx, id, authorizationserver.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") payload := authorizationserver.AuthorizationServerUpdateContract{ // ... diff --git a/resource-manager/apimanagement/2022-08-01/authorizationserver/id_authorizationserver.go b/resource-manager/apimanagement/2022-08-01/authorizationserver/id_authorizationserver.go index f01fa1c02ff..abdc7ef410a 100644 --- a/resource-manager/apimanagement/2022-08-01/authorizationserver/id_authorizationserver.go +++ b/resource-manager/apimanagement/2022-08-01/authorizationserver/id_authorizationserver.go @@ -123,7 +123,7 @@ func (id AuthorizationServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticAuthorizationServers", "authorizationServers", "authorizationServers"), - resourceids.UserSpecifiedSegment("authorizationServerName", "authsid"), + resourceids.UserSpecifiedSegment("authorizationServerName", "authorizationServerName"), } } diff --git a/resource-manager/apimanagement/2022-08-01/authorizationserver/id_authorizationserver_test.go b/resource-manager/apimanagement/2022-08-01/authorizationserver/id_authorizationserver_test.go index 5dabd493731..8df88eb6384 100644 --- a/resource-manager/apimanagement/2022-08-01/authorizationserver/id_authorizationserver_test.go +++ b/resource-manager/apimanagement/2022-08-01/authorizationserver/id_authorizationserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthorizationServerId{} func TestNewAuthorizationServerID(t *testing.T) { - id := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") + id := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAuthorizationServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.AuthorizationServerName != "authsid" { - t.Fatalf("Expected %q but got %q for Segment 'AuthorizationServerName'", id.AuthorizationServerName, "authsid") + if id.AuthorizationServerName != "authorizationServerName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthorizationServerName'", id.AuthorizationServerName, "authorizationServerName") } } func TestFormatAuthorizationServerID(t *testing.T) { - actual := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid" + actual := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAuthorizationServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - AuthorizationServerName: "authsid", + AuthorizationServerName: "authorizationServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAuthorizationServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - AuthorizationServerName: "authsid", + AuthorizationServerName: "authorizationServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHoRiZaTiOnSeRvErNaMe", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - AuthorizationServerName: "aUtHsId", + AuthorizationServerName: "aUtHoRiZaTiOnSeRvErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHoRiZaTiOnSeRvErNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/deletedservice/README.md b/resource-manager/apimanagement/2022-08-01/deletedservice/README.md index 479f5750e14..eff1bde3d81 100644 --- a/resource-manager/apimanagement/2022-08-01/deletedservice/README.md +++ b/resource-manager/apimanagement/2022-08-01/deletedservice/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") +id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") read, err := client.GetByName(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") +id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/apimanagement/2022-08-01/deletedservice/id_deletedservice.go b/resource-manager/apimanagement/2022-08-01/deletedservice/id_deletedservice.go index 263d09e3295..7d68c8e679a 100644 --- a/resource-manager/apimanagement/2022-08-01/deletedservice/id_deletedservice.go +++ b/resource-manager/apimanagement/2022-08-01/deletedservice/id_deletedservice.go @@ -113,9 +113,9 @@ func (id DeletedServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApiManagement", "Microsoft.ApiManagement", "Microsoft.ApiManagement"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedServices", "deletedServices", "deletedServices"), - resourceids.UserSpecifiedSegment("deletedServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("deletedServiceName", "deletedServiceName"), } } diff --git a/resource-manager/apimanagement/2022-08-01/deletedservice/id_deletedservice_test.go b/resource-manager/apimanagement/2022-08-01/deletedservice/id_deletedservice_test.go index f46fc3bb0b0..346ce344f6e 100644 --- a/resource-manager/apimanagement/2022-08-01/deletedservice/id_deletedservice_test.go +++ b/resource-manager/apimanagement/2022-08-01/deletedservice/id_deletedservice_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedServiceId{} func TestNewDeletedServiceID(t *testing.T) { - id := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") + id := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedServiceName'", id.DeletedServiceName, "serviceName") + if id.DeletedServiceName != "deletedServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedServiceName'", id.DeletedServiceName, "deletedServiceName") } } func TestFormatDeletedServiceID(t *testing.T) { - actual := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName" + actual := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedServiceName: "serviceName", + LocationName: "locationName", + DeletedServiceName: "deletedServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedServiceName: "serviceName", + LocationName: "locationName", + DeletedServiceName: "deletedServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs/dElEtEdSeRvIcEnAmE", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedServiceName: "sErViCeNaMe", + LocationName: "lOcAtIoNnAmE", + DeletedServiceName: "dElEtEdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs/dElEtEdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/diagnostic/constants.go b/resource-manager/apimanagement/2022-08-01/diagnostic/constants.go index cde4ab74afa..200c1a288a2 100644 --- a/resource-manager/apimanagement/2022-08-01/diagnostic/constants.go +++ b/resource-manager/apimanagement/2022-08-01/diagnostic/constants.go @@ -136,13 +136,13 @@ type OperationNameFormat string const ( OperationNameFormatName OperationNameFormat = "Name" - OperationNameFormatUrl OperationNameFormat = "Url" + OperationNameFormatURL OperationNameFormat = "Url" ) func PossibleValuesForOperationNameFormat() []string { return []string{ string(OperationNameFormatName), - string(OperationNameFormatUrl), + string(OperationNameFormatURL), } } @@ -162,7 +162,7 @@ func (s *OperationNameFormat) UnmarshalJSON(bytes []byte) error { func parseOperationNameFormat(input string) (*OperationNameFormat, error) { vals := map[string]OperationNameFormat{ "name": OperationNameFormatName, - "url": OperationNameFormatUrl, + "url": OperationNameFormatURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/apimanagement/2022-08-01/gatewayapi/model_apicontractproperties.go b/resource-manager/apimanagement/2022-08-01/gatewayapi/model_apicontractproperties.go index b6730933ec8..042f0f83a91 100644 --- a/resource-manager/apimanagement/2022-08-01/gatewayapi/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2022-08-01/gatewayapi/model_apicontractproperties.go @@ -19,10 +19,10 @@ type ApiContractProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/README.md b/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/README.md index 443c7d75460..ce9135efd4f 100644 --- a/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/README.md +++ b/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.CheckEntityExists(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.CreateOrUpdate(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.Delete(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/id_recipientemail.go b/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/id_recipientemail.go index 3601ab09ace..49db7ac5e85 100644 --- a/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/id_recipientemail.go +++ b/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/id_recipientemail.go @@ -139,7 +139,7 @@ func (id RecipientEmailId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNotifications", "notifications", "notifications"), resourceids.ConstantSegment("notificationName", PossibleValuesForNotificationName(), "AccountClosedPublisher"), resourceids.StaticSegment("staticRecipientEmails", "recipientEmails", "recipientEmails"), - resourceids.UserSpecifiedSegment("recipientEmailName", "email"), + resourceids.UserSpecifiedSegment("recipientEmailName", "recipientEmailName"), } } diff --git a/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/id_recipientemail_test.go b/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/id_recipientemail_test.go index 280f1ecd10d..a6d3a3a8b6b 100644 --- a/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/id_recipientemail_test.go +++ b/resource-manager/apimanagement/2022-08-01/notificationrecipientemail/id_recipientemail_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecipientEmailId{} func TestNewRecipientEmailID(t *testing.T) { - id := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") + id := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRecipientEmailID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NotificationName'", id.NotificationName, "AccountClosedPublisher") } - if id.RecipientEmailName != "email" { - t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "email") + if id.RecipientEmailName != "recipientEmailName" { + t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "recipientEmailName") } } func TestFormatRecipientEmailID(t *testing.T) { - actual := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email" + actual := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseRecipientEmailID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseRecipientEmailIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "eMaIl", + RecipientEmailName: "rEcIpIeNtEmAiLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/openidconnectprovider/README.md b/resource-manager/apimanagement/2022-08-01/openidconnectprovider/README.md index 6e198507d4b..feb0dd3f307 100644 --- a/resource-manager/apimanagement/2022-08-01/openidconnectprovider/README.md +++ b/resource-manager/apimanagement/2022-08-01/openidconnectprovider/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") payload := openidconnectprovider.OpenidConnectProviderContract{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.Delete(ctx, id, openidconnectprovider.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") payload := openidconnectprovider.OpenidConnectProviderUpdateContract{ // ... diff --git a/resource-manager/apimanagement/2022-08-01/openidconnectprovider/id_openidconnectprovider.go b/resource-manager/apimanagement/2022-08-01/openidconnectprovider/id_openidconnectprovider.go index 953e1cc9055..825b3b54bbb 100644 --- a/resource-manager/apimanagement/2022-08-01/openidconnectprovider/id_openidconnectprovider.go +++ b/resource-manager/apimanagement/2022-08-01/openidconnectprovider/id_openidconnectprovider.go @@ -123,7 +123,7 @@ func (id OpenidConnectProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticOpenidConnectProviders", "openidConnectProviders", "openidConnectProviders"), - resourceids.UserSpecifiedSegment("openidConnectProviderName", "opid"), + resourceids.UserSpecifiedSegment("openidConnectProviderName", "openidConnectProviderName"), } } diff --git a/resource-manager/apimanagement/2022-08-01/openidconnectprovider/id_openidconnectprovider_test.go b/resource-manager/apimanagement/2022-08-01/openidconnectprovider/id_openidconnectprovider_test.go index fc41dc570ee..872dce4a46f 100644 --- a/resource-manager/apimanagement/2022-08-01/openidconnectprovider/id_openidconnectprovider_test.go +++ b/resource-manager/apimanagement/2022-08-01/openidconnectprovider/id_openidconnectprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenidConnectProviderId{} func TestNewOpenidConnectProviderID(t *testing.T) { - id := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") + id := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOpenidConnectProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.OpenidConnectProviderName != "opid" { - t.Fatalf("Expected %q but got %q for Segment 'OpenidConnectProviderName'", id.OpenidConnectProviderName, "opid") + if id.OpenidConnectProviderName != "openidConnectProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenidConnectProviderName'", id.OpenidConnectProviderName, "openidConnectProviderName") } } func TestFormatOpenidConnectProviderID(t *testing.T) { - actual := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid" + actual := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOpenidConnectProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - OpenidConnectProviderName: "opid", + OpenidConnectProviderName: "openidConnectProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOpenidConnectProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - OpenidConnectProviderName: "opid", + OpenidConnectProviderName: "openidConnectProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPeNiDcOnNeCtPrOvIdErNaMe", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - OpenidConnectProviderName: "oPiD", + OpenidConnectProviderName: "oPeNiDcOnNeCtPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPeNiDcOnNeCtPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/policyfragment/README.md b/resource-manager/apimanagement/2022-08-01/policyfragment/README.md index b73078f2d35..69c24126c38 100644 --- a/resource-manager/apimanagement/2022-08-01/policyfragment/README.md +++ b/resource-manager/apimanagement/2022-08-01/policyfragment/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") payload := policyfragment.PolicyFragmentContract{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, policyfragment.Default ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.Delete(ctx, id, policyfragment.DefaultDeleteOperationOptions()) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.Get(ctx, id, policyfragment.DefaultGetOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") // alternatively `client.ListReferences(ctx, id, policyfragment.DefaultListReferencesOperationOptions())` can be used to do batched pagination items, err := client.ListReferencesComplete(ctx, id, policyfragment.DefaultListReferencesOperationOptions()) diff --git a/resource-manager/apimanagement/2022-08-01/policyfragment/id_policyfragment.go b/resource-manager/apimanagement/2022-08-01/policyfragment/id_policyfragment.go index 52c258c9e81..5c3e062af19 100644 --- a/resource-manager/apimanagement/2022-08-01/policyfragment/id_policyfragment.go +++ b/resource-manager/apimanagement/2022-08-01/policyfragment/id_policyfragment.go @@ -123,7 +123,7 @@ func (id PolicyFragmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPolicyFragments", "policyFragments", "policyFragments"), - resourceids.UserSpecifiedSegment("policyFragmentName", "id"), + resourceids.UserSpecifiedSegment("policyFragmentName", "policyFragmentName"), } } diff --git a/resource-manager/apimanagement/2022-08-01/policyfragment/id_policyfragment_test.go b/resource-manager/apimanagement/2022-08-01/policyfragment/id_policyfragment_test.go index 97a99d4ee04..ac2a6a9e415 100644 --- a/resource-manager/apimanagement/2022-08-01/policyfragment/id_policyfragment_test.go +++ b/resource-manager/apimanagement/2022-08-01/policyfragment/id_policyfragment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PolicyFragmentId{} func TestNewPolicyFragmentID(t *testing.T) { - id := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") + id := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPolicyFragmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PolicyFragmentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "id") + if id.PolicyFragmentName != "policyFragmentName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "policyFragmentName") } } func TestFormatPolicyFragmentID(t *testing.T) { - actual := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id" + actual := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePolicyFragmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePolicyFragmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - PolicyFragmentName: "iD", + PolicyFragmentName: "pOlIcYfRaGmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/portalconfig/model_portalconfigdelegationproperties.go b/resource-manager/apimanagement/2022-08-01/portalconfig/model_portalconfigdelegationproperties.go index 3d2fa8ed0b6..625bb0da1f5 100644 --- a/resource-manager/apimanagement/2022-08-01/portalconfig/model_portalconfigdelegationproperties.go +++ b/resource-manager/apimanagement/2022-08-01/portalconfig/model_portalconfigdelegationproperties.go @@ -6,6 +6,6 @@ package portalconfig type PortalConfigDelegationProperties struct { DelegateRegistration *bool `json:"delegateRegistration,omitempty"` DelegateSubscription *bool `json:"delegateSubscription,omitempty"` - DelegationUrl *string `json:"delegationUrl,omitempty"` + DelegationURL *string `json:"delegationUrl,omitempty"` ValidationKey *string `json:"validationKey,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/privateendpointconnections/README.md b/resource-manager/apimanagement/2022-08-01/privateendpointconnections/README.md index e5f4b083e2a..3a6222d5f74 100644 --- a/resource-manager/apimanagement/2022-08-01/privateendpointconnections/README.md +++ b/resource-manager/apimanagement/2022-08-01/privateendpointconnections/README.md @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName") +id := privateendpointconnections.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.PrivateEndpointConnectionGetPrivateLinkResource(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2022-08-01/privateendpointconnections/id_privatelinkresource.go b/resource-manager/apimanagement/2022-08-01/privateendpointconnections/id_privatelinkresource.go index 4a1c82d0b48..964e0869832 100644 --- a/resource-manager/apimanagement/2022-08-01/privateendpointconnections/id_privatelinkresource.go +++ b/resource-manager/apimanagement/2022-08-01/privateendpointconnections/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkSubResourceName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/apimanagement/2022-08-01/privateendpointconnections/id_privatelinkresource_test.go b/resource-manager/apimanagement/2022-08-01/privateendpointconnections/id_privatelinkresource_test.go index bc466d49545..0df9bb10d6f 100644 --- a/resource-manager/apimanagement/2022-08-01/privateendpointconnections/id_privatelinkresource_test.go +++ b/resource-manager/apimanagement/2022-08-01/privateendpointconnections/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "privateLinkSubResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkSubResourceName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PrivateLinkResourceName: "privateLinkSubResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PrivateLinkResourceName: "privateLinkSubResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkSuBrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - PrivateLinkResourceName: "pRiVaTeLiNkSuBrEsOuRcEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkSuBrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/productapi/model_apicontractproperties.go b/resource-manager/apimanagement/2022-08-01/productapi/model_apicontractproperties.go index af49c49c945..788eb024f97 100644 --- a/resource-manager/apimanagement/2022-08-01/productapi/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2022-08-01/productapi/model_apicontractproperties.go @@ -19,10 +19,10 @@ type ApiContractProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/productsbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2022-08-01/productsbytag/model_apitagresourcecontractproperties.go index 5b6004615a2..3f71e4a2d31 100644 --- a/resource-manager/apimanagement/2022-08-01/productsbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2022-08-01/productsbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/subscription/README.md b/resource-manager/apimanagement/2022-08-01/subscription/README.md index 2fee6a7fc04..d8479a6e148 100644 --- a/resource-manager/apimanagement/2022-08-01/subscription/README.md +++ b/resource-manager/apimanagement/2022-08-01/subscription/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") payload := subscription.SubscriptionCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.Delete(ctx, id, subscription.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.RegeneratePrimaryKey(ctx, id) if err != nil { @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.RegenerateSecondaryKey(ctx, id) if err != nil { @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") payload := subscription.SubscriptionUpdateParameters{ // ... @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid") +id := subscription.NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName") read, err := client.UserSubscriptionGet(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2022-08-01/subscription/id_subscriptions2.go b/resource-manager/apimanagement/2022-08-01/subscription/id_subscriptions2.go index a0f82191a95..dc35783e6da 100644 --- a/resource-manager/apimanagement/2022-08-01/subscription/id_subscriptions2.go +++ b/resource-manager/apimanagement/2022-08-01/subscription/id_subscriptions2.go @@ -123,7 +123,7 @@ func (id Subscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2022-08-01/subscription/id_subscriptions2_test.go b/resource-manager/apimanagement/2022-08-01/subscription/id_subscriptions2_test.go index 16b9320bc0f..0b5f8ad522c 100644 --- a/resource-manager/apimanagement/2022-08-01/subscription/id_subscriptions2_test.go +++ b/resource-manager/apimanagement/2022-08-01/subscription/id_subscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Subscriptions2Id{} func TestNewSubscriptions2ID(t *testing.T) { - id := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") + id := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatSubscriptions2ID(t *testing.T) { - actual := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid" + actual := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/subscription/id_usersubscriptions2.go b/resource-manager/apimanagement/2022-08-01/subscription/id_usersubscriptions2.go index 3a5d835af6a..043845b67ba 100644 --- a/resource-manager/apimanagement/2022-08-01/subscription/id_usersubscriptions2.go +++ b/resource-manager/apimanagement/2022-08-01/subscription/id_usersubscriptions2.go @@ -131,7 +131,7 @@ func (id UserSubscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userId", "userId"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2022-08-01/subscription/id_usersubscriptions2_test.go b/resource-manager/apimanagement/2022-08-01/subscription/id_usersubscriptions2_test.go index 5b7705f22d5..783e8fa0bdb 100644 --- a/resource-manager/apimanagement/2022-08-01/subscription/id_usersubscriptions2_test.go +++ b/resource-manager/apimanagement/2022-08-01/subscription/id_usersubscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserSubscriptions2Id{} func TestNewUserSubscriptions2ID(t *testing.T) { - id := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid") + id := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewUserSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserId'", id.UserId, "userId") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatUserSubscriptions2ID(t *testing.T) { - actual := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid" + actual := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseUserSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", UserId: "userId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseUserSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", UserId: "userId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", UserId: "uSeRiD", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2022-08-01/tagresource/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2022-08-01/tagresource/model_apitagresourcecontractproperties.go index a64045d1ae4..1866cde6007 100644 --- a/resource-manager/apimanagement/2022-08-01/tagresource/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2022-08-01/tagresource/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2022-08-01/users/README.md b/resource-manager/apimanagement/2022-08-01/users/README.md index c1f962b1d7a..6c7ffd32c4b 100644 --- a/resource-manager/apimanagement/2022-08-01/users/README.md +++ b/resource-manager/apimanagement/2022-08-01/users/README.md @@ -20,13 +20,13 @@ client.Client.Authorizer = authorizer ``` -### Example Usage: `UsersClient.UserGenerateSsoUrl` +### Example Usage: `UsersClient.UserGenerateSsoURL` ```go ctx := context.TODO() id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId") -read, err := client.UserGenerateSsoUrl(ctx, id) +read, err := client.UserGenerateSsoURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/apimanagement/2022-08-01/users/method_usergeneratessourl.go b/resource-manager/apimanagement/2022-08-01/users/method_usergeneratessourl.go index bab32e3f071..211e849804c 100644 --- a/resource-manager/apimanagement/2022-08-01/users/method_usergeneratessourl.go +++ b/resource-manager/apimanagement/2022-08-01/users/method_usergeneratessourl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UserGenerateSsoUrlOperationResponse struct { +type UserGenerateSsoURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *GenerateSsoUrlResult + Model *GenerateSsoURLResult } -// UserGenerateSsoUrl ... -func (c UsersClient) UserGenerateSsoUrl(ctx context.Context, id UserId) (result UserGenerateSsoUrlOperationResponse, err error) { +// UserGenerateSsoURL ... +func (c UsersClient) UserGenerateSsoURL(ctx context.Context, id UserId) (result UserGenerateSsoURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c UsersClient) UserGenerateSsoUrl(ctx context.Context, id UserId) (result return } - var model GenerateSsoUrlResult + var model GenerateSsoURLResult result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/apimanagement/2022-08-01/users/model_generatessourlresult.go b/resource-manager/apimanagement/2022-08-01/users/model_generatessourlresult.go index f78768f2f31..6a9b6202d10 100644 --- a/resource-manager/apimanagement/2022-08-01/users/model_generatessourlresult.go +++ b/resource-manager/apimanagement/2022-08-01/users/model_generatessourlresult.go @@ -3,6 +3,6 @@ package users // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GenerateSsoUrlResult struct { +type GenerateSsoURLResult struct { Value *string `json:"value,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/api/model_apicontractproperties.go b/resource-manager/apimanagement/2023-03-01-preview/api/model_apicontractproperties.go index 642bf4735e2..f2a3268b1cd 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/api/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/api/model_apicontractproperties.go @@ -19,10 +19,10 @@ type ApiContractProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/api/model_apicontractupdateproperties.go b/resource-manager/apimanagement/2023-03-01-preview/api/model_apicontractupdateproperties.go index fe0189ae882..40d76e9f414 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/api/model_apicontractupdateproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/api/model_apicontractupdateproperties.go @@ -18,9 +18,9 @@ type ApiContractUpdateProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/api/model_apicreateorupdateproperties.go b/resource-manager/apimanagement/2023-03-01-preview/api/model_apicreateorupdateproperties.go index c5505b1bd80..deec3f9ee08 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/api/model_apicreateorupdateproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/api/model_apicreateorupdateproperties.go @@ -21,11 +21,11 @@ type ApiCreateOrUpdateProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` TranslateRequiredQueryParameters *TranslateRequiredQueryParametersConduct `json:"translateRequiredQueryParameters,omitempty"` Type *ApiType `json:"type,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/apimanagement/2023-03-01-preview/apidiagnostic/constants.go b/resource-manager/apimanagement/2023-03-01-preview/apidiagnostic/constants.go index 1afde676ffa..728fc412b28 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apidiagnostic/constants.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apidiagnostic/constants.go @@ -136,13 +136,13 @@ type OperationNameFormat string const ( OperationNameFormatName OperationNameFormat = "Name" - OperationNameFormatUrl OperationNameFormat = "Url" + OperationNameFormatURL OperationNameFormat = "Url" ) func PossibleValuesForOperationNameFormat() []string { return []string{ string(OperationNameFormatName), - string(OperationNameFormatUrl), + string(OperationNameFormatURL), } } @@ -162,7 +162,7 @@ func (s *OperationNameFormat) UnmarshalJSON(bytes []byte) error { func parseOperationNameFormat(input string) (*OperationNameFormat, error) { vals := map[string]OperationNameFormat{ "name": OperationNameFormatName, - "url": OperationNameFormatUrl, + "url": OperationNameFormatURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_additionallocation.go b/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_additionallocation.go index 3283a7b8de1..713481d013f 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_additionallocation.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_additionallocation.go @@ -9,7 +9,7 @@ import ( type AdditionalLocation struct { DisableGateway *bool `json:"disableGateway,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` Location string `json:"location"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` diff --git a/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_apimanagementserviceproperties.go b/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_apimanagementserviceproperties.go index a1901e05e4f..ef66688bf0f 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_apimanagementserviceproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_apimanagementserviceproperties.go @@ -17,19 +17,19 @@ type ApiManagementServiceProperties struct { CreatedAtUtc *string `json:"createdAtUtc,omitempty"` CustomProperties *map[string]string `json:"customProperties,omitempty"` DeveloperPortalStatus *DeveloperPortalStatus `json:"developerPortalStatus,omitempty"` - DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"` + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` DisableGateway *bool `json:"disableGateway,omitempty"` EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` - GatewayUrl *string `json:"gatewayUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + GatewayURL *string `json:"gatewayUrl,omitempty"` HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` LegacyPortalStatus *LegacyPortalStatus `json:"legacyPortalStatus,omitempty"` - ManagementApiUrl *string `json:"managementApiUrl,omitempty"` + ManagementApiURL *string `json:"managementApiUrl,omitempty"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` PlatformVersion *PlatformVersion `json:"platformVersion,omitempty"` - PortalUrl *string `json:"portalUrl,omitempty"` + PortalURL *string `json:"portalUrl,omitempty"` PrivateEndpointConnections *[]RemotePrivateEndpointConnectionWrapper `json:"privateEndpointConnections,omitempty"` PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -39,7 +39,7 @@ type ApiManagementServiceProperties struct { PublisherEmail string `json:"publisherEmail"` PublisherName string `json:"publisherName"` Restore *bool `json:"restore,omitempty"` - ScmUrl *string `json:"scmUrl,omitempty"` + ScmURL *string `json:"scmUrl,omitempty"` TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` VirtualNetworkType *VirtualNetworkType `json:"virtualNetworkType,omitempty"` diff --git a/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_apimanagementserviceupdateproperties.go b/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_apimanagementserviceupdateproperties.go index 198f9bd1343..8bd32692ae7 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_apimanagementserviceupdateproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apimanagementservice/model_apimanagementserviceupdateproperties.go @@ -17,19 +17,19 @@ type ApiManagementServiceUpdateProperties struct { CreatedAtUtc *string `json:"createdAtUtc,omitempty"` CustomProperties *map[string]string `json:"customProperties,omitempty"` DeveloperPortalStatus *DeveloperPortalStatus `json:"developerPortalStatus,omitempty"` - DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"` + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` DisableGateway *bool `json:"disableGateway,omitempty"` EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` - GatewayUrl *string `json:"gatewayUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + GatewayURL *string `json:"gatewayUrl,omitempty"` HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` LegacyPortalStatus *LegacyPortalStatus `json:"legacyPortalStatus,omitempty"` - ManagementApiUrl *string `json:"managementApiUrl,omitempty"` + ManagementApiURL *string `json:"managementApiUrl,omitempty"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` PlatformVersion *PlatformVersion `json:"platformVersion,omitempty"` - PortalUrl *string `json:"portalUrl,omitempty"` + PortalURL *string `json:"portalUrl,omitempty"` PrivateEndpointConnections *[]RemotePrivateEndpointConnectionWrapper `json:"privateEndpointConnections,omitempty"` PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -39,7 +39,7 @@ type ApiManagementServiceUpdateProperties struct { PublisherEmail *string `json:"publisherEmail,omitempty"` PublisherName *string `json:"publisherName,omitempty"` Restore *bool `json:"restore,omitempty"` - ScmUrl *string `json:"scmUrl,omitempty"` + ScmURL *string `json:"scmUrl,omitempty"` TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` VirtualNetworkType *VirtualNetworkType `json:"virtualNetworkType,omitempty"` diff --git a/resource-manager/apimanagement/2023-03-01-preview/apioperationsbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2023-03-01-preview/apioperationsbytag/model_apitagresourcecontractproperties.go index 29865d37c08..95eb4a2bed1 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apioperationsbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apioperationsbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/apirevision/model_apirevisioncontract.go b/resource-manager/apimanagement/2023-03-01-preview/apirevision/model_apirevisioncontract.go index 3c366c0bef2..5a1d18799cc 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apirevision/model_apirevisioncontract.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apirevision/model_apirevisioncontract.go @@ -16,7 +16,7 @@ type ApiRevisionContract struct { Description *string `json:"description,omitempty"` IsCurrent *bool `json:"isCurrent,omitempty"` IsOnline *bool `json:"isOnline,omitempty"` - PrivateUrl *string `json:"privateUrl,omitempty"` + PrivateURL *string `json:"privateUrl,omitempty"` UpdatedDateTime *string `json:"updatedDateTime,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/apirevision/predicates.go b/resource-manager/apimanagement/2023-03-01-preview/apirevision/predicates.go index bd4911829a3..4f83cd3cb7b 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apirevision/predicates.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apirevision/predicates.go @@ -10,7 +10,7 @@ type ApiRevisionContractOperationPredicate struct { Description *string IsCurrent *bool IsOnline *bool - PrivateUrl *string + PrivateURL *string UpdatedDateTime *string } @@ -40,7 +40,7 @@ func (p ApiRevisionContractOperationPredicate) Matches(input ApiRevisionContract return false } - if p.PrivateUrl != nil && (input.PrivateUrl == nil || *p.PrivateUrl != *input.PrivateUrl) { + if p.PrivateURL != nil && (input.PrivateURL == nil || *p.PrivateURL != *input.PrivateURL) { return false } diff --git a/resource-manager/apimanagement/2023-03-01-preview/apisbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2023-03-01-preview/apisbytag/model_apitagresourcecontractproperties.go index 33076efa3d1..18046859f0c 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apisbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apisbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/apitagdescription/model_tagdescriptionbaseproperties.go b/resource-manager/apimanagement/2023-03-01-preview/apitagdescription/model_tagdescriptionbaseproperties.go index cb5c534f1af..06bd84a2665 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apitagdescription/model_tagdescriptionbaseproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apitagdescription/model_tagdescriptionbaseproperties.go @@ -6,5 +6,5 @@ package apitagdescription type TagDescriptionBaseProperties struct { Description *string `json:"description,omitempty"` ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` - ExternalDocsUrl *string `json:"externalDocsUrl,omitempty"` + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/apitagdescription/model_tagdescriptioncontractproperties.go b/resource-manager/apimanagement/2023-03-01-preview/apitagdescription/model_tagdescriptioncontractproperties.go index 071eefae7d3..e3261d6e864 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/apitagdescription/model_tagdescriptioncontractproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/apitagdescription/model_tagdescriptioncontractproperties.go @@ -7,6 +7,6 @@ type TagDescriptionContractProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` - ExternalDocsUrl *string `json:"externalDocsUrl,omitempty"` + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` TagId *string `json:"tagId,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/authorizationloginlinks/model_authorizationloginrequestcontract.go b/resource-manager/apimanagement/2023-03-01-preview/authorizationloginlinks/model_authorizationloginrequestcontract.go index e324153247b..cb17aba4abd 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/authorizationloginlinks/model_authorizationloginrequestcontract.go +++ b/resource-manager/apimanagement/2023-03-01-preview/authorizationloginlinks/model_authorizationloginrequestcontract.go @@ -4,5 +4,5 @@ package authorizationloginlinks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AuthorizationLoginRequestContract struct { - PostLoginRedirectUrl *string `json:"postLoginRedirectUrl,omitempty"` + PostLoginRedirectURL *string `json:"postLoginRedirectUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/authorizationprovider/model_authorizationprovideroauth2settings.go b/resource-manager/apimanagement/2023-03-01-preview/authorizationprovider/model_authorizationprovideroauth2settings.go index cfcb9d0c4c2..3ff39bd7622 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/authorizationprovider/model_authorizationprovideroauth2settings.go +++ b/resource-manager/apimanagement/2023-03-01-preview/authorizationprovider/model_authorizationprovideroauth2settings.go @@ -5,5 +5,5 @@ package authorizationprovider type AuthorizationProviderOAuth2Settings struct { GrantTypes *AuthorizationProviderOAuth2GrantTypes `json:"grantTypes,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/README.md b/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/README.md index 6a9f0437207..f566a455382 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/README.md +++ b/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") payload := authorizationserver.AuthorizationServerContract{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.Delete(ctx, id, authorizationserver.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") payload := authorizationserver.AuthorizationServerUpdateContract{ // ... diff --git a/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/id_authorizationserver.go b/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/id_authorizationserver.go index f01fa1c02ff..abdc7ef410a 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/id_authorizationserver.go +++ b/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/id_authorizationserver.go @@ -123,7 +123,7 @@ func (id AuthorizationServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticAuthorizationServers", "authorizationServers", "authorizationServers"), - resourceids.UserSpecifiedSegment("authorizationServerName", "authsid"), + resourceids.UserSpecifiedSegment("authorizationServerName", "authorizationServerName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/id_authorizationserver_test.go b/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/id_authorizationserver_test.go index 5dabd493731..8df88eb6384 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/id_authorizationserver_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/authorizationserver/id_authorizationserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthorizationServerId{} func TestNewAuthorizationServerID(t *testing.T) { - id := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") + id := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAuthorizationServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.AuthorizationServerName != "authsid" { - t.Fatalf("Expected %q but got %q for Segment 'AuthorizationServerName'", id.AuthorizationServerName, "authsid") + if id.AuthorizationServerName != "authorizationServerName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthorizationServerName'", id.AuthorizationServerName, "authorizationServerName") } } func TestFormatAuthorizationServerID(t *testing.T) { - actual := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid" + actual := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAuthorizationServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - AuthorizationServerName: "authsid", + AuthorizationServerName: "authorizationServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAuthorizationServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - AuthorizationServerName: "authsid", + AuthorizationServerName: "authorizationServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHoRiZaTiOnSeRvErNaMe", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - AuthorizationServerName: "aUtHsId", + AuthorizationServerName: "aUtHoRiZaTiOnSeRvErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHoRiZaTiOnSeRvErNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/deletedservice/README.md b/resource-manager/apimanagement/2023-03-01-preview/deletedservice/README.md index 1ecc49541eb..3e0ba79522f 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/deletedservice/README.md +++ b/resource-manager/apimanagement/2023-03-01-preview/deletedservice/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") +id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") read, err := client.GetByName(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") +id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/apimanagement/2023-03-01-preview/deletedservice/id_deletedservice.go b/resource-manager/apimanagement/2023-03-01-preview/deletedservice/id_deletedservice.go index 263d09e3295..7d68c8e679a 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/deletedservice/id_deletedservice.go +++ b/resource-manager/apimanagement/2023-03-01-preview/deletedservice/id_deletedservice.go @@ -113,9 +113,9 @@ func (id DeletedServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApiManagement", "Microsoft.ApiManagement", "Microsoft.ApiManagement"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedServices", "deletedServices", "deletedServices"), - resourceids.UserSpecifiedSegment("deletedServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("deletedServiceName", "deletedServiceName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/deletedservice/id_deletedservice_test.go b/resource-manager/apimanagement/2023-03-01-preview/deletedservice/id_deletedservice_test.go index f46fc3bb0b0..346ce344f6e 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/deletedservice/id_deletedservice_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/deletedservice/id_deletedservice_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedServiceId{} func TestNewDeletedServiceID(t *testing.T) { - id := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") + id := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedServiceName'", id.DeletedServiceName, "serviceName") + if id.DeletedServiceName != "deletedServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedServiceName'", id.DeletedServiceName, "deletedServiceName") } } func TestFormatDeletedServiceID(t *testing.T) { - actual := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName" + actual := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedServiceName: "serviceName", + LocationName: "locationName", + DeletedServiceName: "deletedServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedServiceName: "serviceName", + LocationName: "locationName", + DeletedServiceName: "deletedServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs/dElEtEdSeRvIcEnAmE", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedServiceName: "sErViCeNaMe", + LocationName: "lOcAtIoNnAmE", + DeletedServiceName: "dElEtEdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs/dElEtEdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/diagnostic/constants.go b/resource-manager/apimanagement/2023-03-01-preview/diagnostic/constants.go index cde4ab74afa..200c1a288a2 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/diagnostic/constants.go +++ b/resource-manager/apimanagement/2023-03-01-preview/diagnostic/constants.go @@ -136,13 +136,13 @@ type OperationNameFormat string const ( OperationNameFormatName OperationNameFormat = "Name" - OperationNameFormatUrl OperationNameFormat = "Url" + OperationNameFormatURL OperationNameFormat = "Url" ) func PossibleValuesForOperationNameFormat() []string { return []string{ string(OperationNameFormatName), - string(OperationNameFormatUrl), + string(OperationNameFormatURL), } } @@ -162,7 +162,7 @@ func (s *OperationNameFormat) UnmarshalJSON(bytes []byte) error { func parseOperationNameFormat(input string) (*OperationNameFormat, error) { vals := map[string]OperationNameFormat{ "name": OperationNameFormatName, - "url": OperationNameFormatUrl, + "url": OperationNameFormatURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/apimanagement/2023-03-01-preview/gatewayapi/model_apicontractproperties.go b/resource-manager/apimanagement/2023-03-01-preview/gatewayapi/model_apicontractproperties.go index b6730933ec8..042f0f83a91 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/gatewayapi/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/gatewayapi/model_apicontractproperties.go @@ -19,10 +19,10 @@ type ApiContractProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/README.md b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/README.md index 4e88cc4f903..92ba6d6b55a 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/README.md +++ b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.CheckEntityExists(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.CreateOrUpdate(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.Delete(ctx, id) if err != nil { @@ -89,7 +89,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailCheckEntityExists(ctx, id) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailCreateOrUpdate(ctx, id) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailDelete(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_notificationrecipientemail.go b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_notificationrecipientemail.go index 3835959001e..9d7956ead0c 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_notificationrecipientemail.go +++ b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_notificationrecipientemail.go @@ -147,7 +147,7 @@ func (id NotificationRecipientEmailId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNotifications", "notifications", "notifications"), resourceids.ConstantSegment("notificationName", PossibleValuesForNotificationName(), "AccountClosedPublisher"), resourceids.StaticSegment("staticRecipientEmails", "recipientEmails", "recipientEmails"), - resourceids.UserSpecifiedSegment("recipientEmailName", "email"), + resourceids.UserSpecifiedSegment("recipientEmailName", "recipientEmailName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_notificationrecipientemail_test.go b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_notificationrecipientemail_test.go index 3a9e65402fd..f76e7a473fd 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_notificationrecipientemail_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_notificationrecipientemail_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NotificationRecipientEmailId{} func TestNewNotificationRecipientEmailID(t *testing.T) { - id := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") + id := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,14 +34,14 @@ func TestNewNotificationRecipientEmailID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NotificationName'", id.NotificationName, "AccountClosedPublisher") } - if id.RecipientEmailName != "email" { - t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "email") + if id.RecipientEmailName != "recipientEmailName" { + t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "recipientEmailName") } } func TestFormatNotificationRecipientEmailID(t *testing.T) { - actual := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email" + actual := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -125,19 +125,19 @@ func TestParseNotificationRecipientEmailID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, } @@ -326,36 +326,36 @@ func TestParseNotificationRecipientEmailIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "eMaIl", + RecipientEmailName: "rEcIpIeNtEmAiLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_recipientemail.go b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_recipientemail.go index 3601ab09ace..49db7ac5e85 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_recipientemail.go +++ b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_recipientemail.go @@ -139,7 +139,7 @@ func (id RecipientEmailId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNotifications", "notifications", "notifications"), resourceids.ConstantSegment("notificationName", PossibleValuesForNotificationName(), "AccountClosedPublisher"), resourceids.StaticSegment("staticRecipientEmails", "recipientEmails", "recipientEmails"), - resourceids.UserSpecifiedSegment("recipientEmailName", "email"), + resourceids.UserSpecifiedSegment("recipientEmailName", "recipientEmailName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_recipientemail_test.go b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_recipientemail_test.go index 280f1ecd10d..a6d3a3a8b6b 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_recipientemail_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/notificationrecipientemail/id_recipientemail_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecipientEmailId{} func TestNewRecipientEmailID(t *testing.T) { - id := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") + id := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRecipientEmailID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NotificationName'", id.NotificationName, "AccountClosedPublisher") } - if id.RecipientEmailName != "email" { - t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "email") + if id.RecipientEmailName != "recipientEmailName" { + t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "recipientEmailName") } } func TestFormatRecipientEmailID(t *testing.T) { - actual := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email" + actual := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseRecipientEmailID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseRecipientEmailIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "eMaIl", + RecipientEmailName: "rEcIpIeNtEmAiLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/README.md b/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/README.md index f557597ace0..e59e724dcec 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/README.md +++ b/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") payload := openidconnectprovider.OpenidConnectProviderContract{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.Delete(ctx, id, openidconnectprovider.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") payload := openidconnectprovider.OpenidConnectProviderUpdateContract{ // ... diff --git a/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/id_openidconnectprovider.go b/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/id_openidconnectprovider.go index 953e1cc9055..825b3b54bbb 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/id_openidconnectprovider.go +++ b/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/id_openidconnectprovider.go @@ -123,7 +123,7 @@ func (id OpenidConnectProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticOpenidConnectProviders", "openidConnectProviders", "openidConnectProviders"), - resourceids.UserSpecifiedSegment("openidConnectProviderName", "opid"), + resourceids.UserSpecifiedSegment("openidConnectProviderName", "openidConnectProviderName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/id_openidconnectprovider_test.go b/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/id_openidconnectprovider_test.go index fc41dc570ee..872dce4a46f 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/id_openidconnectprovider_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/openidconnectprovider/id_openidconnectprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenidConnectProviderId{} func TestNewOpenidConnectProviderID(t *testing.T) { - id := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") + id := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOpenidConnectProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.OpenidConnectProviderName != "opid" { - t.Fatalf("Expected %q but got %q for Segment 'OpenidConnectProviderName'", id.OpenidConnectProviderName, "opid") + if id.OpenidConnectProviderName != "openidConnectProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenidConnectProviderName'", id.OpenidConnectProviderName, "openidConnectProviderName") } } func TestFormatOpenidConnectProviderID(t *testing.T) { - actual := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid" + actual := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOpenidConnectProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - OpenidConnectProviderName: "opid", + OpenidConnectProviderName: "openidConnectProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOpenidConnectProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - OpenidConnectProviderName: "opid", + OpenidConnectProviderName: "openidConnectProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPeNiDcOnNeCtPrOvIdErNaMe", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - OpenidConnectProviderName: "oPiD", + OpenidConnectProviderName: "oPeNiDcOnNeCtPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPeNiDcOnNeCtPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/README.md b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/README.md index 7526a283cbc..d156adee2d3 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/README.md +++ b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") payload := policyfragment.PolicyFragmentContract{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, policyfragment.Default ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.Delete(ctx, id, policyfragment.DefaultDeleteOperationOptions()) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.Get(ctx, id, policyfragment.DefaultGetOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") // alternatively `client.ListReferences(ctx, id, policyfragment.DefaultListReferencesOperationOptions())` can be used to do batched pagination items, err := client.ListReferencesComplete(ctx, id, policyfragment.DefaultListReferencesOperationOptions()) @@ -123,7 +123,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") payload := policyfragment.PolicyFragmentContract{ // ... @@ -140,7 +140,7 @@ if err := client.WorkspacePolicyFragmentCreateOrUpdateThenPoll(ctx, id, payload, ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentDelete(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentDeleteOperationOptions()) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentGet(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentGetOperationOptions()) if err != nil { @@ -172,7 +172,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentGetEntityTag(ctx, id) if err != nil { @@ -205,7 +205,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") // alternatively `client.WorkspacePolicyFragmentListReferences(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentListReferencesOperationOptions())` can be used to do batched pagination items, err := client.WorkspacePolicyFragmentListReferencesComplete(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentListReferencesOperationOptions()) diff --git a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_policyfragment.go b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_policyfragment.go index 52c258c9e81..5c3e062af19 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_policyfragment.go +++ b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_policyfragment.go @@ -123,7 +123,7 @@ func (id PolicyFragmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPolicyFragments", "policyFragments", "policyFragments"), - resourceids.UserSpecifiedSegment("policyFragmentName", "id"), + resourceids.UserSpecifiedSegment("policyFragmentName", "policyFragmentName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_policyfragment_test.go b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_policyfragment_test.go index 97a99d4ee04..ac2a6a9e415 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_policyfragment_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_policyfragment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PolicyFragmentId{} func TestNewPolicyFragmentID(t *testing.T) { - id := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") + id := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPolicyFragmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PolicyFragmentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "id") + if id.PolicyFragmentName != "policyFragmentName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "policyFragmentName") } } func TestFormatPolicyFragmentID(t *testing.T) { - actual := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id" + actual := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePolicyFragmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePolicyFragmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - PolicyFragmentName: "iD", + PolicyFragmentName: "pOlIcYfRaGmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_workspacepolicyfragment.go b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_workspacepolicyfragment.go index 397dfee80d9..3449e07796e 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_workspacepolicyfragment.go +++ b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_workspacepolicyfragment.go @@ -131,7 +131,7 @@ func (id WorkspacePolicyFragmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceId", "workspaceId"), resourceids.StaticSegment("staticPolicyFragments", "policyFragments", "policyFragments"), - resourceids.UserSpecifiedSegment("policyFragmentName", "id"), + resourceids.UserSpecifiedSegment("policyFragmentName", "policyFragmentName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_workspacepolicyfragment_test.go b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_workspacepolicyfragment_test.go index 36b415dce85..606baf42bd0 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_workspacepolicyfragment_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/policyfragment/id_workspacepolicyfragment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePolicyFragmentId{} func TestNewWorkspacePolicyFragmentID(t *testing.T) { - id := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") + id := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewWorkspacePolicyFragmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceId'", id.WorkspaceId, "workspaceId") } - if id.PolicyFragmentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "id") + if id.PolicyFragmentName != "policyFragmentName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "policyFragmentName") } } func TestFormatWorkspacePolicyFragmentID(t *testing.T) { - actual := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id" + actual := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseWorkspacePolicyFragmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseWorkspacePolicyFragmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", - PolicyFragmentName: "iD", + PolicyFragmentName: "pOlIcYfRaGmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/portalconfig/model_portalconfigdelegationproperties.go b/resource-manager/apimanagement/2023-03-01-preview/portalconfig/model_portalconfigdelegationproperties.go index 3d2fa8ed0b6..625bb0da1f5 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/portalconfig/model_portalconfigdelegationproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/portalconfig/model_portalconfigdelegationproperties.go @@ -6,6 +6,6 @@ package portalconfig type PortalConfigDelegationProperties struct { DelegateRegistration *bool `json:"delegateRegistration,omitempty"` DelegateSubscription *bool `json:"delegateSubscription,omitempty"` - DelegationUrl *string `json:"delegationUrl,omitempty"` + DelegationURL *string `json:"delegationUrl,omitempty"` ValidationKey *string `json:"validationKey,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/README.md b/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/README.md index f42b9ea65d8..1cfc900d69e 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/README.md +++ b/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/README.md @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName") +id := privateendpointconnections.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.PrivateEndpointConnectionGetPrivateLinkResource(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/id_privatelinkresource.go b/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/id_privatelinkresource.go index 4a1c82d0b48..964e0869832 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/id_privatelinkresource.go +++ b/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkSubResourceName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/id_privatelinkresource_test.go b/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/id_privatelinkresource_test.go index bc466d49545..0df9bb10d6f 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/id_privatelinkresource_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/privateendpointconnections/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "privateLinkSubResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkSubResourceName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PrivateLinkResourceName: "privateLinkSubResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PrivateLinkResourceName: "privateLinkSubResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkSuBrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - PrivateLinkResourceName: "pRiVaTeLiNkSuBrEsOuRcEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkSuBrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/productapi/model_apicontractproperties.go b/resource-manager/apimanagement/2023-03-01-preview/productapi/model_apicontractproperties.go index af49c49c945..788eb024f97 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/productapi/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/productapi/model_apicontractproperties.go @@ -19,10 +19,10 @@ type ApiContractProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/productsbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2023-03-01-preview/productsbytag/model_apitagresourcecontractproperties.go index 5b6004615a2..3f71e4a2d31 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/productsbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/productsbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/subscription/README.md b/resource-manager/apimanagement/2023-03-01-preview/subscription/README.md index 7b0f722af1b..3fad73eceba 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/subscription/README.md +++ b/resource-manager/apimanagement/2023-03-01-preview/subscription/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") payload := subscription.SubscriptionCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.Delete(ctx, id, subscription.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.RegeneratePrimaryKey(ctx, id) if err != nil { @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.RegenerateSecondaryKey(ctx, id) if err != nil { @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") payload := subscription.SubscriptionUpdateParameters{ // ... @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid") +id := subscription.NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName") read, err := client.UserSubscriptionGet(ctx, id) if err != nil { @@ -195,7 +195,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") payload := subscription.SubscriptionCreateParameters{ // ... @@ -216,7 +216,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionDelete(ctx, id, subscription.DefaultWorkspaceSubscriptionDeleteOperationOptions()) if err != nil { @@ -232,7 +232,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionGet(ctx, id) if err != nil { @@ -248,7 +248,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionGetEntityTag(ctx, id) if err != nil { @@ -281,7 +281,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionListSecrets(ctx, id) if err != nil { @@ -297,7 +297,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionRegeneratePrimaryKey(ctx, id) if err != nil { @@ -313,7 +313,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionRegenerateSecondaryKey(ctx, id) if err != nil { @@ -329,7 +329,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") payload := subscription.SubscriptionUpdateParameters{ // ... diff --git a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_subscriptions2.go b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_subscriptions2.go index a0f82191a95..dc35783e6da 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_subscriptions2.go +++ b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_subscriptions2.go @@ -123,7 +123,7 @@ func (id Subscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_subscriptions2_test.go b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_subscriptions2_test.go index 16b9320bc0f..0b5f8ad522c 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_subscriptions2_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_subscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Subscriptions2Id{} func TestNewSubscriptions2ID(t *testing.T) { - id := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") + id := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatSubscriptions2ID(t *testing.T) { - actual := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid" + actual := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_usersubscriptions2.go b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_usersubscriptions2.go index 3a5d835af6a..043845b67ba 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_usersubscriptions2.go +++ b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_usersubscriptions2.go @@ -131,7 +131,7 @@ func (id UserSubscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userId", "userId"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_usersubscriptions2_test.go b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_usersubscriptions2_test.go index 5b7705f22d5..783e8fa0bdb 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_usersubscriptions2_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_usersubscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserSubscriptions2Id{} func TestNewUserSubscriptions2ID(t *testing.T) { - id := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid") + id := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewUserSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserId'", id.UserId, "userId") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatUserSubscriptions2ID(t *testing.T) { - actual := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid" + actual := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseUserSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", UserId: "userId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseUserSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", UserId: "userId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", UserId: "uSeRiD", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_workspacesubscriptions2.go b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_workspacesubscriptions2.go index e99c7a5322d..899ffd622e9 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_workspacesubscriptions2.go +++ b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_workspacesubscriptions2.go @@ -131,7 +131,7 @@ func (id WorkspaceSubscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceId", "workspaceId"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_workspacesubscriptions2_test.go b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_workspacesubscriptions2_test.go index ec4bcd6c747..f4e6288191e 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/subscription/id_workspacesubscriptions2_test.go +++ b/resource-manager/apimanagement/2023-03-01-preview/subscription/id_workspacesubscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspaceSubscriptions2Id{} func TestNewWorkspaceSubscriptions2ID(t *testing.T) { - id := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") + id := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewWorkspaceSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceId'", id.WorkspaceId, "workspaceId") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatWorkspaceSubscriptions2ID(t *testing.T) { - actual := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid" + actual := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseWorkspaceSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseWorkspaceSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-03-01-preview/tagresource/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2023-03-01-preview/tagresource/model_apitagresourcecontractproperties.go index a64045d1ae4..1866cde6007 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/tagresource/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2023-03-01-preview/tagresource/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-03-01-preview/users/README.md b/resource-manager/apimanagement/2023-03-01-preview/users/README.md index 91c164e9949..50bb3d5c134 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/users/README.md +++ b/resource-manager/apimanagement/2023-03-01-preview/users/README.md @@ -20,13 +20,13 @@ client.Client.Authorizer = authorizer ``` -### Example Usage: `UsersClient.UserGenerateSsoUrl` +### Example Usage: `UsersClient.UserGenerateSsoURL` ```go ctx := context.TODO() id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId") -read, err := client.UserGenerateSsoUrl(ctx, id) +read, err := client.UserGenerateSsoURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/apimanagement/2023-03-01-preview/users/method_usergeneratessourl.go b/resource-manager/apimanagement/2023-03-01-preview/users/method_usergeneratessourl.go index bab32e3f071..211e849804c 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/users/method_usergeneratessourl.go +++ b/resource-manager/apimanagement/2023-03-01-preview/users/method_usergeneratessourl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UserGenerateSsoUrlOperationResponse struct { +type UserGenerateSsoURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *GenerateSsoUrlResult + Model *GenerateSsoURLResult } -// UserGenerateSsoUrl ... -func (c UsersClient) UserGenerateSsoUrl(ctx context.Context, id UserId) (result UserGenerateSsoUrlOperationResponse, err error) { +// UserGenerateSsoURL ... +func (c UsersClient) UserGenerateSsoURL(ctx context.Context, id UserId) (result UserGenerateSsoURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c UsersClient) UserGenerateSsoUrl(ctx context.Context, id UserId) (result return } - var model GenerateSsoUrlResult + var model GenerateSsoURLResult result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/apimanagement/2023-03-01-preview/users/model_generatessourlresult.go b/resource-manager/apimanagement/2023-03-01-preview/users/model_generatessourlresult.go index f78768f2f31..6a9b6202d10 100644 --- a/resource-manager/apimanagement/2023-03-01-preview/users/model_generatessourlresult.go +++ b/resource-manager/apimanagement/2023-03-01-preview/users/model_generatessourlresult.go @@ -3,6 +3,6 @@ package users // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GenerateSsoUrlResult struct { +type GenerateSsoURLResult struct { Value *string `json:"value,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/api/model_apicontractproperties.go b/resource-manager/apimanagement/2023-05-01-preview/api/model_apicontractproperties.go index 50984f3b2cb..33aa22a0fa8 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/api/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/api/model_apicontractproperties.go @@ -20,10 +20,10 @@ type ApiContractProperties struct { Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/api/model_apicontractupdateproperties.go b/resource-manager/apimanagement/2023-05-01-preview/api/model_apicontractupdateproperties.go index fe0189ae882..40d76e9f414 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/api/model_apicontractupdateproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/api/model_apicontractupdateproperties.go @@ -18,9 +18,9 @@ type ApiContractUpdateProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/api/model_apicreateorupdateproperties.go b/resource-manager/apimanagement/2023-05-01-preview/api/model_apicreateorupdateproperties.go index 000abe8abbd..73e73b0b7c8 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/api/model_apicreateorupdateproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/api/model_apicreateorupdateproperties.go @@ -22,11 +22,11 @@ type ApiCreateOrUpdateProperties struct { Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` TranslateRequiredQueryParameters *TranslateRequiredQueryParametersConduct `json:"translateRequiredQueryParameters,omitempty"` Type *ApiType `json:"type,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/apimanagement/2023-05-01-preview/apidiagnostic/constants.go b/resource-manager/apimanagement/2023-05-01-preview/apidiagnostic/constants.go index 1afde676ffa..728fc412b28 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apidiagnostic/constants.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apidiagnostic/constants.go @@ -136,13 +136,13 @@ type OperationNameFormat string const ( OperationNameFormatName OperationNameFormat = "Name" - OperationNameFormatUrl OperationNameFormat = "Url" + OperationNameFormatURL OperationNameFormat = "Url" ) func PossibleValuesForOperationNameFormat() []string { return []string{ string(OperationNameFormatName), - string(OperationNameFormatUrl), + string(OperationNameFormatURL), } } @@ -162,7 +162,7 @@ func (s *OperationNameFormat) UnmarshalJSON(bytes []byte) error { func parseOperationNameFormat(input string) (*OperationNameFormat, error) { vals := map[string]OperationNameFormat{ "name": OperationNameFormatName, - "url": OperationNameFormatUrl, + "url": OperationNameFormatURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_additionallocation.go b/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_additionallocation.go index 3283a7b8de1..713481d013f 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_additionallocation.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_additionallocation.go @@ -9,7 +9,7 @@ import ( type AdditionalLocation struct { DisableGateway *bool `json:"disableGateway,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` Location string `json:"location"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` diff --git a/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_apimanagementserviceproperties.go b/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_apimanagementserviceproperties.go index a1901e05e4f..ef66688bf0f 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_apimanagementserviceproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_apimanagementserviceproperties.go @@ -17,19 +17,19 @@ type ApiManagementServiceProperties struct { CreatedAtUtc *string `json:"createdAtUtc,omitempty"` CustomProperties *map[string]string `json:"customProperties,omitempty"` DeveloperPortalStatus *DeveloperPortalStatus `json:"developerPortalStatus,omitempty"` - DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"` + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` DisableGateway *bool `json:"disableGateway,omitempty"` EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` - GatewayUrl *string `json:"gatewayUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + GatewayURL *string `json:"gatewayUrl,omitempty"` HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` LegacyPortalStatus *LegacyPortalStatus `json:"legacyPortalStatus,omitempty"` - ManagementApiUrl *string `json:"managementApiUrl,omitempty"` + ManagementApiURL *string `json:"managementApiUrl,omitempty"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` PlatformVersion *PlatformVersion `json:"platformVersion,omitempty"` - PortalUrl *string `json:"portalUrl,omitempty"` + PortalURL *string `json:"portalUrl,omitempty"` PrivateEndpointConnections *[]RemotePrivateEndpointConnectionWrapper `json:"privateEndpointConnections,omitempty"` PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -39,7 +39,7 @@ type ApiManagementServiceProperties struct { PublisherEmail string `json:"publisherEmail"` PublisherName string `json:"publisherName"` Restore *bool `json:"restore,omitempty"` - ScmUrl *string `json:"scmUrl,omitempty"` + ScmURL *string `json:"scmUrl,omitempty"` TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` VirtualNetworkType *VirtualNetworkType `json:"virtualNetworkType,omitempty"` diff --git a/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_apimanagementserviceupdateproperties.go b/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_apimanagementserviceupdateproperties.go index 198f9bd1343..8bd32692ae7 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_apimanagementserviceupdateproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apimanagementservice/model_apimanagementserviceupdateproperties.go @@ -17,19 +17,19 @@ type ApiManagementServiceUpdateProperties struct { CreatedAtUtc *string `json:"createdAtUtc,omitempty"` CustomProperties *map[string]string `json:"customProperties,omitempty"` DeveloperPortalStatus *DeveloperPortalStatus `json:"developerPortalStatus,omitempty"` - DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"` + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` DisableGateway *bool `json:"disableGateway,omitempty"` EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` - GatewayUrl *string `json:"gatewayUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + GatewayURL *string `json:"gatewayUrl,omitempty"` HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` LegacyPortalStatus *LegacyPortalStatus `json:"legacyPortalStatus,omitempty"` - ManagementApiUrl *string `json:"managementApiUrl,omitempty"` + ManagementApiURL *string `json:"managementApiUrl,omitempty"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` PlatformVersion *PlatformVersion `json:"platformVersion,omitempty"` - PortalUrl *string `json:"portalUrl,omitempty"` + PortalURL *string `json:"portalUrl,omitempty"` PrivateEndpointConnections *[]RemotePrivateEndpointConnectionWrapper `json:"privateEndpointConnections,omitempty"` PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -39,7 +39,7 @@ type ApiManagementServiceUpdateProperties struct { PublisherEmail *string `json:"publisherEmail,omitempty"` PublisherName *string `json:"publisherName,omitempty"` Restore *bool `json:"restore,omitempty"` - ScmUrl *string `json:"scmUrl,omitempty"` + ScmURL *string `json:"scmUrl,omitempty"` TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` VirtualNetworkType *VirtualNetworkType `json:"virtualNetworkType,omitempty"` diff --git a/resource-manager/apimanagement/2023-05-01-preview/apioperationsbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2023-05-01-preview/apioperationsbytag/model_apitagresourcecontractproperties.go index 29865d37c08..95eb4a2bed1 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apioperationsbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apioperationsbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/apirevision/model_apirevisioncontract.go b/resource-manager/apimanagement/2023-05-01-preview/apirevision/model_apirevisioncontract.go index 3c366c0bef2..5a1d18799cc 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apirevision/model_apirevisioncontract.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apirevision/model_apirevisioncontract.go @@ -16,7 +16,7 @@ type ApiRevisionContract struct { Description *string `json:"description,omitempty"` IsCurrent *bool `json:"isCurrent,omitempty"` IsOnline *bool `json:"isOnline,omitempty"` - PrivateUrl *string `json:"privateUrl,omitempty"` + PrivateURL *string `json:"privateUrl,omitempty"` UpdatedDateTime *string `json:"updatedDateTime,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/apirevision/predicates.go b/resource-manager/apimanagement/2023-05-01-preview/apirevision/predicates.go index bd4911829a3..4f83cd3cb7b 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apirevision/predicates.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apirevision/predicates.go @@ -10,7 +10,7 @@ type ApiRevisionContractOperationPredicate struct { Description *string IsCurrent *bool IsOnline *bool - PrivateUrl *string + PrivateURL *string UpdatedDateTime *string } @@ -40,7 +40,7 @@ func (p ApiRevisionContractOperationPredicate) Matches(input ApiRevisionContract return false } - if p.PrivateUrl != nil && (input.PrivateUrl == nil || *p.PrivateUrl != *input.PrivateUrl) { + if p.PrivateURL != nil && (input.PrivateURL == nil || *p.PrivateURL != *input.PrivateURL) { return false } diff --git a/resource-manager/apimanagement/2023-05-01-preview/apisbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2023-05-01-preview/apisbytag/model_apitagresourcecontractproperties.go index 33076efa3d1..18046859f0c 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apisbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apisbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/apitagdescription/model_tagdescriptionbaseproperties.go b/resource-manager/apimanagement/2023-05-01-preview/apitagdescription/model_tagdescriptionbaseproperties.go index cb5c534f1af..06bd84a2665 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apitagdescription/model_tagdescriptionbaseproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apitagdescription/model_tagdescriptionbaseproperties.go @@ -6,5 +6,5 @@ package apitagdescription type TagDescriptionBaseProperties struct { Description *string `json:"description,omitempty"` ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` - ExternalDocsUrl *string `json:"externalDocsUrl,omitempty"` + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/apitagdescription/model_tagdescriptioncontractproperties.go b/resource-manager/apimanagement/2023-05-01-preview/apitagdescription/model_tagdescriptioncontractproperties.go index 071eefae7d3..e3261d6e864 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/apitagdescription/model_tagdescriptioncontractproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/apitagdescription/model_tagdescriptioncontractproperties.go @@ -7,6 +7,6 @@ type TagDescriptionContractProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` - ExternalDocsUrl *string `json:"externalDocsUrl,omitempty"` + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` TagId *string `json:"tagId,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/authorizationloginlinks/model_authorizationloginrequestcontract.go b/resource-manager/apimanagement/2023-05-01-preview/authorizationloginlinks/model_authorizationloginrequestcontract.go index e324153247b..cb17aba4abd 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/authorizationloginlinks/model_authorizationloginrequestcontract.go +++ b/resource-manager/apimanagement/2023-05-01-preview/authorizationloginlinks/model_authorizationloginrequestcontract.go @@ -4,5 +4,5 @@ package authorizationloginlinks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AuthorizationLoginRequestContract struct { - PostLoginRedirectUrl *string `json:"postLoginRedirectUrl,omitempty"` + PostLoginRedirectURL *string `json:"postLoginRedirectUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/authorizationprovider/model_authorizationprovideroauth2settings.go b/resource-manager/apimanagement/2023-05-01-preview/authorizationprovider/model_authorizationprovideroauth2settings.go index cfcb9d0c4c2..3ff39bd7622 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/authorizationprovider/model_authorizationprovideroauth2settings.go +++ b/resource-manager/apimanagement/2023-05-01-preview/authorizationprovider/model_authorizationprovideroauth2settings.go @@ -5,5 +5,5 @@ package authorizationprovider type AuthorizationProviderOAuth2Settings struct { GrantTypes *AuthorizationProviderOAuth2GrantTypes `json:"grantTypes,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/README.md b/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/README.md index 5ca1efcf8ef..577aee6aeaa 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/README.md +++ b/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") payload := authorizationserver.AuthorizationServerContract{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.Delete(ctx, id, authorizationserver.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") payload := authorizationserver.AuthorizationServerUpdateContract{ // ... diff --git a/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/id_authorizationserver.go b/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/id_authorizationserver.go index f01fa1c02ff..abdc7ef410a 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/id_authorizationserver.go +++ b/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/id_authorizationserver.go @@ -123,7 +123,7 @@ func (id AuthorizationServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticAuthorizationServers", "authorizationServers", "authorizationServers"), - resourceids.UserSpecifiedSegment("authorizationServerName", "authsid"), + resourceids.UserSpecifiedSegment("authorizationServerName", "authorizationServerName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/id_authorizationserver_test.go b/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/id_authorizationserver_test.go index 5dabd493731..8df88eb6384 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/id_authorizationserver_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/authorizationserver/id_authorizationserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthorizationServerId{} func TestNewAuthorizationServerID(t *testing.T) { - id := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") + id := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAuthorizationServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.AuthorizationServerName != "authsid" { - t.Fatalf("Expected %q but got %q for Segment 'AuthorizationServerName'", id.AuthorizationServerName, "authsid") + if id.AuthorizationServerName != "authorizationServerName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthorizationServerName'", id.AuthorizationServerName, "authorizationServerName") } } func TestFormatAuthorizationServerID(t *testing.T) { - actual := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid" + actual := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAuthorizationServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - AuthorizationServerName: "authsid", + AuthorizationServerName: "authorizationServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAuthorizationServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - AuthorizationServerName: "authsid", + AuthorizationServerName: "authorizationServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHoRiZaTiOnSeRvErNaMe", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - AuthorizationServerName: "aUtHsId", + AuthorizationServerName: "aUtHoRiZaTiOnSeRvErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHoRiZaTiOnSeRvErNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/deletedservice/README.md b/resource-manager/apimanagement/2023-05-01-preview/deletedservice/README.md index e2f2abeb668..c2eba4c6b03 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/deletedservice/README.md +++ b/resource-manager/apimanagement/2023-05-01-preview/deletedservice/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") +id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") read, err := client.GetByName(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") +id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/apimanagement/2023-05-01-preview/deletedservice/id_deletedservice.go b/resource-manager/apimanagement/2023-05-01-preview/deletedservice/id_deletedservice.go index 263d09e3295..7d68c8e679a 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/deletedservice/id_deletedservice.go +++ b/resource-manager/apimanagement/2023-05-01-preview/deletedservice/id_deletedservice.go @@ -113,9 +113,9 @@ func (id DeletedServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApiManagement", "Microsoft.ApiManagement", "Microsoft.ApiManagement"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedServices", "deletedServices", "deletedServices"), - resourceids.UserSpecifiedSegment("deletedServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("deletedServiceName", "deletedServiceName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/deletedservice/id_deletedservice_test.go b/resource-manager/apimanagement/2023-05-01-preview/deletedservice/id_deletedservice_test.go index f46fc3bb0b0..346ce344f6e 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/deletedservice/id_deletedservice_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/deletedservice/id_deletedservice_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedServiceId{} func TestNewDeletedServiceID(t *testing.T) { - id := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") + id := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedServiceName'", id.DeletedServiceName, "serviceName") + if id.DeletedServiceName != "deletedServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedServiceName'", id.DeletedServiceName, "deletedServiceName") } } func TestFormatDeletedServiceID(t *testing.T) { - actual := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName" + actual := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedServiceName: "serviceName", + LocationName: "locationName", + DeletedServiceName: "deletedServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedServiceName: "serviceName", + LocationName: "locationName", + DeletedServiceName: "deletedServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs/dElEtEdSeRvIcEnAmE", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedServiceName: "sErViCeNaMe", + LocationName: "lOcAtIoNnAmE", + DeletedServiceName: "dElEtEdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs/dElEtEdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/diagnostic/constants.go b/resource-manager/apimanagement/2023-05-01-preview/diagnostic/constants.go index cde4ab74afa..200c1a288a2 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/diagnostic/constants.go +++ b/resource-manager/apimanagement/2023-05-01-preview/diagnostic/constants.go @@ -136,13 +136,13 @@ type OperationNameFormat string const ( OperationNameFormatName OperationNameFormat = "Name" - OperationNameFormatUrl OperationNameFormat = "Url" + OperationNameFormatURL OperationNameFormat = "Url" ) func PossibleValuesForOperationNameFormat() []string { return []string{ string(OperationNameFormatName), - string(OperationNameFormatUrl), + string(OperationNameFormatURL), } } @@ -162,7 +162,7 @@ func (s *OperationNameFormat) UnmarshalJSON(bytes []byte) error { func parseOperationNameFormat(input string) (*OperationNameFormat, error) { vals := map[string]OperationNameFormat{ "name": OperationNameFormatName, - "url": OperationNameFormatUrl, + "url": OperationNameFormatURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/apimanagement/2023-05-01-preview/gatewayapi/model_apicontractproperties.go b/resource-manager/apimanagement/2023-05-01-preview/gatewayapi/model_apicontractproperties.go index 54fd88900fd..2acee539d77 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/gatewayapi/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/gatewayapi/model_apicontractproperties.go @@ -20,10 +20,10 @@ type ApiContractProperties struct { Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/README.md b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/README.md index 3afb34f515a..c9291d615d6 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/README.md +++ b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.CheckEntityExists(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.CreateOrUpdate(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.Delete(ctx, id) if err != nil { @@ -89,7 +89,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailCheckEntityExists(ctx, id) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailCreateOrUpdate(ctx, id) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailDelete(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_notificationrecipientemail.go b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_notificationrecipientemail.go index 3835959001e..9d7956ead0c 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_notificationrecipientemail.go +++ b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_notificationrecipientemail.go @@ -147,7 +147,7 @@ func (id NotificationRecipientEmailId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNotifications", "notifications", "notifications"), resourceids.ConstantSegment("notificationName", PossibleValuesForNotificationName(), "AccountClosedPublisher"), resourceids.StaticSegment("staticRecipientEmails", "recipientEmails", "recipientEmails"), - resourceids.UserSpecifiedSegment("recipientEmailName", "email"), + resourceids.UserSpecifiedSegment("recipientEmailName", "recipientEmailName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_notificationrecipientemail_test.go b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_notificationrecipientemail_test.go index 3a9e65402fd..f76e7a473fd 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_notificationrecipientemail_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_notificationrecipientemail_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NotificationRecipientEmailId{} func TestNewNotificationRecipientEmailID(t *testing.T) { - id := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") + id := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,14 +34,14 @@ func TestNewNotificationRecipientEmailID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NotificationName'", id.NotificationName, "AccountClosedPublisher") } - if id.RecipientEmailName != "email" { - t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "email") + if id.RecipientEmailName != "recipientEmailName" { + t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "recipientEmailName") } } func TestFormatNotificationRecipientEmailID(t *testing.T) { - actual := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email" + actual := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -125,19 +125,19 @@ func TestParseNotificationRecipientEmailID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, } @@ -326,36 +326,36 @@ func TestParseNotificationRecipientEmailIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "eMaIl", + RecipientEmailName: "rEcIpIeNtEmAiLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_recipientemail.go b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_recipientemail.go index 3601ab09ace..49db7ac5e85 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_recipientemail.go +++ b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_recipientemail.go @@ -139,7 +139,7 @@ func (id RecipientEmailId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNotifications", "notifications", "notifications"), resourceids.ConstantSegment("notificationName", PossibleValuesForNotificationName(), "AccountClosedPublisher"), resourceids.StaticSegment("staticRecipientEmails", "recipientEmails", "recipientEmails"), - resourceids.UserSpecifiedSegment("recipientEmailName", "email"), + resourceids.UserSpecifiedSegment("recipientEmailName", "recipientEmailName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_recipientemail_test.go b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_recipientemail_test.go index 280f1ecd10d..a6d3a3a8b6b 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_recipientemail_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/notificationrecipientemail/id_recipientemail_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecipientEmailId{} func TestNewRecipientEmailID(t *testing.T) { - id := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") + id := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRecipientEmailID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NotificationName'", id.NotificationName, "AccountClosedPublisher") } - if id.RecipientEmailName != "email" { - t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "email") + if id.RecipientEmailName != "recipientEmailName" { + t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "recipientEmailName") } } func TestFormatRecipientEmailID(t *testing.T) { - actual := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email" + actual := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseRecipientEmailID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseRecipientEmailIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "eMaIl", + RecipientEmailName: "rEcIpIeNtEmAiLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/README.md b/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/README.md index 0de7337d374..349ba02884c 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/README.md +++ b/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") payload := openidconnectprovider.OpenidConnectProviderContract{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.Delete(ctx, id, openidconnectprovider.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") payload := openidconnectprovider.OpenidConnectProviderUpdateContract{ // ... diff --git a/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/id_openidconnectprovider.go b/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/id_openidconnectprovider.go index 953e1cc9055..825b3b54bbb 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/id_openidconnectprovider.go +++ b/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/id_openidconnectprovider.go @@ -123,7 +123,7 @@ func (id OpenidConnectProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticOpenidConnectProviders", "openidConnectProviders", "openidConnectProviders"), - resourceids.UserSpecifiedSegment("openidConnectProviderName", "opid"), + resourceids.UserSpecifiedSegment("openidConnectProviderName", "openidConnectProviderName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/id_openidconnectprovider_test.go b/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/id_openidconnectprovider_test.go index fc41dc570ee..872dce4a46f 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/id_openidconnectprovider_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/openidconnectprovider/id_openidconnectprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenidConnectProviderId{} func TestNewOpenidConnectProviderID(t *testing.T) { - id := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") + id := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOpenidConnectProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.OpenidConnectProviderName != "opid" { - t.Fatalf("Expected %q but got %q for Segment 'OpenidConnectProviderName'", id.OpenidConnectProviderName, "opid") + if id.OpenidConnectProviderName != "openidConnectProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenidConnectProviderName'", id.OpenidConnectProviderName, "openidConnectProviderName") } } func TestFormatOpenidConnectProviderID(t *testing.T) { - actual := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid" + actual := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOpenidConnectProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - OpenidConnectProviderName: "opid", + OpenidConnectProviderName: "openidConnectProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOpenidConnectProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - OpenidConnectProviderName: "opid", + OpenidConnectProviderName: "openidConnectProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPeNiDcOnNeCtPrOvIdErNaMe", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - OpenidConnectProviderName: "oPiD", + OpenidConnectProviderName: "oPeNiDcOnNeCtPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPeNiDcOnNeCtPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/README.md b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/README.md index 42f5b0f037f..e5a72b4e3f8 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/README.md +++ b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") payload := policyfragment.PolicyFragmentContract{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, policyfragment.Default ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.Delete(ctx, id, policyfragment.DefaultDeleteOperationOptions()) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.Get(ctx, id, policyfragment.DefaultGetOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") // alternatively `client.ListReferences(ctx, id, policyfragment.DefaultListReferencesOperationOptions())` can be used to do batched pagination items, err := client.ListReferencesComplete(ctx, id, policyfragment.DefaultListReferencesOperationOptions()) @@ -123,7 +123,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") payload := policyfragment.PolicyFragmentContract{ // ... @@ -140,7 +140,7 @@ if err := client.WorkspacePolicyFragmentCreateOrUpdateThenPoll(ctx, id, payload, ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentDelete(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentDeleteOperationOptions()) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentGet(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentGetOperationOptions()) if err != nil { @@ -172,7 +172,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentGetEntityTag(ctx, id) if err != nil { @@ -205,7 +205,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") // alternatively `client.WorkspacePolicyFragmentListReferences(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentListReferencesOperationOptions())` can be used to do batched pagination items, err := client.WorkspacePolicyFragmentListReferencesComplete(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentListReferencesOperationOptions()) diff --git a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_policyfragment.go b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_policyfragment.go index 52c258c9e81..5c3e062af19 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_policyfragment.go +++ b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_policyfragment.go @@ -123,7 +123,7 @@ func (id PolicyFragmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPolicyFragments", "policyFragments", "policyFragments"), - resourceids.UserSpecifiedSegment("policyFragmentName", "id"), + resourceids.UserSpecifiedSegment("policyFragmentName", "policyFragmentName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_policyfragment_test.go b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_policyfragment_test.go index 97a99d4ee04..ac2a6a9e415 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_policyfragment_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_policyfragment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PolicyFragmentId{} func TestNewPolicyFragmentID(t *testing.T) { - id := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") + id := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPolicyFragmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PolicyFragmentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "id") + if id.PolicyFragmentName != "policyFragmentName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "policyFragmentName") } } func TestFormatPolicyFragmentID(t *testing.T) { - actual := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id" + actual := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePolicyFragmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePolicyFragmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - PolicyFragmentName: "iD", + PolicyFragmentName: "pOlIcYfRaGmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_workspacepolicyfragment.go b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_workspacepolicyfragment.go index 397dfee80d9..3449e07796e 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_workspacepolicyfragment.go +++ b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_workspacepolicyfragment.go @@ -131,7 +131,7 @@ func (id WorkspacePolicyFragmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceId", "workspaceId"), resourceids.StaticSegment("staticPolicyFragments", "policyFragments", "policyFragments"), - resourceids.UserSpecifiedSegment("policyFragmentName", "id"), + resourceids.UserSpecifiedSegment("policyFragmentName", "policyFragmentName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_workspacepolicyfragment_test.go b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_workspacepolicyfragment_test.go index 36b415dce85..606baf42bd0 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_workspacepolicyfragment_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/policyfragment/id_workspacepolicyfragment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePolicyFragmentId{} func TestNewWorkspacePolicyFragmentID(t *testing.T) { - id := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") + id := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewWorkspacePolicyFragmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceId'", id.WorkspaceId, "workspaceId") } - if id.PolicyFragmentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "id") + if id.PolicyFragmentName != "policyFragmentName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "policyFragmentName") } } func TestFormatWorkspacePolicyFragmentID(t *testing.T) { - actual := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id" + actual := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseWorkspacePolicyFragmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseWorkspacePolicyFragmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", - PolicyFragmentName: "iD", + PolicyFragmentName: "pOlIcYfRaGmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/portalconfig/model_portalconfigdelegationproperties.go b/resource-manager/apimanagement/2023-05-01-preview/portalconfig/model_portalconfigdelegationproperties.go index 3d2fa8ed0b6..625bb0da1f5 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/portalconfig/model_portalconfigdelegationproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/portalconfig/model_portalconfigdelegationproperties.go @@ -6,6 +6,6 @@ package portalconfig type PortalConfigDelegationProperties struct { DelegateRegistration *bool `json:"delegateRegistration,omitempty"` DelegateSubscription *bool `json:"delegateSubscription,omitempty"` - DelegationUrl *string `json:"delegationUrl,omitempty"` + DelegationURL *string `json:"delegationUrl,omitempty"` ValidationKey *string `json:"validationKey,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/README.md b/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/README.md index 12690ee7410..bcd6b81cb76 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/README.md +++ b/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/README.md @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName") +id := privateendpointconnections.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.PrivateEndpointConnectionGetPrivateLinkResource(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/id_privatelinkresource.go b/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/id_privatelinkresource.go index 4a1c82d0b48..964e0869832 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/id_privatelinkresource.go +++ b/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkSubResourceName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/id_privatelinkresource_test.go b/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/id_privatelinkresource_test.go index bc466d49545..0df9bb10d6f 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/id_privatelinkresource_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/privateendpointconnections/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "privateLinkSubResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkSubResourceName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PrivateLinkResourceName: "privateLinkSubResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PrivateLinkResourceName: "privateLinkSubResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkSuBrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - PrivateLinkResourceName: "pRiVaTeLiNkSuBrEsOuRcEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkSuBrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/productapi/model_apicontractproperties.go b/resource-manager/apimanagement/2023-05-01-preview/productapi/model_apicontractproperties.go index ff4acc2668f..1c436fc9227 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/productapi/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/productapi/model_apicontractproperties.go @@ -20,10 +20,10 @@ type ApiContractProperties struct { Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/productsbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2023-05-01-preview/productsbytag/model_apitagresourcecontractproperties.go index 5b6004615a2..3f71e4a2d31 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/productsbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/productsbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/subscription/README.md b/resource-manager/apimanagement/2023-05-01-preview/subscription/README.md index cb629dddd39..e0fb2186cfd 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/subscription/README.md +++ b/resource-manager/apimanagement/2023-05-01-preview/subscription/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") payload := subscription.SubscriptionCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.Delete(ctx, id, subscription.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.RegeneratePrimaryKey(ctx, id) if err != nil { @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.RegenerateSecondaryKey(ctx, id) if err != nil { @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") payload := subscription.SubscriptionUpdateParameters{ // ... @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid") +id := subscription.NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName") read, err := client.UserSubscriptionGet(ctx, id) if err != nil { @@ -195,7 +195,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") payload := subscription.SubscriptionCreateParameters{ // ... @@ -216,7 +216,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionDelete(ctx, id, subscription.DefaultWorkspaceSubscriptionDeleteOperationOptions()) if err != nil { @@ -232,7 +232,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionGet(ctx, id) if err != nil { @@ -248,7 +248,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionGetEntityTag(ctx, id) if err != nil { @@ -281,7 +281,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionListSecrets(ctx, id) if err != nil { @@ -297,7 +297,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionRegeneratePrimaryKey(ctx, id) if err != nil { @@ -313,7 +313,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionRegenerateSecondaryKey(ctx, id) if err != nil { @@ -329,7 +329,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") payload := subscription.SubscriptionUpdateParameters{ // ... diff --git a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_subscriptions2.go b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_subscriptions2.go index a0f82191a95..dc35783e6da 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_subscriptions2.go +++ b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_subscriptions2.go @@ -123,7 +123,7 @@ func (id Subscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_subscriptions2_test.go b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_subscriptions2_test.go index 16b9320bc0f..0b5f8ad522c 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_subscriptions2_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_subscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Subscriptions2Id{} func TestNewSubscriptions2ID(t *testing.T) { - id := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") + id := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatSubscriptions2ID(t *testing.T) { - actual := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid" + actual := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_usersubscriptions2.go b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_usersubscriptions2.go index 3a5d835af6a..043845b67ba 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_usersubscriptions2.go +++ b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_usersubscriptions2.go @@ -131,7 +131,7 @@ func (id UserSubscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userId", "userId"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_usersubscriptions2_test.go b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_usersubscriptions2_test.go index 5b7705f22d5..783e8fa0bdb 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_usersubscriptions2_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_usersubscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserSubscriptions2Id{} func TestNewUserSubscriptions2ID(t *testing.T) { - id := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid") + id := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewUserSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserId'", id.UserId, "userId") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatUserSubscriptions2ID(t *testing.T) { - actual := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid" + actual := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseUserSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", UserId: "userId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseUserSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", UserId: "userId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", UserId: "uSeRiD", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_workspacesubscriptions2.go b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_workspacesubscriptions2.go index e99c7a5322d..899ffd622e9 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_workspacesubscriptions2.go +++ b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_workspacesubscriptions2.go @@ -131,7 +131,7 @@ func (id WorkspaceSubscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceId", "workspaceId"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_workspacesubscriptions2_test.go b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_workspacesubscriptions2_test.go index ec4bcd6c747..f4e6288191e 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/subscription/id_workspacesubscriptions2_test.go +++ b/resource-manager/apimanagement/2023-05-01-preview/subscription/id_workspacesubscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspaceSubscriptions2Id{} func TestNewWorkspaceSubscriptions2ID(t *testing.T) { - id := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") + id := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewWorkspaceSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceId'", id.WorkspaceId, "workspaceId") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatWorkspaceSubscriptions2ID(t *testing.T) { - actual := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid" + actual := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseWorkspaceSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseWorkspaceSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2023-05-01-preview/tagresource/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2023-05-01-preview/tagresource/model_apitagresourcecontractproperties.go index a64045d1ae4..1866cde6007 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/tagresource/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2023-05-01-preview/tagresource/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2023-05-01-preview/users/README.md b/resource-manager/apimanagement/2023-05-01-preview/users/README.md index b63b078659f..98b8b732431 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/users/README.md +++ b/resource-manager/apimanagement/2023-05-01-preview/users/README.md @@ -20,13 +20,13 @@ client.Client.Authorizer = authorizer ``` -### Example Usage: `UsersClient.UserGenerateSsoUrl` +### Example Usage: `UsersClient.UserGenerateSsoURL` ```go ctx := context.TODO() id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId") -read, err := client.UserGenerateSsoUrl(ctx, id) +read, err := client.UserGenerateSsoURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/apimanagement/2023-05-01-preview/users/method_usergeneratessourl.go b/resource-manager/apimanagement/2023-05-01-preview/users/method_usergeneratessourl.go index bab32e3f071..211e849804c 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/users/method_usergeneratessourl.go +++ b/resource-manager/apimanagement/2023-05-01-preview/users/method_usergeneratessourl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UserGenerateSsoUrlOperationResponse struct { +type UserGenerateSsoURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *GenerateSsoUrlResult + Model *GenerateSsoURLResult } -// UserGenerateSsoUrl ... -func (c UsersClient) UserGenerateSsoUrl(ctx context.Context, id UserId) (result UserGenerateSsoUrlOperationResponse, err error) { +// UserGenerateSsoURL ... +func (c UsersClient) UserGenerateSsoURL(ctx context.Context, id UserId) (result UserGenerateSsoURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c UsersClient) UserGenerateSsoUrl(ctx context.Context, id UserId) (result return } - var model GenerateSsoUrlResult + var model GenerateSsoURLResult result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/apimanagement/2023-05-01-preview/users/model_generatessourlresult.go b/resource-manager/apimanagement/2023-05-01-preview/users/model_generatessourlresult.go index f78768f2f31..6a9b6202d10 100644 --- a/resource-manager/apimanagement/2023-05-01-preview/users/model_generatessourlresult.go +++ b/resource-manager/apimanagement/2023-05-01-preview/users/model_generatessourlresult.go @@ -3,6 +3,6 @@ package users // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GenerateSsoUrlResult struct { +type GenerateSsoURLResult struct { Value *string `json:"value,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/api/model_apicontractproperties.go b/resource-manager/apimanagement/2024-05-01/api/model_apicontractproperties.go index 50984f3b2cb..33aa22a0fa8 100644 --- a/resource-manager/apimanagement/2024-05-01/api/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2024-05-01/api/model_apicontractproperties.go @@ -20,10 +20,10 @@ type ApiContractProperties struct { Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/api/model_apicontractupdateproperties.go b/resource-manager/apimanagement/2024-05-01/api/model_apicontractupdateproperties.go index fe0189ae882..40d76e9f414 100644 --- a/resource-manager/apimanagement/2024-05-01/api/model_apicontractupdateproperties.go +++ b/resource-manager/apimanagement/2024-05-01/api/model_apicontractupdateproperties.go @@ -18,9 +18,9 @@ type ApiContractUpdateProperties struct { License *ApiLicenseInformation `json:"license,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/api/model_apicreateorupdateproperties.go b/resource-manager/apimanagement/2024-05-01/api/model_apicreateorupdateproperties.go index 000abe8abbd..73e73b0b7c8 100644 --- a/resource-manager/apimanagement/2024-05-01/api/model_apicreateorupdateproperties.go +++ b/resource-manager/apimanagement/2024-05-01/api/model_apicreateorupdateproperties.go @@ -22,11 +22,11 @@ type ApiCreateOrUpdateProperties struct { Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` TranslateRequiredQueryParameters *TranslateRequiredQueryParametersConduct `json:"translateRequiredQueryParameters,omitempty"` Type *ApiType `json:"type,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/apimanagement/2024-05-01/apidiagnostic/constants.go b/resource-manager/apimanagement/2024-05-01/apidiagnostic/constants.go index 1afde676ffa..728fc412b28 100644 --- a/resource-manager/apimanagement/2024-05-01/apidiagnostic/constants.go +++ b/resource-manager/apimanagement/2024-05-01/apidiagnostic/constants.go @@ -136,13 +136,13 @@ type OperationNameFormat string const ( OperationNameFormatName OperationNameFormat = "Name" - OperationNameFormatUrl OperationNameFormat = "Url" + OperationNameFormatURL OperationNameFormat = "Url" ) func PossibleValuesForOperationNameFormat() []string { return []string{ string(OperationNameFormatName), - string(OperationNameFormatUrl), + string(OperationNameFormatURL), } } @@ -162,7 +162,7 @@ func (s *OperationNameFormat) UnmarshalJSON(bytes []byte) error { func parseOperationNameFormat(input string) (*OperationNameFormat, error) { vals := map[string]OperationNameFormat{ "name": OperationNameFormatName, - "url": OperationNameFormatUrl, + "url": OperationNameFormatURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_additionallocation.go b/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_additionallocation.go index 3283a7b8de1..713481d013f 100644 --- a/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_additionallocation.go +++ b/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_additionallocation.go @@ -9,7 +9,7 @@ import ( type AdditionalLocation struct { DisableGateway *bool `json:"disableGateway,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` Location string `json:"location"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` diff --git a/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_apimanagementserviceproperties.go b/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_apimanagementserviceproperties.go index a1901e05e4f..ef66688bf0f 100644 --- a/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_apimanagementserviceproperties.go +++ b/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_apimanagementserviceproperties.go @@ -17,19 +17,19 @@ type ApiManagementServiceProperties struct { CreatedAtUtc *string `json:"createdAtUtc,omitempty"` CustomProperties *map[string]string `json:"customProperties,omitempty"` DeveloperPortalStatus *DeveloperPortalStatus `json:"developerPortalStatus,omitempty"` - DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"` + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` DisableGateway *bool `json:"disableGateway,omitempty"` EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` - GatewayUrl *string `json:"gatewayUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + GatewayURL *string `json:"gatewayUrl,omitempty"` HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` LegacyPortalStatus *LegacyPortalStatus `json:"legacyPortalStatus,omitempty"` - ManagementApiUrl *string `json:"managementApiUrl,omitempty"` + ManagementApiURL *string `json:"managementApiUrl,omitempty"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` PlatformVersion *PlatformVersion `json:"platformVersion,omitempty"` - PortalUrl *string `json:"portalUrl,omitempty"` + PortalURL *string `json:"portalUrl,omitempty"` PrivateEndpointConnections *[]RemotePrivateEndpointConnectionWrapper `json:"privateEndpointConnections,omitempty"` PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -39,7 +39,7 @@ type ApiManagementServiceProperties struct { PublisherEmail string `json:"publisherEmail"` PublisherName string `json:"publisherName"` Restore *bool `json:"restore,omitempty"` - ScmUrl *string `json:"scmUrl,omitempty"` + ScmURL *string `json:"scmUrl,omitempty"` TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` VirtualNetworkType *VirtualNetworkType `json:"virtualNetworkType,omitempty"` diff --git a/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_apimanagementserviceupdateproperties.go b/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_apimanagementserviceupdateproperties.go index 198f9bd1343..8bd32692ae7 100644 --- a/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_apimanagementserviceupdateproperties.go +++ b/resource-manager/apimanagement/2024-05-01/apimanagementservice/model_apimanagementserviceupdateproperties.go @@ -17,19 +17,19 @@ type ApiManagementServiceUpdateProperties struct { CreatedAtUtc *string `json:"createdAtUtc,omitempty"` CustomProperties *map[string]string `json:"customProperties,omitempty"` DeveloperPortalStatus *DeveloperPortalStatus `json:"developerPortalStatus,omitempty"` - DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"` + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` DisableGateway *bool `json:"disableGateway,omitempty"` EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` - GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"` - GatewayUrl *string `json:"gatewayUrl,omitempty"` + GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + GatewayURL *string `json:"gatewayUrl,omitempty"` HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` LegacyPortalStatus *LegacyPortalStatus `json:"legacyPortalStatus,omitempty"` - ManagementApiUrl *string `json:"managementApiUrl,omitempty"` + ManagementApiURL *string `json:"managementApiUrl,omitempty"` NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` OutboundPublicIPAddresses *[]string `json:"outboundPublicIPAddresses,omitempty"` PlatformVersion *PlatformVersion `json:"platformVersion,omitempty"` - PortalUrl *string `json:"portalUrl,omitempty"` + PortalURL *string `json:"portalUrl,omitempty"` PrivateEndpointConnections *[]RemotePrivateEndpointConnectionWrapper `json:"privateEndpointConnections,omitempty"` PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -39,7 +39,7 @@ type ApiManagementServiceUpdateProperties struct { PublisherEmail *string `json:"publisherEmail,omitempty"` PublisherName *string `json:"publisherName,omitempty"` Restore *bool `json:"restore,omitempty"` - ScmUrl *string `json:"scmUrl,omitempty"` + ScmURL *string `json:"scmUrl,omitempty"` TargetProvisioningState *string `json:"targetProvisioningState,omitempty"` VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` VirtualNetworkType *VirtualNetworkType `json:"virtualNetworkType,omitempty"` diff --git a/resource-manager/apimanagement/2024-05-01/apioperationsbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2024-05-01/apioperationsbytag/model_apitagresourcecontractproperties.go index 29865d37c08..95eb4a2bed1 100644 --- a/resource-manager/apimanagement/2024-05-01/apioperationsbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2024-05-01/apioperationsbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/apirevision/model_apirevisioncontract.go b/resource-manager/apimanagement/2024-05-01/apirevision/model_apirevisioncontract.go index 3c366c0bef2..5a1d18799cc 100644 --- a/resource-manager/apimanagement/2024-05-01/apirevision/model_apirevisioncontract.go +++ b/resource-manager/apimanagement/2024-05-01/apirevision/model_apirevisioncontract.go @@ -16,7 +16,7 @@ type ApiRevisionContract struct { Description *string `json:"description,omitempty"` IsCurrent *bool `json:"isCurrent,omitempty"` IsOnline *bool `json:"isOnline,omitempty"` - PrivateUrl *string `json:"privateUrl,omitempty"` + PrivateURL *string `json:"privateUrl,omitempty"` UpdatedDateTime *string `json:"updatedDateTime,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/apirevision/predicates.go b/resource-manager/apimanagement/2024-05-01/apirevision/predicates.go index bd4911829a3..4f83cd3cb7b 100644 --- a/resource-manager/apimanagement/2024-05-01/apirevision/predicates.go +++ b/resource-manager/apimanagement/2024-05-01/apirevision/predicates.go @@ -10,7 +10,7 @@ type ApiRevisionContractOperationPredicate struct { Description *string IsCurrent *bool IsOnline *bool - PrivateUrl *string + PrivateURL *string UpdatedDateTime *string } @@ -40,7 +40,7 @@ func (p ApiRevisionContractOperationPredicate) Matches(input ApiRevisionContract return false } - if p.PrivateUrl != nil && (input.PrivateUrl == nil || *p.PrivateUrl != *input.PrivateUrl) { + if p.PrivateURL != nil && (input.PrivateURL == nil || *p.PrivateURL != *input.PrivateURL) { return false } diff --git a/resource-manager/apimanagement/2024-05-01/apisbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2024-05-01/apisbytag/model_apitagresourcecontractproperties.go index 33076efa3d1..18046859f0c 100644 --- a/resource-manager/apimanagement/2024-05-01/apisbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2024-05-01/apisbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/apitagdescription/model_tagdescriptionbaseproperties.go b/resource-manager/apimanagement/2024-05-01/apitagdescription/model_tagdescriptionbaseproperties.go index cb5c534f1af..06bd84a2665 100644 --- a/resource-manager/apimanagement/2024-05-01/apitagdescription/model_tagdescriptionbaseproperties.go +++ b/resource-manager/apimanagement/2024-05-01/apitagdescription/model_tagdescriptionbaseproperties.go @@ -6,5 +6,5 @@ package apitagdescription type TagDescriptionBaseProperties struct { Description *string `json:"description,omitempty"` ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` - ExternalDocsUrl *string `json:"externalDocsUrl,omitempty"` + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/apitagdescription/model_tagdescriptioncontractproperties.go b/resource-manager/apimanagement/2024-05-01/apitagdescription/model_tagdescriptioncontractproperties.go index 071eefae7d3..e3261d6e864 100644 --- a/resource-manager/apimanagement/2024-05-01/apitagdescription/model_tagdescriptioncontractproperties.go +++ b/resource-manager/apimanagement/2024-05-01/apitagdescription/model_tagdescriptioncontractproperties.go @@ -7,6 +7,6 @@ type TagDescriptionContractProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"` - ExternalDocsUrl *string `json:"externalDocsUrl,omitempty"` + ExternalDocsURL *string `json:"externalDocsUrl,omitempty"` TagId *string `json:"tagId,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/authorizationloginlinks/model_authorizationloginrequestcontract.go b/resource-manager/apimanagement/2024-05-01/authorizationloginlinks/model_authorizationloginrequestcontract.go index e324153247b..cb17aba4abd 100644 --- a/resource-manager/apimanagement/2024-05-01/authorizationloginlinks/model_authorizationloginrequestcontract.go +++ b/resource-manager/apimanagement/2024-05-01/authorizationloginlinks/model_authorizationloginrequestcontract.go @@ -4,5 +4,5 @@ package authorizationloginlinks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AuthorizationLoginRequestContract struct { - PostLoginRedirectUrl *string `json:"postLoginRedirectUrl,omitempty"` + PostLoginRedirectURL *string `json:"postLoginRedirectUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/authorizationprovider/model_authorizationprovideroauth2settings.go b/resource-manager/apimanagement/2024-05-01/authorizationprovider/model_authorizationprovideroauth2settings.go index cfcb9d0c4c2..3ff39bd7622 100644 --- a/resource-manager/apimanagement/2024-05-01/authorizationprovider/model_authorizationprovideroauth2settings.go +++ b/resource-manager/apimanagement/2024-05-01/authorizationprovider/model_authorizationprovideroauth2settings.go @@ -5,5 +5,5 @@ package authorizationprovider type AuthorizationProviderOAuth2Settings struct { GrantTypes *AuthorizationProviderOAuth2GrantTypes `json:"grantTypes,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/authorizationserver/README.md b/resource-manager/apimanagement/2024-05-01/authorizationserver/README.md index da05b3045ac..706cbc56184 100644 --- a/resource-manager/apimanagement/2024-05-01/authorizationserver/README.md +++ b/resource-manager/apimanagement/2024-05-01/authorizationserver/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") payload := authorizationserver.AuthorizationServerContract{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.Delete(ctx, id, authorizationserver.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") +id := authorizationserver.NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") payload := authorizationserver.AuthorizationServerUpdateContract{ // ... diff --git a/resource-manager/apimanagement/2024-05-01/authorizationserver/id_authorizationserver.go b/resource-manager/apimanagement/2024-05-01/authorizationserver/id_authorizationserver.go index f01fa1c02ff..abdc7ef410a 100644 --- a/resource-manager/apimanagement/2024-05-01/authorizationserver/id_authorizationserver.go +++ b/resource-manager/apimanagement/2024-05-01/authorizationserver/id_authorizationserver.go @@ -123,7 +123,7 @@ func (id AuthorizationServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticAuthorizationServers", "authorizationServers", "authorizationServers"), - resourceids.UserSpecifiedSegment("authorizationServerName", "authsid"), + resourceids.UserSpecifiedSegment("authorizationServerName", "authorizationServerName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/authorizationserver/id_authorizationserver_test.go b/resource-manager/apimanagement/2024-05-01/authorizationserver/id_authorizationserver_test.go index 5dabd493731..8df88eb6384 100644 --- a/resource-manager/apimanagement/2024-05-01/authorizationserver/id_authorizationserver_test.go +++ b/resource-manager/apimanagement/2024-05-01/authorizationserver/id_authorizationserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthorizationServerId{} func TestNewAuthorizationServerID(t *testing.T) { - id := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid") + id := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAuthorizationServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.AuthorizationServerName != "authsid" { - t.Fatalf("Expected %q but got %q for Segment 'AuthorizationServerName'", id.AuthorizationServerName, "authsid") + if id.AuthorizationServerName != "authorizationServerName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthorizationServerName'", id.AuthorizationServerName, "authorizationServerName") } } func TestFormatAuthorizationServerID(t *testing.T) { - actual := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authsid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid" + actual := NewAuthorizationServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "authorizationServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAuthorizationServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - AuthorizationServerName: "authsid", + AuthorizationServerName: "authorizationServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAuthorizationServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - AuthorizationServerName: "authsid", + AuthorizationServerName: "authorizationServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authsid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/authorizationServers/authorizationServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHoRiZaTiOnSeRvErNaMe", Expected: &AuthorizationServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - AuthorizationServerName: "aUtHsId", + AuthorizationServerName: "aUtHoRiZaTiOnSeRvErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/aUtHoRiZaTiOnSeRvErS/aUtHoRiZaTiOnSeRvErNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/deletedservice/README.md b/resource-manager/apimanagement/2024-05-01/deletedservice/README.md index b41b21102bb..d349280c04e 100644 --- a/resource-manager/apimanagement/2024-05-01/deletedservice/README.md +++ b/resource-manager/apimanagement/2024-05-01/deletedservice/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") +id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") read, err := client.GetByName(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") +id := deletedservice.NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/apimanagement/2024-05-01/deletedservice/id_deletedservice.go b/resource-manager/apimanagement/2024-05-01/deletedservice/id_deletedservice.go index 263d09e3295..7d68c8e679a 100644 --- a/resource-manager/apimanagement/2024-05-01/deletedservice/id_deletedservice.go +++ b/resource-manager/apimanagement/2024-05-01/deletedservice/id_deletedservice.go @@ -113,9 +113,9 @@ func (id DeletedServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApiManagement", "Microsoft.ApiManagement", "Microsoft.ApiManagement"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedServices", "deletedServices", "deletedServices"), - resourceids.UserSpecifiedSegment("deletedServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("deletedServiceName", "deletedServiceName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/deletedservice/id_deletedservice_test.go b/resource-manager/apimanagement/2024-05-01/deletedservice/id_deletedservice_test.go index f46fc3bb0b0..346ce344f6e 100644 --- a/resource-manager/apimanagement/2024-05-01/deletedservice/id_deletedservice_test.go +++ b/resource-manager/apimanagement/2024-05-01/deletedservice/id_deletedservice_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedServiceId{} func TestNewDeletedServiceID(t *testing.T) { - id := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName") + id := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedServiceName'", id.DeletedServiceName, "serviceName") + if id.DeletedServiceName != "deletedServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedServiceName'", id.DeletedServiceName, "deletedServiceName") } } func TestFormatDeletedServiceID(t *testing.T) { - actual := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "location", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName" + actual := NewDeletedServiceID("12345678-1234-9876-4563-123456789012", "locationName", "deletedServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedServiceName: "serviceName", + LocationName: "locationName", + DeletedServiceName: "deletedServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedServiceName: "serviceName", + LocationName: "locationName", + DeletedServiceName: "deletedServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/location/deletedServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ApiManagement/locations/locationName/deletedServices/deletedServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs/dElEtEdSeRvIcEnAmE", Expected: &DeletedServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedServiceName: "sErViCeNaMe", + LocationName: "lOcAtIoNnAmE", + DeletedServiceName: "dElEtEdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoN/dElEtEdSeRvIcEs/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSeRvIcEs/dElEtEdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/diagnostic/constants.go b/resource-manager/apimanagement/2024-05-01/diagnostic/constants.go index cde4ab74afa..200c1a288a2 100644 --- a/resource-manager/apimanagement/2024-05-01/diagnostic/constants.go +++ b/resource-manager/apimanagement/2024-05-01/diagnostic/constants.go @@ -136,13 +136,13 @@ type OperationNameFormat string const ( OperationNameFormatName OperationNameFormat = "Name" - OperationNameFormatUrl OperationNameFormat = "Url" + OperationNameFormatURL OperationNameFormat = "Url" ) func PossibleValuesForOperationNameFormat() []string { return []string{ string(OperationNameFormatName), - string(OperationNameFormatUrl), + string(OperationNameFormatURL), } } @@ -162,7 +162,7 @@ func (s *OperationNameFormat) UnmarshalJSON(bytes []byte) error { func parseOperationNameFormat(input string) (*OperationNameFormat, error) { vals := map[string]OperationNameFormat{ "name": OperationNameFormatName, - "url": OperationNameFormatUrl, + "url": OperationNameFormatURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/apimanagement/2024-05-01/gatewayapi/model_apicontractproperties.go b/resource-manager/apimanagement/2024-05-01/gatewayapi/model_apicontractproperties.go index 54fd88900fd..2acee539d77 100644 --- a/resource-manager/apimanagement/2024-05-01/gatewayapi/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2024-05-01/gatewayapi/model_apicontractproperties.go @@ -20,10 +20,10 @@ type ApiContractProperties struct { Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/README.md b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/README.md index ef9ba5f27df..491c4b75fa3 100644 --- a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/README.md +++ b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.CheckEntityExists(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.CreateOrUpdate(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") read, err := client.Delete(ctx, id) if err != nil { @@ -89,7 +89,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailCheckEntityExists(ctx, id) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailCreateOrUpdate(ctx, id) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") +id := notificationrecipientemail.NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") read, err := client.WorkspaceNotificationRecipientEmailDelete(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_notificationrecipientemail.go b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_notificationrecipientemail.go index 3835959001e..9d7956ead0c 100644 --- a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_notificationrecipientemail.go +++ b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_notificationrecipientemail.go @@ -147,7 +147,7 @@ func (id NotificationRecipientEmailId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNotifications", "notifications", "notifications"), resourceids.ConstantSegment("notificationName", PossibleValuesForNotificationName(), "AccountClosedPublisher"), resourceids.StaticSegment("staticRecipientEmails", "recipientEmails", "recipientEmails"), - resourceids.UserSpecifiedSegment("recipientEmailName", "email"), + resourceids.UserSpecifiedSegment("recipientEmailName", "recipientEmailName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_notificationrecipientemail_test.go b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_notificationrecipientemail_test.go index 3a9e65402fd..f76e7a473fd 100644 --- a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_notificationrecipientemail_test.go +++ b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_notificationrecipientemail_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NotificationRecipientEmailId{} func TestNewNotificationRecipientEmailID(t *testing.T) { - id := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email") + id := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,14 +34,14 @@ func TestNewNotificationRecipientEmailID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NotificationName'", id.NotificationName, "AccountClosedPublisher") } - if id.RecipientEmailName != "email" { - t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "email") + if id.RecipientEmailName != "recipientEmailName" { + t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "recipientEmailName") } } func TestFormatNotificationRecipientEmailID(t *testing.T) { - actual := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "email").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email" + actual := NewNotificationRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "AccountClosedPublisher", "recipientEmailName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -125,19 +125,19 @@ func TestParseNotificationRecipientEmailID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, } @@ -326,36 +326,36 @@ func TestParseNotificationRecipientEmailIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE", Expected: &NotificationRecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "eMaIl", + RecipientEmailName: "rEcIpIeNtEmAiLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_recipientemail.go b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_recipientemail.go index 3601ab09ace..49db7ac5e85 100644 --- a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_recipientemail.go +++ b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_recipientemail.go @@ -139,7 +139,7 @@ func (id RecipientEmailId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNotifications", "notifications", "notifications"), resourceids.ConstantSegment("notificationName", PossibleValuesForNotificationName(), "AccountClosedPublisher"), resourceids.StaticSegment("staticRecipientEmails", "recipientEmails", "recipientEmails"), - resourceids.UserSpecifiedSegment("recipientEmailName", "email"), + resourceids.UserSpecifiedSegment("recipientEmailName", "recipientEmailName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_recipientemail_test.go b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_recipientemail_test.go index 280f1ecd10d..a6d3a3a8b6b 100644 --- a/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_recipientemail_test.go +++ b/resource-manager/apimanagement/2024-05-01/notificationrecipientemail/id_recipientemail_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecipientEmailId{} func TestNewRecipientEmailID(t *testing.T) { - id := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email") + id := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRecipientEmailID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NotificationName'", id.NotificationName, "AccountClosedPublisher") } - if id.RecipientEmailName != "email" { - t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "email") + if id.RecipientEmailName != "recipientEmailName" { + t.Fatalf("Expected %q but got %q for Segment 'RecipientEmailName'", id.RecipientEmailName, "recipientEmailName") } } func TestFormatRecipientEmailID(t *testing.T) { - actual := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "email").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email" + actual := NewRecipientEmailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "AccountClosedPublisher", "recipientEmailName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseRecipientEmailID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseRecipientEmailIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "email", + RecipientEmailName: "recipientEmailName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/email/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/notifications/AccountClosedPublisher/recipientEmails/recipientEmailName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE", Expected: &RecipientEmailId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", NotificationName: "AccountClosedPublisher", - RecipientEmailName: "eMaIl", + RecipientEmailName: "rEcIpIeNtEmAiLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/eMaIl/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/nOtIfIcAtIoNs/aCcOuNtClOsEdPuBlIsHeR/rEcIpIeNtEmAiLs/rEcIpIeNtEmAiLnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/openidconnectprovider/README.md b/resource-manager/apimanagement/2024-05-01/openidconnectprovider/README.md index 9005669b4ae..26d58564666 100644 --- a/resource-manager/apimanagement/2024-05-01/openidconnectprovider/README.md +++ b/resource-manager/apimanagement/2024-05-01/openidconnectprovider/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") payload := openidconnectprovider.OpenidConnectProviderContract{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.Delete(ctx, id, openidconnectprovider.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") +id := openidconnectprovider.NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") payload := openidconnectprovider.OpenidConnectProviderUpdateContract{ // ... diff --git a/resource-manager/apimanagement/2024-05-01/openidconnectprovider/id_openidconnectprovider.go b/resource-manager/apimanagement/2024-05-01/openidconnectprovider/id_openidconnectprovider.go index 953e1cc9055..825b3b54bbb 100644 --- a/resource-manager/apimanagement/2024-05-01/openidconnectprovider/id_openidconnectprovider.go +++ b/resource-manager/apimanagement/2024-05-01/openidconnectprovider/id_openidconnectprovider.go @@ -123,7 +123,7 @@ func (id OpenidConnectProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticOpenidConnectProviders", "openidConnectProviders", "openidConnectProviders"), - resourceids.UserSpecifiedSegment("openidConnectProviderName", "opid"), + resourceids.UserSpecifiedSegment("openidConnectProviderName", "openidConnectProviderName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/openidconnectprovider/id_openidconnectprovider_test.go b/resource-manager/apimanagement/2024-05-01/openidconnectprovider/id_openidconnectprovider_test.go index fc41dc570ee..872dce4a46f 100644 --- a/resource-manager/apimanagement/2024-05-01/openidconnectprovider/id_openidconnectprovider_test.go +++ b/resource-manager/apimanagement/2024-05-01/openidconnectprovider/id_openidconnectprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenidConnectProviderId{} func TestNewOpenidConnectProviderID(t *testing.T) { - id := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid") + id := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOpenidConnectProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.OpenidConnectProviderName != "opid" { - t.Fatalf("Expected %q but got %q for Segment 'OpenidConnectProviderName'", id.OpenidConnectProviderName, "opid") + if id.OpenidConnectProviderName != "openidConnectProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenidConnectProviderName'", id.OpenidConnectProviderName, "openidConnectProviderName") } } func TestFormatOpenidConnectProviderID(t *testing.T) { - actual := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "opid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid" + actual := NewOpenidConnectProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "openidConnectProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOpenidConnectProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - OpenidConnectProviderName: "opid", + OpenidConnectProviderName: "openidConnectProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOpenidConnectProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - OpenidConnectProviderName: "opid", + OpenidConnectProviderName: "openidConnectProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/opid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/openidConnectProviders/openidConnectProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPeNiDcOnNeCtPrOvIdErNaMe", Expected: &OpenidConnectProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - OpenidConnectProviderName: "oPiD", + OpenidConnectProviderName: "oPeNiDcOnNeCtPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/oPeNiDcOnNeCtPrOvIdErS/oPeNiDcOnNeCtPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/policyfragment/README.md b/resource-manager/apimanagement/2024-05-01/policyfragment/README.md index 613fc2107c6..0294b12cdac 100644 --- a/resource-manager/apimanagement/2024-05-01/policyfragment/README.md +++ b/resource-manager/apimanagement/2024-05-01/policyfragment/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") payload := policyfragment.PolicyFragmentContract{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, policyfragment.Default ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.Delete(ctx, id, policyfragment.DefaultDeleteOperationOptions()) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.Get(ctx, id, policyfragment.DefaultGetOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") +id := policyfragment.NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") // alternatively `client.ListReferences(ctx, id, policyfragment.DefaultListReferencesOperationOptions())` can be used to do batched pagination items, err := client.ListReferencesComplete(ctx, id, policyfragment.DefaultListReferencesOperationOptions()) @@ -123,7 +123,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") payload := policyfragment.PolicyFragmentContract{ // ... @@ -140,7 +140,7 @@ if err := client.WorkspacePolicyFragmentCreateOrUpdateThenPoll(ctx, id, payload, ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentDelete(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentDeleteOperationOptions()) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentGet(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentGetOperationOptions()) if err != nil { @@ -172,7 +172,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") read, err := client.WorkspacePolicyFragmentGetEntityTag(ctx, id) if err != nil { @@ -205,7 +205,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") +id := policyfragment.NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") // alternatively `client.WorkspacePolicyFragmentListReferences(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentListReferencesOperationOptions())` can be used to do batched pagination items, err := client.WorkspacePolicyFragmentListReferencesComplete(ctx, id, policyfragment.DefaultWorkspacePolicyFragmentListReferencesOperationOptions()) diff --git a/resource-manager/apimanagement/2024-05-01/policyfragment/id_policyfragment.go b/resource-manager/apimanagement/2024-05-01/policyfragment/id_policyfragment.go index 52c258c9e81..5c3e062af19 100644 --- a/resource-manager/apimanagement/2024-05-01/policyfragment/id_policyfragment.go +++ b/resource-manager/apimanagement/2024-05-01/policyfragment/id_policyfragment.go @@ -123,7 +123,7 @@ func (id PolicyFragmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPolicyFragments", "policyFragments", "policyFragments"), - resourceids.UserSpecifiedSegment("policyFragmentName", "id"), + resourceids.UserSpecifiedSegment("policyFragmentName", "policyFragmentName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/policyfragment/id_policyfragment_test.go b/resource-manager/apimanagement/2024-05-01/policyfragment/id_policyfragment_test.go index 97a99d4ee04..ac2a6a9e415 100644 --- a/resource-manager/apimanagement/2024-05-01/policyfragment/id_policyfragment_test.go +++ b/resource-manager/apimanagement/2024-05-01/policyfragment/id_policyfragment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PolicyFragmentId{} func TestNewPolicyFragmentID(t *testing.T) { - id := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id") + id := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPolicyFragmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PolicyFragmentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "id") + if id.PolicyFragmentName != "policyFragmentName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "policyFragmentName") } } func TestFormatPolicyFragmentID(t *testing.T) { - actual := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id" + actual := NewPolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "policyFragmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePolicyFragmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePolicyFragmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/policyFragments/policyFragmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE", Expected: &PolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - PolicyFragmentName: "iD", + PolicyFragmentName: "pOlIcYfRaGmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/policyfragment/id_workspacepolicyfragment.go b/resource-manager/apimanagement/2024-05-01/policyfragment/id_workspacepolicyfragment.go index 397dfee80d9..3449e07796e 100644 --- a/resource-manager/apimanagement/2024-05-01/policyfragment/id_workspacepolicyfragment.go +++ b/resource-manager/apimanagement/2024-05-01/policyfragment/id_workspacepolicyfragment.go @@ -131,7 +131,7 @@ func (id WorkspacePolicyFragmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceId", "workspaceId"), resourceids.StaticSegment("staticPolicyFragments", "policyFragments", "policyFragments"), - resourceids.UserSpecifiedSegment("policyFragmentName", "id"), + resourceids.UserSpecifiedSegment("policyFragmentName", "policyFragmentName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/policyfragment/id_workspacepolicyfragment_test.go b/resource-manager/apimanagement/2024-05-01/policyfragment/id_workspacepolicyfragment_test.go index 36b415dce85..606baf42bd0 100644 --- a/resource-manager/apimanagement/2024-05-01/policyfragment/id_workspacepolicyfragment_test.go +++ b/resource-manager/apimanagement/2024-05-01/policyfragment/id_workspacepolicyfragment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePolicyFragmentId{} func TestNewWorkspacePolicyFragmentID(t *testing.T) { - id := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id") + id := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewWorkspacePolicyFragmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceId'", id.WorkspaceId, "workspaceId") } - if id.PolicyFragmentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "id") + if id.PolicyFragmentName != "policyFragmentName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicyFragmentName'", id.PolicyFragmentName, "policyFragmentName") } } func TestFormatWorkspacePolicyFragmentID(t *testing.T) { - actual := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id" + actual := NewWorkspacePolicyFragmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "policyFragmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseWorkspacePolicyFragmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseWorkspacePolicyFragmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - PolicyFragmentName: "id", + PolicyFragmentName: "policyFragmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/policyFragments/policyFragmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE", Expected: &WorkspacePolicyFragmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", - PolicyFragmentName: "iD", + PolicyFragmentName: "pOlIcYfRaGmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/pOlIcYfRaGmEnTs/pOlIcYfRaGmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/portalconfig/model_portalconfigdelegationproperties.go b/resource-manager/apimanagement/2024-05-01/portalconfig/model_portalconfigdelegationproperties.go index 3d2fa8ed0b6..625bb0da1f5 100644 --- a/resource-manager/apimanagement/2024-05-01/portalconfig/model_portalconfigdelegationproperties.go +++ b/resource-manager/apimanagement/2024-05-01/portalconfig/model_portalconfigdelegationproperties.go @@ -6,6 +6,6 @@ package portalconfig type PortalConfigDelegationProperties struct { DelegateRegistration *bool `json:"delegateRegistration,omitempty"` DelegateSubscription *bool `json:"delegateSubscription,omitempty"` - DelegationUrl *string `json:"delegationUrl,omitempty"` + DelegationURL *string `json:"delegationUrl,omitempty"` ValidationKey *string `json:"validationKey,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/privateendpointconnections/README.md b/resource-manager/apimanagement/2024-05-01/privateendpointconnections/README.md index 16edbab51eb..7a6db005f51 100644 --- a/resource-manager/apimanagement/2024-05-01/privateendpointconnections/README.md +++ b/resource-manager/apimanagement/2024-05-01/privateendpointconnections/README.md @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName") +id := privateendpointconnections.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.PrivateEndpointConnectionGetPrivateLinkResource(ctx, id) if err != nil { diff --git a/resource-manager/apimanagement/2024-05-01/privateendpointconnections/id_privatelinkresource.go b/resource-manager/apimanagement/2024-05-01/privateendpointconnections/id_privatelinkresource.go index 4a1c82d0b48..964e0869832 100644 --- a/resource-manager/apimanagement/2024-05-01/privateendpointconnections/id_privatelinkresource.go +++ b/resource-manager/apimanagement/2024-05-01/privateendpointconnections/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkSubResourceName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/privateendpointconnections/id_privatelinkresource_test.go b/resource-manager/apimanagement/2024-05-01/privateendpointconnections/id_privatelinkresource_test.go index bc466d49545..0df9bb10d6f 100644 --- a/resource-manager/apimanagement/2024-05-01/privateendpointconnections/id_privatelinkresource_test.go +++ b/resource-manager/apimanagement/2024-05-01/privateendpointconnections/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "privateLinkSubResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkSubResourceName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkSubResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PrivateLinkResourceName: "privateLinkSubResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - PrivateLinkResourceName: "privateLinkSubResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkSubResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkSuBrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - PrivateLinkResourceName: "pRiVaTeLiNkSuBrEsOuRcEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkSuBrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/productapi/model_apicontractproperties.go b/resource-manager/apimanagement/2024-05-01/productapi/model_apicontractproperties.go index ff4acc2668f..1c436fc9227 100644 --- a/resource-manager/apimanagement/2024-05-01/productapi/model_apicontractproperties.go +++ b/resource-manager/apimanagement/2024-05-01/productapi/model_apicontractproperties.go @@ -20,10 +20,10 @@ type ApiContractProperties struct { Path string `json:"path"` Protocols *[]Protocol `json:"protocols,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SourceApiId *string `json:"sourceApiId,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/productsbytag/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2024-05-01/productsbytag/model_apitagresourcecontractproperties.go index 5b6004615a2..3f71e4a2d31 100644 --- a/resource-manager/apimanagement/2024-05-01/productsbytag/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2024-05-01/productsbytag/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/subscription/README.md b/resource-manager/apimanagement/2024-05-01/subscription/README.md index 6d20887b515..b25ce59038d 100644 --- a/resource-manager/apimanagement/2024-05-01/subscription/README.md +++ b/resource-manager/apimanagement/2024-05-01/subscription/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") payload := subscription.SubscriptionCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.Delete(ctx, id, subscription.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.GetEntityTag(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.RegeneratePrimaryKey(ctx, id) if err != nil { @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") read, err := client.RegenerateSecondaryKey(ctx, id) if err != nil { @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") +id := subscription.NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") payload := subscription.SubscriptionUpdateParameters{ // ... @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid") +id := subscription.NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName") read, err := client.UserSubscriptionGet(ctx, id) if err != nil { @@ -195,7 +195,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") payload := subscription.SubscriptionCreateParameters{ // ... @@ -216,7 +216,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionDelete(ctx, id, subscription.DefaultWorkspaceSubscriptionDeleteOperationOptions()) if err != nil { @@ -232,7 +232,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionGet(ctx, id) if err != nil { @@ -248,7 +248,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionGetEntityTag(ctx, id) if err != nil { @@ -281,7 +281,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionListSecrets(ctx, id) if err != nil { @@ -297,7 +297,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionRegeneratePrimaryKey(ctx, id) if err != nil { @@ -313,7 +313,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") read, err := client.WorkspaceSubscriptionRegenerateSecondaryKey(ctx, id) if err != nil { @@ -329,7 +329,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") +id := subscription.NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") payload := subscription.SubscriptionUpdateParameters{ // ... diff --git a/resource-manager/apimanagement/2024-05-01/subscription/id_subscriptions2.go b/resource-manager/apimanagement/2024-05-01/subscription/id_subscriptions2.go index a0f82191a95..dc35783e6da 100644 --- a/resource-manager/apimanagement/2024-05-01/subscription/id_subscriptions2.go +++ b/resource-manager/apimanagement/2024-05-01/subscription/id_subscriptions2.go @@ -123,7 +123,7 @@ func (id Subscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticService", "service", "service"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/subscription/id_subscriptions2_test.go b/resource-manager/apimanagement/2024-05-01/subscription/id_subscriptions2_test.go index 16b9320bc0f..0b5f8ad522c 100644 --- a/resource-manager/apimanagement/2024-05-01/subscription/id_subscriptions2_test.go +++ b/resource-manager/apimanagement/2024-05-01/subscription/id_subscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Subscriptions2Id{} func TestNewSubscriptions2ID(t *testing.T) { - id := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid") + id := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatSubscriptions2ID(t *testing.T) { - actual := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid" + actual := NewSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &Subscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/subscription/id_usersubscriptions2.go b/resource-manager/apimanagement/2024-05-01/subscription/id_usersubscriptions2.go index 3a5d835af6a..043845b67ba 100644 --- a/resource-manager/apimanagement/2024-05-01/subscription/id_usersubscriptions2.go +++ b/resource-manager/apimanagement/2024-05-01/subscription/id_usersubscriptions2.go @@ -131,7 +131,7 @@ func (id UserSubscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userId", "userId"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/subscription/id_usersubscriptions2_test.go b/resource-manager/apimanagement/2024-05-01/subscription/id_usersubscriptions2_test.go index 5b7705f22d5..783e8fa0bdb 100644 --- a/resource-manager/apimanagement/2024-05-01/subscription/id_usersubscriptions2_test.go +++ b/resource-manager/apimanagement/2024-05-01/subscription/id_usersubscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserSubscriptions2Id{} func TestNewUserSubscriptions2ID(t *testing.T) { - id := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid") + id := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewUserSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserId'", id.UserId, "userId") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatUserSubscriptions2ID(t *testing.T) { - actual := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid" + actual := NewUserSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseUserSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", UserId: "userId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseUserSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", UserId: "userId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/users/userId/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &UserSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", UserId: "uSeRiD", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/uSeRs/uSeRiD/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/subscription/id_workspacesubscriptions2.go b/resource-manager/apimanagement/2024-05-01/subscription/id_workspacesubscriptions2.go index e99c7a5322d..899ffd622e9 100644 --- a/resource-manager/apimanagement/2024-05-01/subscription/id_workspacesubscriptions2.go +++ b/resource-manager/apimanagement/2024-05-01/subscription/id_workspacesubscriptions2.go @@ -131,7 +131,7 @@ func (id WorkspaceSubscriptions2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceId", "workspaceId"), resourceids.StaticSegment("staticSubscriptions2", "subscriptions", "subscriptions"), - resourceids.UserSpecifiedSegment("subscriptionName", "sid"), + resourceids.UserSpecifiedSegment("subscriptionName", "subscriptionName"), } } diff --git a/resource-manager/apimanagement/2024-05-01/subscription/id_workspacesubscriptions2_test.go b/resource-manager/apimanagement/2024-05-01/subscription/id_workspacesubscriptions2_test.go index ec4bcd6c747..f4e6288191e 100644 --- a/resource-manager/apimanagement/2024-05-01/subscription/id_workspacesubscriptions2_test.go +++ b/resource-manager/apimanagement/2024-05-01/subscription/id_workspacesubscriptions2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspaceSubscriptions2Id{} func TestNewWorkspaceSubscriptions2ID(t *testing.T) { - id := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid") + id := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewWorkspaceSubscriptions2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceId'", id.WorkspaceId, "workspaceId") } - if id.SubscriptionName != "sid" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "sid") + if id.SubscriptionName != "subscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionName'", id.SubscriptionName, "subscriptionName") } } func TestFormatWorkspaceSubscriptions2ID(t *testing.T) { - actual := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "sid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid" + actual := NewWorkspaceSubscriptions2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "workspaceId", "subscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseWorkspaceSubscriptions2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseWorkspaceSubscriptions2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServiceName: "serviceName", WorkspaceId: "workspaceId", - SubscriptionName: "sid", + SubscriptionName: "subscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/sid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ApiManagement/service/serviceName/workspaces/workspaceId/subscriptions/subscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sUbScRiPtIoNnAmE", Expected: &WorkspaceSubscriptions2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServiceName: "sErViCeNaMe", WorkspaceId: "wOrKsPaCeId", - SubscriptionName: "sId", + SubscriptionName: "sUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPiMaNaGeMeNt/sErViCe/sErViCeNaMe/wOrKsPaCeS/wOrKsPaCeId/sUbScRiPtIoNs/sUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/apimanagement/2024-05-01/tagresource/model_apitagresourcecontractproperties.go b/resource-manager/apimanagement/2024-05-01/tagresource/model_apitagresourcecontractproperties.go index a64045d1ae4..1866cde6007 100644 --- a/resource-manager/apimanagement/2024-05-01/tagresource/model_apitagresourcecontractproperties.go +++ b/resource-manager/apimanagement/2024-05-01/tagresource/model_apitagresourcecontractproperties.go @@ -19,9 +19,9 @@ type ApiTagResourceContractProperties struct { Name *string `json:"name,omitempty"` Path *string `json:"path,omitempty"` Protocols *[]Protocol `json:"protocols,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - TermsOfServiceUrl *string `json:"termsOfServiceUrl,omitempty"` + TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` Type *ApiType `json:"type,omitempty"` } diff --git a/resource-manager/apimanagement/2024-05-01/users/README.md b/resource-manager/apimanagement/2024-05-01/users/README.md index 89f32a66c84..a8c27e36ae0 100644 --- a/resource-manager/apimanagement/2024-05-01/users/README.md +++ b/resource-manager/apimanagement/2024-05-01/users/README.md @@ -20,13 +20,13 @@ client.Client.Authorizer = authorizer ``` -### Example Usage: `UsersClient.UserGenerateSsoUrl` +### Example Usage: `UsersClient.UserGenerateSsoURL` ```go ctx := context.TODO() id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "userId") -read, err := client.UserGenerateSsoUrl(ctx, id) +read, err := client.UserGenerateSsoURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/apimanagement/2024-05-01/users/method_usergeneratessourl.go b/resource-manager/apimanagement/2024-05-01/users/method_usergeneratessourl.go index bab32e3f071..211e849804c 100644 --- a/resource-manager/apimanagement/2024-05-01/users/method_usergeneratessourl.go +++ b/resource-manager/apimanagement/2024-05-01/users/method_usergeneratessourl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UserGenerateSsoUrlOperationResponse struct { +type UserGenerateSsoURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *GenerateSsoUrlResult + Model *GenerateSsoURLResult } -// UserGenerateSsoUrl ... -func (c UsersClient) UserGenerateSsoUrl(ctx context.Context, id UserId) (result UserGenerateSsoUrlOperationResponse, err error) { +// UserGenerateSsoURL ... +func (c UsersClient) UserGenerateSsoURL(ctx context.Context, id UserId) (result UserGenerateSsoURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c UsersClient) UserGenerateSsoUrl(ctx context.Context, id UserId) (result return } - var model GenerateSsoUrlResult + var model GenerateSsoURLResult result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/apimanagement/2024-05-01/users/model_generatessourlresult.go b/resource-manager/apimanagement/2024-05-01/users/model_generatessourlresult.go index f78768f2f31..6a9b6202d10 100644 --- a/resource-manager/apimanagement/2024-05-01/users/model_generatessourlresult.go +++ b/resource-manager/apimanagement/2024-05-01/users/model_generatessourlresult.go @@ -3,6 +3,6 @@ package users // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GenerateSsoUrlResult struct { +type GenerateSsoURLResult struct { Value *string `json:"value,omitempty"` } diff --git a/resource-manager/appconfiguration/2023-03-01/configurationstores/README.md b/resource-manager/appconfiguration/2023-03-01/configurationstores/README.md index abbb21625fa..6e2b3e7176e 100644 --- a/resource-manager/appconfiguration/2023-03-01/configurationstores/README.md +++ b/resource-manager/appconfiguration/2023-03-01/configurationstores/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") payload := configurationstores.ConfigurationStore{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") // alternatively `client.ListKeys(ctx, id)` can be used to do batched pagination items, err := client.ListKeysComplete(ctx, id) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") payload := configurationstores.RegenerateKeyParameters{ // ... @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") payload := configurationstores.ConfigurationStoreUpdateParameters{ // ... diff --git a/resource-manager/appconfiguration/2023-03-01/configurationstores/id_configurationstore.go b/resource-manager/appconfiguration/2023-03-01/configurationstores/id_configurationstore.go index 1f9979c2de1..9478e62c36f 100644 --- a/resource-manager/appconfiguration/2023-03-01/configurationstores/id_configurationstore.go +++ b/resource-manager/appconfiguration/2023-03-01/configurationstores/id_configurationstore.go @@ -115,7 +115,7 @@ func (id ConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2023-03-01/configurationstores/id_configurationstore_test.go b/resource-manager/appconfiguration/2023-03-01/configurationstores/id_configurationstore_test.go index b1529d0eb30..891c3257ab5 100644 --- a/resource-manager/appconfiguration/2023-03-01/configurationstores/id_configurationstore_test.go +++ b/resource-manager/appconfiguration/2023-03-01/configurationstores/id_configurationstore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationStoreId{} func TestNewConfigurationStoreID(t *testing.T) { - id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") + id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConfigurationStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } } func TestFormatConfigurationStoreID(t *testing.T) { - actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName" + actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConfigurationStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConfigurationStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/README.md b/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/README.md index f42b335db65..40bd50ba65f 100644 --- a/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/README.md +++ b/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedconfigurationstores.NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "location", "configStoreName") +id := deletedconfigurationstores.NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "locationName", "deletedConfigurationStoreName") read, err := client.ConfigurationStoresGetDeleted(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedconfigurationstores.NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "location", "configStoreName") +id := deletedconfigurationstores.NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "locationName", "deletedConfigurationStoreName") if err := client.ConfigurationStoresPurgeDeletedThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/id_deletedconfigurationstore.go b/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/id_deletedconfigurationstore.go index cac572bcb19..4ef8a2a6be5 100644 --- a/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/id_deletedconfigurationstore.go +++ b/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/id_deletedconfigurationstore.go @@ -113,9 +113,9 @@ func (id DeletedConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedConfigurationStores", "deletedConfigurationStores", "deletedConfigurationStores"), - resourceids.UserSpecifiedSegment("deletedConfigurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("deletedConfigurationStoreName", "deletedConfigurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/id_deletedconfigurationstore_test.go b/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/id_deletedconfigurationstore_test.go index 156d07bf91f..bbbbbe12847 100644 --- a/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/id_deletedconfigurationstore_test.go +++ b/resource-manager/appconfiguration/2023-03-01/deletedconfigurationstores/id_deletedconfigurationstore_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedConfigurationStoreId{} func TestNewDeletedConfigurationStoreID(t *testing.T) { - id := NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "location", "configStoreName") + id := NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "locationName", "deletedConfigurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedConfigurationStoreName'", id.DeletedConfigurationStoreName, "configStoreName") + if id.DeletedConfigurationStoreName != "deletedConfigurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedConfigurationStoreName'", id.DeletedConfigurationStoreName, "deletedConfigurationStoreName") } } func TestFormatDeletedConfigurationStoreID(t *testing.T) { - actual := NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "location", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName" + actual := NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "locationName", "deletedConfigurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedConfigurationStoreID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName", Expected: &DeletedConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedConfigurationStoreName: "configStoreName", + LocationName: "locationName", + DeletedConfigurationStoreName: "deletedConfigurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedConfigurationStoreIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN/dElEtEdCoNfIgUrAtIoNsToReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdCoNfIgUrAtIoNsToReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName", Expected: &DeletedConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedConfigurationStoreName: "configStoreName", + LocationName: "locationName", + DeletedConfigurationStoreName: "deletedConfigurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN/dElEtEdCoNfIgUrAtIoNsToReS/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdCoNfIgUrAtIoNsToReS/dElEtEdCoNfIgUrAtIoNsToReNaMe", Expected: &DeletedConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedConfigurationStoreName: "cOnFiGsToReNaMe", + LocationName: "lOcAtIoNnAmE", + DeletedConfigurationStoreName: "dElEtEdCoNfIgUrAtIoNsToReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN/dElEtEdCoNfIgUrAtIoNsToReS/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdCoNfIgUrAtIoNsToReS/dElEtEdCoNfIgUrAtIoNsToReNaMe/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/keyvalues/README.md b/resource-manager/appconfiguration/2023-03-01/keyvalues/README.md index 7fe28a36cdc..e2b4c6af149 100644 --- a/resource-manager/appconfiguration/2023-03-01/keyvalues/README.md +++ b/resource-manager/appconfiguration/2023-03-01/keyvalues/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName") +id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName") payload := keyvalues.KeyValue{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName") +id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName") +id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/appconfiguration/2023-03-01/keyvalues/id_keyvalue.go b/resource-manager/appconfiguration/2023-03-01/keyvalues/id_keyvalue.go index 18f8b18baf3..049eaf65e4e 100644 --- a/resource-manager/appconfiguration/2023-03-01/keyvalues/id_keyvalue.go +++ b/resource-manager/appconfiguration/2023-03-01/keyvalues/id_keyvalue.go @@ -121,7 +121,7 @@ func (id KeyValueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticKeyValues", "keyValues", "keyValues"), resourceids.UserSpecifiedSegment("keyValueName", "keyValueName"), } diff --git a/resource-manager/appconfiguration/2023-03-01/keyvalues/id_keyvalue_test.go b/resource-manager/appconfiguration/2023-03-01/keyvalues/id_keyvalue_test.go index c2bdb93b0c3..46ba2b1e092 100644 --- a/resource-manager/appconfiguration/2023-03-01/keyvalues/id_keyvalue_test.go +++ b/resource-manager/appconfiguration/2023-03-01/keyvalues/id_keyvalue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KeyValueId{} func TestNewKeyValueID(t *testing.T) { - id := NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName") + id := NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewKeyValueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } if id.KeyValueName != "keyValueName" { @@ -32,8 +32,8 @@ func TestNewKeyValueID(t *testing.T) { } func TestFormatKeyValueID(t *testing.T) { - actual := NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName" + actual := NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseKeyValueID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName", Expected: &KeyValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", KeyValueName: "keyValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseKeyValueIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/kEyVaLuEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/kEyVaLuEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName", Expected: &KeyValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", KeyValueName: "keyValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/kEyVaLuEs/kEyVaLuEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/kEyVaLuEs/kEyVaLuEnAmE", Expected: &KeyValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", KeyValueName: "kEyVaLuEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/kEyVaLuEs/kEyVaLuEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/kEyVaLuEs/kEyVaLuEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/operations/README.md b/resource-manager/appconfiguration/2023-03-01/operations/README.md index 26dfa44d98a..23659e82f6d 100644 --- a/resource-manager/appconfiguration/2023-03-01/operations/README.md +++ b/resource-manager/appconfiguration/2023-03-01/operations/README.md @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := operations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := operations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := operations.CheckNameAvailabilityParameters{ // ... diff --git a/resource-manager/appconfiguration/2023-03-01/operations/id_location.go b/resource-manager/appconfiguration/2023-03-01/operations/id_location.go index c8ec5121b15..19ad542af45 100644 --- a/resource-manager/appconfiguration/2023-03-01/operations/id_location.go +++ b/resource-manager/appconfiguration/2023-03-01/operations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/appconfiguration/2023-03-01/operations/id_location_test.go b/resource-manager/appconfiguration/2023-03-01/operations/id_location_test.go index e6ea738a067..2fcad889c69 100644 --- a/resource-manager/appconfiguration/2023-03-01/operations/id_location_test.go +++ b/resource-manager/appconfiguration/2023-03-01/operations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/README.md b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/README.md index 04594562cc3..80c0b6c1ca9 100644 --- a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/README.md +++ b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := privateendpointconnections.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") // alternatively `client.ListByConfigurationStore(ctx, id)` can be used to do batched pagination items, err := client.ListByConfigurationStoreComplete(ctx, id) diff --git a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_configurationstore.go b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_configurationstore.go index fd3979499a6..594b686634c 100644 --- a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_configurationstore.go +++ b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_configurationstore.go @@ -115,7 +115,7 @@ func (id ConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_configurationstore_test.go b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_configurationstore_test.go index 26bb0392955..fa13eb119ba 100644 --- a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_configurationstore_test.go +++ b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_configurationstore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationStoreId{} func TestNewConfigurationStoreID(t *testing.T) { - id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") + id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConfigurationStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } } func TestFormatConfigurationStoreID(t *testing.T) { - actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName" + actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConfigurationStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConfigurationStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_privateendpointconnection.go index a04b9e58d89..488f42f1ab2 100644 --- a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_privateendpointconnection_test.go index 872e83149ba..25a1c40ad58 100644 --- a/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/appconfiguration/2023-03-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/README.md b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/README.md index ac005f24f8d..57237c2b446 100644 --- a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/README.md +++ b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := privatelinkresources.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") // alternatively `client.ListByConfigurationStore(ctx, id)` can be used to do batched pagination items, err := client.ListByConfigurationStoreComplete(ctx, id) diff --git a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_configurationstore.go b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_configurationstore.go index c8b624a3f7e..a60853b9599 100644 --- a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_configurationstore.go +++ b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_configurationstore.go @@ -115,7 +115,7 @@ func (id ConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_configurationstore_test.go b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_configurationstore_test.go index 026ce2bfbb2..a2dab0cfcf3 100644 --- a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_configurationstore_test.go +++ b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_configurationstore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationStoreId{} func TestNewConfigurationStoreID(t *testing.T) { - id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") + id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConfigurationStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } } func TestFormatConfigurationStoreID(t *testing.T) { - actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName" + actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConfigurationStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConfigurationStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_privatelinkresource.go b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_privatelinkresource.go index 0898a1a8fae..79f919649d1 100644 --- a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_privatelinkresource_test.go index f81ab46004e..e6de81e60a9 100644 --- a/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/appconfiguration/2023-03-01/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", - PrivateLinkResourceName: "groupName", + ConfigurationStoreName: "configurationStoreName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", - PrivateLinkResourceName: "groupName", + ConfigurationStoreName: "configurationStoreName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/replicas/README.md b/resource-manager/appconfiguration/2023-03-01/replicas/README.md index c88d9c0724f..673ac086c93 100644 --- a/resource-manager/appconfiguration/2023-03-01/replicas/README.md +++ b/resource-manager/appconfiguration/2023-03-01/replicas/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName") +id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName") payload := replicas.Replica{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName") +id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName") +id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicas.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := replicas.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") // alternatively `client.ListByConfigurationStore(ctx, id)` can be used to do batched pagination items, err := client.ListByConfigurationStoreComplete(ctx, id) diff --git a/resource-manager/appconfiguration/2023-03-01/replicas/id_configurationstore.go b/resource-manager/appconfiguration/2023-03-01/replicas/id_configurationstore.go index 6adea53e9da..512674a58e4 100644 --- a/resource-manager/appconfiguration/2023-03-01/replicas/id_configurationstore.go +++ b/resource-manager/appconfiguration/2023-03-01/replicas/id_configurationstore.go @@ -115,7 +115,7 @@ func (id ConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2023-03-01/replicas/id_configurationstore_test.go b/resource-manager/appconfiguration/2023-03-01/replicas/id_configurationstore_test.go index f66232bd5d8..58a5db51ca8 100644 --- a/resource-manager/appconfiguration/2023-03-01/replicas/id_configurationstore_test.go +++ b/resource-manager/appconfiguration/2023-03-01/replicas/id_configurationstore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationStoreId{} func TestNewConfigurationStoreID(t *testing.T) { - id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") + id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConfigurationStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } } func TestFormatConfigurationStoreID(t *testing.T) { - actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName" + actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConfigurationStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConfigurationStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2023-03-01/replicas/id_replica.go b/resource-manager/appconfiguration/2023-03-01/replicas/id_replica.go index 908443a24d4..1f6a6991799 100644 --- a/resource-manager/appconfiguration/2023-03-01/replicas/id_replica.go +++ b/resource-manager/appconfiguration/2023-03-01/replicas/id_replica.go @@ -121,7 +121,7 @@ func (id ReplicaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticReplicas", "replicas", "replicas"), resourceids.UserSpecifiedSegment("replicaName", "replicaName"), } diff --git a/resource-manager/appconfiguration/2023-03-01/replicas/id_replica_test.go b/resource-manager/appconfiguration/2023-03-01/replicas/id_replica_test.go index 3053e716983..0c7d6e7a9d8 100644 --- a/resource-manager/appconfiguration/2023-03-01/replicas/id_replica_test.go +++ b/resource-manager/appconfiguration/2023-03-01/replicas/id_replica_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicaId{} func TestNewReplicaID(t *testing.T) { - id := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName") + id := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewReplicaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } if id.ReplicaName != "replicaName" { @@ -32,8 +32,8 @@ func TestNewReplicaID(t *testing.T) { } func TestFormatReplicaID(t *testing.T) { - actual := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName" + actual := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicaID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", ReplicaName: "replicaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicaIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/rEpLiCaS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/rEpLiCaS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", ReplicaName: "replicaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/rEpLiCaS/rEpLiCaNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/rEpLiCaS/rEpLiCaNaMe", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", ReplicaName: "rEpLiCaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/rEpLiCaS/rEpLiCaNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/rEpLiCaS/rEpLiCaNaMe/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/configurationstores/README.md b/resource-manager/appconfiguration/2024-05-01/configurationstores/README.md index 3e9f2035b06..c5d3e2c5f47 100644 --- a/resource-manager/appconfiguration/2024-05-01/configurationstores/README.md +++ b/resource-manager/appconfiguration/2024-05-01/configurationstores/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") payload := configurationstores.ConfigurationStore{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") // alternatively `client.ListKeys(ctx, id)` can be used to do batched pagination items, err := client.ListKeysComplete(ctx, id) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") payload := configurationstores.RegenerateKeyParameters{ // ... @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := configurationstores.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") payload := configurationstores.ConfigurationStoreUpdateParameters{ // ... diff --git a/resource-manager/appconfiguration/2024-05-01/configurationstores/id_configurationstore.go b/resource-manager/appconfiguration/2024-05-01/configurationstores/id_configurationstore.go index 1f9979c2de1..9478e62c36f 100644 --- a/resource-manager/appconfiguration/2024-05-01/configurationstores/id_configurationstore.go +++ b/resource-manager/appconfiguration/2024-05-01/configurationstores/id_configurationstore.go @@ -115,7 +115,7 @@ func (id ConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2024-05-01/configurationstores/id_configurationstore_test.go b/resource-manager/appconfiguration/2024-05-01/configurationstores/id_configurationstore_test.go index b1529d0eb30..891c3257ab5 100644 --- a/resource-manager/appconfiguration/2024-05-01/configurationstores/id_configurationstore_test.go +++ b/resource-manager/appconfiguration/2024-05-01/configurationstores/id_configurationstore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationStoreId{} func TestNewConfigurationStoreID(t *testing.T) { - id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") + id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConfigurationStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } } func TestFormatConfigurationStoreID(t *testing.T) { - actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName" + actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConfigurationStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConfigurationStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/README.md b/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/README.md index 686e50fe2a4..3927ad69b14 100644 --- a/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/README.md +++ b/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedconfigurationstores.NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "location", "configStoreName") +id := deletedconfigurationstores.NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "locationName", "deletedConfigurationStoreName") read, err := client.ConfigurationStoresGetDeleted(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedconfigurationstores.NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "location", "configStoreName") +id := deletedconfigurationstores.NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "locationName", "deletedConfigurationStoreName") if err := client.ConfigurationStoresPurgeDeletedThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/id_deletedconfigurationstore.go b/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/id_deletedconfigurationstore.go index cac572bcb19..4ef8a2a6be5 100644 --- a/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/id_deletedconfigurationstore.go +++ b/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/id_deletedconfigurationstore.go @@ -113,9 +113,9 @@ func (id DeletedConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedConfigurationStores", "deletedConfigurationStores", "deletedConfigurationStores"), - resourceids.UserSpecifiedSegment("deletedConfigurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("deletedConfigurationStoreName", "deletedConfigurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/id_deletedconfigurationstore_test.go b/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/id_deletedconfigurationstore_test.go index 156d07bf91f..bbbbbe12847 100644 --- a/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/id_deletedconfigurationstore_test.go +++ b/resource-manager/appconfiguration/2024-05-01/deletedconfigurationstores/id_deletedconfigurationstore_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedConfigurationStoreId{} func TestNewDeletedConfigurationStoreID(t *testing.T) { - id := NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "location", "configStoreName") + id := NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "locationName", "deletedConfigurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedConfigurationStoreName'", id.DeletedConfigurationStoreName, "configStoreName") + if id.DeletedConfigurationStoreName != "deletedConfigurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedConfigurationStoreName'", id.DeletedConfigurationStoreName, "deletedConfigurationStoreName") } } func TestFormatDeletedConfigurationStoreID(t *testing.T) { - actual := NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "location", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName" + actual := NewDeletedConfigurationStoreID("12345678-1234-9876-4563-123456789012", "locationName", "deletedConfigurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedConfigurationStoreID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName", Expected: &DeletedConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedConfigurationStoreName: "configStoreName", + LocationName: "locationName", + DeletedConfigurationStoreName: "deletedConfigurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedConfigurationStoreIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN/dElEtEdCoNfIgUrAtIoNsToReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdCoNfIgUrAtIoNsToReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName", Expected: &DeletedConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedConfigurationStoreName: "configStoreName", + LocationName: "locationName", + DeletedConfigurationStoreName: "deletedConfigurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/deletedConfigurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/deletedConfigurationStores/deletedConfigurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN/dElEtEdCoNfIgUrAtIoNsToReS/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdCoNfIgUrAtIoNsToReS/dElEtEdCoNfIgUrAtIoNsToReNaMe", Expected: &DeletedConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedConfigurationStoreName: "cOnFiGsToReNaMe", + LocationName: "lOcAtIoNnAmE", + DeletedConfigurationStoreName: "dElEtEdCoNfIgUrAtIoNsToReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN/dElEtEdCoNfIgUrAtIoNsToReS/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdCoNfIgUrAtIoNsToReS/dElEtEdCoNfIgUrAtIoNsToReNaMe/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/keyvalues/README.md b/resource-manager/appconfiguration/2024-05-01/keyvalues/README.md index 8957dae65c6..3957da53831 100644 --- a/resource-manager/appconfiguration/2024-05-01/keyvalues/README.md +++ b/resource-manager/appconfiguration/2024-05-01/keyvalues/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName") +id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName") payload := keyvalues.KeyValue{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName") +id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName") +id := keyvalues.NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/appconfiguration/2024-05-01/keyvalues/id_keyvalue.go b/resource-manager/appconfiguration/2024-05-01/keyvalues/id_keyvalue.go index 18f8b18baf3..049eaf65e4e 100644 --- a/resource-manager/appconfiguration/2024-05-01/keyvalues/id_keyvalue.go +++ b/resource-manager/appconfiguration/2024-05-01/keyvalues/id_keyvalue.go @@ -121,7 +121,7 @@ func (id KeyValueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticKeyValues", "keyValues", "keyValues"), resourceids.UserSpecifiedSegment("keyValueName", "keyValueName"), } diff --git a/resource-manager/appconfiguration/2024-05-01/keyvalues/id_keyvalue_test.go b/resource-manager/appconfiguration/2024-05-01/keyvalues/id_keyvalue_test.go index c2bdb93b0c3..46ba2b1e092 100644 --- a/resource-manager/appconfiguration/2024-05-01/keyvalues/id_keyvalue_test.go +++ b/resource-manager/appconfiguration/2024-05-01/keyvalues/id_keyvalue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KeyValueId{} func TestNewKeyValueID(t *testing.T) { - id := NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName") + id := NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewKeyValueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } if id.KeyValueName != "keyValueName" { @@ -32,8 +32,8 @@ func TestNewKeyValueID(t *testing.T) { } func TestFormatKeyValueID(t *testing.T) { - actual := NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "keyValueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName" + actual := NewKeyValueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "keyValueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseKeyValueID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName", Expected: &KeyValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", KeyValueName: "keyValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseKeyValueIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/kEyVaLuEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/kEyVaLuEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName", Expected: &KeyValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", KeyValueName: "keyValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/keyValues/keyValueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/keyValues/keyValueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/kEyVaLuEs/kEyVaLuEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/kEyVaLuEs/kEyVaLuEnAmE", Expected: &KeyValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", KeyValueName: "kEyVaLuEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/kEyVaLuEs/kEyVaLuEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/kEyVaLuEs/kEyVaLuEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/operations/README.md b/resource-manager/appconfiguration/2024-05-01/operations/README.md index 841bb100645..feba4e46bc1 100644 --- a/resource-manager/appconfiguration/2024-05-01/operations/README.md +++ b/resource-manager/appconfiguration/2024-05-01/operations/README.md @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := operations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := operations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := operations.CheckNameAvailabilityParameters{ // ... diff --git a/resource-manager/appconfiguration/2024-05-01/operations/id_location.go b/resource-manager/appconfiguration/2024-05-01/operations/id_location.go index c8ec5121b15..19ad542af45 100644 --- a/resource-manager/appconfiguration/2024-05-01/operations/id_location.go +++ b/resource-manager/appconfiguration/2024-05-01/operations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/appconfiguration/2024-05-01/operations/id_location_test.go b/resource-manager/appconfiguration/2024-05-01/operations/id_location_test.go index e6ea738a067..2fcad889c69 100644 --- a/resource-manager/appconfiguration/2024-05-01/operations/id_location_test.go +++ b/resource-manager/appconfiguration/2024-05-01/operations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppConfiguration/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/README.md b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/README.md index ef1716f8195..c0b3934cdc0 100644 --- a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/README.md +++ b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := privateendpointconnections.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") // alternatively `client.ListByConfigurationStore(ctx, id)` can be used to do batched pagination items, err := client.ListByConfigurationStoreComplete(ctx, id) diff --git a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_configurationstore.go b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_configurationstore.go index fd3979499a6..594b686634c 100644 --- a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_configurationstore.go +++ b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_configurationstore.go @@ -115,7 +115,7 @@ func (id ConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_configurationstore_test.go b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_configurationstore_test.go index 26bb0392955..fa13eb119ba 100644 --- a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_configurationstore_test.go +++ b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_configurationstore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationStoreId{} func TestNewConfigurationStoreID(t *testing.T) { - id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") + id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConfigurationStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } } func TestFormatConfigurationStoreID(t *testing.T) { - actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName" + actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConfigurationStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConfigurationStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_privateendpointconnection.go index a04b9e58d89..488f42f1ab2 100644 --- a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_privateendpointconnection_test.go index 872e83149ba..25a1c40ad58 100644 --- a/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/appconfiguration/2024-05-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/README.md b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/README.md index 537f045f93a..124d1f99377 100644 --- a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/README.md +++ b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := privatelinkresources.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") // alternatively `client.ListByConfigurationStore(ctx, id)` can be used to do batched pagination items, err := client.ListByConfigurationStoreComplete(ctx, id) diff --git a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_configurationstore.go b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_configurationstore.go index c8b624a3f7e..a60853b9599 100644 --- a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_configurationstore.go +++ b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_configurationstore.go @@ -115,7 +115,7 @@ func (id ConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_configurationstore_test.go b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_configurationstore_test.go index 026ce2bfbb2..a2dab0cfcf3 100644 --- a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_configurationstore_test.go +++ b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_configurationstore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationStoreId{} func TestNewConfigurationStoreID(t *testing.T) { - id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") + id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConfigurationStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } } func TestFormatConfigurationStoreID(t *testing.T) { - actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName" + actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConfigurationStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConfigurationStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_privatelinkresource.go b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_privatelinkresource.go index 0898a1a8fae..79f919649d1 100644 --- a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_privatelinkresource_test.go index f81ab46004e..e6de81e60a9 100644 --- a/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/appconfiguration/2024-05-01/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", - PrivateLinkResourceName: "groupName", + ConfigurationStoreName: "configurationStoreName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", - PrivateLinkResourceName: "groupName", + ConfigurationStoreName: "configurationStoreName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/replicas/README.md b/resource-manager/appconfiguration/2024-05-01/replicas/README.md index 6ad56e4527b..dd407d26e90 100644 --- a/resource-manager/appconfiguration/2024-05-01/replicas/README.md +++ b/resource-manager/appconfiguration/2024-05-01/replicas/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName") +id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName") payload := replicas.Replica{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName") +id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName") +id := replicas.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicas.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") +id := replicas.NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") // alternatively `client.ListByConfigurationStore(ctx, id)` can be used to do batched pagination items, err := client.ListByConfigurationStoreComplete(ctx, id) diff --git a/resource-manager/appconfiguration/2024-05-01/replicas/id_configurationstore.go b/resource-manager/appconfiguration/2024-05-01/replicas/id_configurationstore.go index 6adea53e9da..512674a58e4 100644 --- a/resource-manager/appconfiguration/2024-05-01/replicas/id_configurationstore.go +++ b/resource-manager/appconfiguration/2024-05-01/replicas/id_configurationstore.go @@ -115,7 +115,7 @@ func (id ConfigurationStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), } } diff --git a/resource-manager/appconfiguration/2024-05-01/replicas/id_configurationstore_test.go b/resource-manager/appconfiguration/2024-05-01/replicas/id_configurationstore_test.go index f66232bd5d8..58a5db51ca8 100644 --- a/resource-manager/appconfiguration/2024-05-01/replicas/id_configurationstore_test.go +++ b/resource-manager/appconfiguration/2024-05-01/replicas/id_configurationstore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationStoreId{} func TestNewConfigurationStoreID(t *testing.T) { - id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName") + id := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConfigurationStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } } func TestFormatConfigurationStoreID(t *testing.T) { - actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName" + actual := NewConfigurationStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConfigurationStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConfigurationStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Expected: &ConfigurationStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/replicas/id_replica.go b/resource-manager/appconfiguration/2024-05-01/replicas/id_replica.go index 908443a24d4..1f6a6991799 100644 --- a/resource-manager/appconfiguration/2024-05-01/replicas/id_replica.go +++ b/resource-manager/appconfiguration/2024-05-01/replicas/id_replica.go @@ -121,7 +121,7 @@ func (id ReplicaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticReplicas", "replicas", "replicas"), resourceids.UserSpecifiedSegment("replicaName", "replicaName"), } diff --git a/resource-manager/appconfiguration/2024-05-01/replicas/id_replica_test.go b/resource-manager/appconfiguration/2024-05-01/replicas/id_replica_test.go index 3053e716983..0c7d6e7a9d8 100644 --- a/resource-manager/appconfiguration/2024-05-01/replicas/id_replica_test.go +++ b/resource-manager/appconfiguration/2024-05-01/replicas/id_replica_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicaId{} func TestNewReplicaID(t *testing.T) { - id := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName") + id := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewReplicaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } if id.ReplicaName != "replicaName" { @@ -32,8 +32,8 @@ func TestNewReplicaID(t *testing.T) { } func TestFormatReplicaID(t *testing.T) { - actual := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "replicaName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName" + actual := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "replicaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicaID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", ReplicaName: "replicaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicaIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/rEpLiCaS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/rEpLiCaS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", ReplicaName: "replicaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/replicas/replicaName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/replicas/replicaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/rEpLiCaS/rEpLiCaNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/rEpLiCaS/rEpLiCaNaMe", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", ReplicaName: "rEpLiCaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/rEpLiCaS/rEpLiCaNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/rEpLiCaS/rEpLiCaNaMe/extra", Error: true, }, } diff --git a/resource-manager/appconfiguration/2024-05-01/snapshots/README.md b/resource-manager/appconfiguration/2024-05-01/snapshots/README.md index ea92edecdec..4ff355b4748 100644 --- a/resource-manager/appconfiguration/2024-05-01/snapshots/README.md +++ b/resource-manager/appconfiguration/2024-05-01/snapshots/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "snapshotName") payload := snapshots.Snapshot{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "snapshotName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/appconfiguration/2024-05-01/snapshots/id_snapshot.go b/resource-manager/appconfiguration/2024-05-01/snapshots/id_snapshot.go index 99088b82735..7b07a9bdbf8 100644 --- a/resource-manager/appconfiguration/2024-05-01/snapshots/id_snapshot.go +++ b/resource-manager/appconfiguration/2024-05-01/snapshots/id_snapshot.go @@ -121,7 +121,7 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppConfiguration", "Microsoft.AppConfiguration", "Microsoft.AppConfiguration"), resourceids.StaticSegment("staticConfigurationStores", "configurationStores", "configurationStores"), - resourceids.UserSpecifiedSegment("configurationStoreName", "configStoreName"), + resourceids.UserSpecifiedSegment("configurationStoreName", "configurationStoreName"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), resourceids.UserSpecifiedSegment("snapshotName", "snapshotName"), } diff --git a/resource-manager/appconfiguration/2024-05-01/snapshots/id_snapshot_test.go b/resource-manager/appconfiguration/2024-05-01/snapshots/id_snapshot_test.go index d8852a3de43..a3aa88bb134 100644 --- a/resource-manager/appconfiguration/2024-05-01/snapshots/id_snapshot_test.go +++ b/resource-manager/appconfiguration/2024-05-01/snapshots/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "snapshotName") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "snapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConfigurationStoreName != "configStoreName" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configStoreName") + if id.ConfigurationStoreName != "configurationStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'ConfigurationStoreName'", id.ConfigurationStoreName, "configurationStoreName") } if id.SnapshotName != "snapshotName" { @@ -32,8 +32,8 @@ func TestNewSnapshotID(t *testing.T) { } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configStoreName", "snapshotName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/snapshots/snapshotName" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "configurationStoreName", "snapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/snapshots/snapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/snapshots/snapshotName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConfigurationStoreName: "configStoreName", + ConfigurationStoreName: "configurationStoreName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configStoreName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppConfiguration/configurationStores/configurationStoreName/snapshots/snapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/sNaPsHoTs/sNaPsHoTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/sNaPsHoTs/sNaPsHoTnAmE", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConfigurationStoreName: "cOnFiGsToReNaMe", + ConfigurationStoreName: "cOnFiGuRaTiOnStOrEnAmE", SnapshotName: "sNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGsToReNaMe/sNaPsHoTs/sNaPsHoTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpCoNfIgUrAtIoN/cOnFiGuRaTiOnStOrEs/cOnFiGuRaTiOnStOrEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/README.md b/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/README.md index 72cddd1b5ea..93eea12871c 100644 --- a/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := analyticsitemsapis.NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := analyticsitemsapis.NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.AnalyticsItemsDelete(ctx, id, analyticsitemsapis.DefaultAnalyticsItemsDeleteOperationOptions()) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := analyticsitemsapis.NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := analyticsitemsapis.NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.AnalyticsItemsGet(ctx, id, analyticsitemsapis.DefaultAnalyticsItemsGetOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := analyticsitemsapis.NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := analyticsitemsapis.NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.AnalyticsItemsList(ctx, id, analyticsitemsapis.DefaultAnalyticsItemsListOperationOptions()) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := analyticsitemsapis.NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := analyticsitemsapis.NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") payload := analyticsitemsapis.ApplicationInsightsComponentAnalyticsItem{ // ... diff --git a/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/id_providercomponent.go b/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/id_providercomponent.go index 6bd23d6235d..e90e5db3233 100644 --- a/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/id_providercomponent.go +++ b/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/id_providercomponent.go @@ -121,7 +121,7 @@ func (id ProviderComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.ScopeSegment("scopePath", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/id_providercomponent_test.go b/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/id_providercomponent_test.go index 9d60e919390..f16ab85f27f 100644 --- a/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/id_providercomponent_test.go +++ b/resource-manager/applicationinsights/2015-05-01/analyticsitemsapis/id_providercomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderComponentId{} func TestNewProviderComponentID(t *testing.T) { - id := NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewProviderComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.ScopePath != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewProviderComponentID(t *testing.T) { } func TestFormatProviderComponentID(t *testing.T) { - actual := NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewProviderComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,16 +87,16 @@ func TestParseProviderComponentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &ProviderComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", ScopePath: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -218,31 +218,31 @@ func TestParseProviderComponentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &ProviderComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", ScopePath: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &ProviderComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", ScopePath: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/README.md b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/README.md index 6807c76806d..67985da657e 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentannotationsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentannotationsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentannotationsapis.Annotation{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentannotationsapis.NewAnnotationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "annotationId") +id := componentannotationsapis.NewAnnotationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "annotationId") read, err := client.AnnotationsDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentannotationsapis.NewAnnotationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "annotationId") +id := componentannotationsapis.NewAnnotationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "annotationId") read, err := client.AnnotationsGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentannotationsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentannotationsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.AnnotationsList(ctx, id, componentannotationsapis.DefaultAnnotationsListOperationOptions()) if err != nil { diff --git a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_annotation.go b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_annotation.go index 82b0c56e364..fcbf8e0669d 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_annotation.go +++ b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_annotation.go @@ -121,7 +121,7 @@ func (id AnnotationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticAnnotations", "annotations", "annotations"), resourceids.UserSpecifiedSegment("annotationId", "annotationId"), } diff --git a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_annotation_test.go b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_annotation_test.go index 3c7808e9c5a..f46f80735bf 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_annotation_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_annotation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AnnotationId{} func TestNewAnnotationID(t *testing.T) { - id := NewAnnotationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "annotationId") + id := NewAnnotationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "annotationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAnnotationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.AnnotationId != "annotationId" { @@ -32,8 +32,8 @@ func TestNewAnnotationID(t *testing.T) { } func TestFormatAnnotationID(t *testing.T) { - actual := NewAnnotationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "annotationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/annotations/annotationId" + actual := NewAnnotationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "annotationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/annotations/annotationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAnnotationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/annotations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/annotations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/annotations/annotationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/annotations/annotationId", Expected: &AnnotationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", AnnotationId: "annotationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/annotations/annotationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/annotations/annotationId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAnnotationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/annotations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/annotations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/aNnOtAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/aNnOtAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/annotations/annotationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/annotations/annotationId", Expected: &AnnotationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", AnnotationId: "annotationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/annotations/annotationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/annotations/annotationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/aNnOtAtIoNs/aNnOtAtIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/aNnOtAtIoNs/aNnOtAtIoNiD", Expected: &AnnotationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", AnnotationId: "aNnOtAtIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/aNnOtAtIoNs/aNnOtAtIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/aNnOtAtIoNs/aNnOtAtIoNiD/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_component.go index 8be2525a289..93eb1679e85 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_component_test.go index 4762e603966..8f72a188d1f 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentannotationsapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/README.md b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/README.md index c3d7204eba0..9698c8eb140 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentapikeysapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentapikeysapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentapikeysapis.APIKeyRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentapikeysapis.NewApiKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "keyId") +id := componentapikeysapis.NewApiKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "keyId") read, err := client.APIKeysDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentapikeysapis.NewApiKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "keyId") +id := componentapikeysapis.NewApiKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "keyId") read, err := client.APIKeysGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentapikeysapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentapikeysapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.APIKeysList(ctx, id) if err != nil { diff --git a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_apikey.go b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_apikey.go index 0cd0fe15919..5fba59ce123 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_apikey.go +++ b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_apikey.go @@ -121,7 +121,7 @@ func (id ApiKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticApiKeys", "apiKeys", "apiKeys"), resourceids.UserSpecifiedSegment("keyId", "keyId"), } diff --git a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_apikey_test.go b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_apikey_test.go index f2b38edb651..5a30fc37283 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_apikey_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_apikey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApiKeyId{} func TestNewApiKeyID(t *testing.T) { - id := NewApiKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "keyId") + id := NewApiKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "keyId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApiKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.KeyId != "keyId" { @@ -32,8 +32,8 @@ func TestNewApiKeyID(t *testing.T) { } func TestFormatApiKeyID(t *testing.T) { - actual := NewApiKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "keyId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/apiKeys/keyId" + actual := NewApiKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "keyId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/apiKeys/keyId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApiKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/apiKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/apiKeys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/apiKeys/keyId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/apiKeys/keyId", Expected: &ApiKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", KeyId: "keyId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/apiKeys/keyId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/apiKeys/keyId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApiKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/apiKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/apiKeys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/aPiKeYs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/aPiKeYs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/apiKeys/keyId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/apiKeys/keyId", Expected: &ApiKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", KeyId: "keyId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/apiKeys/keyId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/apiKeys/keyId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/aPiKeYs/kEyId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/aPiKeYs/kEyId", Expected: &ApiKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", KeyId: "kEyId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/aPiKeYs/kEyId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/aPiKeYs/kEyId/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_component.go index 7b98288b05a..326c432120e 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_component_test.go index b17be67b452..a140be0334f 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentapikeysapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/README.md b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/README.md index b6c898fc44e..d8f9acf3dfc 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentcontinuousexportapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentcontinuousexportapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentcontinuousexportapis.ApplicationInsightsComponentExportRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentcontinuousexportapis.NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "exportId") +id := componentcontinuousexportapis.NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "exportId") read, err := client.ExportConfigurationsDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentcontinuousexportapis.NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "exportId") +id := componentcontinuousexportapis.NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "exportId") read, err := client.ExportConfigurationsGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentcontinuousexportapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentcontinuousexportapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ExportConfigurationsList(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentcontinuousexportapis.NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "exportId") +id := componentcontinuousexportapis.NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "exportId") payload := componentcontinuousexportapis.ApplicationInsightsComponentExportRequest{ // ... diff --git a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_component.go index 5134821f780..2703fe3fcf9 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_component_test.go index 2b665330c26..4a38178b56a 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_exportconfiguration.go b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_exportconfiguration.go index ed614d323f9..1b449c02b50 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_exportconfiguration.go +++ b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_exportconfiguration.go @@ -121,7 +121,7 @@ func (id ExportConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticExportConfiguration", "exportConfiguration", "exportConfiguration"), resourceids.UserSpecifiedSegment("exportId", "exportId"), } diff --git a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_exportconfiguration_test.go b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_exportconfiguration_test.go index c2e6ae2f8b5..a6e086f1abf 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_exportconfiguration_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentcontinuousexportapis/id_exportconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExportConfigurationId{} func TestNewExportConfigurationID(t *testing.T) { - id := NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "exportId") + id := NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "exportId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewExportConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.ExportId != "exportId" { @@ -32,8 +32,8 @@ func TestNewExportConfigurationID(t *testing.T) { } func TestFormatExportConfigurationID(t *testing.T) { - actual := NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "exportId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/exportConfiguration/exportId" + actual := NewExportConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "exportId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/exportConfiguration/exportId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseExportConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/exportConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/exportConfiguration", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/exportConfiguration/exportId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/exportConfiguration/exportId", Expected: &ExportConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", ExportId: "exportId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/exportConfiguration/exportId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/exportConfiguration/exportId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseExportConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/exportConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/exportConfiguration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/eXpOrTcOnFiGuRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/eXpOrTcOnFiGuRaTiOn", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/exportConfiguration/exportId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/exportConfiguration/exportId", Expected: &ExportConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", ExportId: "exportId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/exportConfiguration/exportId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/exportConfiguration/exportId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/eXpOrTcOnFiGuRaTiOn/eXpOrTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/eXpOrTcOnFiGuRaTiOn/eXpOrTiD", Expected: &ExportConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", ExportId: "eXpOrTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/eXpOrTcOnFiGuRaTiOn/eXpOrTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/eXpOrTcOnFiGuRaTiOn/eXpOrTiD/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/README.md b/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/README.md index 96e562a3f99..d811c0a956c 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ComponentAvailableFeaturesGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ComponentCurrentBillingFeaturesGet(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentfeaturesandpricingapis.ApplicationInsightsComponentBillingFeatures{ // ... @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ComponentFeatureCapabilitiesGet(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentfeaturesandpricingapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ComponentQuotaStatusGet(ctx, id) if err != nil { diff --git a/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/id_component.go index ff9a6209681..b5685fd68ae 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/id_component_test.go index ddeb7a5edeb..44ead6773c2 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentfeaturesandpricingapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/README.md b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/README.md index 18965c159d2..160e33232d9 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentproactivedetectionapis.NewProactiveDetectionConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configurationId") +id := componentproactivedetectionapis.NewProactiveDetectionConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "configurationId") read, err := client.ProactiveDetectionConfigurationsGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentproactivedetectionapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentproactivedetectionapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ProactiveDetectionConfigurationsList(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentproactivedetectionapis.NewProactiveDetectionConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configurationId") +id := componentproactivedetectionapis.NewProactiveDetectionConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "configurationId") payload := componentproactivedetectionapis.ApplicationInsightsComponentProactiveDetectionConfiguration{ // ... diff --git a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_component.go index 01a335fe98e..42ee16243a8 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_component_test.go index 6ab73e68cc0..f5b6fb71228 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_proactivedetectionconfig.go b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_proactivedetectionconfig.go index c82521135e7..c50bf95f254 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_proactivedetectionconfig.go +++ b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_proactivedetectionconfig.go @@ -121,7 +121,7 @@ func (id ProactiveDetectionConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticProactiveDetectionConfigs", "proactiveDetectionConfigs", "proactiveDetectionConfigs"), resourceids.UserSpecifiedSegment("configurationId", "configurationId"), } diff --git a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_proactivedetectionconfig_test.go b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_proactivedetectionconfig_test.go index 6a325245f00..13d81a6f0b6 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_proactivedetectionconfig_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/id_proactivedetectionconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProactiveDetectionConfigId{} func TestNewProactiveDetectionConfigID(t *testing.T) { - id := NewProactiveDetectionConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configurationId") + id := NewProactiveDetectionConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "configurationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewProactiveDetectionConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.ConfigurationId != "configurationId" { @@ -32,8 +32,8 @@ func TestNewProactiveDetectionConfigID(t *testing.T) { } func TestFormatProactiveDetectionConfigID(t *testing.T) { - actual := NewProactiveDetectionConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configurationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/proactiveDetectionConfigs/configurationId" + actual := NewProactiveDetectionConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "configurationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/proactiveDetectionConfigs/configurationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseProactiveDetectionConfigID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/proactiveDetectionConfigs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/proactiveDetectionConfigs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/proactiveDetectionConfigs/configurationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/proactiveDetectionConfigs/configurationId", Expected: &ProactiveDetectionConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", ConfigurationId: "configurationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/proactiveDetectionConfigs/configurationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/proactiveDetectionConfigs/configurationId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseProactiveDetectionConfigIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/proactiveDetectionConfigs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/proactiveDetectionConfigs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/pRoAcTiVeDeTeCtIoNcOnFiGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/pRoAcTiVeDeTeCtIoNcOnFiGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/proactiveDetectionConfigs/configurationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/proactiveDetectionConfigs/configurationId", Expected: &ProactiveDetectionConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", ConfigurationId: "configurationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/proactiveDetectionConfigs/configurationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/proactiveDetectionConfigs/configurationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/pRoAcTiVeDeTeCtIoNcOnFiGs/cOnFiGuRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/pRoAcTiVeDeTeCtIoNcOnFiGs/cOnFiGuRaTiOnId", Expected: &ProactiveDetectionConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", ConfigurationId: "cOnFiGuRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/pRoAcTiVeDeTeCtIoNcOnFiGs/cOnFiGuRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/pRoAcTiVeDeTeCtIoNcOnFiGs/cOnFiGuRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/model_applicationinsightscomponentproactivedetectionconfigurationruledefinitions.go b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/model_applicationinsightscomponentproactivedetectionconfigurationruledefinitions.go index b9e655a767d..134d46c2ac8 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/model_applicationinsightscomponentproactivedetectionconfigurationruledefinitions.go +++ b/resource-manager/applicationinsights/2015-05-01/componentproactivedetectionapis/model_applicationinsightscomponentproactivedetectionconfigurationruledefinitions.go @@ -6,7 +6,7 @@ package componentproactivedetectionapis type ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions struct { Description *string `json:"Description,omitempty"` DisplayName *string `json:"DisplayName,omitempty"` - HelpUrl *string `json:"HelpUrl,omitempty"` + HelpURL *string `json:"HelpUrl,omitempty"` IsEnabledByDefault *bool `json:"IsEnabledByDefault,omitempty"` IsHidden *bool `json:"IsHidden,omitempty"` IsInPreview *bool `json:"IsInPreview,omitempty"` diff --git a/resource-manager/applicationinsights/2015-05-01/componentsapis/README.md b/resource-manager/applicationinsights/2015-05-01/componentsapis/README.md index 181734bd0d9..8f4d5756ffc 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentsapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/componentsapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentsapis.ApplicationInsightsComponent{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ComponentsDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ComponentsGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentsapis.NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "purgeId") +id := componentsapis.NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "purgeId") read, err := client.ComponentsGetPurgeStatus(ctx, id) if err != nil { @@ -128,7 +128,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentsapis.ComponentPurgeBody{ // ... @@ -149,7 +149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentsapis.TagsResource{ // ... diff --git a/resource-manager/applicationinsights/2015-05-01/componentsapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/componentsapis/id_component.go index 2f321369a10..32f97fdb0e8 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentsapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/componentsapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/componentsapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/componentsapis/id_component_test.go index 98ba24ee871..b016df47262 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentsapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentsapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentsapis/id_operation.go b/resource-manager/applicationinsights/2015-05-01/componentsapis/id_operation.go index f212ab95201..e243972fa67 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentsapis/id_operation.go +++ b/resource-manager/applicationinsights/2015-05-01/componentsapis/id_operation.go @@ -121,7 +121,7 @@ func (id OperationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticOperations", "operations", "operations"), resourceids.UserSpecifiedSegment("purgeId", "purgeId"), } diff --git a/resource-manager/applicationinsights/2015-05-01/componentsapis/id_operation_test.go b/resource-manager/applicationinsights/2015-05-01/componentsapis/id_operation_test.go index a7c4bed8a58..80caaaee3f5 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentsapis/id_operation_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentsapis/id_operation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OperationId{} func TestNewOperationID(t *testing.T) { - id := NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "purgeId") + id := NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "purgeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewOperationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.PurgeId != "purgeId" { @@ -32,8 +32,8 @@ func TestNewOperationID(t *testing.T) { } func TestFormatOperationID(t *testing.T) { - actual := NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "purgeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId" + actual := NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "purgeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseOperationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", PurgeId: "purgeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseOperationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/oPeRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/oPeRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", PurgeId: "purgeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/oPeRaTiOnS/pUrGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/oPeRaTiOnS/pUrGeId", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", PurgeId: "pUrGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/oPeRaTiOnS/pUrGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/oPeRaTiOnS/pUrGeId/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/README.md b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/README.md index 0794b5f5f4d..8e47ffba745 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentworkitemconfigsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentworkitemconfigsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentworkitemconfigsapis.WorkItemCreateConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentworkitemconfigsapis.NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "workItemConfigId") +id := componentworkitemconfigsapis.NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "workItemConfigId") read, err := client.WorkItemConfigurationsDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentworkitemconfigsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentworkitemconfigsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.WorkItemConfigurationsGetDefault(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentworkitemconfigsapis.NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "workItemConfigId") +id := componentworkitemconfigsapis.NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "workItemConfigId") read, err := client.WorkItemConfigurationsGetItem(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentworkitemconfigsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentworkitemconfigsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.WorkItemConfigurationsList(ctx, id) if err != nil { @@ -109,7 +109,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentworkitemconfigsapis.NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "workItemConfigId") +id := componentworkitemconfigsapis.NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "workItemConfigId") payload := componentworkitemconfigsapis.WorkItemCreateConfiguration{ // ... diff --git a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_component.go index bd8192135d2..c339bd5dfa5 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_component_test.go index 93ad569e48a..3f10c39eae5 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_workitemconfig.go b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_workitemconfig.go index 6e8ae0c7d79..e1dfbf058ea 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_workitemconfig.go +++ b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_workitemconfig.go @@ -121,7 +121,7 @@ func (id WorkItemConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticWorkItemConfigs", "workItemConfigs", "workItemConfigs"), resourceids.UserSpecifiedSegment("workItemConfigId", "workItemConfigId"), } diff --git a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_workitemconfig_test.go b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_workitemconfig_test.go index 26a594eed80..b396a13c68d 100644 --- a/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_workitemconfig_test.go +++ b/resource-manager/applicationinsights/2015-05-01/componentworkitemconfigsapis/id_workitemconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkItemConfigId{} func TestNewWorkItemConfigID(t *testing.T) { - id := NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "workItemConfigId") + id := NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "workItemConfigId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkItemConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.WorkItemConfigId != "workItemConfigId" { @@ -32,8 +32,8 @@ func TestNewWorkItemConfigID(t *testing.T) { } func TestFormatWorkItemConfigID(t *testing.T) { - actual := NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "workItemConfigId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/workItemConfigs/workItemConfigId" + actual := NewWorkItemConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "workItemConfigId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/workItemConfigs/workItemConfigId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkItemConfigID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/workItemConfigs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/workItemConfigs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/workItemConfigs/workItemConfigId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/workItemConfigs/workItemConfigId", Expected: &WorkItemConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", WorkItemConfigId: "workItemConfigId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/workItemConfigs/workItemConfigId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/workItemConfigs/workItemConfigId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkItemConfigIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/workItemConfigs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/workItemConfigs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/wOrKiTeMcOnFiGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/wOrKiTeMcOnFiGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/workItemConfigs/workItemConfigId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/workItemConfigs/workItemConfigId", Expected: &WorkItemConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", WorkItemConfigId: "workItemConfigId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/workItemConfigs/workItemConfigId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/workItemConfigs/workItemConfigId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/wOrKiTeMcOnFiGs/wOrKiTeMcOnFiGiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/wOrKiTeMcOnFiGs/wOrKiTeMcOnFiGiD", Expected: &WorkItemConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", WorkItemConfigId: "wOrKiTeMcOnFiGiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/wOrKiTeMcOnFiGs/wOrKiTeMcOnFiGiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/wOrKiTeMcOnFiGs/wOrKiTeMcOnFiGiD/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/favoritesapis/README.md b/resource-manager/applicationinsights/2015-05-01/favoritesapis/README.md index 16bbcf640d3..91938a3efd9 100644 --- a/resource-manager/applicationinsights/2015-05-01/favoritesapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/favoritesapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := favoritesapis.NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "favoriteId") +id := favoritesapis.NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "favoriteId") payload := favoritesapis.ApplicationInsightsComponentFavorite{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := favoritesapis.NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "favoriteId") +id := favoritesapis.NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "favoriteId") read, err := client.FavoritesDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := favoritesapis.NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "favoriteId") +id := favoritesapis.NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "favoriteId") read, err := client.FavoritesGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := favoritesapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := favoritesapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.FavoritesList(ctx, id, favoritesapis.DefaultFavoritesListOperationOptions()) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := favoritesapis.NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "favoriteId") +id := favoritesapis.NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "favoriteId") payload := favoritesapis.ApplicationInsightsComponentFavorite{ // ... diff --git a/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_component.go index 2140af1d0cc..8ebd4c76773 100644 --- a/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_component_test.go index 01d19af0da0..cc4d10ddc0b 100644 --- a/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_favorite.go b/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_favorite.go index 4eb1709765b..724af39b571 100644 --- a/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_favorite.go +++ b/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_favorite.go @@ -121,7 +121,7 @@ func (id FavoriteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticFavorites", "favorites", "favorites"), resourceids.UserSpecifiedSegment("favoriteId", "favoriteId"), } diff --git a/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_favorite_test.go b/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_favorite_test.go index 5dcef007931..dd9f6296f3f 100644 --- a/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_favorite_test.go +++ b/resource-manager/applicationinsights/2015-05-01/favoritesapis/id_favorite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FavoriteId{} func TestNewFavoriteID(t *testing.T) { - id := NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "favoriteId") + id := NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "favoriteId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFavoriteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.FavoriteId != "favoriteId" { @@ -32,8 +32,8 @@ func TestNewFavoriteID(t *testing.T) { } func TestFormatFavoriteID(t *testing.T) { - actual := NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "favoriteId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/favorites/favoriteId" + actual := NewFavoriteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "favoriteId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/favorites/favoriteId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFavoriteID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/favorites", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/favorites", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/favorites/favoriteId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/favorites/favoriteId", Expected: &FavoriteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", FavoriteId: "favoriteId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/favorites/favoriteId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/favorites/favoriteId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFavoriteIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/favorites", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/favorites", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/fAvOrItEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/fAvOrItEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/favorites/favoriteId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/favorites/favoriteId", Expected: &FavoriteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", FavoriteId: "favoriteId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/favorites/favoriteId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/favorites/favoriteId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/fAvOrItEs/fAvOrItEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/fAvOrItEs/fAvOrItEiD", Expected: &FavoriteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", FavoriteId: "fAvOrItEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/fAvOrItEs/fAvOrItEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/fAvOrItEs/fAvOrItEiD/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/README.md b/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/README.md index 88b592478e5..9303aefd657 100644 --- a/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := myworkbooksapis.NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := myworkbooksapis.NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "myWorkbookName") payload := myworkbooksapis.MyWorkbook{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := myworkbooksapis.NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := myworkbooksapis.NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "myWorkbookName") read, err := client.MyWorkbooksDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := myworkbooksapis.NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := myworkbooksapis.NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "myWorkbookName") read, err := client.MyWorkbooksGet(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := myworkbooksapis.NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := myworkbooksapis.NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "myWorkbookName") payload := myworkbooksapis.MyWorkbook{ // ... diff --git a/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/id_myworkbook.go b/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/id_myworkbook.go index d320dd63f6a..8754854b9be 100644 --- a/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/id_myworkbook.go +++ b/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/id_myworkbook.go @@ -115,7 +115,7 @@ func (id MyWorkbookId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticMyWorkbooks", "myWorkbooks", "myWorkbooks"), - resourceids.UserSpecifiedSegment("myWorkbookName", "resourceName"), + resourceids.UserSpecifiedSegment("myWorkbookName", "myWorkbookName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/id_myworkbook_test.go b/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/id_myworkbook_test.go index 231de50fa25..f18127b87b0 100644 --- a/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/id_myworkbook_test.go +++ b/resource-manager/applicationinsights/2015-05-01/myworkbooksapis/id_myworkbook_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MyWorkbookId{} func TestNewMyWorkbookID(t *testing.T) { - id := NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "myWorkbookName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewMyWorkbookID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MyWorkbookName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'MyWorkbookName'", id.MyWorkbookName, "resourceName") + if id.MyWorkbookName != "myWorkbookName" { + t.Fatalf("Expected %q but got %q for Segment 'MyWorkbookName'", id.MyWorkbookName, "myWorkbookName") } } func TestFormatMyWorkbookID(t *testing.T) { - actual := NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/resourceName" + actual := NewMyWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "myWorkbookName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/myWorkbookName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseMyWorkbookID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/myWorkbookName", Expected: &MyWorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MyWorkbookName: "resourceName", + MyWorkbookName: "myWorkbookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/myWorkbookName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseMyWorkbookIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/myWorkbookName", Expected: &MyWorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MyWorkbookName: "resourceName", + MyWorkbookName: "myWorkbookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/myWorkbooks/myWorkbookName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mYwOrKbOoKs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mYwOrKbOoKs/mYwOrKbOoKnAmE", Expected: &MyWorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MyWorkbookName: "rEsOuRcEnAmE", + MyWorkbookName: "mYwOrKbOoKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mYwOrKbOoKs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mYwOrKbOoKs/mYwOrKbOoKnAmE/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/README.md b/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/README.md index 6d6569dfe25..2f4e41c1c35 100644 --- a/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webtestlocationsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webtestlocationsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.WebTestLocationsList(ctx, id) if err != nil { diff --git a/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/id_component.go index 51e0ea2cf98..058fde01824 100644 --- a/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/id_component_test.go index d457e7f0c09..15beb985e18 100644 --- a/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/webtestlocationsapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/webtestsapis/README.md b/resource-manager/applicationinsights/2015-05-01/webtestsapis/README.md index 171af179897..750e2acf5b4 100644 --- a/resource-manager/applicationinsights/2015-05-01/webtestsapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/webtestsapis/README.md @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webtestsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webtestsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") // alternatively `client.WebTestsListByComponent(ctx, id)` can be used to do batched pagination items, err := client.WebTestsListByComponentComplete(ctx, id) diff --git a/resource-manager/applicationinsights/2015-05-01/webtestsapis/id_component.go b/resource-manager/applicationinsights/2015-05-01/webtestsapis/id_component.go index a3ed2291610..ef7aa1589ed 100644 --- a/resource-manager/applicationinsights/2015-05-01/webtestsapis/id_component.go +++ b/resource-manager/applicationinsights/2015-05-01/webtestsapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/webtestsapis/id_component_test.go b/resource-manager/applicationinsights/2015-05-01/webtestsapis/id_component_test.go index 4638cfb63e7..59357e307d9 100644 --- a/resource-manager/applicationinsights/2015-05-01/webtestsapis/id_component_test.go +++ b/resource-manager/applicationinsights/2015-05-01/webtestsapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2015-05-01/workbooksapis/README.md b/resource-manager/applicationinsights/2015-05-01/workbooksapis/README.md index fe55deb8c55..a200c8390a1 100644 --- a/resource-manager/applicationinsights/2015-05-01/workbooksapis/README.md +++ b/resource-manager/applicationinsights/2015-05-01/workbooksapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") payload := workbooksapis.Workbook{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") read, err := client.WorkbooksDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") read, err := client.WorkbooksGet(ctx, id) if err != nil { @@ -94,7 +94,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") payload := workbooksapis.Workbook{ // ... diff --git a/resource-manager/applicationinsights/2015-05-01/workbooksapis/id_workbook.go b/resource-manager/applicationinsights/2015-05-01/workbooksapis/id_workbook.go index cea362268c2..793c6ec6edf 100644 --- a/resource-manager/applicationinsights/2015-05-01/workbooksapis/id_workbook.go +++ b/resource-manager/applicationinsights/2015-05-01/workbooksapis/id_workbook.go @@ -115,7 +115,7 @@ func (id WorkbookId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticWorkbooks", "workbooks", "workbooks"), - resourceids.UserSpecifiedSegment("workbookName", "resourceName"), + resourceids.UserSpecifiedSegment("workbookName", "workbookName"), } } diff --git a/resource-manager/applicationinsights/2015-05-01/workbooksapis/id_workbook_test.go b/resource-manager/applicationinsights/2015-05-01/workbooksapis/id_workbook_test.go index fb960c15ff7..56b233f6e47 100644 --- a/resource-manager/applicationinsights/2015-05-01/workbooksapis/id_workbook_test.go +++ b/resource-manager/applicationinsights/2015-05-01/workbooksapis/id_workbook_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkbookId{} func TestNewWorkbookID(t *testing.T) { - id := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewWorkbookID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WorkbookName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "resourceName") + if id.WorkbookName != "workbookName" { + t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "workbookName") } } func TestFormatWorkbookID(t *testing.T) { - actual := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName" + actual := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseWorkbookID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseWorkbookIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkbookName: "rEsOuRcEnAmE", + WorkbookName: "wOrKbOoKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2020-02-02/componentsapis/README.md b/resource-manager/applicationinsights/2020-02-02/componentsapis/README.md index 36d4d7202f5..343b3352f9d 100644 --- a/resource-manager/applicationinsights/2020-02-02/componentsapis/README.md +++ b/resource-manager/applicationinsights/2020-02-02/componentsapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentsapis.ApplicationInsightsComponent{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ComponentsDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") read, err := client.ComponentsGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentsapis.NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "purgeId") +id := componentsapis.NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "purgeId") read, err := client.ComponentsGetPurgeStatus(ctx, id) if err != nil { @@ -128,7 +128,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentsapis.ComponentPurgeBody{ // ... @@ -149,7 +149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := componentsapis.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") payload := componentsapis.TagsResource{ // ... diff --git a/resource-manager/applicationinsights/2020-02-02/componentsapis/id_component.go b/resource-manager/applicationinsights/2020-02-02/componentsapis/id_component.go index 2f321369a10..32f97fdb0e8 100644 --- a/resource-manager/applicationinsights/2020-02-02/componentsapis/id_component.go +++ b/resource-manager/applicationinsights/2020-02-02/componentsapis/id_component.go @@ -115,7 +115,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/applicationinsights/2020-02-02/componentsapis/id_component_test.go b/resource-manager/applicationinsights/2020-02-02/componentsapis/id_component_test.go index 98ba24ee871..b016df47262 100644 --- a/resource-manager/applicationinsights/2020-02-02/componentsapis/id_component_test.go +++ b/resource-manager/applicationinsights/2020-02-02/componentsapis/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2020-02-02/componentsapis/id_operation.go b/resource-manager/applicationinsights/2020-02-02/componentsapis/id_operation.go index f212ab95201..e243972fa67 100644 --- a/resource-manager/applicationinsights/2020-02-02/componentsapis/id_operation.go +++ b/resource-manager/applicationinsights/2020-02-02/componentsapis/id_operation.go @@ -121,7 +121,7 @@ func (id OperationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "resourceName"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticOperations", "operations", "operations"), resourceids.UserSpecifiedSegment("purgeId", "purgeId"), } diff --git a/resource-manager/applicationinsights/2020-02-02/componentsapis/id_operation_test.go b/resource-manager/applicationinsights/2020-02-02/componentsapis/id_operation_test.go index a7c4bed8a58..80caaaee3f5 100644 --- a/resource-manager/applicationinsights/2020-02-02/componentsapis/id_operation_test.go +++ b/resource-manager/applicationinsights/2020-02-02/componentsapis/id_operation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OperationId{} func TestNewOperationID(t *testing.T) { - id := NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "purgeId") + id := NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "purgeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewOperationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ComponentName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "resourceName") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } if id.PurgeId != "purgeId" { @@ -32,8 +32,8 @@ func TestNewOperationID(t *testing.T) { } func TestFormatOperationID(t *testing.T) { - actual := NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "purgeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId" + actual := NewOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "componentName", "purgeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseOperationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", PurgeId: "purgeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseOperationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/oPeRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/oPeRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ComponentName: "resourceName", + ComponentName: "componentName", PurgeId: "purgeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/resourceName/operations/purgeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/components/componentName/operations/purgeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/oPeRaTiOnS/pUrGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/oPeRaTiOnS/pUrGeId", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ComponentName: "rEsOuRcEnAmE", + ComponentName: "cOmPoNeNtNaMe", PurgeId: "pUrGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/rEsOuRcEnAmE/oPeRaTiOnS/pUrGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/cOmPoNeNtS/cOmPoNeNtNaMe/oPeRaTiOnS/pUrGeId/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/README.md b/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/README.md index e326989d7a9..60b3273e404 100644 --- a/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/README.md +++ b/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookTemplateName") payload := workbooktemplatesapis.WorkbookTemplate{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookTemplateName") read, err := client.WorkbookTemplatesDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookTemplateName") read, err := client.WorkbookTemplatesGet(ctx, id) if err != nil { @@ -94,7 +94,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooktemplatesapis.NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookTemplateName") payload := workbooktemplatesapis.WorkbookTemplateUpdateParameters{ // ... diff --git a/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate.go b/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate.go index 9e8fd1cfe65..f1d5418ce60 100644 --- a/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate.go +++ b/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate.go @@ -115,7 +115,7 @@ func (id WorkbookTemplateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticWorkbookTemplates", "workbookTemplates", "workbookTemplates"), - resourceids.UserSpecifiedSegment("workbookTemplateName", "resourceName"), + resourceids.UserSpecifiedSegment("workbookTemplateName", "workbookTemplateName"), } } diff --git a/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate_test.go b/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate_test.go index cf42ac717d2..930c6922448 100644 --- a/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate_test.go +++ b/resource-manager/applicationinsights/2020-11-20/workbooktemplatesapis/id_workbooktemplate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkbookTemplateId{} func TestNewWorkbookTemplateID(t *testing.T) { - id := NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookTemplateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewWorkbookTemplateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WorkbookTemplateName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WorkbookTemplateName'", id.WorkbookTemplateName, "resourceName") + if id.WorkbookTemplateName != "workbookTemplateName" { + t.Fatalf("Expected %q but got %q for Segment 'WorkbookTemplateName'", id.WorkbookTemplateName, "workbookTemplateName") } } func TestFormatWorkbookTemplateID(t *testing.T) { - actual := NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/resourceName" + actual := NewWorkbookTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookTemplateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/workbookTemplateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseWorkbookTemplateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/workbookTemplateName", Expected: &WorkbookTemplateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookTemplateName: "resourceName", + WorkbookTemplateName: "workbookTemplateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/workbookTemplateName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseWorkbookTemplateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/workbookTemplateName", Expected: &WorkbookTemplateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookTemplateName: "resourceName", + WorkbookTemplateName: "workbookTemplateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbookTemplates/workbookTemplateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKtEmPlAtEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKtEmPlAtEs/wOrKbOoKtEmPlAtEnAmE", Expected: &WorkbookTemplateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkbookTemplateName: "rEsOuRcEnAmE", + WorkbookTemplateName: "wOrKbOoKtEmPlAtEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKtEmPlAtEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKtEmPlAtEs/wOrKbOoKtEmPlAtEnAmE/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2022-04-01/workbooksapis/README.md b/resource-manager/applicationinsights/2022-04-01/workbooksapis/README.md index c2cf1e1a353..fc5c35adb15 100644 --- a/resource-manager/applicationinsights/2022-04-01/workbooksapis/README.md +++ b/resource-manager/applicationinsights/2022-04-01/workbooksapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") payload := workbooksapis.Workbook{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") read, err := client.WorkbooksDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") read, err := client.WorkbooksGet(ctx, id, workbooksapis.DefaultWorkbooksGetOperationOptions()) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workbooksapis.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "revisionId") +id := workbooksapis.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName", "revisionId") read, err := client.WorkbooksRevisionGet(ctx, id) if err != nil { @@ -128,7 +128,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") // alternatively `client.WorkbooksRevisionsList(ctx, id)` can be used to do batched pagination items, err := client.WorkbooksRevisionsListComplete(ctx, id) @@ -145,7 +145,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") payload := workbooksapis.WorkbookUpdateParameters{ // ... diff --git a/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision.go b/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision.go index 0e32ad50754..f919f4d8706 100644 --- a/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision.go +++ b/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision.go @@ -121,7 +121,7 @@ func (id RevisionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticWorkbooks", "workbooks", "workbooks"), - resourceids.UserSpecifiedSegment("workbookName", "resourceName"), + resourceids.UserSpecifiedSegment("workbookName", "workbookName"), resourceids.StaticSegment("staticRevisions", "revisions", "revisions"), resourceids.UserSpecifiedSegment("revisionId", "revisionId"), } diff --git a/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision_test.go b/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision_test.go index 30357edd170..fd4ed902f8e 100644 --- a/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision_test.go +++ b/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_revision_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RevisionId{} func TestNewRevisionID(t *testing.T) { - id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "revisionId") + id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName", "revisionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRevisionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WorkbookName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "resourceName") + if id.WorkbookName != "workbookName" { + t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "workbookName") } if id.RevisionId != "revisionId" { @@ -32,8 +32,8 @@ func TestNewRevisionID(t *testing.T) { } func TestFormatRevisionID(t *testing.T) { - actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "revisionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId" + actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName", "revisionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRevisionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", RevisionId: "revisionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRevisionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/rEvIsIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/rEvIsIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", RevisionId: "revisionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/rEvIsIoNs/rEvIsIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/rEvIsIoNs/rEvIsIoNiD", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkbookName: "rEsOuRcEnAmE", + WorkbookName: "wOrKbOoKnAmE", RevisionId: "rEvIsIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/rEvIsIoNs/rEvIsIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/rEvIsIoNs/rEvIsIoNiD/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook.go b/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook.go index cea362268c2..793c6ec6edf 100644 --- a/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook.go +++ b/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook.go @@ -115,7 +115,7 @@ func (id WorkbookId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticWorkbooks", "workbooks", "workbooks"), - resourceids.UserSpecifiedSegment("workbookName", "resourceName"), + resourceids.UserSpecifiedSegment("workbookName", "workbookName"), } } diff --git a/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook_test.go b/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook_test.go index fb960c15ff7..56b233f6e47 100644 --- a/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook_test.go +++ b/resource-manager/applicationinsights/2022-04-01/workbooksapis/id_workbook_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkbookId{} func TestNewWorkbookID(t *testing.T) { - id := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewWorkbookID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WorkbookName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "resourceName") + if id.WorkbookName != "workbookName" { + t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "workbookName") } } func TestFormatWorkbookID(t *testing.T) { - actual := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName" + actual := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseWorkbookID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseWorkbookIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkbookName: "rEsOuRcEnAmE", + WorkbookName: "wOrKbOoKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2022-06-15/webtestsapis/model_webtestpropertiesrequest.go b/resource-manager/applicationinsights/2022-06-15/webtestsapis/model_webtestpropertiesrequest.go index 956b4a782c1..803ce3fa929 100644 --- a/resource-manager/applicationinsights/2022-06-15/webtestsapis/model_webtestpropertiesrequest.go +++ b/resource-manager/applicationinsights/2022-06-15/webtestsapis/model_webtestpropertiesrequest.go @@ -9,5 +9,5 @@ type WebTestPropertiesRequest struct { Headers *[]HeaderField `json:"Headers,omitempty"` ParseDependentRequests *bool `json:"ParseDependentRequests,omitempty"` RequestBody *string `json:"RequestBody,omitempty"` - RequestUrl *string `json:"RequestUrl,omitempty"` + RequestURL *string `json:"RequestUrl,omitempty"` } diff --git a/resource-manager/applicationinsights/2023-06-01/workbooksapis/README.md b/resource-manager/applicationinsights/2023-06-01/workbooksapis/README.md index 1f17b25bf28..1fb65789d03 100644 --- a/resource-manager/applicationinsights/2023-06-01/workbooksapis/README.md +++ b/resource-manager/applicationinsights/2023-06-01/workbooksapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") payload := workbooksapis.Workbook{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") read, err := client.WorkbooksDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") read, err := client.WorkbooksGet(ctx, id, workbooksapis.DefaultWorkbooksGetOperationOptions()) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workbooksapis.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "revisionId") +id := workbooksapis.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName", "revisionId") read, err := client.WorkbooksRevisionGet(ctx, id) if err != nil { @@ -128,7 +128,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") // alternatively `client.WorkbooksRevisionsList(ctx, id)` can be used to do batched pagination items, err := client.WorkbooksRevisionsListComplete(ctx, id) @@ -145,7 +145,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := workbooksapis.NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") payload := workbooksapis.WorkbookUpdateParameters{ // ... diff --git a/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_revision.go b/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_revision.go index 0e32ad50754..f919f4d8706 100644 --- a/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_revision.go +++ b/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_revision.go @@ -121,7 +121,7 @@ func (id RevisionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticWorkbooks", "workbooks", "workbooks"), - resourceids.UserSpecifiedSegment("workbookName", "resourceName"), + resourceids.UserSpecifiedSegment("workbookName", "workbookName"), resourceids.StaticSegment("staticRevisions", "revisions", "revisions"), resourceids.UserSpecifiedSegment("revisionId", "revisionId"), } diff --git a/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_revision_test.go b/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_revision_test.go index 30357edd170..fd4ed902f8e 100644 --- a/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_revision_test.go +++ b/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_revision_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RevisionId{} func TestNewRevisionID(t *testing.T) { - id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "revisionId") + id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName", "revisionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRevisionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WorkbookName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "resourceName") + if id.WorkbookName != "workbookName" { + t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "workbookName") } if id.RevisionId != "revisionId" { @@ -32,8 +32,8 @@ func TestNewRevisionID(t *testing.T) { } func TestFormatRevisionID(t *testing.T) { - actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "revisionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId" + actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName", "revisionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRevisionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", RevisionId: "revisionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRevisionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/rEvIsIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/rEvIsIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", RevisionId: "revisionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/revisions/revisionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/revisions/revisionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/rEvIsIoNs/rEvIsIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/rEvIsIoNs/rEvIsIoNiD", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkbookName: "rEsOuRcEnAmE", + WorkbookName: "wOrKbOoKnAmE", RevisionId: "rEvIsIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/rEvIsIoNs/rEvIsIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/rEvIsIoNs/rEvIsIoNiD/extra", Error: true, }, } diff --git a/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_workbook.go b/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_workbook.go index cea362268c2..793c6ec6edf 100644 --- a/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_workbook.go +++ b/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_workbook.go @@ -115,7 +115,7 @@ func (id WorkbookId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticWorkbooks", "workbooks", "workbooks"), - resourceids.UserSpecifiedSegment("workbookName", "resourceName"), + resourceids.UserSpecifiedSegment("workbookName", "workbookName"), } } diff --git a/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_workbook_test.go b/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_workbook_test.go index fb960c15ff7..56b233f6e47 100644 --- a/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_workbook_test.go +++ b/resource-manager/applicationinsights/2023-06-01/workbooksapis/id_workbook_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkbookId{} func TestNewWorkbookID(t *testing.T) { - id := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewWorkbookID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WorkbookName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "resourceName") + if id.WorkbookName != "workbookName" { + t.Fatalf("Expected %q but got %q for Segment 'WorkbookName'", id.WorkbookName, "workbookName") } } func TestFormatWorkbookID(t *testing.T) { - actual := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName" + actual := NewWorkbookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workbookName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseWorkbookID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseWorkbookIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WorkbookName: "resourceName", + WorkbookName: "workbookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/workbooks/workbookName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE", Expected: &WorkbookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkbookName: "rEsOuRcEnAmE", + WorkbookName: "wOrKbOoKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/wOrKbOoKs/wOrKbOoKnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/README.md b/resource-manager/appplatform/2024-01-01-preview/appplatform/README.md index 66a56804ccd..af39cc644e3 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/README.md +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := appplatform.NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName", "domainName") +id := appplatform.NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName", "domainName") payload := appplatform.ApiPortalCustomDomainResource{ // ... @@ -42,7 +42,7 @@ if err := client.ApiPortalCustomDomainsCreateOrUpdateThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := appplatform.NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName", "domainName") +id := appplatform.NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName", "domainName") if err := client.ApiPortalCustomDomainsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.ApiPortalCustomDomainsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName", "domainName") +id := appplatform.NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName", "domainName") read, err := client.ApiPortalCustomDomainsGet(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName") +id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName") // alternatively `client.ApiPortalCustomDomainsList(ctx, id)` can be used to do batched pagination items, err := client.ApiPortalCustomDomainsListComplete(ctx, id) @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName") +id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName") payload := appplatform.ApiPortalResource{ // ... @@ -104,7 +104,7 @@ if err := client.ApiPortalsCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName") +id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName") if err := client.ApiPortalsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.ApiPortalsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName") +id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName") read, err := client.ApiPortalsGet(ctx, id) if err != nil { @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ApiPortalsList(ctx, id)` can be used to do batched pagination items, err := client.ApiPortalsListComplete(ctx, id) @@ -149,7 +149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName") +id := appplatform.NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName") payload := appplatform.CustomDomainValidatePayload{ // ... @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apmName") +id := appplatform.NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apmName") payload := appplatform.ApmResource{ // ... @@ -187,7 +187,7 @@ if err := client.ApmsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apmName") +id := appplatform.NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apmName") if err := client.ApmsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -199,7 +199,7 @@ if err := client.ApmsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apmName") +id := appplatform.NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apmName") read, err := client.ApmsGet(ctx, id) if err != nil { @@ -215,7 +215,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ApmsList(ctx, id)` can be used to do batched pagination items, err := client.ApmsListComplete(ctx, id) @@ -232,7 +232,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apmName") +id := appplatform.NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apmName") read, err := client.ApmsListSecretKeys(ctx, id) if err != nil { @@ -248,7 +248,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName") +id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName") payload := appplatform.ApplicationAcceleratorResource{ // ... @@ -265,7 +265,7 @@ if err := client.ApplicationAcceleratorsCreateOrUpdateThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName") +id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName") if err := client.ApplicationAcceleratorsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -277,7 +277,7 @@ if err := client.ApplicationAcceleratorsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName") +id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName") read, err := client.ApplicationAcceleratorsGet(ctx, id) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ApplicationAcceleratorsList(ctx, id)` can be used to do batched pagination items, err := client.ApplicationAcceleratorsListComplete(ctx, id) @@ -310,7 +310,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationLiveViewName") +id := appplatform.NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationLiveViewName") payload := appplatform.ApplicationLiveViewResource{ // ... @@ -327,7 +327,7 @@ if err := client.ApplicationLiveViewsCreateOrUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := appplatform.NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationLiveViewName") +id := appplatform.NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationLiveViewName") if err := client.ApplicationLiveViewsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -339,7 +339,7 @@ if err := client.ApplicationLiveViewsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationLiveViewName") +id := appplatform.NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationLiveViewName") read, err := client.ApplicationLiveViewsGet(ctx, id) if err != nil { @@ -355,7 +355,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ApplicationLiveViewsList(ctx, id)` can be used to do batched pagination items, err := client.ApplicationLiveViewsListComplete(ctx, id) @@ -372,7 +372,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") payload := appplatform.AppResource{ // ... @@ -389,7 +389,7 @@ if err := client.AppsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") if err := client.AppsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -401,7 +401,7 @@ if err := client.AppsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") read, err := client.AppsGet(ctx, id, appplatform.DefaultAppsGetOperationOptions()) if err != nil { @@ -413,13 +413,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `AppPlatformClient.AppsGetResourceUploadUrl` +### Example Usage: `AppPlatformClient.AppsGetResourceUploadURL` ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") -read, err := client.AppsGetResourceUploadUrl(ctx, id) +read, err := client.AppsGetResourceUploadURL(ctx, id) if err != nil { // handle the error } @@ -433,7 +433,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.AppsList(ctx, id)` can be used to do batched pagination items, err := client.AppsListComplete(ctx, id) @@ -450,7 +450,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") payload := appplatform.ActiveDeploymentCollection{ // ... @@ -467,7 +467,7 @@ if err := client.AppsSetActiveDeploymentsThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") payload := appplatform.AppResource{ // ... @@ -484,7 +484,7 @@ if err := client.AppsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") payload := appplatform.CustomDomainValidatePayload{ // ... @@ -505,7 +505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "bindingName") +id := appplatform.NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "bindingName") payload := appplatform.BindingResource{ // ... @@ -522,7 +522,7 @@ if err := client.BindingsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "bindingName") +id := appplatform.NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "bindingName") if err := client.BindingsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -534,7 +534,7 @@ if err := client.BindingsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "bindingName") +id := appplatform.NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "bindingName") read, err := client.BindingsGet(ctx, id) if err != nil { @@ -550,7 +550,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") // alternatively `client.BindingsList(ctx, id)` can be used to do batched pagination items, err := client.BindingsListComplete(ctx, id) @@ -567,7 +567,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "bindingName") +id := appplatform.NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "bindingName") payload := appplatform.BindingResource{ // ... @@ -584,7 +584,7 @@ if err := client.BindingsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "agentPoolName") +id := appplatform.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "agentPoolName") read, err := client.BuildServiceAgentPoolGet(ctx, id) if err != nil { @@ -600,7 +600,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") +id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") // alternatively `client.BuildServiceAgentPoolList(ctx, id)` can be used to do batched pagination items, err := client.BuildServiceAgentPoolListComplete(ctx, id) @@ -617,7 +617,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "agentPoolName") +id := appplatform.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "agentPoolName") payload := appplatform.BuildServiceAgentPoolResource{ // ... @@ -634,7 +634,7 @@ if err := client.BuildServiceAgentPoolUpdatePutThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName") +id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName") payload := appplatform.BuilderResource{ // ... @@ -651,7 +651,7 @@ if err := client.BuildServiceBuilderCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName") +id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName") if err := client.BuildServiceBuilderDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -663,7 +663,7 @@ if err := client.BuildServiceBuilderDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName") +id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName") read, err := client.BuildServiceBuilderGet(ctx, id) if err != nil { @@ -679,7 +679,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") +id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") // alternatively `client.BuildServiceBuilderList(ctx, id)` can be used to do batched pagination items, err := client.BuildServiceBuilderListComplete(ctx, id) @@ -696,7 +696,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName") +id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName") read, err := client.BuildServiceBuilderListDeployments(ctx, id) if err != nil { @@ -712,7 +712,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") +id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") payload := appplatform.BuildService{ // ... @@ -729,7 +729,7 @@ if err := client.BuildServiceCreateOrUpdateThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := appplatform.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName") +id := appplatform.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName") payload := appplatform.Build{ // ... @@ -750,7 +750,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName") +id := appplatform.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName") if err := client.BuildServiceDeleteBuildThenPoll(ctx, id); err != nil { // handle the error @@ -762,7 +762,7 @@ if err := client.BuildServiceDeleteBuildThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName") +id := appplatform.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName") read, err := client.BuildServiceGetBuild(ctx, id) if err != nil { @@ -778,7 +778,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName", "buildResultName") +id := appplatform.NewResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName", "resultName") read, err := client.BuildServiceGetBuildResult(ctx, id) if err != nil { @@ -794,7 +794,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName", "buildResultName") +id := appplatform.NewResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName", "resultName") read, err := client.BuildServiceGetBuildResultLog(ctx, id) if err != nil { @@ -810,7 +810,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") +id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") read, err := client.BuildServiceGetBuildService(ctx, id) if err != nil { @@ -822,13 +822,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `AppPlatformClient.BuildServiceGetResourceUploadUrl` +### Example Usage: `AppPlatformClient.BuildServiceGetResourceUploadURL` ```go ctx := context.TODO() -id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") +id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") -read, err := client.BuildServiceGetResourceUploadUrl(ctx, id) +read, err := client.BuildServiceGetResourceUploadURL(ctx, id) if err != nil { // handle the error } @@ -842,7 +842,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewSupportedBuildPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildpackName") +id := appplatform.NewSupportedBuildPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "supportedBuildPackName") read, err := client.BuildServiceGetSupportedBuildpack(ctx, id) if err != nil { @@ -858,7 +858,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewSupportedStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "stackName") +id := appplatform.NewSupportedStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "supportedStackName") read, err := client.BuildServiceGetSupportedStack(ctx, id) if err != nil { @@ -874,7 +874,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName") +id := appplatform.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName") // alternatively `client.BuildServiceListBuildResults(ctx, id)` can be used to do batched pagination items, err := client.BuildServiceListBuildResultsComplete(ctx, id) @@ -891,7 +891,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.BuildServiceListBuildServices(ctx, id)` can be used to do batched pagination items, err := client.BuildServiceListBuildServicesComplete(ctx, id) @@ -908,7 +908,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") +id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") // alternatively `client.BuildServiceListBuilds(ctx, id)` can be used to do batched pagination items, err := client.BuildServiceListBuildsComplete(ctx, id) @@ -925,7 +925,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") +id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") // alternatively `client.BuildServiceListSupportedBuildpacks(ctx, id)` can be used to do batched pagination items, err := client.BuildServiceListSupportedBuildpacksComplete(ctx, id) @@ -942,7 +942,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") +id := appplatform.NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") // alternatively `client.BuildServiceListSupportedStacks(ctx, id)` can be used to do batched pagination items, err := client.BuildServiceListSupportedStacksComplete(ctx, id) @@ -959,7 +959,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName", "buildpackBindingName") +id := appplatform.NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName", "buildPackBindingName") payload := appplatform.BuildpackBindingResource{ // ... @@ -976,7 +976,7 @@ if err := client.BuildpackBindingCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := appplatform.NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName", "buildpackBindingName") +id := appplatform.NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName", "buildPackBindingName") if err := client.BuildpackBindingDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -988,7 +988,7 @@ if err := client.BuildpackBindingDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName", "buildpackBindingName") +id := appplatform.NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName", "buildPackBindingName") read, err := client.BuildpackBindingGet(ctx, id) if err != nil { @@ -1004,7 +1004,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName") +id := appplatform.NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName") // alternatively `client.BuildpackBindingList(ctx, id)` can be used to do batched pagination items, err := client.BuildpackBindingListComplete(ctx, id) @@ -1021,7 +1021,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.BuildpackBindingListForCluster(ctx, id)` can be used to do batched pagination items, err := client.BuildpackBindingListForClusterComplete(ctx, id) @@ -1038,7 +1038,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "certificateName") +id := appplatform.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "certificateName") payload := appplatform.CertificateResource{ // ... @@ -1055,7 +1055,7 @@ if err := client.CertificatesCreateOrUpdateThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := appplatform.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "certificateName") +id := appplatform.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "certificateName") if err := client.CertificatesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1067,7 +1067,7 @@ if err := client.CertificatesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "certificateName") +id := appplatform.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "certificateName") read, err := client.CertificatesGet(ctx, id) if err != nil { @@ -1083,7 +1083,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.CertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CertificatesListComplete(ctx, id) @@ -1100,7 +1100,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") read, err := client.ConfigServersGet(ctx, id) if err != nil { @@ -1116,7 +1116,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.ConfigServerResource{ // ... @@ -1133,7 +1133,7 @@ if err := client.ConfigServersUpdatePatchThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.ConfigServerResource{ // ... @@ -1150,7 +1150,7 @@ if err := client.ConfigServersUpdatePutThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.ConfigServerSettings{ // ... @@ -1167,7 +1167,7 @@ if err := client.ConfigServersValidateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "configurationServiceName") +id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "configurationServiceName") payload := appplatform.ConfigurationServiceResource{ // ... @@ -1184,7 +1184,7 @@ if err := client.ConfigurationServicesCreateOrUpdateThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "configurationServiceName") +id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "configurationServiceName") if err := client.ConfigurationServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1196,7 +1196,7 @@ if err := client.ConfigurationServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "configurationServiceName") +id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "configurationServiceName") read, err := client.ConfigurationServicesGet(ctx, id) if err != nil { @@ -1212,7 +1212,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ConfigurationServicesList(ctx, id)` can be used to do batched pagination items, err := client.ConfigurationServicesListComplete(ctx, id) @@ -1229,7 +1229,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "configurationServiceName") +id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "configurationServiceName") payload := appplatform.ConfigurationServiceSettings{ // ... @@ -1246,7 +1246,7 @@ if err := client.ConfigurationServicesValidateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "configurationServiceName") +id := appplatform.NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "configurationServiceName") payload := appplatform.ConfigurationServiceResource{ // ... @@ -1263,7 +1263,7 @@ if err := client.ConfigurationServicesValidateResourceThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := appplatform.NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "containerRegistryName") +id := appplatform.NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "containerRegistryName") payload := appplatform.ContainerRegistryResource{ // ... @@ -1280,7 +1280,7 @@ if err := client.ContainerRegistriesCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := appplatform.NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "containerRegistryName") +id := appplatform.NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "containerRegistryName") if err := client.ContainerRegistriesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1292,7 +1292,7 @@ if err := client.ContainerRegistriesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "containerRegistryName") +id := appplatform.NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "containerRegistryName") read, err := client.ContainerRegistriesGet(ctx, id) if err != nil { @@ -1308,7 +1308,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ContainerRegistriesList(ctx, id)` can be used to do batched pagination items, err := client.ContainerRegistriesListComplete(ctx, id) @@ -1325,7 +1325,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "containerRegistryName") +id := appplatform.NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "containerRegistryName") payload := appplatform.ContainerRegistryProperties{ // ... @@ -1342,7 +1342,7 @@ if err := client.ContainerRegistriesValidateThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := appplatform.NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "domainName") +id := appplatform.NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "domainName") payload := appplatform.CustomDomainResource{ // ... @@ -1359,7 +1359,7 @@ if err := client.CustomDomainsCreateOrUpdateThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := appplatform.NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "domainName") +id := appplatform.NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "domainName") if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1371,7 +1371,7 @@ if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "domainName") +id := appplatform.NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "domainName") read, err := client.CustomDomainsGet(ctx, id) if err != nil { @@ -1387,7 +1387,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") // alternatively `client.CustomDomainsList(ctx, id)` can be used to do batched pagination items, err := client.CustomDomainsListComplete(ctx, id) @@ -1404,7 +1404,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "domainName") +id := appplatform.NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "domainName") payload := appplatform.CustomDomainResource{ // ... @@ -1421,7 +1421,7 @@ if err := client.CustomDomainsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "customizedAcceleratorName") +id := appplatform.NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "customizedAcceleratorName") payload := appplatform.CustomizedAcceleratorResource{ // ... @@ -1438,7 +1438,7 @@ if err := client.CustomizedAcceleratorsCreateOrUpdateThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := appplatform.NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "customizedAcceleratorName") +id := appplatform.NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "customizedAcceleratorName") if err := client.CustomizedAcceleratorsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1450,7 +1450,7 @@ if err := client.CustomizedAcceleratorsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "customizedAcceleratorName") +id := appplatform.NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "customizedAcceleratorName") read, err := client.CustomizedAcceleratorsGet(ctx, id) if err != nil { @@ -1466,7 +1466,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName") +id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName") // alternatively `client.CustomizedAcceleratorsList(ctx, id)` can be used to do batched pagination items, err := client.CustomizedAcceleratorsListComplete(ctx, id) @@ -1483,7 +1483,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "customizedAcceleratorName") +id := appplatform.NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "customizedAcceleratorName") payload := appplatform.CustomizedAcceleratorProperties{ // ... @@ -1500,7 +1500,7 @@ if err := client.CustomizedAcceleratorsValidateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") payload := appplatform.DeploymentResource{ // ... @@ -1517,7 +1517,7 @@ if err := client.DeploymentsCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") if err := client.DeploymentsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1529,7 +1529,7 @@ if err := client.DeploymentsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") if err := client.DeploymentsDisableRemoteDebuggingThenPoll(ctx, id); err != nil { // handle the error @@ -1541,7 +1541,7 @@ if err := client.DeploymentsDisableRemoteDebuggingThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") payload := appplatform.RemoteDebuggingPayload{ // ... @@ -1558,7 +1558,7 @@ if err := client.DeploymentsEnableRemoteDebuggingThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") payload := appplatform.DiagnosticParameters{ // ... @@ -1575,7 +1575,7 @@ if err := client.DeploymentsGenerateHeapDumpThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") payload := appplatform.DiagnosticParameters{ // ... @@ -1592,7 +1592,7 @@ if err := client.DeploymentsGenerateThreadDumpThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") read, err := client.DeploymentsGet(ctx, id) if err != nil { @@ -1604,13 +1604,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `AppPlatformClient.DeploymentsGetLogFileUrl` +### Example Usage: `AppPlatformClient.DeploymentsGetLogFileURL` ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") -read, err := client.DeploymentsGetLogFileUrl(ctx, id) +read, err := client.DeploymentsGetLogFileURL(ctx, id) if err != nil { // handle the error } @@ -1624,7 +1624,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") read, err := client.DeploymentsGetRemoteDebuggingConfig(ctx, id) if err != nil { @@ -1640,7 +1640,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") +id := appplatform.NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") // alternatively `client.DeploymentsList(ctx, id, appplatform.DefaultDeploymentsListOperationOptions())` can be used to do batched pagination items, err := client.DeploymentsListComplete(ctx, id, appplatform.DefaultDeploymentsListOperationOptions()) @@ -1657,7 +1657,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.DeploymentsListForCluster(ctx, id, appplatform.DefaultDeploymentsListForClusterOperationOptions())` can be used to do batched pagination items, err := client.DeploymentsListForClusterComplete(ctx, id, appplatform.DefaultDeploymentsListForClusterOperationOptions()) @@ -1674,7 +1674,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") if err := client.DeploymentsRestartThenPoll(ctx, id); err != nil { // handle the error @@ -1686,7 +1686,7 @@ if err := client.DeploymentsRestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") if err := client.DeploymentsStartThenPoll(ctx, id); err != nil { // handle the error @@ -1698,7 +1698,7 @@ if err := client.DeploymentsStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") payload := appplatform.DiagnosticParameters{ // ... @@ -1715,7 +1715,7 @@ if err := client.DeploymentsStartJFRThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") if err := client.DeploymentsStopThenPoll(ctx, id); err != nil { // handle the error @@ -1727,7 +1727,7 @@ if err := client.DeploymentsStopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") +id := appplatform.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") payload := appplatform.DeploymentResource{ // ... @@ -1744,7 +1744,7 @@ if err := client.DeploymentsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "devToolPortalName") +id := appplatform.NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "devToolPortalName") payload := appplatform.DevToolPortalResource{ // ... @@ -1761,7 +1761,7 @@ if err := client.DevToolPortalsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := appplatform.NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "devToolPortalName") +id := appplatform.NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "devToolPortalName") if err := client.DevToolPortalsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1773,7 +1773,7 @@ if err := client.DevToolPortalsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "devToolPortalName") +id := appplatform.NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "devToolPortalName") read, err := client.DevToolPortalsGet(ctx, id) if err != nil { @@ -1789,7 +1789,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.DevToolPortalsList(ctx, id)` can be used to do batched pagination items, err := client.DevToolPortalsListComplete(ctx, id) @@ -1806,7 +1806,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") read, err := client.EurekaServersGet(ctx, id) if err != nil { @@ -1822,7 +1822,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.EurekaServersList(ctx, id)` can be used to do batched pagination items, err := client.EurekaServersListComplete(ctx, id) @@ -1839,7 +1839,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.EurekaServerResource{ // ... @@ -1856,7 +1856,7 @@ if err := client.EurekaServersUpdatePatchThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.EurekaServerResource{ // ... @@ -1873,7 +1873,7 @@ if err := client.EurekaServersUpdatePutThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "domainName") +id := appplatform.NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "domainName") payload := appplatform.GatewayCustomDomainResource{ // ... @@ -1890,7 +1890,7 @@ if err := client.GatewayCustomDomainsCreateOrUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := appplatform.NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "domainName") +id := appplatform.NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "domainName") if err := client.GatewayCustomDomainsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1902,7 +1902,7 @@ if err := client.GatewayCustomDomainsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "domainName") +id := appplatform.NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "domainName") read, err := client.GatewayCustomDomainsGet(ctx, id) if err != nil { @@ -1918,7 +1918,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") // alternatively `client.GatewayCustomDomainsList(ctx, id)` can be used to do batched pagination items, err := client.GatewayCustomDomainsListComplete(ctx, id) @@ -1935,7 +1935,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "routeConfigName") +id := appplatform.NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "routeConfigName") payload := appplatform.GatewayRouteConfigResource{ // ... @@ -1952,7 +1952,7 @@ if err := client.GatewayRouteConfigsCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := appplatform.NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "routeConfigName") +id := appplatform.NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "routeConfigName") if err := client.GatewayRouteConfigsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1964,7 +1964,7 @@ if err := client.GatewayRouteConfigsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "routeConfigName") +id := appplatform.NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "routeConfigName") read, err := client.GatewayRouteConfigsGet(ctx, id) if err != nil { @@ -1980,7 +1980,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") // alternatively `client.GatewayRouteConfigsList(ctx, id)` can be used to do batched pagination items, err := client.GatewayRouteConfigsListComplete(ctx, id) @@ -1997,7 +1997,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") payload := appplatform.GatewayResource{ // ... @@ -2014,7 +2014,7 @@ if err := client.GatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") if err := client.GatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -2026,7 +2026,7 @@ if err := client.GatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") read, err := client.GatewaysGet(ctx, id) if err != nil { @@ -2042,7 +2042,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.GatewaysList(ctx, id)` can be used to do batched pagination items, err := client.GatewaysListComplete(ctx, id) @@ -2059,7 +2059,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") read, err := client.GatewaysListEnvSecrets(ctx, id) if err != nil { @@ -2075,7 +2075,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") if err := client.GatewaysRestartThenPoll(ctx, id); err != nil { // handle the error @@ -2087,7 +2087,7 @@ if err := client.GatewaysRestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") payload := appplatform.SkuObject{ // ... @@ -2104,7 +2104,7 @@ if err := client.GatewaysUpdateCapacityThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") +id := appplatform.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") payload := appplatform.CustomDomainValidatePayload{ // ... @@ -2125,7 +2125,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") read, err := client.MonitoringSettingsGet(ctx, id) if err != nil { @@ -2141,7 +2141,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.MonitoringSettingResource{ // ... @@ -2158,7 +2158,7 @@ if err := client.MonitoringSettingsUpdatePatchThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.MonitoringSettingResource{ // ... @@ -2175,7 +2175,7 @@ if err := client.MonitoringSettingsUpdatePutThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := appplatform.NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "predefinedAcceleratorName") +id := appplatform.NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "predefinedAcceleratorName") if err := client.PredefinedAcceleratorsDisableThenPoll(ctx, id); err != nil { // handle the error @@ -2187,7 +2187,7 @@ if err := client.PredefinedAcceleratorsDisableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "predefinedAcceleratorName") +id := appplatform.NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "predefinedAcceleratorName") if err := client.PredefinedAcceleratorsEnableThenPoll(ctx, id); err != nil { // handle the error @@ -2199,7 +2199,7 @@ if err := client.PredefinedAcceleratorsEnableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "predefinedAcceleratorName") +id := appplatform.NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "predefinedAcceleratorName") read, err := client.PredefinedAcceleratorsGet(ctx, id) if err != nil { @@ -2215,7 +2215,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName") +id := appplatform.NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName") // alternatively `client.PredefinedAcceleratorsList(ctx, id)` can be used to do batched pagination items, err := client.PredefinedAcceleratorsListComplete(ctx, id) @@ -2248,7 +2248,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appplatform.NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "serviceRegistryName") +id := appplatform.NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "serviceRegistryName") if err := client.ServiceRegistriesCreateOrUpdateThenPoll(ctx, id); err != nil { // handle the error @@ -2260,7 +2260,7 @@ if err := client.ServiceRegistriesCreateOrUpdateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "serviceRegistryName") +id := appplatform.NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "serviceRegistryName") if err := client.ServiceRegistriesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -2272,7 +2272,7 @@ if err := client.ServiceRegistriesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "serviceRegistryName") +id := appplatform.NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "serviceRegistryName") read, err := client.ServiceRegistriesGet(ctx, id) if err != nil { @@ -2288,7 +2288,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ServiceRegistriesList(ctx, id)` can be used to do batched pagination items, err := client.ServiceRegistriesListComplete(ctx, id) @@ -2305,7 +2305,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := appplatform.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := appplatform.NameAvailabilityParameters{ // ... @@ -2326,7 +2326,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.ServiceResource{ // ... @@ -2343,7 +2343,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -2355,7 +2355,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.ApmReference{ // ... @@ -2372,7 +2372,7 @@ if err := client.ServicesDisableApmGloballyThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") read, err := client.ServicesDisableTestEndpoint(ctx, id) if err != nil { @@ -2388,7 +2388,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.ApmReference{ // ... @@ -2405,7 +2405,7 @@ if err := client.ServicesEnableApmGloballyThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") read, err := client.ServicesEnableTestEndpoint(ctx, id) if err != nil { @@ -2421,7 +2421,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") if err := client.ServicesFlushVnetDnsSettingThenPoll(ctx, id); err != nil { // handle the error @@ -2433,7 +2433,7 @@ if err := client.ServicesFlushVnetDnsSettingThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -2483,7 +2483,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") read, err := client.ServicesListGloballyEnabledApms(ctx, id) if err != nil { @@ -2499,7 +2499,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ServicesListSupportedApmTypes(ctx, id)` can be used to do batched pagination items, err := client.ServicesListSupportedApmTypesComplete(ctx, id) @@ -2516,7 +2516,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.ServicesListSupportedServerVersions(ctx, id)` can be used to do batched pagination items, err := client.ServicesListSupportedServerVersionsComplete(ctx, id) @@ -2533,7 +2533,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") read, err := client.ServicesListTestKeys(ctx, id) if err != nil { @@ -2549,7 +2549,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.RegenerateTestKeyRequestPayload{ // ... @@ -2570,7 +2570,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") if err := client.ServicesStartThenPoll(ctx, id); err != nil { // handle the error @@ -2582,7 +2582,7 @@ if err := client.ServicesStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") if err := client.ServicesStopThenPoll(ctx, id); err != nil { // handle the error @@ -2594,7 +2594,7 @@ if err := client.ServicesStopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") payload := appplatform.ServiceResource{ // ... @@ -2628,7 +2628,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appplatform.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "storageName") +id := appplatform.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "storageName") payload := appplatform.StorageResource{ // ... @@ -2645,7 +2645,7 @@ if err := client.StoragesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appplatform.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "storageName") +id := appplatform.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "storageName") if err := client.StoragesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -2657,7 +2657,7 @@ if err := client.StoragesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appplatform.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "storageName") +id := appplatform.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "storageName") read, err := client.StoragesGet(ctx, id) if err != nil { @@ -2673,7 +2673,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := commonids.NewSpringCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName") // alternatively `client.StoragesList(ctx, id)` can be used to do batched pagination items, err := client.StoragesListComplete(ctx, id) diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_agentpool.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_agentpool.go index ac30f519cef..1fc67a79b7b 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_agentpool.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_agentpool.go @@ -127,7 +127,7 @@ func (id AgentPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticBuildServices", "buildServices", "buildServices"), resourceids.UserSpecifiedSegment("buildServiceName", "buildServiceName"), resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_agentpool_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_agentpool_test.go index 709694e4389..242f12f7b3f 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_agentpool_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_agentpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AgentPoolId{} func TestNewAgentPoolID(t *testing.T) { - id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "agentPoolName") + id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "agentPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAgentPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.BuildServiceName != "buildServiceName" { @@ -36,8 +36,8 @@ func TestNewAgentPoolID(t *testing.T) { } func TestFormatAgentPoolID(t *testing.T) { - actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "agentPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/agentPools/agentPoolName" + actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "agentPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/agentPools/agentPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseAgentPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/agentPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/agentPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/agentPools/agentPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/agentPools/agentPoolName", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/agentPools/agentPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/agentPools/agentPoolName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseAgentPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/agentPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/agentPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/aGeNtPoOlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/aGeNtPoOlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/agentPools/agentPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/agentPools/agentPoolName", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/agentPools/agentPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/agentPools/agentPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", BuildServiceName: "bUiLdSeRvIcEnAmE", AgentPoolName: "aGeNtPoOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportal.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportal.go index 59e8fe75580..09a2ce96867 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportal.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportal.go @@ -121,7 +121,7 @@ func (id ApiPortalId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApiPortals", "apiPortals", "apiPortals"), resourceids.UserSpecifiedSegment("apiPortalName", "apiPortalName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportal_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportal_test.go index 93e2bb693fc..c3d687076cb 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportal_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportal_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApiPortalId{} func TestNewApiPortalID(t *testing.T) { - id := NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName") + id := NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApiPortalID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ApiPortalName != "apiPortalName" { @@ -32,8 +32,8 @@ func TestNewApiPortalID(t *testing.T) { } func TestFormatApiPortalID(t *testing.T) { - actual := NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName" + actual := NewApiPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApiPortalID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName", Expected: &ApiPortalId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApiPortalName: "apiPortalName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApiPortalIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPiPoRtAlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPiPoRtAlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName", Expected: &ApiPortalId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApiPortalName: "apiPortalName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPiPoRtAlS/aPiPoRtAlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPiPoRtAlS/aPiPoRtAlNaMe", Expected: &ApiPortalId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ApiPortalName: "aPiPoRtAlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPiPoRtAlS/aPiPoRtAlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPiPoRtAlS/aPiPoRtAlNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportaldomain.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportaldomain.go index 1509e75d9b5..ea76b134608 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportaldomain.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportaldomain.go @@ -127,7 +127,7 @@ func (id ApiPortalDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApiPortals", "apiPortals", "apiPortals"), resourceids.UserSpecifiedSegment("apiPortalName", "apiPortalName"), resourceids.StaticSegment("staticDomains", "domains", "domains"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportaldomain_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportaldomain_test.go index b15ad360735..d5919ec39a3 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportaldomain_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apiportaldomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApiPortalDomainId{} func TestNewApiPortalDomainID(t *testing.T) { - id := NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName", "domainName") + id := NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName", "domainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApiPortalDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ApiPortalName != "apiPortalName" { @@ -36,8 +36,8 @@ func TestNewApiPortalDomainID(t *testing.T) { } func TestFormatApiPortalDomainID(t *testing.T) { - actual := NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apiPortalName", "domainName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/domains/domainName" + actual := NewApiPortalDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apiPortalName", "domainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/domains/domainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseApiPortalDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/domains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/domains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/domains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/domains/domainName", Expected: &ApiPortalDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApiPortalName: "apiPortalName", DomainName: "domainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/domains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/domains/domainName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseApiPortalDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPiPoRtAlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPiPoRtAlS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPiPoRtAlS/aPiPoRtAlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPiPoRtAlS/aPiPoRtAlNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/domains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/domains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPiPoRtAlS/aPiPoRtAlNaMe/dOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPiPoRtAlS/aPiPoRtAlNaMe/dOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/domains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/domains/domainName", Expected: &ApiPortalDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApiPortalName: "apiPortalName", DomainName: "domainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apiPortals/apiPortalName/domains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apiPortals/apiPortalName/domains/domainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPiPoRtAlS/aPiPoRtAlNaMe/dOmAiNs/dOmAiNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPiPoRtAlS/aPiPoRtAlNaMe/dOmAiNs/dOmAiNnAmE", Expected: &ApiPortalDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ApiPortalName: "aPiPoRtAlNaMe", DomainName: "dOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPiPoRtAlS/aPiPoRtAlNaMe/dOmAiNs/dOmAiNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPiPoRtAlS/aPiPoRtAlNaMe/dOmAiNs/dOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apm.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apm.go index 828a3e5aa48..f36f8c46dab 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apm.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apm.go @@ -121,7 +121,7 @@ func (id ApmId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApms", "apms", "apms"), resourceids.UserSpecifiedSegment("apmName", "apmName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apm_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apm_test.go index 9eb240f8239..14066e8a544 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apm_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_apm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApmId{} func TestNewApmID(t *testing.T) { - id := NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apmName") + id := NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apmName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApmID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ApmName != "apmName" { @@ -32,8 +32,8 @@ func TestNewApmID(t *testing.T) { } func TestFormatApmID(t *testing.T) { - actual := NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "apmName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apms/apmName" + actual := NewApmID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "apmName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apms/apmName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApmID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apms", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apms", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apms/apmName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apms/apmName", Expected: &ApmId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApmName: "apmName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apms/apmName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apms/apmName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApmIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apms", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apms", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apms/apmName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apms/apmName", Expected: &ApmId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApmName: "apmName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apms/apmName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apms/apmName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPmS/aPmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPmS/aPmNaMe", Expected: &ApmId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ApmName: "aPmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPmS/aPmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPmS/aPmNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_app.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_app.go index 424003cb742..e2f8ec3beeb 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_app.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_app.go @@ -121,7 +121,7 @@ func (id AppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApps", "apps", "apps"), resourceids.UserSpecifiedSegment("appName", "appName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_app_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_app_test.go index 1eaae7ee46b..ff64ee8038f 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_app_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_app_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AppId{} func TestNewAppID(t *testing.T) { - id := NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName") + id := NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.AppName != "appName" { @@ -32,8 +32,8 @@ func TestNewAppID(t *testing.T) { } func TestFormatAppID(t *testing.T) { - actual := NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName" + actual := NewAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAppID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName", Expected: &AppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", AppName: "appName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAppIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName", Expected: &AppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", AppName: "appName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe", Expected: &AppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", AppName: "aPpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationaccelerator.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationaccelerator.go index 8cc0e66c390..1be59dab579 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationaccelerator.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationaccelerator.go @@ -121,7 +121,7 @@ func (id ApplicationAcceleratorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApplicationAccelerators", "applicationAccelerators", "applicationAccelerators"), resourceids.UserSpecifiedSegment("applicationAcceleratorName", "applicationAcceleratorName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationaccelerator_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationaccelerator_test.go index 1835029d70d..8e48861280c 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationaccelerator_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationaccelerator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationAcceleratorId{} func TestNewApplicationAcceleratorID(t *testing.T) { - id := NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName") + id := NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationAcceleratorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ApplicationAcceleratorName != "applicationAcceleratorName" { @@ -32,8 +32,8 @@ func TestNewApplicationAcceleratorID(t *testing.T) { } func TestFormatApplicationAcceleratorID(t *testing.T) { - actual := NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName" + actual := NewApplicationAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationAcceleratorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName", Expected: &ApplicationAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApplicationAcceleratorName: "applicationAcceleratorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationAcceleratorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName", Expected: &ApplicationAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApplicationAcceleratorName: "applicationAcceleratorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE", Expected: &ApplicationAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ApplicationAcceleratorName: "aPpLiCaTiOnAcCeLeRaToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationliveview.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationliveview.go index a4719fd0a73..1996b1de170 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationliveview.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationliveview.go @@ -121,7 +121,7 @@ func (id ApplicationLiveViewId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApplicationLiveViews", "applicationLiveViews", "applicationLiveViews"), resourceids.UserSpecifiedSegment("applicationLiveViewName", "applicationLiveViewName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationliveview_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationliveview_test.go index b86fb8c4973..45798b4fcf5 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationliveview_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_applicationliveview_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationLiveViewId{} func TestNewApplicationLiveViewID(t *testing.T) { - id := NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationLiveViewName") + id := NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationLiveViewName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationLiveViewID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ApplicationLiveViewName != "applicationLiveViewName" { @@ -32,8 +32,8 @@ func TestNewApplicationLiveViewID(t *testing.T) { } func TestFormatApplicationLiveViewID(t *testing.T) { - actual := NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationLiveViewName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationLiveViews/applicationLiveViewName" + actual := NewApplicationLiveViewID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationLiveViewName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationLiveViews/applicationLiveViewName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationLiveViewID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationLiveViews", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationLiveViews", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationLiveViews/applicationLiveViewName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationLiveViews/applicationLiveViewName", Expected: &ApplicationLiveViewId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApplicationLiveViewName: "applicationLiveViewName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationLiveViews/applicationLiveViewName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationLiveViews/applicationLiveViewName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationLiveViewIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationLiveViews", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationLiveViews", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnLiVeViEwS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnLiVeViEwS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationLiveViews/applicationLiveViewName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationLiveViews/applicationLiveViewName", Expected: &ApplicationLiveViewId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApplicationLiveViewName: "applicationLiveViewName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationLiveViews/applicationLiveViewName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationLiveViews/applicationLiveViewName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnLiVeViEwS/aPpLiCaTiOnLiVeViEwNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnLiVeViEwS/aPpLiCaTiOnLiVeViEwNaMe", Expected: &ApplicationLiveViewId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ApplicationLiveViewName: "aPpLiCaTiOnLiVeViEwNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnLiVeViEwS/aPpLiCaTiOnLiVeViEwNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnLiVeViEwS/aPpLiCaTiOnLiVeViEwNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_binding.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_binding.go index 74502f14a4d..a9e87b64338 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_binding.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_binding.go @@ -127,7 +127,7 @@ func (id BindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApps", "apps", "apps"), resourceids.UserSpecifiedSegment("appName", "appName"), resourceids.StaticSegment("staticBindings", "bindings", "bindings"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_binding_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_binding_test.go index 0403f74c739..34a7ef46b53 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_binding_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_binding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BindingId{} func TestNewBindingID(t *testing.T) { - id := NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "bindingName") + id := NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "bindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.AppName != "appName" { @@ -36,8 +36,8 @@ func TestNewBindingID(t *testing.T) { } func TestFormatBindingID(t *testing.T) { - actual := NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "bindingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/bindings/bindingName" + actual := NewBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "bindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/bindings/bindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/bindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/bindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/bindings/bindingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/bindings/bindingName", Expected: &BindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", AppName: "appName", BindingName: "bindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/bindings/bindingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/bindings/bindingName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/bindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/bindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/bInDiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/bInDiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/bindings/bindingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/bindings/bindingName", Expected: &BindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", AppName: "appName", BindingName: "bindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/bindings/bindingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/bindings/bindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/bInDiNgS/bInDiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/bInDiNgS/bInDiNgNaMe", Expected: &BindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", AppName: "aPpNaMe", BindingName: "bInDiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/bInDiNgS/bInDiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/bInDiNgS/bInDiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_build.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_build.go index 3882d0eee0b..599ed75936a 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_build.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_build.go @@ -127,7 +127,7 @@ func (id BuildId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticBuildServices", "buildServices", "buildServices"), resourceids.UserSpecifiedSegment("buildServiceName", "buildServiceName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_build_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_build_test.go index 835a7e42a9b..8ba78207a5c 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_build_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_build_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildId{} func TestNewBuildID(t *testing.T) { - id := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName") + id := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBuildID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.BuildServiceName != "buildServiceName" { @@ -36,8 +36,8 @@ func TestNewBuildID(t *testing.T) { } func TestFormatBuildID(t *testing.T) { - actual := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName" + actual := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", BuildName: "buildName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", BuildName: "buildName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", BuildServiceName: "bUiLdSeRvIcEnAmE", BuildName: "bUiLdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_builder.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_builder.go index cc665d616e8..68e6872f7f5 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_builder.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_builder.go @@ -127,7 +127,7 @@ func (id BuilderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticBuildServices", "buildServices", "buildServices"), resourceids.UserSpecifiedSegment("buildServiceName", "buildServiceName"), resourceids.StaticSegment("staticBuilders", "builders", "builders"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_builder_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_builder_test.go index d55095886f7..1c7f447290f 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_builder_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_builder_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuilderId{} func TestNewBuilderID(t *testing.T) { - id := NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName") + id := NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBuilderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.BuildServiceName != "buildServiceName" { @@ -36,8 +36,8 @@ func TestNewBuilderID(t *testing.T) { } func TestFormatBuilderID(t *testing.T) { - actual := NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName" + actual := NewBuilderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuilderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName", Expected: &BuilderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", BuilderName: "builderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuilderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName", Expected: &BuilderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", BuilderName: "builderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe", Expected: &BuilderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", BuildServiceName: "bUiLdSeRvIcEnAmE", BuilderName: "bUiLdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildpackbinding.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildpackbinding.go index c5af88810da..844f9cdf390 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildpackbinding.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildpackbinding.go @@ -133,13 +133,13 @@ func (id BuildPackBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticBuildServices", "buildServices", "buildServices"), resourceids.UserSpecifiedSegment("buildServiceName", "buildServiceName"), resourceids.StaticSegment("staticBuilders", "builders", "builders"), resourceids.UserSpecifiedSegment("builderName", "builderName"), resourceids.StaticSegment("staticBuildPackBindings", "buildPackBindings", "buildPackBindings"), - resourceids.UserSpecifiedSegment("buildPackBindingName", "buildpackBindingName"), + resourceids.UserSpecifiedSegment("buildPackBindingName", "buildPackBindingName"), } } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildpackbinding_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildpackbinding_test.go index 487bdc064a5..1ea68061a43 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildpackbinding_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildpackbinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildPackBindingId{} func TestNewBuildPackBindingID(t *testing.T) { - id := NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName", "buildpackBindingName") + id := NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName", "buildPackBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBuildPackBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.BuildServiceName != "buildServiceName" { @@ -34,14 +34,14 @@ func TestNewBuildPackBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'BuilderName'", id.BuilderName, "builderName") } - if id.BuildPackBindingName != "buildpackBindingName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildPackBindingName'", id.BuildPackBindingName, "buildpackBindingName") + if id.BuildPackBindingName != "buildPackBindingName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildPackBindingName'", id.BuildPackBindingName, "buildPackBindingName") } } func TestFormatBuildPackBindingID(t *testing.T) { - actual := NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "builderName", "buildpackBindingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildpackBindingName" + actual := NewBuildPackBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "builderName", "buildPackBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildPackBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseBuildPackBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/buildPackBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/buildPackBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildpackBindingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildPackBindingName", Expected: &BuildPackBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", BuilderName: "builderName", - BuildPackBindingName: "buildpackBindingName", + BuildPackBindingName: "buildPackBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildpackBindingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildPackBindingName/extra", Error: true, }, } @@ -266,88 +266,88 @@ func TestParseBuildPackBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/buildPackBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/buildPackBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe/bUiLdPaCkBiNdInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe/bUiLdPaCkBiNdInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildpackBindingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildPackBindingName", Expected: &BuildPackBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", BuilderName: "builderName", - BuildPackBindingName: "buildpackBindingName", + BuildPackBindingName: "buildPackBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildpackBindingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builders/builderName/buildPackBindings/buildPackBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe/bUiLdPaCkBiNdInGs/bUiLdPaCkBiNdInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe/bUiLdPaCkBiNdInGs/bUiLdPaCkBiNdInGnAmE", Expected: &BuildPackBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", BuildServiceName: "bUiLdSeRvIcEnAmE", BuilderName: "bUiLdErNaMe", BuildPackBindingName: "bUiLdPaCkBiNdInGnAmE", @@ -355,7 +355,7 @@ func TestParseBuildPackBindingIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe/bUiLdPaCkBiNdInGs/bUiLdPaCkBiNdInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdErS/bUiLdErNaMe/bUiLdPaCkBiNdInGs/bUiLdPaCkBiNdInGnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildservice.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildservice.go index 201184323a4..28fa106aa36 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildservice.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildservice.go @@ -121,7 +121,7 @@ func (id BuildServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticBuildServices", "buildServices", "buildServices"), resourceids.UserSpecifiedSegment("buildServiceName", "buildServiceName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildservice_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildservice_test.go index 472241f5a26..d533db08627 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildservice_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_buildservice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildServiceId{} func TestNewBuildServiceID(t *testing.T) { - id := NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName") + id := NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBuildServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.BuildServiceName != "buildServiceName" { @@ -32,8 +32,8 @@ func TestNewBuildServiceID(t *testing.T) { } func TestFormatBuildServiceID(t *testing.T) { - actual := NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName" + actual := NewBuildServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBuildServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Expected: &BuildServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBuildServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Expected: &BuildServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", Expected: &BuildServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", BuildServiceName: "bUiLdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_certificate.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_certificate.go index 897a366b2ba..d5868a74e0e 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_certificate.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_certificate_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_certificate_test.go index 4e25437477f..05e25275c3e 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_certificate_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_configurationservice.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_configurationservice.go index 586fb8e6f8f..817d387c863 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_configurationservice.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_configurationservice.go @@ -121,7 +121,7 @@ func (id ConfigurationServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticConfigurationServices", "configurationServices", "configurationServices"), resourceids.UserSpecifiedSegment("configurationServiceName", "configurationServiceName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_configurationservice_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_configurationservice_test.go index acbf439deb4..53ee62ebfd7 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_configurationservice_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_configurationservice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationServiceId{} func TestNewConfigurationServiceID(t *testing.T) { - id := NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "configurationServiceName") + id := NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "configurationServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ConfigurationServiceName != "configurationServiceName" { @@ -32,8 +32,8 @@ func TestNewConfigurationServiceID(t *testing.T) { } func TestFormatConfigurationServiceID(t *testing.T) { - actual := NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "configurationServiceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/configurationServices/configurationServiceName" + actual := NewConfigurationServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "configurationServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/configurationServices/configurationServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/configurationServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/configurationServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/configurationServices/configurationServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/configurationServices/configurationServiceName", Expected: &ConfigurationServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ConfigurationServiceName: "configurationServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/configurationServices/configurationServiceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/configurationServices/configurationServiceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/configurationServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/configurationServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cOnFiGuRaTiOnSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cOnFiGuRaTiOnSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/configurationServices/configurationServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/configurationServices/configurationServiceName", Expected: &ConfigurationServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ConfigurationServiceName: "configurationServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/configurationServices/configurationServiceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/configurationServices/configurationServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cOnFiGuRaTiOnSeRvIcEs/cOnFiGuRaTiOnSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cOnFiGuRaTiOnSeRvIcEs/cOnFiGuRaTiOnSeRvIcEnAmE", Expected: &ConfigurationServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ConfigurationServiceName: "cOnFiGuRaTiOnSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cOnFiGuRaTiOnSeRvIcEs/cOnFiGuRaTiOnSeRvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cOnFiGuRaTiOnSeRvIcEs/cOnFiGuRaTiOnSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_containerregistry.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_containerregistry.go index 7c5c589f65d..16c77ae4b97 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_containerregistry.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_containerregistry.go @@ -121,7 +121,7 @@ func (id ContainerRegistryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticContainerRegistries", "containerRegistries", "containerRegistries"), resourceids.UserSpecifiedSegment("containerRegistryName", "containerRegistryName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_containerregistry_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_containerregistry_test.go index 7c476c97c19..9ba67e6eeb5 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_containerregistry_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_containerregistry_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerRegistryId{} func TestNewContainerRegistryID(t *testing.T) { - id := NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "containerRegistryName") + id := NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "containerRegistryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewContainerRegistryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ContainerRegistryName != "containerRegistryName" { @@ -32,8 +32,8 @@ func TestNewContainerRegistryID(t *testing.T) { } func TestFormatContainerRegistryID(t *testing.T) { - actual := NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "containerRegistryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/containerRegistries/containerRegistryName" + actual := NewContainerRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "containerRegistryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/containerRegistries/containerRegistryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseContainerRegistryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/containerRegistries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/containerRegistries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/containerRegistries/containerRegistryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/containerRegistries/containerRegistryName", Expected: &ContainerRegistryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ContainerRegistryName: "containerRegistryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/containerRegistries/containerRegistryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/containerRegistries/containerRegistryName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseContainerRegistryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/containerRegistries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/containerRegistries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cOnTaInErReGiStRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cOnTaInErReGiStRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/containerRegistries/containerRegistryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/containerRegistries/containerRegistryName", Expected: &ContainerRegistryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ContainerRegistryName: "containerRegistryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/containerRegistries/containerRegistryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/containerRegistries/containerRegistryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cOnTaInErReGiStRiEs/cOnTaInErReGiStRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cOnTaInErReGiStRiEs/cOnTaInErReGiStRyNaMe", Expected: &ContainerRegistryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ContainerRegistryName: "cOnTaInErReGiStRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/cOnTaInErReGiStRiEs/cOnTaInErReGiStRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/cOnTaInErReGiStRiEs/cOnTaInErReGiStRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_customizedaccelerator.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_customizedaccelerator.go index 03cec1da9fa..244567c6cd9 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_customizedaccelerator.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_customizedaccelerator.go @@ -127,7 +127,7 @@ func (id CustomizedAcceleratorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApplicationAccelerators", "applicationAccelerators", "applicationAccelerators"), resourceids.UserSpecifiedSegment("applicationAcceleratorName", "applicationAcceleratorName"), resourceids.StaticSegment("staticCustomizedAccelerators", "customizedAccelerators", "customizedAccelerators"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_customizedaccelerator_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_customizedaccelerator_test.go index 825da9f802b..2ef35c36e0d 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_customizedaccelerator_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_customizedaccelerator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomizedAcceleratorId{} func TestNewCustomizedAcceleratorID(t *testing.T) { - id := NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "customizedAcceleratorName") + id := NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "customizedAcceleratorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCustomizedAcceleratorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ApplicationAcceleratorName != "applicationAcceleratorName" { @@ -36,8 +36,8 @@ func TestNewCustomizedAcceleratorID(t *testing.T) { } func TestFormatCustomizedAcceleratorID(t *testing.T) { - actual := NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "customizedAcceleratorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName" + actual := NewCustomizedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "customizedAcceleratorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCustomizedAcceleratorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName", Expected: &CustomizedAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApplicationAcceleratorName: "applicationAcceleratorName", CustomizedAcceleratorName: "customizedAcceleratorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCustomizedAcceleratorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/cUsToMiZeDaCcElErAtOrS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/cUsToMiZeDaCcElErAtOrS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName", Expected: &CustomizedAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApplicationAcceleratorName: "applicationAcceleratorName", CustomizedAcceleratorName: "customizedAcceleratorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/customizedAccelerators/customizedAcceleratorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/cUsToMiZeDaCcElErAtOrS/cUsToMiZeDaCcElErAtOrNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/cUsToMiZeDaCcElErAtOrS/cUsToMiZeDaCcElErAtOrNaMe", Expected: &CustomizedAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ApplicationAcceleratorName: "aPpLiCaTiOnAcCeLeRaToRnAmE", CustomizedAcceleratorName: "cUsToMiZeDaCcElErAtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/cUsToMiZeDaCcElErAtOrS/cUsToMiZeDaCcElErAtOrNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/cUsToMiZeDaCcElErAtOrS/cUsToMiZeDaCcElErAtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_deployment.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_deployment.go index 10c20e2ce4a..6d1f6af4285 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_deployment.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_deployment.go @@ -127,7 +127,7 @@ func (id DeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApps", "apps", "apps"), resourceids.UserSpecifiedSegment("appName", "appName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_deployment_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_deployment_test.go index 71f5108049f..ecc58d8f5a9 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_deployment_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_deployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeploymentId{} func TestNewDeploymentID(t *testing.T) { - id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName") + id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.AppName != "appName" { @@ -36,8 +36,8 @@ func TestNewDeploymentID(t *testing.T) { } func TestFormatDeploymentID(t *testing.T) { - actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/deployments/deploymentName" + actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/deployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", AppName: "appName", DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/deployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/deployments/deploymentName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/deployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", AppName: "appName", DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/deployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/dEpLoYmEnTs/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", AppName: "aPpNaMe", DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_devtoolportal.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_devtoolportal.go index b332c41eccc..f039e8ec1b8 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_devtoolportal.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_devtoolportal.go @@ -121,7 +121,7 @@ func (id DevToolPortalId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticDevToolPortals", "devToolPortals", "devToolPortals"), resourceids.UserSpecifiedSegment("devToolPortalName", "devToolPortalName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_devtoolportal_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_devtoolportal_test.go index 49c0f612315..d6208db3ef4 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_devtoolportal_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_devtoolportal_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DevToolPortalId{} func TestNewDevToolPortalID(t *testing.T) { - id := NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "devToolPortalName") + id := NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "devToolPortalName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDevToolPortalID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.DevToolPortalName != "devToolPortalName" { @@ -32,8 +32,8 @@ func TestNewDevToolPortalID(t *testing.T) { } func TestFormatDevToolPortalID(t *testing.T) { - actual := NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "devToolPortalName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/devToolPortals/devToolPortalName" + actual := NewDevToolPortalID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "devToolPortalName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/devToolPortals/devToolPortalName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDevToolPortalID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/devToolPortals", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/devToolPortals", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/devToolPortals/devToolPortalName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/devToolPortals/devToolPortalName", Expected: &DevToolPortalId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", DevToolPortalName: "devToolPortalName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/devToolPortals/devToolPortalName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/devToolPortals/devToolPortalName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDevToolPortalIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/devToolPortals", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/devToolPortals", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/dEvToOlPoRtAlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/dEvToOlPoRtAlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/devToolPortals/devToolPortalName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/devToolPortals/devToolPortalName", Expected: &DevToolPortalId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", DevToolPortalName: "devToolPortalName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/devToolPortals/devToolPortalName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/devToolPortals/devToolPortalName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/dEvToOlPoRtAlS/dEvToOlPoRtAlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/dEvToOlPoRtAlS/dEvToOlPoRtAlNaMe", Expected: &DevToolPortalId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", DevToolPortalName: "dEvToOlPoRtAlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/dEvToOlPoRtAlS/dEvToOlPoRtAlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/dEvToOlPoRtAlS/dEvToOlPoRtAlNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_domain.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_domain.go index 506a6832159..533d7b953fe 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_domain.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_domain.go @@ -127,7 +127,7 @@ func (id DomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApps", "apps", "apps"), resourceids.UserSpecifiedSegment("appName", "appName"), resourceids.StaticSegment("staticDomains", "domains", "domains"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_domain_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_domain_test.go index 0be7c635698..b06984a8b5d 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_domain_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_domain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DomainId{} func TestNewDomainID(t *testing.T) { - id := NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "domainName") + id := NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "domainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.AppName != "appName" { @@ -36,8 +36,8 @@ func TestNewDomainID(t *testing.T) { } func TestFormatDomainID(t *testing.T) { - actual := NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "appName", "domainName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/domains/domainName" + actual := NewDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "appName", "domainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/domains/domainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/domains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/domains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/domains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/domains/domainName", Expected: &DomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", AppName: "appName", DomainName: "domainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/domains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/domains/domainName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/domains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/domains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/dOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/dOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/domains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/domains/domainName", Expected: &DomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", AppName: "appName", DomainName: "domainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/apps/appName/domains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/apps/appName/domains/domainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/dOmAiNs/dOmAiNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/dOmAiNs/dOmAiNnAmE", Expected: &DomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", AppName: "aPpNaMe", DomainName: "dOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpS/aPpNaMe/dOmAiNs/dOmAiNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpS/aPpNaMe/dOmAiNs/dOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gateway.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gateway.go index 120c1aeaf30..197e3a1e57a 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gateway.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gateway.go @@ -121,7 +121,7 @@ func (id GatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gateway_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gateway_test.go index d75580a1ffe..78f6d73a37b 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gateway_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GatewayId{} func TestNewGatewayID(t *testing.T) { - id := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName") + id := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.GatewayName != "gatewayName" { @@ -32,8 +32,8 @@ func TestNewGatewayID(t *testing.T) { } func TestFormatGatewayID(t *testing.T) { - actual := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName" + actual := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gatewaydomain.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gatewaydomain.go index 1bab10b411d..e6977bb38d5 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gatewaydomain.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gatewaydomain.go @@ -127,7 +127,7 @@ func (id GatewayDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), resourceids.StaticSegment("staticDomains", "domains", "domains"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gatewaydomain_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gatewaydomain_test.go index 5428ad5b218..319edaa9acd 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gatewaydomain_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_gatewaydomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GatewayDomainId{} func TestNewGatewayDomainID(t *testing.T) { - id := NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "domainName") + id := NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "domainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewGatewayDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.GatewayName != "gatewayName" { @@ -36,8 +36,8 @@ func TestNewGatewayDomainID(t *testing.T) { } func TestFormatGatewayDomainID(t *testing.T) { - actual := NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "domainName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/domains/domainName" + actual := NewGatewayDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "domainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/domains/domainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGatewayDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/domains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/domains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/domains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/domains/domainName", Expected: &GatewayDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", GatewayName: "gatewayName", DomainName: "domainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/domains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/domains/domainName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGatewayDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/domains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/domains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe/dOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe/dOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/domains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/domains/domainName", Expected: &GatewayDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", GatewayName: "gatewayName", DomainName: "domainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/domains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/domains/domainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe/dOmAiNs/dOmAiNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe/dOmAiNs/dOmAiNnAmE", Expected: &GatewayDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", GatewayName: "gAtEwAyNaMe", DomainName: "dOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe/dOmAiNs/dOmAiNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe/dOmAiNs/dOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_location.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_location.go index 778d96b4dc0..0aa97734894 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_location.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_location_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_location_test.go index 69b5cf38eab..2a3734a4076 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_location_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AppPlatform/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_predefinedaccelerator.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_predefinedaccelerator.go index 3a2cde2d9d2..cf14edf337c 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_predefinedaccelerator.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_predefinedaccelerator.go @@ -127,7 +127,7 @@ func (id PredefinedAcceleratorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticApplicationAccelerators", "applicationAccelerators", "applicationAccelerators"), resourceids.UserSpecifiedSegment("applicationAcceleratorName", "applicationAcceleratorName"), resourceids.StaticSegment("staticPredefinedAccelerators", "predefinedAccelerators", "predefinedAccelerators"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_predefinedaccelerator_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_predefinedaccelerator_test.go index a87430e5dd0..29e0d02f885 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_predefinedaccelerator_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_predefinedaccelerator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PredefinedAcceleratorId{} func TestNewPredefinedAcceleratorID(t *testing.T) { - id := NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "predefinedAcceleratorName") + id := NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "predefinedAcceleratorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPredefinedAcceleratorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ApplicationAcceleratorName != "applicationAcceleratorName" { @@ -36,8 +36,8 @@ func TestNewPredefinedAcceleratorID(t *testing.T) { } func TestFormatPredefinedAcceleratorID(t *testing.T) { - actual := NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "applicationAcceleratorName", "predefinedAcceleratorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName" + actual := NewPredefinedAcceleratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "applicationAcceleratorName", "predefinedAcceleratorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePredefinedAcceleratorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName", Expected: &PredefinedAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApplicationAcceleratorName: "applicationAcceleratorName", PredefinedAcceleratorName: "predefinedAcceleratorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePredefinedAcceleratorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/pReDeFiNeDaCcElErAtOrS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/pReDeFiNeDaCcElErAtOrS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName", Expected: &PredefinedAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ApplicationAcceleratorName: "applicationAcceleratorName", PredefinedAcceleratorName: "predefinedAcceleratorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/applicationAccelerators/applicationAcceleratorName/predefinedAccelerators/predefinedAcceleratorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/pReDeFiNeDaCcElErAtOrS/pReDeFiNeDaCcElErAtOrNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/pReDeFiNeDaCcElErAtOrS/pReDeFiNeDaCcElErAtOrNaMe", Expected: &PredefinedAcceleratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ApplicationAcceleratorName: "aPpLiCaTiOnAcCeLeRaToRnAmE", PredefinedAcceleratorName: "pReDeFiNeDaCcElErAtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/pReDeFiNeDaCcElErAtOrS/pReDeFiNeDaCcElErAtOrNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/aPpLiCaTiOnAcCeLeRaToRs/aPpLiCaTiOnAcCeLeRaToRnAmE/pReDeFiNeDaCcElErAtOrS/pReDeFiNeDaCcElErAtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_result.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_result.go index dd899109a48..d04c64aad61 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_result.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_result.go @@ -133,13 +133,13 @@ func (id ResultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticBuildServices", "buildServices", "buildServices"), resourceids.UserSpecifiedSegment("buildServiceName", "buildServiceName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticResults", "results", "results"), - resourceids.UserSpecifiedSegment("resultName", "buildResultName"), + resourceids.UserSpecifiedSegment("resultName", "resultName"), } } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_result_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_result_test.go index 729f35b12a6..ce0167368f7 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_result_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_result_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ResultId{} func TestNewResultID(t *testing.T) { - id := NewResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName", "buildResultName") + id := NewResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName", "resultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewResultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.BuildServiceName != "buildServiceName" { @@ -34,14 +34,14 @@ func TestNewResultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } - if id.ResultName != "buildResultName" { - t.Fatalf("Expected %q but got %q for Segment 'ResultName'", id.ResultName, "buildResultName") + if id.ResultName != "resultName" { + t.Fatalf("Expected %q but got %q for Segment 'ResultName'", id.ResultName, "resultName") } } func TestFormatResultID(t *testing.T) { - actual := NewResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildName", "buildResultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/results/buildResultName" + actual := NewResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "buildName", "resultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/results/resultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseResultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/results", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/results", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/results/buildResultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/results/resultName", Expected: &ResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", BuildName: "buildName", - ResultName: "buildResultName", + ResultName: "resultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/results/buildResultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/results/resultName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseResultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/results", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/results", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe/rEsUlTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe/rEsUlTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/results/buildResultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/results/resultName", Expected: &ResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", BuildName: "buildName", - ResultName: "buildResultName", + ResultName: "resultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/builds/buildName/results/buildResultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/builds/buildName/results/resultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe/rEsUlTs/bUiLdReSuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe/rEsUlTs/rEsUlTnAmE", Expected: &ResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", BuildServiceName: "bUiLdSeRvIcEnAmE", BuildName: "bUiLdNaMe", - ResultName: "bUiLdReSuLtNaMe", + ResultName: "rEsUlTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe/rEsUlTs/bUiLdReSuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/bUiLdS/bUiLdNaMe/rEsUlTs/rEsUlTnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_routeconfig.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_routeconfig.go index f3b52f33881..7e7c1a3f8d1 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_routeconfig.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_routeconfig.go @@ -127,7 +127,7 @@ func (id RouteConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), resourceids.StaticSegment("staticRouteConfigs", "routeConfigs", "routeConfigs"), diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_routeconfig_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_routeconfig_test.go index c6b54abaf1a..ec68b75666f 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_routeconfig_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_routeconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteConfigId{} func TestNewRouteConfigID(t *testing.T) { - id := NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "routeConfigName") + id := NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "routeConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRouteConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.GatewayName != "gatewayName" { @@ -36,8 +36,8 @@ func TestNewRouteConfigID(t *testing.T) { } func TestFormatRouteConfigID(t *testing.T) { - actual := NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "gatewayName", "routeConfigName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/routeConfigs/routeConfigName" + actual := NewRouteConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "gatewayName", "routeConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/routeConfigs/routeConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRouteConfigID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/routeConfigs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/routeConfigs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/routeConfigs/routeConfigName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/routeConfigs/routeConfigName", Expected: &RouteConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", GatewayName: "gatewayName", RouteConfigName: "routeConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/routeConfigs/routeConfigName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/routeConfigs/routeConfigName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRouteConfigIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/routeConfigs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/routeConfigs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe/rOuTeCoNfIgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe/rOuTeCoNfIgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/routeConfigs/routeConfigName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/routeConfigs/routeConfigName", Expected: &RouteConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", GatewayName: "gatewayName", RouteConfigName: "routeConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/gateways/gatewayName/routeConfigs/routeConfigName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/gateways/gatewayName/routeConfigs/routeConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe/rOuTeCoNfIgS/rOuTeCoNfIgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe/rOuTeCoNfIgS/rOuTeCoNfIgNaMe", Expected: &RouteConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", GatewayName: "gAtEwAyNaMe", RouteConfigName: "rOuTeCoNfIgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/gAtEwAyS/gAtEwAyNaMe/rOuTeCoNfIgS/rOuTeCoNfIgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/gAtEwAyS/gAtEwAyNaMe/rOuTeCoNfIgS/rOuTeCoNfIgNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_serviceregistry.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_serviceregistry.go index 8700f597a7a..ab4a91ee346 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_serviceregistry.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_serviceregistry.go @@ -121,7 +121,7 @@ func (id ServiceRegistryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticServiceRegistries", "serviceRegistries", "serviceRegistries"), resourceids.UserSpecifiedSegment("serviceRegistryName", "serviceRegistryName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_serviceregistry_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_serviceregistry_test.go index 4941a46cb41..93fb31b0090 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_serviceregistry_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_serviceregistry_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceRegistryId{} func TestNewServiceRegistryID(t *testing.T) { - id := NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "serviceRegistryName") + id := NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "serviceRegistryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceRegistryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.ServiceRegistryName != "serviceRegistryName" { @@ -32,8 +32,8 @@ func TestNewServiceRegistryID(t *testing.T) { } func TestFormatServiceRegistryID(t *testing.T) { - actual := NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "serviceRegistryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/serviceRegistries/serviceRegistryName" + actual := NewServiceRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "serviceRegistryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/serviceRegistries/serviceRegistryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceRegistryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/serviceRegistries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/serviceRegistries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/serviceRegistries/serviceRegistryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/serviceRegistries/serviceRegistryName", Expected: &ServiceRegistryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ServiceRegistryName: "serviceRegistryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/serviceRegistries/serviceRegistryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/serviceRegistries/serviceRegistryName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceRegistryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/serviceRegistries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/serviceRegistries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/sErViCeReGiStRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/sErViCeReGiStRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/serviceRegistries/serviceRegistryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/serviceRegistries/serviceRegistryName", Expected: &ServiceRegistryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", ServiceRegistryName: "serviceRegistryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/serviceRegistries/serviceRegistryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/serviceRegistries/serviceRegistryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/sErViCeReGiStRiEs/sErViCeReGiStRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/sErViCeReGiStRiEs/sErViCeReGiStRyNaMe", Expected: &ServiceRegistryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", ServiceRegistryName: "sErViCeReGiStRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/sErViCeReGiStRiEs/sErViCeReGiStRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/sErViCeReGiStRiEs/sErViCeReGiStRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_storage.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_storage.go index 004318e79f1..fd15260df02 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_storage.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_storage.go @@ -121,7 +121,7 @@ func (id StorageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticStorages", "storages", "storages"), resourceids.UserSpecifiedSegment("storageName", "storageName"), } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_storage_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_storage_test.go index 5c6a6b9c6d4..45e759ca305 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_storage_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_storage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageId{} func TestNewStorageID(t *testing.T) { - id := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "storageName") + id := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "storageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.StorageName != "storageName" { @@ -32,8 +32,8 @@ func TestNewStorageID(t *testing.T) { } func TestFormatStorageID(t *testing.T) { - actual := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "storageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/storages/storageName" + actual := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "storageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/storages/storageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/storages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/storages", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/storages/storageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/storages/storageName", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", StorageName: "storageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/storages/storageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/storages/storageName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/storages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/storages", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/sToRaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/sToRaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/storages/storageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/storages/storageName", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", StorageName: "storageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/storages/storageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/storages/storageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/sToRaGeS/sToRaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/sToRaGeS/sToRaGeNaMe", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", StorageName: "sToRaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/sToRaGeS/sToRaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/sToRaGeS/sToRaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedbuildpack.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedbuildpack.go index 2611b658680..6563c7f213c 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedbuildpack.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedbuildpack.go @@ -127,11 +127,11 @@ func (id SupportedBuildPackId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticBuildServices", "buildServices", "buildServices"), resourceids.UserSpecifiedSegment("buildServiceName", "buildServiceName"), resourceids.StaticSegment("staticSupportedBuildPacks", "supportedBuildPacks", "supportedBuildPacks"), - resourceids.UserSpecifiedSegment("supportedBuildPackName", "buildpackName"), + resourceids.UserSpecifiedSegment("supportedBuildPackName", "supportedBuildPackName"), } } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedbuildpack_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedbuildpack_test.go index 6afbc0e0d03..55550eefd46 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedbuildpack_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedbuildpack_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SupportedBuildPackId{} func TestNewSupportedBuildPackID(t *testing.T) { - id := NewSupportedBuildPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildpackName") + id := NewSupportedBuildPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "supportedBuildPackName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSupportedBuildPackID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.BuildServiceName != "buildServiceName" { t.Fatalf("Expected %q but got %q for Segment 'BuildServiceName'", id.BuildServiceName, "buildServiceName") } - if id.SupportedBuildPackName != "buildpackName" { - t.Fatalf("Expected %q but got %q for Segment 'SupportedBuildPackName'", id.SupportedBuildPackName, "buildpackName") + if id.SupportedBuildPackName != "supportedBuildPackName" { + t.Fatalf("Expected %q but got %q for Segment 'SupportedBuildPackName'", id.SupportedBuildPackName, "supportedBuildPackName") } } func TestFormatSupportedBuildPackID(t *testing.T) { - actual := NewSupportedBuildPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "buildpackName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedBuildPacks/buildpackName" + actual := NewSupportedBuildPackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "supportedBuildPackName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedBuildPacks/supportedBuildPackName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSupportedBuildPackID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedBuildPacks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedBuildPacks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedBuildPacks/buildpackName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedBuildPacks/supportedBuildPackName", Expected: &SupportedBuildPackId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", - SupportedBuildPackName: "buildpackName", + SupportedBuildPackName: "supportedBuildPackName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedBuildPacks/buildpackName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedBuildPacks/supportedBuildPackName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSupportedBuildPackIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedBuildPacks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedBuildPacks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdBuIlDpAcKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdBuIlDpAcKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedBuildPacks/buildpackName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedBuildPacks/supportedBuildPackName", Expected: &SupportedBuildPackId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", - SupportedBuildPackName: "buildpackName", + SupportedBuildPackName: "supportedBuildPackName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedBuildPacks/buildpackName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedBuildPacks/supportedBuildPackName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdBuIlDpAcKs/bUiLdPaCkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdBuIlDpAcKs/sUpPoRtEdBuIlDpAcKnAmE", Expected: &SupportedBuildPackId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", BuildServiceName: "bUiLdSeRvIcEnAmE", - SupportedBuildPackName: "bUiLdPaCkNaMe", + SupportedBuildPackName: "sUpPoRtEdBuIlDpAcKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdBuIlDpAcKs/bUiLdPaCkNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdBuIlDpAcKs/sUpPoRtEdBuIlDpAcKnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedstack.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedstack.go index 865195f9afa..e8fadf42f95 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedstack.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedstack.go @@ -127,11 +127,11 @@ func (id SupportedStackId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAppPlatform", "Microsoft.AppPlatform", "Microsoft.AppPlatform"), resourceids.StaticSegment("staticSpring", "spring", "spring"), - resourceids.UserSpecifiedSegment("springName", "serviceName"), + resourceids.UserSpecifiedSegment("springName", "springName"), resourceids.StaticSegment("staticBuildServices", "buildServices", "buildServices"), resourceids.UserSpecifiedSegment("buildServiceName", "buildServiceName"), resourceids.StaticSegment("staticSupportedStacks", "supportedStacks", "supportedStacks"), - resourceids.UserSpecifiedSegment("supportedStackName", "stackName"), + resourceids.UserSpecifiedSegment("supportedStackName", "supportedStackName"), } } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedstack_test.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedstack_test.go index baca196a056..9d51aa7250d 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedstack_test.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/id_supportedstack_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SupportedStackId{} func TestNewSupportedStackID(t *testing.T) { - id := NewSupportedStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "stackName") + id := NewSupportedStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "supportedStackName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSupportedStackID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpringName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "serviceName") + if id.SpringName != "springName" { + t.Fatalf("Expected %q but got %q for Segment 'SpringName'", id.SpringName, "springName") } if id.BuildServiceName != "buildServiceName" { t.Fatalf("Expected %q but got %q for Segment 'BuildServiceName'", id.BuildServiceName, "buildServiceName") } - if id.SupportedStackName != "stackName" { - t.Fatalf("Expected %q but got %q for Segment 'SupportedStackName'", id.SupportedStackName, "stackName") + if id.SupportedStackName != "supportedStackName" { + t.Fatalf("Expected %q but got %q for Segment 'SupportedStackName'", id.SupportedStackName, "supportedStackName") } } func TestFormatSupportedStackID(t *testing.T) { - actual := NewSupportedStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "buildServiceName", "stackName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedStacks/stackName" + actual := NewSupportedStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "springName", "buildServiceName", "supportedStackName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedStacks/supportedStackName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSupportedStackID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedStacks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedStacks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedStacks/stackName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedStacks/supportedStackName", Expected: &SupportedStackId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", - SupportedStackName: "stackName", + SupportedStackName: "supportedStackName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedStacks/stackName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedStacks/supportedStackName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSupportedStackIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedStacks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedStacks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdStAcKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdStAcKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedStacks/stackName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedStacks/supportedStackName", Expected: &SupportedStackId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpringName: "serviceName", + SpringName: "springName", BuildServiceName: "buildServiceName", - SupportedStackName: "stackName", + SupportedStackName: "supportedStackName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/serviceName/buildServices/buildServiceName/supportedStacks/stackName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AppPlatform/spring/springName/buildServices/buildServiceName/supportedStacks/supportedStackName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdStAcKs/sTaCkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdStAcKs/sUpPoRtEdStAcKnAmE", Expected: &SupportedStackId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpringName: "sErViCeNaMe", + SpringName: "sPrInGnAmE", BuildServiceName: "bUiLdSeRvIcEnAmE", - SupportedStackName: "sTaCkNaMe", + SupportedStackName: "sUpPoRtEdStAcKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sErViCeNaMe/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdStAcKs/sTaCkNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPpPlAtFoRm/sPrInG/sPrInGnAmE/bUiLdSeRvIcEs/bUiLdSeRvIcEnAmE/sUpPoRtEdStAcKs/sUpPoRtEdStAcKnAmE/extra", Error: true, }, } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/method_appsgetresourceuploadurl.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/method_appsgetresourceuploadurl.go index 6e1b2cd1650..c309409d12e 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/method_appsgetresourceuploadurl.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/method_appsgetresourceuploadurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type AppsGetResourceUploadUrlOperationResponse struct { +type AppsGetResourceUploadURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *ResourceUploadDefinition } -// AppsGetResourceUploadUrl ... -func (c AppPlatformClient) AppsGetResourceUploadUrl(ctx context.Context, id AppId) (result AppsGetResourceUploadUrlOperationResponse, err error) { +// AppsGetResourceUploadURL ... +func (c AppPlatformClient) AppsGetResourceUploadURL(ctx context.Context, id AppId) (result AppsGetResourceUploadURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/method_buildservicegetresourceuploadurl.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/method_buildservicegetresourceuploadurl.go index 9708b701e43..6f268bd29bc 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/method_buildservicegetresourceuploadurl.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/method_buildservicegetresourceuploadurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type BuildServiceGetResourceUploadUrlOperationResponse struct { +type BuildServiceGetResourceUploadURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *ResourceUploadDefinition } -// BuildServiceGetResourceUploadUrl ... -func (c AppPlatformClient) BuildServiceGetResourceUploadUrl(ctx context.Context, id BuildServiceId) (result BuildServiceGetResourceUploadUrlOperationResponse, err error) { +// BuildServiceGetResourceUploadURL ... +func (c AppPlatformClient) BuildServiceGetResourceUploadURL(ctx context.Context, id BuildServiceId) (result BuildServiceGetResourceUploadURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/method_deploymentsgetlogfileurl.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/method_deploymentsgetlogfileurl.go index 674afbef641..26f6ba9df87 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/method_deploymentsgetlogfileurl.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/method_deploymentsgetlogfileurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DeploymentsGetLogFileUrlOperationResponse struct { +type DeploymentsGetLogFileURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *LogFileUrlResponse + Model *LogFileURLResponse } -// DeploymentsGetLogFileUrl ... -func (c AppPlatformClient) DeploymentsGetLogFileUrl(ctx context.Context, id DeploymentId) (result DeploymentsGetLogFileUrlOperationResponse, err error) { +// DeploymentsGetLogFileURL ... +func (c AppPlatformClient) DeploymentsGetLogFileURL(ctx context.Context, id DeploymentId) (result DeploymentsGetLogFileURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -45,7 +45,7 @@ func (c AppPlatformClient) DeploymentsGetLogFileUrl(ctx context.Context, id Depl return } - var model LogFileUrlResponse + var model LogFileURLResponse result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_apiportalproperties.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_apiportalproperties.go index e4ffded5c40..8f9635a372e 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_apiportalproperties.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_apiportalproperties.go @@ -11,7 +11,7 @@ type ApiPortalProperties struct { ProvisioningState *ApiPortalProvisioningState `json:"provisioningState,omitempty"` Public *bool `json:"public,omitempty"` ResourceRequests *ApiPortalResourceRequests `json:"resourceRequests,omitempty"` - SourceUrls *[]string `json:"sourceUrls,omitempty"` + SourceURLs *[]string `json:"sourceUrls,omitempty"` SsoProperties *SsoProperties `json:"ssoProperties,omitempty"` Url *string `json:"url,omitempty"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_appvnetaddons.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_appvnetaddons.go index baf72c52de1..58649ca7840 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_appvnetaddons.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_appvnetaddons.go @@ -5,5 +5,5 @@ package appplatform type AppVNetAddons struct { PublicEndpoint *bool `json:"publicEndpoint,omitempty"` - PublicEndpointUrl *string `json:"publicEndpointUrl,omitempty"` + PublicEndpointURL *string `json:"publicEndpointUrl,omitempty"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_buildresultlog.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_buildresultlog.go index ae9e019d802..904cc74807b 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_buildresultlog.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_buildresultlog.go @@ -4,5 +4,5 @@ package appplatform // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type BuildResultLog struct { - BlobUrl *string `json:"blobUrl,omitempty"` + BlobURL *string `json:"blobUrl,omitempty"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_customizedacceleratorproperties.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_customizedacceleratorproperties.go index e1b0ae37c62..0e5496603b4 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_customizedacceleratorproperties.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_customizedacceleratorproperties.go @@ -9,7 +9,7 @@ type CustomizedAcceleratorProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` GitRepository AcceleratorGitRepository `json:"gitRepository"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` Imports *[]string `json:"imports,omitempty"` ProvisioningState *CustomizedAcceleratorProvisioningState `json:"provisioningState,omitempty"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_devtoolportalssoproperties.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_devtoolportalssoproperties.go index 71dc00f4062..5e96437497c 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_devtoolportalssoproperties.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_devtoolportalssoproperties.go @@ -6,6 +6,6 @@ package appplatform type DevToolPortalSsoProperties struct { ClientId *string `json:"clientId,omitempty"` ClientSecret *string `json:"clientSecret,omitempty"` - MetadataUrl *string `json:"metadataUrl,omitempty"` + MetadataURL *string `json:"metadataUrl,omitempty"` Scopes *[]string `json:"scopes,omitempty"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_gatewayapimetadataproperties.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_gatewayapimetadataproperties.go index 860b99631e7..dff39d628ee 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_gatewayapimetadataproperties.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_gatewayapimetadataproperties.go @@ -6,7 +6,7 @@ package appplatform type GatewayApiMetadataProperties struct { Description *string `json:"description,omitempty"` Documentation *string `json:"documentation,omitempty"` - ServerUrl *string `json:"serverUrl,omitempty"` + ServerURL *string `json:"serverUrl,omitempty"` Title *string `json:"title,omitempty"` Version *string `json:"version,omitempty"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_logfileurlresponse.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_logfileurlresponse.go index 444d30751f6..6a970d33610 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_logfileurlresponse.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_logfileurlresponse.go @@ -3,6 +3,6 @@ package appplatform // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type LogFileUrlResponse struct { +type LogFileURLResponse struct { Url string `json:"url"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_predefinedacceleratorproperties.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_predefinedacceleratorproperties.go index 2449929660c..6891240fe47 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_predefinedacceleratorproperties.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_predefinedacceleratorproperties.go @@ -7,7 +7,7 @@ type PredefinedAcceleratorProperties struct { AcceleratorTags *[]string `json:"acceleratorTags,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` ProvisioningState *PredefinedAcceleratorProvisioningState `json:"provisioningState,omitempty"` State *PredefinedAcceleratorState `json:"state,omitempty"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_resourceuploaddefinition.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_resourceuploaddefinition.go index 6c04602e5d4..a7e1eabb035 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_resourceuploaddefinition.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_resourceuploaddefinition.go @@ -5,5 +5,5 @@ package appplatform type ResourceUploadDefinition struct { RelativePath *string `json:"relativePath,omitempty"` - UploadUrl *string `json:"uploadUrl,omitempty"` + UploadURL *string `json:"uploadUrl,omitempty"` } diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_uploadedusersourceinfo.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_uploadedusersourceinfo.go new file mode 100644 index 00000000000..c06453d2084 --- /dev/null +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_uploadedusersourceinfo.go @@ -0,0 +1,52 @@ +package appplatform + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ UserSourceInfo = UploadedUserSourceInfo{} + +type UploadedUserSourceInfo struct { + RelativePath *string `json:"relativePath,omitempty"` + + // Fields inherited from UserSourceInfo + + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s UploadedUserSourceInfo) UserSourceInfo() BaseUserSourceInfoImpl { + return BaseUserSourceInfoImpl{ + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = UploadedUserSourceInfo{} + +func (s UploadedUserSourceInfo) MarshalJSON() ([]byte, error) { + type wrapper UploadedUserSourceInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling UploadedUserSourceInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling UploadedUserSourceInfo: %+v", err) + } + + decoded["type"] = "UploadedUserSourceInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling UploadedUserSourceInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_usersourceinfo.go b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_usersourceinfo.go index bef5f481416..59e546a1b81 100644 --- a/resource-manager/appplatform/2024-01-01-preview/appplatform/model_usersourceinfo.go +++ b/resource-manager/appplatform/2024-01-01-preview/appplatform/model_usersourceinfo.go @@ -94,6 +94,14 @@ func UnmarshalUserSourceInfoImplementation(input []byte) (UserSourceInfo, error) return out, nil } + if strings.EqualFold(value, "UploadedUserSourceInfo") { + var out UploadedUserSourceInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into UploadedUserSourceInfo: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "War") { var out WarUploadedUserSourceInfo if err := json.Unmarshal(input, &out); err != nil { diff --git a/resource-manager/attestation/2020-10-01/attestationproviders/README.md b/resource-manager/attestation/2020-10-01/attestationproviders/README.md index 27bdb6f2273..bd761cf4893 100644 --- a/resource-manager/attestation/2020-10-01/attestationproviders/README.md +++ b/resource-manager/attestation/2020-10-01/attestationproviders/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") payload := attestationproviders.AttestationServiceCreationParams{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := attestationproviders.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := attestationproviders.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.GetDefaultByLocation(ctx, id) if err != nil { @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") payload := attestationproviders.AttestationServicePatchParams{ // ... diff --git a/resource-manager/attestation/2020-10-01/attestationproviders/id_attestationproviders.go b/resource-manager/attestation/2020-10-01/attestationproviders/id_attestationproviders.go index 603966f841c..7ca1f1bf4a5 100644 --- a/resource-manager/attestation/2020-10-01/attestationproviders/id_attestationproviders.go +++ b/resource-manager/attestation/2020-10-01/attestationproviders/id_attestationproviders.go @@ -115,7 +115,7 @@ func (id AttestationProvidersId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticAttestationProviders", "attestationProviders", "attestationProviders"), - resourceids.UserSpecifiedSegment("attestationProviderName", "providerName"), + resourceids.UserSpecifiedSegment("attestationProviderName", "attestationProviderName"), } } diff --git a/resource-manager/attestation/2020-10-01/attestationproviders/id_attestationproviders_test.go b/resource-manager/attestation/2020-10-01/attestationproviders/id_attestationproviders_test.go index a48cf166b9b..7272ca0bc18 100644 --- a/resource-manager/attestation/2020-10-01/attestationproviders/id_attestationproviders_test.go +++ b/resource-manager/attestation/2020-10-01/attestationproviders/id_attestationproviders_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AttestationProvidersId{} func TestNewAttestationProvidersID(t *testing.T) { - id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") + id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAttestationProvidersID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AttestationProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "providerName") + if id.AttestationProviderName != "attestationProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "attestationProviderName") } } func TestFormatAttestationProvidersID(t *testing.T) { - actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName" + actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAttestationProvidersID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAttestationProvidersIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AttestationProviderName: "pRoViDeRnAmE", + AttestationProviderName: "aTtEsTaTiOnPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/attestation/2020-10-01/attestationproviders/id_location.go b/resource-manager/attestation/2020-10-01/attestationproviders/id_location.go index fea36271650..219c377fec8 100644 --- a/resource-manager/attestation/2020-10-01/attestationproviders/id_location.go +++ b/resource-manager/attestation/2020-10-01/attestationproviders/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/attestation/2020-10-01/attestationproviders/id_location_test.go b/resource-manager/attestation/2020-10-01/attestationproviders/id_location_test.go index 6ff0a7c5379..621ccbbbb70 100644 --- a/resource-manager/attestation/2020-10-01/attestationproviders/id_location_test.go +++ b/resource-manager/attestation/2020-10-01/attestationproviders/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/attestation/2020-10-01/attestationproviders/model_jsonwebkey.go b/resource-manager/attestation/2020-10-01/attestationproviders/model_jsonwebkey.go index 3bb8473e4d0..0100eba22b9 100644 --- a/resource-manager/attestation/2020-10-01/attestationproviders/model_jsonwebkey.go +++ b/resource-manager/attestation/2020-10-01/attestationproviders/model_jsonwebkey.go @@ -3,7 +3,7 @@ package attestationproviders // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type JsonWebKey struct { +type JSONWebKey struct { Alg *string `json:"alg,omitempty"` Crv *string `json:"crv,omitempty"` D *string `json:"d,omitempty"` diff --git a/resource-manager/attestation/2020-10-01/attestationproviders/model_jsonwebkeyset.go b/resource-manager/attestation/2020-10-01/attestationproviders/model_jsonwebkeyset.go index cf265e6df87..c78d39b6a55 100644 --- a/resource-manager/attestation/2020-10-01/attestationproviders/model_jsonwebkeyset.go +++ b/resource-manager/attestation/2020-10-01/attestationproviders/model_jsonwebkeyset.go @@ -4,5 +4,5 @@ package attestationproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type JsonWebKeySet struct { - Keys *[]JsonWebKey `json:"keys,omitempty"` + Keys *[]JSONWebKey `json:"keys,omitempty"` } diff --git a/resource-manager/attestation/2020-10-01/privateendpointconnections/README.md b/resource-manager/attestation/2020-10-01/privateendpointconnections/README.md index dff2d9d7d78..50541c2fb21 100644 --- a/resource-manager/attestation/2020-10-01/privateendpointconnections/README.md +++ b/resource-manager/attestation/2020-10-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := privateendpointconnections.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/attestation/2020-10-01/privateendpointconnections/id_attestationproviders.go b/resource-manager/attestation/2020-10-01/privateendpointconnections/id_attestationproviders.go index 15052752d17..14e14c7ef7c 100644 --- a/resource-manager/attestation/2020-10-01/privateendpointconnections/id_attestationproviders.go +++ b/resource-manager/attestation/2020-10-01/privateendpointconnections/id_attestationproviders.go @@ -115,7 +115,7 @@ func (id AttestationProvidersId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticAttestationProviders", "attestationProviders", "attestationProviders"), - resourceids.UserSpecifiedSegment("attestationProviderName", "providerName"), + resourceids.UserSpecifiedSegment("attestationProviderName", "attestationProviderName"), } } diff --git a/resource-manager/attestation/2020-10-01/privateendpointconnections/id_attestationproviders_test.go b/resource-manager/attestation/2020-10-01/privateendpointconnections/id_attestationproviders_test.go index cb62a12b997..8e36d0aae22 100644 --- a/resource-manager/attestation/2020-10-01/privateendpointconnections/id_attestationproviders_test.go +++ b/resource-manager/attestation/2020-10-01/privateendpointconnections/id_attestationproviders_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AttestationProvidersId{} func TestNewAttestationProvidersID(t *testing.T) { - id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") + id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAttestationProvidersID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AttestationProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "providerName") + if id.AttestationProviderName != "attestationProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "attestationProviderName") } } func TestFormatAttestationProvidersID(t *testing.T) { - actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName" + actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAttestationProvidersID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAttestationProvidersIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AttestationProviderName: "pRoViDeRnAmE", + AttestationProviderName: "aTtEsTaTiOnPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/attestation/2020-10-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/attestation/2020-10-01/privateendpointconnections/id_privateendpointconnection.go index 8acb76fd04d..ecd726d9251 100644 --- a/resource-manager/attestation/2020-10-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/attestation/2020-10-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticAttestationProviders", "attestationProviders", "attestationProviders"), - resourceids.UserSpecifiedSegment("attestationProviderName", "providerName"), + resourceids.UserSpecifiedSegment("attestationProviderName", "attestationProviderName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/attestation/2020-10-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/attestation/2020-10-01/privateendpointconnections/id_privateendpointconnection_test.go index 42c860b2134..ceea0e4bccd 100644 --- a/resource-manager/attestation/2020-10-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/attestation/2020-10-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AttestationProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "providerName") + if id.AttestationProviderName != "attestationProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "attestationProviderName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AttestationProviderName: "pRoViDeRnAmE", + AttestationProviderName: "aTtEsTaTiOnPrOvIdErNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/attestation/2021-06-01/attestationproviders/README.md b/resource-manager/attestation/2021-06-01/attestationproviders/README.md index 2d07d0ff018..ecdad44ad45 100644 --- a/resource-manager/attestation/2021-06-01/attestationproviders/README.md +++ b/resource-manager/attestation/2021-06-01/attestationproviders/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") payload := attestationproviders.AttestationServiceCreationParams{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := attestationproviders.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := attestationproviders.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.GetDefaultByLocation(ctx, id) if err != nil { @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := attestationproviders.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") payload := attestationproviders.AttestationServicePatchParams{ // ... diff --git a/resource-manager/attestation/2021-06-01/attestationproviders/id_attestationproviders.go b/resource-manager/attestation/2021-06-01/attestationproviders/id_attestationproviders.go index 603966f841c..7ca1f1bf4a5 100644 --- a/resource-manager/attestation/2021-06-01/attestationproviders/id_attestationproviders.go +++ b/resource-manager/attestation/2021-06-01/attestationproviders/id_attestationproviders.go @@ -115,7 +115,7 @@ func (id AttestationProvidersId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticAttestationProviders", "attestationProviders", "attestationProviders"), - resourceids.UserSpecifiedSegment("attestationProviderName", "providerName"), + resourceids.UserSpecifiedSegment("attestationProviderName", "attestationProviderName"), } } diff --git a/resource-manager/attestation/2021-06-01/attestationproviders/id_attestationproviders_test.go b/resource-manager/attestation/2021-06-01/attestationproviders/id_attestationproviders_test.go index a48cf166b9b..7272ca0bc18 100644 --- a/resource-manager/attestation/2021-06-01/attestationproviders/id_attestationproviders_test.go +++ b/resource-manager/attestation/2021-06-01/attestationproviders/id_attestationproviders_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AttestationProvidersId{} func TestNewAttestationProvidersID(t *testing.T) { - id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") + id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAttestationProvidersID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AttestationProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "providerName") + if id.AttestationProviderName != "attestationProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "attestationProviderName") } } func TestFormatAttestationProvidersID(t *testing.T) { - actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName" + actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAttestationProvidersID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAttestationProvidersIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AttestationProviderName: "pRoViDeRnAmE", + AttestationProviderName: "aTtEsTaTiOnPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/attestation/2021-06-01/attestationproviders/id_location.go b/resource-manager/attestation/2021-06-01/attestationproviders/id_location.go index fea36271650..219c377fec8 100644 --- a/resource-manager/attestation/2021-06-01/attestationproviders/id_location.go +++ b/resource-manager/attestation/2021-06-01/attestationproviders/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/attestation/2021-06-01/attestationproviders/id_location_test.go b/resource-manager/attestation/2021-06-01/attestationproviders/id_location_test.go index 6ff0a7c5379..621ccbbbb70 100644 --- a/resource-manager/attestation/2021-06-01/attestationproviders/id_location_test.go +++ b/resource-manager/attestation/2021-06-01/attestationproviders/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Attestation/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/attestation/2021-06-01/attestationproviders/model_jsonwebkey.go b/resource-manager/attestation/2021-06-01/attestationproviders/model_jsonwebkey.go index 3bb8473e4d0..0100eba22b9 100644 --- a/resource-manager/attestation/2021-06-01/attestationproviders/model_jsonwebkey.go +++ b/resource-manager/attestation/2021-06-01/attestationproviders/model_jsonwebkey.go @@ -3,7 +3,7 @@ package attestationproviders // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type JsonWebKey struct { +type JSONWebKey struct { Alg *string `json:"alg,omitempty"` Crv *string `json:"crv,omitempty"` D *string `json:"d,omitempty"` diff --git a/resource-manager/attestation/2021-06-01/attestationproviders/model_jsonwebkeyset.go b/resource-manager/attestation/2021-06-01/attestationproviders/model_jsonwebkeyset.go index cf265e6df87..c78d39b6a55 100644 --- a/resource-manager/attestation/2021-06-01/attestationproviders/model_jsonwebkeyset.go +++ b/resource-manager/attestation/2021-06-01/attestationproviders/model_jsonwebkeyset.go @@ -4,5 +4,5 @@ package attestationproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type JsonWebKeySet struct { - Keys *[]JsonWebKey `json:"keys,omitempty"` + Keys *[]JSONWebKey `json:"keys,omitempty"` } diff --git a/resource-manager/attestation/2021-06-01/privateendpointconnections/README.md b/resource-manager/attestation/2021-06-01/privateendpointconnections/README.md index c7c12c9e072..0638fec4720 100644 --- a/resource-manager/attestation/2021-06-01/privateendpointconnections/README.md +++ b/resource-manager/attestation/2021-06-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := privateendpointconnections.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/attestation/2021-06-01/privateendpointconnections/id_attestationproviders.go b/resource-manager/attestation/2021-06-01/privateendpointconnections/id_attestationproviders.go index 15052752d17..14e14c7ef7c 100644 --- a/resource-manager/attestation/2021-06-01/privateendpointconnections/id_attestationproviders.go +++ b/resource-manager/attestation/2021-06-01/privateendpointconnections/id_attestationproviders.go @@ -115,7 +115,7 @@ func (id AttestationProvidersId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticAttestationProviders", "attestationProviders", "attestationProviders"), - resourceids.UserSpecifiedSegment("attestationProviderName", "providerName"), + resourceids.UserSpecifiedSegment("attestationProviderName", "attestationProviderName"), } } diff --git a/resource-manager/attestation/2021-06-01/privateendpointconnections/id_attestationproviders_test.go b/resource-manager/attestation/2021-06-01/privateendpointconnections/id_attestationproviders_test.go index cb62a12b997..8e36d0aae22 100644 --- a/resource-manager/attestation/2021-06-01/privateendpointconnections/id_attestationproviders_test.go +++ b/resource-manager/attestation/2021-06-01/privateendpointconnections/id_attestationproviders_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AttestationProvidersId{} func TestNewAttestationProvidersID(t *testing.T) { - id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") + id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAttestationProvidersID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AttestationProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "providerName") + if id.AttestationProviderName != "attestationProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "attestationProviderName") } } func TestFormatAttestationProvidersID(t *testing.T) { - actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName" + actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAttestationProvidersID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAttestationProvidersIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AttestationProviderName: "pRoViDeRnAmE", + AttestationProviderName: "aTtEsTaTiOnPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/attestation/2021-06-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/attestation/2021-06-01/privateendpointconnections/id_privateendpointconnection.go index 8acb76fd04d..ecd726d9251 100644 --- a/resource-manager/attestation/2021-06-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/attestation/2021-06-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticAttestationProviders", "attestationProviders", "attestationProviders"), - resourceids.UserSpecifiedSegment("attestationProviderName", "providerName"), + resourceids.UserSpecifiedSegment("attestationProviderName", "attestationProviderName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/attestation/2021-06-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/attestation/2021-06-01/privateendpointconnections/id_privateendpointconnection_test.go index 42c860b2134..ceea0e4bccd 100644 --- a/resource-manager/attestation/2021-06-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/attestation/2021-06-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AttestationProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "providerName") + if id.AttestationProviderName != "attestationProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "attestationProviderName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AttestationProviderName: "pRoViDeRnAmE", + AttestationProviderName: "aTtEsTaTiOnPrOvIdErNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/attestation/2021-06-01/privatelinkresources/README.md b/resource-manager/attestation/2021-06-01/privatelinkresources/README.md index d2411133dd6..d1ce21dbe1a 100644 --- a/resource-manager/attestation/2021-06-01/privatelinkresources/README.md +++ b/resource-manager/attestation/2021-06-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") +id := privatelinkresources.NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") read, err := client.ListByProvider(ctx, id) if err != nil { diff --git a/resource-manager/attestation/2021-06-01/privatelinkresources/id_attestationproviders.go b/resource-manager/attestation/2021-06-01/privatelinkresources/id_attestationproviders.go index 6ab82acce3c..d0994fe4ede 100644 --- a/resource-manager/attestation/2021-06-01/privatelinkresources/id_attestationproviders.go +++ b/resource-manager/attestation/2021-06-01/privatelinkresources/id_attestationproviders.go @@ -115,7 +115,7 @@ func (id AttestationProvidersId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAttestation", "Microsoft.Attestation", "Microsoft.Attestation"), resourceids.StaticSegment("staticAttestationProviders", "attestationProviders", "attestationProviders"), - resourceids.UserSpecifiedSegment("attestationProviderName", "providerName"), + resourceids.UserSpecifiedSegment("attestationProviderName", "attestationProviderName"), } } diff --git a/resource-manager/attestation/2021-06-01/privatelinkresources/id_attestationproviders_test.go b/resource-manager/attestation/2021-06-01/privatelinkresources/id_attestationproviders_test.go index 11d27711084..625bca5bd6d 100644 --- a/resource-manager/attestation/2021-06-01/privatelinkresources/id_attestationproviders_test.go +++ b/resource-manager/attestation/2021-06-01/privatelinkresources/id_attestationproviders_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AttestationProvidersId{} func TestNewAttestationProvidersID(t *testing.T) { - id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName") + id := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAttestationProvidersID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AttestationProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "providerName") + if id.AttestationProviderName != "attestationProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AttestationProviderName'", id.AttestationProviderName, "attestationProviderName") } } func TestFormatAttestationProvidersID(t *testing.T) { - actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "providerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName" + actual := NewAttestationProvidersID("12345678-1234-9876-4563-123456789012", "example-resource-group", "attestationProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAttestationProvidersID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAttestationProvidersIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AttestationProviderName: "providerName", + AttestationProviderName: "attestationProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Attestation/attestationProviders/attestationProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe", Expected: &AttestationProvidersId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AttestationProviderName: "pRoViDeRnAmE", + AttestationProviderName: "aTtEsTaTiOnPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/pRoViDeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aTtEsTaTiOn/aTtEsTaTiOnPrOvIdErS/aTtEsTaTiOnPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/README.md b/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/README.md index fa5896a2077..84ef86f4e53 100644 --- a/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/README.md +++ b/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := provideroperationsmetadata.NewProviderOperationID("resourceProviderNamespace") +id := provideroperationsmetadata.NewProviderOperationID("providerOperationName") read, err := client.Get(ctx, id, provideroperationsmetadata.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/id_provideroperation.go b/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/id_provideroperation.go index c718b6ce188..e9dfaa4bd3d 100644 --- a/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/id_provideroperation.go +++ b/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/id_provideroperation.go @@ -99,7 +99,7 @@ func (id ProviderOperationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAuthorization", "Microsoft.Authorization", "Microsoft.Authorization"), resourceids.StaticSegment("staticProviderOperations", "providerOperations", "providerOperations"), - resourceids.UserSpecifiedSegment("providerOperationName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerOperationName", "providerOperationName"), } } diff --git a/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/id_provideroperation_test.go b/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/id_provideroperation_test.go index 13a6421a8f7..f57c36c7929 100644 --- a/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/id_provideroperation_test.go +++ b/resource-manager/authorization/2018-01-01-preview/provideroperationsmetadata/id_provideroperation_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ProviderOperationId{} func TestNewProviderOperationID(t *testing.T) { - id := NewProviderOperationID("resourceProviderNamespace") + id := NewProviderOperationID("providerOperationName") - if id.ProviderOperationName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderOperationName'", id.ProviderOperationName, "resourceProviderNamespace") + if id.ProviderOperationName != "providerOperationName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderOperationName'", id.ProviderOperationName, "providerOperationName") } } func TestFormatProviderOperationID(t *testing.T) { - actual := NewProviderOperationID("resourceProviderNamespace").ID() - expected := "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace" + actual := NewProviderOperationID("providerOperationName").ID() + expected := "/providers/Microsoft.Authorization/providerOperations/providerOperationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseProviderOperationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace", + Input: "/providers/Microsoft.Authorization/providerOperations/providerOperationName", Expected: &ProviderOperationId{ - ProviderOperationName: "resourceProviderNamespace", + ProviderOperationName: "providerOperationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Authorization/providerOperations/providerOperationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseProviderOperationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace", + Input: "/providers/Microsoft.Authorization/providerOperations/providerOperationName", Expected: &ProviderOperationId{ - ProviderOperationName: "resourceProviderNamespace", + ProviderOperationName: "providerOperationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Authorization/providerOperations/providerOperationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/pRoViDeRoPeRaTiOnS/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/pRoViDeRoPeRaTiOnS/pRoViDeRoPeRaTiOnNaMe", Expected: &ProviderOperationId{ - ProviderOperationName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderOperationName: "pRoViDeRoPeRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/pRoViDeRoPeRaTiOnS/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/pRoViDeRoPeRaTiOnS/pRoViDeRoPeRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/constants.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/constants.go index 34d30a7f049..38ddc9c034b 100644 --- a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/constants.go +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/constants.go @@ -9,6 +9,223 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type ApprovalMode string + +const ( + ApprovalModeNoApproval ApprovalMode = "NoApproval" + ApprovalModeParallel ApprovalMode = "Parallel" + ApprovalModeSerial ApprovalMode = "Serial" + ApprovalModeSingleStage ApprovalMode = "SingleStage" +) + +func PossibleValuesForApprovalMode() []string { + return []string{ + string(ApprovalModeNoApproval), + string(ApprovalModeParallel), + string(ApprovalModeSerial), + string(ApprovalModeSingleStage), + } +} + +func (s *ApprovalMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApprovalMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApprovalMode(input string) (*ApprovalMode, error) { + vals := map[string]ApprovalMode{ + "noapproval": ApprovalModeNoApproval, + "parallel": ApprovalModeParallel, + "serial": ApprovalModeSerial, + "singlestage": ApprovalModeSingleStage, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApprovalMode(input) + return &out, nil +} + +type EnablementRules string + +const ( + EnablementRulesJustification EnablementRules = "Justification" + EnablementRulesMultiFactorAuthentication EnablementRules = "MultiFactorAuthentication" + EnablementRulesTicketing EnablementRules = "Ticketing" +) + +func PossibleValuesForEnablementRules() []string { + return []string{ + string(EnablementRulesJustification), + string(EnablementRulesMultiFactorAuthentication), + string(EnablementRulesTicketing), + } +} + +func (s *EnablementRules) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEnablementRules(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEnablementRules(input string) (*EnablementRules, error) { + vals := map[string]EnablementRules{ + "justification": EnablementRulesJustification, + "multifactorauthentication": EnablementRulesMultiFactorAuthentication, + "ticketing": EnablementRulesTicketing, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnablementRules(input) + return &out, nil +} + +type NotificationDeliveryMechanism string + +const ( + NotificationDeliveryMechanismEmail NotificationDeliveryMechanism = "Email" +) + +func PossibleValuesForNotificationDeliveryMechanism() []string { + return []string{ + string(NotificationDeliveryMechanismEmail), + } +} + +func (s *NotificationDeliveryMechanism) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNotificationDeliveryMechanism(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNotificationDeliveryMechanism(input string) (*NotificationDeliveryMechanism, error) { + vals := map[string]NotificationDeliveryMechanism{ + "email": NotificationDeliveryMechanismEmail, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NotificationDeliveryMechanism(input) + return &out, nil +} + +type NotificationLevel string + +const ( + NotificationLevelAll NotificationLevel = "All" + NotificationLevelCritical NotificationLevel = "Critical" + NotificationLevelNone NotificationLevel = "None" +) + +func PossibleValuesForNotificationLevel() []string { + return []string{ + string(NotificationLevelAll), + string(NotificationLevelCritical), + string(NotificationLevelNone), + } +} + +func (s *NotificationLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNotificationLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNotificationLevel(input string) (*NotificationLevel, error) { + vals := map[string]NotificationLevel{ + "all": NotificationLevelAll, + "critical": NotificationLevelCritical, + "none": NotificationLevelNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NotificationLevel(input) + return &out, nil +} + +type RecipientType string + +const ( + RecipientTypeAdmin RecipientType = "Admin" + RecipientTypeApprover RecipientType = "Approver" + RecipientTypeRequestor RecipientType = "Requestor" +) + +func PossibleValuesForRecipientType() []string { + return []string{ + string(RecipientTypeAdmin), + string(RecipientTypeApprover), + string(RecipientTypeRequestor), + } +} + +func (s *RecipientType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRecipientType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRecipientType(input string) (*RecipientType, error) { + vals := map[string]RecipientType{ + "admin": RecipientTypeAdmin, + "approver": RecipientTypeApprover, + "requestor": RecipientTypeRequestor, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RecipientType(input) + return &out, nil +} + type RoleManagementPolicyRuleType string const ( @@ -58,3 +275,44 @@ func parseRoleManagementPolicyRuleType(input string) (*RoleManagementPolicyRuleT out := RoleManagementPolicyRuleType(input) return &out, nil } + +type UserType string + +const ( + UserTypeGroup UserType = "Group" + UserTypeUser UserType = "User" +) + +func PossibleValuesForUserType() []string { + return []string{ + string(UserTypeGroup), + string(UserTypeUser), + } +} + +func (s *UserType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUserType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUserType(input string) (*UserType, error) { + vals := map[string]UserType{ + "group": UserTypeGroup, + "user": UserTypeUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UserType(input) + return &out, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_approvalsettings.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_approvalsettings.go new file mode 100644 index 00000000000..3cc092b5d58 --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_approvalsettings.go @@ -0,0 +1,12 @@ +package rolemanagementpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApprovalSettings struct { + ApprovalMode *ApprovalMode `json:"approvalMode,omitempty"` + ApprovalStages *[]ApprovalStage `json:"approvalStages,omitempty"` + IsApprovalRequired *bool `json:"isApprovalRequired,omitempty"` + IsApprovalRequiredForExtension *bool `json:"isApprovalRequiredForExtension,omitempty"` + IsRequestorJustificationRequired *bool `json:"isRequestorJustificationRequired,omitempty"` +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_approvalstage.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_approvalstage.go new file mode 100644 index 00000000000..160b556692d --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_approvalstage.go @@ -0,0 +1,13 @@ +package rolemanagementpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApprovalStage struct { + ApprovalStageTimeOutInDays *int64 `json:"approvalStageTimeOutInDays,omitempty"` + EscalationApprovers *[]UserSet `json:"escalationApprovers,omitempty"` + EscalationTimeInMinutes *int64 `json:"escalationTimeInMinutes,omitempty"` + IsApproverJustificationRequired *bool `json:"isApproverJustificationRequired,omitempty"` + IsEscalationEnabled *bool `json:"isEscalationEnabled,omitempty"` + PrimaryApprovers *[]UserSet `json:"primaryApprovers,omitempty"` +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyapprovalrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyapprovalrule.go new file mode 100644 index 00000000000..37ad1b3a7b2 --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyapprovalrule.go @@ -0,0 +1,54 @@ +package rolemanagementpolicies + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyApprovalRule{} + +type RoleManagementPolicyApprovalRule struct { + Setting *ApprovalSettings `json:"setting,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyApprovalRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyApprovalRule{} + +func (s RoleManagementPolicyApprovalRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyApprovalRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyApprovalRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyApprovalRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyApprovalRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyApprovalRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyauthenticationcontextrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyauthenticationcontextrule.go new file mode 100644 index 00000000000..781be97744d --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyauthenticationcontextrule.go @@ -0,0 +1,55 @@ +package rolemanagementpolicies + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyAuthenticationContextRule{} + +type RoleManagementPolicyAuthenticationContextRule struct { + ClaimValue *string `json:"claimValue,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyAuthenticationContextRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyAuthenticationContextRule{} + +func (s RoleManagementPolicyAuthenticationContextRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyAuthenticationContextRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyAuthenticationContextRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyAuthenticationContextRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyAuthenticationContextRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyAuthenticationContextRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyenablementrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyenablementrule.go new file mode 100644 index 00000000000..98489ed3d15 --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyenablementrule.go @@ -0,0 +1,54 @@ +package rolemanagementpolicies + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyEnablementRule{} + +type RoleManagementPolicyEnablementRule struct { + EnabledRules *[]EnablementRules `json:"enabledRules,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyEnablementRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyEnablementRule{} + +func (s RoleManagementPolicyEnablementRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyEnablementRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyEnablementRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyEnablementRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyEnablementRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyEnablementRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyexpirationrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyexpirationrule.go new file mode 100644 index 00000000000..2b951b5c30e --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyexpirationrule.go @@ -0,0 +1,55 @@ +package rolemanagementpolicies + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyExpirationRule{} + +type RoleManagementPolicyExpirationRule struct { + IsExpirationRequired *bool `json:"isExpirationRequired,omitempty"` + MaximumDuration *string `json:"maximumDuration,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyExpirationRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyExpirationRule{} + +func (s RoleManagementPolicyExpirationRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyExpirationRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyExpirationRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyExpirationRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyExpirationRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyExpirationRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicynotificationrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicynotificationrule.go new file mode 100644 index 00000000000..eee66eb0efe --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicynotificationrule.go @@ -0,0 +1,58 @@ +package rolemanagementpolicies + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyNotificationRule{} + +type RoleManagementPolicyNotificationRule struct { + IsDefaultRecipientsEnabled *bool `json:"isDefaultRecipientsEnabled,omitempty"` + NotificationLevel *NotificationLevel `json:"notificationLevel,omitempty"` + NotificationRecipients *[]string `json:"notificationRecipients,omitempty"` + NotificationType *NotificationDeliveryMechanism `json:"notificationType,omitempty"` + RecipientType *RecipientType `json:"recipientType,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyNotificationRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyNotificationRule{} + +func (s RoleManagementPolicyNotificationRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyNotificationRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyNotificationRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyNotificationRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyNotificationRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyNotificationRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyrule.go index 573273dc89b..8552a5d5257 100644 --- a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyrule.go +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_rolemanagementpolicyrule.go @@ -3,6 +3,7 @@ package rolemanagementpolicies import ( "encoding/json" "fmt" + "strings" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -54,6 +55,46 @@ func UnmarshalRoleManagementPolicyRuleImplementation(input []byte) (RoleManageme value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "RoleManagementPolicyApprovalRule") { + var out RoleManagementPolicyApprovalRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyApprovalRule: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RoleManagementPolicyAuthenticationContextRule") { + var out RoleManagementPolicyAuthenticationContextRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyAuthenticationContextRule: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RoleManagementPolicyEnablementRule") { + var out RoleManagementPolicyEnablementRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyEnablementRule: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RoleManagementPolicyExpirationRule") { + var out RoleManagementPolicyExpirationRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyExpirationRule: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RoleManagementPolicyNotificationRule") { + var out RoleManagementPolicyNotificationRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyNotificationRule: %+v", err) + } + return out, nil + } + var parent BaseRoleManagementPolicyRuleImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseRoleManagementPolicyRuleImpl: %+v", err) diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_userset.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_userset.go new file mode 100644 index 00000000000..d79a5be7e9f --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicies/model_userset.go @@ -0,0 +1,11 @@ +package rolemanagementpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserSet struct { + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + IsBackup *bool `json:"isBackup,omitempty"` + UserType *UserType `json:"userType,omitempty"` +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/constants.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/constants.go index 429be1bb0c4..84afa6b435e 100644 --- a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/constants.go +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/constants.go @@ -9,6 +9,223 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type ApprovalMode string + +const ( + ApprovalModeNoApproval ApprovalMode = "NoApproval" + ApprovalModeParallel ApprovalMode = "Parallel" + ApprovalModeSerial ApprovalMode = "Serial" + ApprovalModeSingleStage ApprovalMode = "SingleStage" +) + +func PossibleValuesForApprovalMode() []string { + return []string{ + string(ApprovalModeNoApproval), + string(ApprovalModeParallel), + string(ApprovalModeSerial), + string(ApprovalModeSingleStage), + } +} + +func (s *ApprovalMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApprovalMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApprovalMode(input string) (*ApprovalMode, error) { + vals := map[string]ApprovalMode{ + "noapproval": ApprovalModeNoApproval, + "parallel": ApprovalModeParallel, + "serial": ApprovalModeSerial, + "singlestage": ApprovalModeSingleStage, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApprovalMode(input) + return &out, nil +} + +type EnablementRules string + +const ( + EnablementRulesJustification EnablementRules = "Justification" + EnablementRulesMultiFactorAuthentication EnablementRules = "MultiFactorAuthentication" + EnablementRulesTicketing EnablementRules = "Ticketing" +) + +func PossibleValuesForEnablementRules() []string { + return []string{ + string(EnablementRulesJustification), + string(EnablementRulesMultiFactorAuthentication), + string(EnablementRulesTicketing), + } +} + +func (s *EnablementRules) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEnablementRules(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEnablementRules(input string) (*EnablementRules, error) { + vals := map[string]EnablementRules{ + "justification": EnablementRulesJustification, + "multifactorauthentication": EnablementRulesMultiFactorAuthentication, + "ticketing": EnablementRulesTicketing, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnablementRules(input) + return &out, nil +} + +type NotificationDeliveryMechanism string + +const ( + NotificationDeliveryMechanismEmail NotificationDeliveryMechanism = "Email" +) + +func PossibleValuesForNotificationDeliveryMechanism() []string { + return []string{ + string(NotificationDeliveryMechanismEmail), + } +} + +func (s *NotificationDeliveryMechanism) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNotificationDeliveryMechanism(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNotificationDeliveryMechanism(input string) (*NotificationDeliveryMechanism, error) { + vals := map[string]NotificationDeliveryMechanism{ + "email": NotificationDeliveryMechanismEmail, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NotificationDeliveryMechanism(input) + return &out, nil +} + +type NotificationLevel string + +const ( + NotificationLevelAll NotificationLevel = "All" + NotificationLevelCritical NotificationLevel = "Critical" + NotificationLevelNone NotificationLevel = "None" +) + +func PossibleValuesForNotificationLevel() []string { + return []string{ + string(NotificationLevelAll), + string(NotificationLevelCritical), + string(NotificationLevelNone), + } +} + +func (s *NotificationLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNotificationLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNotificationLevel(input string) (*NotificationLevel, error) { + vals := map[string]NotificationLevel{ + "all": NotificationLevelAll, + "critical": NotificationLevelCritical, + "none": NotificationLevelNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NotificationLevel(input) + return &out, nil +} + +type RecipientType string + +const ( + RecipientTypeAdmin RecipientType = "Admin" + RecipientTypeApprover RecipientType = "Approver" + RecipientTypeRequestor RecipientType = "Requestor" +) + +func PossibleValuesForRecipientType() []string { + return []string{ + string(RecipientTypeAdmin), + string(RecipientTypeApprover), + string(RecipientTypeRequestor), + } +} + +func (s *RecipientType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRecipientType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRecipientType(input string) (*RecipientType, error) { + vals := map[string]RecipientType{ + "admin": RecipientTypeAdmin, + "approver": RecipientTypeApprover, + "requestor": RecipientTypeRequestor, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RecipientType(input) + return &out, nil +} + type RoleManagementPolicyRuleType string const ( @@ -58,3 +275,44 @@ func parseRoleManagementPolicyRuleType(input string) (*RoleManagementPolicyRuleT out := RoleManagementPolicyRuleType(input) return &out, nil } + +type UserType string + +const ( + UserTypeGroup UserType = "Group" + UserTypeUser UserType = "User" +) + +func PossibleValuesForUserType() []string { + return []string{ + string(UserTypeGroup), + string(UserTypeUser), + } +} + +func (s *UserType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUserType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUserType(input string) (*UserType, error) { + vals := map[string]UserType{ + "group": UserTypeGroup, + "user": UserTypeUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UserType(input) + return &out, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_approvalsettings.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_approvalsettings.go new file mode 100644 index 00000000000..11c0980bb1a --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_approvalsettings.go @@ -0,0 +1,12 @@ +package rolemanagementpolicyassignments + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApprovalSettings struct { + ApprovalMode *ApprovalMode `json:"approvalMode,omitempty"` + ApprovalStages *[]ApprovalStage `json:"approvalStages,omitempty"` + IsApprovalRequired *bool `json:"isApprovalRequired,omitempty"` + IsApprovalRequiredForExtension *bool `json:"isApprovalRequiredForExtension,omitempty"` + IsRequestorJustificationRequired *bool `json:"isRequestorJustificationRequired,omitempty"` +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_approvalstage.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_approvalstage.go new file mode 100644 index 00000000000..639b133852c --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_approvalstage.go @@ -0,0 +1,13 @@ +package rolemanagementpolicyassignments + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApprovalStage struct { + ApprovalStageTimeOutInDays *int64 `json:"approvalStageTimeOutInDays,omitempty"` + EscalationApprovers *[]UserSet `json:"escalationApprovers,omitempty"` + EscalationTimeInMinutes *int64 `json:"escalationTimeInMinutes,omitempty"` + IsApproverJustificationRequired *bool `json:"isApproverJustificationRequired,omitempty"` + IsEscalationEnabled *bool `json:"isEscalationEnabled,omitempty"` + PrimaryApprovers *[]UserSet `json:"primaryApprovers,omitempty"` +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyapprovalrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyapprovalrule.go new file mode 100644 index 00000000000..e89690a50ff --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyapprovalrule.go @@ -0,0 +1,54 @@ +package rolemanagementpolicyassignments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyApprovalRule{} + +type RoleManagementPolicyApprovalRule struct { + Setting *ApprovalSettings `json:"setting,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyApprovalRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyApprovalRule{} + +func (s RoleManagementPolicyApprovalRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyApprovalRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyApprovalRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyApprovalRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyApprovalRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyApprovalRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyauthenticationcontextrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyauthenticationcontextrule.go new file mode 100644 index 00000000000..9d124c26e1c --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyauthenticationcontextrule.go @@ -0,0 +1,55 @@ +package rolemanagementpolicyassignments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyAuthenticationContextRule{} + +type RoleManagementPolicyAuthenticationContextRule struct { + ClaimValue *string `json:"claimValue,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyAuthenticationContextRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyAuthenticationContextRule{} + +func (s RoleManagementPolicyAuthenticationContextRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyAuthenticationContextRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyAuthenticationContextRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyAuthenticationContextRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyAuthenticationContextRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyAuthenticationContextRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyenablementrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyenablementrule.go new file mode 100644 index 00000000000..c041150f870 --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyenablementrule.go @@ -0,0 +1,54 @@ +package rolemanagementpolicyassignments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyEnablementRule{} + +type RoleManagementPolicyEnablementRule struct { + EnabledRules *[]EnablementRules `json:"enabledRules,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyEnablementRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyEnablementRule{} + +func (s RoleManagementPolicyEnablementRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyEnablementRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyEnablementRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyEnablementRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyEnablementRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyEnablementRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyexpirationrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyexpirationrule.go new file mode 100644 index 00000000000..a25e043887b --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyexpirationrule.go @@ -0,0 +1,55 @@ +package rolemanagementpolicyassignments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyExpirationRule{} + +type RoleManagementPolicyExpirationRule struct { + IsExpirationRequired *bool `json:"isExpirationRequired,omitempty"` + MaximumDuration *string `json:"maximumDuration,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyExpirationRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyExpirationRule{} + +func (s RoleManagementPolicyExpirationRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyExpirationRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyExpirationRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyExpirationRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyExpirationRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyExpirationRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicynotificationrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicynotificationrule.go new file mode 100644 index 00000000000..86b80186a93 --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicynotificationrule.go @@ -0,0 +1,58 @@ +package rolemanagementpolicyassignments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ RoleManagementPolicyRule = RoleManagementPolicyNotificationRule{} + +type RoleManagementPolicyNotificationRule struct { + IsDefaultRecipientsEnabled *bool `json:"isDefaultRecipientsEnabled,omitempty"` + NotificationLevel *NotificationLevel `json:"notificationLevel,omitempty"` + NotificationRecipients *[]string `json:"notificationRecipients,omitempty"` + NotificationType *NotificationDeliveryMechanism `json:"notificationType,omitempty"` + RecipientType *RecipientType `json:"recipientType,omitempty"` + + // Fields inherited from RoleManagementPolicyRule + + Id *string `json:"id,omitempty"` + RuleType RoleManagementPolicyRuleType `json:"ruleType"` + Target *RoleManagementPolicyRuleTarget `json:"target,omitempty"` +} + +func (s RoleManagementPolicyNotificationRule) RoleManagementPolicyRule() BaseRoleManagementPolicyRuleImpl { + return BaseRoleManagementPolicyRuleImpl{ + Id: s.Id, + RuleType: s.RuleType, + Target: s.Target, + } +} + +var _ json.Marshaler = RoleManagementPolicyNotificationRule{} + +func (s RoleManagementPolicyNotificationRule) MarshalJSON() ([]byte, error) { + type wrapper RoleManagementPolicyNotificationRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RoleManagementPolicyNotificationRule: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RoleManagementPolicyNotificationRule: %+v", err) + } + + decoded["ruleType"] = "RoleManagementPolicyNotificationRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RoleManagementPolicyNotificationRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyrule.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyrule.go index 69d5d4b120b..ad7d2178909 100644 --- a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyrule.go +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_rolemanagementpolicyrule.go @@ -3,6 +3,7 @@ package rolemanagementpolicyassignments import ( "encoding/json" "fmt" + "strings" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -54,6 +55,46 @@ func UnmarshalRoleManagementPolicyRuleImplementation(input []byte) (RoleManageme value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "RoleManagementPolicyApprovalRule") { + var out RoleManagementPolicyApprovalRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyApprovalRule: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RoleManagementPolicyAuthenticationContextRule") { + var out RoleManagementPolicyAuthenticationContextRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyAuthenticationContextRule: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RoleManagementPolicyEnablementRule") { + var out RoleManagementPolicyEnablementRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyEnablementRule: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RoleManagementPolicyExpirationRule") { + var out RoleManagementPolicyExpirationRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyExpirationRule: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RoleManagementPolicyNotificationRule") { + var out RoleManagementPolicyNotificationRule + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RoleManagementPolicyNotificationRule: %+v", err) + } + return out, nil + } + var parent BaseRoleManagementPolicyRuleImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseRoleManagementPolicyRuleImpl: %+v", err) diff --git a/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_userset.go b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_userset.go new file mode 100644 index 00000000000..8ff4459b32b --- /dev/null +++ b/resource-manager/authorization/2020-10-01/rolemanagementpolicyassignments/model_userset.go @@ -0,0 +1,11 @@ +package rolemanagementpolicyassignments + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserSet struct { + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + IsBackup *bool `json:"isBackup,omitempty"` + UserType *UserType `json:"userType,omitempty"` +} diff --git a/resource-manager/authorization/2022-04-01/provideroperationsmetadata/README.md b/resource-manager/authorization/2022-04-01/provideroperationsmetadata/README.md index b64f0cf2648..6f94778a7b1 100644 --- a/resource-manager/authorization/2022-04-01/provideroperationsmetadata/README.md +++ b/resource-manager/authorization/2022-04-01/provideroperationsmetadata/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := provideroperationsmetadata.NewProviderOperationID("resourceProviderNamespace") +id := provideroperationsmetadata.NewProviderOperationID("providerOperationName") read, err := client.Get(ctx, id, provideroperationsmetadata.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/authorization/2022-04-01/provideroperationsmetadata/id_provideroperation.go b/resource-manager/authorization/2022-04-01/provideroperationsmetadata/id_provideroperation.go index c718b6ce188..e9dfaa4bd3d 100644 --- a/resource-manager/authorization/2022-04-01/provideroperationsmetadata/id_provideroperation.go +++ b/resource-manager/authorization/2022-04-01/provideroperationsmetadata/id_provideroperation.go @@ -99,7 +99,7 @@ func (id ProviderOperationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAuthorization", "Microsoft.Authorization", "Microsoft.Authorization"), resourceids.StaticSegment("staticProviderOperations", "providerOperations", "providerOperations"), - resourceids.UserSpecifiedSegment("providerOperationName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerOperationName", "providerOperationName"), } } diff --git a/resource-manager/authorization/2022-04-01/provideroperationsmetadata/id_provideroperation_test.go b/resource-manager/authorization/2022-04-01/provideroperationsmetadata/id_provideroperation_test.go index 13a6421a8f7..f57c36c7929 100644 --- a/resource-manager/authorization/2022-04-01/provideroperationsmetadata/id_provideroperation_test.go +++ b/resource-manager/authorization/2022-04-01/provideroperationsmetadata/id_provideroperation_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ProviderOperationId{} func TestNewProviderOperationID(t *testing.T) { - id := NewProviderOperationID("resourceProviderNamespace") + id := NewProviderOperationID("providerOperationName") - if id.ProviderOperationName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderOperationName'", id.ProviderOperationName, "resourceProviderNamespace") + if id.ProviderOperationName != "providerOperationName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderOperationName'", id.ProviderOperationName, "providerOperationName") } } func TestFormatProviderOperationID(t *testing.T) { - actual := NewProviderOperationID("resourceProviderNamespace").ID() - expected := "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace" + actual := NewProviderOperationID("providerOperationName").ID() + expected := "/providers/Microsoft.Authorization/providerOperations/providerOperationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseProviderOperationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace", + Input: "/providers/Microsoft.Authorization/providerOperations/providerOperationName", Expected: &ProviderOperationId{ - ProviderOperationName: "resourceProviderNamespace", + ProviderOperationName: "providerOperationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Authorization/providerOperations/providerOperationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseProviderOperationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace", + Input: "/providers/Microsoft.Authorization/providerOperations/providerOperationName", Expected: &ProviderOperationId{ - ProviderOperationName: "resourceProviderNamespace", + ProviderOperationName: "providerOperationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Authorization/providerOperations/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Authorization/providerOperations/providerOperationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/pRoViDeRoPeRaTiOnS/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/pRoViDeRoPeRaTiOnS/pRoViDeRoPeRaTiOnNaMe", Expected: &ProviderOperationId{ - ProviderOperationName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderOperationName: "pRoViDeRoPeRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/pRoViDeRoPeRaTiOnS/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/pRoViDeRoPeRaTiOnS/pRoViDeRoPeRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/automation/2015-10-31/objectdatatypes/README.md b/resource-manager/automation/2015-10-31/objectdatatypes/README.md index 6538c8d3fd9..7ec3bb1a3ac 100644 --- a/resource-manager/automation/2015-10-31/objectdatatypes/README.md +++ b/resource-manager/automation/2015-10-31/objectdatatypes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") +id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") read, err := client.ListFieldsByModuleAndType(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") +id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") read, err := client.ListFieldsByType(ctx, id) if err != nil { diff --git a/resource-manager/automation/2015-10-31/objectdatatypes/id_moduleobjectdatatype.go b/resource-manager/automation/2015-10-31/objectdatatypes/id_moduleobjectdatatype.go index e02c0c14cae..33d09ddf304 100644 --- a/resource-manager/automation/2015-10-31/objectdatatypes/id_moduleobjectdatatype.go +++ b/resource-manager/automation/2015-10-31/objectdatatypes/id_moduleobjectdatatype.go @@ -131,7 +131,7 @@ func (id ModuleObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticModules", "modules", "modules"), resourceids.UserSpecifiedSegment("moduleName", "moduleName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2015-10-31/objectdatatypes/id_moduleobjectdatatype_test.go b/resource-manager/automation/2015-10-31/objectdatatypes/id_moduleobjectdatatype_test.go index 80c13043fd2..d8e7a0c8bfd 100644 --- a/resource-manager/automation/2015-10-31/objectdatatypes/id_moduleobjectdatatype_test.go +++ b/resource-manager/automation/2015-10-31/objectdatatypes/id_moduleobjectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModuleObjectDataTypeId{} func TestNewModuleObjectDataTypeID(t *testing.T) { - id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") + id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewModuleObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatModuleObjectDataTypeID(t *testing.T) { - actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName" + actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseModuleObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseModuleObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", ModuleName: "mOdUlEnAmE", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2015-10-31/objectdatatypes/id_objectdatatype.go b/resource-manager/automation/2015-10-31/objectdatatypes/id_objectdatatype.go index f8217a2592b..86e001d2c78 100644 --- a/resource-manager/automation/2015-10-31/objectdatatypes/id_objectdatatype.go +++ b/resource-manager/automation/2015-10-31/objectdatatypes/id_objectdatatype.go @@ -123,7 +123,7 @@ func (id ObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2015-10-31/objectdatatypes/id_objectdatatype_test.go b/resource-manager/automation/2015-10-31/objectdatatypes/id_objectdatatype_test.go index b6ffc014a1e..e16931fd648 100644 --- a/resource-manager/automation/2015-10-31/objectdatatypes/id_objectdatatype_test.go +++ b/resource-manager/automation/2015-10-31/objectdatatypes/id_objectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ObjectDataTypeId{} func TestNewObjectDataTypeID(t *testing.T) { - id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") + id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatObjectDataTypeID(t *testing.T) { - actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName" + actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2015-10-31/webhook/README.md b/resource-manager/automation/2015-10-31/webhook/README.md index 40f34d705b7..b148d41fcda 100644 --- a/resource-manager/automation/2015-10-31/webhook/README.md +++ b/resource-manager/automation/2015-10-31/webhook/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webhook.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webhookName") +id := webhook.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webHookName") payload := webhook.WebhookCreateOrUpdateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webhook.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webhookName") +id := webhook.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webHookName") read, err := client.Delete(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webhook.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webhookName") +id := webhook.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webHookName") read, err := client.Get(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webhook.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webhookName") +id := webhook.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webHookName") payload := webhook.WebhookUpdateParameters{ // ... diff --git a/resource-manager/automation/2015-10-31/webhook/id_webhook.go b/resource-manager/automation/2015-10-31/webhook/id_webhook.go index c8370faa10d..7268ad3c281 100644 --- a/resource-manager/automation/2015-10-31/webhook/id_webhook.go +++ b/resource-manager/automation/2015-10-31/webhook/id_webhook.go @@ -123,7 +123,7 @@ func (id WebHookId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), - resourceids.UserSpecifiedSegment("webHookName", "webhookName"), + resourceids.UserSpecifiedSegment("webHookName", "webHookName"), } } diff --git a/resource-manager/automation/2015-10-31/webhook/id_webhook_test.go b/resource-manager/automation/2015-10-31/webhook/id_webhook_test.go index db8dce29e0a..e2f86b09e1a 100644 --- a/resource-manager/automation/2015-10-31/webhook/id_webhook_test.go +++ b/resource-manager/automation/2015-10-31/webhook/id_webhook_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebHookId{} func TestNewWebHookID(t *testing.T) { - id := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webhookName") + id := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webHookName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWebHookID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.WebHookName != "webhookName" { - t.Fatalf("Expected %q but got %q for Segment 'WebHookName'", id.WebHookName, "webhookName") + if id.WebHookName != "webHookName" { + t.Fatalf("Expected %q but got %q for Segment 'WebHookName'", id.WebHookName, "webHookName") } } func TestFormatWebHookID(t *testing.T) { - actual := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webhookName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webhookName" + actual := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "webHookName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webHookName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWebHookID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webhookName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webHookName", Expected: &WebHookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - WebHookName: "webhookName", + WebHookName: "webHookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webhookName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webHookName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseWebHookIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webhookName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webHookName", Expected: &WebHookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - WebHookName: "webhookName", + WebHookName: "webHookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webhookName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/webHooks/webHookName/extra", Error: true, }, { diff --git a/resource-manager/automation/2019-06-01/objectdatatypes/README.md b/resource-manager/automation/2019-06-01/objectdatatypes/README.md index eb36c162b3d..85f93d29d8c 100644 --- a/resource-manager/automation/2019-06-01/objectdatatypes/README.md +++ b/resource-manager/automation/2019-06-01/objectdatatypes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") +id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") read, err := client.ListFieldsByModuleAndType(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") +id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") read, err := client.ListFieldsByType(ctx, id) if err != nil { diff --git a/resource-manager/automation/2019-06-01/objectdatatypes/id_moduleobjectdatatype.go b/resource-manager/automation/2019-06-01/objectdatatypes/id_moduleobjectdatatype.go index e02c0c14cae..33d09ddf304 100644 --- a/resource-manager/automation/2019-06-01/objectdatatypes/id_moduleobjectdatatype.go +++ b/resource-manager/automation/2019-06-01/objectdatatypes/id_moduleobjectdatatype.go @@ -131,7 +131,7 @@ func (id ModuleObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticModules", "modules", "modules"), resourceids.UserSpecifiedSegment("moduleName", "moduleName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2019-06-01/objectdatatypes/id_moduleobjectdatatype_test.go b/resource-manager/automation/2019-06-01/objectdatatypes/id_moduleobjectdatatype_test.go index 80c13043fd2..d8e7a0c8bfd 100644 --- a/resource-manager/automation/2019-06-01/objectdatatypes/id_moduleobjectdatatype_test.go +++ b/resource-manager/automation/2019-06-01/objectdatatypes/id_moduleobjectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModuleObjectDataTypeId{} func TestNewModuleObjectDataTypeID(t *testing.T) { - id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") + id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewModuleObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatModuleObjectDataTypeID(t *testing.T) { - actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName" + actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseModuleObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseModuleObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", ModuleName: "mOdUlEnAmE", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2019-06-01/objectdatatypes/id_objectdatatype.go b/resource-manager/automation/2019-06-01/objectdatatypes/id_objectdatatype.go index f8217a2592b..86e001d2c78 100644 --- a/resource-manager/automation/2019-06-01/objectdatatypes/id_objectdatatype.go +++ b/resource-manager/automation/2019-06-01/objectdatatypes/id_objectdatatype.go @@ -123,7 +123,7 @@ func (id ObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2019-06-01/objectdatatypes/id_objectdatatype_test.go b/resource-manager/automation/2019-06-01/objectdatatypes/id_objectdatatype_test.go index b6ffc014a1e..e16931fd648 100644 --- a/resource-manager/automation/2019-06-01/objectdatatypes/id_objectdatatype_test.go +++ b/resource-manager/automation/2019-06-01/objectdatatypes/id_objectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ObjectDataTypeId{} func TestNewObjectDataTypeID(t *testing.T) { - id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") + id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatObjectDataTypeID(t *testing.T) { - actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName" + actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2019-06-01/python2package/README.md b/resource-manager/automation/2019-06-01/python2package/README.md index 6c05bbeb3b6..de142885176 100644 --- a/resource-manager/automation/2019-06-01/python2package/README.md +++ b/resource-manager/automation/2019-06-01/python2package/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") payload := python2package.PythonPackageCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") payload := python2package.PythonPackageUpdateParameters{ // ... diff --git a/resource-manager/automation/2019-06-01/python2package/id_python2package.go b/resource-manager/automation/2019-06-01/python2package/id_python2package.go index c2fcc16218b..19ff0b7604a 100644 --- a/resource-manager/automation/2019-06-01/python2package/id_python2package.go +++ b/resource-manager/automation/2019-06-01/python2package/id_python2package.go @@ -123,7 +123,7 @@ func (id Python2PackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticPython2Packages", "python2Packages", "python2Packages"), - resourceids.UserSpecifiedSegment("python2PackageName", "packageName"), + resourceids.UserSpecifiedSegment("python2PackageName", "python2PackageName"), } } diff --git a/resource-manager/automation/2019-06-01/python2package/id_python2package_test.go b/resource-manager/automation/2019-06-01/python2package/id_python2package_test.go index daa0e53bd55..fbf7b3009a1 100644 --- a/resource-manager/automation/2019-06-01/python2package/id_python2package_test.go +++ b/resource-manager/automation/2019-06-01/python2package/id_python2package_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Python2PackageId{} func TestNewPython2PackageID(t *testing.T) { - id := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") + id := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPython2PackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.Python2PackageName != "packageName" { - t.Fatalf("Expected %q but got %q for Segment 'Python2PackageName'", id.Python2PackageName, "packageName") + if id.Python2PackageName != "python2PackageName" { + t.Fatalf("Expected %q but got %q for Segment 'Python2PackageName'", id.Python2PackageName, "python2PackageName") } } func TestFormatPython2PackageID(t *testing.T) { - actual := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName" + actual := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePython2PackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python2PackageName: "packageName", + Python2PackageName: "python2PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePython2PackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python2PackageName: "packageName", + Python2PackageName: "python2PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pAcKaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pYtHoN2PaCkAgEnAmE", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - Python2PackageName: "pAcKaGeNaMe", + Python2PackageName: "pYtHoN2PaCkAgEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pAcKaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pYtHoN2PaCkAgEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2019-06-01/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go b/resource-manager/automation/2019-06-01/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go index 91fe515d844..40035782a1a 100644 --- a/resource-manager/automation/2019-06-01/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go +++ b/resource-manager/automation/2019-06-01/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go @@ -9,7 +9,7 @@ type SourceControlCreateOrUpdateProperties struct { Description *string `json:"description,omitempty"` FolderPath *string `json:"folderPath,omitempty"` PublishRunbook *bool `json:"publishRunbook,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` SourceType *SourceType `json:"sourceType,omitempty"` } diff --git a/resource-manager/automation/2019-06-01/sourcecontrol/model_sourcecontrolproperties.go b/resource-manager/automation/2019-06-01/sourcecontrol/model_sourcecontrolproperties.go index 21d10172e47..33a22675f14 100644 --- a/resource-manager/automation/2019-06-01/sourcecontrol/model_sourcecontrolproperties.go +++ b/resource-manager/automation/2019-06-01/sourcecontrol/model_sourcecontrolproperties.go @@ -17,7 +17,7 @@ type SourceControlProperties struct { FolderPath *string `json:"folderPath,omitempty"` LastModifiedTime *string `json:"lastModifiedTime,omitempty"` PublishRunbook *bool `json:"publishRunbook,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` SourceType *SourceType `json:"sourceType,omitempty"` } diff --git a/resource-manager/automation/2020-01-13-preview/objectdatatypes/README.md b/resource-manager/automation/2020-01-13-preview/objectdatatypes/README.md index 8a3af35e048..1cad1bd322b 100644 --- a/resource-manager/automation/2020-01-13-preview/objectdatatypes/README.md +++ b/resource-manager/automation/2020-01-13-preview/objectdatatypes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") +id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") read, err := client.ListFieldsByModuleAndType(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") +id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") read, err := client.ListFieldsByType(ctx, id) if err != nil { diff --git a/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_moduleobjectdatatype.go b/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_moduleobjectdatatype.go index e02c0c14cae..33d09ddf304 100644 --- a/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_moduleobjectdatatype.go +++ b/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_moduleobjectdatatype.go @@ -131,7 +131,7 @@ func (id ModuleObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticModules", "modules", "modules"), resourceids.UserSpecifiedSegment("moduleName", "moduleName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_moduleobjectdatatype_test.go b/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_moduleobjectdatatype_test.go index 80c13043fd2..d8e7a0c8bfd 100644 --- a/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_moduleobjectdatatype_test.go +++ b/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_moduleobjectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModuleObjectDataTypeId{} func TestNewModuleObjectDataTypeID(t *testing.T) { - id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") + id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewModuleObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatModuleObjectDataTypeID(t *testing.T) { - actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName" + actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseModuleObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseModuleObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", ModuleName: "mOdUlEnAmE", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_objectdatatype.go b/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_objectdatatype.go index f8217a2592b..86e001d2c78 100644 --- a/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_objectdatatype.go +++ b/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_objectdatatype.go @@ -123,7 +123,7 @@ func (id ObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_objectdatatype_test.go b/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_objectdatatype_test.go index b6ffc014a1e..e16931fd648 100644 --- a/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_objectdatatype_test.go +++ b/resource-manager/automation/2020-01-13-preview/objectdatatypes/id_objectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ObjectDataTypeId{} func TestNewObjectDataTypeID(t *testing.T) { - id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") + id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatObjectDataTypeID(t *testing.T) { - actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName" + actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2020-01-13-preview/python2package/README.md b/resource-manager/automation/2020-01-13-preview/python2package/README.md index 6e3f5da58a7..2757e64a6bb 100644 --- a/resource-manager/automation/2020-01-13-preview/python2package/README.md +++ b/resource-manager/automation/2020-01-13-preview/python2package/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") payload := python2package.PythonPackageCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") payload := python2package.PythonPackageUpdateParameters{ // ... diff --git a/resource-manager/automation/2020-01-13-preview/python2package/id_python2package.go b/resource-manager/automation/2020-01-13-preview/python2package/id_python2package.go index c2fcc16218b..19ff0b7604a 100644 --- a/resource-manager/automation/2020-01-13-preview/python2package/id_python2package.go +++ b/resource-manager/automation/2020-01-13-preview/python2package/id_python2package.go @@ -123,7 +123,7 @@ func (id Python2PackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticPython2Packages", "python2Packages", "python2Packages"), - resourceids.UserSpecifiedSegment("python2PackageName", "packageName"), + resourceids.UserSpecifiedSegment("python2PackageName", "python2PackageName"), } } diff --git a/resource-manager/automation/2020-01-13-preview/python2package/id_python2package_test.go b/resource-manager/automation/2020-01-13-preview/python2package/id_python2package_test.go index daa0e53bd55..fbf7b3009a1 100644 --- a/resource-manager/automation/2020-01-13-preview/python2package/id_python2package_test.go +++ b/resource-manager/automation/2020-01-13-preview/python2package/id_python2package_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Python2PackageId{} func TestNewPython2PackageID(t *testing.T) { - id := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") + id := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPython2PackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.Python2PackageName != "packageName" { - t.Fatalf("Expected %q but got %q for Segment 'Python2PackageName'", id.Python2PackageName, "packageName") + if id.Python2PackageName != "python2PackageName" { + t.Fatalf("Expected %q but got %q for Segment 'Python2PackageName'", id.Python2PackageName, "python2PackageName") } } func TestFormatPython2PackageID(t *testing.T) { - actual := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName" + actual := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePython2PackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python2PackageName: "packageName", + Python2PackageName: "python2PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePython2PackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python2PackageName: "packageName", + Python2PackageName: "python2PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pAcKaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pYtHoN2PaCkAgEnAmE", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - Python2PackageName: "pAcKaGeNaMe", + Python2PackageName: "pYtHoN2PaCkAgEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pAcKaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pYtHoN2PaCkAgEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2020-01-13-preview/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go b/resource-manager/automation/2020-01-13-preview/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go index 91fe515d844..40035782a1a 100644 --- a/resource-manager/automation/2020-01-13-preview/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go +++ b/resource-manager/automation/2020-01-13-preview/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go @@ -9,7 +9,7 @@ type SourceControlCreateOrUpdateProperties struct { Description *string `json:"description,omitempty"` FolderPath *string `json:"folderPath,omitempty"` PublishRunbook *bool `json:"publishRunbook,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` SourceType *SourceType `json:"sourceType,omitempty"` } diff --git a/resource-manager/automation/2020-01-13-preview/sourcecontrol/model_sourcecontrolproperties.go b/resource-manager/automation/2020-01-13-preview/sourcecontrol/model_sourcecontrolproperties.go index 21d10172e47..33a22675f14 100644 --- a/resource-manager/automation/2020-01-13-preview/sourcecontrol/model_sourcecontrolproperties.go +++ b/resource-manager/automation/2020-01-13-preview/sourcecontrol/model_sourcecontrolproperties.go @@ -17,7 +17,7 @@ type SourceControlProperties struct { FolderPath *string `json:"folderPath,omitempty"` LastModifiedTime *string `json:"lastModifiedTime,omitempty"` PublishRunbook *bool `json:"publishRunbook,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` SourceType *SourceType `json:"sourceType,omitempty"` } diff --git a/resource-manager/automation/2021-06-22/automationaccount/model_automationaccountproperties.go b/resource-manager/automation/2021-06-22/automationaccount/model_automationaccountproperties.go index 4a52729a341..b451334411a 100644 --- a/resource-manager/automation/2021-06-22/automationaccount/model_automationaccountproperties.go +++ b/resource-manager/automation/2021-06-22/automationaccount/model_automationaccountproperties.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AutomationAccountProperties struct { - AutomationHybridServiceUrl *string `json:"automationHybridServiceUrl,omitempty"` + AutomationHybridServiceURL *string `json:"automationHybridServiceUrl,omitempty"` CreationTime *string `json:"creationTime,omitempty"` Description *string `json:"description,omitempty"` DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` diff --git a/resource-manager/automation/2022-08-08/automationaccount/model_automationaccountproperties.go b/resource-manager/automation/2022-08-08/automationaccount/model_automationaccountproperties.go index 4a52729a341..b451334411a 100644 --- a/resource-manager/automation/2022-08-08/automationaccount/model_automationaccountproperties.go +++ b/resource-manager/automation/2022-08-08/automationaccount/model_automationaccountproperties.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AutomationAccountProperties struct { - AutomationHybridServiceUrl *string `json:"automationHybridServiceUrl,omitempty"` + AutomationHybridServiceURL *string `json:"automationHybridServiceUrl,omitempty"` CreationTime *string `json:"creationTime,omitempty"` Description *string `json:"description,omitempty"` DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` diff --git a/resource-manager/automation/2022-08-08/objectdatatypes/README.md b/resource-manager/automation/2022-08-08/objectdatatypes/README.md index 570a47aa475..67dbd810faa 100644 --- a/resource-manager/automation/2022-08-08/objectdatatypes/README.md +++ b/resource-manager/automation/2022-08-08/objectdatatypes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") +id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") read, err := client.ListFieldsByModuleAndType(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") +id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") read, err := client.ListFieldsByType(ctx, id) if err != nil { diff --git a/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype.go b/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype.go index e02c0c14cae..33d09ddf304 100644 --- a/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype.go +++ b/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype.go @@ -131,7 +131,7 @@ func (id ModuleObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticModules", "modules", "modules"), resourceids.UserSpecifiedSegment("moduleName", "moduleName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype_test.go b/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype_test.go index 80c13043fd2..d8e7a0c8bfd 100644 --- a/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype_test.go +++ b/resource-manager/automation/2022-08-08/objectdatatypes/id_moduleobjectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModuleObjectDataTypeId{} func TestNewModuleObjectDataTypeID(t *testing.T) { - id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") + id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewModuleObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatModuleObjectDataTypeID(t *testing.T) { - actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName" + actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseModuleObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseModuleObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", ModuleName: "mOdUlEnAmE", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype.go b/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype.go index f8217a2592b..86e001d2c78 100644 --- a/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype.go +++ b/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype.go @@ -123,7 +123,7 @@ func (id ObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype_test.go b/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype_test.go index b6ffc014a1e..e16931fd648 100644 --- a/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype_test.go +++ b/resource-manager/automation/2022-08-08/objectdatatypes/id_objectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ObjectDataTypeId{} func TestNewObjectDataTypeID(t *testing.T) { - id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") + id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatObjectDataTypeID(t *testing.T) { - actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName" + actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2022-08-08/python2package/README.md b/resource-manager/automation/2022-08-08/python2package/README.md index 3da0211b7a9..78b7c3d3e0a 100644 --- a/resource-manager/automation/2022-08-08/python2package/README.md +++ b/resource-manager/automation/2022-08-08/python2package/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") payload := python2package.PythonPackageCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") payload := python2package.PythonPackageUpdateParameters{ // ... diff --git a/resource-manager/automation/2022-08-08/python2package/id_python2package.go b/resource-manager/automation/2022-08-08/python2package/id_python2package.go index c2fcc16218b..19ff0b7604a 100644 --- a/resource-manager/automation/2022-08-08/python2package/id_python2package.go +++ b/resource-manager/automation/2022-08-08/python2package/id_python2package.go @@ -123,7 +123,7 @@ func (id Python2PackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticPython2Packages", "python2Packages", "python2Packages"), - resourceids.UserSpecifiedSegment("python2PackageName", "packageName"), + resourceids.UserSpecifiedSegment("python2PackageName", "python2PackageName"), } } diff --git a/resource-manager/automation/2022-08-08/python2package/id_python2package_test.go b/resource-manager/automation/2022-08-08/python2package/id_python2package_test.go index daa0e53bd55..fbf7b3009a1 100644 --- a/resource-manager/automation/2022-08-08/python2package/id_python2package_test.go +++ b/resource-manager/automation/2022-08-08/python2package/id_python2package_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Python2PackageId{} func TestNewPython2PackageID(t *testing.T) { - id := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") + id := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPython2PackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.Python2PackageName != "packageName" { - t.Fatalf("Expected %q but got %q for Segment 'Python2PackageName'", id.Python2PackageName, "packageName") + if id.Python2PackageName != "python2PackageName" { + t.Fatalf("Expected %q but got %q for Segment 'Python2PackageName'", id.Python2PackageName, "python2PackageName") } } func TestFormatPython2PackageID(t *testing.T) { - actual := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName" + actual := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePython2PackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python2PackageName: "packageName", + Python2PackageName: "python2PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePython2PackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python2PackageName: "packageName", + Python2PackageName: "python2PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pAcKaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pYtHoN2PaCkAgEnAmE", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - Python2PackageName: "pAcKaGeNaMe", + Python2PackageName: "pYtHoN2PaCkAgEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pAcKaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pYtHoN2PaCkAgEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2022-08-08/python3package/README.md b/resource-manager/automation/2022-08-08/python3package/README.md index 260787e8af5..fde27040ac3 100644 --- a/resource-manager/automation/2022-08-08/python3package/README.md +++ b/resource-manager/automation/2022-08-08/python3package/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") payload := python3package.PythonPackageCreateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") read, err := client.Get(ctx, id) if err != nil { @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") payload := python3package.PythonPackageUpdateParameters{ // ... diff --git a/resource-manager/automation/2022-08-08/python3package/id_python3package.go b/resource-manager/automation/2022-08-08/python3package/id_python3package.go index 1ba8eadd6ee..cef34b98c76 100644 --- a/resource-manager/automation/2022-08-08/python3package/id_python3package.go +++ b/resource-manager/automation/2022-08-08/python3package/id_python3package.go @@ -123,7 +123,7 @@ func (id Python3PackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticPython3Packages", "python3Packages", "python3Packages"), - resourceids.UserSpecifiedSegment("python3PackageName", "packageName"), + resourceids.UserSpecifiedSegment("python3PackageName", "python3PackageName"), } } diff --git a/resource-manager/automation/2022-08-08/python3package/id_python3package_test.go b/resource-manager/automation/2022-08-08/python3package/id_python3package_test.go index eb4a361f3b9..9a3cdbaafda 100644 --- a/resource-manager/automation/2022-08-08/python3package/id_python3package_test.go +++ b/resource-manager/automation/2022-08-08/python3package/id_python3package_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Python3PackageId{} func TestNewPython3PackageID(t *testing.T) { - id := NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") + id := NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPython3PackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.Python3PackageName != "packageName" { - t.Fatalf("Expected %q but got %q for Segment 'Python3PackageName'", id.Python3PackageName, "packageName") + if id.Python3PackageName != "python3PackageName" { + t.Fatalf("Expected %q but got %q for Segment 'Python3PackageName'", id.Python3PackageName, "python3PackageName") } } func TestFormatPython3PackageID(t *testing.T) { - actual := NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName" + actual := NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePython3PackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName", Expected: &Python3PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python3PackageName: "packageName", + Python3PackageName: "python3PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePython3PackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName", Expected: &Python3PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python3PackageName: "packageName", + Python3PackageName: "python3PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN3PaCkAgEs/pAcKaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN3PaCkAgEs/pYtHoN3PaCkAgEnAmE", Expected: &Python3PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - Python3PackageName: "pAcKaGeNaMe", + Python3PackageName: "pYtHoN3PaCkAgEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN3PaCkAgEs/pAcKaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN3PaCkAgEs/pYtHoN3PaCkAgEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2022-08-08/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go b/resource-manager/automation/2022-08-08/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go index 91fe515d844..40035782a1a 100644 --- a/resource-manager/automation/2022-08-08/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go +++ b/resource-manager/automation/2022-08-08/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go @@ -9,7 +9,7 @@ type SourceControlCreateOrUpdateProperties struct { Description *string `json:"description,omitempty"` FolderPath *string `json:"folderPath,omitempty"` PublishRunbook *bool `json:"publishRunbook,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` SourceType *SourceType `json:"sourceType,omitempty"` } diff --git a/resource-manager/automation/2022-08-08/sourcecontrol/model_sourcecontrolproperties.go b/resource-manager/automation/2022-08-08/sourcecontrol/model_sourcecontrolproperties.go index 21d10172e47..33a22675f14 100644 --- a/resource-manager/automation/2022-08-08/sourcecontrol/model_sourcecontrolproperties.go +++ b/resource-manager/automation/2022-08-08/sourcecontrol/model_sourcecontrolproperties.go @@ -17,7 +17,7 @@ type SourceControlProperties struct { FolderPath *string `json:"folderPath,omitempty"` LastModifiedTime *string `json:"lastModifiedTime,omitempty"` PublishRunbook *bool `json:"publishRunbook,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` SourceType *SourceType `json:"sourceType,omitempty"` } diff --git a/resource-manager/automation/2023-11-01/automationaccount/model_automationaccountproperties.go b/resource-manager/automation/2023-11-01/automationaccount/model_automationaccountproperties.go index 4a52729a341..b451334411a 100644 --- a/resource-manager/automation/2023-11-01/automationaccount/model_automationaccountproperties.go +++ b/resource-manager/automation/2023-11-01/automationaccount/model_automationaccountproperties.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AutomationAccountProperties struct { - AutomationHybridServiceUrl *string `json:"automationHybridServiceUrl,omitempty"` + AutomationHybridServiceURL *string `json:"automationHybridServiceUrl,omitempty"` CreationTime *string `json:"creationTime,omitempty"` Description *string `json:"description,omitempty"` DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` diff --git a/resource-manager/automation/2023-11-01/module/README.md b/resource-manager/automation/2023-11-01/module/README.md index 08bb34a41f2..ba17eed8237 100644 --- a/resource-manager/automation/2023-11-01/module/README.md +++ b/resource-manager/automation/2023-11-01/module/README.md @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := module.NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName") +id := module.NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "powerShell72ModuleName") payload := module.ModuleCreateOrUpdateParameters{ // ... @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := module.NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName") +id := module.NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "powerShell72ModuleName") read, err := client.PowerShell72ModuleDelete(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := module.NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName") +id := module.NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "powerShell72ModuleName") read, err := client.PowerShell72ModuleGet(ctx, id) if err != nil { @@ -164,7 +164,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := module.NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName") +id := module.NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "powerShell72ModuleName") payload := module.ModuleUpdateParameters{ // ... diff --git a/resource-manager/automation/2023-11-01/module/id_powershell72module.go b/resource-manager/automation/2023-11-01/module/id_powershell72module.go index fb57f3af4ee..a61346f1005 100644 --- a/resource-manager/automation/2023-11-01/module/id_powershell72module.go +++ b/resource-manager/automation/2023-11-01/module/id_powershell72module.go @@ -123,7 +123,7 @@ func (id PowerShell72ModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticPowerShell72Modules", "powerShell72Modules", "powerShell72Modules"), - resourceids.UserSpecifiedSegment("powerShell72ModuleName", "moduleName"), + resourceids.UserSpecifiedSegment("powerShell72ModuleName", "powerShell72ModuleName"), } } diff --git a/resource-manager/automation/2023-11-01/module/id_powershell72module_test.go b/resource-manager/automation/2023-11-01/module/id_powershell72module_test.go index cba0276dcb5..54de69cd090 100644 --- a/resource-manager/automation/2023-11-01/module/id_powershell72module_test.go +++ b/resource-manager/automation/2023-11-01/module/id_powershell72module_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PowerShell72ModuleId{} func TestNewPowerShell72ModuleID(t *testing.T) { - id := NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName") + id := NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "powerShell72ModuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPowerShell72ModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.PowerShell72ModuleName != "moduleName" { - t.Fatalf("Expected %q but got %q for Segment 'PowerShell72ModuleName'", id.PowerShell72ModuleName, "moduleName") + if id.PowerShell72ModuleName != "powerShell72ModuleName" { + t.Fatalf("Expected %q but got %q for Segment 'PowerShell72ModuleName'", id.PowerShell72ModuleName, "powerShell72ModuleName") } } func TestFormatPowerShell72ModuleID(t *testing.T) { - actual := NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/moduleName" + actual := NewPowerShell72ModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "powerShell72ModuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/powerShell72ModuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePowerShell72ModuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/moduleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/powerShell72ModuleName", Expected: &PowerShell72ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - PowerShell72ModuleName: "moduleName", + PowerShell72ModuleName: "powerShell72ModuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/moduleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/powerShell72ModuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePowerShell72ModuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/moduleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/powerShell72ModuleName", Expected: &PowerShell72ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - PowerShell72ModuleName: "moduleName", + PowerShell72ModuleName: "powerShell72ModuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/moduleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/powerShell72Modules/powerShell72ModuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pOwErShElL72mOdUlEs/mOdUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pOwErShElL72mOdUlEs/pOwErShElL72mOdUlEnAmE", Expected: &PowerShell72ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - PowerShell72ModuleName: "mOdUlEnAmE", + PowerShell72ModuleName: "pOwErShElL72mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pOwErShElL72mOdUlEs/mOdUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pOwErShElL72mOdUlEs/pOwErShElL72mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2023-11-01/objectdatatypes/README.md b/resource-manager/automation/2023-11-01/objectdatatypes/README.md index a156b0db154..35ae327fa0e 100644 --- a/resource-manager/automation/2023-11-01/objectdatatypes/README.md +++ b/resource-manager/automation/2023-11-01/objectdatatypes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") +id := objectdatatypes.NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") read, err := client.ListFieldsByModuleAndType(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") +id := objectdatatypes.NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") read, err := client.ListFieldsByType(ctx, id) if err != nil { diff --git a/resource-manager/automation/2023-11-01/objectdatatypes/id_moduleobjectdatatype.go b/resource-manager/automation/2023-11-01/objectdatatypes/id_moduleobjectdatatype.go index e02c0c14cae..33d09ddf304 100644 --- a/resource-manager/automation/2023-11-01/objectdatatypes/id_moduleobjectdatatype.go +++ b/resource-manager/automation/2023-11-01/objectdatatypes/id_moduleobjectdatatype.go @@ -131,7 +131,7 @@ func (id ModuleObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticModules", "modules", "modules"), resourceids.UserSpecifiedSegment("moduleName", "moduleName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2023-11-01/objectdatatypes/id_moduleobjectdatatype_test.go b/resource-manager/automation/2023-11-01/objectdatatypes/id_moduleobjectdatatype_test.go index 80c13043fd2..d8e7a0c8bfd 100644 --- a/resource-manager/automation/2023-11-01/objectdatatypes/id_moduleobjectdatatype_test.go +++ b/resource-manager/automation/2023-11-01/objectdatatypes/id_moduleobjectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModuleObjectDataTypeId{} func TestNewModuleObjectDataTypeID(t *testing.T) { - id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName") + id := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewModuleObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatModuleObjectDataTypeID(t *testing.T) { - actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName" + actual := NewModuleObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "moduleName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseModuleObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseModuleObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", ModuleName: "moduleName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/modules/moduleName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ModuleObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", ModuleName: "mOdUlEnAmE", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/mOdUlEs/mOdUlEnAmE/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2023-11-01/objectdatatypes/id_objectdatatype.go b/resource-manager/automation/2023-11-01/objectdatatypes/id_objectdatatype.go index f8217a2592b..86e001d2c78 100644 --- a/resource-manager/automation/2023-11-01/objectdatatypes/id_objectdatatype.go +++ b/resource-manager/automation/2023-11-01/objectdatatypes/id_objectdatatype.go @@ -123,7 +123,7 @@ func (id ObjectDataTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticObjectDataTypes", "objectDataTypes", "objectDataTypes"), - resourceids.UserSpecifiedSegment("objectDataTypeName", "typeName"), + resourceids.UserSpecifiedSegment("objectDataTypeName", "objectDataTypeName"), } } diff --git a/resource-manager/automation/2023-11-01/objectdatatypes/id_objectdatatype_test.go b/resource-manager/automation/2023-11-01/objectdatatypes/id_objectdatatype_test.go index b6ffc014a1e..e16931fd648 100644 --- a/resource-manager/automation/2023-11-01/objectdatatypes/id_objectdatatype_test.go +++ b/resource-manager/automation/2023-11-01/objectdatatypes/id_objectdatatype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ObjectDataTypeId{} func TestNewObjectDataTypeID(t *testing.T) { - id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName") + id := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewObjectDataTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.ObjectDataTypeName != "typeName" { - t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "typeName") + if id.ObjectDataTypeName != "objectDataTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ObjectDataTypeName'", id.ObjectDataTypeName, "objectDataTypeName") } } func TestFormatObjectDataTypeID(t *testing.T) { - actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName" + actual := NewObjectDataTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "objectDataTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseObjectDataTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseObjectDataTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - ObjectDataTypeName: "typeName", + ObjectDataTypeName: "objectDataTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/objectDataTypes/objectDataTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE", Expected: &ObjectDataTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - ObjectDataTypeName: "tYpEnAmE", + ObjectDataTypeName: "oBjEcTdAtAtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/oBjEcTdAtAtYpEs/oBjEcTdAtAtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2023-11-01/python2package/README.md b/resource-manager/automation/2023-11-01/python2package/README.md index fcbe3bbb0bf..463302347d6 100644 --- a/resource-manager/automation/2023-11-01/python2package/README.md +++ b/resource-manager/automation/2023-11-01/python2package/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") payload := python2package.PythonPackageCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python2package.NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") payload := python2package.PythonPackageUpdateParameters{ // ... diff --git a/resource-manager/automation/2023-11-01/python2package/id_python2package.go b/resource-manager/automation/2023-11-01/python2package/id_python2package.go index c2fcc16218b..19ff0b7604a 100644 --- a/resource-manager/automation/2023-11-01/python2package/id_python2package.go +++ b/resource-manager/automation/2023-11-01/python2package/id_python2package.go @@ -123,7 +123,7 @@ func (id Python2PackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticPython2Packages", "python2Packages", "python2Packages"), - resourceids.UserSpecifiedSegment("python2PackageName", "packageName"), + resourceids.UserSpecifiedSegment("python2PackageName", "python2PackageName"), } } diff --git a/resource-manager/automation/2023-11-01/python2package/id_python2package_test.go b/resource-manager/automation/2023-11-01/python2package/id_python2package_test.go index daa0e53bd55..fbf7b3009a1 100644 --- a/resource-manager/automation/2023-11-01/python2package/id_python2package_test.go +++ b/resource-manager/automation/2023-11-01/python2package/id_python2package_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Python2PackageId{} func TestNewPython2PackageID(t *testing.T) { - id := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") + id := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPython2PackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.Python2PackageName != "packageName" { - t.Fatalf("Expected %q but got %q for Segment 'Python2PackageName'", id.Python2PackageName, "packageName") + if id.Python2PackageName != "python2PackageName" { + t.Fatalf("Expected %q but got %q for Segment 'Python2PackageName'", id.Python2PackageName, "python2PackageName") } } func TestFormatPython2PackageID(t *testing.T) { - actual := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName" + actual := NewPython2PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python2PackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePython2PackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python2PackageName: "packageName", + Python2PackageName: "python2PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePython2PackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python2PackageName: "packageName", + Python2PackageName: "python2PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python2Packages/python2PackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pAcKaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pYtHoN2PaCkAgEnAmE", Expected: &Python2PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - Python2PackageName: "pAcKaGeNaMe", + Python2PackageName: "pYtHoN2PaCkAgEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pAcKaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN2PaCkAgEs/pYtHoN2PaCkAgEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2023-11-01/python3package/README.md b/resource-manager/automation/2023-11-01/python3package/README.md index 2d4692d0a7c..66b87c4e68c 100644 --- a/resource-manager/automation/2023-11-01/python3package/README.md +++ b/resource-manager/automation/2023-11-01/python3package/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") payload := python3package.PythonPackageCreateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") read, err := client.Get(ctx, id) if err != nil { @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") +id := python3package.NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") payload := python3package.PythonPackageUpdateParameters{ // ... diff --git a/resource-manager/automation/2023-11-01/python3package/id_python3package.go b/resource-manager/automation/2023-11-01/python3package/id_python3package.go index 1ba8eadd6ee..cef34b98c76 100644 --- a/resource-manager/automation/2023-11-01/python3package/id_python3package.go +++ b/resource-manager/automation/2023-11-01/python3package/id_python3package.go @@ -123,7 +123,7 @@ func (id Python3PackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticAutomationAccounts", "automationAccounts", "automationAccounts"), resourceids.UserSpecifiedSegment("automationAccountName", "automationAccountName"), resourceids.StaticSegment("staticPython3Packages", "python3Packages", "python3Packages"), - resourceids.UserSpecifiedSegment("python3PackageName", "packageName"), + resourceids.UserSpecifiedSegment("python3PackageName", "python3PackageName"), } } diff --git a/resource-manager/automation/2023-11-01/python3package/id_python3package_test.go b/resource-manager/automation/2023-11-01/python3package/id_python3package_test.go index eb4a361f3b9..9a3cdbaafda 100644 --- a/resource-manager/automation/2023-11-01/python3package/id_python3package_test.go +++ b/resource-manager/automation/2023-11-01/python3package/id_python3package_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &Python3PackageId{} func TestNewPython3PackageID(t *testing.T) { - id := NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName") + id := NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPython3PackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AutomationAccountName'", id.AutomationAccountName, "automationAccountName") } - if id.Python3PackageName != "packageName" { - t.Fatalf("Expected %q but got %q for Segment 'Python3PackageName'", id.Python3PackageName, "packageName") + if id.Python3PackageName != "python3PackageName" { + t.Fatalf("Expected %q but got %q for Segment 'Python3PackageName'", id.Python3PackageName, "python3PackageName") } } func TestFormatPython3PackageID(t *testing.T) { - actual := NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "packageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName" + actual := NewPython3PackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "automationAccountName", "python3PackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePython3PackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName", Expected: &Python3PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python3PackageName: "packageName", + Python3PackageName: "python3PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePython3PackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName", Expected: &Python3PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AutomationAccountName: "automationAccountName", - Python3PackageName: "packageName", + Python3PackageName: "python3PackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/packageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Automation/automationAccounts/automationAccountName/python3Packages/python3PackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN3PaCkAgEs/pAcKaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN3PaCkAgEs/pYtHoN3PaCkAgEnAmE", Expected: &Python3PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutomationAccountName: "aUtOmAtIoNaCcOuNtNaMe", - Python3PackageName: "pAcKaGeNaMe", + Python3PackageName: "pYtHoN3PaCkAgEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN3PaCkAgEs/pAcKaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtOmAtIoN/aUtOmAtIoNaCcOuNtS/aUtOmAtIoNaCcOuNtNaMe/pYtHoN3PaCkAgEs/pYtHoN3PaCkAgEnAmE/extra", Error: true, }, } diff --git a/resource-manager/automation/2023-11-01/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go b/resource-manager/automation/2023-11-01/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go index 91fe515d844..40035782a1a 100644 --- a/resource-manager/automation/2023-11-01/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go +++ b/resource-manager/automation/2023-11-01/sourcecontrol/model_sourcecontrolcreateorupdateproperties.go @@ -9,7 +9,7 @@ type SourceControlCreateOrUpdateProperties struct { Description *string `json:"description,omitempty"` FolderPath *string `json:"folderPath,omitempty"` PublishRunbook *bool `json:"publishRunbook,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` SourceType *SourceType `json:"sourceType,omitempty"` } diff --git a/resource-manager/automation/2023-11-01/sourcecontrol/model_sourcecontrolproperties.go b/resource-manager/automation/2023-11-01/sourcecontrol/model_sourcecontrolproperties.go index 21d10172e47..33a22675f14 100644 --- a/resource-manager/automation/2023-11-01/sourcecontrol/model_sourcecontrolproperties.go +++ b/resource-manager/automation/2023-11-01/sourcecontrol/model_sourcecontrolproperties.go @@ -17,7 +17,7 @@ type SourceControlProperties struct { FolderPath *string `json:"folderPath,omitempty"` LastModifiedTime *string `json:"lastModifiedTime,omitempty"` PublishRunbook *bool `json:"publishRunbook,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` SourceType *SourceType `json:"sourceType,omitempty"` } diff --git a/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/README.md b/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/README.md index 889ea2dd444..d2a98230f4a 100644 --- a/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/README.md +++ b/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnosticsettings.NewDiagnosticSettingID("name") +id := diagnosticsettings.NewDiagnosticSettingID("diagnosticSettingName") payload := diagnosticsettings.DiagnosticSettingsResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewDiagnosticSettingID("name") +id := diagnosticsettings.NewDiagnosticSettingID("diagnosticSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewDiagnosticSettingID("name") +id := diagnosticsettings.NewDiagnosticSettingID("diagnosticSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/id_diagnosticsetting.go b/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/id_diagnosticsetting.go index 72abbb4e42f..e187f043d2b 100644 --- a/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/id_diagnosticsetting.go +++ b/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/id_diagnosticsetting.go @@ -99,7 +99,7 @@ func (id DiagnosticSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAADIAM", "Microsoft.AADIAM", "Microsoft.AADIAM"), resourceids.StaticSegment("staticDiagnosticSettings", "diagnosticSettings", "diagnosticSettings"), - resourceids.UserSpecifiedSegment("diagnosticSettingName", "name"), + resourceids.UserSpecifiedSegment("diagnosticSettingName", "diagnosticSettingName"), } } diff --git a/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/id_diagnosticsetting_test.go b/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/id_diagnosticsetting_test.go index 785f7b473ca..c14799c93a1 100644 --- a/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/id_diagnosticsetting_test.go +++ b/resource-manager/azureactivedirectory/2017-04-01/diagnosticsettings/id_diagnosticsetting_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &DiagnosticSettingId{} func TestNewDiagnosticSettingID(t *testing.T) { - id := NewDiagnosticSettingID("name") + id := NewDiagnosticSettingID("diagnosticSettingName") - if id.DiagnosticSettingName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingName'", id.DiagnosticSettingName, "name") + if id.DiagnosticSettingName != "diagnosticSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingName'", id.DiagnosticSettingName, "diagnosticSettingName") } } func TestFormatDiagnosticSettingID(t *testing.T) { - actual := NewDiagnosticSettingID("name").ID() - expected := "/providers/Microsoft.AADIAM/diagnosticSettings/name" + actual := NewDiagnosticSettingID("diagnosticSettingName").ID() + expected := "/providers/Microsoft.AADIAM/diagnosticSettings/diagnosticSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseDiagnosticSettingID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.AADIAM/diagnosticSettings/name", + Input: "/providers/Microsoft.AADIAM/diagnosticSettings/diagnosticSettingName", Expected: &DiagnosticSettingId{ - DiagnosticSettingName: "name", + DiagnosticSettingName: "diagnosticSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.AADIAM/diagnosticSettings/name/extra", + Input: "/providers/Microsoft.AADIAM/diagnosticSettings/diagnosticSettingName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseDiagnosticSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.AADIAM/diagnosticSettings/name", + Input: "/providers/Microsoft.AADIAM/diagnosticSettings/diagnosticSettingName", Expected: &DiagnosticSettingId{ - DiagnosticSettingName: "name", + DiagnosticSettingName: "diagnosticSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.AADIAM/diagnosticSettings/name/extra", + Input: "/providers/Microsoft.AADIAM/diagnosticSettings/diagnosticSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.aAdIaM/dIaGnOsTiCsEtTiNgS/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.aAdIaM/dIaGnOsTiCsEtTiNgS/dIaGnOsTiCsEtTiNgNaMe", Expected: &DiagnosticSettingId{ - DiagnosticSettingName: "nAmE", + DiagnosticSettingName: "dIaGnOsTiCsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.aAdIaM/dIaGnOsTiCsEtTiNgS/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.aAdIaM/dIaGnOsTiCsEtTiNgS/dIaGnOsTiCsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/README.md b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/README.md index 03efdaa50c3..89bb54008db 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/README.md +++ b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := privateendpointconnections.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") // alternatively `client.ListByPolicyName(ctx, id)` can be used to do batched pagination items, err := client.ListByPolicyNameComplete(ctx, id) diff --git a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privateendpointconnection.go index 5bd627fc5cb..d17ead108a0 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAADIAM", "Microsoft.AADIAM", "Microsoft.AADIAM"), resourceids.StaticSegment("staticPrivateLinkForAzureAd", "privateLinkForAzureAd", "privateLinkForAzureAd"), - resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "policyName"), + resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "privateLinkForAzureAdName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privateendpointconnection_test.go index 783bad3b401..3ed056c14ad 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkForAzureAdName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "policyName") + if id.PrivateLinkForAzureAdName != "privateLinkForAzureAdName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "privateLinkForAzureAdName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkForAzureAdName: "pOlIcYnAmE", + PrivateLinkForAzureAdName: "pRiVaTeLiNkFoRaZuReAdNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privatelinkforazuread.go b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privatelinkforazuread.go index 13b651a1895..07dbc8e2093 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privatelinkforazuread.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privatelinkforazuread.go @@ -115,7 +115,7 @@ func (id PrivateLinkForAzureAdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAADIAM", "Microsoft.AADIAM", "Microsoft.AADIAM"), resourceids.StaticSegment("staticPrivateLinkForAzureAd", "privateLinkForAzureAd", "privateLinkForAzureAd"), - resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "policyName"), + resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "privateLinkForAzureAdName"), } } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privatelinkforazuread_test.go b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privatelinkforazuread_test.go index f789ea56572..b0b93f7619a 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privatelinkforazuread_test.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privateendpointconnections/id_privatelinkforazuread_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkForAzureAdId{} func TestNewPrivateLinkForAzureAdID(t *testing.T) { - id := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkForAzureAdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkForAzureAdName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "policyName") + if id.PrivateLinkForAzureAdName != "privateLinkForAzureAdName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "privateLinkForAzureAdName") } } func TestFormatPrivateLinkForAzureAdID(t *testing.T) { - actual := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName" + actual := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkForAzureAdID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkForAzureAdIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkForAzureAdName: "pOlIcYnAmE", + PrivateLinkForAzureAdName: "pRiVaTeLiNkFoRaZuReAdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/extra", Error: true, }, } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/README.md b/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/README.md index 52b88a57512..eabe501addf 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/README.md +++ b/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkforazuread.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := privatelinkforazuread.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") payload := privatelinkforazuread.PrivateLinkPolicy{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privatelinkforazuread.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := privatelinkforazuread.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") read, err := client.Delete(ctx, id) if err != nil { @@ -58,7 +58,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkforazuread.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := privatelinkforazuread.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") read, err := client.Get(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkforazuread.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := privatelinkforazuread.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") payload := privatelinkforazuread.PrivateLinkPolicyUpdateParameter{ // ... diff --git a/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/id_privatelinkforazuread.go b/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/id_privatelinkforazuread.go index 74ea5b62756..6c770608222 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/id_privatelinkforazuread.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/id_privatelinkforazuread.go @@ -115,7 +115,7 @@ func (id PrivateLinkForAzureAdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAADIAM", "Microsoft.AADIAM", "Microsoft.AADIAM"), resourceids.StaticSegment("staticPrivateLinkForAzureAd", "privateLinkForAzureAd", "privateLinkForAzureAd"), - resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "policyName"), + resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "privateLinkForAzureAdName"), } } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/id_privatelinkforazuread_test.go b/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/id_privatelinkforazuread_test.go index 3ca0baef051..c2b6ba9f3f4 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/id_privatelinkforazuread_test.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privatelinkforazuread/id_privatelinkforazuread_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkForAzureAdId{} func TestNewPrivateLinkForAzureAdID(t *testing.T) { - id := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkForAzureAdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkForAzureAdName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "policyName") + if id.PrivateLinkForAzureAdName != "privateLinkForAzureAdName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "privateLinkForAzureAdName") } } func TestFormatPrivateLinkForAzureAdID(t *testing.T) { - actual := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName" + actual := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkForAzureAdID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkForAzureAdIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkForAzureAdName: "pOlIcYnAmE", + PrivateLinkForAzureAdName: "pRiVaTeLiNkFoRaZuReAdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/extra", Error: true, }, } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/README.md b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/README.md index 82274535f87..800b706efac 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/README.md +++ b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := privatelinkresources.NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") // alternatively `client.ListByPrivateLinkPolicy(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkPolicyComplete(ctx, id) diff --git a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkforazuread.go b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkforazuread.go index 308d4f3e8a4..3fc1f39dcb8 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkforazuread.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkforazuread.go @@ -115,7 +115,7 @@ func (id PrivateLinkForAzureAdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAADIAM", "Microsoft.AADIAM", "Microsoft.AADIAM"), resourceids.StaticSegment("staticPrivateLinkForAzureAd", "privateLinkForAzureAd", "privateLinkForAzureAd"), - resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "policyName"), + resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "privateLinkForAzureAdName"), } } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkforazuread_test.go b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkforazuread_test.go index d918ae3051d..8a717b8a615 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkforazuread_test.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkforazuread_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkForAzureAdId{} func TestNewPrivateLinkForAzureAdID(t *testing.T) { - id := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkForAzureAdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkForAzureAdName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "policyName") + if id.PrivateLinkForAzureAdName != "privateLinkForAzureAdName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "privateLinkForAzureAdName") } } func TestFormatPrivateLinkForAzureAdID(t *testing.T) { - actual := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName" + actual := NewPrivateLinkForAzureAdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkForAzureAdID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkForAzureAdIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe", Expected: &PrivateLinkForAzureAdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkForAzureAdName: "pOlIcYnAmE", + PrivateLinkForAzureAdName: "pRiVaTeLiNkFoRaZuReAdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/extra", Error: true, }, } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkresource.go b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkresource.go index 33827cc6830..eadf5dcf898 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAADIAM", "Microsoft.AADIAM", "Microsoft.AADIAM"), resourceids.StaticSegment("staticPrivateLinkForAzureAd", "privateLinkForAzureAd", "privateLinkForAzureAd"), - resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "policyName"), + resourceids.UserSpecifiedSegment("privateLinkForAzureAdName", "privateLinkForAzureAdName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkresource_test.go index 7e0ca32eb22..506f9aee312 100644 --- a/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/azureactivedirectory/2020-03-01/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkForAzureAdName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "policyName") + if id.PrivateLinkForAzureAdName != "privateLinkForAzureAdName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkForAzureAdName'", id.PrivateLinkForAzureAdName, "privateLinkForAzureAdName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkForAzureAdName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", - PrivateLinkResourceName: "groupName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkForAzureAdName: "policyName", - PrivateLinkResourceName: "groupName", + PrivateLinkForAzureAdName: "privateLinkForAzureAdName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/policyName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AADIAM/privateLinkForAzureAd/privateLinkForAzureAdName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkForAzureAdName: "pOlIcYnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkForAzureAdName: "pRiVaTeLiNkFoRaZuReAdNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pOlIcYnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aAdIaM/pRiVaTeLiNkFoRaZuReAd/pRiVaTeLiNkFoRaZuReAdNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/azurefleet/2024-05-01-preview/fleets/model_keyvaultsecretreference.go b/resource-manager/azurefleet/2024-05-01-preview/fleets/model_keyvaultsecretreference.go index c8633a7946b..684b0486642 100644 --- a/resource-manager/azurefleet/2024-05-01-preview/fleets/model_keyvaultsecretreference.go +++ b/resource-manager/azurefleet/2024-05-01-preview/fleets/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package fleets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/azurefleet/2024-05-01-preview/fleets/model_vaultcertificate.go b/resource-manager/azurefleet/2024-05-01-preview/fleets/model_vaultcertificate.go index f42af796e80..0cfabd0a8cc 100644 --- a/resource-manager/azurefleet/2024-05-01-preview/fleets/model_vaultcertificate.go +++ b/resource-manager/azurefleet/2024-05-01-preview/fleets/model_vaultcertificate.go @@ -5,5 +5,5 @@ package fleets type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/azurefleet/2024-05-01-preview/fleets/model_virtualmachinescalesetextensionproperties.go b/resource-manager/azurefleet/2024-05-01-preview/fleets/model_virtualmachinescalesetextensionproperties.go index 6613fda2e5b..5261f1d1b5a 100644 --- a/resource-manager/azurefleet/2024-05-01-preview/fleets/model_virtualmachinescalesetextensionproperties.go +++ b/resource-manager/azurefleet/2024-05-01-preview/fleets/model_virtualmachinescalesetextensionproperties.go @@ -7,12 +7,12 @@ type VirtualMachineScaleSetExtensionProperties struct { AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` SuppressFailures *bool `json:"suppressFailures,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` diff --git a/resource-manager/azurefleet/2024-05-01-preview/fleets/model_winrmlistener.go b/resource-manager/azurefleet/2024-05-01-preview/fleets/model_winrmlistener.go index d0cd0189649..67a7c3aa0da 100644 --- a/resource-manager/azurefleet/2024-05-01-preview/fleets/model_winrmlistener.go +++ b/resource-manager/azurefleet/2024-05-01-preview/fleets/model_winrmlistener.go @@ -4,6 +4,6 @@ package fleets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/azurestackhci/2024-01-01/deploymentsettings/README.md b/resource-manager/azurestackhci/2024-01-01/deploymentsettings/README.md index dcbf01868f6..d80b6d4f985 100644 --- a/resource-manager/azurestackhci/2024-01-01/deploymentsettings/README.md +++ b/resource-manager/azurestackhci/2024-01-01/deploymentsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingsName") +id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingName") payload := deploymentsettings.DeploymentSetting{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingsName") +id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingsName") +id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/azurestackhci/2024-01-01/deploymentsettings/id_deploymentsetting.go b/resource-manager/azurestackhci/2024-01-01/deploymentsettings/id_deploymentsetting.go index af72974c652..cf106cc9a2b 100644 --- a/resource-manager/azurestackhci/2024-01-01/deploymentsettings/id_deploymentsetting.go +++ b/resource-manager/azurestackhci/2024-01-01/deploymentsettings/id_deploymentsetting.go @@ -123,7 +123,7 @@ func (id DeploymentSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticClusters", "clusters", "clusters"), resourceids.UserSpecifiedSegment("clusterName", "clusterName"), resourceids.StaticSegment("staticDeploymentSettings", "deploymentSettings", "deploymentSettings"), - resourceids.UserSpecifiedSegment("deploymentSettingName", "deploymentSettingsName"), + resourceids.UserSpecifiedSegment("deploymentSettingName", "deploymentSettingName"), } } diff --git a/resource-manager/azurestackhci/2024-01-01/deploymentsettings/id_deploymentsetting_test.go b/resource-manager/azurestackhci/2024-01-01/deploymentsettings/id_deploymentsetting_test.go index b10d20291bd..9191a201bdf 100644 --- a/resource-manager/azurestackhci/2024-01-01/deploymentsettings/id_deploymentsetting_test.go +++ b/resource-manager/azurestackhci/2024-01-01/deploymentsettings/id_deploymentsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeploymentSettingId{} func TestNewDeploymentSettingID(t *testing.T) { - id := NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingsName") + id := NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDeploymentSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterName") } - if id.DeploymentSettingName != "deploymentSettingsName" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentSettingName'", id.DeploymentSettingName, "deploymentSettingsName") + if id.DeploymentSettingName != "deploymentSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentSettingName'", id.DeploymentSettingName, "deploymentSettingName") } } func TestFormatDeploymentSettingID(t *testing.T) { - actual := NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingsName" + actual := NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "deploymentSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDeploymentSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingName", Expected: &DeploymentSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ClusterName: "clusterName", - DeploymentSettingName: "deploymentSettingsName", + DeploymentSettingName: "deploymentSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDeploymentSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingName", Expected: &DeploymentSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ClusterName: "clusterName", - DeploymentSettingName: "deploymentSettingsName", + DeploymentSettingName: "deploymentSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/deploymentSettings/deploymentSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErNaMe/dEpLoYmEnTsEtTiNgS/dEpLoYmEnTsEtTiNgSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErNaMe/dEpLoYmEnTsEtTiNgS/dEpLoYmEnTsEtTiNgNaMe", Expected: &DeploymentSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ClusterName: "cLuStErNaMe", - DeploymentSettingName: "dEpLoYmEnTsEtTiNgSnAmE", + DeploymentSettingName: "dEpLoYmEnTsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErNaMe/dEpLoYmEnTsEtTiNgS/dEpLoYmEnTsEtTiNgSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErNaMe/dEpLoYmEnTsEtTiNgS/dEpLoYmEnTsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/azurestackhci/2024-01-01/securitysettings/README.md b/resource-manager/azurestackhci/2024-01-01/securitysettings/README.md index 7172b5b4fbd..06fd80cccbc 100644 --- a/resource-manager/azurestackhci/2024-01-01/securitysettings/README.md +++ b/resource-manager/azurestackhci/2024-01-01/securitysettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securitysettings.NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingsName") +id := securitysettings.NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingName") payload := securitysettings.SecuritySetting{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := securitysettings.NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingsName") +id := securitysettings.NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := securitysettings.NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingsName") +id := securitysettings.NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/azurestackhci/2024-01-01/securitysettings/id_securitysetting.go b/resource-manager/azurestackhci/2024-01-01/securitysettings/id_securitysetting.go index 464522511cc..591df95c4df 100644 --- a/resource-manager/azurestackhci/2024-01-01/securitysettings/id_securitysetting.go +++ b/resource-manager/azurestackhci/2024-01-01/securitysettings/id_securitysetting.go @@ -123,7 +123,7 @@ func (id SecuritySettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticClusters", "clusters", "clusters"), resourceids.UserSpecifiedSegment("clusterName", "clusterName"), resourceids.StaticSegment("staticSecuritySettings", "securitySettings", "securitySettings"), - resourceids.UserSpecifiedSegment("securitySettingName", "securitySettingsName"), + resourceids.UserSpecifiedSegment("securitySettingName", "securitySettingName"), } } diff --git a/resource-manager/azurestackhci/2024-01-01/securitysettings/id_securitysetting_test.go b/resource-manager/azurestackhci/2024-01-01/securitysettings/id_securitysetting_test.go index b6ea6d4a7bb..1d9600dc42b 100644 --- a/resource-manager/azurestackhci/2024-01-01/securitysettings/id_securitysetting_test.go +++ b/resource-manager/azurestackhci/2024-01-01/securitysettings/id_securitysetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecuritySettingId{} func TestNewSecuritySettingID(t *testing.T) { - id := NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingsName") + id := NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecuritySettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterName") } - if id.SecuritySettingName != "securitySettingsName" { - t.Fatalf("Expected %q but got %q for Segment 'SecuritySettingName'", id.SecuritySettingName, "securitySettingsName") + if id.SecuritySettingName != "securitySettingName" { + t.Fatalf("Expected %q but got %q for Segment 'SecuritySettingName'", id.SecuritySettingName, "securitySettingName") } } func TestFormatSecuritySettingID(t *testing.T) { - actual := NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingsName" + actual := NewSecuritySettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "securitySettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecuritySettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingName", Expected: &SecuritySettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ClusterName: "clusterName", - SecuritySettingName: "securitySettingsName", + SecuritySettingName: "securitySettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecuritySettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingName", Expected: &SecuritySettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ClusterName: "clusterName", - SecuritySettingName: "securitySettingsName", + SecuritySettingName: "securitySettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterName/securitySettings/securitySettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErNaMe/sEcUrItYsEtTiNgS/sEcUrItYsEtTiNgSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErNaMe/sEcUrItYsEtTiNgS/sEcUrItYsEtTiNgNaMe", Expected: &SecuritySettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ClusterName: "cLuStErNaMe", - SecuritySettingName: "sEcUrItYsEtTiNgSnAmE", + SecuritySettingName: "sEcUrItYsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErNaMe/sEcUrItYsEtTiNgS/sEcUrItYsEtTiNgSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErNaMe/sEcUrItYsEtTiNgS/sEcUrItYsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/application/README.md b/resource-manager/batch/2023-05-01/application/README.md index f96bfc45a7b..08588c1d0b2 100644 --- a/resource-manager/batch/2023-05-01/application/README.md +++ b/resource-manager/batch/2023-05-01/application/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") payload := application.Application{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.List(ctx, id, application.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, application.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") payload := application.Application{ // ... diff --git a/resource-manager/batch/2023-05-01/application/id_application.go b/resource-manager/batch/2023-05-01/application/id_application.go index cb94f45793b..7d86ef6c958 100644 --- a/resource-manager/batch/2023-05-01/application/id_application.go +++ b/resource-manager/batch/2023-05-01/application/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/batch/2023-05-01/application/id_application_test.go b/resource-manager/batch/2023-05-01/application/id_application_test.go index edda3b3ac98..256e73ef3a7 100644 --- a/resource-manager/batch/2023-05-01/application/id_application_test.go +++ b/resource-manager/batch/2023-05-01/application/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/application/id_batchaccount.go b/resource-manager/batch/2023-05-01/application/id_batchaccount.go index 308b45d462b..e33350fba90 100644 --- a/resource-manager/batch/2023-05-01/application/id_batchaccount.go +++ b/resource-manager/batch/2023-05-01/application/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-05-01/application/id_batchaccount_test.go b/resource-manager/batch/2023-05-01/application/id_batchaccount_test.go index e209c9e9bfe..767dc437740 100644 --- a/resource-manager/batch/2023-05-01/application/id_batchaccount_test.go +++ b/resource-manager/batch/2023-05-01/application/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/applicationpackage/README.md b/resource-manager/batch/2023-05-01/applicationpackage/README.md index 5cc28c4a4f8..1ac40ba4c64 100644 --- a/resource-manager/batch/2023-05-01/applicationpackage/README.md +++ b/resource-manager/batch/2023-05-01/applicationpackage/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") payload := applicationpackage.ActivateApplicationPackageParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") payload := applicationpackage.ApplicationPackage{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := applicationpackage.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") // alternatively `client.List(ctx, id, applicationpackage.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, applicationpackage.DefaultListOperationOptions()) diff --git a/resource-manager/batch/2023-05-01/applicationpackage/id_application.go b/resource-manager/batch/2023-05-01/applicationpackage/id_application.go index 3538ecc3fcc..a27df437364 100644 --- a/resource-manager/batch/2023-05-01/applicationpackage/id_application.go +++ b/resource-manager/batch/2023-05-01/applicationpackage/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/batch/2023-05-01/applicationpackage/id_application_test.go b/resource-manager/batch/2023-05-01/applicationpackage/id_application_test.go index b17fdece35d..f18c35b6d96 100644 --- a/resource-manager/batch/2023-05-01/applicationpackage/id_application_test.go +++ b/resource-manager/batch/2023-05-01/applicationpackage/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/applicationpackage/id_version.go b/resource-manager/batch/2023-05-01/applicationpackage/id_version.go index 67084ea1452..6c50c4461cd 100644 --- a/resource-manager/batch/2023-05-01/applicationpackage/id_version.go +++ b/resource-manager/batch/2023-05-01/applicationpackage/id_version.go @@ -127,7 +127,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), diff --git a/resource-manager/batch/2023-05-01/applicationpackage/id_version_test.go b/resource-manager/batch/2023-05-01/applicationpackage/id_version_test.go index d06257a8f3e..ad8a1a26cb6 100644 --- a/resource-manager/batch/2023-05-01/applicationpackage/id_version_test.go +++ b/resource-manager/batch/2023-05-01/applicationpackage/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewVersionID(t *testing.T) { } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/applicationpackage/model_applicationpackageproperties.go b/resource-manager/batch/2023-05-01/applicationpackage/model_applicationpackageproperties.go index e49cd1f1a80..a3e08bb9c00 100644 --- a/resource-manager/batch/2023-05-01/applicationpackage/model_applicationpackageproperties.go +++ b/resource-manager/batch/2023-05-01/applicationpackage/model_applicationpackageproperties.go @@ -13,8 +13,8 @@ type ApplicationPackageProperties struct { Format *string `json:"format,omitempty"` LastActivationTime *string `json:"lastActivationTime,omitempty"` State *PackageState `json:"state,omitempty"` - StorageUrl *string `json:"storageUrl,omitempty"` - StorageUrlExpiry *string `json:"storageUrlExpiry,omitempty"` + StorageURL *string `json:"storageUrl,omitempty"` + StorageURLExpiry *string `json:"storageUrlExpiry,omitempty"` } func (o *ApplicationPackageProperties) GetLastActivationTimeAsTime() (*time.Time, error) { @@ -29,14 +29,14 @@ func (o *ApplicationPackageProperties) SetLastActivationTimeAsTime(input time.Ti o.LastActivationTime = &formatted } -func (o *ApplicationPackageProperties) GetStorageUrlExpiryAsTime() (*time.Time, error) { - if o.StorageUrlExpiry == nil { +func (o *ApplicationPackageProperties) GetStorageURLExpiryAsTime() (*time.Time, error) { + if o.StorageURLExpiry == nil { return nil, nil } - return dates.ParseAsFormat(o.StorageUrlExpiry, "2006-01-02T15:04:05Z07:00") + return dates.ParseAsFormat(o.StorageURLExpiry, "2006-01-02T15:04:05Z07:00") } -func (o *ApplicationPackageProperties) SetStorageUrlExpiryAsTime(input time.Time) { +func (o *ApplicationPackageProperties) SetStorageURLExpiryAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StorageUrlExpiry = &formatted + o.StorageURLExpiry = &formatted } diff --git a/resource-manager/batch/2023-05-01/batchaccount/README.md b/resource-manager/batch/2023-05-01/batchaccount/README.md index 9376cdbe077..1b174103fce 100644 --- a/resource-manager/batch/2023-05-01/batchaccount/README.md +++ b/resource-manager/batch/2023-05-01/batchaccount/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountCreateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.GetKeys(ctx, id) if err != nil { @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) @@ -137,7 +137,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountRegenerateKeyParameters{ // ... @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.SynchronizeAutoStorageKeys(ctx, id) if err != nil { @@ -174,7 +174,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountUpdateParameters{ // ... diff --git a/resource-manager/batch/2023-05-01/batchaccount/id_batchaccount.go b/resource-manager/batch/2023-05-01/batchaccount/id_batchaccount.go index 3aed3534630..40f8fee2fa0 100644 --- a/resource-manager/batch/2023-05-01/batchaccount/id_batchaccount.go +++ b/resource-manager/batch/2023-05-01/batchaccount/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-05-01/batchaccount/id_batchaccount_test.go b/resource-manager/batch/2023-05-01/batchaccount/id_batchaccount_test.go index dd150171fbc..e279a3b5cbf 100644 --- a/resource-manager/batch/2023-05-01/batchaccount/id_batchaccount_test.go +++ b/resource-manager/batch/2023-05-01/batchaccount/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/batchmanagements/README.md b/resource-manager/batch/2023-05-01/batchmanagements/README.md index 4282a922c12..41318bddc27 100644 --- a/resource-manager/batch/2023-05-01/batchmanagements/README.md +++ b/resource-manager/batch/2023-05-01/batchmanagements/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchmanagements.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId") +id := batchmanagements.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId") read, err := client.BatchAccountGetDetector(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchmanagements.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchmanagements.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.BatchAccountListDetectors(ctx, id)` can be used to do batched pagination items, err := client.BatchAccountListDetectorsComplete(ctx, id) diff --git a/resource-manager/batch/2023-05-01/batchmanagements/id_batchaccount.go b/resource-manager/batch/2023-05-01/batchmanagements/id_batchaccount.go index c0de828cf69..990b7377b69 100644 --- a/resource-manager/batch/2023-05-01/batchmanagements/id_batchaccount.go +++ b/resource-manager/batch/2023-05-01/batchmanagements/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-05-01/batchmanagements/id_batchaccount_test.go b/resource-manager/batch/2023-05-01/batchmanagements/id_batchaccount_test.go index 1f445bf51c6..dc5efb236d7 100644 --- a/resource-manager/batch/2023-05-01/batchmanagements/id_batchaccount_test.go +++ b/resource-manager/batch/2023-05-01/batchmanagements/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/batchmanagements/id_detector.go b/resource-manager/batch/2023-05-01/batchmanagements/id_detector.go index 87ff01264a1..19b75f4839b 100644 --- a/resource-manager/batch/2023-05-01/batchmanagements/id_detector.go +++ b/resource-manager/batch/2023-05-01/batchmanagements/id_detector.go @@ -121,7 +121,7 @@ func (id DetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorId", "detectorId"), } diff --git a/resource-manager/batch/2023-05-01/batchmanagements/id_detector_test.go b/resource-manager/batch/2023-05-01/batchmanagements/id_detector_test.go index 6f07aac8a22..b7e87bab0f3 100644 --- a/resource-manager/batch/2023-05-01/batchmanagements/id_detector_test.go +++ b/resource-manager/batch/2023-05-01/batchmanagements/id_detector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DetectorId{} func TestNewDetectorID(t *testing.T) { - id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId") + id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.DetectorId != "detectorId" { @@ -32,8 +32,8 @@ func TestNewDetectorID(t *testing.T) { } func TestFormatDetectorID(t *testing.T) { - actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId" + actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", DetectorId: "detectorId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", DetectorId: "detectorId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs/dEtEcToRiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs/dEtEcToRiD", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", DetectorId: "dEtEcToRiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs/dEtEcToRiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs/dEtEcToRiD/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/certificate/README.md b/resource-manager/batch/2023-05-01/certificate/README.md index f0d52e29e73..23bd7cbe03f 100644 --- a/resource-manager/batch/2023-05-01/certificate/README.md +++ b/resource-manager/batch/2023-05-01/certificate/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") read, err := client.CancelDeletion(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") payload := certificate.CertificateCreateOrUpdateParameters{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -73,7 +73,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := certificate.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, certificate.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, certificate.DefaultListByBatchAccountOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") payload := certificate.CertificateCreateOrUpdateParameters{ // ... diff --git a/resource-manager/batch/2023-05-01/certificate/id_batchaccount.go b/resource-manager/batch/2023-05-01/certificate/id_batchaccount.go index 2408b63af1f..4acb2c09d7a 100644 --- a/resource-manager/batch/2023-05-01/certificate/id_batchaccount.go +++ b/resource-manager/batch/2023-05-01/certificate/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-05-01/certificate/id_batchaccount_test.go b/resource-manager/batch/2023-05-01/certificate/id_batchaccount_test.go index 9edb9b2c70f..ec23edd8872 100644 --- a/resource-manager/batch/2023-05-01/certificate/id_batchaccount_test.go +++ b/resource-manager/batch/2023-05-01/certificate/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/certificate/id_certificate.go b/resource-manager/batch/2023-05-01/certificate/id_certificate.go index 4e57e868efe..8c16320b58b 100644 --- a/resource-manager/batch/2023-05-01/certificate/id_certificate.go +++ b/resource-manager/batch/2023-05-01/certificate/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/batch/2023-05-01/certificate/id_certificate_test.go b/resource-manager/batch/2023-05-01/certificate/id_certificate_test.go index d505e287161..60f6258d46a 100644 --- a/resource-manager/batch/2023-05-01/certificate/id_certificate_test.go +++ b/resource-manager/batch/2023-05-01/certificate/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/pool/README.md b/resource-manager/batch/2023-05-01/pool/README.md index f7bea2ed7df..efe23df4634 100644 --- a/resource-manager/batch/2023-05-01/pool/README.md +++ b/resource-manager/batch/2023-05-01/pool/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") payload := pool.Pool{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.DisableAutoScale(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := pool.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, pool.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, pool.DefaultListByBatchAccountOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.StopResize(ctx, id) if err != nil { @@ -122,7 +122,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") payload := pool.Pool{ // ... diff --git a/resource-manager/batch/2023-05-01/pool/id_batchaccount.go b/resource-manager/batch/2023-05-01/pool/id_batchaccount.go index 3cf0013a05d..9c419de2dca 100644 --- a/resource-manager/batch/2023-05-01/pool/id_batchaccount.go +++ b/resource-manager/batch/2023-05-01/pool/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-05-01/pool/id_batchaccount_test.go b/resource-manager/batch/2023-05-01/pool/id_batchaccount_test.go index dd6178079e5..85b207ea3d8 100644 --- a/resource-manager/batch/2023-05-01/pool/id_batchaccount_test.go +++ b/resource-manager/batch/2023-05-01/pool/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/pool/id_pool.go b/resource-manager/batch/2023-05-01/pool/id_pool.go index d9b835e8179..25e8665345f 100644 --- a/resource-manager/batch/2023-05-01/pool/id_pool.go +++ b/resource-manager/batch/2023-05-01/pool/id_pool.go @@ -121,7 +121,7 @@ func (id PoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPools", "pools", "pools"), resourceids.UserSpecifiedSegment("poolName", "poolName"), } diff --git a/resource-manager/batch/2023-05-01/pool/id_pool_test.go b/resource-manager/batch/2023-05-01/pool/id_pool_test.go index 63bb4dd01dc..2caaba8195c 100644 --- a/resource-manager/batch/2023-05-01/pool/id_pool_test.go +++ b/resource-manager/batch/2023-05-01/pool/id_pool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PoolId{} func TestNewPoolID(t *testing.T) { - id := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PoolName != "poolName" { @@ -32,8 +32,8 @@ func TestNewPoolID(t *testing.T) { } func TestFormatPoolID(t *testing.T) { - actual := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName" + actual := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PoolName: "poolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PoolName: "poolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs/pOoLnAmE", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PoolName: "pOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs/pOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/pool/model_azurefileshareconfiguration.go b/resource-manager/batch/2023-05-01/pool/model_azurefileshareconfiguration.go index 910a385e4b8..7ae87358d03 100644 --- a/resource-manager/batch/2023-05-01/pool/model_azurefileshareconfiguration.go +++ b/resource-manager/batch/2023-05-01/pool/model_azurefileshareconfiguration.go @@ -6,7 +6,7 @@ package pool type AzureFileShareConfiguration struct { AccountKey string `json:"accountKey"` AccountName string `json:"accountName"` - AzureFileUrl string `json:"azureFileUrl"` + AzureFileURL string `json:"azureFileUrl"` MountOptions *string `json:"mountOptions,omitempty"` RelativeMountPath string `json:"relativeMountPath"` } diff --git a/resource-manager/batch/2023-05-01/pool/model_resourcefile.go b/resource-manager/batch/2023-05-01/pool/model_resourcefile.go index 9eddccfb1ed..00eb0fef9b2 100644 --- a/resource-manager/batch/2023-05-01/pool/model_resourcefile.go +++ b/resource-manager/batch/2023-05-01/pool/model_resourcefile.go @@ -8,7 +8,7 @@ type ResourceFile struct { BlobPrefix *string `json:"blobPrefix,omitempty"` FileMode *string `json:"fileMode,omitempty"` FilePath *string `json:"filePath,omitempty"` - HTTPUrl *string `json:"httpUrl,omitempty"` + HTTPURL *string `json:"httpUrl,omitempty"` IdentityReference *ComputeNodeIdentityReference `json:"identityReference,omitempty"` - StorageContainerUrl *string `json:"storageContainerUrl,omitempty"` + StorageContainerURL *string `json:"storageContainerUrl,omitempty"` } diff --git a/resource-manager/batch/2023-05-01/privateendpointconnection/README.md b/resource-manager/batch/2023-05-01/privateendpointconnection/README.md index 2afd83736c6..603243de617 100644 --- a/resource-manager/batch/2023-05-01/privateendpointconnection/README.md +++ b/resource-manager/batch/2023-05-01/privateendpointconnection/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnection.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, privateendpointconnection.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, privateendpointconnection.DefaultListByBatchAccountOperationOptions()) @@ -69,7 +69,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") payload := privateendpointconnection.PrivateEndpointConnection{ // ... diff --git a/resource-manager/batch/2023-05-01/privateendpointconnection/id_batchaccount.go b/resource-manager/batch/2023-05-01/privateendpointconnection/id_batchaccount.go index 61a92df7a34..686c510807f 100644 --- a/resource-manager/batch/2023-05-01/privateendpointconnection/id_batchaccount.go +++ b/resource-manager/batch/2023-05-01/privateendpointconnection/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-05-01/privateendpointconnection/id_batchaccount_test.go b/resource-manager/batch/2023-05-01/privateendpointconnection/id_batchaccount_test.go index 6ab17ef2252..11b7b035660 100644 --- a/resource-manager/batch/2023-05-01/privateendpointconnection/id_batchaccount_test.go +++ b/resource-manager/batch/2023-05-01/privateendpointconnection/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/privateendpointconnection/id_privateendpointconnection.go b/resource-manager/batch/2023-05-01/privateendpointconnection/id_privateendpointconnection.go index a1ecb02d3f6..c8419c90b3a 100644 --- a/resource-manager/batch/2023-05-01/privateendpointconnection/id_privateendpointconnection.go +++ b/resource-manager/batch/2023-05-01/privateendpointconnection/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/batch/2023-05-01/privateendpointconnection/id_privateendpointconnection_test.go b/resource-manager/batch/2023-05-01/privateendpointconnection/id_privateendpointconnection_test.go index 8d7aa4ef65d..c38620f9e86 100644 --- a/resource-manager/batch/2023-05-01/privateendpointconnection/id_privateendpointconnection_test.go +++ b/resource-manager/batch/2023-05-01/privateendpointconnection/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/privatelinkresource/README.md b/resource-manager/batch/2023-05-01/privatelinkresource/README.md index 1ae0bc19451..996e6ada8dd 100644 --- a/resource-manager/batch/2023-05-01/privatelinkresource/README.md +++ b/resource-manager/batch/2023-05-01/privatelinkresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName") +id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresource.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresource.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, privatelinkresource.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, privatelinkresource.DefaultListByBatchAccountOperationOptions()) diff --git a/resource-manager/batch/2023-05-01/privatelinkresource/id_batchaccount.go b/resource-manager/batch/2023-05-01/privatelinkresource/id_batchaccount.go index 13e21417dcb..9bd1aa4df28 100644 --- a/resource-manager/batch/2023-05-01/privatelinkresource/id_batchaccount.go +++ b/resource-manager/batch/2023-05-01/privatelinkresource/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-05-01/privatelinkresource/id_batchaccount_test.go b/resource-manager/batch/2023-05-01/privatelinkresource/id_batchaccount_test.go index c4e8ef7b2d0..55722fd5e6a 100644 --- a/resource-manager/batch/2023-05-01/privatelinkresource/id_batchaccount_test.go +++ b/resource-manager/batch/2023-05-01/privatelinkresource/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-05-01/privatelinkresource/id_privatelinkresource.go b/resource-manager/batch/2023-05-01/privatelinkresource/id_privatelinkresource.go index 24cab96a05e..77d21d6170e 100644 --- a/resource-manager/batch/2023-05-01/privatelinkresource/id_privatelinkresource.go +++ b/resource-manager/batch/2023-05-01/privatelinkresource/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } diff --git a/resource-manager/batch/2023-05-01/privatelinkresource/id_privatelinkresource_test.go b/resource-manager/batch/2023-05-01/privatelinkresource/id_privatelinkresource_test.go index 9a355ce420b..946c94afbec 100644 --- a/resource-manager/batch/2023-05-01/privatelinkresource/id_privatelinkresource_test.go +++ b/resource-manager/batch/2023-05-01/privatelinkresource/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PrivateLinkResourceName != "privateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/application/README.md b/resource-manager/batch/2023-11-01/application/README.md index ebd6132866f..66f6022499a 100644 --- a/resource-manager/batch/2023-11-01/application/README.md +++ b/resource-manager/batch/2023-11-01/application/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") payload := application.Application{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.List(ctx, id, application.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, application.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") payload := application.Application{ // ... diff --git a/resource-manager/batch/2023-11-01/application/id_application.go b/resource-manager/batch/2023-11-01/application/id_application.go index cb94f45793b..7d86ef6c958 100644 --- a/resource-manager/batch/2023-11-01/application/id_application.go +++ b/resource-manager/batch/2023-11-01/application/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/batch/2023-11-01/application/id_application_test.go b/resource-manager/batch/2023-11-01/application/id_application_test.go index edda3b3ac98..256e73ef3a7 100644 --- a/resource-manager/batch/2023-11-01/application/id_application_test.go +++ b/resource-manager/batch/2023-11-01/application/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/application/id_batchaccount.go b/resource-manager/batch/2023-11-01/application/id_batchaccount.go index 308b45d462b..e33350fba90 100644 --- a/resource-manager/batch/2023-11-01/application/id_batchaccount.go +++ b/resource-manager/batch/2023-11-01/application/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-11-01/application/id_batchaccount_test.go b/resource-manager/batch/2023-11-01/application/id_batchaccount_test.go index e209c9e9bfe..767dc437740 100644 --- a/resource-manager/batch/2023-11-01/application/id_batchaccount_test.go +++ b/resource-manager/batch/2023-11-01/application/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/applicationpackage/README.md b/resource-manager/batch/2023-11-01/applicationpackage/README.md index d97ad8d839a..4b0a5091dea 100644 --- a/resource-manager/batch/2023-11-01/applicationpackage/README.md +++ b/resource-manager/batch/2023-11-01/applicationpackage/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") payload := applicationpackage.ActivateApplicationPackageParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") payload := applicationpackage.ApplicationPackage{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := applicationpackage.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") // alternatively `client.List(ctx, id, applicationpackage.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, applicationpackage.DefaultListOperationOptions()) diff --git a/resource-manager/batch/2023-11-01/applicationpackage/id_application.go b/resource-manager/batch/2023-11-01/applicationpackage/id_application.go index 3538ecc3fcc..a27df437364 100644 --- a/resource-manager/batch/2023-11-01/applicationpackage/id_application.go +++ b/resource-manager/batch/2023-11-01/applicationpackage/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/batch/2023-11-01/applicationpackage/id_application_test.go b/resource-manager/batch/2023-11-01/applicationpackage/id_application_test.go index b17fdece35d..f18c35b6d96 100644 --- a/resource-manager/batch/2023-11-01/applicationpackage/id_application_test.go +++ b/resource-manager/batch/2023-11-01/applicationpackage/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/applicationpackage/id_version.go b/resource-manager/batch/2023-11-01/applicationpackage/id_version.go index 67084ea1452..6c50c4461cd 100644 --- a/resource-manager/batch/2023-11-01/applicationpackage/id_version.go +++ b/resource-manager/batch/2023-11-01/applicationpackage/id_version.go @@ -127,7 +127,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), diff --git a/resource-manager/batch/2023-11-01/applicationpackage/id_version_test.go b/resource-manager/batch/2023-11-01/applicationpackage/id_version_test.go index d06257a8f3e..ad8a1a26cb6 100644 --- a/resource-manager/batch/2023-11-01/applicationpackage/id_version_test.go +++ b/resource-manager/batch/2023-11-01/applicationpackage/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewVersionID(t *testing.T) { } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/applicationpackage/model_applicationpackageproperties.go b/resource-manager/batch/2023-11-01/applicationpackage/model_applicationpackageproperties.go index e49cd1f1a80..a3e08bb9c00 100644 --- a/resource-manager/batch/2023-11-01/applicationpackage/model_applicationpackageproperties.go +++ b/resource-manager/batch/2023-11-01/applicationpackage/model_applicationpackageproperties.go @@ -13,8 +13,8 @@ type ApplicationPackageProperties struct { Format *string `json:"format,omitempty"` LastActivationTime *string `json:"lastActivationTime,omitempty"` State *PackageState `json:"state,omitempty"` - StorageUrl *string `json:"storageUrl,omitempty"` - StorageUrlExpiry *string `json:"storageUrlExpiry,omitempty"` + StorageURL *string `json:"storageUrl,omitempty"` + StorageURLExpiry *string `json:"storageUrlExpiry,omitempty"` } func (o *ApplicationPackageProperties) GetLastActivationTimeAsTime() (*time.Time, error) { @@ -29,14 +29,14 @@ func (o *ApplicationPackageProperties) SetLastActivationTimeAsTime(input time.Ti o.LastActivationTime = &formatted } -func (o *ApplicationPackageProperties) GetStorageUrlExpiryAsTime() (*time.Time, error) { - if o.StorageUrlExpiry == nil { +func (o *ApplicationPackageProperties) GetStorageURLExpiryAsTime() (*time.Time, error) { + if o.StorageURLExpiry == nil { return nil, nil } - return dates.ParseAsFormat(o.StorageUrlExpiry, "2006-01-02T15:04:05Z07:00") + return dates.ParseAsFormat(o.StorageURLExpiry, "2006-01-02T15:04:05Z07:00") } -func (o *ApplicationPackageProperties) SetStorageUrlExpiryAsTime(input time.Time) { +func (o *ApplicationPackageProperties) SetStorageURLExpiryAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StorageUrlExpiry = &formatted + o.StorageURLExpiry = &formatted } diff --git a/resource-manager/batch/2023-11-01/batchaccount/README.md b/resource-manager/batch/2023-11-01/batchaccount/README.md index b83f8b5b688..b351ad00e40 100644 --- a/resource-manager/batch/2023-11-01/batchaccount/README.md +++ b/resource-manager/batch/2023-11-01/batchaccount/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountCreateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.GetKeys(ctx, id) if err != nil { @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) @@ -137,7 +137,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountRegenerateKeyParameters{ // ... @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.SynchronizeAutoStorageKeys(ctx, id) if err != nil { @@ -174,7 +174,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountUpdateParameters{ // ... diff --git a/resource-manager/batch/2023-11-01/batchaccount/id_batchaccount.go b/resource-manager/batch/2023-11-01/batchaccount/id_batchaccount.go index 3aed3534630..40f8fee2fa0 100644 --- a/resource-manager/batch/2023-11-01/batchaccount/id_batchaccount.go +++ b/resource-manager/batch/2023-11-01/batchaccount/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-11-01/batchaccount/id_batchaccount_test.go b/resource-manager/batch/2023-11-01/batchaccount/id_batchaccount_test.go index dd150171fbc..e279a3b5cbf 100644 --- a/resource-manager/batch/2023-11-01/batchaccount/id_batchaccount_test.go +++ b/resource-manager/batch/2023-11-01/batchaccount/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/batchmanagements/README.md b/resource-manager/batch/2023-11-01/batchmanagements/README.md index 5b77e615ff6..140c7648c0e 100644 --- a/resource-manager/batch/2023-11-01/batchmanagements/README.md +++ b/resource-manager/batch/2023-11-01/batchmanagements/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchmanagements.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId") +id := batchmanagements.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId") read, err := client.BatchAccountGetDetector(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchmanagements.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchmanagements.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.BatchAccountListDetectors(ctx, id)` can be used to do batched pagination items, err := client.BatchAccountListDetectorsComplete(ctx, id) diff --git a/resource-manager/batch/2023-11-01/batchmanagements/id_batchaccount.go b/resource-manager/batch/2023-11-01/batchmanagements/id_batchaccount.go index c0de828cf69..990b7377b69 100644 --- a/resource-manager/batch/2023-11-01/batchmanagements/id_batchaccount.go +++ b/resource-manager/batch/2023-11-01/batchmanagements/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-11-01/batchmanagements/id_batchaccount_test.go b/resource-manager/batch/2023-11-01/batchmanagements/id_batchaccount_test.go index 1f445bf51c6..dc5efb236d7 100644 --- a/resource-manager/batch/2023-11-01/batchmanagements/id_batchaccount_test.go +++ b/resource-manager/batch/2023-11-01/batchmanagements/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/batchmanagements/id_detector.go b/resource-manager/batch/2023-11-01/batchmanagements/id_detector.go index 87ff01264a1..19b75f4839b 100644 --- a/resource-manager/batch/2023-11-01/batchmanagements/id_detector.go +++ b/resource-manager/batch/2023-11-01/batchmanagements/id_detector.go @@ -121,7 +121,7 @@ func (id DetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorId", "detectorId"), } diff --git a/resource-manager/batch/2023-11-01/batchmanagements/id_detector_test.go b/resource-manager/batch/2023-11-01/batchmanagements/id_detector_test.go index 6f07aac8a22..b7e87bab0f3 100644 --- a/resource-manager/batch/2023-11-01/batchmanagements/id_detector_test.go +++ b/resource-manager/batch/2023-11-01/batchmanagements/id_detector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DetectorId{} func TestNewDetectorID(t *testing.T) { - id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId") + id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.DetectorId != "detectorId" { @@ -32,8 +32,8 @@ func TestNewDetectorID(t *testing.T) { } func TestFormatDetectorID(t *testing.T) { - actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId" + actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", DetectorId: "detectorId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", DetectorId: "detectorId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs/dEtEcToRiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs/dEtEcToRiD", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", DetectorId: "dEtEcToRiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs/dEtEcToRiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs/dEtEcToRiD/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/certificate/README.md b/resource-manager/batch/2023-11-01/certificate/README.md index 90afebb1c47..04f9332ae6c 100644 --- a/resource-manager/batch/2023-11-01/certificate/README.md +++ b/resource-manager/batch/2023-11-01/certificate/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") read, err := client.CancelDeletion(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") payload := certificate.CertificateCreateOrUpdateParameters{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -73,7 +73,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := certificate.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, certificate.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, certificate.DefaultListByBatchAccountOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") payload := certificate.CertificateCreateOrUpdateParameters{ // ... diff --git a/resource-manager/batch/2023-11-01/certificate/id_batchaccount.go b/resource-manager/batch/2023-11-01/certificate/id_batchaccount.go index 2408b63af1f..4acb2c09d7a 100644 --- a/resource-manager/batch/2023-11-01/certificate/id_batchaccount.go +++ b/resource-manager/batch/2023-11-01/certificate/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-11-01/certificate/id_batchaccount_test.go b/resource-manager/batch/2023-11-01/certificate/id_batchaccount_test.go index 9edb9b2c70f..ec23edd8872 100644 --- a/resource-manager/batch/2023-11-01/certificate/id_batchaccount_test.go +++ b/resource-manager/batch/2023-11-01/certificate/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/certificate/id_certificate.go b/resource-manager/batch/2023-11-01/certificate/id_certificate.go index 4e57e868efe..8c16320b58b 100644 --- a/resource-manager/batch/2023-11-01/certificate/id_certificate.go +++ b/resource-manager/batch/2023-11-01/certificate/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/batch/2023-11-01/certificate/id_certificate_test.go b/resource-manager/batch/2023-11-01/certificate/id_certificate_test.go index d505e287161..60f6258d46a 100644 --- a/resource-manager/batch/2023-11-01/certificate/id_certificate_test.go +++ b/resource-manager/batch/2023-11-01/certificate/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/pool/README.md b/resource-manager/batch/2023-11-01/pool/README.md index f72f047ea4a..fb5f626daf6 100644 --- a/resource-manager/batch/2023-11-01/pool/README.md +++ b/resource-manager/batch/2023-11-01/pool/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") payload := pool.Pool{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.DisableAutoScale(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := pool.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, pool.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, pool.DefaultListByBatchAccountOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.StopResize(ctx, id) if err != nil { @@ -122,7 +122,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") payload := pool.Pool{ // ... diff --git a/resource-manager/batch/2023-11-01/pool/id_batchaccount.go b/resource-manager/batch/2023-11-01/pool/id_batchaccount.go index 3cf0013a05d..9c419de2dca 100644 --- a/resource-manager/batch/2023-11-01/pool/id_batchaccount.go +++ b/resource-manager/batch/2023-11-01/pool/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-11-01/pool/id_batchaccount_test.go b/resource-manager/batch/2023-11-01/pool/id_batchaccount_test.go index dd6178079e5..85b207ea3d8 100644 --- a/resource-manager/batch/2023-11-01/pool/id_batchaccount_test.go +++ b/resource-manager/batch/2023-11-01/pool/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/pool/id_pool.go b/resource-manager/batch/2023-11-01/pool/id_pool.go index d9b835e8179..25e8665345f 100644 --- a/resource-manager/batch/2023-11-01/pool/id_pool.go +++ b/resource-manager/batch/2023-11-01/pool/id_pool.go @@ -121,7 +121,7 @@ func (id PoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPools", "pools", "pools"), resourceids.UserSpecifiedSegment("poolName", "poolName"), } diff --git a/resource-manager/batch/2023-11-01/pool/id_pool_test.go b/resource-manager/batch/2023-11-01/pool/id_pool_test.go index 63bb4dd01dc..2caaba8195c 100644 --- a/resource-manager/batch/2023-11-01/pool/id_pool_test.go +++ b/resource-manager/batch/2023-11-01/pool/id_pool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PoolId{} func TestNewPoolID(t *testing.T) { - id := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PoolName != "poolName" { @@ -32,8 +32,8 @@ func TestNewPoolID(t *testing.T) { } func TestFormatPoolID(t *testing.T) { - actual := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName" + actual := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PoolName: "poolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PoolName: "poolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs/pOoLnAmE", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PoolName: "pOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs/pOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/pool/model_azurefileshareconfiguration.go b/resource-manager/batch/2023-11-01/pool/model_azurefileshareconfiguration.go index 910a385e4b8..7ae87358d03 100644 --- a/resource-manager/batch/2023-11-01/pool/model_azurefileshareconfiguration.go +++ b/resource-manager/batch/2023-11-01/pool/model_azurefileshareconfiguration.go @@ -6,7 +6,7 @@ package pool type AzureFileShareConfiguration struct { AccountKey string `json:"accountKey"` AccountName string `json:"accountName"` - AzureFileUrl string `json:"azureFileUrl"` + AzureFileURL string `json:"azureFileUrl"` MountOptions *string `json:"mountOptions,omitempty"` RelativeMountPath string `json:"relativeMountPath"` } diff --git a/resource-manager/batch/2023-11-01/pool/model_resourcefile.go b/resource-manager/batch/2023-11-01/pool/model_resourcefile.go index 9eddccfb1ed..00eb0fef9b2 100644 --- a/resource-manager/batch/2023-11-01/pool/model_resourcefile.go +++ b/resource-manager/batch/2023-11-01/pool/model_resourcefile.go @@ -8,7 +8,7 @@ type ResourceFile struct { BlobPrefix *string `json:"blobPrefix,omitempty"` FileMode *string `json:"fileMode,omitempty"` FilePath *string `json:"filePath,omitempty"` - HTTPUrl *string `json:"httpUrl,omitempty"` + HTTPURL *string `json:"httpUrl,omitempty"` IdentityReference *ComputeNodeIdentityReference `json:"identityReference,omitempty"` - StorageContainerUrl *string `json:"storageContainerUrl,omitempty"` + StorageContainerURL *string `json:"storageContainerUrl,omitempty"` } diff --git a/resource-manager/batch/2023-11-01/privateendpointconnection/README.md b/resource-manager/batch/2023-11-01/privateendpointconnection/README.md index 5ed1af660f6..573cd930436 100644 --- a/resource-manager/batch/2023-11-01/privateendpointconnection/README.md +++ b/resource-manager/batch/2023-11-01/privateendpointconnection/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnection.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, privateendpointconnection.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, privateendpointconnection.DefaultListByBatchAccountOperationOptions()) @@ -69,7 +69,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") payload := privateendpointconnection.PrivateEndpointConnection{ // ... diff --git a/resource-manager/batch/2023-11-01/privateendpointconnection/id_batchaccount.go b/resource-manager/batch/2023-11-01/privateendpointconnection/id_batchaccount.go index 61a92df7a34..686c510807f 100644 --- a/resource-manager/batch/2023-11-01/privateendpointconnection/id_batchaccount.go +++ b/resource-manager/batch/2023-11-01/privateendpointconnection/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-11-01/privateendpointconnection/id_batchaccount_test.go b/resource-manager/batch/2023-11-01/privateendpointconnection/id_batchaccount_test.go index 6ab17ef2252..11b7b035660 100644 --- a/resource-manager/batch/2023-11-01/privateendpointconnection/id_batchaccount_test.go +++ b/resource-manager/batch/2023-11-01/privateendpointconnection/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/privateendpointconnection/id_privateendpointconnection.go b/resource-manager/batch/2023-11-01/privateendpointconnection/id_privateendpointconnection.go index a1ecb02d3f6..c8419c90b3a 100644 --- a/resource-manager/batch/2023-11-01/privateendpointconnection/id_privateendpointconnection.go +++ b/resource-manager/batch/2023-11-01/privateendpointconnection/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/batch/2023-11-01/privateendpointconnection/id_privateendpointconnection_test.go b/resource-manager/batch/2023-11-01/privateendpointconnection/id_privateendpointconnection_test.go index 8d7aa4ef65d..c38620f9e86 100644 --- a/resource-manager/batch/2023-11-01/privateendpointconnection/id_privateendpointconnection_test.go +++ b/resource-manager/batch/2023-11-01/privateendpointconnection/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/privatelinkresource/README.md b/resource-manager/batch/2023-11-01/privatelinkresource/README.md index 889f16667eb..f84f665c8cc 100644 --- a/resource-manager/batch/2023-11-01/privatelinkresource/README.md +++ b/resource-manager/batch/2023-11-01/privatelinkresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName") +id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresource.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresource.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, privatelinkresource.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, privatelinkresource.DefaultListByBatchAccountOperationOptions()) diff --git a/resource-manager/batch/2023-11-01/privatelinkresource/id_batchaccount.go b/resource-manager/batch/2023-11-01/privatelinkresource/id_batchaccount.go index 13e21417dcb..9bd1aa4df28 100644 --- a/resource-manager/batch/2023-11-01/privatelinkresource/id_batchaccount.go +++ b/resource-manager/batch/2023-11-01/privatelinkresource/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2023-11-01/privatelinkresource/id_batchaccount_test.go b/resource-manager/batch/2023-11-01/privatelinkresource/id_batchaccount_test.go index c4e8ef7b2d0..55722fd5e6a 100644 --- a/resource-manager/batch/2023-11-01/privatelinkresource/id_batchaccount_test.go +++ b/resource-manager/batch/2023-11-01/privatelinkresource/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2023-11-01/privatelinkresource/id_privatelinkresource.go b/resource-manager/batch/2023-11-01/privatelinkresource/id_privatelinkresource.go index 24cab96a05e..77d21d6170e 100644 --- a/resource-manager/batch/2023-11-01/privatelinkresource/id_privatelinkresource.go +++ b/resource-manager/batch/2023-11-01/privatelinkresource/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } diff --git a/resource-manager/batch/2023-11-01/privatelinkresource/id_privatelinkresource_test.go b/resource-manager/batch/2023-11-01/privatelinkresource/id_privatelinkresource_test.go index 9a355ce420b..946c94afbec 100644 --- a/resource-manager/batch/2023-11-01/privatelinkresource/id_privatelinkresource_test.go +++ b/resource-manager/batch/2023-11-01/privatelinkresource/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PrivateLinkResourceName != "privateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/application/README.md b/resource-manager/batch/2024-02-01/application/README.md index 1b6185f14c9..cb92aa34c03 100644 --- a/resource-manager/batch/2024-02-01/application/README.md +++ b/resource-manager/batch/2024-02-01/application/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") payload := application.Application{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.List(ctx, id, application.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, application.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") payload := application.Application{ // ... diff --git a/resource-manager/batch/2024-02-01/application/id_application.go b/resource-manager/batch/2024-02-01/application/id_application.go index cb94f45793b..7d86ef6c958 100644 --- a/resource-manager/batch/2024-02-01/application/id_application.go +++ b/resource-manager/batch/2024-02-01/application/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/batch/2024-02-01/application/id_application_test.go b/resource-manager/batch/2024-02-01/application/id_application_test.go index edda3b3ac98..256e73ef3a7 100644 --- a/resource-manager/batch/2024-02-01/application/id_application_test.go +++ b/resource-manager/batch/2024-02-01/application/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/application/id_batchaccount.go b/resource-manager/batch/2024-02-01/application/id_batchaccount.go index 308b45d462b..e33350fba90 100644 --- a/resource-manager/batch/2024-02-01/application/id_batchaccount.go +++ b/resource-manager/batch/2024-02-01/application/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-02-01/application/id_batchaccount_test.go b/resource-manager/batch/2024-02-01/application/id_batchaccount_test.go index e209c9e9bfe..767dc437740 100644 --- a/resource-manager/batch/2024-02-01/application/id_batchaccount_test.go +++ b/resource-manager/batch/2024-02-01/application/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/applicationpackage/README.md b/resource-manager/batch/2024-02-01/applicationpackage/README.md index e2e7bd96b1e..889de54b7a0 100644 --- a/resource-manager/batch/2024-02-01/applicationpackage/README.md +++ b/resource-manager/batch/2024-02-01/applicationpackage/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") payload := applicationpackage.ActivateApplicationPackageParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") payload := applicationpackage.ApplicationPackage{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := applicationpackage.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") // alternatively `client.List(ctx, id, applicationpackage.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, applicationpackage.DefaultListOperationOptions()) diff --git a/resource-manager/batch/2024-02-01/applicationpackage/id_application.go b/resource-manager/batch/2024-02-01/applicationpackage/id_application.go index 3538ecc3fcc..a27df437364 100644 --- a/resource-manager/batch/2024-02-01/applicationpackage/id_application.go +++ b/resource-manager/batch/2024-02-01/applicationpackage/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/batch/2024-02-01/applicationpackage/id_application_test.go b/resource-manager/batch/2024-02-01/applicationpackage/id_application_test.go index b17fdece35d..f18c35b6d96 100644 --- a/resource-manager/batch/2024-02-01/applicationpackage/id_application_test.go +++ b/resource-manager/batch/2024-02-01/applicationpackage/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/applicationpackage/id_version.go b/resource-manager/batch/2024-02-01/applicationpackage/id_version.go index 67084ea1452..6c50c4461cd 100644 --- a/resource-manager/batch/2024-02-01/applicationpackage/id_version.go +++ b/resource-manager/batch/2024-02-01/applicationpackage/id_version.go @@ -127,7 +127,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), diff --git a/resource-manager/batch/2024-02-01/applicationpackage/id_version_test.go b/resource-manager/batch/2024-02-01/applicationpackage/id_version_test.go index d06257a8f3e..ad8a1a26cb6 100644 --- a/resource-manager/batch/2024-02-01/applicationpackage/id_version_test.go +++ b/resource-manager/batch/2024-02-01/applicationpackage/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewVersionID(t *testing.T) { } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/applicationpackage/model_applicationpackageproperties.go b/resource-manager/batch/2024-02-01/applicationpackage/model_applicationpackageproperties.go index e49cd1f1a80..a3e08bb9c00 100644 --- a/resource-manager/batch/2024-02-01/applicationpackage/model_applicationpackageproperties.go +++ b/resource-manager/batch/2024-02-01/applicationpackage/model_applicationpackageproperties.go @@ -13,8 +13,8 @@ type ApplicationPackageProperties struct { Format *string `json:"format,omitempty"` LastActivationTime *string `json:"lastActivationTime,omitempty"` State *PackageState `json:"state,omitempty"` - StorageUrl *string `json:"storageUrl,omitempty"` - StorageUrlExpiry *string `json:"storageUrlExpiry,omitempty"` + StorageURL *string `json:"storageUrl,omitempty"` + StorageURLExpiry *string `json:"storageUrlExpiry,omitempty"` } func (o *ApplicationPackageProperties) GetLastActivationTimeAsTime() (*time.Time, error) { @@ -29,14 +29,14 @@ func (o *ApplicationPackageProperties) SetLastActivationTimeAsTime(input time.Ti o.LastActivationTime = &formatted } -func (o *ApplicationPackageProperties) GetStorageUrlExpiryAsTime() (*time.Time, error) { - if o.StorageUrlExpiry == nil { +func (o *ApplicationPackageProperties) GetStorageURLExpiryAsTime() (*time.Time, error) { + if o.StorageURLExpiry == nil { return nil, nil } - return dates.ParseAsFormat(o.StorageUrlExpiry, "2006-01-02T15:04:05Z07:00") + return dates.ParseAsFormat(o.StorageURLExpiry, "2006-01-02T15:04:05Z07:00") } -func (o *ApplicationPackageProperties) SetStorageUrlExpiryAsTime(input time.Time) { +func (o *ApplicationPackageProperties) SetStorageURLExpiryAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StorageUrlExpiry = &formatted + o.StorageURLExpiry = &formatted } diff --git a/resource-manager/batch/2024-02-01/batchaccount/README.md b/resource-manager/batch/2024-02-01/batchaccount/README.md index b1a3d81d7e0..51aa4863bad 100644 --- a/resource-manager/batch/2024-02-01/batchaccount/README.md +++ b/resource-manager/batch/2024-02-01/batchaccount/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountCreateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.GetKeys(ctx, id) if err != nil { @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) @@ -137,7 +137,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountRegenerateKeyParameters{ // ... @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.SynchronizeAutoStorageKeys(ctx, id) if err != nil { @@ -174,7 +174,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountUpdateParameters{ // ... diff --git a/resource-manager/batch/2024-02-01/batchaccount/id_batchaccount.go b/resource-manager/batch/2024-02-01/batchaccount/id_batchaccount.go index 3aed3534630..40f8fee2fa0 100644 --- a/resource-manager/batch/2024-02-01/batchaccount/id_batchaccount.go +++ b/resource-manager/batch/2024-02-01/batchaccount/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-02-01/batchaccount/id_batchaccount_test.go b/resource-manager/batch/2024-02-01/batchaccount/id_batchaccount_test.go index dd150171fbc..e279a3b5cbf 100644 --- a/resource-manager/batch/2024-02-01/batchaccount/id_batchaccount_test.go +++ b/resource-manager/batch/2024-02-01/batchaccount/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/batchmanagements/README.md b/resource-manager/batch/2024-02-01/batchmanagements/README.md index 1e8d25d9d92..6aa746c0630 100644 --- a/resource-manager/batch/2024-02-01/batchmanagements/README.md +++ b/resource-manager/batch/2024-02-01/batchmanagements/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchmanagements.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId") +id := batchmanagements.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId") read, err := client.BatchAccountGetDetector(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchmanagements.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchmanagements.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.BatchAccountListDetectors(ctx, id)` can be used to do batched pagination items, err := client.BatchAccountListDetectorsComplete(ctx, id) diff --git a/resource-manager/batch/2024-02-01/batchmanagements/id_batchaccount.go b/resource-manager/batch/2024-02-01/batchmanagements/id_batchaccount.go index c0de828cf69..990b7377b69 100644 --- a/resource-manager/batch/2024-02-01/batchmanagements/id_batchaccount.go +++ b/resource-manager/batch/2024-02-01/batchmanagements/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-02-01/batchmanagements/id_batchaccount_test.go b/resource-manager/batch/2024-02-01/batchmanagements/id_batchaccount_test.go index 1f445bf51c6..dc5efb236d7 100644 --- a/resource-manager/batch/2024-02-01/batchmanagements/id_batchaccount_test.go +++ b/resource-manager/batch/2024-02-01/batchmanagements/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/batchmanagements/id_detector.go b/resource-manager/batch/2024-02-01/batchmanagements/id_detector.go index 87ff01264a1..19b75f4839b 100644 --- a/resource-manager/batch/2024-02-01/batchmanagements/id_detector.go +++ b/resource-manager/batch/2024-02-01/batchmanagements/id_detector.go @@ -121,7 +121,7 @@ func (id DetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorId", "detectorId"), } diff --git a/resource-manager/batch/2024-02-01/batchmanagements/id_detector_test.go b/resource-manager/batch/2024-02-01/batchmanagements/id_detector_test.go index 6f07aac8a22..b7e87bab0f3 100644 --- a/resource-manager/batch/2024-02-01/batchmanagements/id_detector_test.go +++ b/resource-manager/batch/2024-02-01/batchmanagements/id_detector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DetectorId{} func TestNewDetectorID(t *testing.T) { - id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId") + id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.DetectorId != "detectorId" { @@ -32,8 +32,8 @@ func TestNewDetectorID(t *testing.T) { } func TestFormatDetectorID(t *testing.T) { - actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId" + actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", DetectorId: "detectorId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", DetectorId: "detectorId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs/dEtEcToRiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs/dEtEcToRiD", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", DetectorId: "dEtEcToRiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs/dEtEcToRiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs/dEtEcToRiD/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/certificate/README.md b/resource-manager/batch/2024-02-01/certificate/README.md index d0a1fa269ff..1dffb6f9252 100644 --- a/resource-manager/batch/2024-02-01/certificate/README.md +++ b/resource-manager/batch/2024-02-01/certificate/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") read, err := client.CancelDeletion(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") payload := certificate.CertificateCreateOrUpdateParameters{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -73,7 +73,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := certificate.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, certificate.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, certificate.DefaultListByBatchAccountOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") payload := certificate.CertificateCreateOrUpdateParameters{ // ... diff --git a/resource-manager/batch/2024-02-01/certificate/id_batchaccount.go b/resource-manager/batch/2024-02-01/certificate/id_batchaccount.go index 2408b63af1f..4acb2c09d7a 100644 --- a/resource-manager/batch/2024-02-01/certificate/id_batchaccount.go +++ b/resource-manager/batch/2024-02-01/certificate/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-02-01/certificate/id_batchaccount_test.go b/resource-manager/batch/2024-02-01/certificate/id_batchaccount_test.go index 9edb9b2c70f..ec23edd8872 100644 --- a/resource-manager/batch/2024-02-01/certificate/id_batchaccount_test.go +++ b/resource-manager/batch/2024-02-01/certificate/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/certificate/id_certificate.go b/resource-manager/batch/2024-02-01/certificate/id_certificate.go index 4e57e868efe..8c16320b58b 100644 --- a/resource-manager/batch/2024-02-01/certificate/id_certificate.go +++ b/resource-manager/batch/2024-02-01/certificate/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/batch/2024-02-01/certificate/id_certificate_test.go b/resource-manager/batch/2024-02-01/certificate/id_certificate_test.go index d505e287161..60f6258d46a 100644 --- a/resource-manager/batch/2024-02-01/certificate/id_certificate_test.go +++ b/resource-manager/batch/2024-02-01/certificate/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/pool/README.md b/resource-manager/batch/2024-02-01/pool/README.md index 3884107c719..b0b9aae7e83 100644 --- a/resource-manager/batch/2024-02-01/pool/README.md +++ b/resource-manager/batch/2024-02-01/pool/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") payload := pool.Pool{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.DisableAutoScale(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := pool.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, pool.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, pool.DefaultListByBatchAccountOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.StopResize(ctx, id) if err != nil { @@ -122,7 +122,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") payload := pool.Pool{ // ... diff --git a/resource-manager/batch/2024-02-01/pool/id_batchaccount.go b/resource-manager/batch/2024-02-01/pool/id_batchaccount.go index 3cf0013a05d..9c419de2dca 100644 --- a/resource-manager/batch/2024-02-01/pool/id_batchaccount.go +++ b/resource-manager/batch/2024-02-01/pool/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-02-01/pool/id_batchaccount_test.go b/resource-manager/batch/2024-02-01/pool/id_batchaccount_test.go index dd6178079e5..85b207ea3d8 100644 --- a/resource-manager/batch/2024-02-01/pool/id_batchaccount_test.go +++ b/resource-manager/batch/2024-02-01/pool/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/pool/id_pool.go b/resource-manager/batch/2024-02-01/pool/id_pool.go index d9b835e8179..25e8665345f 100644 --- a/resource-manager/batch/2024-02-01/pool/id_pool.go +++ b/resource-manager/batch/2024-02-01/pool/id_pool.go @@ -121,7 +121,7 @@ func (id PoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPools", "pools", "pools"), resourceids.UserSpecifiedSegment("poolName", "poolName"), } diff --git a/resource-manager/batch/2024-02-01/pool/id_pool_test.go b/resource-manager/batch/2024-02-01/pool/id_pool_test.go index 63bb4dd01dc..2caaba8195c 100644 --- a/resource-manager/batch/2024-02-01/pool/id_pool_test.go +++ b/resource-manager/batch/2024-02-01/pool/id_pool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PoolId{} func TestNewPoolID(t *testing.T) { - id := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PoolName != "poolName" { @@ -32,8 +32,8 @@ func TestNewPoolID(t *testing.T) { } func TestFormatPoolID(t *testing.T) { - actual := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName" + actual := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PoolName: "poolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PoolName: "poolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs/pOoLnAmE", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PoolName: "pOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs/pOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/pool/model_azurefileshareconfiguration.go b/resource-manager/batch/2024-02-01/pool/model_azurefileshareconfiguration.go index 910a385e4b8..7ae87358d03 100644 --- a/resource-manager/batch/2024-02-01/pool/model_azurefileshareconfiguration.go +++ b/resource-manager/batch/2024-02-01/pool/model_azurefileshareconfiguration.go @@ -6,7 +6,7 @@ package pool type AzureFileShareConfiguration struct { AccountKey string `json:"accountKey"` AccountName string `json:"accountName"` - AzureFileUrl string `json:"azureFileUrl"` + AzureFileURL string `json:"azureFileUrl"` MountOptions *string `json:"mountOptions,omitempty"` RelativeMountPath string `json:"relativeMountPath"` } diff --git a/resource-manager/batch/2024-02-01/pool/model_resourcefile.go b/resource-manager/batch/2024-02-01/pool/model_resourcefile.go index 9eddccfb1ed..00eb0fef9b2 100644 --- a/resource-manager/batch/2024-02-01/pool/model_resourcefile.go +++ b/resource-manager/batch/2024-02-01/pool/model_resourcefile.go @@ -8,7 +8,7 @@ type ResourceFile struct { BlobPrefix *string `json:"blobPrefix,omitempty"` FileMode *string `json:"fileMode,omitempty"` FilePath *string `json:"filePath,omitempty"` - HTTPUrl *string `json:"httpUrl,omitempty"` + HTTPURL *string `json:"httpUrl,omitempty"` IdentityReference *ComputeNodeIdentityReference `json:"identityReference,omitempty"` - StorageContainerUrl *string `json:"storageContainerUrl,omitempty"` + StorageContainerURL *string `json:"storageContainerUrl,omitempty"` } diff --git a/resource-manager/batch/2024-02-01/privateendpointconnection/README.md b/resource-manager/batch/2024-02-01/privateendpointconnection/README.md index 8a53387dbd7..92619a1ca5c 100644 --- a/resource-manager/batch/2024-02-01/privateendpointconnection/README.md +++ b/resource-manager/batch/2024-02-01/privateendpointconnection/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnection.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, privateendpointconnection.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, privateendpointconnection.DefaultListByBatchAccountOperationOptions()) @@ -69,7 +69,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") payload := privateendpointconnection.PrivateEndpointConnection{ // ... diff --git a/resource-manager/batch/2024-02-01/privateendpointconnection/id_batchaccount.go b/resource-manager/batch/2024-02-01/privateendpointconnection/id_batchaccount.go index 61a92df7a34..686c510807f 100644 --- a/resource-manager/batch/2024-02-01/privateendpointconnection/id_batchaccount.go +++ b/resource-manager/batch/2024-02-01/privateendpointconnection/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-02-01/privateendpointconnection/id_batchaccount_test.go b/resource-manager/batch/2024-02-01/privateendpointconnection/id_batchaccount_test.go index 6ab17ef2252..11b7b035660 100644 --- a/resource-manager/batch/2024-02-01/privateendpointconnection/id_batchaccount_test.go +++ b/resource-manager/batch/2024-02-01/privateendpointconnection/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/privateendpointconnection/id_privateendpointconnection.go b/resource-manager/batch/2024-02-01/privateendpointconnection/id_privateendpointconnection.go index a1ecb02d3f6..c8419c90b3a 100644 --- a/resource-manager/batch/2024-02-01/privateendpointconnection/id_privateendpointconnection.go +++ b/resource-manager/batch/2024-02-01/privateendpointconnection/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/batch/2024-02-01/privateendpointconnection/id_privateendpointconnection_test.go b/resource-manager/batch/2024-02-01/privateendpointconnection/id_privateendpointconnection_test.go index 8d7aa4ef65d..c38620f9e86 100644 --- a/resource-manager/batch/2024-02-01/privateendpointconnection/id_privateendpointconnection_test.go +++ b/resource-manager/batch/2024-02-01/privateendpointconnection/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/privatelinkresource/README.md b/resource-manager/batch/2024-02-01/privatelinkresource/README.md index 6f5f1cb3525..1c6ca6c6b91 100644 --- a/resource-manager/batch/2024-02-01/privatelinkresource/README.md +++ b/resource-manager/batch/2024-02-01/privatelinkresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName") +id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresource.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresource.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, privatelinkresource.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, privatelinkresource.DefaultListByBatchAccountOperationOptions()) diff --git a/resource-manager/batch/2024-02-01/privatelinkresource/id_batchaccount.go b/resource-manager/batch/2024-02-01/privatelinkresource/id_batchaccount.go index 13e21417dcb..9bd1aa4df28 100644 --- a/resource-manager/batch/2024-02-01/privatelinkresource/id_batchaccount.go +++ b/resource-manager/batch/2024-02-01/privatelinkresource/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-02-01/privatelinkresource/id_batchaccount_test.go b/resource-manager/batch/2024-02-01/privatelinkresource/id_batchaccount_test.go index c4e8ef7b2d0..55722fd5e6a 100644 --- a/resource-manager/batch/2024-02-01/privatelinkresource/id_batchaccount_test.go +++ b/resource-manager/batch/2024-02-01/privatelinkresource/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-02-01/privatelinkresource/id_privatelinkresource.go b/resource-manager/batch/2024-02-01/privatelinkresource/id_privatelinkresource.go index 24cab96a05e..77d21d6170e 100644 --- a/resource-manager/batch/2024-02-01/privatelinkresource/id_privatelinkresource.go +++ b/resource-manager/batch/2024-02-01/privatelinkresource/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } diff --git a/resource-manager/batch/2024-02-01/privatelinkresource/id_privatelinkresource_test.go b/resource-manager/batch/2024-02-01/privatelinkresource/id_privatelinkresource_test.go index 9a355ce420b..946c94afbec 100644 --- a/resource-manager/batch/2024-02-01/privatelinkresource/id_privatelinkresource_test.go +++ b/resource-manager/batch/2024-02-01/privatelinkresource/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PrivateLinkResourceName != "privateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/application/README.md b/resource-manager/batch/2024-07-01/application/README.md index 8c1af90ba5f..10d77d1dc07 100644 --- a/resource-manager/batch/2024-07-01/application/README.md +++ b/resource-manager/batch/2024-07-01/application/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") payload := application.Application{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := application.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.List(ctx, id, application.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, application.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") payload := application.Application{ // ... diff --git a/resource-manager/batch/2024-07-01/application/id_application.go b/resource-manager/batch/2024-07-01/application/id_application.go index cb94f45793b..7d86ef6c958 100644 --- a/resource-manager/batch/2024-07-01/application/id_application.go +++ b/resource-manager/batch/2024-07-01/application/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/batch/2024-07-01/application/id_application_test.go b/resource-manager/batch/2024-07-01/application/id_application_test.go index edda3b3ac98..256e73ef3a7 100644 --- a/resource-manager/batch/2024-07-01/application/id_application_test.go +++ b/resource-manager/batch/2024-07-01/application/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/application/id_batchaccount.go b/resource-manager/batch/2024-07-01/application/id_batchaccount.go index 308b45d462b..e33350fba90 100644 --- a/resource-manager/batch/2024-07-01/application/id_batchaccount.go +++ b/resource-manager/batch/2024-07-01/application/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-07-01/application/id_batchaccount_test.go b/resource-manager/batch/2024-07-01/application/id_batchaccount_test.go index e209c9e9bfe..767dc437740 100644 --- a/resource-manager/batch/2024-07-01/application/id_batchaccount_test.go +++ b/resource-manager/batch/2024-07-01/application/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/applicationpackage/README.md b/resource-manager/batch/2024-07-01/applicationpackage/README.md index 8b987d61871..74ae173c84c 100644 --- a/resource-manager/batch/2024-07-01/applicationpackage/README.md +++ b/resource-manager/batch/2024-07-01/applicationpackage/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") payload := applicationpackage.ActivateApplicationPackageParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") payload := applicationpackage.ApplicationPackage{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") +id := applicationpackage.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationpackage.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") +id := applicationpackage.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") // alternatively `client.List(ctx, id, applicationpackage.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, applicationpackage.DefaultListOperationOptions()) diff --git a/resource-manager/batch/2024-07-01/applicationpackage/id_application.go b/resource-manager/batch/2024-07-01/applicationpackage/id_application.go index 3538ecc3fcc..a27df437364 100644 --- a/resource-manager/batch/2024-07-01/applicationpackage/id_application.go +++ b/resource-manager/batch/2024-07-01/applicationpackage/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/batch/2024-07-01/applicationpackage/id_application_test.go b/resource-manager/batch/2024-07-01/applicationpackage/id_application_test.go index b17fdece35d..f18c35b6d96 100644 --- a/resource-manager/batch/2024-07-01/applicationpackage/id_application_test.go +++ b/resource-manager/batch/2024-07-01/applicationpackage/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/applicationpackage/id_version.go b/resource-manager/batch/2024-07-01/applicationpackage/id_version.go index 67084ea1452..6c50c4461cd 100644 --- a/resource-manager/batch/2024-07-01/applicationpackage/id_version.go +++ b/resource-manager/batch/2024-07-01/applicationpackage/id_version.go @@ -127,7 +127,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), diff --git a/resource-manager/batch/2024-07-01/applicationpackage/id_version_test.go b/resource-manager/batch/2024-07-01/applicationpackage/id_version_test.go index d06257a8f3e..ad8a1a26cb6 100644 --- a/resource-manager/batch/2024-07-01/applicationpackage/id_version_test.go +++ b/resource-manager/batch/2024-07-01/applicationpackage/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewVersionID(t *testing.T) { } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "applicationName", "versionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "applicationName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", ApplicationName: "applicationName", VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/applications/applicationName/versions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/applications/applicationName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", ApplicationName: "aPpLiCaTiOnNaMe", VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/applicationpackage/model_applicationpackageproperties.go b/resource-manager/batch/2024-07-01/applicationpackage/model_applicationpackageproperties.go index e49cd1f1a80..a3e08bb9c00 100644 --- a/resource-manager/batch/2024-07-01/applicationpackage/model_applicationpackageproperties.go +++ b/resource-manager/batch/2024-07-01/applicationpackage/model_applicationpackageproperties.go @@ -13,8 +13,8 @@ type ApplicationPackageProperties struct { Format *string `json:"format,omitempty"` LastActivationTime *string `json:"lastActivationTime,omitempty"` State *PackageState `json:"state,omitempty"` - StorageUrl *string `json:"storageUrl,omitempty"` - StorageUrlExpiry *string `json:"storageUrlExpiry,omitempty"` + StorageURL *string `json:"storageUrl,omitempty"` + StorageURLExpiry *string `json:"storageUrlExpiry,omitempty"` } func (o *ApplicationPackageProperties) GetLastActivationTimeAsTime() (*time.Time, error) { @@ -29,14 +29,14 @@ func (o *ApplicationPackageProperties) SetLastActivationTimeAsTime(input time.Ti o.LastActivationTime = &formatted } -func (o *ApplicationPackageProperties) GetStorageUrlExpiryAsTime() (*time.Time, error) { - if o.StorageUrlExpiry == nil { +func (o *ApplicationPackageProperties) GetStorageURLExpiryAsTime() (*time.Time, error) { + if o.StorageURLExpiry == nil { return nil, nil } - return dates.ParseAsFormat(o.StorageUrlExpiry, "2006-01-02T15:04:05Z07:00") + return dates.ParseAsFormat(o.StorageURLExpiry, "2006-01-02T15:04:05Z07:00") } -func (o *ApplicationPackageProperties) SetStorageUrlExpiryAsTime(input time.Time) { +func (o *ApplicationPackageProperties) SetStorageURLExpiryAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StorageUrlExpiry = &formatted + o.StorageURLExpiry = &formatted } diff --git a/resource-manager/batch/2024-07-01/batchaccount/README.md b/resource-manager/batch/2024-07-01/batchaccount/README.md index 9ab443345e5..151c29d0f5d 100644 --- a/resource-manager/batch/2024-07-01/batchaccount/README.md +++ b/resource-manager/batch/2024-07-01/batchaccount/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountCreateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.GetKeys(ctx, id) if err != nil { @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination items, err := client.ListOutboundNetworkDependenciesEndpointsComplete(ctx, id) @@ -137,7 +137,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountRegenerateKeyParameters{ // ... @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") read, err := client.SynchronizeAutoStorageKeys(ctx, id) if err != nil { @@ -174,7 +174,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchaccount.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") payload := batchaccount.BatchAccountUpdateParameters{ // ... diff --git a/resource-manager/batch/2024-07-01/batchaccount/id_batchaccount.go b/resource-manager/batch/2024-07-01/batchaccount/id_batchaccount.go index 3aed3534630..40f8fee2fa0 100644 --- a/resource-manager/batch/2024-07-01/batchaccount/id_batchaccount.go +++ b/resource-manager/batch/2024-07-01/batchaccount/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-07-01/batchaccount/id_batchaccount_test.go b/resource-manager/batch/2024-07-01/batchaccount/id_batchaccount_test.go index dd150171fbc..e279a3b5cbf 100644 --- a/resource-manager/batch/2024-07-01/batchaccount/id_batchaccount_test.go +++ b/resource-manager/batch/2024-07-01/batchaccount/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/batchmanagements/README.md b/resource-manager/batch/2024-07-01/batchmanagements/README.md index b6961ed5bb4..32556253871 100644 --- a/resource-manager/batch/2024-07-01/batchmanagements/README.md +++ b/resource-manager/batch/2024-07-01/batchmanagements/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchmanagements.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId") +id := batchmanagements.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId") read, err := client.BatchAccountGetDetector(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchmanagements.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := batchmanagements.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.BatchAccountListDetectors(ctx, id)` can be used to do batched pagination items, err := client.BatchAccountListDetectorsComplete(ctx, id) diff --git a/resource-manager/batch/2024-07-01/batchmanagements/id_batchaccount.go b/resource-manager/batch/2024-07-01/batchmanagements/id_batchaccount.go index c0de828cf69..990b7377b69 100644 --- a/resource-manager/batch/2024-07-01/batchmanagements/id_batchaccount.go +++ b/resource-manager/batch/2024-07-01/batchmanagements/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-07-01/batchmanagements/id_batchaccount_test.go b/resource-manager/batch/2024-07-01/batchmanagements/id_batchaccount_test.go index 1f445bf51c6..dc5efb236d7 100644 --- a/resource-manager/batch/2024-07-01/batchmanagements/id_batchaccount_test.go +++ b/resource-manager/batch/2024-07-01/batchmanagements/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/batchmanagements/id_detector.go b/resource-manager/batch/2024-07-01/batchmanagements/id_detector.go index 87ff01264a1..19b75f4839b 100644 --- a/resource-manager/batch/2024-07-01/batchmanagements/id_detector.go +++ b/resource-manager/batch/2024-07-01/batchmanagements/id_detector.go @@ -121,7 +121,7 @@ func (id DetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorId", "detectorId"), } diff --git a/resource-manager/batch/2024-07-01/batchmanagements/id_detector_test.go b/resource-manager/batch/2024-07-01/batchmanagements/id_detector_test.go index 6f07aac8a22..b7e87bab0f3 100644 --- a/resource-manager/batch/2024-07-01/batchmanagements/id_detector_test.go +++ b/resource-manager/batch/2024-07-01/batchmanagements/id_detector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DetectorId{} func TestNewDetectorID(t *testing.T) { - id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId") + id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.DetectorId != "detectorId" { @@ -32,8 +32,8 @@ func TestNewDetectorID(t *testing.T) { } func TestFormatDetectorID(t *testing.T) { - actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "detectorId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId" + actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "detectorId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", DetectorId: "detectorId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", DetectorId: "detectorId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/detectors/detectorId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/detectors/detectorId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs/dEtEcToRiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs/dEtEcToRiD", Expected: &DetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", DetectorId: "dEtEcToRiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/dEtEcToRs/dEtEcToRiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/dEtEcToRs/dEtEcToRiD/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/certificate/README.md b/resource-manager/batch/2024-07-01/certificate/README.md index 138982b7eb2..1516a1744b0 100644 --- a/resource-manager/batch/2024-07-01/certificate/README.md +++ b/resource-manager/batch/2024-07-01/certificate/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") read, err := client.CancelDeletion(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") payload := certificate.CertificateCreateOrUpdateParameters{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -73,7 +73,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificate.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := certificate.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, certificate.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, certificate.DefaultListByBatchAccountOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") +id := certificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") payload := certificate.CertificateCreateOrUpdateParameters{ // ... diff --git a/resource-manager/batch/2024-07-01/certificate/id_batchaccount.go b/resource-manager/batch/2024-07-01/certificate/id_batchaccount.go index 2408b63af1f..4acb2c09d7a 100644 --- a/resource-manager/batch/2024-07-01/certificate/id_batchaccount.go +++ b/resource-manager/batch/2024-07-01/certificate/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-07-01/certificate/id_batchaccount_test.go b/resource-manager/batch/2024-07-01/certificate/id_batchaccount_test.go index 9edb9b2c70f..ec23edd8872 100644 --- a/resource-manager/batch/2024-07-01/certificate/id_batchaccount_test.go +++ b/resource-manager/batch/2024-07-01/certificate/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/certificate/id_certificate.go b/resource-manager/batch/2024-07-01/certificate/id_certificate.go index 4e57e868efe..8c16320b58b 100644 --- a/resource-manager/batch/2024-07-01/certificate/id_certificate.go +++ b/resource-manager/batch/2024-07-01/certificate/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/batch/2024-07-01/certificate/id_certificate_test.go b/resource-manager/batch/2024-07-01/certificate/id_certificate_test.go index d505e287161..60f6258d46a 100644 --- a/resource-manager/batch/2024-07-01/certificate/id_certificate_test.go +++ b/resource-manager/batch/2024-07-01/certificate/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/networksecurityperimeter/README.md b/resource-manager/batch/2024-07-01/networksecurityperimeter/README.md index 1b59a11c96c..f6ceb86c30f 100644 --- a/resource-manager/batch/2024-07-01/networksecurityperimeter/README.md +++ b/resource-manager/batch/2024-07-01/networksecurityperimeter/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := networksecurityperimeter.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") +id := networksecurityperimeter.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "networkSecurityPerimeterConfigurationName") read, err := client.GetConfiguration(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networksecurityperimeter.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := networksecurityperimeter.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListConfigurations(ctx, id)` can be used to do batched pagination items, err := client.ListConfigurationsComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networksecurityperimeter.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") +id := networksecurityperimeter.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "networkSecurityPerimeterConfigurationName") if err := client.ReconcileConfigurationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/batch/2024-07-01/networksecurityperimeter/id_batchaccount.go b/resource-manager/batch/2024-07-01/networksecurityperimeter/id_batchaccount.go index f4433c003c7..b4e6f275695 100644 --- a/resource-manager/batch/2024-07-01/networksecurityperimeter/id_batchaccount.go +++ b/resource-manager/batch/2024-07-01/networksecurityperimeter/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-07-01/networksecurityperimeter/id_batchaccount_test.go b/resource-manager/batch/2024-07-01/networksecurityperimeter/id_batchaccount_test.go index c154bee3fc1..811ec552aca 100644 --- a/resource-manager/batch/2024-07-01/networksecurityperimeter/id_batchaccount_test.go +++ b/resource-manager/batch/2024-07-01/networksecurityperimeter/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/networksecurityperimeter/id_networksecurityperimeterconfiguration.go b/resource-manager/batch/2024-07-01/networksecurityperimeter/id_networksecurityperimeterconfiguration.go index b1d43a3d90d..fb25510fc1a 100644 --- a/resource-manager/batch/2024-07-01/networksecurityperimeter/id_networksecurityperimeterconfiguration.go +++ b/resource-manager/batch/2024-07-01/networksecurityperimeter/id_networksecurityperimeterconfiguration.go @@ -121,7 +121,7 @@ func (id NetworkSecurityPerimeterConfigurationId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } diff --git a/resource-manager/batch/2024-07-01/networksecurityperimeter/id_networksecurityperimeterconfiguration_test.go b/resource-manager/batch/2024-07-01/networksecurityperimeter/id_networksecurityperimeterconfiguration_test.go index e8a867d38b3..58772a580da 100644 --- a/resource-manager/batch/2024-07-01/networksecurityperimeter/id_networksecurityperimeterconfiguration_test.go +++ b/resource-manager/batch/2024-07-01/networksecurityperimeter/id_networksecurityperimeterconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkSecurityPerimeterConfigurationId{} func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") + id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "networkSecurityPerimeterConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { @@ -32,8 +32,8 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { } func TestFormatNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" + actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/networkSecurityPerimeterConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/networkSecurityPerimeterConfigurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkSecurityPerimeterConfigurationIDInsensitively(t *testing.T) }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/networkSecurityPerimeterConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/networkSecurityPerimeterConfigurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/pool/README.md b/resource-manager/batch/2024-07-01/pool/README.md index 851a7e4ddab..9c1038cd3b3 100644 --- a/resource-manager/batch/2024-07-01/pool/README.md +++ b/resource-manager/batch/2024-07-01/pool/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") payload := pool.Pool{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.DisableAutoScale(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := pool.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, pool.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, pool.DefaultListByBatchAccountOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") read, err := client.StopResize(ctx, id) if err != nil { @@ -122,7 +122,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := pool.NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") payload := pool.Pool{ // ... diff --git a/resource-manager/batch/2024-07-01/pool/id_batchaccount.go b/resource-manager/batch/2024-07-01/pool/id_batchaccount.go index 3cf0013a05d..9c419de2dca 100644 --- a/resource-manager/batch/2024-07-01/pool/id_batchaccount.go +++ b/resource-manager/batch/2024-07-01/pool/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-07-01/pool/id_batchaccount_test.go b/resource-manager/batch/2024-07-01/pool/id_batchaccount_test.go index dd6178079e5..85b207ea3d8 100644 --- a/resource-manager/batch/2024-07-01/pool/id_batchaccount_test.go +++ b/resource-manager/batch/2024-07-01/pool/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/pool/id_pool.go b/resource-manager/batch/2024-07-01/pool/id_pool.go index d9b835e8179..25e8665345f 100644 --- a/resource-manager/batch/2024-07-01/pool/id_pool.go +++ b/resource-manager/batch/2024-07-01/pool/id_pool.go @@ -121,7 +121,7 @@ func (id PoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPools", "pools", "pools"), resourceids.UserSpecifiedSegment("poolName", "poolName"), } diff --git a/resource-manager/batch/2024-07-01/pool/id_pool_test.go b/resource-manager/batch/2024-07-01/pool/id_pool_test.go index 63bb4dd01dc..2caaba8195c 100644 --- a/resource-manager/batch/2024-07-01/pool/id_pool_test.go +++ b/resource-manager/batch/2024-07-01/pool/id_pool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PoolId{} func TestNewPoolID(t *testing.T) { - id := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PoolName != "poolName" { @@ -32,8 +32,8 @@ func TestNewPoolID(t *testing.T) { } func TestFormatPoolID(t *testing.T) { - actual := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName" + actual := NewPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "poolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PoolName: "poolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PoolName: "poolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/pools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/pools/poolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs/pOoLnAmE", Expected: &PoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PoolName: "pOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pOoLs/pOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/pool/model_azurefileshareconfiguration.go b/resource-manager/batch/2024-07-01/pool/model_azurefileshareconfiguration.go index 910a385e4b8..7ae87358d03 100644 --- a/resource-manager/batch/2024-07-01/pool/model_azurefileshareconfiguration.go +++ b/resource-manager/batch/2024-07-01/pool/model_azurefileshareconfiguration.go @@ -6,7 +6,7 @@ package pool type AzureFileShareConfiguration struct { AccountKey string `json:"accountKey"` AccountName string `json:"accountName"` - AzureFileUrl string `json:"azureFileUrl"` + AzureFileURL string `json:"azureFileUrl"` MountOptions *string `json:"mountOptions,omitempty"` RelativeMountPath string `json:"relativeMountPath"` } diff --git a/resource-manager/batch/2024-07-01/pool/model_resourcefile.go b/resource-manager/batch/2024-07-01/pool/model_resourcefile.go index 9eddccfb1ed..00eb0fef9b2 100644 --- a/resource-manager/batch/2024-07-01/pool/model_resourcefile.go +++ b/resource-manager/batch/2024-07-01/pool/model_resourcefile.go @@ -8,7 +8,7 @@ type ResourceFile struct { BlobPrefix *string `json:"blobPrefix,omitempty"` FileMode *string `json:"fileMode,omitempty"` FilePath *string `json:"filePath,omitempty"` - HTTPUrl *string `json:"httpUrl,omitempty"` + HTTPURL *string `json:"httpUrl,omitempty"` IdentityReference *ComputeNodeIdentityReference `json:"identityReference,omitempty"` - StorageContainerUrl *string `json:"storageContainerUrl,omitempty"` + StorageContainerURL *string `json:"storageContainerUrl,omitempty"` } diff --git a/resource-manager/batch/2024-07-01/privateendpointconnection/README.md b/resource-manager/batch/2024-07-01/privateendpointconnection/README.md index 35eea0db470..b99e1db6ddc 100644 --- a/resource-manager/batch/2024-07-01/privateendpointconnection/README.md +++ b/resource-manager/batch/2024-07-01/privateendpointconnection/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnection.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, privateendpointconnection.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, privateendpointconnection.DefaultListByBatchAccountOperationOptions()) @@ -69,7 +69,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") payload := privateendpointconnection.PrivateEndpointConnection{ // ... diff --git a/resource-manager/batch/2024-07-01/privateendpointconnection/id_batchaccount.go b/resource-manager/batch/2024-07-01/privateendpointconnection/id_batchaccount.go index 61a92df7a34..686c510807f 100644 --- a/resource-manager/batch/2024-07-01/privateendpointconnection/id_batchaccount.go +++ b/resource-manager/batch/2024-07-01/privateendpointconnection/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-07-01/privateendpointconnection/id_batchaccount_test.go b/resource-manager/batch/2024-07-01/privateendpointconnection/id_batchaccount_test.go index 6ab17ef2252..11b7b035660 100644 --- a/resource-manager/batch/2024-07-01/privateendpointconnection/id_batchaccount_test.go +++ b/resource-manager/batch/2024-07-01/privateendpointconnection/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/privateendpointconnection/id_privateendpointconnection.go b/resource-manager/batch/2024-07-01/privateendpointconnection/id_privateendpointconnection.go index a1ecb02d3f6..c8419c90b3a 100644 --- a/resource-manager/batch/2024-07-01/privateendpointconnection/id_privateendpointconnection.go +++ b/resource-manager/batch/2024-07-01/privateendpointconnection/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/batch/2024-07-01/privateendpointconnection/id_privateendpointconnection_test.go b/resource-manager/batch/2024-07-01/privateendpointconnection/id_privateendpointconnection_test.go index 8d7aa4ef65d..c38620f9e86 100644 --- a/resource-manager/batch/2024-07-01/privateendpointconnection/id_privateendpointconnection_test.go +++ b/resource-manager/batch/2024-07-01/privateendpointconnection/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/privatelinkresource/README.md b/resource-manager/batch/2024-07-01/privatelinkresource/README.md index afbe939169c..531aa1a0568 100644 --- a/resource-manager/batch/2024-07-01/privatelinkresource/README.md +++ b/resource-manager/batch/2024-07-01/privatelinkresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName") +id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresource.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresource.NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") // alternatively `client.ListByBatchAccount(ctx, id, privatelinkresource.DefaultListByBatchAccountOperationOptions())` can be used to do batched pagination items, err := client.ListByBatchAccountComplete(ctx, id, privatelinkresource.DefaultListByBatchAccountOperationOptions()) diff --git a/resource-manager/batch/2024-07-01/privatelinkresource/id_batchaccount.go b/resource-manager/batch/2024-07-01/privatelinkresource/id_batchaccount.go index 13e21417dcb..9bd1aa4df28 100644 --- a/resource-manager/batch/2024-07-01/privatelinkresource/id_batchaccount.go +++ b/resource-manager/batch/2024-07-01/privatelinkresource/id_batchaccount.go @@ -115,7 +115,7 @@ func (id BatchAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), } } diff --git a/resource-manager/batch/2024-07-01/privatelinkresource/id_batchaccount_test.go b/resource-manager/batch/2024-07-01/privatelinkresource/id_batchaccount_test.go index c4e8ef7b2d0..55722fd5e6a 100644 --- a/resource-manager/batch/2024-07-01/privatelinkresource/id_batchaccount_test.go +++ b/resource-manager/batch/2024-07-01/privatelinkresource/id_batchaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchAccountId{} func TestNewBatchAccountID(t *testing.T) { - id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBatchAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } } func TestFormatBatchAccountID(t *testing.T) { - actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName" + actual := NewBatchAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBatchAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBatchAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Expected: &BatchAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/batch/2024-07-01/privatelinkresource/id_privatelinkresource.go b/resource-manager/batch/2024-07-01/privatelinkresource/id_privatelinkresource.go index 24cab96a05e..77d21d6170e 100644 --- a/resource-manager/batch/2024-07-01/privatelinkresource/id_privatelinkresource.go +++ b/resource-manager/batch/2024-07-01/privatelinkresource/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBatch", "Microsoft.Batch", "Microsoft.Batch"), resourceids.StaticSegment("staticBatchAccounts", "batchAccounts", "batchAccounts"), - resourceids.UserSpecifiedSegment("batchAccountName", "accountName"), + resourceids.UserSpecifiedSegment("batchAccountName", "batchAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } diff --git a/resource-manager/batch/2024-07-01/privatelinkresource/id_privatelinkresource_test.go b/resource-manager/batch/2024-07-01/privatelinkresource/id_privatelinkresource_test.go index 9a355ce420b..946c94afbec 100644 --- a/resource-manager/batch/2024-07-01/privatelinkresource/id_privatelinkresource_test.go +++ b/resource-manager/batch/2024-07-01/privatelinkresource/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BatchAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "accountName") + if id.BatchAccountName != "batchAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchAccountName'", id.BatchAccountName, "batchAccountName") } if id.PrivateLinkResourceName != "privateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "batchAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BatchAccountName: "accountName", + BatchAccountName: "batchAccountName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/accountName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Batch/batchAccounts/batchAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BatchAccountName: "aCcOuNtNaMe", + BatchAccountName: "bAtChAcCoUnTnAmE", PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bAtCh/bAtChAcCoUnTs/bAtChAcCoUnTnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultiplebillingprofileinvoices.go b/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultiplebillingprofileinvoices.go index 148ffc85b30..2781d2eaccc 100644 --- a/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultiplebillingprofileinvoices.go +++ b/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultiplebillingprofileinvoices.go @@ -18,7 +18,7 @@ type DownloadMultipleBillingProfileInvoicesOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // DownloadMultipleBillingProfileInvoices ... diff --git a/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultiplebillingsubscriptioninvoices.go b/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultiplebillingsubscriptioninvoices.go index ca1b8099f77..edd708dbcec 100644 --- a/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultiplebillingsubscriptioninvoices.go +++ b/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultiplebillingsubscriptioninvoices.go @@ -18,7 +18,7 @@ type DownloadMultipleBillingSubscriptionInvoicesOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // DownloadMultipleBillingSubscriptionInvoices ... diff --git a/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultipleeainvoices.go b/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultipleeainvoices.go index a33dd7fffd8..067888870cd 100644 --- a/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultipleeainvoices.go +++ b/resource-manager/billing/2019-10-01-preview/invoices/method_downloadmultipleeainvoices.go @@ -18,7 +18,7 @@ type DownloadMultipleEAInvoicesOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // DownloadMultipleEAInvoices ... diff --git a/resource-manager/billing/2019-10-01-preview/invoices/model_downloadurl.go b/resource-manager/billing/2019-10-01-preview/invoices/model_downloadurl.go index abf5e806ac2..949b5a540fa 100644 --- a/resource-manager/billing/2019-10-01-preview/invoices/model_downloadurl.go +++ b/resource-manager/billing/2019-10-01-preview/invoices/model_downloadurl.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { +type DownloadURL struct { ExpiryTime *string `json:"expiryTime,omitempty"` Url *string `json:"url,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } diff --git a/resource-manager/billing/2019-10-01-preview/pricesheet/method_download.go b/resource-manager/billing/2019-10-01-preview/pricesheet/method_download.go index cf9ef129ce9..e46cb2520e8 100644 --- a/resource-manager/billing/2019-10-01-preview/pricesheet/method_download.go +++ b/resource-manager/billing/2019-10-01-preview/pricesheet/method_download.go @@ -18,7 +18,7 @@ type DownloadOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // Download ... diff --git a/resource-manager/billing/2019-10-01-preview/pricesheet/method_downloadbybillingprofile.go b/resource-manager/billing/2019-10-01-preview/pricesheet/method_downloadbybillingprofile.go index e6a8c02dd30..3f54a07bf84 100644 --- a/resource-manager/billing/2019-10-01-preview/pricesheet/method_downloadbybillingprofile.go +++ b/resource-manager/billing/2019-10-01-preview/pricesheet/method_downloadbybillingprofile.go @@ -18,7 +18,7 @@ type DownloadByBillingProfileOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // DownloadByBillingProfile ... diff --git a/resource-manager/billing/2019-10-01-preview/pricesheet/model_downloadurl.go b/resource-manager/billing/2019-10-01-preview/pricesheet/model_downloadurl.go index c5e054d02f4..b92da1fabea 100644 --- a/resource-manager/billing/2019-10-01-preview/pricesheet/model_downloadurl.go +++ b/resource-manager/billing/2019-10-01-preview/pricesheet/model_downloadurl.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { +type DownloadURL struct { ExpiryTime *string `json:"expiryTime,omitempty"` Url *string `json:"url,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } diff --git a/resource-manager/billing/2020-05-01/invoices/method_downloadbillingsubscriptioninvoice.go b/resource-manager/billing/2020-05-01/invoices/method_downloadbillingsubscriptioninvoice.go index f39e22b479a..dba9dc8b546 100644 --- a/resource-manager/billing/2020-05-01/invoices/method_downloadbillingsubscriptioninvoice.go +++ b/resource-manager/billing/2020-05-01/invoices/method_downloadbillingsubscriptioninvoice.go @@ -18,7 +18,7 @@ type DownloadBillingSubscriptionInvoiceOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } type DownloadBillingSubscriptionInvoiceOperationOptions struct { diff --git a/resource-manager/billing/2020-05-01/invoices/method_downloadinvoice.go b/resource-manager/billing/2020-05-01/invoices/method_downloadinvoice.go index 6565154c613..6dd8af31778 100644 --- a/resource-manager/billing/2020-05-01/invoices/method_downloadinvoice.go +++ b/resource-manager/billing/2020-05-01/invoices/method_downloadinvoice.go @@ -18,7 +18,7 @@ type DownloadInvoiceOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } type DownloadInvoiceOperationOptions struct { diff --git a/resource-manager/billing/2020-05-01/invoices/method_downloadmultiplebillingprofileinvoices.go b/resource-manager/billing/2020-05-01/invoices/method_downloadmultiplebillingprofileinvoices.go index e03a0f82825..579765c1965 100644 --- a/resource-manager/billing/2020-05-01/invoices/method_downloadmultiplebillingprofileinvoices.go +++ b/resource-manager/billing/2020-05-01/invoices/method_downloadmultiplebillingprofileinvoices.go @@ -18,7 +18,7 @@ type DownloadMultipleBillingProfileInvoicesOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // DownloadMultipleBillingProfileInvoices ... diff --git a/resource-manager/billing/2020-05-01/invoices/method_downloadmultiplebillingsubscriptioninvoices.go b/resource-manager/billing/2020-05-01/invoices/method_downloadmultiplebillingsubscriptioninvoices.go index ca1b8099f77..edd708dbcec 100644 --- a/resource-manager/billing/2020-05-01/invoices/method_downloadmultiplebillingsubscriptioninvoices.go +++ b/resource-manager/billing/2020-05-01/invoices/method_downloadmultiplebillingsubscriptioninvoices.go @@ -18,7 +18,7 @@ type DownloadMultipleBillingSubscriptionInvoicesOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // DownloadMultipleBillingSubscriptionInvoices ... diff --git a/resource-manager/billing/2020-05-01/invoices/model_downloadurl.go b/resource-manager/billing/2020-05-01/invoices/model_downloadurl.go index abf5e806ac2..949b5a540fa 100644 --- a/resource-manager/billing/2020-05-01/invoices/model_downloadurl.go +++ b/resource-manager/billing/2020-05-01/invoices/model_downloadurl.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { +type DownloadURL struct { ExpiryTime *string `json:"expiryTime,omitempty"` Url *string `json:"url,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } diff --git a/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/README.md b/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/README.md index 89e614630f7..592da032354 100644 --- a/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/README.md +++ b/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := billingsubscriptionsaliases.NewBillingSubscriptionAliasID("billingAccountName", "aliasName") +id := billingsubscriptionsaliases.NewBillingSubscriptionAliasID("billingAccountName", "billingSubscriptionAliasName") payload := billingsubscriptionsaliases.BillingSubscriptionAlias{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := billingsubscriptionsaliases.NewBillingSubscriptionAliasID("billingAccountName", "aliasName") +id := billingsubscriptionsaliases.NewBillingSubscriptionAliasID("billingAccountName", "billingSubscriptionAliasName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/id_billingsubscriptionalias.go b/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/id_billingsubscriptionalias.go index 0ed490c2923..68d583582fe 100644 --- a/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/id_billingsubscriptionalias.go +++ b/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/id_billingsubscriptionalias.go @@ -107,7 +107,7 @@ func (id BillingSubscriptionAliasId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticBillingAccounts", "billingAccounts", "billingAccounts"), resourceids.UserSpecifiedSegment("billingAccountName", "billingAccountName"), resourceids.StaticSegment("staticBillingSubscriptionAliases", "billingSubscriptionAliases", "billingSubscriptionAliases"), - resourceids.UserSpecifiedSegment("billingSubscriptionAliasName", "aliasName"), + resourceids.UserSpecifiedSegment("billingSubscriptionAliasName", "billingSubscriptionAliasName"), } } diff --git a/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/id_billingsubscriptionalias_test.go b/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/id_billingsubscriptionalias_test.go index a77cf3c0b2d..76814fc6686 100644 --- a/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/id_billingsubscriptionalias_test.go +++ b/resource-manager/billing/2021-10-01/billingsubscriptionsaliases/id_billingsubscriptionalias_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &BillingSubscriptionAliasId{} func TestNewBillingSubscriptionAliasID(t *testing.T) { - id := NewBillingSubscriptionAliasID("billingAccountName", "aliasName") + id := NewBillingSubscriptionAliasID("billingAccountName", "billingSubscriptionAliasName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") } - if id.BillingSubscriptionAliasName != "aliasName" { - t.Fatalf("Expected %q but got %q for Segment 'BillingSubscriptionAliasName'", id.BillingSubscriptionAliasName, "aliasName") + if id.BillingSubscriptionAliasName != "billingSubscriptionAliasName" { + t.Fatalf("Expected %q but got %q for Segment 'BillingSubscriptionAliasName'", id.BillingSubscriptionAliasName, "billingSubscriptionAliasName") } } func TestFormatBillingSubscriptionAliasID(t *testing.T) { - actual := NewBillingSubscriptionAliasID("billingAccountName", "aliasName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName" + actual := NewBillingSubscriptionAliasID("billingAccountName", "billingSubscriptionAliasName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseBillingSubscriptionAliasID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName", Expected: &BillingSubscriptionAliasId{ BillingAccountName: "billingAccountName", - BillingSubscriptionAliasName: "aliasName", + BillingSubscriptionAliasName: "billingSubscriptionAliasName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseBillingSubscriptionAliasIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName", Expected: &BillingSubscriptionAliasId{ BillingAccountName: "billingAccountName", - BillingSubscriptionAliasName: "aliasName", + BillingSubscriptionAliasName: "billingSubscriptionAliasName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgSuBsCrIpTiOnAlIaSeS/aLiAsNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgSuBsCrIpTiOnAlIaSeS/bIlLiNgSuBsCrIpTiOnAlIaSnAmE", Expected: &BillingSubscriptionAliasId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", - BillingSubscriptionAliasName: "aLiAsNaMe", + BillingSubscriptionAliasName: "bIlLiNgSuBsCrIpTiOnAlIaSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgSuBsCrIpTiOnAlIaSeS/aLiAsNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgSuBsCrIpTiOnAlIaSeS/bIlLiNgSuBsCrIpTiOnAlIaSnAmE/extra", Error: true, }, } diff --git a/resource-manager/billing/2021-10-01/paymentmethods/README.md b/resource-manager/billing/2021-10-01/paymentmethods/README.md index 8eccc364a0e..e73d9ffbc85 100644 --- a/resource-manager/billing/2021-10-01/paymentmethods/README.md +++ b/resource-manager/billing/2021-10-01/paymentmethods/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := paymentmethods.NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodName") +id := paymentmethods.NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodLinkName") if err := client.DeleteAtBillingProfileThenPoll(ctx, id); err != nil { // handle the error @@ -68,7 +68,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := paymentmethods.NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodName") +id := paymentmethods.NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodLinkName") read, err := client.GetByBillingProfile(ctx, id) if err != nil { diff --git a/resource-manager/billing/2021-10-01/paymentmethods/id_paymentmethodlink.go b/resource-manager/billing/2021-10-01/paymentmethods/id_paymentmethodlink.go index 738b5d48c53..40445a6792e 100644 --- a/resource-manager/billing/2021-10-01/paymentmethods/id_paymentmethodlink.go +++ b/resource-manager/billing/2021-10-01/paymentmethods/id_paymentmethodlink.go @@ -115,7 +115,7 @@ func (id PaymentMethodLinkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticBillingProfiles", "billingProfiles", "billingProfiles"), resourceids.UserSpecifiedSegment("billingProfileName", "billingProfileName"), resourceids.StaticSegment("staticPaymentMethodLinks", "paymentMethodLinks", "paymentMethodLinks"), - resourceids.UserSpecifiedSegment("paymentMethodLinkName", "paymentMethodName"), + resourceids.UserSpecifiedSegment("paymentMethodLinkName", "paymentMethodLinkName"), } } diff --git a/resource-manager/billing/2021-10-01/paymentmethods/id_paymentmethodlink_test.go b/resource-manager/billing/2021-10-01/paymentmethods/id_paymentmethodlink_test.go index bc3f63dee3b..e78772e719c 100644 --- a/resource-manager/billing/2021-10-01/paymentmethods/id_paymentmethodlink_test.go +++ b/resource-manager/billing/2021-10-01/paymentmethods/id_paymentmethodlink_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PaymentMethodLinkId{} func TestNewPaymentMethodLinkID(t *testing.T) { - id := NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodName") + id := NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodLinkName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") @@ -22,14 +22,14 @@ func TestNewPaymentMethodLinkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'BillingProfileName'", id.BillingProfileName, "billingProfileName") } - if id.PaymentMethodLinkName != "paymentMethodName" { - t.Fatalf("Expected %q but got %q for Segment 'PaymentMethodLinkName'", id.PaymentMethodLinkName, "paymentMethodName") + if id.PaymentMethodLinkName != "paymentMethodLinkName" { + t.Fatalf("Expected %q but got %q for Segment 'PaymentMethodLinkName'", id.PaymentMethodLinkName, "paymentMethodLinkName") } } func TestFormatPaymentMethodLinkID(t *testing.T) { - actual := NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName" + actual := NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodLinkName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePaymentMethodLinkID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName", Expected: &PaymentMethodLinkId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", - PaymentMethodLinkName: "paymentMethodName", + PaymentMethodLinkName: "paymentMethodLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePaymentMethodLinkIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName", Expected: &PaymentMethodLinkId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", - PaymentMethodLinkName: "paymentMethodName", + PaymentMethodLinkName: "paymentMethodLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/pAyMeNtMeThOdLiNkS/pAyMeNtMeThOdNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/pAyMeNtMeThOdLiNkS/pAyMeNtMeThOdLiNkNaMe", Expected: &PaymentMethodLinkId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", BillingProfileName: "bIlLiNgPrOfIlEnAmE", - PaymentMethodLinkName: "pAyMeNtMeThOdNaMe", + PaymentMethodLinkName: "pAyMeNtMeThOdLiNkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/pAyMeNtMeThOdLiNkS/pAyMeNtMeThOdNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/pAyMeNtMeThOdLiNkS/pAyMeNtMeThOdLiNkNaMe/extra", Error: true, }, } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/README.md b/resource-manager/billing/2024-04-01/billingroledefinition/README.md index 6eb49bcafda..509dd3f5105 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/README.md +++ b/resource-manager/billing/2024-04-01/billingroledefinition/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := billingroledefinition.NewBillingRoleDefinitionID("billingAccountName", "roleDefinitionName") +id := billingroledefinition.NewBillingRoleDefinitionID("billingAccountName", "billingRoleDefinitionName") read, err := client.GetByBillingAccount(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := billingroledefinition.NewBillingProfileBillingRoleDefinitionID("billingAccountName", "billingProfileName", "roleDefinitionName") +id := billingroledefinition.NewBillingProfileBillingRoleDefinitionID("billingAccountName", "billingProfileName", "billingRoleDefinitionName") read, err := client.GetByBillingProfile(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := billingroledefinition.NewCustomerBillingRoleDefinitionID("billingAccountName", "billingProfileName", "customerName", "roleDefinitionName") +id := billingroledefinition.NewCustomerBillingRoleDefinitionID("billingAccountName", "billingProfileName", "customerName", "billingRoleDefinitionName") read, err := client.GetByCustomer(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := billingroledefinition.NewDepartmentBillingRoleDefinitionID("billingAccountName", "departmentName", "roleDefinitionName") +id := billingroledefinition.NewDepartmentBillingRoleDefinitionID("billingAccountName", "departmentName", "billingRoleDefinitionName") read, err := client.GetByDepartment(ctx, id) if err != nil { @@ -88,7 +88,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := billingroledefinition.NewEnrollmentAccountBillingRoleDefinitionID("billingAccountName", "enrollmentAccountName", "roleDefinitionName") +id := billingroledefinition.NewEnrollmentAccountBillingRoleDefinitionID("billingAccountName", "enrollmentAccountName", "billingRoleDefinitionName") read, err := client.GetByEnrollmentAccount(ctx, id) if err != nil { @@ -104,7 +104,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := billingroledefinition.NewInvoiceSectionBillingRoleDefinitionID("billingAccountName", "billingProfileName", "invoiceSectionName", "roleDefinitionName") +id := billingroledefinition.NewInvoiceSectionBillingRoleDefinitionID("billingAccountName", "billingProfileName", "invoiceSectionName", "billingRoleDefinitionName") read, err := client.GetByInvoiceSection(ctx, id) if err != nil { diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_billingprofilebillingroledefinition.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_billingprofilebillingroledefinition.go index 6bec452c44d..39dbe9fa265 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_billingprofilebillingroledefinition.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_billingprofilebillingroledefinition.go @@ -115,7 +115,7 @@ func (id BillingProfileBillingRoleDefinitionId) Segments() []resourceids.Segment resourceids.StaticSegment("staticBillingProfiles", "billingProfiles", "billingProfiles"), resourceids.UserSpecifiedSegment("billingProfileName", "billingProfileName"), resourceids.StaticSegment("staticBillingRoleDefinitions", "billingRoleDefinitions", "billingRoleDefinitions"), - resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "roleDefinitionName"), + resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "billingRoleDefinitionName"), } } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_billingprofilebillingroledefinition_test.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_billingprofilebillingroledefinition_test.go index 46571630ba7..33d17c4a5cc 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_billingprofilebillingroledefinition_test.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_billingprofilebillingroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BillingProfileBillingRoleDefinitionId{} func TestNewBillingProfileBillingRoleDefinitionID(t *testing.T) { - id := NewBillingProfileBillingRoleDefinitionID("billingAccountName", "billingProfileName", "roleDefinitionName") + id := NewBillingProfileBillingRoleDefinitionID("billingAccountName", "billingProfileName", "billingRoleDefinitionName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") @@ -22,14 +22,14 @@ func TestNewBillingProfileBillingRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'BillingProfileName'", id.BillingProfileName, "billingProfileName") } - if id.BillingRoleDefinitionName != "roleDefinitionName" { - t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "roleDefinitionName") + if id.BillingRoleDefinitionName != "billingRoleDefinitionName" { + t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "billingRoleDefinitionName") } } func TestFormatBillingProfileBillingRoleDefinitionID(t *testing.T) { - actual := NewBillingProfileBillingRoleDefinitionID("billingAccountName", "billingProfileName", "roleDefinitionName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/roleDefinitionName" + actual := NewBillingProfileBillingRoleDefinitionID("billingAccountName", "billingProfileName", "billingRoleDefinitionName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/billingRoleDefinitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBillingProfileBillingRoleDefinitionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &BillingProfileBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBillingProfileBillingRoleDefinitionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &BillingProfileBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe", Expected: &BillingProfileBillingRoleDefinitionId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", BillingProfileName: "bIlLiNgPrOfIlEnAmE", - BillingRoleDefinitionName: "rOlEdEfInItIoNnAmE", + BillingRoleDefinitionName: "bIlLiNgRoLeDeFiNiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_billingroledefinition.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_billingroledefinition.go index d4cd4495256..57d6cd40f2f 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_billingroledefinition.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_billingroledefinition.go @@ -107,7 +107,7 @@ func (id BillingRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticBillingAccounts", "billingAccounts", "billingAccounts"), resourceids.UserSpecifiedSegment("billingAccountName", "billingAccountName"), resourceids.StaticSegment("staticBillingRoleDefinitions", "billingRoleDefinitions", "billingRoleDefinitions"), - resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "roleDefinitionName"), + resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "billingRoleDefinitionName"), } } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_billingroledefinition_test.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_billingroledefinition_test.go index e7106ee70f1..d4c7f0ce04c 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_billingroledefinition_test.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_billingroledefinition_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &BillingRoleDefinitionId{} func TestNewBillingRoleDefinitionID(t *testing.T) { - id := NewBillingRoleDefinitionID("billingAccountName", "roleDefinitionName") + id := NewBillingRoleDefinitionID("billingAccountName", "billingRoleDefinitionName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") } - if id.BillingRoleDefinitionName != "roleDefinitionName" { - t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "roleDefinitionName") + if id.BillingRoleDefinitionName != "billingRoleDefinitionName" { + t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "billingRoleDefinitionName") } } func TestFormatBillingRoleDefinitionID(t *testing.T) { - actual := NewBillingRoleDefinitionID("billingAccountName", "roleDefinitionName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/roleDefinitionName" + actual := NewBillingRoleDefinitionID("billingAccountName", "billingRoleDefinitionName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/billingRoleDefinitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseBillingRoleDefinitionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &BillingRoleDefinitionId{ BillingAccountName: "billingAccountName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseBillingRoleDefinitionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &BillingRoleDefinitionId{ BillingAccountName: "billingAccountName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe", Expected: &BillingRoleDefinitionId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", - BillingRoleDefinitionName: "rOlEdEfInItIoNnAmE", + BillingRoleDefinitionName: "bIlLiNgRoLeDeFiNiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_customerbillingroledefinition.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_customerbillingroledefinition.go index 37fd7dff6df..8a2962a3230 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_customerbillingroledefinition.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_customerbillingroledefinition.go @@ -123,7 +123,7 @@ func (id CustomerBillingRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticCustomers", "customers", "customers"), resourceids.UserSpecifiedSegment("customerName", "customerName"), resourceids.StaticSegment("staticBillingRoleDefinitions", "billingRoleDefinitions", "billingRoleDefinitions"), - resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "roleDefinitionName"), + resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "billingRoleDefinitionName"), } } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_customerbillingroledefinition_test.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_customerbillingroledefinition_test.go index 042d423adab..f2f2e4774a1 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_customerbillingroledefinition_test.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_customerbillingroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomerBillingRoleDefinitionId{} func TestNewCustomerBillingRoleDefinitionID(t *testing.T) { - id := NewCustomerBillingRoleDefinitionID("billingAccountName", "billingProfileName", "customerName", "roleDefinitionName") + id := NewCustomerBillingRoleDefinitionID("billingAccountName", "billingProfileName", "customerName", "billingRoleDefinitionName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") @@ -26,14 +26,14 @@ func TestNewCustomerBillingRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'CustomerName'", id.CustomerName, "customerName") } - if id.BillingRoleDefinitionName != "roleDefinitionName" { - t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "roleDefinitionName") + if id.BillingRoleDefinitionName != "billingRoleDefinitionName" { + t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "billingRoleDefinitionName") } } func TestFormatCustomerBillingRoleDefinitionID(t *testing.T) { - actual := NewCustomerBillingRoleDefinitionID("billingAccountName", "billingProfileName", "customerName", "roleDefinitionName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/roleDefinitionName" + actual := NewCustomerBillingRoleDefinitionID("billingAccountName", "billingProfileName", "customerName", "billingRoleDefinitionName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/billingRoleDefinitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseCustomerBillingRoleDefinitionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &CustomerBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", CustomerName: "customerName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseCustomerBillingRoleDefinitionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &CustomerBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", CustomerName: "customerName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/customers/customerName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/cUsToMeRs/cUsToMeRnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/cUsToMeRs/cUsToMeRnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe", Expected: &CustomerBillingRoleDefinitionId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", BillingProfileName: "bIlLiNgPrOfIlEnAmE", CustomerName: "cUsToMeRnAmE", - BillingRoleDefinitionName: "rOlEdEfInItIoNnAmE", + BillingRoleDefinitionName: "bIlLiNgRoLeDeFiNiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/cUsToMeRs/cUsToMeRnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/cUsToMeRs/cUsToMeRnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_departmentbillingroledefinition.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_departmentbillingroledefinition.go index d8b3039047a..0461ea41d4d 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_departmentbillingroledefinition.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_departmentbillingroledefinition.go @@ -115,7 +115,7 @@ func (id DepartmentBillingRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDepartments", "departments", "departments"), resourceids.UserSpecifiedSegment("departmentName", "departmentName"), resourceids.StaticSegment("staticBillingRoleDefinitions", "billingRoleDefinitions", "billingRoleDefinitions"), - resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "roleDefinitionName"), + resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "billingRoleDefinitionName"), } } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_departmentbillingroledefinition_test.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_departmentbillingroledefinition_test.go index 87104585627..b9dc9764e4e 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_departmentbillingroledefinition_test.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_departmentbillingroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DepartmentBillingRoleDefinitionId{} func TestNewDepartmentBillingRoleDefinitionID(t *testing.T) { - id := NewDepartmentBillingRoleDefinitionID("billingAccountName", "departmentName", "roleDefinitionName") + id := NewDepartmentBillingRoleDefinitionID("billingAccountName", "departmentName", "billingRoleDefinitionName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") @@ -22,14 +22,14 @@ func TestNewDepartmentBillingRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DepartmentName'", id.DepartmentName, "departmentName") } - if id.BillingRoleDefinitionName != "roleDefinitionName" { - t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "roleDefinitionName") + if id.BillingRoleDefinitionName != "billingRoleDefinitionName" { + t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "billingRoleDefinitionName") } } func TestFormatDepartmentBillingRoleDefinitionID(t *testing.T) { - actual := NewDepartmentBillingRoleDefinitionID("billingAccountName", "departmentName", "roleDefinitionName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/roleDefinitionName" + actual := NewDepartmentBillingRoleDefinitionID("billingAccountName", "departmentName", "billingRoleDefinitionName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/billingRoleDefinitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDepartmentBillingRoleDefinitionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &DepartmentBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", DepartmentName: "departmentName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDepartmentBillingRoleDefinitionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &DepartmentBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", DepartmentName: "departmentName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/departments/departmentName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/dEpArTmEnTs/dEpArTmEnTnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/dEpArTmEnTs/dEpArTmEnTnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe", Expected: &DepartmentBillingRoleDefinitionId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", DepartmentName: "dEpArTmEnTnAmE", - BillingRoleDefinitionName: "rOlEdEfInItIoNnAmE", + BillingRoleDefinitionName: "bIlLiNgRoLeDeFiNiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/dEpArTmEnTs/dEpArTmEnTnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/dEpArTmEnTs/dEpArTmEnTnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_enrollmentaccountbillingroledefinition.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_enrollmentaccountbillingroledefinition.go index 93fcf8e2d96..54ea2f856e9 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_enrollmentaccountbillingroledefinition.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_enrollmentaccountbillingroledefinition.go @@ -115,7 +115,7 @@ func (id EnrollmentAccountBillingRoleDefinitionId) Segments() []resourceids.Segm resourceids.StaticSegment("staticEnrollmentAccounts", "enrollmentAccounts", "enrollmentAccounts"), resourceids.UserSpecifiedSegment("enrollmentAccountName", "enrollmentAccountName"), resourceids.StaticSegment("staticBillingRoleDefinitions", "billingRoleDefinitions", "billingRoleDefinitions"), - resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "roleDefinitionName"), + resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "billingRoleDefinitionName"), } } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_enrollmentaccountbillingroledefinition_test.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_enrollmentaccountbillingroledefinition_test.go index 4cf60f9a3da..af634d0024a 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_enrollmentaccountbillingroledefinition_test.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_enrollmentaccountbillingroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EnrollmentAccountBillingRoleDefinitionId{} func TestNewEnrollmentAccountBillingRoleDefinitionID(t *testing.T) { - id := NewEnrollmentAccountBillingRoleDefinitionID("billingAccountName", "enrollmentAccountName", "roleDefinitionName") + id := NewEnrollmentAccountBillingRoleDefinitionID("billingAccountName", "enrollmentAccountName", "billingRoleDefinitionName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") @@ -22,14 +22,14 @@ func TestNewEnrollmentAccountBillingRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'EnrollmentAccountName'", id.EnrollmentAccountName, "enrollmentAccountName") } - if id.BillingRoleDefinitionName != "roleDefinitionName" { - t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "roleDefinitionName") + if id.BillingRoleDefinitionName != "billingRoleDefinitionName" { + t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "billingRoleDefinitionName") } } func TestFormatEnrollmentAccountBillingRoleDefinitionID(t *testing.T) { - actual := NewEnrollmentAccountBillingRoleDefinitionID("billingAccountName", "enrollmentAccountName", "roleDefinitionName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/roleDefinitionName" + actual := NewEnrollmentAccountBillingRoleDefinitionID("billingAccountName", "enrollmentAccountName", "billingRoleDefinitionName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/billingRoleDefinitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseEnrollmentAccountBillingRoleDefinitionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &EnrollmentAccountBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", EnrollmentAccountName: "enrollmentAccountName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseEnrollmentAccountBillingRoleDefinitionIDInsensitively(t *testing.T }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &EnrollmentAccountBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", EnrollmentAccountName: "enrollmentAccountName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/enrollmentAccounts/enrollmentAccountName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/eNrOlLmEnTaCcOuNtS/eNrOlLmEnTaCcOuNtNaMe/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/eNrOlLmEnTaCcOuNtS/eNrOlLmEnTaCcOuNtNaMe/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe", Expected: &EnrollmentAccountBillingRoleDefinitionId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", EnrollmentAccountName: "eNrOlLmEnTaCcOuNtNaMe", - BillingRoleDefinitionName: "rOlEdEfInItIoNnAmE", + BillingRoleDefinitionName: "bIlLiNgRoLeDeFiNiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/eNrOlLmEnTaCcOuNtS/eNrOlLmEnTaCcOuNtNaMe/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/eNrOlLmEnTaCcOuNtS/eNrOlLmEnTaCcOuNtNaMe/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_invoicesectionbillingroledefinition.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_invoicesectionbillingroledefinition.go index 68c30b41aad..19e6509e6f4 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_invoicesectionbillingroledefinition.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_invoicesectionbillingroledefinition.go @@ -123,7 +123,7 @@ func (id InvoiceSectionBillingRoleDefinitionId) Segments() []resourceids.Segment resourceids.StaticSegment("staticInvoiceSections", "invoiceSections", "invoiceSections"), resourceids.UserSpecifiedSegment("invoiceSectionName", "invoiceSectionName"), resourceids.StaticSegment("staticBillingRoleDefinitions", "billingRoleDefinitions", "billingRoleDefinitions"), - resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "roleDefinitionName"), + resourceids.UserSpecifiedSegment("billingRoleDefinitionName", "billingRoleDefinitionName"), } } diff --git a/resource-manager/billing/2024-04-01/billingroledefinition/id_invoicesectionbillingroledefinition_test.go b/resource-manager/billing/2024-04-01/billingroledefinition/id_invoicesectionbillingroledefinition_test.go index 5c6314800be..2d55f64a4ab 100644 --- a/resource-manager/billing/2024-04-01/billingroledefinition/id_invoicesectionbillingroledefinition_test.go +++ b/resource-manager/billing/2024-04-01/billingroledefinition/id_invoicesectionbillingroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InvoiceSectionBillingRoleDefinitionId{} func TestNewInvoiceSectionBillingRoleDefinitionID(t *testing.T) { - id := NewInvoiceSectionBillingRoleDefinitionID("billingAccountName", "billingProfileName", "invoiceSectionName", "roleDefinitionName") + id := NewInvoiceSectionBillingRoleDefinitionID("billingAccountName", "billingProfileName", "invoiceSectionName", "billingRoleDefinitionName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") @@ -26,14 +26,14 @@ func TestNewInvoiceSectionBillingRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'InvoiceSectionName'", id.InvoiceSectionName, "invoiceSectionName") } - if id.BillingRoleDefinitionName != "roleDefinitionName" { - t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "roleDefinitionName") + if id.BillingRoleDefinitionName != "billingRoleDefinitionName" { + t.Fatalf("Expected %q but got %q for Segment 'BillingRoleDefinitionName'", id.BillingRoleDefinitionName, "billingRoleDefinitionName") } } func TestFormatInvoiceSectionBillingRoleDefinitionID(t *testing.T) { - actual := NewInvoiceSectionBillingRoleDefinitionID("billingAccountName", "billingProfileName", "invoiceSectionName", "roleDefinitionName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/roleDefinitionName" + actual := NewInvoiceSectionBillingRoleDefinitionID("billingAccountName", "billingProfileName", "invoiceSectionName", "billingRoleDefinitionName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/billingRoleDefinitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseInvoiceSectionBillingRoleDefinitionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &InvoiceSectionBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", InvoiceSectionName: "invoiceSectionName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseInvoiceSectionBillingRoleDefinitionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/roleDefinitionName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/billingRoleDefinitionName", Expected: &InvoiceSectionBillingRoleDefinitionId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", InvoiceSectionName: "invoiceSectionName", - BillingRoleDefinitionName: "roleDefinitionName", + BillingRoleDefinitionName: "billingRoleDefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/roleDefinitionName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/invoiceSections/invoiceSectionName/billingRoleDefinitions/billingRoleDefinitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/iNvOiCeSeCtIoNs/iNvOiCeSeCtIoNnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/iNvOiCeSeCtIoNs/iNvOiCeSeCtIoNnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe", Expected: &InvoiceSectionBillingRoleDefinitionId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", BillingProfileName: "bIlLiNgPrOfIlEnAmE", InvoiceSectionName: "iNvOiCeSeCtIoNnAmE", - BillingRoleDefinitionName: "rOlEdEfInItIoNnAmE", + BillingRoleDefinitionName: "bIlLiNgRoLeDeFiNiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/iNvOiCeSeCtIoNs/iNvOiCeSeCtIoNnAmE/bIlLiNgRoLeDeFiNiTiOnS/rOlEdEfInItIoNnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/iNvOiCeSeCtIoNs/iNvOiCeSeCtIoNnAmE/bIlLiNgRoLeDeFiNiTiOnS/bIlLiNgRoLeDeFiNiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/billing/2024-04-01/billingsubscription/README.md b/resource-manager/billing/2024-04-01/billingsubscription/README.md index 388aa560ace..dd698ab8387 100644 --- a/resource-manager/billing/2024-04-01/billingsubscription/README.md +++ b/resource-manager/billing/2024-04-01/billingsubscription/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := billingsubscription.NewBillingSubscriptionAliasID("billingAccountName", "aliasName") +id := billingsubscription.NewBillingSubscriptionAliasID("billingAccountName", "billingSubscriptionAliasName") payload := billingsubscription.BillingSubscriptionAlias{ // ... @@ -41,7 +41,7 @@ if err := client.AliasesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := billingsubscription.NewBillingSubscriptionAliasID("billingAccountName", "aliasName") +id := billingsubscription.NewBillingSubscriptionAliasID("billingAccountName", "billingSubscriptionAliasName") read, err := client.AliasesGet(ctx, id) if err != nil { diff --git a/resource-manager/billing/2024-04-01/billingsubscription/id_billingsubscriptionalias.go b/resource-manager/billing/2024-04-01/billingsubscription/id_billingsubscriptionalias.go index bfba22c2470..480c8928efe 100644 --- a/resource-manager/billing/2024-04-01/billingsubscription/id_billingsubscriptionalias.go +++ b/resource-manager/billing/2024-04-01/billingsubscription/id_billingsubscriptionalias.go @@ -107,7 +107,7 @@ func (id BillingSubscriptionAliasId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticBillingAccounts", "billingAccounts", "billingAccounts"), resourceids.UserSpecifiedSegment("billingAccountName", "billingAccountName"), resourceids.StaticSegment("staticBillingSubscriptionAliases", "billingSubscriptionAliases", "billingSubscriptionAliases"), - resourceids.UserSpecifiedSegment("billingSubscriptionAliasName", "aliasName"), + resourceids.UserSpecifiedSegment("billingSubscriptionAliasName", "billingSubscriptionAliasName"), } } diff --git a/resource-manager/billing/2024-04-01/billingsubscription/id_billingsubscriptionalias_test.go b/resource-manager/billing/2024-04-01/billingsubscription/id_billingsubscriptionalias_test.go index 103d27d3a01..608375fc6b6 100644 --- a/resource-manager/billing/2024-04-01/billingsubscription/id_billingsubscriptionalias_test.go +++ b/resource-manager/billing/2024-04-01/billingsubscription/id_billingsubscriptionalias_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &BillingSubscriptionAliasId{} func TestNewBillingSubscriptionAliasID(t *testing.T) { - id := NewBillingSubscriptionAliasID("billingAccountName", "aliasName") + id := NewBillingSubscriptionAliasID("billingAccountName", "billingSubscriptionAliasName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") } - if id.BillingSubscriptionAliasName != "aliasName" { - t.Fatalf("Expected %q but got %q for Segment 'BillingSubscriptionAliasName'", id.BillingSubscriptionAliasName, "aliasName") + if id.BillingSubscriptionAliasName != "billingSubscriptionAliasName" { + t.Fatalf("Expected %q but got %q for Segment 'BillingSubscriptionAliasName'", id.BillingSubscriptionAliasName, "billingSubscriptionAliasName") } } func TestFormatBillingSubscriptionAliasID(t *testing.T) { - actual := NewBillingSubscriptionAliasID("billingAccountName", "aliasName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName" + actual := NewBillingSubscriptionAliasID("billingAccountName", "billingSubscriptionAliasName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseBillingSubscriptionAliasID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName", Expected: &BillingSubscriptionAliasId{ BillingAccountName: "billingAccountName", - BillingSubscriptionAliasName: "aliasName", + BillingSubscriptionAliasName: "billingSubscriptionAliasName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseBillingSubscriptionAliasIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName", Expected: &BillingSubscriptionAliasId{ BillingAccountName: "billingAccountName", - BillingSubscriptionAliasName: "aliasName", + BillingSubscriptionAliasName: "billingSubscriptionAliasName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/aliasName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingSubscriptionAliases/billingSubscriptionAliasName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgSuBsCrIpTiOnAlIaSeS/aLiAsNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgSuBsCrIpTiOnAlIaSeS/bIlLiNgSuBsCrIpTiOnAlIaSnAmE", Expected: &BillingSubscriptionAliasId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", - BillingSubscriptionAliasName: "aLiAsNaMe", + BillingSubscriptionAliasName: "bIlLiNgSuBsCrIpTiOnAlIaSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgSuBsCrIpTiOnAlIaSeS/aLiAsNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgSuBsCrIpTiOnAlIaSeS/bIlLiNgSuBsCrIpTiOnAlIaSnAmE/extra", Error: true, }, } diff --git a/resource-manager/billing/2024-04-01/invoice/model_invoicedocument.go b/resource-manager/billing/2024-04-01/invoice/model_invoicedocument.go index f1828018e6c..c598ef0d98b 100644 --- a/resource-manager/billing/2024-04-01/invoice/model_invoicedocument.go +++ b/resource-manager/billing/2024-04-01/invoice/model_invoicedocument.go @@ -5,7 +5,7 @@ package invoice type InvoiceDocument struct { DocumentNumbers *[]string `json:"documentNumbers,omitempty"` - ExternalUrl *string `json:"externalUrl,omitempty"` + ExternalURL *string `json:"externalUrl,omitempty"` Kind *InvoiceDocumentType `json:"kind,omitempty"` Name *string `json:"name,omitempty"` Source *DocumentSource `json:"source,omitempty"` diff --git a/resource-manager/billing/2024-04-01/paymentmethods/README.md b/resource-manager/billing/2024-04-01/paymentmethods/README.md index c6196e87657..c757405550f 100644 --- a/resource-manager/billing/2024-04-01/paymentmethods/README.md +++ b/resource-manager/billing/2024-04-01/paymentmethods/README.md @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := paymentmethods.NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodName") +id := paymentmethods.NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodLinkName") read, err := client.GetByBillingProfile(ctx, id) if err != nil { diff --git a/resource-manager/billing/2024-04-01/paymentmethods/id_paymentmethodlink.go b/resource-manager/billing/2024-04-01/paymentmethods/id_paymentmethodlink.go index 738b5d48c53..40445a6792e 100644 --- a/resource-manager/billing/2024-04-01/paymentmethods/id_paymentmethodlink.go +++ b/resource-manager/billing/2024-04-01/paymentmethods/id_paymentmethodlink.go @@ -115,7 +115,7 @@ func (id PaymentMethodLinkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticBillingProfiles", "billingProfiles", "billingProfiles"), resourceids.UserSpecifiedSegment("billingProfileName", "billingProfileName"), resourceids.StaticSegment("staticPaymentMethodLinks", "paymentMethodLinks", "paymentMethodLinks"), - resourceids.UserSpecifiedSegment("paymentMethodLinkName", "paymentMethodName"), + resourceids.UserSpecifiedSegment("paymentMethodLinkName", "paymentMethodLinkName"), } } diff --git a/resource-manager/billing/2024-04-01/paymentmethods/id_paymentmethodlink_test.go b/resource-manager/billing/2024-04-01/paymentmethods/id_paymentmethodlink_test.go index bc3f63dee3b..e78772e719c 100644 --- a/resource-manager/billing/2024-04-01/paymentmethods/id_paymentmethodlink_test.go +++ b/resource-manager/billing/2024-04-01/paymentmethods/id_paymentmethodlink_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PaymentMethodLinkId{} func TestNewPaymentMethodLinkID(t *testing.T) { - id := NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodName") + id := NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodLinkName") if id.BillingAccountName != "billingAccountName" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountName'", id.BillingAccountName, "billingAccountName") @@ -22,14 +22,14 @@ func TestNewPaymentMethodLinkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'BillingProfileName'", id.BillingProfileName, "billingProfileName") } - if id.PaymentMethodLinkName != "paymentMethodName" { - t.Fatalf("Expected %q but got %q for Segment 'PaymentMethodLinkName'", id.PaymentMethodLinkName, "paymentMethodName") + if id.PaymentMethodLinkName != "paymentMethodLinkName" { + t.Fatalf("Expected %q but got %q for Segment 'PaymentMethodLinkName'", id.PaymentMethodLinkName, "paymentMethodLinkName") } } func TestFormatPaymentMethodLinkID(t *testing.T) { - actual := NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName" + actual := NewPaymentMethodLinkID("billingAccountName", "billingProfileName", "paymentMethodLinkName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePaymentMethodLinkID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName", Expected: &PaymentMethodLinkId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", - PaymentMethodLinkName: "paymentMethodName", + PaymentMethodLinkName: "paymentMethodLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePaymentMethodLinkIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName", Expected: &PaymentMethodLinkId{ BillingAccountName: "billingAccountName", BillingProfileName: "billingProfileName", - PaymentMethodLinkName: "paymentMethodName", + PaymentMethodLinkName: "paymentMethodLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountName/billingProfiles/billingProfileName/paymentMethodLinks/paymentMethodLinkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/pAyMeNtMeThOdLiNkS/pAyMeNtMeThOdNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/pAyMeNtMeThOdLiNkS/pAyMeNtMeThOdLiNkNaMe", Expected: &PaymentMethodLinkId{ BillingAccountName: "bIlLiNgAcCoUnTnAmE", BillingProfileName: "bIlLiNgPrOfIlEnAmE", - PaymentMethodLinkName: "pAyMeNtMeThOdNaMe", + PaymentMethodLinkName: "pAyMeNtMeThOdLiNkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/pAyMeNtMeThOdLiNkS/pAyMeNtMeThOdNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTnAmE/bIlLiNgPrOfIlEs/bIlLiNgPrOfIlEnAmE/pAyMeNtMeThOdLiNkS/pAyMeNtMeThOdLiNkNaMe/extra", Error: true, }, } diff --git a/resource-manager/blueprints/2018-11-01-preview/assignment/README.md b/resource-manager/blueprints/2018-11-01-preview/assignment/README.md index a173d647535..aa7cecf3ec6 100644 --- a/resource-manager/blueprints/2018-11-01-preview/assignment/README.md +++ b/resource-manager/blueprints/2018-11-01-preview/assignment/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := assignment.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName") +id := assignment.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName") payload := assignment.Assignment{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := assignment.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName") +id := assignment.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName") read, err := client.Delete(ctx, id, assignment.DefaultDeleteOperationOptions()) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := assignment.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName") +id := assignment.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/blueprints/2018-11-01-preview/assignment/id_scopedblueprintassignment.go b/resource-manager/blueprints/2018-11-01-preview/assignment/id_scopedblueprintassignment.go index 101af80aa2e..5df0db2a590 100644 --- a/resource-manager/blueprints/2018-11-01-preview/assignment/id_scopedblueprintassignment.go +++ b/resource-manager/blueprints/2018-11-01-preview/assignment/id_scopedblueprintassignment.go @@ -106,7 +106,7 @@ func (id ScopedBlueprintAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBlueprint", "Microsoft.Blueprint", "Microsoft.Blueprint"), resourceids.StaticSegment("staticBlueprintAssignments", "blueprintAssignments", "blueprintAssignments"), - resourceids.UserSpecifiedSegment("blueprintAssignmentName", "assignmentName"), + resourceids.UserSpecifiedSegment("blueprintAssignmentName", "blueprintAssignmentName"), } } diff --git a/resource-manager/blueprints/2018-11-01-preview/assignment/id_scopedblueprintassignment_test.go b/resource-manager/blueprints/2018-11-01-preview/assignment/id_scopedblueprintassignment_test.go index 4f5c8020fb6..311e1272450 100644 --- a/resource-manager/blueprints/2018-11-01-preview/assignment/id_scopedblueprintassignment_test.go +++ b/resource-manager/blueprints/2018-11-01-preview/assignment/id_scopedblueprintassignment_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedBlueprintAssignmentId{} func TestNewScopedBlueprintAssignmentID(t *testing.T) { - id := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName") + id := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName") if id.ResourceScope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceScope'", id.ResourceScope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.BlueprintAssignmentName != "assignmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BlueprintAssignmentName'", id.BlueprintAssignmentName, "assignmentName") + if id.BlueprintAssignmentName != "blueprintAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'BlueprintAssignmentName'", id.BlueprintAssignmentName, "blueprintAssignmentName") } } func TestFormatScopedBlueprintAssignmentID(t *testing.T) { - actual := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName" + actual := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedBlueprintAssignmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - BlueprintAssignmentName: "assignmentName", + BlueprintAssignmentName: "blueprintAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedBlueprintAssignmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - BlueprintAssignmentName: "assignmentName", + BlueprintAssignmentName: "blueprintAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - BlueprintAssignmentName: "aSsIgNmEnTnAmE", + BlueprintAssignmentName: "bLuEpRiNtAsSiGnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/README.md b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/README.md index e1fce838cbf..218c1bc3189 100644 --- a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/README.md +++ b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := assignmentoperations.NewScopedAssignmentOperationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName", "assignmentOperationName") +id := assignmentoperations.NewScopedAssignmentOperationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName", "assignmentOperationName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := assignmentoperations.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName") +id := assignmentoperations.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedassignmentoperation.go b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedassignmentoperation.go index 0e643a44406..0c309ee9882 100644 --- a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedassignmentoperation.go +++ b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedassignmentoperation.go @@ -112,7 +112,7 @@ func (id ScopedAssignmentOperationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBlueprint", "Microsoft.Blueprint", "Microsoft.Blueprint"), resourceids.StaticSegment("staticBlueprintAssignments", "blueprintAssignments", "blueprintAssignments"), - resourceids.UserSpecifiedSegment("blueprintAssignmentName", "assignmentName"), + resourceids.UserSpecifiedSegment("blueprintAssignmentName", "blueprintAssignmentName"), resourceids.StaticSegment("staticAssignmentOperations", "assignmentOperations", "assignmentOperations"), resourceids.UserSpecifiedSegment("assignmentOperationName", "assignmentOperationName"), } diff --git a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedassignmentoperation_test.go b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedassignmentoperation_test.go index b06011960ae..a7aae765373 100644 --- a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedassignmentoperation_test.go +++ b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedassignmentoperation_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ScopedAssignmentOperationId{} func TestNewScopedAssignmentOperationID(t *testing.T) { - id := NewScopedAssignmentOperationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName", "assignmentOperationName") + id := NewScopedAssignmentOperationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName", "assignmentOperationName") if id.ResourceScope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceScope'", id.ResourceScope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.BlueprintAssignmentName != "assignmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BlueprintAssignmentName'", id.BlueprintAssignmentName, "assignmentName") + if id.BlueprintAssignmentName != "blueprintAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'BlueprintAssignmentName'", id.BlueprintAssignmentName, "blueprintAssignmentName") } if id.AssignmentOperationName != "assignmentOperationName" { @@ -28,8 +28,8 @@ func TestNewScopedAssignmentOperationID(t *testing.T) { } func TestFormatScopedAssignmentOperationID(t *testing.T) { - actual := NewScopedAssignmentOperationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName", "assignmentOperationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/assignmentOperations/assignmentOperationName" + actual := NewScopedAssignmentOperationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName", "assignmentOperationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/assignmentOperations/assignmentOperationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -68,26 +68,26 @@ func TestParseScopedAssignmentOperationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/assignmentOperations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/assignmentOperations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/assignmentOperations/assignmentOperationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/assignmentOperations/assignmentOperationName", Expected: &ScopedAssignmentOperationId{ ResourceScope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - BlueprintAssignmentName: "assignmentName", + BlueprintAssignmentName: "blueprintAssignmentName", AssignmentOperationName: "assignmentOperationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/assignmentOperations/assignmentOperationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/assignmentOperations/assignmentOperationName/extra", Error: true, }, } @@ -174,50 +174,50 @@ func TestParseScopedAssignmentOperationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/assignmentOperations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/assignmentOperations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE/aSsIgNmEnToPeRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe/aSsIgNmEnToPeRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/assignmentOperations/assignmentOperationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/assignmentOperations/assignmentOperationName", Expected: &ScopedAssignmentOperationId{ ResourceScope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - BlueprintAssignmentName: "assignmentName", + BlueprintAssignmentName: "blueprintAssignmentName", AssignmentOperationName: "assignmentOperationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/assignmentOperations/assignmentOperationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/assignmentOperations/assignmentOperationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE/aSsIgNmEnToPeRaTiOnS/aSsIgNmEnToPeRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe/aSsIgNmEnToPeRaTiOnS/aSsIgNmEnToPeRaTiOnNaMe", Expected: &ScopedAssignmentOperationId{ ResourceScope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - BlueprintAssignmentName: "aSsIgNmEnTnAmE", + BlueprintAssignmentName: "bLuEpRiNtAsSiGnMeNtNaMe", AssignmentOperationName: "aSsIgNmEnToPeRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE/aSsIgNmEnToPeRaTiOnS/aSsIgNmEnToPeRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe/aSsIgNmEnToPeRaTiOnS/aSsIgNmEnToPeRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedblueprintassignment.go b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedblueprintassignment.go index a20b94df4e1..722dc398e49 100644 --- a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedblueprintassignment.go +++ b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedblueprintassignment.go @@ -106,7 +106,7 @@ func (id ScopedBlueprintAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBlueprint", "Microsoft.Blueprint", "Microsoft.Blueprint"), resourceids.StaticSegment("staticBlueprintAssignments", "blueprintAssignments", "blueprintAssignments"), - resourceids.UserSpecifiedSegment("blueprintAssignmentName", "assignmentName"), + resourceids.UserSpecifiedSegment("blueprintAssignmentName", "blueprintAssignmentName"), } } diff --git a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedblueprintassignment_test.go b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedblueprintassignment_test.go index 43afe07455f..31e37228652 100644 --- a/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedblueprintassignment_test.go +++ b/resource-manager/blueprints/2018-11-01-preview/assignmentoperations/id_scopedblueprintassignment_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedBlueprintAssignmentId{} func TestNewScopedBlueprintAssignmentID(t *testing.T) { - id := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName") + id := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName") if id.ResourceScope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceScope'", id.ResourceScope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.BlueprintAssignmentName != "assignmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BlueprintAssignmentName'", id.BlueprintAssignmentName, "assignmentName") + if id.BlueprintAssignmentName != "blueprintAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'BlueprintAssignmentName'", id.BlueprintAssignmentName, "blueprintAssignmentName") } } func TestFormatScopedBlueprintAssignmentID(t *testing.T) { - actual := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName" + actual := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedBlueprintAssignmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - BlueprintAssignmentName: "assignmentName", + BlueprintAssignmentName: "blueprintAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedBlueprintAssignmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - BlueprintAssignmentName: "assignmentName", + BlueprintAssignmentName: "blueprintAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - BlueprintAssignmentName: "aSsIgNmEnTnAmE", + BlueprintAssignmentName: "bLuEpRiNtAsSiGnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/README.md b/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/README.md index 5ffac4a4702..42cb456e3bf 100644 --- a/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/README.md +++ b/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := blueprintassignments.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName") +id := blueprintassignments.NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName") read, err := client.AssignmentsWhoIsBlueprint(ctx, id) if err != nil { diff --git a/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/id_scopedblueprintassignment.go b/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/id_scopedblueprintassignment.go index 44e6c920f20..c0e7234ba04 100644 --- a/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/id_scopedblueprintassignment.go +++ b/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/id_scopedblueprintassignment.go @@ -106,7 +106,7 @@ func (id ScopedBlueprintAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBlueprint", "Microsoft.Blueprint", "Microsoft.Blueprint"), resourceids.StaticSegment("staticBlueprintAssignments", "blueprintAssignments", "blueprintAssignments"), - resourceids.UserSpecifiedSegment("blueprintAssignmentName", "assignmentName"), + resourceids.UserSpecifiedSegment("blueprintAssignmentName", "blueprintAssignmentName"), } } diff --git a/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/id_scopedblueprintassignment_test.go b/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/id_scopedblueprintassignment_test.go index c60079230bc..9c914d2dbf6 100644 --- a/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/id_scopedblueprintassignment_test.go +++ b/resource-manager/blueprints/2018-11-01-preview/blueprintassignments/id_scopedblueprintassignment_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedBlueprintAssignmentId{} func TestNewScopedBlueprintAssignmentID(t *testing.T) { - id := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName") + id := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName") if id.ResourceScope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceScope'", id.ResourceScope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.BlueprintAssignmentName != "assignmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BlueprintAssignmentName'", id.BlueprintAssignmentName, "assignmentName") + if id.BlueprintAssignmentName != "blueprintAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'BlueprintAssignmentName'", id.BlueprintAssignmentName, "blueprintAssignmentName") } } func TestFormatScopedBlueprintAssignmentID(t *testing.T) { - actual := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "assignmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName" + actual := NewScopedBlueprintAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "blueprintAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedBlueprintAssignmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - BlueprintAssignmentName: "assignmentName", + BlueprintAssignmentName: "blueprintAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedBlueprintAssignmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - BlueprintAssignmentName: "assignmentName", + BlueprintAssignmentName: "blueprintAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/assignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Blueprint/blueprintAssignments/blueprintAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe", Expected: &ScopedBlueprintAssignmentId{ ResourceScope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - BlueprintAssignmentName: "aSsIgNmEnTnAmE", + BlueprintAssignmentName: "bLuEpRiNtAsSiGnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/aSsIgNmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.bLuEpRiNt/bLuEpRiNtAsSiGnMeNtS/bLuEpRiNtAsSiGnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/botservice/2022-09-15/bot/model_botproperties.go b/resource-manager/botservice/2022-09-15/bot/model_botproperties.go index 04f482df33e..8470e090532 100644 --- a/resource-manager/botservice/2022-09-15/bot/model_botproperties.go +++ b/resource-manager/botservice/2022-09-15/bot/model_botproperties.go @@ -7,7 +7,7 @@ type BotProperties struct { AllSettings *map[string]string `json:"allSettings,omitempty"` AppPasswordHint *string `json:"appPasswordHint,omitempty"` CmekEncryptionStatus *string `json:"cmekEncryptionStatus,omitempty"` - CmekKeyVaultUrl *string `json:"cmekKeyVaultUrl,omitempty"` + CmekKeyVaultURL *string `json:"cmekKeyVaultUrl,omitempty"` ConfiguredChannels *[]string `json:"configuredChannels,omitempty"` Description *string `json:"description,omitempty"` DeveloperAppInsightKey *string `json:"developerAppInsightKey,omitempty"` @@ -18,13 +18,13 @@ type BotProperties struct { EnabledChannels *[]string `json:"enabledChannels,omitempty"` Endpoint string `json:"endpoint"` EndpointVersion *string `json:"endpointVersion,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` IsCmekEnabled *bool `json:"isCmekEnabled,omitempty"` IsDeveloperAppInsightsApiKeySet *bool `json:"isDeveloperAppInsightsApiKeySet,omitempty"` IsStreamingSupported *bool `json:"isStreamingSupported,omitempty"` LuisAppIds *[]string `json:"luisAppIds,omitempty"` LuisKey *string `json:"luisKey,omitempty"` - ManifestUrl *string `json:"manifestUrl,omitempty"` + ManifestURL *string `json:"manifestUrl,omitempty"` MigrationToken *string `json:"migrationToken,omitempty"` MsaAppId string `json:"msaAppId"` MsaAppMSIResourceId *string `json:"msaAppMSIResourceId,omitempty"` diff --git a/resource-manager/botservice/2022-09-15/botconnection/README.md b/resource-manager/botservice/2022-09-15/botconnection/README.md index 56d8ef9c815..557d56f88cf 100644 --- a/resource-manager/botservice/2022-09-15/botconnection/README.md +++ b/resource-manager/botservice/2022-09-15/botconnection/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "connectionName") +id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "connectionName") payload := botconnection.ConnectionSetting{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "connectionName") +id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "connectionName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "connectionName") +id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "connectionName") +id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "connectionName") read, err := client.ListWithSecrets(ctx, id) if err != nil { @@ -111,7 +111,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "connectionName") +id := botconnection.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "connectionName") payload := botconnection.ConnectionSetting{ // ... diff --git a/resource-manager/botservice/2022-09-15/botconnection/id_connection.go b/resource-manager/botservice/2022-09-15/botconnection/id_connection.go index 360408612f8..847eabe012f 100644 --- a/resource-manager/botservice/2022-09-15/botconnection/id_connection.go +++ b/resource-manager/botservice/2022-09-15/botconnection/id_connection.go @@ -121,7 +121,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBotService", "Microsoft.BotService", "Microsoft.BotService"), resourceids.StaticSegment("staticBotServices", "botServices", "botServices"), - resourceids.UserSpecifiedSegment("botServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("botServiceName", "botServiceName"), resourceids.StaticSegment("staticConnections", "connections", "connections"), resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } diff --git a/resource-manager/botservice/2022-09-15/botconnection/id_connection_test.go b/resource-manager/botservice/2022-09-15/botconnection/id_connection_test.go index a6d19846c2f..a777de1a82f 100644 --- a/resource-manager/botservice/2022-09-15/botconnection/id_connection_test.go +++ b/resource-manager/botservice/2022-09-15/botconnection/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "connectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BotServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'BotServiceName'", id.BotServiceName, "resourceName") + if id.BotServiceName != "botServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'BotServiceName'", id.BotServiceName, "botServiceName") } if id.ConnectionName != "connectionName" { @@ -32,8 +32,8 @@ func TestNewConnectionID(t *testing.T) { } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/connections/connectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/connections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BotServiceName: "resourceName", + BotServiceName: "botServiceName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/connections/connectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/bOtSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/connections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/rEsOuRcEnAmE/cOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/bOtSeRvIcEnAmE/cOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BotServiceName: "resourceName", + BotServiceName: "botServiceName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/rEsOuRcEnAmE/cOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/bOtSeRvIcEnAmE/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BotServiceName: "rEsOuRcEnAmE", + BotServiceName: "bOtSeRvIcEnAmE", ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/rEsOuRcEnAmE/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/bOtSeRvIcEnAmE/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/botservice/2022-09-15/bothostsettings/model_hostsettingsresponse.go b/resource-manager/botservice/2022-09-15/bothostsettings/model_hostsettingsresponse.go index 72042a47622..c963cae73d7 100644 --- a/resource-manager/botservice/2022-09-15/bothostsettings/model_hostsettingsresponse.go +++ b/resource-manager/botservice/2022-09-15/bothostsettings/model_hostsettingsresponse.go @@ -5,11 +5,11 @@ package bothostsettings type HostSettingsResponse struct { BotOpenIdMetadata *string `json:"BotOpenIdMetadata,omitempty"` - OAuthUrl *string `json:"OAuthUrl,omitempty"` - ToBotFromChannelOpenIdMetadataUrl *string `json:"ToBotFromChannelOpenIdMetadataUrl,omitempty"` + OAuthURL *string `json:"OAuthUrl,omitempty"` + ToBotFromChannelOpenIdMetadataURL *string `json:"ToBotFromChannelOpenIdMetadataUrl,omitempty"` ToBotFromChannelTokenIssuer *string `json:"ToBotFromChannelTokenIssuer,omitempty"` - ToBotFromEmulatorOpenIdMetadataUrl *string `json:"ToBotFromEmulatorOpenIdMetadataUrl,omitempty"` - ToChannelFromBotLoginUrl *string `json:"ToChannelFromBotLoginUrl,omitempty"` + ToBotFromEmulatorOpenIdMetadataURL *string `json:"ToBotFromEmulatorOpenIdMetadataUrl,omitempty"` + ToChannelFromBotLoginURL *string `json:"ToChannelFromBotLoginUrl,omitempty"` ToChannelFromBotOAuthScope *string `json:"ToChannelFromBotOAuthScope,omitempty"` ValidateAuthority *bool `json:"ValidateAuthority,omitempty"` } diff --git a/resource-manager/botservice/2022-09-15/channel/README.md b/resource-manager/botservice/2022-09-15/channel/README.md index f216106564d..1bbb669a912 100644 --- a/resource-manager/botservice/2022-09-15/channel/README.md +++ b/resource-manager/botservice/2022-09-15/channel/README.md @@ -79,13 +79,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ChannelClient.EmailCreateSignInUrl` +### Example Usage: `ChannelClient.EmailCreateSignInURL` ```go ctx := context.TODO() id := commonids.NewBotServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName") -read, err := client.EmailCreateSignInUrl(ctx, id) +read, err := client.EmailCreateSignInURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/botservice/2022-09-15/channel/method_emailcreatesigninurl.go b/resource-manager/botservice/2022-09-15/channel/method_emailcreatesigninurl.go index 5c7bfa1d088..711ba96e1f8 100644 --- a/resource-manager/botservice/2022-09-15/channel/method_emailcreatesigninurl.go +++ b/resource-manager/botservice/2022-09-15/channel/method_emailcreatesigninurl.go @@ -13,14 +13,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type EmailCreateSignInUrlOperationResponse struct { +type EmailCreateSignInURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *CreateEmailSignInUrlResponse + Model *CreateEmailSignInURLResponse } -// EmailCreateSignInUrl ... -func (c ChannelClient) EmailCreateSignInUrl(ctx context.Context, id commonids.BotServiceId) (result EmailCreateSignInUrlOperationResponse, err error) { +// EmailCreateSignInURL ... +func (c ChannelClient) EmailCreateSignInURL(ctx context.Context, id commonids.BotServiceId) (result EmailCreateSignInURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -45,7 +45,7 @@ func (c ChannelClient) EmailCreateSignInUrl(ctx context.Context, id commonids.Bo return } - var model CreateEmailSignInUrlResponse + var model CreateEmailSignInURLResponse result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/botservice/2022-09-15/channel/model_channelsettings.go b/resource-manager/botservice/2022-09-15/channel/model_channelsettings.go index f188e82ca36..fbbb75cd7a3 100644 --- a/resource-manager/botservice/2022-09-15/channel/model_channelsettings.go +++ b/resource-manager/botservice/2022-09-15/channel/model_channelsettings.go @@ -4,7 +4,7 @@ package channel // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ChannelSettings struct { - BotIconUrl *string `json:"botIconUrl,omitempty"` + BotIconURL *string `json:"botIconUrl,omitempty"` BotId *string `json:"botId,omitempty"` ChannelDisplayName *string `json:"channelDisplayName,omitempty"` ChannelId *string `json:"channelId,omitempty"` diff --git a/resource-manager/botservice/2022-09-15/channel/model_createemailsigninurlresponse.go b/resource-manager/botservice/2022-09-15/channel/model_createemailsigninurlresponse.go index 63713e4658d..f25c00bea17 100644 --- a/resource-manager/botservice/2022-09-15/channel/model_createemailsigninurlresponse.go +++ b/resource-manager/botservice/2022-09-15/channel/model_createemailsigninurlresponse.go @@ -3,8 +3,8 @@ package channel // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CreateEmailSignInUrlResponse struct { +type CreateEmailSignInURLResponse struct { Id *string `json:"id,omitempty"` Location *string `json:"location,omitempty"` - Properties *CreateEmailSignInUrlResponseProperties `json:"properties,omitempty"` + Properties *CreateEmailSignInURLResponseProperties `json:"properties,omitempty"` } diff --git a/resource-manager/botservice/2022-09-15/channel/model_createemailsigninurlresponseproperties.go b/resource-manager/botservice/2022-09-15/channel/model_createemailsigninurlresponseproperties.go index eb5780dbdc8..cc43096f3de 100644 --- a/resource-manager/botservice/2022-09-15/channel/model_createemailsigninurlresponseproperties.go +++ b/resource-manager/botservice/2022-09-15/channel/model_createemailsigninurlresponseproperties.go @@ -3,6 +3,6 @@ package channel // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CreateEmailSignInUrlResponseProperties struct { +type CreateEmailSignInURLResponseProperties struct { Url *string `json:"url,omitempty"` } diff --git a/resource-manager/botservice/2022-09-15/channel/model_facebookchannelproperties.go b/resource-manager/botservice/2022-09-15/channel/model_facebookchannelproperties.go index 456556ddc40..32418ab885a 100644 --- a/resource-manager/botservice/2022-09-15/channel/model_facebookchannelproperties.go +++ b/resource-manager/botservice/2022-09-15/channel/model_facebookchannelproperties.go @@ -6,7 +6,7 @@ package channel type FacebookChannelProperties struct { AppId string `json:"appId"` AppSecret *string `json:"appSecret,omitempty"` - CallbackUrl *string `json:"callbackUrl,omitempty"` + CallbackURL *string `json:"callbackUrl,omitempty"` IsEnabled bool `json:"isEnabled"` Pages *[]FacebookPage `json:"pages,omitempty"` VerifyToken *string `json:"verifyToken,omitempty"` diff --git a/resource-manager/botservice/2022-09-15/channel/model_linechannelproperties.go b/resource-manager/botservice/2022-09-15/channel/model_linechannelproperties.go index 396523b4894..2e97d168352 100644 --- a/resource-manager/botservice/2022-09-15/channel/model_linechannelproperties.go +++ b/resource-manager/botservice/2022-09-15/channel/model_linechannelproperties.go @@ -4,7 +4,7 @@ package channel // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type LineChannelProperties struct { - CallbackUrl *string `json:"callbackUrl,omitempty"` + CallbackURL *string `json:"callbackUrl,omitempty"` IsValidated *bool `json:"isValidated,omitempty"` LineRegistrations []LineRegistration `json:"lineRegistrations"` } diff --git a/resource-manager/botservice/2022-09-15/channel/model_slackchannelproperties.go b/resource-manager/botservice/2022-09-15/channel/model_slackchannelproperties.go index b72f28e781b..55c6c0fcef4 100644 --- a/resource-manager/botservice/2022-09-15/channel/model_slackchannelproperties.go +++ b/resource-manager/botservice/2022-09-15/channel/model_slackchannelproperties.go @@ -8,7 +8,7 @@ type SlackChannelProperties struct { ClientSecret *string `json:"clientSecret,omitempty"` IsEnabled bool `json:"isEnabled"` IsValidated *bool `json:"IsValidated,omitempty"` - LandingPageUrl *string `json:"landingPageUrl,omitempty"` + LandingPageURL *string `json:"landingPageUrl,omitempty"` LastSubmissionId *string `json:"lastSubmissionId,omitempty"` RedirectAction *string `json:"redirectAction,omitempty"` RegisterBeforeOAuthFlow *bool `json:"registerBeforeOAuthFlow,omitempty"` diff --git a/resource-manager/botservice/2022-09-15/listserviceproviders/model_serviceproviderparameter.go b/resource-manager/botservice/2022-09-15/listserviceproviders/model_serviceproviderparameter.go index bb46eea4c63..28c70034445 100644 --- a/resource-manager/botservice/2022-09-15/listserviceproviders/model_serviceproviderparameter.go +++ b/resource-manager/botservice/2022-09-15/listserviceproviders/model_serviceproviderparameter.go @@ -7,7 +7,7 @@ type ServiceProviderParameter struct { Default *string `json:"default,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - HelpUrl *string `json:"helpUrl,omitempty"` + HelpURL *string `json:"helpUrl,omitempty"` Metadata *ServiceProviderParameterMetadata `json:"metadata,omitempty"` Name *string `json:"name,omitempty"` Type *string `json:"type,omitempty"` diff --git a/resource-manager/botservice/2022-09-15/listserviceproviders/model_serviceproviderproperties.go b/resource-manager/botservice/2022-09-15/listserviceproviders/model_serviceproviderproperties.go index 4c0566ed90f..5c8480edb39 100644 --- a/resource-manager/botservice/2022-09-15/listserviceproviders/model_serviceproviderproperties.go +++ b/resource-manager/botservice/2022-09-15/listserviceproviders/model_serviceproviderproperties.go @@ -4,9 +4,9 @@ package listserviceproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ServiceProviderProperties struct { - DevPortalUrl *string `json:"devPortalUrl,omitempty"` + DevPortalURL *string `json:"devPortalUrl,omitempty"` DisplayName *string `json:"displayName,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` Id *string `json:"id,omitempty"` Parameters *[]ServiceProviderParameter `json:"parameters,omitempty"` ServiceProviderName *string `json:"serviceProviderName,omitempty"` diff --git a/resource-manager/botservice/2022-09-15/privateendpointconnections/README.md b/resource-manager/botservice/2022-09-15/privateendpointconnections/README.md index 2c6d3fce97b..21134ff2b0a 100644 --- a/resource-manager/botservice/2022-09-15/privateendpointconnections/README.md +++ b/resource-manager/botservice/2022-09-15/privateendpointconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "privateEndpointConnectionName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/botservice/2022-09-15/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/botservice/2022-09-15/privateendpointconnections/id_privateendpointconnection.go index 4c06d15bc93..157294aa3d4 100644 --- a/resource-manager/botservice/2022-09-15/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/botservice/2022-09-15/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftBotService", "Microsoft.BotService", "Microsoft.BotService"), resourceids.StaticSegment("staticBotServices", "botServices", "botServices"), - resourceids.UserSpecifiedSegment("botServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("botServiceName", "botServiceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/botservice/2022-09-15/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/botservice/2022-09-15/privateendpointconnections/id_privateendpointconnection_test.go index 54cf641e0dc..3c72dceca15 100644 --- a/resource-manager/botservice/2022-09-15/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/botservice/2022-09-15/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BotServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'BotServiceName'", id.BotServiceName, "resourceName") + if id.BotServiceName != "botServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'BotServiceName'", id.BotServiceName, "botServiceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botServiceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BotServiceName: "resourceName", + BotServiceName: "botServiceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/bOtSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/bOtSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BotServiceName: "resourceName", + BotServiceName: "botServiceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.BotService/botServices/botServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/bOtSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BotServiceName: "rEsOuRcEnAmE", + BotServiceName: "bOtSeRvIcEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.bOtSeRvIcE/bOtSeRvIcEs/bOtSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cdn/2024-02-01/afdendpoints/README.md b/resource-manager/cdn/2024-02-01/afdendpoints/README.md index d4d936c04fd..19986be119d 100644 --- a/resource-manager/cdn/2024-02-01/afdendpoints/README.md +++ b/resource-manager/cdn/2024-02-01/afdendpoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") +id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") payload := afdendpoints.AFDEndpoint{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") +id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") +id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") +id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") // alternatively `client.ListResourceUsage(ctx, id)` can be used to do batched pagination items, err := client.ListResourceUsageComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") +id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") payload := afdendpoints.AfdPurgeParameters{ // ... @@ -120,7 +120,7 @@ if err := client.PurgeContentThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") +id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") payload := afdendpoints.AFDEndpointUpdateParameters{ // ... @@ -137,7 +137,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") +id := afdendpoints.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") payload := afdendpoints.ValidateCustomDomainInput{ // ... diff --git a/resource-manager/cdn/2024-02-01/afdendpoints/id_afdendpoint.go b/resource-manager/cdn/2024-02-01/afdendpoints/id_afdendpoint.go index b20dda196dd..7548872fa4a 100644 --- a/resource-manager/cdn/2024-02-01/afdendpoints/id_afdendpoint.go +++ b/resource-manager/cdn/2024-02-01/afdendpoints/id_afdendpoint.go @@ -123,7 +123,7 @@ func (id AfdEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProfiles", "profiles", "profiles"), resourceids.UserSpecifiedSegment("profileName", "profileName"), resourceids.StaticSegment("staticAfdEndpoints", "afdEndpoints", "afdEndpoints"), - resourceids.UserSpecifiedSegment("afdEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("afdEndpointName", "afdEndpointName"), } } diff --git a/resource-manager/cdn/2024-02-01/afdendpoints/id_afdendpoint_test.go b/resource-manager/cdn/2024-02-01/afdendpoints/id_afdendpoint_test.go index 65309b89324..17925820c6d 100644 --- a/resource-manager/cdn/2024-02-01/afdendpoints/id_afdendpoint_test.go +++ b/resource-manager/cdn/2024-02-01/afdendpoints/id_afdendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AfdEndpointId{} func TestNewAfdEndpointID(t *testing.T) { - id := NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") + id := NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAfdEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProfileName'", id.ProfileName, "profileName") } - if id.AfdEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'AfdEndpointName'", id.AfdEndpointName, "endpointName") + if id.AfdEndpointName != "afdEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'AfdEndpointName'", id.AfdEndpointName, "afdEndpointName") } } func TestFormatAfdEndpointID(t *testing.T) { - actual := NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName" + actual := NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAfdEndpointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName", Expected: &AfdEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProfileName: "profileName", - AfdEndpointName: "endpointName", + AfdEndpointName: "afdEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAfdEndpointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName", Expected: &AfdEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProfileName: "profileName", - AfdEndpointName: "endpointName", + AfdEndpointName: "afdEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/aFdEnDpOiNtNaMe", Expected: &AfdEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ProfileName: "pRoFiLeNaMe", - AfdEndpointName: "eNdPoInTnAmE", + AfdEndpointName: "aFdEnDpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/eNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/aFdEnDpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cdn/2024-02-01/afdprofiles/constants.go b/resource-manager/cdn/2024-02-01/afdprofiles/constants.go index c6ab80b56dd..da6f76c8fea 100644 --- a/resource-manager/cdn/2024-02-01/afdprofiles/constants.go +++ b/resource-manager/cdn/2024-02-01/afdprofiles/constants.go @@ -379,7 +379,7 @@ const ( SecretTypeAzureFirstPartyManagedCertificate SecretType = "AzureFirstPartyManagedCertificate" SecretTypeCustomerCertificate SecretType = "CustomerCertificate" SecretTypeManagedCertificate SecretType = "ManagedCertificate" - SecretTypeUrlSigningKey SecretType = "UrlSigningKey" + SecretTypeURLSigningKey SecretType = "UrlSigningKey" ) func PossibleValuesForSecretType() []string { @@ -387,7 +387,7 @@ func PossibleValuesForSecretType() []string { string(SecretTypeAzureFirstPartyManagedCertificate), string(SecretTypeCustomerCertificate), string(SecretTypeManagedCertificate), - string(SecretTypeUrlSigningKey), + string(SecretTypeURLSigningKey), } } @@ -409,7 +409,7 @@ func parseSecretType(input string) (*SecretType, error) { "azurefirstpartymanagedcertificate": SecretTypeAzureFirstPartyManagedCertificate, "customercertificate": SecretTypeCustomerCertificate, "managedcertificate": SecretTypeManagedCertificate, - "urlsigningkey": SecretTypeUrlSigningKey, + "urlsigningkey": SecretTypeURLSigningKey, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/constants.go b/resource-manager/cdn/2024-02-01/endpoints/constants.go index fec07d91d23..489637e32e3 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/constants.go +++ b/resource-manager/cdn/2024-02-01/endpoints/constants.go @@ -268,9 +268,9 @@ const ( DeliveryRuleActionNameModifyResponseHeader DeliveryRuleActionName = "ModifyResponseHeader" DeliveryRuleActionNameOriginGroupOverride DeliveryRuleActionName = "OriginGroupOverride" DeliveryRuleActionNameRouteConfigurationOverride DeliveryRuleActionName = "RouteConfigurationOverride" - DeliveryRuleActionNameUrlRedirect DeliveryRuleActionName = "UrlRedirect" - DeliveryRuleActionNameUrlRewrite DeliveryRuleActionName = "UrlRewrite" - DeliveryRuleActionNameUrlSigning DeliveryRuleActionName = "UrlSigning" + DeliveryRuleActionNameURLRedirect DeliveryRuleActionName = "UrlRedirect" + DeliveryRuleActionNameURLRewrite DeliveryRuleActionName = "UrlRewrite" + DeliveryRuleActionNameURLSigning DeliveryRuleActionName = "UrlSigning" ) func PossibleValuesForDeliveryRuleActionName() []string { @@ -281,9 +281,9 @@ func PossibleValuesForDeliveryRuleActionName() []string { string(DeliveryRuleActionNameModifyResponseHeader), string(DeliveryRuleActionNameOriginGroupOverride), string(DeliveryRuleActionNameRouteConfigurationOverride), - string(DeliveryRuleActionNameUrlRedirect), - string(DeliveryRuleActionNameUrlRewrite), - string(DeliveryRuleActionNameUrlSigning), + string(DeliveryRuleActionNameURLRedirect), + string(DeliveryRuleActionNameURLRewrite), + string(DeliveryRuleActionNameURLSigning), } } @@ -308,9 +308,9 @@ func parseDeliveryRuleActionName(input string) (*DeliveryRuleActionName, error) "modifyresponseheader": DeliveryRuleActionNameModifyResponseHeader, "origingroupoverride": DeliveryRuleActionNameOriginGroupOverride, "routeconfigurationoverride": DeliveryRuleActionNameRouteConfigurationOverride, - "urlredirect": DeliveryRuleActionNameUrlRedirect, - "urlrewrite": DeliveryRuleActionNameUrlRewrite, - "urlsigning": DeliveryRuleActionNameUrlSigning, + "urlredirect": DeliveryRuleActionNameURLRedirect, + "urlrewrite": DeliveryRuleActionNameURLRewrite, + "urlsigning": DeliveryRuleActionNameURLSigning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -329,9 +329,9 @@ const ( DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters DeliveryRuleActionParametersType = "DeliveryRuleHeaderActionParameters" DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters DeliveryRuleActionParametersType = "DeliveryRuleOriginGroupOverrideActionParameters" DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters DeliveryRuleActionParametersType = "DeliveryRuleRouteConfigurationOverrideActionParameters" - DeliveryRuleActionParametersTypeDeliveryRuleUrlRedirectActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRedirectActionParameters" - DeliveryRuleActionParametersTypeDeliveryRuleUrlRewriteActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRewriteActionParameters" - DeliveryRuleActionParametersTypeDeliveryRuleUrlSigningActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlSigningActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRedirectActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRewriteActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlSigningActionParameters" ) func PossibleValuesForDeliveryRuleActionParametersType() []string { @@ -341,9 +341,9 @@ func PossibleValuesForDeliveryRuleActionParametersType() []string { string(DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters), string(DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters), string(DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters), - string(DeliveryRuleActionParametersTypeDeliveryRuleUrlRedirectActionParameters), - string(DeliveryRuleActionParametersTypeDeliveryRuleUrlRewriteActionParameters), - string(DeliveryRuleActionParametersTypeDeliveryRuleUrlSigningActionParameters), + string(DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters), + string(DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters), + string(DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters), } } @@ -367,9 +367,9 @@ func parseDeliveryRuleActionParametersType(input string) (*DeliveryRuleActionPar "deliveryruleheaderactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters, "deliveryruleorigingroupoverrideactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters, "deliveryrulerouteconfigurationoverrideactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters, - "deliveryruleurlredirectactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleUrlRedirectActionParameters, - "deliveryruleurlrewriteactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleUrlRewriteActionParameters, - "deliveryruleurlsigningactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleUrlSigningActionParameters, + "deliveryruleurlredirectactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters, + "deliveryruleurlrewriteactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters, + "deliveryruleurlsigningactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -399,9 +399,9 @@ const ( DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleServerPortConditionParameters" DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleSocketAddrConditionParameters" DeliveryRuleConditionParametersTypeDeliveryRuleSslProtocolConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleSslProtocolConditionParameters" - DeliveryRuleConditionParametersTypeDeliveryRuleUrlFileExtensionMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFileExtensionMatchConditionParameters" - DeliveryRuleConditionParametersTypeDeliveryRuleUrlFilenameConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFilenameConditionParameters" - DeliveryRuleConditionParametersTypeDeliveryRuleUrlPathMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlPathMatchConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFileExtensionMatchConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFilenameConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlPathMatchConditionParameters" ) func PossibleValuesForDeliveryRuleConditionParametersType() []string { @@ -422,9 +422,9 @@ func PossibleValuesForDeliveryRuleConditionParametersType() []string { string(DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters), string(DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters), string(DeliveryRuleConditionParametersTypeDeliveryRuleSslProtocolConditionParameters), - string(DeliveryRuleConditionParametersTypeDeliveryRuleUrlFileExtensionMatchConditionParameters), - string(DeliveryRuleConditionParametersTypeDeliveryRuleUrlFilenameConditionParameters), - string(DeliveryRuleConditionParametersTypeDeliveryRuleUrlPathMatchConditionParameters), + string(DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters), + string(DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters), + string(DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters), } } @@ -459,9 +459,9 @@ func parseDeliveryRuleConditionParametersType(input string) (*DeliveryRuleCondit "deliveryruleserverportconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters, "deliveryrulesocketaddrconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters, "deliveryrulesslprotocolconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleSslProtocolConditionParameters, - "deliveryruleurlfileextensionmatchconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleUrlFileExtensionMatchConditionParameters, - "deliveryruleurlfilenameconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleUrlFilenameConditionParameters, - "deliveryruleurlpathmatchconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleUrlPathMatchConditionParameters, + "deliveryruleurlfileextensionmatchconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters, + "deliveryruleurlfilenameconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters, + "deliveryruleurlpathmatchconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -1031,9 +1031,9 @@ const ( MatchVariableServerPort MatchVariable = "ServerPort" MatchVariableSocketAddr MatchVariable = "SocketAddr" MatchVariableSslProtocol MatchVariable = "SslProtocol" - MatchVariableUrlFileExtension MatchVariable = "UrlFileExtension" - MatchVariableUrlFileName MatchVariable = "UrlFileName" - MatchVariableUrlPath MatchVariable = "UrlPath" + MatchVariableURLFileExtension MatchVariable = "UrlFileExtension" + MatchVariableURLFileName MatchVariable = "UrlFileName" + MatchVariableURLPath MatchVariable = "UrlPath" ) func PossibleValuesForMatchVariable() []string { @@ -1054,9 +1054,9 @@ func PossibleValuesForMatchVariable() []string { string(MatchVariableServerPort), string(MatchVariableSocketAddr), string(MatchVariableSslProtocol), - string(MatchVariableUrlFileExtension), - string(MatchVariableUrlFileName), - string(MatchVariableUrlPath), + string(MatchVariableURLFileExtension), + string(MatchVariableURLFileName), + string(MatchVariableURLPath), } } @@ -1091,9 +1091,9 @@ func parseMatchVariable(input string) (*MatchVariable, error) { "serverport": MatchVariableServerPort, "socketaddr": MatchVariableSocketAddr, "sslprotocol": MatchVariableSslProtocol, - "urlfileextension": MatchVariableUrlFileExtension, - "urlfilename": MatchVariableUrlFileName, - "urlpath": MatchVariableUrlPath, + "urlfileextension": MatchVariableURLFileExtension, + "urlfilename": MatchVariableURLFileName, + "urlpath": MatchVariableURLPath, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -2383,9 +2383,9 @@ const ( TransformLowercase Transform = "Lowercase" TransformRemoveNulls Transform = "RemoveNulls" TransformTrim Transform = "Trim" + TransformURLDecode Transform = "UrlDecode" + TransformURLEncode Transform = "UrlEncode" TransformUppercase Transform = "Uppercase" - TransformUrlDecode Transform = "UrlDecode" - TransformUrlEncode Transform = "UrlEncode" ) func PossibleValuesForTransform() []string { @@ -2393,9 +2393,9 @@ func PossibleValuesForTransform() []string { string(TransformLowercase), string(TransformRemoveNulls), string(TransformTrim), + string(TransformURLDecode), + string(TransformURLEncode), string(TransformUppercase), - string(TransformUrlDecode), - string(TransformUrlEncode), } } @@ -2417,9 +2417,9 @@ func parseTransform(input string) (*Transform, error) { "lowercase": TransformLowercase, "removenulls": TransformRemoveNulls, "trim": TransformTrim, + "urldecode": TransformURLDecode, + "urlencode": TransformURLEncode, "uppercase": TransformUppercase, - "urldecode": TransformUrlDecode, - "urlencode": TransformUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -2430,42 +2430,42 @@ func parseTransform(input string) (*Transform, error) { return &out, nil } -type UrlFileExtensionOperator string +type URLFileExtensionOperator string const ( - UrlFileExtensionOperatorAny UrlFileExtensionOperator = "Any" - UrlFileExtensionOperatorBeginsWith UrlFileExtensionOperator = "BeginsWith" - UrlFileExtensionOperatorContains UrlFileExtensionOperator = "Contains" - UrlFileExtensionOperatorEndsWith UrlFileExtensionOperator = "EndsWith" - UrlFileExtensionOperatorEqual UrlFileExtensionOperator = "Equal" - UrlFileExtensionOperatorGreaterThan UrlFileExtensionOperator = "GreaterThan" - UrlFileExtensionOperatorGreaterThanOrEqual UrlFileExtensionOperator = "GreaterThanOrEqual" - UrlFileExtensionOperatorLessThan UrlFileExtensionOperator = "LessThan" - UrlFileExtensionOperatorLessThanOrEqual UrlFileExtensionOperator = "LessThanOrEqual" - UrlFileExtensionOperatorRegEx UrlFileExtensionOperator = "RegEx" + URLFileExtensionOperatorAny URLFileExtensionOperator = "Any" + URLFileExtensionOperatorBeginsWith URLFileExtensionOperator = "BeginsWith" + URLFileExtensionOperatorContains URLFileExtensionOperator = "Contains" + URLFileExtensionOperatorEndsWith URLFileExtensionOperator = "EndsWith" + URLFileExtensionOperatorEqual URLFileExtensionOperator = "Equal" + URLFileExtensionOperatorGreaterThan URLFileExtensionOperator = "GreaterThan" + URLFileExtensionOperatorGreaterThanOrEqual URLFileExtensionOperator = "GreaterThanOrEqual" + URLFileExtensionOperatorLessThan URLFileExtensionOperator = "LessThan" + URLFileExtensionOperatorLessThanOrEqual URLFileExtensionOperator = "LessThanOrEqual" + URLFileExtensionOperatorRegEx URLFileExtensionOperator = "RegEx" ) -func PossibleValuesForUrlFileExtensionOperator() []string { +func PossibleValuesForURLFileExtensionOperator() []string { return []string{ - string(UrlFileExtensionOperatorAny), - string(UrlFileExtensionOperatorBeginsWith), - string(UrlFileExtensionOperatorContains), - string(UrlFileExtensionOperatorEndsWith), - string(UrlFileExtensionOperatorEqual), - string(UrlFileExtensionOperatorGreaterThan), - string(UrlFileExtensionOperatorGreaterThanOrEqual), - string(UrlFileExtensionOperatorLessThan), - string(UrlFileExtensionOperatorLessThanOrEqual), - string(UrlFileExtensionOperatorRegEx), + string(URLFileExtensionOperatorAny), + string(URLFileExtensionOperatorBeginsWith), + string(URLFileExtensionOperatorContains), + string(URLFileExtensionOperatorEndsWith), + string(URLFileExtensionOperatorEqual), + string(URLFileExtensionOperatorGreaterThan), + string(URLFileExtensionOperatorGreaterThanOrEqual), + string(URLFileExtensionOperatorLessThan), + string(URLFileExtensionOperatorLessThanOrEqual), + string(URLFileExtensionOperatorRegEx), } } -func (s *UrlFileExtensionOperator) UnmarshalJSON(bytes []byte) error { +func (s *URLFileExtensionOperator) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseUrlFileExtensionOperator(decoded) + out, err := parseURLFileExtensionOperator(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -2473,64 +2473,64 @@ func (s *UrlFileExtensionOperator) UnmarshalJSON(bytes []byte) error { return nil } -func parseUrlFileExtensionOperator(input string) (*UrlFileExtensionOperator, error) { - vals := map[string]UrlFileExtensionOperator{ - "any": UrlFileExtensionOperatorAny, - "beginswith": UrlFileExtensionOperatorBeginsWith, - "contains": UrlFileExtensionOperatorContains, - "endswith": UrlFileExtensionOperatorEndsWith, - "equal": UrlFileExtensionOperatorEqual, - "greaterthan": UrlFileExtensionOperatorGreaterThan, - "greaterthanorequal": UrlFileExtensionOperatorGreaterThanOrEqual, - "lessthan": UrlFileExtensionOperatorLessThan, - "lessthanorequal": UrlFileExtensionOperatorLessThanOrEqual, - "regex": UrlFileExtensionOperatorRegEx, +func parseURLFileExtensionOperator(input string) (*URLFileExtensionOperator, error) { + vals := map[string]URLFileExtensionOperator{ + "any": URLFileExtensionOperatorAny, + "beginswith": URLFileExtensionOperatorBeginsWith, + "contains": URLFileExtensionOperatorContains, + "endswith": URLFileExtensionOperatorEndsWith, + "equal": URLFileExtensionOperatorEqual, + "greaterthan": URLFileExtensionOperatorGreaterThan, + "greaterthanorequal": URLFileExtensionOperatorGreaterThanOrEqual, + "lessthan": URLFileExtensionOperatorLessThan, + "lessthanorequal": URLFileExtensionOperatorLessThanOrEqual, + "regex": URLFileExtensionOperatorRegEx, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := UrlFileExtensionOperator(input) + out := URLFileExtensionOperator(input) return &out, nil } -type UrlFileNameOperator string +type URLFileNameOperator string const ( - UrlFileNameOperatorAny UrlFileNameOperator = "Any" - UrlFileNameOperatorBeginsWith UrlFileNameOperator = "BeginsWith" - UrlFileNameOperatorContains UrlFileNameOperator = "Contains" - UrlFileNameOperatorEndsWith UrlFileNameOperator = "EndsWith" - UrlFileNameOperatorEqual UrlFileNameOperator = "Equal" - UrlFileNameOperatorGreaterThan UrlFileNameOperator = "GreaterThan" - UrlFileNameOperatorGreaterThanOrEqual UrlFileNameOperator = "GreaterThanOrEqual" - UrlFileNameOperatorLessThan UrlFileNameOperator = "LessThan" - UrlFileNameOperatorLessThanOrEqual UrlFileNameOperator = "LessThanOrEqual" - UrlFileNameOperatorRegEx UrlFileNameOperator = "RegEx" + URLFileNameOperatorAny URLFileNameOperator = "Any" + URLFileNameOperatorBeginsWith URLFileNameOperator = "BeginsWith" + URLFileNameOperatorContains URLFileNameOperator = "Contains" + URLFileNameOperatorEndsWith URLFileNameOperator = "EndsWith" + URLFileNameOperatorEqual URLFileNameOperator = "Equal" + URLFileNameOperatorGreaterThan URLFileNameOperator = "GreaterThan" + URLFileNameOperatorGreaterThanOrEqual URLFileNameOperator = "GreaterThanOrEqual" + URLFileNameOperatorLessThan URLFileNameOperator = "LessThan" + URLFileNameOperatorLessThanOrEqual URLFileNameOperator = "LessThanOrEqual" + URLFileNameOperatorRegEx URLFileNameOperator = "RegEx" ) -func PossibleValuesForUrlFileNameOperator() []string { +func PossibleValuesForURLFileNameOperator() []string { return []string{ - string(UrlFileNameOperatorAny), - string(UrlFileNameOperatorBeginsWith), - string(UrlFileNameOperatorContains), - string(UrlFileNameOperatorEndsWith), - string(UrlFileNameOperatorEqual), - string(UrlFileNameOperatorGreaterThan), - string(UrlFileNameOperatorGreaterThanOrEqual), - string(UrlFileNameOperatorLessThan), - string(UrlFileNameOperatorLessThanOrEqual), - string(UrlFileNameOperatorRegEx), + string(URLFileNameOperatorAny), + string(URLFileNameOperatorBeginsWith), + string(URLFileNameOperatorContains), + string(URLFileNameOperatorEndsWith), + string(URLFileNameOperatorEqual), + string(URLFileNameOperatorGreaterThan), + string(URLFileNameOperatorGreaterThanOrEqual), + string(URLFileNameOperatorLessThan), + string(URLFileNameOperatorLessThanOrEqual), + string(URLFileNameOperatorRegEx), } } -func (s *UrlFileNameOperator) UnmarshalJSON(bytes []byte) error { +func (s *URLFileNameOperator) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseUrlFileNameOperator(decoded) + out, err := parseURLFileNameOperator(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -2538,66 +2538,66 @@ func (s *UrlFileNameOperator) UnmarshalJSON(bytes []byte) error { return nil } -func parseUrlFileNameOperator(input string) (*UrlFileNameOperator, error) { - vals := map[string]UrlFileNameOperator{ - "any": UrlFileNameOperatorAny, - "beginswith": UrlFileNameOperatorBeginsWith, - "contains": UrlFileNameOperatorContains, - "endswith": UrlFileNameOperatorEndsWith, - "equal": UrlFileNameOperatorEqual, - "greaterthan": UrlFileNameOperatorGreaterThan, - "greaterthanorequal": UrlFileNameOperatorGreaterThanOrEqual, - "lessthan": UrlFileNameOperatorLessThan, - "lessthanorequal": UrlFileNameOperatorLessThanOrEqual, - "regex": UrlFileNameOperatorRegEx, +func parseURLFileNameOperator(input string) (*URLFileNameOperator, error) { + vals := map[string]URLFileNameOperator{ + "any": URLFileNameOperatorAny, + "beginswith": URLFileNameOperatorBeginsWith, + "contains": URLFileNameOperatorContains, + "endswith": URLFileNameOperatorEndsWith, + "equal": URLFileNameOperatorEqual, + "greaterthan": URLFileNameOperatorGreaterThan, + "greaterthanorequal": URLFileNameOperatorGreaterThanOrEqual, + "lessthan": URLFileNameOperatorLessThan, + "lessthanorequal": URLFileNameOperatorLessThanOrEqual, + "regex": URLFileNameOperatorRegEx, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := UrlFileNameOperator(input) + out := URLFileNameOperator(input) return &out, nil } -type UrlPathOperator string +type URLPathOperator string const ( - UrlPathOperatorAny UrlPathOperator = "Any" - UrlPathOperatorBeginsWith UrlPathOperator = "BeginsWith" - UrlPathOperatorContains UrlPathOperator = "Contains" - UrlPathOperatorEndsWith UrlPathOperator = "EndsWith" - UrlPathOperatorEqual UrlPathOperator = "Equal" - UrlPathOperatorGreaterThan UrlPathOperator = "GreaterThan" - UrlPathOperatorGreaterThanOrEqual UrlPathOperator = "GreaterThanOrEqual" - UrlPathOperatorLessThan UrlPathOperator = "LessThan" - UrlPathOperatorLessThanOrEqual UrlPathOperator = "LessThanOrEqual" - UrlPathOperatorRegEx UrlPathOperator = "RegEx" - UrlPathOperatorWildcard UrlPathOperator = "Wildcard" + URLPathOperatorAny URLPathOperator = "Any" + URLPathOperatorBeginsWith URLPathOperator = "BeginsWith" + URLPathOperatorContains URLPathOperator = "Contains" + URLPathOperatorEndsWith URLPathOperator = "EndsWith" + URLPathOperatorEqual URLPathOperator = "Equal" + URLPathOperatorGreaterThan URLPathOperator = "GreaterThan" + URLPathOperatorGreaterThanOrEqual URLPathOperator = "GreaterThanOrEqual" + URLPathOperatorLessThan URLPathOperator = "LessThan" + URLPathOperatorLessThanOrEqual URLPathOperator = "LessThanOrEqual" + URLPathOperatorRegEx URLPathOperator = "RegEx" + URLPathOperatorWildcard URLPathOperator = "Wildcard" ) -func PossibleValuesForUrlPathOperator() []string { +func PossibleValuesForURLPathOperator() []string { return []string{ - string(UrlPathOperatorAny), - string(UrlPathOperatorBeginsWith), - string(UrlPathOperatorContains), - string(UrlPathOperatorEndsWith), - string(UrlPathOperatorEqual), - string(UrlPathOperatorGreaterThan), - string(UrlPathOperatorGreaterThanOrEqual), - string(UrlPathOperatorLessThan), - string(UrlPathOperatorLessThanOrEqual), - string(UrlPathOperatorRegEx), - string(UrlPathOperatorWildcard), + string(URLPathOperatorAny), + string(URLPathOperatorBeginsWith), + string(URLPathOperatorContains), + string(URLPathOperatorEndsWith), + string(URLPathOperatorEqual), + string(URLPathOperatorGreaterThan), + string(URLPathOperatorGreaterThanOrEqual), + string(URLPathOperatorLessThan), + string(URLPathOperatorLessThanOrEqual), + string(URLPathOperatorRegEx), + string(URLPathOperatorWildcard), } } -func (s *UrlPathOperator) UnmarshalJSON(bytes []byte) error { +func (s *URLPathOperator) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseUrlPathOperator(decoded) + out, err := parseURLPathOperator(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -2605,25 +2605,25 @@ func (s *UrlPathOperator) UnmarshalJSON(bytes []byte) error { return nil } -func parseUrlPathOperator(input string) (*UrlPathOperator, error) { - vals := map[string]UrlPathOperator{ - "any": UrlPathOperatorAny, - "beginswith": UrlPathOperatorBeginsWith, - "contains": UrlPathOperatorContains, - "endswith": UrlPathOperatorEndsWith, - "equal": UrlPathOperatorEqual, - "greaterthan": UrlPathOperatorGreaterThan, - "greaterthanorequal": UrlPathOperatorGreaterThanOrEqual, - "lessthan": UrlPathOperatorLessThan, - "lessthanorequal": UrlPathOperatorLessThanOrEqual, - "regex": UrlPathOperatorRegEx, - "wildcard": UrlPathOperatorWildcard, +func parseURLPathOperator(input string) (*URLPathOperator, error) { + vals := map[string]URLPathOperator{ + "any": URLPathOperatorAny, + "beginswith": URLPathOperatorBeginsWith, + "contains": URLPathOperatorContains, + "endswith": URLPathOperatorEndsWith, + "equal": URLPathOperatorEqual, + "greaterthan": URLPathOperatorGreaterThan, + "greaterthanorequal": URLPathOperatorGreaterThanOrEqual, + "lessthan": URLPathOperatorLessThan, + "lessthanorequal": URLPathOperatorLessThanOrEqual, + "regex": URLPathOperatorRegEx, + "wildcard": URLPathOperatorWildcard, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := UrlPathOperator(input) + out := URLPathOperator(input) return &out, nil } diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleaction.go b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleaction.go index e32e8f22d2a..1f623094311 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleaction.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleaction.go @@ -102,25 +102,25 @@ func UnmarshalDeliveryRuleActionImplementation(input []byte) (DeliveryRuleAction } if strings.EqualFold(value, "UrlRedirect") { - var out UrlRedirectAction + var out URLRedirectAction if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlRedirectAction: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLRedirectAction: %+v", err) } return out, nil } if strings.EqualFold(value, "UrlRewrite") { - var out UrlRewriteAction + var out URLRewriteAction if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlRewriteAction: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLRewriteAction: %+v", err) } return out, nil } if strings.EqualFold(value, "UrlSigning") { - var out UrlSigningAction + var out URLSigningAction if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlSigningAction: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLSigningAction: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleactionparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleactionparameters.go index 18628347ce9..e239eb6b31e 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleactionparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleactionparameters.go @@ -94,25 +94,25 @@ func UnmarshalDeliveryRuleActionParametersImplementation(input []byte) (Delivery } if strings.EqualFold(value, "DeliveryRuleUrlRedirectActionParameters") { - var out UrlRedirectActionParameters + var out URLRedirectActionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlRedirectActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLRedirectActionParameters: %+v", err) } return out, nil } if strings.EqualFold(value, "DeliveryRuleUrlRewriteActionParameters") { - var out UrlRewriteActionParameters + var out URLRewriteActionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlRewriteActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLRewriteActionParameters: %+v", err) } return out, nil } if strings.EqualFold(value, "DeliveryRuleUrlSigningActionParameters") { - var out UrlSigningActionParameters + var out URLSigningActionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlSigningActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLSigningActionParameters: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryrulecondition.go b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryrulecondition.go index dc2ec7aecc1..bf2d6ee9d79 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryrulecondition.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryrulecondition.go @@ -182,25 +182,25 @@ func UnmarshalDeliveryRuleConditionImplementation(input []byte) (DeliveryRuleCon } if strings.EqualFold(value, "UrlFileExtension") { - var out DeliveryRuleUrlFileExtensionCondition + var out DeliveryRuleURLFileExtensionCondition if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DeliveryRuleUrlFileExtensionCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling into DeliveryRuleURLFileExtensionCondition: %+v", err) } return out, nil } if strings.EqualFold(value, "UrlFileName") { - var out DeliveryRuleUrlFileNameCondition + var out DeliveryRuleURLFileNameCondition if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DeliveryRuleUrlFileNameCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling into DeliveryRuleURLFileNameCondition: %+v", err) } return out, nil } if strings.EqualFold(value, "UrlPath") { - var out DeliveryRuleUrlPathCondition + var out DeliveryRuleURLPathCondition if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DeliveryRuleUrlPathCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling into DeliveryRuleURLPathCondition: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleconditionparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleconditionparameters.go index a34de72b883..0dfb89f8c21 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleconditionparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleconditionparameters.go @@ -182,25 +182,25 @@ func UnmarshalDeliveryRuleConditionParametersImplementation(input []byte) (Deliv } if strings.EqualFold(value, "DeliveryRuleUrlFileExtensionMatchConditionParameters") { - var out UrlFileExtensionMatchConditionParameters + var out URLFileExtensionMatchConditionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlFileExtensionMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLFileExtensionMatchConditionParameters: %+v", err) } return out, nil } if strings.EqualFold(value, "DeliveryRuleUrlFilenameConditionParameters") { - var out UrlFileNameMatchConditionParameters + var out URLFileNameMatchConditionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlFileNameMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLFileNameMatchConditionParameters: %+v", err) } return out, nil } if strings.EqualFold(value, "DeliveryRuleUrlPathMatchConditionParameters") { - var out UrlPathMatchConditionParameters + var out URLPathMatchConditionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlPathMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLPathMatchConditionParameters: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlfileextensioncondition.go b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlfileextensioncondition.go index 9512a01cd72..caf12ca2fd7 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlfileextensioncondition.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlfileextensioncondition.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleCondition = DeliveryRuleUrlFileExtensionCondition{} +var _ DeliveryRuleCondition = DeliveryRuleURLFileExtensionCondition{} -type DeliveryRuleUrlFileExtensionCondition struct { - Parameters UrlFileExtensionMatchConditionParameters `json:"parameters"` +type DeliveryRuleURLFileExtensionCondition struct { + Parameters URLFileExtensionMatchConditionParameters `json:"parameters"` // Fields inherited from DeliveryRuleCondition Name MatchVariable `json:"name"` } -func (s DeliveryRuleUrlFileExtensionCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { +func (s DeliveryRuleURLFileExtensionCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { return BaseDeliveryRuleConditionImpl{ Name: s.Name, } } -var _ json.Marshaler = DeliveryRuleUrlFileExtensionCondition{} +var _ json.Marshaler = DeliveryRuleURLFileExtensionCondition{} -func (s DeliveryRuleUrlFileExtensionCondition) MarshalJSON() ([]byte, error) { - type wrapper DeliveryRuleUrlFileExtensionCondition +func (s DeliveryRuleURLFileExtensionCondition) MarshalJSON() ([]byte, error) { + type wrapper DeliveryRuleURLFileExtensionCondition wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling DeliveryRuleUrlFileExtensionCondition: %+v", err) + return nil, fmt.Errorf("marshaling DeliveryRuleURLFileExtensionCondition: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DeliveryRuleUrlFileExtensionCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling DeliveryRuleURLFileExtensionCondition: %+v", err) } decoded["name"] = "UrlFileExtension" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling DeliveryRuleUrlFileExtensionCondition: %+v", err) + return nil, fmt.Errorf("re-marshaling DeliveryRuleURLFileExtensionCondition: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlfilenamecondition.go b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlfilenamecondition.go index 99553de40b3..c2c6f61a99d 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlfilenamecondition.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlfilenamecondition.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleCondition = DeliveryRuleUrlFileNameCondition{} +var _ DeliveryRuleCondition = DeliveryRuleURLFileNameCondition{} -type DeliveryRuleUrlFileNameCondition struct { - Parameters UrlFileNameMatchConditionParameters `json:"parameters"` +type DeliveryRuleURLFileNameCondition struct { + Parameters URLFileNameMatchConditionParameters `json:"parameters"` // Fields inherited from DeliveryRuleCondition Name MatchVariable `json:"name"` } -func (s DeliveryRuleUrlFileNameCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { +func (s DeliveryRuleURLFileNameCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { return BaseDeliveryRuleConditionImpl{ Name: s.Name, } } -var _ json.Marshaler = DeliveryRuleUrlFileNameCondition{} +var _ json.Marshaler = DeliveryRuleURLFileNameCondition{} -func (s DeliveryRuleUrlFileNameCondition) MarshalJSON() ([]byte, error) { - type wrapper DeliveryRuleUrlFileNameCondition +func (s DeliveryRuleURLFileNameCondition) MarshalJSON() ([]byte, error) { + type wrapper DeliveryRuleURLFileNameCondition wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling DeliveryRuleUrlFileNameCondition: %+v", err) + return nil, fmt.Errorf("marshaling DeliveryRuleURLFileNameCondition: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DeliveryRuleUrlFileNameCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling DeliveryRuleURLFileNameCondition: %+v", err) } decoded["name"] = "UrlFileName" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling DeliveryRuleUrlFileNameCondition: %+v", err) + return nil, fmt.Errorf("re-marshaling DeliveryRuleURLFileNameCondition: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlpathcondition.go b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlpathcondition.go index d5086467665..c67b5fa29ac 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlpathcondition.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_deliveryruleurlpathcondition.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleCondition = DeliveryRuleUrlPathCondition{} +var _ DeliveryRuleCondition = DeliveryRuleURLPathCondition{} -type DeliveryRuleUrlPathCondition struct { - Parameters UrlPathMatchConditionParameters `json:"parameters"` +type DeliveryRuleURLPathCondition struct { + Parameters URLPathMatchConditionParameters `json:"parameters"` // Fields inherited from DeliveryRuleCondition Name MatchVariable `json:"name"` } -func (s DeliveryRuleUrlPathCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { +func (s DeliveryRuleURLPathCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { return BaseDeliveryRuleConditionImpl{ Name: s.Name, } } -var _ json.Marshaler = DeliveryRuleUrlPathCondition{} +var _ json.Marshaler = DeliveryRuleURLPathCondition{} -func (s DeliveryRuleUrlPathCondition) MarshalJSON() ([]byte, error) { - type wrapper DeliveryRuleUrlPathCondition +func (s DeliveryRuleURLPathCondition) MarshalJSON() ([]byte, error) { + type wrapper DeliveryRuleURLPathCondition wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling DeliveryRuleUrlPathCondition: %+v", err) + return nil, fmt.Errorf("marshaling DeliveryRuleURLPathCondition: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DeliveryRuleUrlPathCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling DeliveryRuleURLPathCondition: %+v", err) } decoded["name"] = "UrlPath" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling DeliveryRuleUrlPathCondition: %+v", err) + return nil, fmt.Errorf("re-marshaling DeliveryRuleURLPathCondition: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_endpointproperties.go b/resource-manager/cdn/2024-02-01/endpoints/model_endpointproperties.go index 6ee490e4fca..35d5341712d 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_endpointproperties.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_endpointproperties.go @@ -22,6 +22,6 @@ type EndpointProperties struct { ProvisioningState *EndpointProvisioningState `json:"provisioningState,omitempty"` QueryStringCachingBehavior *QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` ResourceState *EndpointResourceState `json:"resourceState,omitempty"` - UrlSigningKeys *[]UrlSigningKey `json:"urlSigningKeys,omitempty"` + UrlSigningKeys *[]URLSigningKey `json:"urlSigningKeys,omitempty"` WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` } diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_endpointpropertiesupdateparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_endpointpropertiesupdateparameters.go index c35794d9388..adb1f260474 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_endpointpropertiesupdateparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_endpointpropertiesupdateparameters.go @@ -16,6 +16,6 @@ type EndpointPropertiesUpdateParameters struct { OriginPath *string `json:"originPath,omitempty"` ProbePath *string `json:"probePath,omitempty"` QueryStringCachingBehavior *QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` - UrlSigningKeys *[]UrlSigningKey `json:"urlSigningKeys,omitempty"` + UrlSigningKeys *[]URLSigningKey `json:"urlSigningKeys,omitempty"` WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` } diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlfileextensionmatchconditionparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlfileextensionmatchconditionparameters.go index 69e22adcabd..543a890572f 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlfileextensionmatchconditionparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlfileextensionmatchconditionparameters.go @@ -8,12 +8,12 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleConditionParameters = UrlFileExtensionMatchConditionParameters{} +var _ DeliveryRuleConditionParameters = URLFileExtensionMatchConditionParameters{} -type UrlFileExtensionMatchConditionParameters struct { +type URLFileExtensionMatchConditionParameters struct { MatchValues *[]string `json:"matchValues,omitempty"` NegateCondition *bool `json:"negateCondition,omitempty"` - Operator UrlFileExtensionOperator `json:"operator"` + Operator URLFileExtensionOperator `json:"operator"` Transforms *[]Transform `json:"transforms,omitempty"` // Fields inherited from DeliveryRuleConditionParameters @@ -21,32 +21,32 @@ type UrlFileExtensionMatchConditionParameters struct { TypeName DeliveryRuleConditionParametersType `json:"typeName"` } -func (s UrlFileExtensionMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { +func (s URLFileExtensionMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { return BaseDeliveryRuleConditionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlFileExtensionMatchConditionParameters{} +var _ json.Marshaler = URLFileExtensionMatchConditionParameters{} -func (s UrlFileExtensionMatchConditionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlFileExtensionMatchConditionParameters +func (s URLFileExtensionMatchConditionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLFileExtensionMatchConditionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlFileExtensionMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLFileExtensionMatchConditionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlFileExtensionMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLFileExtensionMatchConditionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlFileExtensionMatchConditionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlFileExtensionMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLFileExtensionMatchConditionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlfilenamematchconditionparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlfilenamematchconditionparameters.go index 3c1f9542bb1..af287a69d2e 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlfilenamematchconditionparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlfilenamematchconditionparameters.go @@ -8,12 +8,12 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleConditionParameters = UrlFileNameMatchConditionParameters{} +var _ DeliveryRuleConditionParameters = URLFileNameMatchConditionParameters{} -type UrlFileNameMatchConditionParameters struct { +type URLFileNameMatchConditionParameters struct { MatchValues *[]string `json:"matchValues,omitempty"` NegateCondition *bool `json:"negateCondition,omitempty"` - Operator UrlFileNameOperator `json:"operator"` + Operator URLFileNameOperator `json:"operator"` Transforms *[]Transform `json:"transforms,omitempty"` // Fields inherited from DeliveryRuleConditionParameters @@ -21,32 +21,32 @@ type UrlFileNameMatchConditionParameters struct { TypeName DeliveryRuleConditionParametersType `json:"typeName"` } -func (s UrlFileNameMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { +func (s URLFileNameMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { return BaseDeliveryRuleConditionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlFileNameMatchConditionParameters{} +var _ json.Marshaler = URLFileNameMatchConditionParameters{} -func (s UrlFileNameMatchConditionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlFileNameMatchConditionParameters +func (s URLFileNameMatchConditionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLFileNameMatchConditionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlFileNameMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLFileNameMatchConditionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlFileNameMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLFileNameMatchConditionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlFilenameConditionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlFileNameMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLFileNameMatchConditionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlpathmatchconditionparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlpathmatchconditionparameters.go index a3b8d9fb970..fc1e2b837d5 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlpathmatchconditionparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlpathmatchconditionparameters.go @@ -8,12 +8,12 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleConditionParameters = UrlPathMatchConditionParameters{} +var _ DeliveryRuleConditionParameters = URLPathMatchConditionParameters{} -type UrlPathMatchConditionParameters struct { +type URLPathMatchConditionParameters struct { MatchValues *[]string `json:"matchValues,omitempty"` NegateCondition *bool `json:"negateCondition,omitempty"` - Operator UrlPathOperator `json:"operator"` + Operator URLPathOperator `json:"operator"` Transforms *[]Transform `json:"transforms,omitempty"` // Fields inherited from DeliveryRuleConditionParameters @@ -21,32 +21,32 @@ type UrlPathMatchConditionParameters struct { TypeName DeliveryRuleConditionParametersType `json:"typeName"` } -func (s UrlPathMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { +func (s URLPathMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { return BaseDeliveryRuleConditionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlPathMatchConditionParameters{} +var _ json.Marshaler = URLPathMatchConditionParameters{} -func (s UrlPathMatchConditionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlPathMatchConditionParameters +func (s URLPathMatchConditionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLPathMatchConditionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlPathMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLPathMatchConditionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlPathMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLPathMatchConditionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlPathMatchConditionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlPathMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLPathMatchConditionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlredirectaction.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlredirectaction.go index 59b77e9342f..a82af931aaa 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlredirectaction.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlredirectaction.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleAction = UrlRedirectAction{} +var _ DeliveryRuleAction = URLRedirectAction{} -type UrlRedirectAction struct { - Parameters UrlRedirectActionParameters `json:"parameters"` +type URLRedirectAction struct { + Parameters URLRedirectActionParameters `json:"parameters"` // Fields inherited from DeliveryRuleAction Name DeliveryRuleActionName `json:"name"` } -func (s UrlRedirectAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { +func (s URLRedirectAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { return BaseDeliveryRuleActionImpl{ Name: s.Name, } } -var _ json.Marshaler = UrlRedirectAction{} +var _ json.Marshaler = URLRedirectAction{} -func (s UrlRedirectAction) MarshalJSON() ([]byte, error) { - type wrapper UrlRedirectAction +func (s URLRedirectAction) MarshalJSON() ([]byte, error) { + type wrapper URLRedirectAction wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlRedirectAction: %+v", err) + return nil, fmt.Errorf("marshaling URLRedirectAction: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlRedirectAction: %+v", err) + return nil, fmt.Errorf("unmarshaling URLRedirectAction: %+v", err) } decoded["name"] = "UrlRedirect" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlRedirectAction: %+v", err) + return nil, fmt.Errorf("re-marshaling URLRedirectAction: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlredirectactionparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlredirectactionparameters.go index a0983325e04..9d30e3ee1d9 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlredirectactionparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlredirectactionparameters.go @@ -8,9 +8,9 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleActionParameters = UrlRedirectActionParameters{} +var _ DeliveryRuleActionParameters = URLRedirectActionParameters{} -type UrlRedirectActionParameters struct { +type URLRedirectActionParameters struct { CustomFragment *string `json:"customFragment,omitempty"` CustomHostname *string `json:"customHostname,omitempty"` CustomPath *string `json:"customPath,omitempty"` @@ -23,32 +23,32 @@ type UrlRedirectActionParameters struct { TypeName DeliveryRuleActionParametersType `json:"typeName"` } -func (s UrlRedirectActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { +func (s URLRedirectActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { return BaseDeliveryRuleActionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlRedirectActionParameters{} +var _ json.Marshaler = URLRedirectActionParameters{} -func (s UrlRedirectActionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlRedirectActionParameters +func (s URLRedirectActionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLRedirectActionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlRedirectActionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLRedirectActionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlRedirectActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLRedirectActionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlRedirectActionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlRedirectActionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLRedirectActionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlrewriteaction.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlrewriteaction.go index 0f4dbbfdccb..f45df93ec32 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlrewriteaction.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlrewriteaction.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleAction = UrlRewriteAction{} +var _ DeliveryRuleAction = URLRewriteAction{} -type UrlRewriteAction struct { - Parameters UrlRewriteActionParameters `json:"parameters"` +type URLRewriteAction struct { + Parameters URLRewriteActionParameters `json:"parameters"` // Fields inherited from DeliveryRuleAction Name DeliveryRuleActionName `json:"name"` } -func (s UrlRewriteAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { +func (s URLRewriteAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { return BaseDeliveryRuleActionImpl{ Name: s.Name, } } -var _ json.Marshaler = UrlRewriteAction{} +var _ json.Marshaler = URLRewriteAction{} -func (s UrlRewriteAction) MarshalJSON() ([]byte, error) { - type wrapper UrlRewriteAction +func (s URLRewriteAction) MarshalJSON() ([]byte, error) { + type wrapper URLRewriteAction wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlRewriteAction: %+v", err) + return nil, fmt.Errorf("marshaling URLRewriteAction: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlRewriteAction: %+v", err) + return nil, fmt.Errorf("unmarshaling URLRewriteAction: %+v", err) } decoded["name"] = "UrlRewrite" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlRewriteAction: %+v", err) + return nil, fmt.Errorf("re-marshaling URLRewriteAction: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlrewriteactionparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlrewriteactionparameters.go index ed5d929eff7..dd8bafa33f1 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlrewriteactionparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlrewriteactionparameters.go @@ -8,9 +8,9 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleActionParameters = UrlRewriteActionParameters{} +var _ DeliveryRuleActionParameters = URLRewriteActionParameters{} -type UrlRewriteActionParameters struct { +type URLRewriteActionParameters struct { Destination string `json:"destination"` PreserveUnmatchedPath *bool `json:"preserveUnmatchedPath,omitempty"` SourcePattern string `json:"sourcePattern"` @@ -20,32 +20,32 @@ type UrlRewriteActionParameters struct { TypeName DeliveryRuleActionParametersType `json:"typeName"` } -func (s UrlRewriteActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { +func (s URLRewriteActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { return BaseDeliveryRuleActionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlRewriteActionParameters{} +var _ json.Marshaler = URLRewriteActionParameters{} -func (s UrlRewriteActionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlRewriteActionParameters +func (s URLRewriteActionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLRewriteActionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlRewriteActionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLRewriteActionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlRewriteActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLRewriteActionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlRewriteActionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlRewriteActionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLRewriteActionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningaction.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningaction.go index 1aa8ea2ab6f..5bb4b815f27 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningaction.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningaction.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleAction = UrlSigningAction{} +var _ DeliveryRuleAction = URLSigningAction{} -type UrlSigningAction struct { - Parameters UrlSigningActionParameters `json:"parameters"` +type URLSigningAction struct { + Parameters URLSigningActionParameters `json:"parameters"` // Fields inherited from DeliveryRuleAction Name DeliveryRuleActionName `json:"name"` } -func (s UrlSigningAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { +func (s URLSigningAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { return BaseDeliveryRuleActionImpl{ Name: s.Name, } } -var _ json.Marshaler = UrlSigningAction{} +var _ json.Marshaler = URLSigningAction{} -func (s UrlSigningAction) MarshalJSON() ([]byte, error) { - type wrapper UrlSigningAction +func (s URLSigningAction) MarshalJSON() ([]byte, error) { + type wrapper URLSigningAction wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlSigningAction: %+v", err) + return nil, fmt.Errorf("marshaling URLSigningAction: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlSigningAction: %+v", err) + return nil, fmt.Errorf("unmarshaling URLSigningAction: %+v", err) } decoded["name"] = "UrlSigning" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlSigningAction: %+v", err) + return nil, fmt.Errorf("re-marshaling URLSigningAction: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningactionparameters.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningactionparameters.go index b7de6a63660..2d8b2ce8da7 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningactionparameters.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningactionparameters.go @@ -8,43 +8,43 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleActionParameters = UrlSigningActionParameters{} +var _ DeliveryRuleActionParameters = URLSigningActionParameters{} -type UrlSigningActionParameters struct { +type URLSigningActionParameters struct { Algorithm *Algorithm `json:"algorithm,omitempty"` - ParameterNameOverride *[]UrlSigningParamIdentifier `json:"parameterNameOverride,omitempty"` + ParameterNameOverride *[]URLSigningParamIdentifier `json:"parameterNameOverride,omitempty"` // Fields inherited from DeliveryRuleActionParameters TypeName DeliveryRuleActionParametersType `json:"typeName"` } -func (s UrlSigningActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { +func (s URLSigningActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { return BaseDeliveryRuleActionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlSigningActionParameters{} +var _ json.Marshaler = URLSigningActionParameters{} -func (s UrlSigningActionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlSigningActionParameters +func (s URLSigningActionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLSigningActionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlSigningActionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLSigningActionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlSigningActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLSigningActionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlSigningActionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlSigningActionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLSigningActionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningkey.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningkey.go index 9249776a493..7e788a39c7c 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningkey.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningkey.go @@ -3,7 +3,7 @@ package endpoints // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UrlSigningKey struct { +type URLSigningKey struct { KeyId string `json:"keyId"` KeySourceParameters KeyVaultSigningKeyParameters `json:"keySourceParameters"` } diff --git a/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningparamidentifier.go b/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningparamidentifier.go index a8bdab0f7a2..537fae3e438 100644 --- a/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningparamidentifier.go +++ b/resource-manager/cdn/2024-02-01/endpoints/model_urlsigningparamidentifier.go @@ -3,7 +3,7 @@ package endpoints // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UrlSigningParamIdentifier struct { +type URLSigningParamIdentifier struct { ParamIndicator ParamIndicator `json:"paramIndicator"` ParamName string `json:"paramName"` } diff --git a/resource-manager/cdn/2024-02-01/routes/README.md b/resource-manager/cdn/2024-02-01/routes/README.md index 21e70064d42..44e3d77fa6b 100644 --- a/resource-manager/cdn/2024-02-01/routes/README.md +++ b/resource-manager/cdn/2024-02-01/routes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName", "routeName") +id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName", "routeName") payload := routes.Route{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName", "routeName") +id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName", "routeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName", "routeName") +id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName", "routeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := routes.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") +id := routes.NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") // alternatively `client.ListByEndpoint(ctx, id)` can be used to do batched pagination items, err := client.ListByEndpointComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName", "routeName") +id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName", "routeName") payload := routes.RouteUpdateParameters{ // ... diff --git a/resource-manager/cdn/2024-02-01/routes/id_afdendpoint.go b/resource-manager/cdn/2024-02-01/routes/id_afdendpoint.go index 0b6158a6eef..8308687804f 100644 --- a/resource-manager/cdn/2024-02-01/routes/id_afdendpoint.go +++ b/resource-manager/cdn/2024-02-01/routes/id_afdendpoint.go @@ -123,7 +123,7 @@ func (id AfdEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProfiles", "profiles", "profiles"), resourceids.UserSpecifiedSegment("profileName", "profileName"), resourceids.StaticSegment("staticAfdEndpoints", "afdEndpoints", "afdEndpoints"), - resourceids.UserSpecifiedSegment("afdEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("afdEndpointName", "afdEndpointName"), } } diff --git a/resource-manager/cdn/2024-02-01/routes/id_afdendpoint_test.go b/resource-manager/cdn/2024-02-01/routes/id_afdendpoint_test.go index 20ef40020fa..15dd4eba196 100644 --- a/resource-manager/cdn/2024-02-01/routes/id_afdendpoint_test.go +++ b/resource-manager/cdn/2024-02-01/routes/id_afdendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AfdEndpointId{} func TestNewAfdEndpointID(t *testing.T) { - id := NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName") + id := NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAfdEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProfileName'", id.ProfileName, "profileName") } - if id.AfdEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'AfdEndpointName'", id.AfdEndpointName, "endpointName") + if id.AfdEndpointName != "afdEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'AfdEndpointName'", id.AfdEndpointName, "afdEndpointName") } } func TestFormatAfdEndpointID(t *testing.T) { - actual := NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName" + actual := NewAfdEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAfdEndpointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName", Expected: &AfdEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProfileName: "profileName", - AfdEndpointName: "endpointName", + AfdEndpointName: "afdEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAfdEndpointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName", Expected: &AfdEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProfileName: "profileName", - AfdEndpointName: "endpointName", + AfdEndpointName: "afdEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/aFdEnDpOiNtNaMe", Expected: &AfdEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ProfileName: "pRoFiLeNaMe", - AfdEndpointName: "eNdPoInTnAmE", + AfdEndpointName: "aFdEnDpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/eNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/aFdEnDpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cdn/2024-02-01/routes/id_route.go b/resource-manager/cdn/2024-02-01/routes/id_route.go index 0672631f52e..f69c574f868 100644 --- a/resource-manager/cdn/2024-02-01/routes/id_route.go +++ b/resource-manager/cdn/2024-02-01/routes/id_route.go @@ -129,7 +129,7 @@ func (id RouteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProfiles", "profiles", "profiles"), resourceids.UserSpecifiedSegment("profileName", "profileName"), resourceids.StaticSegment("staticAfdEndpoints", "afdEndpoints", "afdEndpoints"), - resourceids.UserSpecifiedSegment("afdEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("afdEndpointName", "afdEndpointName"), resourceids.StaticSegment("staticRoutes", "routes", "routes"), resourceids.UserSpecifiedSegment("routeName", "routeName"), } diff --git a/resource-manager/cdn/2024-02-01/routes/id_route_test.go b/resource-manager/cdn/2024-02-01/routes/id_route_test.go index b2a8b28d272..63a14d96932 100644 --- a/resource-manager/cdn/2024-02-01/routes/id_route_test.go +++ b/resource-manager/cdn/2024-02-01/routes/id_route_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteId{} func TestNewRouteID(t *testing.T) { - id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName", "routeName") + id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName", "routeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRouteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProfileName'", id.ProfileName, "profileName") } - if id.AfdEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'AfdEndpointName'", id.AfdEndpointName, "endpointName") + if id.AfdEndpointName != "afdEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'AfdEndpointName'", id.AfdEndpointName, "afdEndpointName") } if id.RouteName != "routeName" { @@ -36,8 +36,8 @@ func TestNewRouteID(t *testing.T) { } func TestFormatRouteID(t *testing.T) { - actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "endpointName", "routeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/routes/routeName" + actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "afdEndpointName", "routeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/routes/routeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRouteID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/routes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/routes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/routes/routeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/routes/routeName", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProfileName: "profileName", - AfdEndpointName: "endpointName", + AfdEndpointName: "afdEndpointName", RouteName: "routeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/routes/routeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/routes/routeName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRouteIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/aFdEnDpOiNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/routes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/routes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/eNdPoInTnAmE/rOuTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/aFdEnDpOiNtNaMe/rOuTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/routes/routeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/routes/routeName", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProfileName: "profileName", - AfdEndpointName: "endpointName", + AfdEndpointName: "afdEndpointName", RouteName: "routeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/endpointName/routes/routeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/profiles/profileName/afdEndpoints/afdEndpointName/routes/routeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/eNdPoInTnAmE/rOuTeS/rOuTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/aFdEnDpOiNtNaMe/rOuTeS/rOuTeNaMe", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ProfileName: "pRoFiLeNaMe", - AfdEndpointName: "eNdPoInTnAmE", + AfdEndpointName: "aFdEnDpOiNtNaMe", RouteName: "rOuTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/eNdPoInTnAmE/rOuTeS/rOuTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/pRoFiLeS/pRoFiLeNaMe/aFdEnDpOiNtS/aFdEnDpOiNtNaMe/rOuTeS/rOuTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cdn/2024-02-01/rules/constants.go b/resource-manager/cdn/2024-02-01/rules/constants.go index 5a6cc728f67..6fb915180b5 100644 --- a/resource-manager/cdn/2024-02-01/rules/constants.go +++ b/resource-manager/cdn/2024-02-01/rules/constants.go @@ -318,9 +318,9 @@ const ( DeliveryRuleActionNameModifyResponseHeader DeliveryRuleActionName = "ModifyResponseHeader" DeliveryRuleActionNameOriginGroupOverride DeliveryRuleActionName = "OriginGroupOverride" DeliveryRuleActionNameRouteConfigurationOverride DeliveryRuleActionName = "RouteConfigurationOverride" - DeliveryRuleActionNameUrlRedirect DeliveryRuleActionName = "UrlRedirect" - DeliveryRuleActionNameUrlRewrite DeliveryRuleActionName = "UrlRewrite" - DeliveryRuleActionNameUrlSigning DeliveryRuleActionName = "UrlSigning" + DeliveryRuleActionNameURLRedirect DeliveryRuleActionName = "UrlRedirect" + DeliveryRuleActionNameURLRewrite DeliveryRuleActionName = "UrlRewrite" + DeliveryRuleActionNameURLSigning DeliveryRuleActionName = "UrlSigning" ) func PossibleValuesForDeliveryRuleActionName() []string { @@ -331,9 +331,9 @@ func PossibleValuesForDeliveryRuleActionName() []string { string(DeliveryRuleActionNameModifyResponseHeader), string(DeliveryRuleActionNameOriginGroupOverride), string(DeliveryRuleActionNameRouteConfigurationOverride), - string(DeliveryRuleActionNameUrlRedirect), - string(DeliveryRuleActionNameUrlRewrite), - string(DeliveryRuleActionNameUrlSigning), + string(DeliveryRuleActionNameURLRedirect), + string(DeliveryRuleActionNameURLRewrite), + string(DeliveryRuleActionNameURLSigning), } } @@ -358,9 +358,9 @@ func parseDeliveryRuleActionName(input string) (*DeliveryRuleActionName, error) "modifyresponseheader": DeliveryRuleActionNameModifyResponseHeader, "origingroupoverride": DeliveryRuleActionNameOriginGroupOverride, "routeconfigurationoverride": DeliveryRuleActionNameRouteConfigurationOverride, - "urlredirect": DeliveryRuleActionNameUrlRedirect, - "urlrewrite": DeliveryRuleActionNameUrlRewrite, - "urlsigning": DeliveryRuleActionNameUrlSigning, + "urlredirect": DeliveryRuleActionNameURLRedirect, + "urlrewrite": DeliveryRuleActionNameURLRewrite, + "urlsigning": DeliveryRuleActionNameURLSigning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -379,9 +379,9 @@ const ( DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters DeliveryRuleActionParametersType = "DeliveryRuleHeaderActionParameters" DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters DeliveryRuleActionParametersType = "DeliveryRuleOriginGroupOverrideActionParameters" DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters DeliveryRuleActionParametersType = "DeliveryRuleRouteConfigurationOverrideActionParameters" - DeliveryRuleActionParametersTypeDeliveryRuleUrlRedirectActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRedirectActionParameters" - DeliveryRuleActionParametersTypeDeliveryRuleUrlRewriteActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRewriteActionParameters" - DeliveryRuleActionParametersTypeDeliveryRuleUrlSigningActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlSigningActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRedirectActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlRewriteActionParameters" + DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters DeliveryRuleActionParametersType = "DeliveryRuleUrlSigningActionParameters" ) func PossibleValuesForDeliveryRuleActionParametersType() []string { @@ -391,9 +391,9 @@ func PossibleValuesForDeliveryRuleActionParametersType() []string { string(DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters), string(DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters), string(DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters), - string(DeliveryRuleActionParametersTypeDeliveryRuleUrlRedirectActionParameters), - string(DeliveryRuleActionParametersTypeDeliveryRuleUrlRewriteActionParameters), - string(DeliveryRuleActionParametersTypeDeliveryRuleUrlSigningActionParameters), + string(DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters), + string(DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters), + string(DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters), } } @@ -417,9 +417,9 @@ func parseDeliveryRuleActionParametersType(input string) (*DeliveryRuleActionPar "deliveryruleheaderactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleHeaderActionParameters, "deliveryruleorigingroupoverrideactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleOriginGroupOverrideActionParameters, "deliveryrulerouteconfigurationoverrideactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleRouteConfigurationOverrideActionParameters, - "deliveryruleurlredirectactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleUrlRedirectActionParameters, - "deliveryruleurlrewriteactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleUrlRewriteActionParameters, - "deliveryruleurlsigningactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleUrlSigningActionParameters, + "deliveryruleurlredirectactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleURLRedirectActionParameters, + "deliveryruleurlrewriteactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleURLRewriteActionParameters, + "deliveryruleurlsigningactionparameters": DeliveryRuleActionParametersTypeDeliveryRuleURLSigningActionParameters, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -449,9 +449,9 @@ const ( DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleServerPortConditionParameters" DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleSocketAddrConditionParameters" DeliveryRuleConditionParametersTypeDeliveryRuleSslProtocolConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleSslProtocolConditionParameters" - DeliveryRuleConditionParametersTypeDeliveryRuleUrlFileExtensionMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFileExtensionMatchConditionParameters" - DeliveryRuleConditionParametersTypeDeliveryRuleUrlFilenameConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFilenameConditionParameters" - DeliveryRuleConditionParametersTypeDeliveryRuleUrlPathMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlPathMatchConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFileExtensionMatchConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlFilenameConditionParameters" + DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters DeliveryRuleConditionParametersType = "DeliveryRuleUrlPathMatchConditionParameters" ) func PossibleValuesForDeliveryRuleConditionParametersType() []string { @@ -472,9 +472,9 @@ func PossibleValuesForDeliveryRuleConditionParametersType() []string { string(DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters), string(DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters), string(DeliveryRuleConditionParametersTypeDeliveryRuleSslProtocolConditionParameters), - string(DeliveryRuleConditionParametersTypeDeliveryRuleUrlFileExtensionMatchConditionParameters), - string(DeliveryRuleConditionParametersTypeDeliveryRuleUrlFilenameConditionParameters), - string(DeliveryRuleConditionParametersTypeDeliveryRuleUrlPathMatchConditionParameters), + string(DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters), + string(DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters), + string(DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters), } } @@ -509,9 +509,9 @@ func parseDeliveryRuleConditionParametersType(input string) (*DeliveryRuleCondit "deliveryruleserverportconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleServerPortConditionParameters, "deliveryrulesocketaddrconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleSocketAddrConditionParameters, "deliveryrulesslprotocolconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleSslProtocolConditionParameters, - "deliveryruleurlfileextensionmatchconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleUrlFileExtensionMatchConditionParameters, - "deliveryruleurlfilenameconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleUrlFilenameConditionParameters, - "deliveryruleurlpathmatchconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleUrlPathMatchConditionParameters, + "deliveryruleurlfileextensionmatchconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleURLFileExtensionMatchConditionParameters, + "deliveryruleurlfilenameconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleURLFilenameConditionParameters, + "deliveryruleurlpathmatchconditionparameters": DeliveryRuleConditionParametersTypeDeliveryRuleURLPathMatchConditionParameters, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -943,9 +943,9 @@ const ( MatchVariableServerPort MatchVariable = "ServerPort" MatchVariableSocketAddr MatchVariable = "SocketAddr" MatchVariableSslProtocol MatchVariable = "SslProtocol" - MatchVariableUrlFileExtension MatchVariable = "UrlFileExtension" - MatchVariableUrlFileName MatchVariable = "UrlFileName" - MatchVariableUrlPath MatchVariable = "UrlPath" + MatchVariableURLFileExtension MatchVariable = "UrlFileExtension" + MatchVariableURLFileName MatchVariable = "UrlFileName" + MatchVariableURLPath MatchVariable = "UrlPath" ) func PossibleValuesForMatchVariable() []string { @@ -966,9 +966,9 @@ func PossibleValuesForMatchVariable() []string { string(MatchVariableServerPort), string(MatchVariableSocketAddr), string(MatchVariableSslProtocol), - string(MatchVariableUrlFileExtension), - string(MatchVariableUrlFileName), - string(MatchVariableUrlPath), + string(MatchVariableURLFileExtension), + string(MatchVariableURLFileName), + string(MatchVariableURLPath), } } @@ -1003,9 +1003,9 @@ func parseMatchVariable(input string) (*MatchVariable, error) { "serverport": MatchVariableServerPort, "socketaddr": MatchVariableSocketAddr, "sslprotocol": MatchVariableSslProtocol, - "urlfileextension": MatchVariableUrlFileExtension, - "urlfilename": MatchVariableUrlFileName, - "urlpath": MatchVariableUrlPath, + "urlfileextension": MatchVariableURLFileExtension, + "urlfilename": MatchVariableURLFileName, + "urlpath": MatchVariableURLPath, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -2022,9 +2022,9 @@ const ( TransformLowercase Transform = "Lowercase" TransformRemoveNulls Transform = "RemoveNulls" TransformTrim Transform = "Trim" + TransformURLDecode Transform = "UrlDecode" + TransformURLEncode Transform = "UrlEncode" TransformUppercase Transform = "Uppercase" - TransformUrlDecode Transform = "UrlDecode" - TransformUrlEncode Transform = "UrlEncode" ) func PossibleValuesForTransform() []string { @@ -2032,9 +2032,9 @@ func PossibleValuesForTransform() []string { string(TransformLowercase), string(TransformRemoveNulls), string(TransformTrim), + string(TransformURLDecode), + string(TransformURLEncode), string(TransformUppercase), - string(TransformUrlDecode), - string(TransformUrlEncode), } } @@ -2056,9 +2056,9 @@ func parseTransform(input string) (*Transform, error) { "lowercase": TransformLowercase, "removenulls": TransformRemoveNulls, "trim": TransformTrim, + "urldecode": TransformURLDecode, + "urlencode": TransformURLEncode, "uppercase": TransformUppercase, - "urldecode": TransformUrlDecode, - "urlencode": TransformUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -2069,42 +2069,42 @@ func parseTransform(input string) (*Transform, error) { return &out, nil } -type UrlFileExtensionOperator string +type URLFileExtensionOperator string const ( - UrlFileExtensionOperatorAny UrlFileExtensionOperator = "Any" - UrlFileExtensionOperatorBeginsWith UrlFileExtensionOperator = "BeginsWith" - UrlFileExtensionOperatorContains UrlFileExtensionOperator = "Contains" - UrlFileExtensionOperatorEndsWith UrlFileExtensionOperator = "EndsWith" - UrlFileExtensionOperatorEqual UrlFileExtensionOperator = "Equal" - UrlFileExtensionOperatorGreaterThan UrlFileExtensionOperator = "GreaterThan" - UrlFileExtensionOperatorGreaterThanOrEqual UrlFileExtensionOperator = "GreaterThanOrEqual" - UrlFileExtensionOperatorLessThan UrlFileExtensionOperator = "LessThan" - UrlFileExtensionOperatorLessThanOrEqual UrlFileExtensionOperator = "LessThanOrEqual" - UrlFileExtensionOperatorRegEx UrlFileExtensionOperator = "RegEx" + URLFileExtensionOperatorAny URLFileExtensionOperator = "Any" + URLFileExtensionOperatorBeginsWith URLFileExtensionOperator = "BeginsWith" + URLFileExtensionOperatorContains URLFileExtensionOperator = "Contains" + URLFileExtensionOperatorEndsWith URLFileExtensionOperator = "EndsWith" + URLFileExtensionOperatorEqual URLFileExtensionOperator = "Equal" + URLFileExtensionOperatorGreaterThan URLFileExtensionOperator = "GreaterThan" + URLFileExtensionOperatorGreaterThanOrEqual URLFileExtensionOperator = "GreaterThanOrEqual" + URLFileExtensionOperatorLessThan URLFileExtensionOperator = "LessThan" + URLFileExtensionOperatorLessThanOrEqual URLFileExtensionOperator = "LessThanOrEqual" + URLFileExtensionOperatorRegEx URLFileExtensionOperator = "RegEx" ) -func PossibleValuesForUrlFileExtensionOperator() []string { +func PossibleValuesForURLFileExtensionOperator() []string { return []string{ - string(UrlFileExtensionOperatorAny), - string(UrlFileExtensionOperatorBeginsWith), - string(UrlFileExtensionOperatorContains), - string(UrlFileExtensionOperatorEndsWith), - string(UrlFileExtensionOperatorEqual), - string(UrlFileExtensionOperatorGreaterThan), - string(UrlFileExtensionOperatorGreaterThanOrEqual), - string(UrlFileExtensionOperatorLessThan), - string(UrlFileExtensionOperatorLessThanOrEqual), - string(UrlFileExtensionOperatorRegEx), + string(URLFileExtensionOperatorAny), + string(URLFileExtensionOperatorBeginsWith), + string(URLFileExtensionOperatorContains), + string(URLFileExtensionOperatorEndsWith), + string(URLFileExtensionOperatorEqual), + string(URLFileExtensionOperatorGreaterThan), + string(URLFileExtensionOperatorGreaterThanOrEqual), + string(URLFileExtensionOperatorLessThan), + string(URLFileExtensionOperatorLessThanOrEqual), + string(URLFileExtensionOperatorRegEx), } } -func (s *UrlFileExtensionOperator) UnmarshalJSON(bytes []byte) error { +func (s *URLFileExtensionOperator) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseUrlFileExtensionOperator(decoded) + out, err := parseURLFileExtensionOperator(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -2112,64 +2112,64 @@ func (s *UrlFileExtensionOperator) UnmarshalJSON(bytes []byte) error { return nil } -func parseUrlFileExtensionOperator(input string) (*UrlFileExtensionOperator, error) { - vals := map[string]UrlFileExtensionOperator{ - "any": UrlFileExtensionOperatorAny, - "beginswith": UrlFileExtensionOperatorBeginsWith, - "contains": UrlFileExtensionOperatorContains, - "endswith": UrlFileExtensionOperatorEndsWith, - "equal": UrlFileExtensionOperatorEqual, - "greaterthan": UrlFileExtensionOperatorGreaterThan, - "greaterthanorequal": UrlFileExtensionOperatorGreaterThanOrEqual, - "lessthan": UrlFileExtensionOperatorLessThan, - "lessthanorequal": UrlFileExtensionOperatorLessThanOrEqual, - "regex": UrlFileExtensionOperatorRegEx, +func parseURLFileExtensionOperator(input string) (*URLFileExtensionOperator, error) { + vals := map[string]URLFileExtensionOperator{ + "any": URLFileExtensionOperatorAny, + "beginswith": URLFileExtensionOperatorBeginsWith, + "contains": URLFileExtensionOperatorContains, + "endswith": URLFileExtensionOperatorEndsWith, + "equal": URLFileExtensionOperatorEqual, + "greaterthan": URLFileExtensionOperatorGreaterThan, + "greaterthanorequal": URLFileExtensionOperatorGreaterThanOrEqual, + "lessthan": URLFileExtensionOperatorLessThan, + "lessthanorequal": URLFileExtensionOperatorLessThanOrEqual, + "regex": URLFileExtensionOperatorRegEx, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := UrlFileExtensionOperator(input) + out := URLFileExtensionOperator(input) return &out, nil } -type UrlFileNameOperator string +type URLFileNameOperator string const ( - UrlFileNameOperatorAny UrlFileNameOperator = "Any" - UrlFileNameOperatorBeginsWith UrlFileNameOperator = "BeginsWith" - UrlFileNameOperatorContains UrlFileNameOperator = "Contains" - UrlFileNameOperatorEndsWith UrlFileNameOperator = "EndsWith" - UrlFileNameOperatorEqual UrlFileNameOperator = "Equal" - UrlFileNameOperatorGreaterThan UrlFileNameOperator = "GreaterThan" - UrlFileNameOperatorGreaterThanOrEqual UrlFileNameOperator = "GreaterThanOrEqual" - UrlFileNameOperatorLessThan UrlFileNameOperator = "LessThan" - UrlFileNameOperatorLessThanOrEqual UrlFileNameOperator = "LessThanOrEqual" - UrlFileNameOperatorRegEx UrlFileNameOperator = "RegEx" + URLFileNameOperatorAny URLFileNameOperator = "Any" + URLFileNameOperatorBeginsWith URLFileNameOperator = "BeginsWith" + URLFileNameOperatorContains URLFileNameOperator = "Contains" + URLFileNameOperatorEndsWith URLFileNameOperator = "EndsWith" + URLFileNameOperatorEqual URLFileNameOperator = "Equal" + URLFileNameOperatorGreaterThan URLFileNameOperator = "GreaterThan" + URLFileNameOperatorGreaterThanOrEqual URLFileNameOperator = "GreaterThanOrEqual" + URLFileNameOperatorLessThan URLFileNameOperator = "LessThan" + URLFileNameOperatorLessThanOrEqual URLFileNameOperator = "LessThanOrEqual" + URLFileNameOperatorRegEx URLFileNameOperator = "RegEx" ) -func PossibleValuesForUrlFileNameOperator() []string { +func PossibleValuesForURLFileNameOperator() []string { return []string{ - string(UrlFileNameOperatorAny), - string(UrlFileNameOperatorBeginsWith), - string(UrlFileNameOperatorContains), - string(UrlFileNameOperatorEndsWith), - string(UrlFileNameOperatorEqual), - string(UrlFileNameOperatorGreaterThan), - string(UrlFileNameOperatorGreaterThanOrEqual), - string(UrlFileNameOperatorLessThan), - string(UrlFileNameOperatorLessThanOrEqual), - string(UrlFileNameOperatorRegEx), + string(URLFileNameOperatorAny), + string(URLFileNameOperatorBeginsWith), + string(URLFileNameOperatorContains), + string(URLFileNameOperatorEndsWith), + string(URLFileNameOperatorEqual), + string(URLFileNameOperatorGreaterThan), + string(URLFileNameOperatorGreaterThanOrEqual), + string(URLFileNameOperatorLessThan), + string(URLFileNameOperatorLessThanOrEqual), + string(URLFileNameOperatorRegEx), } } -func (s *UrlFileNameOperator) UnmarshalJSON(bytes []byte) error { +func (s *URLFileNameOperator) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseUrlFileNameOperator(decoded) + out, err := parseURLFileNameOperator(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -2177,66 +2177,66 @@ func (s *UrlFileNameOperator) UnmarshalJSON(bytes []byte) error { return nil } -func parseUrlFileNameOperator(input string) (*UrlFileNameOperator, error) { - vals := map[string]UrlFileNameOperator{ - "any": UrlFileNameOperatorAny, - "beginswith": UrlFileNameOperatorBeginsWith, - "contains": UrlFileNameOperatorContains, - "endswith": UrlFileNameOperatorEndsWith, - "equal": UrlFileNameOperatorEqual, - "greaterthan": UrlFileNameOperatorGreaterThan, - "greaterthanorequal": UrlFileNameOperatorGreaterThanOrEqual, - "lessthan": UrlFileNameOperatorLessThan, - "lessthanorequal": UrlFileNameOperatorLessThanOrEqual, - "regex": UrlFileNameOperatorRegEx, +func parseURLFileNameOperator(input string) (*URLFileNameOperator, error) { + vals := map[string]URLFileNameOperator{ + "any": URLFileNameOperatorAny, + "beginswith": URLFileNameOperatorBeginsWith, + "contains": URLFileNameOperatorContains, + "endswith": URLFileNameOperatorEndsWith, + "equal": URLFileNameOperatorEqual, + "greaterthan": URLFileNameOperatorGreaterThan, + "greaterthanorequal": URLFileNameOperatorGreaterThanOrEqual, + "lessthan": URLFileNameOperatorLessThan, + "lessthanorequal": URLFileNameOperatorLessThanOrEqual, + "regex": URLFileNameOperatorRegEx, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := UrlFileNameOperator(input) + out := URLFileNameOperator(input) return &out, nil } -type UrlPathOperator string +type URLPathOperator string const ( - UrlPathOperatorAny UrlPathOperator = "Any" - UrlPathOperatorBeginsWith UrlPathOperator = "BeginsWith" - UrlPathOperatorContains UrlPathOperator = "Contains" - UrlPathOperatorEndsWith UrlPathOperator = "EndsWith" - UrlPathOperatorEqual UrlPathOperator = "Equal" - UrlPathOperatorGreaterThan UrlPathOperator = "GreaterThan" - UrlPathOperatorGreaterThanOrEqual UrlPathOperator = "GreaterThanOrEqual" - UrlPathOperatorLessThan UrlPathOperator = "LessThan" - UrlPathOperatorLessThanOrEqual UrlPathOperator = "LessThanOrEqual" - UrlPathOperatorRegEx UrlPathOperator = "RegEx" - UrlPathOperatorWildcard UrlPathOperator = "Wildcard" + URLPathOperatorAny URLPathOperator = "Any" + URLPathOperatorBeginsWith URLPathOperator = "BeginsWith" + URLPathOperatorContains URLPathOperator = "Contains" + URLPathOperatorEndsWith URLPathOperator = "EndsWith" + URLPathOperatorEqual URLPathOperator = "Equal" + URLPathOperatorGreaterThan URLPathOperator = "GreaterThan" + URLPathOperatorGreaterThanOrEqual URLPathOperator = "GreaterThanOrEqual" + URLPathOperatorLessThan URLPathOperator = "LessThan" + URLPathOperatorLessThanOrEqual URLPathOperator = "LessThanOrEqual" + URLPathOperatorRegEx URLPathOperator = "RegEx" + URLPathOperatorWildcard URLPathOperator = "Wildcard" ) -func PossibleValuesForUrlPathOperator() []string { +func PossibleValuesForURLPathOperator() []string { return []string{ - string(UrlPathOperatorAny), - string(UrlPathOperatorBeginsWith), - string(UrlPathOperatorContains), - string(UrlPathOperatorEndsWith), - string(UrlPathOperatorEqual), - string(UrlPathOperatorGreaterThan), - string(UrlPathOperatorGreaterThanOrEqual), - string(UrlPathOperatorLessThan), - string(UrlPathOperatorLessThanOrEqual), - string(UrlPathOperatorRegEx), - string(UrlPathOperatorWildcard), + string(URLPathOperatorAny), + string(URLPathOperatorBeginsWith), + string(URLPathOperatorContains), + string(URLPathOperatorEndsWith), + string(URLPathOperatorEqual), + string(URLPathOperatorGreaterThan), + string(URLPathOperatorGreaterThanOrEqual), + string(URLPathOperatorLessThan), + string(URLPathOperatorLessThanOrEqual), + string(URLPathOperatorRegEx), + string(URLPathOperatorWildcard), } } -func (s *UrlPathOperator) UnmarshalJSON(bytes []byte) error { +func (s *URLPathOperator) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseUrlPathOperator(decoded) + out, err := parseURLPathOperator(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -2244,25 +2244,25 @@ func (s *UrlPathOperator) UnmarshalJSON(bytes []byte) error { return nil } -func parseUrlPathOperator(input string) (*UrlPathOperator, error) { - vals := map[string]UrlPathOperator{ - "any": UrlPathOperatorAny, - "beginswith": UrlPathOperatorBeginsWith, - "contains": UrlPathOperatorContains, - "endswith": UrlPathOperatorEndsWith, - "equal": UrlPathOperatorEqual, - "greaterthan": UrlPathOperatorGreaterThan, - "greaterthanorequal": UrlPathOperatorGreaterThanOrEqual, - "lessthan": UrlPathOperatorLessThan, - "lessthanorequal": UrlPathOperatorLessThanOrEqual, - "regex": UrlPathOperatorRegEx, - "wildcard": UrlPathOperatorWildcard, +func parseURLPathOperator(input string) (*URLPathOperator, error) { + vals := map[string]URLPathOperator{ + "any": URLPathOperatorAny, + "beginswith": URLPathOperatorBeginsWith, + "contains": URLPathOperatorContains, + "endswith": URLPathOperatorEndsWith, + "equal": URLPathOperatorEqual, + "greaterthan": URLPathOperatorGreaterThan, + "greaterthanorequal": URLPathOperatorGreaterThanOrEqual, + "lessthan": URLPathOperatorLessThan, + "lessthanorequal": URLPathOperatorLessThanOrEqual, + "regex": URLPathOperatorRegEx, + "wildcard": URLPathOperatorWildcard, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := UrlPathOperator(input) + out := URLPathOperator(input) return &out, nil } diff --git a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleaction.go b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleaction.go index d53ca7db74d..c9742f9ceb7 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleaction.go +++ b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleaction.go @@ -102,25 +102,25 @@ func UnmarshalDeliveryRuleActionImplementation(input []byte) (DeliveryRuleAction } if strings.EqualFold(value, "UrlRedirect") { - var out UrlRedirectAction + var out URLRedirectAction if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlRedirectAction: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLRedirectAction: %+v", err) } return out, nil } if strings.EqualFold(value, "UrlRewrite") { - var out UrlRewriteAction + var out URLRewriteAction if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlRewriteAction: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLRewriteAction: %+v", err) } return out, nil } if strings.EqualFold(value, "UrlSigning") { - var out UrlSigningAction + var out URLSigningAction if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlSigningAction: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLSigningAction: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleactionparameters.go b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleactionparameters.go index 41644c20d7e..f6a9cc5b1c6 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleactionparameters.go +++ b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleactionparameters.go @@ -94,25 +94,25 @@ func UnmarshalDeliveryRuleActionParametersImplementation(input []byte) (Delivery } if strings.EqualFold(value, "DeliveryRuleUrlRedirectActionParameters") { - var out UrlRedirectActionParameters + var out URLRedirectActionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlRedirectActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLRedirectActionParameters: %+v", err) } return out, nil } if strings.EqualFold(value, "DeliveryRuleUrlRewriteActionParameters") { - var out UrlRewriteActionParameters + var out URLRewriteActionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlRewriteActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLRewriteActionParameters: %+v", err) } return out, nil } if strings.EqualFold(value, "DeliveryRuleUrlSigningActionParameters") { - var out UrlSigningActionParameters + var out URLSigningActionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlSigningActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLSigningActionParameters: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/rules/model_deliveryrulecondition.go b/resource-manager/cdn/2024-02-01/rules/model_deliveryrulecondition.go index 9f987dcf39c..f82db88bf3f 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_deliveryrulecondition.go +++ b/resource-manager/cdn/2024-02-01/rules/model_deliveryrulecondition.go @@ -182,25 +182,25 @@ func UnmarshalDeliveryRuleConditionImplementation(input []byte) (DeliveryRuleCon } if strings.EqualFold(value, "UrlFileExtension") { - var out DeliveryRuleUrlFileExtensionCondition + var out DeliveryRuleURLFileExtensionCondition if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DeliveryRuleUrlFileExtensionCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling into DeliveryRuleURLFileExtensionCondition: %+v", err) } return out, nil } if strings.EqualFold(value, "UrlFileName") { - var out DeliveryRuleUrlFileNameCondition + var out DeliveryRuleURLFileNameCondition if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DeliveryRuleUrlFileNameCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling into DeliveryRuleURLFileNameCondition: %+v", err) } return out, nil } if strings.EqualFold(value, "UrlPath") { - var out DeliveryRuleUrlPathCondition + var out DeliveryRuleURLPathCondition if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DeliveryRuleUrlPathCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling into DeliveryRuleURLPathCondition: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleconditionparameters.go b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleconditionparameters.go index fd4ab79ea5b..f527b6e7326 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleconditionparameters.go +++ b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleconditionparameters.go @@ -182,25 +182,25 @@ func UnmarshalDeliveryRuleConditionParametersImplementation(input []byte) (Deliv } if strings.EqualFold(value, "DeliveryRuleUrlFileExtensionMatchConditionParameters") { - var out UrlFileExtensionMatchConditionParameters + var out URLFileExtensionMatchConditionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlFileExtensionMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLFileExtensionMatchConditionParameters: %+v", err) } return out, nil } if strings.EqualFold(value, "DeliveryRuleUrlFilenameConditionParameters") { - var out UrlFileNameMatchConditionParameters + var out URLFileNameMatchConditionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlFileNameMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLFileNameMatchConditionParameters: %+v", err) } return out, nil } if strings.EqualFold(value, "DeliveryRuleUrlPathMatchConditionParameters") { - var out UrlPathMatchConditionParameters + var out URLPathMatchConditionParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlPathMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLPathMatchConditionParameters: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlfileextensioncondition.go b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlfileextensioncondition.go index 3e10cd3465d..1654163eb0d 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlfileextensioncondition.go +++ b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlfileextensioncondition.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleCondition = DeliveryRuleUrlFileExtensionCondition{} +var _ DeliveryRuleCondition = DeliveryRuleURLFileExtensionCondition{} -type DeliveryRuleUrlFileExtensionCondition struct { - Parameters UrlFileExtensionMatchConditionParameters `json:"parameters"` +type DeliveryRuleURLFileExtensionCondition struct { + Parameters URLFileExtensionMatchConditionParameters `json:"parameters"` // Fields inherited from DeliveryRuleCondition Name MatchVariable `json:"name"` } -func (s DeliveryRuleUrlFileExtensionCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { +func (s DeliveryRuleURLFileExtensionCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { return BaseDeliveryRuleConditionImpl{ Name: s.Name, } } -var _ json.Marshaler = DeliveryRuleUrlFileExtensionCondition{} +var _ json.Marshaler = DeliveryRuleURLFileExtensionCondition{} -func (s DeliveryRuleUrlFileExtensionCondition) MarshalJSON() ([]byte, error) { - type wrapper DeliveryRuleUrlFileExtensionCondition +func (s DeliveryRuleURLFileExtensionCondition) MarshalJSON() ([]byte, error) { + type wrapper DeliveryRuleURLFileExtensionCondition wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling DeliveryRuleUrlFileExtensionCondition: %+v", err) + return nil, fmt.Errorf("marshaling DeliveryRuleURLFileExtensionCondition: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DeliveryRuleUrlFileExtensionCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling DeliveryRuleURLFileExtensionCondition: %+v", err) } decoded["name"] = "UrlFileExtension" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling DeliveryRuleUrlFileExtensionCondition: %+v", err) + return nil, fmt.Errorf("re-marshaling DeliveryRuleURLFileExtensionCondition: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlfilenamecondition.go b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlfilenamecondition.go index 40de83410dd..c2e66c27254 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlfilenamecondition.go +++ b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlfilenamecondition.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleCondition = DeliveryRuleUrlFileNameCondition{} +var _ DeliveryRuleCondition = DeliveryRuleURLFileNameCondition{} -type DeliveryRuleUrlFileNameCondition struct { - Parameters UrlFileNameMatchConditionParameters `json:"parameters"` +type DeliveryRuleURLFileNameCondition struct { + Parameters URLFileNameMatchConditionParameters `json:"parameters"` // Fields inherited from DeliveryRuleCondition Name MatchVariable `json:"name"` } -func (s DeliveryRuleUrlFileNameCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { +func (s DeliveryRuleURLFileNameCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { return BaseDeliveryRuleConditionImpl{ Name: s.Name, } } -var _ json.Marshaler = DeliveryRuleUrlFileNameCondition{} +var _ json.Marshaler = DeliveryRuleURLFileNameCondition{} -func (s DeliveryRuleUrlFileNameCondition) MarshalJSON() ([]byte, error) { - type wrapper DeliveryRuleUrlFileNameCondition +func (s DeliveryRuleURLFileNameCondition) MarshalJSON() ([]byte, error) { + type wrapper DeliveryRuleURLFileNameCondition wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling DeliveryRuleUrlFileNameCondition: %+v", err) + return nil, fmt.Errorf("marshaling DeliveryRuleURLFileNameCondition: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DeliveryRuleUrlFileNameCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling DeliveryRuleURLFileNameCondition: %+v", err) } decoded["name"] = "UrlFileName" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling DeliveryRuleUrlFileNameCondition: %+v", err) + return nil, fmt.Errorf("re-marshaling DeliveryRuleURLFileNameCondition: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlpathcondition.go b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlpathcondition.go index 937fc47bf32..f88fc78d5b0 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlpathcondition.go +++ b/resource-manager/cdn/2024-02-01/rules/model_deliveryruleurlpathcondition.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleCondition = DeliveryRuleUrlPathCondition{} +var _ DeliveryRuleCondition = DeliveryRuleURLPathCondition{} -type DeliveryRuleUrlPathCondition struct { - Parameters UrlPathMatchConditionParameters `json:"parameters"` +type DeliveryRuleURLPathCondition struct { + Parameters URLPathMatchConditionParameters `json:"parameters"` // Fields inherited from DeliveryRuleCondition Name MatchVariable `json:"name"` } -func (s DeliveryRuleUrlPathCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { +func (s DeliveryRuleURLPathCondition) DeliveryRuleCondition() BaseDeliveryRuleConditionImpl { return BaseDeliveryRuleConditionImpl{ Name: s.Name, } } -var _ json.Marshaler = DeliveryRuleUrlPathCondition{} +var _ json.Marshaler = DeliveryRuleURLPathCondition{} -func (s DeliveryRuleUrlPathCondition) MarshalJSON() ([]byte, error) { - type wrapper DeliveryRuleUrlPathCondition +func (s DeliveryRuleURLPathCondition) MarshalJSON() ([]byte, error) { + type wrapper DeliveryRuleURLPathCondition wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling DeliveryRuleUrlPathCondition: %+v", err) + return nil, fmt.Errorf("marshaling DeliveryRuleURLPathCondition: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DeliveryRuleUrlPathCondition: %+v", err) + return nil, fmt.Errorf("unmarshaling DeliveryRuleURLPathCondition: %+v", err) } decoded["name"] = "UrlPath" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling DeliveryRuleUrlPathCondition: %+v", err) + return nil, fmt.Errorf("re-marshaling DeliveryRuleURLPathCondition: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlfileextensionmatchconditionparameters.go b/resource-manager/cdn/2024-02-01/rules/model_urlfileextensionmatchconditionparameters.go index 21b26fd6fd1..275ca468b7a 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlfileextensionmatchconditionparameters.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlfileextensionmatchconditionparameters.go @@ -8,12 +8,12 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleConditionParameters = UrlFileExtensionMatchConditionParameters{} +var _ DeliveryRuleConditionParameters = URLFileExtensionMatchConditionParameters{} -type UrlFileExtensionMatchConditionParameters struct { +type URLFileExtensionMatchConditionParameters struct { MatchValues *[]string `json:"matchValues,omitempty"` NegateCondition *bool `json:"negateCondition,omitempty"` - Operator UrlFileExtensionOperator `json:"operator"` + Operator URLFileExtensionOperator `json:"operator"` Transforms *[]Transform `json:"transforms,omitempty"` // Fields inherited from DeliveryRuleConditionParameters @@ -21,32 +21,32 @@ type UrlFileExtensionMatchConditionParameters struct { TypeName DeliveryRuleConditionParametersType `json:"typeName"` } -func (s UrlFileExtensionMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { +func (s URLFileExtensionMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { return BaseDeliveryRuleConditionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlFileExtensionMatchConditionParameters{} +var _ json.Marshaler = URLFileExtensionMatchConditionParameters{} -func (s UrlFileExtensionMatchConditionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlFileExtensionMatchConditionParameters +func (s URLFileExtensionMatchConditionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLFileExtensionMatchConditionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlFileExtensionMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLFileExtensionMatchConditionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlFileExtensionMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLFileExtensionMatchConditionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlFileExtensionMatchConditionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlFileExtensionMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLFileExtensionMatchConditionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlfilenamematchconditionparameters.go b/resource-manager/cdn/2024-02-01/rules/model_urlfilenamematchconditionparameters.go index 611acf6b2cb..5d6316c6493 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlfilenamematchconditionparameters.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlfilenamematchconditionparameters.go @@ -8,12 +8,12 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleConditionParameters = UrlFileNameMatchConditionParameters{} +var _ DeliveryRuleConditionParameters = URLFileNameMatchConditionParameters{} -type UrlFileNameMatchConditionParameters struct { +type URLFileNameMatchConditionParameters struct { MatchValues *[]string `json:"matchValues,omitempty"` NegateCondition *bool `json:"negateCondition,omitempty"` - Operator UrlFileNameOperator `json:"operator"` + Operator URLFileNameOperator `json:"operator"` Transforms *[]Transform `json:"transforms,omitempty"` // Fields inherited from DeliveryRuleConditionParameters @@ -21,32 +21,32 @@ type UrlFileNameMatchConditionParameters struct { TypeName DeliveryRuleConditionParametersType `json:"typeName"` } -func (s UrlFileNameMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { +func (s URLFileNameMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { return BaseDeliveryRuleConditionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlFileNameMatchConditionParameters{} +var _ json.Marshaler = URLFileNameMatchConditionParameters{} -func (s UrlFileNameMatchConditionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlFileNameMatchConditionParameters +func (s URLFileNameMatchConditionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLFileNameMatchConditionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlFileNameMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLFileNameMatchConditionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlFileNameMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLFileNameMatchConditionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlFilenameConditionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlFileNameMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLFileNameMatchConditionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlpathmatchconditionparameters.go b/resource-manager/cdn/2024-02-01/rules/model_urlpathmatchconditionparameters.go index 0de2e11db74..e62c36d355c 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlpathmatchconditionparameters.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlpathmatchconditionparameters.go @@ -8,12 +8,12 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleConditionParameters = UrlPathMatchConditionParameters{} +var _ DeliveryRuleConditionParameters = URLPathMatchConditionParameters{} -type UrlPathMatchConditionParameters struct { +type URLPathMatchConditionParameters struct { MatchValues *[]string `json:"matchValues,omitempty"` NegateCondition *bool `json:"negateCondition,omitempty"` - Operator UrlPathOperator `json:"operator"` + Operator URLPathOperator `json:"operator"` Transforms *[]Transform `json:"transforms,omitempty"` // Fields inherited from DeliveryRuleConditionParameters @@ -21,32 +21,32 @@ type UrlPathMatchConditionParameters struct { TypeName DeliveryRuleConditionParametersType `json:"typeName"` } -func (s UrlPathMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { +func (s URLPathMatchConditionParameters) DeliveryRuleConditionParameters() BaseDeliveryRuleConditionParametersImpl { return BaseDeliveryRuleConditionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlPathMatchConditionParameters{} +var _ json.Marshaler = URLPathMatchConditionParameters{} -func (s UrlPathMatchConditionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlPathMatchConditionParameters +func (s URLPathMatchConditionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLPathMatchConditionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlPathMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLPathMatchConditionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlPathMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLPathMatchConditionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlPathMatchConditionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlPathMatchConditionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLPathMatchConditionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlredirectaction.go b/resource-manager/cdn/2024-02-01/rules/model_urlredirectaction.go index 63d35c55d69..578a809c159 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlredirectaction.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlredirectaction.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleAction = UrlRedirectAction{} +var _ DeliveryRuleAction = URLRedirectAction{} -type UrlRedirectAction struct { - Parameters UrlRedirectActionParameters `json:"parameters"` +type URLRedirectAction struct { + Parameters URLRedirectActionParameters `json:"parameters"` // Fields inherited from DeliveryRuleAction Name DeliveryRuleActionName `json:"name"` } -func (s UrlRedirectAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { +func (s URLRedirectAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { return BaseDeliveryRuleActionImpl{ Name: s.Name, } } -var _ json.Marshaler = UrlRedirectAction{} +var _ json.Marshaler = URLRedirectAction{} -func (s UrlRedirectAction) MarshalJSON() ([]byte, error) { - type wrapper UrlRedirectAction +func (s URLRedirectAction) MarshalJSON() ([]byte, error) { + type wrapper URLRedirectAction wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlRedirectAction: %+v", err) + return nil, fmt.Errorf("marshaling URLRedirectAction: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlRedirectAction: %+v", err) + return nil, fmt.Errorf("unmarshaling URLRedirectAction: %+v", err) } decoded["name"] = "UrlRedirect" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlRedirectAction: %+v", err) + return nil, fmt.Errorf("re-marshaling URLRedirectAction: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlredirectactionparameters.go b/resource-manager/cdn/2024-02-01/rules/model_urlredirectactionparameters.go index 98ca92159c8..e9f8a9a7ada 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlredirectactionparameters.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlredirectactionparameters.go @@ -8,9 +8,9 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleActionParameters = UrlRedirectActionParameters{} +var _ DeliveryRuleActionParameters = URLRedirectActionParameters{} -type UrlRedirectActionParameters struct { +type URLRedirectActionParameters struct { CustomFragment *string `json:"customFragment,omitempty"` CustomHostname *string `json:"customHostname,omitempty"` CustomPath *string `json:"customPath,omitempty"` @@ -23,32 +23,32 @@ type UrlRedirectActionParameters struct { TypeName DeliveryRuleActionParametersType `json:"typeName"` } -func (s UrlRedirectActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { +func (s URLRedirectActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { return BaseDeliveryRuleActionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlRedirectActionParameters{} +var _ json.Marshaler = URLRedirectActionParameters{} -func (s UrlRedirectActionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlRedirectActionParameters +func (s URLRedirectActionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLRedirectActionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlRedirectActionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLRedirectActionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlRedirectActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLRedirectActionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlRedirectActionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlRedirectActionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLRedirectActionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlrewriteaction.go b/resource-manager/cdn/2024-02-01/rules/model_urlrewriteaction.go index ff7258a8371..a8b1e21014c 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlrewriteaction.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlrewriteaction.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleAction = UrlRewriteAction{} +var _ DeliveryRuleAction = URLRewriteAction{} -type UrlRewriteAction struct { - Parameters UrlRewriteActionParameters `json:"parameters"` +type URLRewriteAction struct { + Parameters URLRewriteActionParameters `json:"parameters"` // Fields inherited from DeliveryRuleAction Name DeliveryRuleActionName `json:"name"` } -func (s UrlRewriteAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { +func (s URLRewriteAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { return BaseDeliveryRuleActionImpl{ Name: s.Name, } } -var _ json.Marshaler = UrlRewriteAction{} +var _ json.Marshaler = URLRewriteAction{} -func (s UrlRewriteAction) MarshalJSON() ([]byte, error) { - type wrapper UrlRewriteAction +func (s URLRewriteAction) MarshalJSON() ([]byte, error) { + type wrapper URLRewriteAction wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlRewriteAction: %+v", err) + return nil, fmt.Errorf("marshaling URLRewriteAction: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlRewriteAction: %+v", err) + return nil, fmt.Errorf("unmarshaling URLRewriteAction: %+v", err) } decoded["name"] = "UrlRewrite" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlRewriteAction: %+v", err) + return nil, fmt.Errorf("re-marshaling URLRewriteAction: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlrewriteactionparameters.go b/resource-manager/cdn/2024-02-01/rules/model_urlrewriteactionparameters.go index 4cd9e9bff0c..e142109b425 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlrewriteactionparameters.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlrewriteactionparameters.go @@ -8,9 +8,9 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleActionParameters = UrlRewriteActionParameters{} +var _ DeliveryRuleActionParameters = URLRewriteActionParameters{} -type UrlRewriteActionParameters struct { +type URLRewriteActionParameters struct { Destination string `json:"destination"` PreserveUnmatchedPath *bool `json:"preserveUnmatchedPath,omitempty"` SourcePattern string `json:"sourcePattern"` @@ -20,32 +20,32 @@ type UrlRewriteActionParameters struct { TypeName DeliveryRuleActionParametersType `json:"typeName"` } -func (s UrlRewriteActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { +func (s URLRewriteActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { return BaseDeliveryRuleActionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlRewriteActionParameters{} +var _ json.Marshaler = URLRewriteActionParameters{} -func (s UrlRewriteActionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlRewriteActionParameters +func (s URLRewriteActionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLRewriteActionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlRewriteActionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLRewriteActionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlRewriteActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLRewriteActionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlRewriteActionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlRewriteActionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLRewriteActionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlsigningaction.go b/resource-manager/cdn/2024-02-01/rules/model_urlsigningaction.go index c119bfa48cc..7d5cb1faa22 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlsigningaction.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlsigningaction.go @@ -8,42 +8,42 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleAction = UrlSigningAction{} +var _ DeliveryRuleAction = URLSigningAction{} -type UrlSigningAction struct { - Parameters UrlSigningActionParameters `json:"parameters"` +type URLSigningAction struct { + Parameters URLSigningActionParameters `json:"parameters"` // Fields inherited from DeliveryRuleAction Name DeliveryRuleActionName `json:"name"` } -func (s UrlSigningAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { +func (s URLSigningAction) DeliveryRuleAction() BaseDeliveryRuleActionImpl { return BaseDeliveryRuleActionImpl{ Name: s.Name, } } -var _ json.Marshaler = UrlSigningAction{} +var _ json.Marshaler = URLSigningAction{} -func (s UrlSigningAction) MarshalJSON() ([]byte, error) { - type wrapper UrlSigningAction +func (s URLSigningAction) MarshalJSON() ([]byte, error) { + type wrapper URLSigningAction wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlSigningAction: %+v", err) + return nil, fmt.Errorf("marshaling URLSigningAction: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlSigningAction: %+v", err) + return nil, fmt.Errorf("unmarshaling URLSigningAction: %+v", err) } decoded["name"] = "UrlSigning" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlSigningAction: %+v", err) + return nil, fmt.Errorf("re-marshaling URLSigningAction: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlsigningactionparameters.go b/resource-manager/cdn/2024-02-01/rules/model_urlsigningactionparameters.go index bbab36d001f..787ca3ac7c1 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlsigningactionparameters.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlsigningactionparameters.go @@ -8,43 +8,43 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ DeliveryRuleActionParameters = UrlSigningActionParameters{} +var _ DeliveryRuleActionParameters = URLSigningActionParameters{} -type UrlSigningActionParameters struct { +type URLSigningActionParameters struct { Algorithm *Algorithm `json:"algorithm,omitempty"` - ParameterNameOverride *[]UrlSigningParamIdentifier `json:"parameterNameOverride,omitempty"` + ParameterNameOverride *[]URLSigningParamIdentifier `json:"parameterNameOverride,omitempty"` // Fields inherited from DeliveryRuleActionParameters TypeName DeliveryRuleActionParametersType `json:"typeName"` } -func (s UrlSigningActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { +func (s URLSigningActionParameters) DeliveryRuleActionParameters() BaseDeliveryRuleActionParametersImpl { return BaseDeliveryRuleActionParametersImpl{ TypeName: s.TypeName, } } -var _ json.Marshaler = UrlSigningActionParameters{} +var _ json.Marshaler = URLSigningActionParameters{} -func (s UrlSigningActionParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlSigningActionParameters +func (s URLSigningActionParameters) MarshalJSON() ([]byte, error) { + type wrapper URLSigningActionParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlSigningActionParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLSigningActionParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlSigningActionParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLSigningActionParameters: %+v", err) } decoded["typeName"] = "DeliveryRuleUrlSigningActionParameters" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlSigningActionParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLSigningActionParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/rules/model_urlsigningparamidentifier.go b/resource-manager/cdn/2024-02-01/rules/model_urlsigningparamidentifier.go index c8c8ae6a812..6b81c77c9b8 100644 --- a/resource-manager/cdn/2024-02-01/rules/model_urlsigningparamidentifier.go +++ b/resource-manager/cdn/2024-02-01/rules/model_urlsigningparamidentifier.go @@ -3,7 +3,7 @@ package rules // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type UrlSigningParamIdentifier struct { +type URLSigningParamIdentifier struct { ParamIndicator ParamIndicator `json:"paramIndicator"` ParamName string `json:"paramName"` } diff --git a/resource-manager/cdn/2024-02-01/secrets/constants.go b/resource-manager/cdn/2024-02-01/secrets/constants.go index c8027d12eef..c5fd9ff587b 100644 --- a/resource-manager/cdn/2024-02-01/secrets/constants.go +++ b/resource-manager/cdn/2024-02-01/secrets/constants.go @@ -112,7 +112,7 @@ const ( SecretTypeAzureFirstPartyManagedCertificate SecretType = "AzureFirstPartyManagedCertificate" SecretTypeCustomerCertificate SecretType = "CustomerCertificate" SecretTypeManagedCertificate SecretType = "ManagedCertificate" - SecretTypeUrlSigningKey SecretType = "UrlSigningKey" + SecretTypeURLSigningKey SecretType = "UrlSigningKey" ) func PossibleValuesForSecretType() []string { @@ -120,7 +120,7 @@ func PossibleValuesForSecretType() []string { string(SecretTypeAzureFirstPartyManagedCertificate), string(SecretTypeCustomerCertificate), string(SecretTypeManagedCertificate), - string(SecretTypeUrlSigningKey), + string(SecretTypeURLSigningKey), } } @@ -142,7 +142,7 @@ func parseSecretType(input string) (*SecretType, error) { "azurefirstpartymanagedcertificate": SecretTypeAzureFirstPartyManagedCertificate, "customercertificate": SecretTypeCustomerCertificate, "managedcertificate": SecretTypeManagedCertificate, - "urlsigningkey": SecretTypeUrlSigningKey, + "urlsigningkey": SecretTypeURLSigningKey, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/cdn/2024-02-01/secrets/model_secretparameters.go b/resource-manager/cdn/2024-02-01/secrets/model_secretparameters.go index 2870d26b4c7..29be92c985c 100644 --- a/resource-manager/cdn/2024-02-01/secrets/model_secretparameters.go +++ b/resource-manager/cdn/2024-02-01/secrets/model_secretparameters.go @@ -78,9 +78,9 @@ func UnmarshalSecretParametersImplementation(input []byte) (SecretParameters, er } if strings.EqualFold(value, "UrlSigningKey") { - var out UrlSigningKeyParameters + var out URLSigningKeyParameters if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlSigningKeyParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling into URLSigningKeyParameters: %+v", err) } return out, nil } diff --git a/resource-manager/cdn/2024-02-01/secrets/model_urlsigningkeyparameters.go b/resource-manager/cdn/2024-02-01/secrets/model_urlsigningkeyparameters.go index 0d9110f3f48..5030e7658ac 100644 --- a/resource-manager/cdn/2024-02-01/secrets/model_urlsigningkeyparameters.go +++ b/resource-manager/cdn/2024-02-01/secrets/model_urlsigningkeyparameters.go @@ -8,9 +8,9 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ SecretParameters = UrlSigningKeyParameters{} +var _ SecretParameters = URLSigningKeyParameters{} -type UrlSigningKeyParameters struct { +type URLSigningKeyParameters struct { KeyId string `json:"keyId"` SecretSource ResourceReference `json:"secretSource"` SecretVersion *string `json:"secretVersion,omitempty"` @@ -20,32 +20,32 @@ type UrlSigningKeyParameters struct { Type SecretType `json:"type"` } -func (s UrlSigningKeyParameters) SecretParameters() BaseSecretParametersImpl { +func (s URLSigningKeyParameters) SecretParameters() BaseSecretParametersImpl { return BaseSecretParametersImpl{ Type: s.Type, } } -var _ json.Marshaler = UrlSigningKeyParameters{} +var _ json.Marshaler = URLSigningKeyParameters{} -func (s UrlSigningKeyParameters) MarshalJSON() ([]byte, error) { - type wrapper UrlSigningKeyParameters +func (s URLSigningKeyParameters) MarshalJSON() ([]byte, error) { + type wrapper URLSigningKeyParameters wrapped := wrapper(s) encoded, err := json.Marshal(wrapped) if err != nil { - return nil, fmt.Errorf("marshaling UrlSigningKeyParameters: %+v", err) + return nil, fmt.Errorf("marshaling URLSigningKeyParameters: %+v", err) } var decoded map[string]interface{} if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlSigningKeyParameters: %+v", err) + return nil, fmt.Errorf("unmarshaling URLSigningKeyParameters: %+v", err) } decoded["type"] = "UrlSigningKey" encoded, err = json.Marshal(decoded) if err != nil { - return nil, fmt.Errorf("re-marshaling UrlSigningKeyParameters: %+v", err) + return nil, fmt.Errorf("re-marshaling URLSigningKeyParameters: %+v", err) } return encoded, nil diff --git a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/README.md b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/README.md index 427347b3b8b..92539fe2a69 100644 --- a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/README.md +++ b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.CdnWebApplicationFirewallPolicy{ // ... @@ -42,7 +42,7 @@ if err := client.PoliciesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName") read, err := client.PoliciesDelete(ctx, id) if err != nil { @@ -58,7 +58,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName") read, err := client.PoliciesGet(ctx, id) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.CdnWebApplicationFirewallPolicyPatchParameters{ // ... diff --git a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/constants.go b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/constants.go index c5acc5a0a4b..674e07f7495 100644 --- a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/constants.go +++ b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/constants.go @@ -518,9 +518,9 @@ const ( TransformTypeLowercase TransformType = "Lowercase" TransformTypeRemoveNulls TransformType = "RemoveNulls" TransformTypeTrim TransformType = "Trim" + TransformTypeURLDecode TransformType = "UrlDecode" + TransformTypeURLEncode TransformType = "UrlEncode" TransformTypeUppercase TransformType = "Uppercase" - TransformTypeUrlDecode TransformType = "UrlDecode" - TransformTypeUrlEncode TransformType = "UrlEncode" ) func PossibleValuesForTransformType() []string { @@ -528,9 +528,9 @@ func PossibleValuesForTransformType() []string { string(TransformTypeLowercase), string(TransformTypeRemoveNulls), string(TransformTypeTrim), + string(TransformTypeURLDecode), + string(TransformTypeURLEncode), string(TransformTypeUppercase), - string(TransformTypeUrlDecode), - string(TransformTypeUrlEncode), } } @@ -552,9 +552,9 @@ func parseTransformType(input string) (*TransformType, error) { "lowercase": TransformTypeLowercase, "removenulls": TransformTypeRemoveNulls, "trim": TransformTypeTrim, + "urldecode": TransformTypeURLDecode, + "urlencode": TransformTypeURLEncode, "uppercase": TransformTypeUppercase, - "urldecode": TransformTypeUrlDecode, - "urlencode": TransformTypeUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/id_cdnwebapplicationfirewallpolicy.go b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/id_cdnwebapplicationfirewallpolicy.go index 065bdd76c3c..6153eee68ae 100644 --- a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/id_cdnwebapplicationfirewallpolicy.go +++ b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/id_cdnwebapplicationfirewallpolicy.go @@ -115,7 +115,7 @@ func (id CdnWebApplicationFirewallPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCDN", "Microsoft.CDN", "Microsoft.CDN"), resourceids.StaticSegment("staticCdnWebApplicationFirewallPolicies", "cdnWebApplicationFirewallPolicies", "cdnWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("cdnWebApplicationFirewallPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("cdnWebApplicationFirewallPolicyName", "cdnWebApplicationFirewallPolicyName"), } } diff --git a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/id_cdnwebapplicationfirewallpolicy_test.go b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/id_cdnwebapplicationfirewallpolicy_test.go index 1a7ffbb9313..87fd6a25f66 100644 --- a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/id_cdnwebapplicationfirewallpolicy_test.go +++ b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/id_cdnwebapplicationfirewallpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CdnWebApplicationFirewallPolicyId{} func TestNewCdnWebApplicationFirewallPolicyID(t *testing.T) { - id := NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCdnWebApplicationFirewallPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CdnWebApplicationFirewallPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'CdnWebApplicationFirewallPolicyName'", id.CdnWebApplicationFirewallPolicyName, "policyName") + if id.CdnWebApplicationFirewallPolicyName != "cdnWebApplicationFirewallPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'CdnWebApplicationFirewallPolicyName'", id.CdnWebApplicationFirewallPolicyName, "cdnWebApplicationFirewallPolicyName") } } func TestFormatCdnWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/policyName" + actual := NewCdnWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cdnWebApplicationFirewallPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/cdnWebApplicationFirewallPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCdnWebApplicationFirewallPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/cdnWebApplicationFirewallPolicyName", Expected: &CdnWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CdnWebApplicationFirewallPolicyName: "policyName", + CdnWebApplicationFirewallPolicyName: "cdnWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/cdnWebApplicationFirewallPolicyName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCdnWebApplicationFirewallPolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/cdnWebApplicationFirewallPolicyName", Expected: &CdnWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CdnWebApplicationFirewallPolicyName: "policyName", + CdnWebApplicationFirewallPolicyName: "cdnWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CDN/cdnWebApplicationFirewallPolicies/cdnWebApplicationFirewallPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/cDnWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/cDnWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/cDnWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe", Expected: &CdnWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CdnWebApplicationFirewallPolicyName: "pOlIcYnAmE", + CdnWebApplicationFirewallPolicyName: "cDnWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/cDnWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cDn/cDnWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/cDnWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe/extra", Error: true, }, } diff --git a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/model_policysettings.go b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/model_policysettings.go index dc011a63138..c9c6b06dcc8 100644 --- a/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/model_policysettings.go +++ b/resource-manager/cdn/2024-02-01/webapplicationfirewallpolicies/model_policysettings.go @@ -6,7 +6,7 @@ package webapplicationfirewallpolicies type PolicySettings struct { DefaultCustomBlockResponseBody *string `json:"defaultCustomBlockResponseBody,omitempty"` DefaultCustomBlockResponseStatusCode *DefaultCustomBlockResponseStatusCode `json:"defaultCustomBlockResponseStatusCode,omitempty"` - DefaultRedirectUrl *string `json:"defaultRedirectUrl,omitempty"` + DefaultRedirectURL *string `json:"defaultRedirectUrl,omitempty"` EnabledState *PolicyEnabledState `json:"enabledState,omitempty"` Mode *PolicyMode `json:"mode,omitempty"` } diff --git a/resource-manager/chaosstudio/2023-11-01/experiments/model_simplefilterparameters.go b/resource-manager/chaosstudio/2023-11-01/experiments/model_simplefilterparameters.go index a69b07a3e68..a93c2dc69eb 100644 --- a/resource-manager/chaosstudio/2023-11-01/experiments/model_simplefilterparameters.go +++ b/resource-manager/chaosstudio/2023-11-01/experiments/model_simplefilterparameters.go @@ -1,8 +1,12 @@ package experiments +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type SimpleFilterParameters struct { - Zones *[]string `json:"zones,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` } diff --git a/resource-manager/chaosstudio/2024-01-01/experiments/model_simplefilterparameters.go b/resource-manager/chaosstudio/2024-01-01/experiments/model_simplefilterparameters.go index a69b07a3e68..a93c2dc69eb 100644 --- a/resource-manager/chaosstudio/2024-01-01/experiments/model_simplefilterparameters.go +++ b/resource-manager/chaosstudio/2024-01-01/experiments/model_simplefilterparameters.go @@ -1,8 +1,12 @@ package experiments +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type SimpleFilterParameters struct { - Zones *[]string `json:"zones,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` } diff --git a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/README.md b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/README.md index f8d12af0772..a7105880596 100644 --- a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/README.md +++ b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/README.md @@ -229,7 +229,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cognitiveservicesaccounts.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := cognitiveservicesaccounts.CheckSkuAvailabilityParameter{ // ... @@ -250,7 +250,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") +id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") read, err := client.DeletedAccountsGet(ctx, id) if err != nil { @@ -283,7 +283,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") +id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") if err := client.DeletedAccountsPurgeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_deletedaccount.go b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_deletedaccount.go index 06b62b98f51..119662e5040 100644 --- a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_deletedaccount.go +++ b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_deletedaccount.go @@ -119,11 +119,11 @@ func (id DeletedAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), resourceids.StaticSegment("staticDeletedAccounts", "deletedAccounts", "deletedAccounts"), - resourceids.UserSpecifiedSegment("deletedAccountName", "accountName"), + resourceids.UserSpecifiedSegment("deletedAccountName", "deletedAccountName"), } } diff --git a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_deletedaccount_test.go b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_deletedaccount_test.go index dd73eb1f587..014ef217729 100644 --- a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_deletedaccount_test.go +++ b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_deletedaccount_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &DeletedAccountId{} func TestNewDeletedAccountID(t *testing.T) { - id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") + id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.ResourceGroupName != "example-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DeletedAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedAccountName'", id.DeletedAccountName, "accountName") + if id.DeletedAccountName != "deletedAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedAccountName'", id.DeletedAccountName, "deletedAccountName") } } func TestFormatDeletedAccountID(t *testing.T) { - actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName" + actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseDeletedAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", ResourceGroupName: "example-resource-group", - DeletedAccountName: "accountName", + DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseDeletedAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", ResourceGroupName: "example-resource-group", - DeletedAccountName: "accountName", + DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DeletedAccountName: "aCcOuNtNaMe", + DeletedAccountName: "dElEtEdAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_location.go b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_location.go index 367e04d1dfd..07df845235d 100644 --- a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_location.go +++ b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_location_test.go b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_location_test.go index 66b967c58c0..308e0866154 100644 --- a/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_location_test.go +++ b/resource-manager/cognitive/2023-05-01/cognitiveservicesaccounts/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-05-01/commitmentplans/README.md b/resource-manager/cognitive/2023-05-01/commitmentplans/README.md index 55dad6da5de..6e43909c3e4 100644 --- a/resource-manager/cognitive/2023-05-01/commitmentplans/README.md +++ b/resource-manager/cognitive/2023-05-01/commitmentplans/README.md @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") payload := commitmentplans.CommitmentPlanAccountAssociation{ // ... @@ -74,7 +74,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") if err := client.DeleteAssociationThenPoll(ctx, id); err != nil { // handle the error @@ -102,7 +102,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") read, err := client.GetAssociation(ctx, id) if err != nil { diff --git a/resource-manager/cognitive/2023-05-01/commitmentplans/id_accountassociation.go b/resource-manager/cognitive/2023-05-01/commitmentplans/id_accountassociation.go index 209ee3fb56a..18f20d9c5e6 100644 --- a/resource-manager/cognitive/2023-05-01/commitmentplans/id_accountassociation.go +++ b/resource-manager/cognitive/2023-05-01/commitmentplans/id_accountassociation.go @@ -123,7 +123,7 @@ func (id AccountAssociationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticCommitmentPlans", "commitmentPlans", "commitmentPlans"), resourceids.UserSpecifiedSegment("commitmentPlanName", "commitmentPlanName"), resourceids.StaticSegment("staticAccountAssociations", "accountAssociations", "accountAssociations"), - resourceids.UserSpecifiedSegment("accountAssociationName", "commitmentPlanAssociationName"), + resourceids.UserSpecifiedSegment("accountAssociationName", "accountAssociationName"), } } diff --git a/resource-manager/cognitive/2023-05-01/commitmentplans/id_accountassociation_test.go b/resource-manager/cognitive/2023-05-01/commitmentplans/id_accountassociation_test.go index 71c3013ef8f..138be5831dc 100644 --- a/resource-manager/cognitive/2023-05-01/commitmentplans/id_accountassociation_test.go +++ b/resource-manager/cognitive/2023-05-01/commitmentplans/id_accountassociation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountAssociationId{} func TestNewAccountAssociationID(t *testing.T) { - id := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") + id := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAccountAssociationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'CommitmentPlanName'", id.CommitmentPlanName, "commitmentPlanName") } - if id.AccountAssociationName != "commitmentPlanAssociationName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountAssociationName'", id.AccountAssociationName, "commitmentPlanAssociationName") + if id.AccountAssociationName != "accountAssociationName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountAssociationName'", id.AccountAssociationName, "accountAssociationName") } } func TestFormatAccountAssociationID(t *testing.T) { - actual := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName" + actual := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAccountAssociationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CommitmentPlanName: "commitmentPlanName", - AccountAssociationName: "commitmentPlanAssociationName", + AccountAssociationName: "accountAssociationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAccountAssociationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CommitmentPlanName: "commitmentPlanName", - AccountAssociationName: "commitmentPlanAssociationName", + AccountAssociationName: "accountAssociationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/cOmMiTmEnTpLaNaSsOcIaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/aCcOuNtAsSoCiAtIoNnAmE", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CommitmentPlanName: "cOmMiTmEnTpLaNnAmE", - AccountAssociationName: "cOmMiTmEnTpLaNaSsOcIaTiOnNaMe", + AccountAssociationName: "aCcOuNtAsSoCiAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/cOmMiTmEnTpLaNaSsOcIaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/aCcOuNtAsSoCiAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-05-01/commitmenttiers/README.md b/resource-manager/cognitive/2023-05-01/commitmenttiers/README.md index 4079d306ba5..821706dedd3 100644 --- a/resource-manager/cognitive/2023-05-01/commitmenttiers/README.md +++ b/resource-manager/cognitive/2023-05-01/commitmenttiers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commitmenttiers.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := commitmenttiers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/cognitive/2023-05-01/commitmenttiers/id_location.go b/resource-manager/cognitive/2023-05-01/commitmenttiers/id_location.go index 00a0650a0cb..0b5e5b77479 100644 --- a/resource-manager/cognitive/2023-05-01/commitmenttiers/id_location.go +++ b/resource-manager/cognitive/2023-05-01/commitmenttiers/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-05-01/commitmenttiers/id_location_test.go b/resource-manager/cognitive/2023-05-01/commitmenttiers/id_location_test.go index d2c1bc5c45b..c1578035e98 100644 --- a/resource-manager/cognitive/2023-05-01/commitmenttiers/id_location_test.go +++ b/resource-manager/cognitive/2023-05-01/commitmenttiers/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-05-01/models/README.md b/resource-manager/cognitive/2023-05-01/models/README.md index 317b3f4919a..081acd5add7 100644 --- a/resource-manager/cognitive/2023-05-01/models/README.md +++ b/resource-manager/cognitive/2023-05-01/models/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := models.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := models.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/cognitive/2023-05-01/models/id_location.go b/resource-manager/cognitive/2023-05-01/models/id_location.go index 152bcf9a770..bfe100c794a 100644 --- a/resource-manager/cognitive/2023-05-01/models/id_location.go +++ b/resource-manager/cognitive/2023-05-01/models/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-05-01/models/id_location_test.go b/resource-manager/cognitive/2023-05-01/models/id_location_test.go index 3190d9278db..a5bef3983a9 100644 --- a/resource-manager/cognitive/2023-05-01/models/id_location_test.go +++ b/resource-manager/cognitive/2023-05-01/models/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-05-01/usages/README.md b/resource-manager/cognitive/2023-05-01/usages/README.md index eaf25f3145c..d9b122c2d51 100644 --- a/resource-manager/cognitive/2023-05-01/usages/README.md +++ b/resource-manager/cognitive/2023-05-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id, usages.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, usages.DefaultListOperationOptions()) diff --git a/resource-manager/cognitive/2023-05-01/usages/id_location.go b/resource-manager/cognitive/2023-05-01/usages/id_location.go index 83f39a75beb..6ed669b9c07 100644 --- a/resource-manager/cognitive/2023-05-01/usages/id_location.go +++ b/resource-manager/cognitive/2023-05-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-05-01/usages/id_location_test.go b/resource-manager/cognitive/2023-05-01/usages/id_location_test.go index 59878e904b5..dd806e02b46 100644 --- a/resource-manager/cognitive/2023-05-01/usages/id_location_test.go +++ b/resource-manager/cognitive/2023-05-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/README.md b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/README.md index daae56a7ecb..f59020b9042 100644 --- a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/README.md +++ b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/README.md @@ -229,7 +229,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cognitiveservicesaccounts.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := cognitiveservicesaccounts.CheckSkuAvailabilityParameter{ // ... @@ -250,7 +250,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") +id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") read, err := client.DeletedAccountsGet(ctx, id) if err != nil { @@ -283,7 +283,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") +id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") if err := client.DeletedAccountsPurgeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_deletedaccount.go b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_deletedaccount.go index 06b62b98f51..119662e5040 100644 --- a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_deletedaccount.go +++ b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_deletedaccount.go @@ -119,11 +119,11 @@ func (id DeletedAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), resourceids.StaticSegment("staticDeletedAccounts", "deletedAccounts", "deletedAccounts"), - resourceids.UserSpecifiedSegment("deletedAccountName", "accountName"), + resourceids.UserSpecifiedSegment("deletedAccountName", "deletedAccountName"), } } diff --git a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_deletedaccount_test.go b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_deletedaccount_test.go index dd73eb1f587..014ef217729 100644 --- a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_deletedaccount_test.go +++ b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_deletedaccount_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &DeletedAccountId{} func TestNewDeletedAccountID(t *testing.T) { - id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") + id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.ResourceGroupName != "example-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DeletedAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedAccountName'", id.DeletedAccountName, "accountName") + if id.DeletedAccountName != "deletedAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedAccountName'", id.DeletedAccountName, "deletedAccountName") } } func TestFormatDeletedAccountID(t *testing.T) { - actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName" + actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseDeletedAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", ResourceGroupName: "example-resource-group", - DeletedAccountName: "accountName", + DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseDeletedAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", ResourceGroupName: "example-resource-group", - DeletedAccountName: "accountName", + DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DeletedAccountName: "aCcOuNtNaMe", + DeletedAccountName: "dElEtEdAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_location.go b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_location.go index 367e04d1dfd..07df845235d 100644 --- a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_location.go +++ b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_location_test.go b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_location_test.go index 66b967c58c0..308e0866154 100644 --- a/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_location_test.go +++ b/resource-manager/cognitive/2023-10-01-preview/cognitiveservicesaccounts/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-10-01-preview/commitmentplans/README.md b/resource-manager/cognitive/2023-10-01-preview/commitmentplans/README.md index 5a0cd0fdb0d..302f776d904 100644 --- a/resource-manager/cognitive/2023-10-01-preview/commitmentplans/README.md +++ b/resource-manager/cognitive/2023-10-01-preview/commitmentplans/README.md @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") payload := commitmentplans.CommitmentPlanAccountAssociation{ // ... @@ -74,7 +74,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") if err := client.DeleteAssociationThenPoll(ctx, id); err != nil { // handle the error @@ -102,7 +102,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") read, err := client.GetAssociation(ctx, id) if err != nil { diff --git a/resource-manager/cognitive/2023-10-01-preview/commitmentplans/id_accountassociation.go b/resource-manager/cognitive/2023-10-01-preview/commitmentplans/id_accountassociation.go index 209ee3fb56a..18f20d9c5e6 100644 --- a/resource-manager/cognitive/2023-10-01-preview/commitmentplans/id_accountassociation.go +++ b/resource-manager/cognitive/2023-10-01-preview/commitmentplans/id_accountassociation.go @@ -123,7 +123,7 @@ func (id AccountAssociationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticCommitmentPlans", "commitmentPlans", "commitmentPlans"), resourceids.UserSpecifiedSegment("commitmentPlanName", "commitmentPlanName"), resourceids.StaticSegment("staticAccountAssociations", "accountAssociations", "accountAssociations"), - resourceids.UserSpecifiedSegment("accountAssociationName", "commitmentPlanAssociationName"), + resourceids.UserSpecifiedSegment("accountAssociationName", "accountAssociationName"), } } diff --git a/resource-manager/cognitive/2023-10-01-preview/commitmentplans/id_accountassociation_test.go b/resource-manager/cognitive/2023-10-01-preview/commitmentplans/id_accountassociation_test.go index 71c3013ef8f..138be5831dc 100644 --- a/resource-manager/cognitive/2023-10-01-preview/commitmentplans/id_accountassociation_test.go +++ b/resource-manager/cognitive/2023-10-01-preview/commitmentplans/id_accountassociation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountAssociationId{} func TestNewAccountAssociationID(t *testing.T) { - id := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") + id := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAccountAssociationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'CommitmentPlanName'", id.CommitmentPlanName, "commitmentPlanName") } - if id.AccountAssociationName != "commitmentPlanAssociationName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountAssociationName'", id.AccountAssociationName, "commitmentPlanAssociationName") + if id.AccountAssociationName != "accountAssociationName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountAssociationName'", id.AccountAssociationName, "accountAssociationName") } } func TestFormatAccountAssociationID(t *testing.T) { - actual := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName" + actual := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAccountAssociationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CommitmentPlanName: "commitmentPlanName", - AccountAssociationName: "commitmentPlanAssociationName", + AccountAssociationName: "accountAssociationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAccountAssociationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CommitmentPlanName: "commitmentPlanName", - AccountAssociationName: "commitmentPlanAssociationName", + AccountAssociationName: "accountAssociationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/cOmMiTmEnTpLaNaSsOcIaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/aCcOuNtAsSoCiAtIoNnAmE", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CommitmentPlanName: "cOmMiTmEnTpLaNnAmE", - AccountAssociationName: "cOmMiTmEnTpLaNaSsOcIaTiOnNaMe", + AccountAssociationName: "aCcOuNtAsSoCiAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/cOmMiTmEnTpLaNaSsOcIaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/aCcOuNtAsSoCiAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/README.md b/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/README.md index ef81de26013..431858cbb21 100644 --- a/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/README.md +++ b/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commitmenttiers.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := commitmenttiers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/id_location.go b/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/id_location.go index 00a0650a0cb..0b5e5b77479 100644 --- a/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/id_location.go +++ b/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/id_location_test.go b/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/id_location_test.go index d2c1bc5c45b..c1578035e98 100644 --- a/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/id_location_test.go +++ b/resource-manager/cognitive/2023-10-01-preview/commitmenttiers/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-10-01-preview/models/README.md b/resource-manager/cognitive/2023-10-01-preview/models/README.md index fa8903f92ff..f2309485924 100644 --- a/resource-manager/cognitive/2023-10-01-preview/models/README.md +++ b/resource-manager/cognitive/2023-10-01-preview/models/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := models.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := models.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/cognitive/2023-10-01-preview/models/id_location.go b/resource-manager/cognitive/2023-10-01-preview/models/id_location.go index 152bcf9a770..bfe100c794a 100644 --- a/resource-manager/cognitive/2023-10-01-preview/models/id_location.go +++ b/resource-manager/cognitive/2023-10-01-preview/models/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-10-01-preview/models/id_location_test.go b/resource-manager/cognitive/2023-10-01-preview/models/id_location_test.go index 3190d9278db..a5bef3983a9 100644 --- a/resource-manager/cognitive/2023-10-01-preview/models/id_location_test.go +++ b/resource-manager/cognitive/2023-10-01-preview/models/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/README.md b/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/README.md index c7d0acee6df..b0f14dce27f 100644 --- a/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/README.md +++ b/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := raicontentfilters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := raicontentfilters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/id_location.go b/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/id_location.go index 7aa762722ee..3dfb920179a 100644 --- a/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/id_location.go +++ b/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/id_location_test.go b/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/id_location_test.go index 1bbee4613db..7383a74a2c1 100644 --- a/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/id_location_test.go +++ b/resource-manager/cognitive/2023-10-01-preview/raicontentfilters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2023-10-01-preview/usages/README.md b/resource-manager/cognitive/2023-10-01-preview/usages/README.md index 4852eb1b82d..1a1e2302247 100644 --- a/resource-manager/cognitive/2023-10-01-preview/usages/README.md +++ b/resource-manager/cognitive/2023-10-01-preview/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id, usages.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, usages.DefaultListOperationOptions()) diff --git a/resource-manager/cognitive/2023-10-01-preview/usages/id_location.go b/resource-manager/cognitive/2023-10-01-preview/usages/id_location.go index 83f39a75beb..6ed669b9c07 100644 --- a/resource-manager/cognitive/2023-10-01-preview/usages/id_location.go +++ b/resource-manager/cognitive/2023-10-01-preview/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2023-10-01-preview/usages/id_location_test.go b/resource-manager/cognitive/2023-10-01-preview/usages/id_location_test.go index 59878e904b5..dd806e02b46 100644 --- a/resource-manager/cognitive/2023-10-01-preview/usages/id_location_test.go +++ b/resource-manager/cognitive/2023-10-01-preview/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/README.md b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/README.md index a50b74c319a..d25bcd4ab01 100644 --- a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/README.md +++ b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/README.md @@ -250,7 +250,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cognitiveservicesaccounts.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := cognitiveservicesaccounts.CheckSkuAvailabilityParameter{ // ... @@ -271,7 +271,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") +id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") read, err := client.DeletedAccountsGet(ctx, id) if err != nil { @@ -304,7 +304,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") +id := cognitiveservicesaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") if err := client.DeletedAccountsPurgeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_deletedaccount.go b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_deletedaccount.go index 06b62b98f51..119662e5040 100644 --- a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_deletedaccount.go +++ b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_deletedaccount.go @@ -119,11 +119,11 @@ func (id DeletedAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), resourceids.StaticSegment("staticDeletedAccounts", "deletedAccounts", "deletedAccounts"), - resourceids.UserSpecifiedSegment("deletedAccountName", "accountName"), + resourceids.UserSpecifiedSegment("deletedAccountName", "deletedAccountName"), } } diff --git a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_deletedaccount_test.go b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_deletedaccount_test.go index dd73eb1f587..014ef217729 100644 --- a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_deletedaccount_test.go +++ b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_deletedaccount_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &DeletedAccountId{} func TestNewDeletedAccountID(t *testing.T) { - id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName") + id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.ResourceGroupName != "example-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DeletedAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedAccountName'", id.DeletedAccountName, "accountName") + if id.DeletedAccountName != "deletedAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedAccountName'", id.DeletedAccountName, "deletedAccountName") } } func TestFormatDeletedAccountID(t *testing.T) { - actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName" + actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "example-resource-group", "deletedAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseDeletedAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", ResourceGroupName: "example-resource-group", - DeletedAccountName: "accountName", + DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseDeletedAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", ResourceGroupName: "example-resource-group", - DeletedAccountName: "accountName", + DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/resourceGroups/example-resource-group/deletedAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/resourceGroups/example-resource-group/deletedAccounts/deletedAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DeletedAccountName: "aCcOuNtNaMe", + DeletedAccountName: "dElEtEdAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_location.go b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_location.go index 367e04d1dfd..07df845235d 100644 --- a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_location.go +++ b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_location_test.go b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_location_test.go index 66b967c58c0..308e0866154 100644 --- a/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_location_test.go +++ b/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/commitmentplans/README.md b/resource-manager/cognitive/2024-10-01/commitmentplans/README.md index de808253c43..22bb1544858 100644 --- a/resource-manager/cognitive/2024-10-01/commitmentplans/README.md +++ b/resource-manager/cognitive/2024-10-01/commitmentplans/README.md @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") payload := commitmentplans.CommitmentPlanAccountAssociation{ // ... @@ -74,7 +74,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") if err := client.DeleteAssociationThenPoll(ctx, id); err != nil { // handle the error @@ -102,7 +102,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") +id := commitmentplans.NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") read, err := client.GetAssociation(ctx, id) if err != nil { diff --git a/resource-manager/cognitive/2024-10-01/commitmentplans/id_accountassociation.go b/resource-manager/cognitive/2024-10-01/commitmentplans/id_accountassociation.go index 209ee3fb56a..18f20d9c5e6 100644 --- a/resource-manager/cognitive/2024-10-01/commitmentplans/id_accountassociation.go +++ b/resource-manager/cognitive/2024-10-01/commitmentplans/id_accountassociation.go @@ -123,7 +123,7 @@ func (id AccountAssociationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticCommitmentPlans", "commitmentPlans", "commitmentPlans"), resourceids.UserSpecifiedSegment("commitmentPlanName", "commitmentPlanName"), resourceids.StaticSegment("staticAccountAssociations", "accountAssociations", "accountAssociations"), - resourceids.UserSpecifiedSegment("accountAssociationName", "commitmentPlanAssociationName"), + resourceids.UserSpecifiedSegment("accountAssociationName", "accountAssociationName"), } } diff --git a/resource-manager/cognitive/2024-10-01/commitmentplans/id_accountassociation_test.go b/resource-manager/cognitive/2024-10-01/commitmentplans/id_accountassociation_test.go index 71c3013ef8f..138be5831dc 100644 --- a/resource-manager/cognitive/2024-10-01/commitmentplans/id_accountassociation_test.go +++ b/resource-manager/cognitive/2024-10-01/commitmentplans/id_accountassociation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountAssociationId{} func TestNewAccountAssociationID(t *testing.T) { - id := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName") + id := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAccountAssociationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'CommitmentPlanName'", id.CommitmentPlanName, "commitmentPlanName") } - if id.AccountAssociationName != "commitmentPlanAssociationName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountAssociationName'", id.AccountAssociationName, "commitmentPlanAssociationName") + if id.AccountAssociationName != "accountAssociationName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountAssociationName'", id.AccountAssociationName, "accountAssociationName") } } func TestFormatAccountAssociationID(t *testing.T) { - actual := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "commitmentPlanAssociationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName" + actual := NewAccountAssociationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "commitmentPlanName", "accountAssociationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAccountAssociationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CommitmentPlanName: "commitmentPlanName", - AccountAssociationName: "commitmentPlanAssociationName", + AccountAssociationName: "accountAssociationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAccountAssociationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CommitmentPlanName: "commitmentPlanName", - AccountAssociationName: "commitmentPlanAssociationName", + AccountAssociationName: "accountAssociationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/commitmentPlanAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/commitmentPlans/commitmentPlanName/accountAssociations/accountAssociationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/cOmMiTmEnTpLaNaSsOcIaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/aCcOuNtAsSoCiAtIoNnAmE", Expected: &AccountAssociationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CommitmentPlanName: "cOmMiTmEnTpLaNnAmE", - AccountAssociationName: "cOmMiTmEnTpLaNaSsOcIaTiOnNaMe", + AccountAssociationName: "aCcOuNtAsSoCiAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/cOmMiTmEnTpLaNaSsOcIaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/cOmMiTmEnTpLaNs/cOmMiTmEnTpLaNnAmE/aCcOuNtAsSoCiAtIoNs/aCcOuNtAsSoCiAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/commitmenttiers/README.md b/resource-manager/cognitive/2024-10-01/commitmenttiers/README.md index 0b6ec7aae7d..6da85ffddf9 100644 --- a/resource-manager/cognitive/2024-10-01/commitmenttiers/README.md +++ b/resource-manager/cognitive/2024-10-01/commitmenttiers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commitmenttiers.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := commitmenttiers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/cognitive/2024-10-01/commitmenttiers/id_location.go b/resource-manager/cognitive/2024-10-01/commitmenttiers/id_location.go index 00a0650a0cb..0b5e5b77479 100644 --- a/resource-manager/cognitive/2024-10-01/commitmenttiers/id_location.go +++ b/resource-manager/cognitive/2024-10-01/commitmenttiers/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2024-10-01/commitmenttiers/id_location_test.go b/resource-manager/cognitive/2024-10-01/commitmenttiers/id_location_test.go index d2c1bc5c45b..c1578035e98 100644 --- a/resource-manager/cognitive/2024-10-01/commitmenttiers/id_location_test.go +++ b/resource-manager/cognitive/2024-10-01/commitmenttiers/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/modelcapacities/README.md b/resource-manager/cognitive/2024-10-01/modelcapacities/README.md index 5d268fb4662..0e42998cb6d 100644 --- a/resource-manager/cognitive/2024-10-01/modelcapacities/README.md +++ b/resource-manager/cognitive/2024-10-01/modelcapacities/README.md @@ -42,7 +42,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := modelcapacities.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := modelcapacities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.LocationBasedModelCapacitiesList(ctx, id, modelcapacities.DefaultLocationBasedModelCapacitiesListOperationOptions())` can be used to do batched pagination items, err := client.LocationBasedModelCapacitiesListComplete(ctx, id, modelcapacities.DefaultLocationBasedModelCapacitiesListOperationOptions()) diff --git a/resource-manager/cognitive/2024-10-01/modelcapacities/id_location.go b/resource-manager/cognitive/2024-10-01/modelcapacities/id_location.go index a1c7414bf08..bbcad3c80b4 100644 --- a/resource-manager/cognitive/2024-10-01/modelcapacities/id_location.go +++ b/resource-manager/cognitive/2024-10-01/modelcapacities/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2024-10-01/modelcapacities/id_location_test.go b/resource-manager/cognitive/2024-10-01/modelcapacities/id_location_test.go index 3dd204c3ff8..5eb36a4f215 100644 --- a/resource-manager/cognitive/2024-10-01/modelcapacities/id_location_test.go +++ b/resource-manager/cognitive/2024-10-01/modelcapacities/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/models/README.md b/resource-manager/cognitive/2024-10-01/models/README.md index e0de4f403d9..4b10f8ccec8 100644 --- a/resource-manager/cognitive/2024-10-01/models/README.md +++ b/resource-manager/cognitive/2024-10-01/models/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := models.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := models.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/cognitive/2024-10-01/models/id_location.go b/resource-manager/cognitive/2024-10-01/models/id_location.go index 152bcf9a770..bfe100c794a 100644 --- a/resource-manager/cognitive/2024-10-01/models/id_location.go +++ b/resource-manager/cognitive/2024-10-01/models/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2024-10-01/models/id_location_test.go b/resource-manager/cognitive/2024-10-01/models/id_location_test.go index 3190d9278db..a5bef3983a9 100644 --- a/resource-manager/cognitive/2024-10-01/models/id_location_test.go +++ b/resource-manager/cognitive/2024-10-01/models/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/README.md b/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/README.md index eaf8fb8806d..0146a0f52e7 100644 --- a/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/README.md +++ b/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := networksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "nspConfigurationName") +id := networksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "nspConfigurationName") +id := networksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") if err := client.ReconcileThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go b/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go index f7cee217bbe..f54809bc4a7 100644 --- a/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go +++ b/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go @@ -123,7 +123,7 @@ func (id NetworkSecurityPerimeterConfigurationId) Segments() []resourceids.Segme resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), resourceids.UserSpecifiedSegment("accountName", "accountName"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), - resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "nspConfigurationName"), + resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } } diff --git a/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go b/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go index c87edc418be..b9a6eb4689a 100644 --- a/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go +++ b/resource-manager/cognitive/2024-10-01/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkSecurityPerimeterConfigurationId{} func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "nspConfigurationName") + id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountName") } - if id.NetworkSecurityPerimeterConfigurationName != "nspConfigurationName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "nspConfigurationName") + if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "networkSecurityPerimeterConfigurationName") } } func TestFormatNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "nspConfigurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/nspConfigurationName" + actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/nspConfigurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AccountName: "accountName", - NetworkSecurityPerimeterConfigurationName: "nspConfigurationName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/nspConfigurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNetworkSecurityPerimeterConfigurationIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/nspConfigurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", AccountName: "accountName", - NetworkSecurityPerimeterConfigurationName: "nspConfigurationName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/nspConfigurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CognitiveServices/accounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/aCcOuNtS/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nSpCoNfIgUrAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/aCcOuNtS/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AccountName: "aCcOuNtNaMe", - NetworkSecurityPerimeterConfigurationName: "nSpCoNfIgUrAtIoNnAmE", + NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/aCcOuNtS/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nSpCoNfIgUrAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/aCcOuNtS/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/raicontentfilters/README.md b/resource-manager/cognitive/2024-10-01/raicontentfilters/README.md index 4eda32037f4..7e211cb271c 100644 --- a/resource-manager/cognitive/2024-10-01/raicontentfilters/README.md +++ b/resource-manager/cognitive/2024-10-01/raicontentfilters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := raicontentfilters.NewRaiContentFilterID("12345678-1234-9876-4563-123456789012", "location", "filterName") +id := raicontentfilters.NewRaiContentFilterID("12345678-1234-9876-4563-123456789012", "locationName", "raiContentFilterName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := raicontentfilters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := raicontentfilters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/cognitive/2024-10-01/raicontentfilters/id_location.go b/resource-manager/cognitive/2024-10-01/raicontentfilters/id_location.go index 7aa762722ee..3dfb920179a 100644 --- a/resource-manager/cognitive/2024-10-01/raicontentfilters/id_location.go +++ b/resource-manager/cognitive/2024-10-01/raicontentfilters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2024-10-01/raicontentfilters/id_location_test.go b/resource-manager/cognitive/2024-10-01/raicontentfilters/id_location_test.go index 1bbee4613db..7383a74a2c1 100644 --- a/resource-manager/cognitive/2024-10-01/raicontentfilters/id_location_test.go +++ b/resource-manager/cognitive/2024-10-01/raicontentfilters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/raicontentfilters/id_raicontentfilter.go b/resource-manager/cognitive/2024-10-01/raicontentfilters/id_raicontentfilter.go index f947f56e6af..0494a52b88e 100644 --- a/resource-manager/cognitive/2024-10-01/raicontentfilters/id_raicontentfilter.go +++ b/resource-manager/cognitive/2024-10-01/raicontentfilters/id_raicontentfilter.go @@ -113,9 +113,9 @@ func (id RaiContentFilterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRaiContentFilters", "raiContentFilters", "raiContentFilters"), - resourceids.UserSpecifiedSegment("raiContentFilterName", "filterName"), + resourceids.UserSpecifiedSegment("raiContentFilterName", "raiContentFilterName"), } } diff --git a/resource-manager/cognitive/2024-10-01/raicontentfilters/id_raicontentfilter_test.go b/resource-manager/cognitive/2024-10-01/raicontentfilters/id_raicontentfilter_test.go index c69e6cd5d2b..d5f4390d445 100644 --- a/resource-manager/cognitive/2024-10-01/raicontentfilters/id_raicontentfilter_test.go +++ b/resource-manager/cognitive/2024-10-01/raicontentfilters/id_raicontentfilter_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &RaiContentFilterId{} func TestNewRaiContentFilterID(t *testing.T) { - id := NewRaiContentFilterID("12345678-1234-9876-4563-123456789012", "location", "filterName") + id := NewRaiContentFilterID("12345678-1234-9876-4563-123456789012", "locationName", "raiContentFilterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.RaiContentFilterName != "filterName" { - t.Fatalf("Expected %q but got %q for Segment 'RaiContentFilterName'", id.RaiContentFilterName, "filterName") + if id.RaiContentFilterName != "raiContentFilterName" { + t.Fatalf("Expected %q but got %q for Segment 'RaiContentFilterName'", id.RaiContentFilterName, "raiContentFilterName") } } func TestFormatRaiContentFilterID(t *testing.T) { - actual := NewRaiContentFilterID("12345678-1234-9876-4563-123456789012", "location", "filterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/raiContentFilters/filterName" + actual := NewRaiContentFilterID("12345678-1234-9876-4563-123456789012", "locationName", "raiContentFilterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/raiContentFilters/raiContentFilterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRaiContentFilterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/raiContentFilters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/raiContentFilters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/raiContentFilters/filterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/raiContentFilters/raiContentFilterName", Expected: &RaiContentFilterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - RaiContentFilterName: "filterName", + LocationName: "locationName", + RaiContentFilterName: "raiContentFilterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/raiContentFilters/filterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/raiContentFilters/raiContentFilterName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRaiContentFilterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/raiContentFilters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/raiContentFilters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rAiCoNtEnTfIlTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rAiCoNtEnTfIlTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/raiContentFilters/filterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/raiContentFilters/raiContentFilterName", Expected: &RaiContentFilterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - RaiContentFilterName: "filterName", + LocationName: "locationName", + RaiContentFilterName: "raiContentFilterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/raiContentFilters/filterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/raiContentFilters/raiContentFilterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rAiCoNtEnTfIlTeRs/fIlTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rAiCoNtEnTfIlTeRs/rAiCoNtEnTfIlTeRnAmE", Expected: &RaiContentFilterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - RaiContentFilterName: "fIlTeRnAmE", + LocationName: "lOcAtIoNnAmE", + RaiContentFilterName: "rAiCoNtEnTfIlTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/rAiCoNtEnTfIlTeRs/fIlTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/rAiCoNtEnTfIlTeRs/rAiCoNtEnTfIlTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cognitive/2024-10-01/usages/README.md b/resource-manager/cognitive/2024-10-01/usages/README.md index e1458424a55..d71fc5cc710 100644 --- a/resource-manager/cognitive/2024-10-01/usages/README.md +++ b/resource-manager/cognitive/2024-10-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id, usages.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, usages.DefaultListOperationOptions()) diff --git a/resource-manager/cognitive/2024-10-01/usages/id_location.go b/resource-manager/cognitive/2024-10-01/usages/id_location.go index 83f39a75beb..6ed669b9c07 100644 --- a/resource-manager/cognitive/2024-10-01/usages/id_location.go +++ b/resource-manager/cognitive/2024-10-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCognitiveServices", "Microsoft.CognitiveServices", "Microsoft.CognitiveServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cognitive/2024-10-01/usages/id_location_test.go b/resource-manager/cognitive/2024-10-01/usages/id_location_test.go index 59878e904b5..dd806e02b46 100644 --- a/resource-manager/cognitive/2024-10-01/usages/id_location_test.go +++ b/resource-manager/cognitive/2024-10-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.CognitiveServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOgNiTiVeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/communication/2023-03-31/senderusernames/README.md b/resource-manager/communication/2023-03-31/senderusernames/README.md index a838374d82f..6299cb515fd 100644 --- a/resource-manager/communication/2023-03-31/senderusernames/README.md +++ b/resource-manager/communication/2023-03-31/senderusernames/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername") +id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName") payload := senderusernames.SenderUsernameResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername") +id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername") +id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/communication/2023-03-31/senderusernames/id_senderusername.go b/resource-manager/communication/2023-03-31/senderusernames/id_senderusername.go index 54fcfb7645a..bd37547f4dd 100644 --- a/resource-manager/communication/2023-03-31/senderusernames/id_senderusername.go +++ b/resource-manager/communication/2023-03-31/senderusernames/id_senderusername.go @@ -131,7 +131,7 @@ func (id SenderUsernameId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticSenderUsernames", "senderUsernames", "senderUsernames"), - resourceids.UserSpecifiedSegment("senderUsernameName", "senderUsername"), + resourceids.UserSpecifiedSegment("senderUsernameName", "senderUsernameName"), } } diff --git a/resource-manager/communication/2023-03-31/senderusernames/id_senderusername_test.go b/resource-manager/communication/2023-03-31/senderusernames/id_senderusername_test.go index bab4b586c7e..c6cfe38fd41 100644 --- a/resource-manager/communication/2023-03-31/senderusernames/id_senderusername_test.go +++ b/resource-manager/communication/2023-03-31/senderusernames/id_senderusername_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SenderUsernameId{} func TestNewSenderUsernameID(t *testing.T) { - id := NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername") + id := NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewSenderUsernameID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.SenderUsernameName != "senderUsername" { - t.Fatalf("Expected %q but got %q for Segment 'SenderUsernameName'", id.SenderUsernameName, "senderUsername") + if id.SenderUsernameName != "senderUsernameName" { + t.Fatalf("Expected %q but got %q for Segment 'SenderUsernameName'", id.SenderUsernameName, "senderUsernameName") } } func TestFormatSenderUsernameID(t *testing.T) { - actual := NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername" + actual := NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseSenderUsernameID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName", Expected: &SenderUsernameId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", EmailServiceName: "emailServiceName", DomainName: "domainName", - SenderUsernameName: "senderUsername", + SenderUsernameName: "senderUsernameName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseSenderUsernameIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName", Expected: &SenderUsernameId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", EmailServiceName: "emailServiceName", DomainName: "domainName", - SenderUsernameName: "senderUsername", + SenderUsernameName: "senderUsernameName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmMuNiCaTiOn/eMaIlSeRvIcEs/eMaIlSeRvIcEnAmE/dOmAiNs/dOmAiNnAmE/sEnDeRuSeRnAmEs/sEnDeRuSeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmMuNiCaTiOn/eMaIlSeRvIcEs/eMaIlSeRvIcEnAmE/dOmAiNs/dOmAiNnAmE/sEnDeRuSeRnAmEs/sEnDeRuSeRnAmEnAmE", Expected: &SenderUsernameId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", EmailServiceName: "eMaIlSeRvIcEnAmE", DomainName: "dOmAiNnAmE", - SenderUsernameName: "sEnDeRuSeRnAmE", + SenderUsernameName: "sEnDeRuSeRnAmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmMuNiCaTiOn/eMaIlSeRvIcEs/eMaIlSeRvIcEnAmE/dOmAiNs/dOmAiNnAmE/sEnDeRuSeRnAmEs/sEnDeRuSeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmMuNiCaTiOn/eMaIlSeRvIcEs/eMaIlSeRvIcEnAmE/dOmAiNs/dOmAiNnAmE/sEnDeRuSeRnAmEs/sEnDeRuSeRnAmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/communication/2023-04-01/senderusernames/README.md b/resource-manager/communication/2023-04-01/senderusernames/README.md index 4f159033277..5b891c7391e 100644 --- a/resource-manager/communication/2023-04-01/senderusernames/README.md +++ b/resource-manager/communication/2023-04-01/senderusernames/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername") +id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName") payload := senderusernames.SenderUsernameResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername") +id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername") +id := senderusernames.NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/communication/2023-04-01/senderusernames/id_senderusername.go b/resource-manager/communication/2023-04-01/senderusernames/id_senderusername.go index 54fcfb7645a..bd37547f4dd 100644 --- a/resource-manager/communication/2023-04-01/senderusernames/id_senderusername.go +++ b/resource-manager/communication/2023-04-01/senderusernames/id_senderusername.go @@ -131,7 +131,7 @@ func (id SenderUsernameId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticSenderUsernames", "senderUsernames", "senderUsernames"), - resourceids.UserSpecifiedSegment("senderUsernameName", "senderUsername"), + resourceids.UserSpecifiedSegment("senderUsernameName", "senderUsernameName"), } } diff --git a/resource-manager/communication/2023-04-01/senderusernames/id_senderusername_test.go b/resource-manager/communication/2023-04-01/senderusernames/id_senderusername_test.go index bab4b586c7e..c6cfe38fd41 100644 --- a/resource-manager/communication/2023-04-01/senderusernames/id_senderusername_test.go +++ b/resource-manager/communication/2023-04-01/senderusernames/id_senderusername_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SenderUsernameId{} func TestNewSenderUsernameID(t *testing.T) { - id := NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername") + id := NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewSenderUsernameID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.SenderUsernameName != "senderUsername" { - t.Fatalf("Expected %q but got %q for Segment 'SenderUsernameName'", id.SenderUsernameName, "senderUsername") + if id.SenderUsernameName != "senderUsernameName" { + t.Fatalf("Expected %q but got %q for Segment 'SenderUsernameName'", id.SenderUsernameName, "senderUsernameName") } } func TestFormatSenderUsernameID(t *testing.T) { - actual := NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsername").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername" + actual := NewSenderUsernameID("12345678-1234-9876-4563-123456789012", "example-resource-group", "emailServiceName", "domainName", "senderUsernameName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseSenderUsernameID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName", Expected: &SenderUsernameId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", EmailServiceName: "emailServiceName", DomainName: "domainName", - SenderUsernameName: "senderUsername", + SenderUsernameName: "senderUsernameName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseSenderUsernameIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName", Expected: &SenderUsernameId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", EmailServiceName: "emailServiceName", DomainName: "domainName", - SenderUsernameName: "senderUsername", + SenderUsernameName: "senderUsernameName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Communication/emailServices/emailServiceName/domains/domainName/senderUsernames/senderUsernameName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmMuNiCaTiOn/eMaIlSeRvIcEs/eMaIlSeRvIcEnAmE/dOmAiNs/dOmAiNnAmE/sEnDeRuSeRnAmEs/sEnDeRuSeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmMuNiCaTiOn/eMaIlSeRvIcEs/eMaIlSeRvIcEnAmE/dOmAiNs/dOmAiNnAmE/sEnDeRuSeRnAmEs/sEnDeRuSeRnAmEnAmE", Expected: &SenderUsernameId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", EmailServiceName: "eMaIlSeRvIcEnAmE", DomainName: "dOmAiNnAmE", - SenderUsernameName: "sEnDeRuSeRnAmE", + SenderUsernameName: "sEnDeRuSeRnAmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmMuNiCaTiOn/eMaIlSeRvIcEs/eMaIlSeRvIcEnAmE/dOmAiNs/dOmAiNnAmE/sEnDeRuSeRnAmEs/sEnDeRuSeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmMuNiCaTiOn/eMaIlSeRvIcEs/eMaIlSeRvIcEnAmE/dOmAiNs/dOmAiNnAmE/sEnDeRuSeRnAmEs/sEnDeRuSeRnAmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/availabilitysets/README.md b/resource-manager/compute/2021-07-01/availabilitysets/README.md index bb6b68eed20..9bd57661b8a 100644 --- a/resource-manager/compute/2021-07-01/availabilitysets/README.md +++ b/resource-manager/compute/2021-07-01/availabilitysets/README.md @@ -21,6 +21,109 @@ client.Client.Authorizer = authorizer ``` +### Example Usage: `AvailabilitySetsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") + +payload := availabilitysets.AvailabilitySet{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AvailabilitySetsClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AvailabilitySetsClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AvailabilitySetsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AvailabilitySetsClient.ListAvailableSizes` + +```go +ctx := context.TODO() +id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") + +read, err := client.ListAvailableSizes(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AvailabilitySetsClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id, availabilitysets.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id, availabilitysets.DefaultListBySubscriptionOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + ### Example Usage: `AvailabilitySetsClient.ResourceSkusList` ```go @@ -36,3 +139,24 @@ for _, item := range items { // do something } ``` + + +### Example Usage: `AvailabilitySetsClient.Update` + +```go +ctx := context.TODO() +id := commonids.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") + +payload := availabilitysets.AvailabilitySetUpdate{ + // ... +} + + +read, err := client.Update(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/resource-manager/compute/2021-07-01/availabilitysets/constants.go b/resource-manager/compute/2021-07-01/availabilitysets/constants.go index fc34e747301..7738a79af2c 100644 --- a/resource-manager/compute/2021-07-01/availabilitysets/constants.go +++ b/resource-manager/compute/2021-07-01/availabilitysets/constants.go @@ -172,3 +172,47 @@ func parseResourceSkuRestrictionsType(input string) (*ResourceSkuRestrictionsTyp out := ResourceSkuRestrictionsType(input) return &out, nil } + +type StatusLevelTypes string + +const ( + StatusLevelTypesError StatusLevelTypes = "Error" + StatusLevelTypesInfo StatusLevelTypes = "Info" + StatusLevelTypesWarning StatusLevelTypes = "Warning" +) + +func PossibleValuesForStatusLevelTypes() []string { + return []string{ + string(StatusLevelTypesError), + string(StatusLevelTypesInfo), + string(StatusLevelTypesWarning), + } +} + +func (s *StatusLevelTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStatusLevelTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { + vals := map[string]StatusLevelTypes{ + "error": StatusLevelTypesError, + "info": StatusLevelTypesInfo, + "warning": StatusLevelTypesWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StatusLevelTypes(input) + return &out, nil +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/method_createorupdate.go b/resource-manager/compute/2021-07-01/availabilitysets/method_createorupdate.go new file mode 100644 index 00000000000..0fd3b44fe2c --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/method_createorupdate.go @@ -0,0 +1,58 @@ +package availabilitysets + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AvailabilitySet +} + +// CreateOrUpdate ... +func (c AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, id commonids.AvailabilitySetId, input AvailabilitySet) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model AvailabilitySet + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/method_delete.go b/resource-manager/compute/2021-07-01/availabilitysets/method_delete.go new file mode 100644 index 00000000000..e89779e3039 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/method_delete.go @@ -0,0 +1,48 @@ +package availabilitysets + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c AvailabilitySetsClient) Delete(ctx context.Context, id commonids.AvailabilitySetId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/method_get.go b/resource-manager/compute/2021-07-01/availabilitysets/method_get.go new file mode 100644 index 00000000000..5331c2457d7 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/method_get.go @@ -0,0 +1,54 @@ +package availabilitysets + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AvailabilitySet +} + +// Get ... +func (c AvailabilitySetsClient) Get(ctx context.Context, id commonids.AvailabilitySetId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model AvailabilitySet + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/method_list.go b/resource-manager/compute/2021-07-01/availabilitysets/method_list.go new file mode 100644 index 00000000000..f5a12a32b9e --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/method_list.go @@ -0,0 +1,106 @@ +package availabilitysets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AvailabilitySet +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []AvailabilitySet +} + +type ListCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// List ... +func (c AvailabilitySetsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.Compute/availabilitySets", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]AvailabilitySet `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c AvailabilitySetsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, AvailabilitySetOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AvailabilitySetsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AvailabilitySetOperationPredicate) (result ListCompleteResult, err error) { + items := make([]AvailabilitySet, 0) + + resp, err := c.List(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/method_listavailablesizes.go b/resource-manager/compute/2021-07-01/availabilitysets/method_listavailablesizes.go new file mode 100644 index 00000000000..d47e9dec5a7 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/method_listavailablesizes.go @@ -0,0 +1,55 @@ +package availabilitysets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListAvailableSizesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VirtualMachineSizeListResult +} + +// ListAvailableSizes ... +func (c AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, id commonids.AvailabilitySetId) (result ListAvailableSizesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/vmSizes", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model VirtualMachineSizeListResult + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/method_listbysubscription.go b/resource-manager/compute/2021-07-01/availabilitysets/method_listbysubscription.go new file mode 100644 index 00000000000..44f1ba6844b --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/method_listbysubscription.go @@ -0,0 +1,135 @@ +package availabilitysets + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AvailabilitySet +} + +type ListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []AvailabilitySet +} + +type ListBySubscriptionOperationOptions struct { + Expand *string +} + +func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions { + return ListBySubscriptionOperationOptions{} +} + +func (o ListBySubscriptionOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListBySubscriptionOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + + return &out +} + +func (o ListBySubscriptionOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Expand != nil { + out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) + } + return &out +} + +type ListBySubscriptionCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListBySubscription ... +func (c AvailabilitySetsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + OptionsObject: options, + Pager: &ListBySubscriptionCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.Compute/availabilitySets", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]AvailabilitySet `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, options, AvailabilitySetOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AvailabilitySetsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate AvailabilitySetOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]AvailabilitySet, 0) + + resp, err := c.ListBySubscription(ctx, id, options) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListBySubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/method_update.go b/resource-manager/compute/2021-07-01/availabilitysets/method_update.go new file mode 100644 index 00000000000..8eb2093ecd2 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/method_update.go @@ -0,0 +1,58 @@ +package availabilitysets + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AvailabilitySet +} + +// Update ... +func (c AvailabilitySetsClient) Update(ctx context.Context, id commonids.AvailabilitySetId, input AvailabilitySetUpdate) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model AvailabilitySet + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/model_availabilityset.go b/resource-manager/compute/2021-07-01/availabilitysets/model_availabilityset.go new file mode 100644 index 00000000000..49248ed2f4a --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/model_availabilityset.go @@ -0,0 +1,14 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvailabilitySet struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *AvailabilitySetProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/model_availabilitysetproperties.go b/resource-manager/compute/2021-07-01/availabilitysets/model_availabilitysetproperties.go new file mode 100644 index 00000000000..3e1e7585608 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/model_availabilitysetproperties.go @@ -0,0 +1,12 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvailabilitySetProperties struct { + PlatformFaultDomainCount *int64 `json:"platformFaultDomainCount,omitempty"` + PlatformUpdateDomainCount *int64 `json:"platformUpdateDomainCount,omitempty"` + ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/model_availabilitysetupdate.go b/resource-manager/compute/2021-07-01/availabilitysets/model_availabilitysetupdate.go new file mode 100644 index 00000000000..04ce035cd46 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/model_availabilitysetupdate.go @@ -0,0 +1,10 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvailabilitySetUpdate struct { + Properties *AvailabilitySetProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/model_instanceviewstatus.go b/resource-manager/compute/2021-07-01/availabilitysets/model_instanceviewstatus.go new file mode 100644 index 00000000000..038a3c1dd32 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/model_instanceviewstatus.go @@ -0,0 +1,30 @@ +package availabilitysets + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceViewStatus struct { + Code *string `json:"code,omitempty"` + DisplayStatus *string `json:"displayStatus,omitempty"` + Level *StatusLevelTypes `json:"level,omitempty"` + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *InstanceViewStatus) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/model_sku.go b/resource-manager/compute/2021-07-01/availabilitysets/model_sku.go new file mode 100644 index 00000000000..9e275b34b2a --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/model_sku.go @@ -0,0 +1,10 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Sku struct { + Capacity *int64 `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + Tier *string `json:"tier,omitempty"` +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/model_subresource.go b/resource-manager/compute/2021-07-01/availabilitysets/model_subresource.go new file mode 100644 index 00000000000..9890abb18c9 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/model_subresource.go @@ -0,0 +1,8 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubResource struct { + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/model_virtualmachinesize.go b/resource-manager/compute/2021-07-01/availabilitysets/model_virtualmachinesize.go new file mode 100644 index 00000000000..d9b2adc3758 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/model_virtualmachinesize.go @@ -0,0 +1,13 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineSize struct { + MaxDataDiskCount *int64 `json:"maxDataDiskCount,omitempty"` + MemoryInMB *int64 `json:"memoryInMB,omitempty"` + Name *string `json:"name,omitempty"` + NumberOfCores *int64 `json:"numberOfCores,omitempty"` + OsDiskSizeInMB *int64 `json:"osDiskSizeInMB,omitempty"` + ResourceDiskSizeInMB *int64 `json:"resourceDiskSizeInMB,omitempty"` +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/model_virtualmachinesizelistresult.go b/resource-manager/compute/2021-07-01/availabilitysets/model_virtualmachinesizelistresult.go new file mode 100644 index 00000000000..190cfb1b670 --- /dev/null +++ b/resource-manager/compute/2021-07-01/availabilitysets/model_virtualmachinesizelistresult.go @@ -0,0 +1,8 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineSizeListResult struct { + Value *[]VirtualMachineSize `json:"value,omitempty"` +} diff --git a/resource-manager/compute/2021-07-01/availabilitysets/predicates.go b/resource-manager/compute/2021-07-01/availabilitysets/predicates.go index 29fe762df0a..3b8072b69f1 100644 --- a/resource-manager/compute/2021-07-01/availabilitysets/predicates.go +++ b/resource-manager/compute/2021-07-01/availabilitysets/predicates.go @@ -3,6 +3,34 @@ package availabilitysets // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AvailabilitySetOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p AvailabilitySetOperationPredicate) Matches(input AvailabilitySet) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + type ResourceSkuOperationPredicate struct { Family *string Kind *string diff --git a/resource-manager/compute/2021-07-01/communitygalleries/README.md b/resource-manager/compute/2021-07-01/communitygalleries/README.md index 8eec4a11600..a40f025c8fc 100644 --- a/resource-manager/compute/2021-07-01/communitygalleries/README.md +++ b/resource-manager/compute/2021-07-01/communitygalleries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleries.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") +id := communitygalleries.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/compute/2021-07-01/communitygalleries/id_communitygallery.go b/resource-manager/compute/2021-07-01/communitygalleries/id_communitygallery.go index 3d8672e9b69..d77b8b52d53 100644 --- a/resource-manager/compute/2021-07-01/communitygalleries/id_communitygallery.go +++ b/resource-manager/compute/2021-07-01/communitygalleries/id_communitygallery.go @@ -113,9 +113,9 @@ func (id CommunityGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), } } diff --git a/resource-manager/compute/2021-07-01/communitygalleries/id_communitygallery_test.go b/resource-manager/compute/2021-07-01/communitygalleries/id_communitygallery_test.go index d1b0b1c05db..325bcd4400d 100644 --- a/resource-manager/compute/2021-07-01/communitygalleries/id_communitygallery_test.go +++ b/resource-manager/compute/2021-07-01/communitygalleries/id_communitygallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryId{} func TestNewCommunityGalleryID(t *testing.T) { - id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") + id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } } func TestFormatCommunityGalleryID(t *testing.T) { - actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName" + actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseCommunityGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseCommunityGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/communitygalleryimages/README.md b/resource-manager/compute/2021-07-01/communitygalleryimages/README.md index 35b6dc8d854..0aa50f0181c 100644 --- a/resource-manager/compute/2021-07-01/communitygalleryimages/README.md +++ b/resource-manager/compute/2021-07-01/communitygalleryimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleryimages.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") +id := communitygalleryimages.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/compute/2021-07-01/communitygalleryimages/id_communitygalleryimage.go b/resource-manager/compute/2021-07-01/communitygalleryimages/id_communitygalleryimage.go index af36bc3b0ab..e94cfc15022 100644 --- a/resource-manager/compute/2021-07-01/communitygalleryimages/id_communitygalleryimage.go +++ b/resource-manager/compute/2021-07-01/communitygalleryimages/id_communitygalleryimage.go @@ -119,11 +119,11 @@ func (id CommunityGalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2021-07-01/communitygalleryimages/id_communitygalleryimage_test.go b/resource-manager/compute/2021-07-01/communitygalleryimages/id_communitygalleryimage_test.go index 269737a2b21..8e48672a727 100644 --- a/resource-manager/compute/2021-07-01/communitygalleryimages/id_communitygalleryimage_test.go +++ b/resource-manager/compute/2021-07-01/communitygalleryimages/id_communitygalleryimage_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryImageId{} func TestNewCommunityGalleryImageID(t *testing.T) { - id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") + id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatCommunityGalleryImageID(t *testing.T) { - actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName" + actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseCommunityGalleryImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseCommunityGalleryImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/communitygalleryimageversions/README.md b/resource-manager/compute/2021-07-01/communitygalleryimageversions/README.md index ad5d6e60d07..52cc603767f 100644 --- a/resource-manager/compute/2021-07-01/communitygalleryimageversions/README.md +++ b/resource-manager/compute/2021-07-01/communitygalleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleryimageversions.NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName") +id := communitygalleryimageversions.NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/compute/2021-07-01/communitygalleryimageversions/id_communitygalleryimageversion.go b/resource-manager/compute/2021-07-01/communitygalleryimageversions/id_communitygalleryimageversion.go index df7f451f227..1d726a30cbf 100644 --- a/resource-manager/compute/2021-07-01/communitygalleryimageversions/id_communitygalleryimageversion.go +++ b/resource-manager/compute/2021-07-01/communitygalleryimageversions/id_communitygalleryimageversion.go @@ -125,13 +125,13 @@ func (id CommunityGalleryImageVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2021-07-01/communitygalleryimageversions/id_communitygalleryimageversion_test.go b/resource-manager/compute/2021-07-01/communitygalleryimageversions/id_communitygalleryimageversion_test.go index da73ee1270c..2f27f37d55e 100644 --- a/resource-manager/compute/2021-07-01/communitygalleryimageversions/id_communitygalleryimageversion_test.go +++ b/resource-manager/compute/2021-07-01/communitygalleryimageversions/id_communitygalleryimageversion_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryImageVersionId{} func TestNewCommunityGalleryImageVersionID(t *testing.T) { - id := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName") + id := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatCommunityGalleryImageVersionID(t *testing.T) { - actual := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName" + actual := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseCommunityGalleryImageVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseCommunityGalleryImageVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/compute/model_keyvaultkeyreference.go b/resource-manager/compute/2021-07-01/compute/model_keyvaultkeyreference.go index 9006abc5b9f..044a74ca9ae 100644 --- a/resource-manager/compute/2021-07-01/compute/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2021-07-01/compute/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package compute // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2021-07-01/compute/model_keyvaultsecretreference.go b/resource-manager/compute/2021-07-01/compute/model_keyvaultsecretreference.go index e531def198b..83e2cb99c76 100644 --- a/resource-manager/compute/2021-07-01/compute/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2021-07-01/compute/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package compute // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2021-07-01/compute/model_vaultcertificate.go b/resource-manager/compute/2021-07-01/compute/model_vaultcertificate.go index 9ff4dc03cf1..7a43205eee2 100644 --- a/resource-manager/compute/2021-07-01/compute/model_vaultcertificate.go +++ b/resource-manager/compute/2021-07-01/compute/model_vaultcertificate.go @@ -5,5 +5,5 @@ package compute type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/compute/model_winrmlistener.go b/resource-manager/compute/2021-07-01/compute/model_winrmlistener.go index 9d1cc699287..6e2646200ea 100644 --- a/resource-manager/compute/2021-07-01/compute/model_winrmlistener.go +++ b/resource-manager/compute/2021-07-01/compute/model_winrmlistener.go @@ -4,6 +4,6 @@ package compute // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/galleryapplications/README.md b/resource-manager/compute/2021-07-01/galleryapplications/README.md index 84a4a292e28..d120fbc8617 100644 --- a/resource-manager/compute/2021-07-01/galleryapplications/README.md +++ b/resource-manager/compute/2021-07-01/galleryapplications/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") payload := galleryapplications.GalleryApplication{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") payload := galleryapplications.GalleryApplicationUpdate{ // ... diff --git a/resource-manager/compute/2021-07-01/galleryapplications/id_application.go b/resource-manager/compute/2021-07-01/galleryapplications/id_application.go index 865683cdda7..5b6ff82bf5b 100644 --- a/resource-manager/compute/2021-07-01/galleryapplications/id_application.go +++ b/resource-manager/compute/2021-07-01/galleryapplications/id_application.go @@ -123,7 +123,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } } diff --git a/resource-manager/compute/2021-07-01/galleryapplications/id_application_test.go b/resource-manager/compute/2021-07-01/galleryapplications/id_application_test.go index 9b358fec0af..6fbd0d8f746 100644 --- a/resource-manager/compute/2021-07-01/galleryapplications/id_application_test.go +++ b/resource-manager/compute/2021-07-01/galleryapplications/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", + ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/galleryapplicationversions/README.md b/resource-manager/compute/2021-07-01/galleryapplicationversions/README.md index 459de180eba..98e22774dcc 100644 --- a/resource-manager/compute/2021-07-01/galleryapplicationversions/README.md +++ b/resource-manager/compute/2021-07-01/galleryapplicationversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") payload := galleryapplicationversions.GalleryApplicationVersion{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") read, err := client.Get(ctx, id, galleryapplicationversions.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplicationversions.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") // alternatively `client.ListByGalleryApplication(ctx, id)` can be used to do batched pagination items, err := client.ListByGalleryApplicationComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") payload := galleryapplicationversions.GalleryApplicationVersionUpdate{ // ... diff --git a/resource-manager/compute/2021-07-01/galleryapplicationversions/id_application.go b/resource-manager/compute/2021-07-01/galleryapplicationversions/id_application.go index 08704b1b91f..56d6741ec00 100644 --- a/resource-manager/compute/2021-07-01/galleryapplicationversions/id_application.go +++ b/resource-manager/compute/2021-07-01/galleryapplicationversions/id_application.go @@ -123,7 +123,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } } diff --git a/resource-manager/compute/2021-07-01/galleryapplicationversions/id_application_test.go b/resource-manager/compute/2021-07-01/galleryapplicationversions/id_application_test.go index 02a985fc8a8..da5f9c61e9d 100644 --- a/resource-manager/compute/2021-07-01/galleryapplicationversions/id_application_test.go +++ b/resource-manager/compute/2021-07-01/galleryapplicationversions/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", + ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/galleryapplicationversions/id_applicationversion.go b/resource-manager/compute/2021-07-01/galleryapplicationversions/id_applicationversion.go index 545d234622c..7042840fc6e 100644 --- a/resource-manager/compute/2021-07-01/galleryapplicationversions/id_applicationversion.go +++ b/resource-manager/compute/2021-07-01/galleryapplicationversions/id_applicationversion.go @@ -129,9 +129,9 @@ func (id ApplicationVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryApplicationVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2021-07-01/galleryapplicationversions/id_applicationversion_test.go b/resource-manager/compute/2021-07-01/galleryapplicationversions/id_applicationversion_test.go index cbfc5e4c037..d1a837bdbda 100644 --- a/resource-manager/compute/2021-07-01/galleryapplicationversions/id_applicationversion_test.go +++ b/resource-manager/compute/2021-07-01/galleryapplicationversions/id_applicationversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationVersionId{} func TestNewApplicationVersionID(t *testing.T) { - id := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") + id := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewApplicationVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } - if id.VersionName != "galleryApplicationVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryApplicationVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatApplicationVersionID(t *testing.T) { - actual := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName" + actual := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseApplicationVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", - VersionName: "galleryApplicationVersionName", + ApplicationName: "applicationName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseApplicationVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", - VersionName: "galleryApplicationVersionName", + ApplicationName: "applicationName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS/gAlLeRyApPlIcAtIoNvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", - VersionName: "gAlLeRyApPlIcAtIoNvErSiOnNaMe", + ApplicationName: "aPpLiCaTiOnNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS/gAlLeRyApPlIcAtIoNvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/galleryimages/README.md b/resource-manager/compute/2021-07-01/galleryimages/README.md index fb682381bcd..7bb2ccdef05 100644 --- a/resource-manager/compute/2021-07-01/galleryimages/README.md +++ b/resource-manager/compute/2021-07-01/galleryimages/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") payload := galleryimages.GalleryImage{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") payload := galleryimages.GalleryImageUpdate{ // ... diff --git a/resource-manager/compute/2021-07-01/galleryimages/id_galleryimage.go b/resource-manager/compute/2021-07-01/galleryimages/id_galleryimage.go index 5883023f463..dd4c61adfae 100644 --- a/resource-manager/compute/2021-07-01/galleryimages/id_galleryimage.go +++ b/resource-manager/compute/2021-07-01/galleryimages/id_galleryimage.go @@ -123,7 +123,7 @@ func (id GalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2021-07-01/galleryimages/id_galleryimage_test.go b/resource-manager/compute/2021-07-01/galleryimages/id_galleryimage_test.go index 913b82acd35..8c77e84e750 100644 --- a/resource-manager/compute/2021-07-01/galleryimages/id_galleryimage_test.go +++ b/resource-manager/compute/2021-07-01/galleryimages/id_galleryimage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GalleryImageId{} func TestNewGalleryImageID(t *testing.T) { - id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") + id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGalleryImageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatGalleryImageID(t *testing.T) { - actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName" + actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseGalleryImageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseGalleryImageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/README.md b/resource-manager/compute/2021-07-01/galleryimageversions/README.md index badc718b5a4..897870cfe14 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/README.md +++ b/resource-manager/compute/2021-07-01/galleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") payload := galleryimageversions.GalleryImageVersion{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") read, err := client.Get(ctx, id, galleryimageversions.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimageversions.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") // alternatively `client.ListByGalleryImage(ctx, id)` can be used to do batched pagination items, err := client.ListByGalleryImageComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") payload := galleryimageversions.GalleryImageVersionUpdate{ // ... diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimage.go b/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimage.go index fdcea2d752b..0d1f7d19f12 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimage.go +++ b/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimage.go @@ -123,7 +123,7 @@ func (id GalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimage_test.go b/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimage_test.go index b7cd98a82ee..d2791250c5b 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimage_test.go +++ b/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GalleryImageId{} func TestNewGalleryImageID(t *testing.T) { - id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") + id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGalleryImageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatGalleryImageID(t *testing.T) { - actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName" + actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseGalleryImageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseGalleryImageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimageversion.go b/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimageversion.go new file mode 100644 index 00000000000..50ab9b3cd88 --- /dev/null +++ b/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimageversion.go @@ -0,0 +1,148 @@ +package galleryimageversions + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&GalleryImageVersionId{}) +} + +var _ resourceids.ResourceId = &GalleryImageVersionId{} + +// GalleryImageVersionId is a struct representing the Resource ID for a Gallery Image Version +type GalleryImageVersionId struct { + SubscriptionId string + ResourceGroupName string + GalleryName string + ImageName string + VersionName string +} + +// NewGalleryImageVersionID returns a new GalleryImageVersionId struct +func NewGalleryImageVersionID(subscriptionId string, resourceGroupName string, galleryName string, imageName string, versionName string) GalleryImageVersionId { + return GalleryImageVersionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + GalleryName: galleryName, + ImageName: imageName, + VersionName: versionName, + } +} + +// ParseGalleryImageVersionID parses 'input' into a GalleryImageVersionId +func ParseGalleryImageVersionID(input string) (*GalleryImageVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(&GalleryImageVersionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := GalleryImageVersionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseGalleryImageVersionIDInsensitively parses 'input' case-insensitively into a GalleryImageVersionId +// note: this method should only be used for API response data and not user input +func ParseGalleryImageVersionIDInsensitively(input string) (*GalleryImageVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(&GalleryImageVersionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := GalleryImageVersionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *GalleryImageVersionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.GalleryName, ok = input.Parsed["galleryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "galleryName", input) + } + + if id.ImageName, ok = input.Parsed["imageName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input) + } + + if id.VersionName, ok = input.Parsed["versionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "versionName", input) + } + + return nil +} + +// ValidateGalleryImageVersionID checks that 'input' can be parsed as a Gallery Image Version ID +func ValidateGalleryImageVersionID(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 := ParseGalleryImageVersionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Gallery Image Version ID +func (id GalleryImageVersionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/galleries/%s/images/%s/versions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.GalleryName, id.ImageName, id.VersionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Gallery Image Version ID +func (id GalleryImageVersionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), + resourceids.UserSpecifiedSegment("galleryName", "galleryName"), + resourceids.StaticSegment("staticImages", "images", "images"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), + resourceids.StaticSegment("staticVersions", "versions", "versions"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), + } +} + +// String returns a human-readable description of this Gallery Image Version ID +func (id GalleryImageVersionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Gallery Name: %q", id.GalleryName), + fmt.Sprintf("Image Name: %q", id.ImageName), + fmt.Sprintf("Version Name: %q", id.VersionName), + } + return fmt.Sprintf("Gallery Image Version (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/id_imageversion_test.go b/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimageversion_test.go similarity index 82% rename from resource-manager/compute/2021-07-01/galleryimageversions/id_imageversion_test.go rename to resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimageversion_test.go index 7a2f370f771..f7e42c01475 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/id_imageversion_test.go +++ b/resource-manager/compute/2021-07-01/galleryimageversions/id_galleryimageversion_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &ImageVersionId{} +var _ resourceids.ResourceId = &GalleryImageVersionId{} -func TestNewImageVersionID(t *testing.T) { - id := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +func TestNewGalleryImageVersionID(t *testing.T) { + id := NewGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,28 +26,28 @@ func TestNewImageVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } -func TestFormatImageVersionID(t *testing.T) { - actual := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName" +func TestFormatGalleryImageVersionID(t *testing.T) { + actual := NewGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseImageVersionID(t *testing.T) { +func TestParseGalleryImageVersionID(t *testing.T) { testData := []struct { Input string Error bool - Expected *ImageVersionId + Expected *GalleryImageVersionId }{ { // Incomplete URI @@ -101,35 +101,35 @@ func TestParseImageVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName", - Expected: &ImageVersionId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName", + Expected: &GalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseImageVersionID(v.Input) + actual, err := ParseGalleryImageVersionID(v.Input) if err != nil { if v.Error { continue @@ -164,11 +164,11 @@ func TestParseImageVersionID(t *testing.T) { } } -func TestParseImageVersionIDInsensitively(t *testing.T) { +func TestParseGalleryImageVersionIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *ImageVersionId + Expected *GalleryImageVersionId }{ { // Incomplete URI @@ -267,61 +267,61 @@ func TestParseImageVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName", - Expected: &ImageVersionId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName", + Expected: &GalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", - Expected: &ImageVersionId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", + Expected: &GalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseImageVersionIDInsensitively(v.Input) + actual, err := ParseGalleryImageVersionIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -356,10 +356,10 @@ func TestParseImageVersionIDInsensitively(t *testing.T) { } } -func TestSegmentsForImageVersionId(t *testing.T) { - segments := ImageVersionId{}.Segments() +func TestSegmentsForGalleryImageVersionId(t *testing.T) { + segments := GalleryImageVersionId{}.Segments() if len(segments) == 0 { - t.Fatalf("ImageVersionId has no segments") + t.Fatalf("GalleryImageVersionId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/method_createorupdate.go b/resource-manager/compute/2021-07-01/galleryimageversions/method_createorupdate.go index ad69a8d9801..cced5b87054 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/method_createorupdate.go +++ b/resource-manager/compute/2021-07-01/galleryimageversions/method_createorupdate.go @@ -22,7 +22,7 @@ type CreateOrUpdateOperationResponse struct { } // CreateOrUpdate ... -func (c GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, id ImageVersionId, input GalleryImageVersion) (result CreateOrUpdateOperationResponse, err error) { +func (c GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, id GalleryImageVersionId, input GalleryImageVersion) (result CreateOrUpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -62,7 +62,7 @@ func (c GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, id Image } // CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c GalleryImageVersionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ImageVersionId, input GalleryImageVersion) error { +func (c GalleryImageVersionsClient) CreateOrUpdateThenPoll(ctx context.Context, id GalleryImageVersionId, input GalleryImageVersion) error { result, err := c.CreateOrUpdate(ctx, id, input) if err != nil { return fmt.Errorf("performing CreateOrUpdate: %+v", err) diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/method_delete.go b/resource-manager/compute/2021-07-01/galleryimageversions/method_delete.go index 57eff6eb56f..5b4076feccf 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/method_delete.go +++ b/resource-manager/compute/2021-07-01/galleryimageversions/method_delete.go @@ -21,7 +21,7 @@ type DeleteOperationResponse struct { } // Delete ... -func (c GalleryImageVersionsClient) Delete(ctx context.Context, id ImageVersionId) (result DeleteOperationResponse, err error) { +func (c GalleryImageVersionsClient) Delete(ctx context.Context, id GalleryImageVersionId) (result DeleteOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -57,7 +57,7 @@ func (c GalleryImageVersionsClient) Delete(ctx context.Context, id ImageVersionI } // DeleteThenPoll performs Delete then polls until it's completed -func (c GalleryImageVersionsClient) DeleteThenPoll(ctx context.Context, id ImageVersionId) error { +func (c GalleryImageVersionsClient) DeleteThenPoll(ctx context.Context, id GalleryImageVersionId) error { result, err := c.Delete(ctx, id) if err != nil { return fmt.Errorf("performing Delete: %+v", err) diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/method_get.go b/resource-manager/compute/2021-07-01/galleryimageversions/method_get.go index a018545b29f..2b877570eff 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/method_get.go +++ b/resource-manager/compute/2021-07-01/galleryimageversions/method_get.go @@ -47,7 +47,7 @@ func (o GetOperationOptions) ToQuery() *client.QueryParams { } // Get ... -func (c GalleryImageVersionsClient) Get(ctx context.Context, id ImageVersionId, options GetOperationOptions) (result GetOperationResponse, err error) { +func (c GalleryImageVersionsClient) Get(ctx context.Context, id GalleryImageVersionId, options GetOperationOptions) (result GetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/method_update.go b/resource-manager/compute/2021-07-01/galleryimageversions/method_update.go index da2897707ae..d43a4c198c9 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/method_update.go +++ b/resource-manager/compute/2021-07-01/galleryimageversions/method_update.go @@ -22,7 +22,7 @@ type UpdateOperationResponse struct { } // Update ... -func (c GalleryImageVersionsClient) Update(ctx context.Context, id ImageVersionId, input GalleryImageVersionUpdate) (result UpdateOperationResponse, err error) { +func (c GalleryImageVersionsClient) Update(ctx context.Context, id GalleryImageVersionId, input GalleryImageVersionUpdate) (result UpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -60,7 +60,7 @@ func (c GalleryImageVersionsClient) Update(ctx context.Context, id ImageVersionI } // UpdateThenPoll performs Update then polls until it's completed -func (c GalleryImageVersionsClient) UpdateThenPoll(ctx context.Context, id ImageVersionId, input GalleryImageVersionUpdate) error { +func (c GalleryImageVersionsClient) UpdateThenPoll(ctx context.Context, id GalleryImageVersionId, input GalleryImageVersionUpdate) error { result, err := c.Update(ctx, id, input) if err != nil { return fmt.Errorf("performing Update: %+v", err) diff --git a/resource-manager/compute/2021-07-01/loganalytics/README.md b/resource-manager/compute/2021-07-01/loganalytics/README.md index 268643afede..2925fe57a9b 100644 --- a/resource-manager/compute/2021-07-01/loganalytics/README.md +++ b/resource-manager/compute/2021-07-01/loganalytics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.RequestRateByIntervalInput{ // ... @@ -41,7 +41,7 @@ if err := client.ExportRequestRateByIntervalThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.LogAnalyticsInputBase{ // ... diff --git a/resource-manager/compute/2021-07-01/loganalytics/id_location.go b/resource-manager/compute/2021-07-01/loganalytics/id_location.go index 017c4298e31..893525660f2 100644 --- a/resource-manager/compute/2021-07-01/loganalytics/id_location.go +++ b/resource-manager/compute/2021-07-01/loganalytics/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2021-07-01/loganalytics/id_location_test.go b/resource-manager/compute/2021-07-01/loganalytics/id_location_test.go index 9e2582fe064..76eb5c3f415 100644 --- a/resource-manager/compute/2021-07-01/loganalytics/id_location_test.go +++ b/resource-manager/compute/2021-07-01/loganalytics/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/restorepointcollections/model_keyvaultkeyreference.go b/resource-manager/compute/2021-07-01/restorepointcollections/model_keyvaultkeyreference.go index a58940dc601..e67b885cbec 100644 --- a/resource-manager/compute/2021-07-01/restorepointcollections/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2021-07-01/restorepointcollections/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2021-07-01/restorepointcollections/model_keyvaultsecretreference.go b/resource-manager/compute/2021-07-01/restorepointcollections/model_keyvaultsecretreference.go index 9cdda52320c..f403c9277b7 100644 --- a/resource-manager/compute/2021-07-01/restorepointcollections/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2021-07-01/restorepointcollections/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2021-07-01/restorepointcollections/model_vaultcertificate.go b/resource-manager/compute/2021-07-01/restorepointcollections/model_vaultcertificate.go index 1e6b6948da0..f3fd244ab96 100644 --- a/resource-manager/compute/2021-07-01/restorepointcollections/model_vaultcertificate.go +++ b/resource-manager/compute/2021-07-01/restorepointcollections/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepointcollections type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/restorepointcollections/model_winrmlistener.go b/resource-manager/compute/2021-07-01/restorepointcollections/model_winrmlistener.go index 48cee24a28f..3b6dcd5d775 100644 --- a/resource-manager/compute/2021-07-01/restorepointcollections/model_winrmlistener.go +++ b/resource-manager/compute/2021-07-01/restorepointcollections/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/sharedgalleries/README.md b/resource-manager/compute/2021-07-01/sharedgalleries/README.md index f9013377cfc..b807b56cc50 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleries/README.md +++ b/resource-manager/compute/2021-07-01/sharedgalleries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleries.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") +id := sharedgalleries.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleries.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := sharedgalleries.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id, sharedgalleries.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleries.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2021-07-01/sharedgalleries/id_location.go b/resource-manager/compute/2021-07-01/sharedgalleries/id_location.go index a02aeee9e82..a2b72e84cfb 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleries/id_location.go +++ b/resource-manager/compute/2021-07-01/sharedgalleries/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2021-07-01/sharedgalleries/id_location_test.go b/resource-manager/compute/2021-07-01/sharedgalleries/id_location_test.go index 4e4d0a54829..7e29e53bdc5 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleries/id_location_test.go +++ b/resource-manager/compute/2021-07-01/sharedgalleries/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/sharedgalleries/id_sharedgallery.go b/resource-manager/compute/2021-07-01/sharedgalleries/id_sharedgallery.go index 4622271e542..49ee6bb93ea 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleries/id_sharedgallery.go +++ b/resource-manager/compute/2021-07-01/sharedgalleries/id_sharedgallery.go @@ -113,9 +113,9 @@ func (id SharedGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), } } diff --git a/resource-manager/compute/2021-07-01/sharedgalleries/id_sharedgallery_test.go b/resource-manager/compute/2021-07-01/sharedgalleries/id_sharedgallery_test.go index 4b82c4b049a..f70f26dfd8f 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleries/id_sharedgallery_test.go +++ b/resource-manager/compute/2021-07-01/sharedgalleries/id_sharedgallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &SharedGalleryId{} func TestNewSharedGalleryID(t *testing.T) { - id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") + id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } } func TestFormatSharedGalleryID(t *testing.T) { - actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName" + actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseSharedGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseSharedGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimages/README.md b/resource-manager/compute/2021-07-01/sharedgalleryimages/README.md index 85a97ab4742..ec23dfb3b22 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimages/README.md +++ b/resource-manager/compute/2021-07-01/sharedgalleryimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleryimages.NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") +id := sharedgalleryimages.NewSharedGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleryimages.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") +id := sharedgalleryimages.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") // alternatively `client.List(ctx, id, sharedgalleryimages.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleryimages.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgallery.go b/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgallery.go index a458b9a6ca0..be4499dac00 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgallery.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgallery.go @@ -113,9 +113,9 @@ func (id SharedGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), } } diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgallery_test.go b/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgallery_test.go index 029a84562fd..78c44f7b95b 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgallery_test.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &SharedGalleryId{} func TestNewSharedGalleryID(t *testing.T) { - id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") + id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } } func TestFormatSharedGalleryID(t *testing.T) { - actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName" + actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseSharedGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseSharedGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimages/id_image.go b/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgalleryimage.go similarity index 60% rename from resource-manager/compute/2021-07-01/sharedgalleryimages/id_image.go rename to resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgalleryimage.go index 42c59630ae7..dd6ef4dee61 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimages/id_image.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgalleryimage.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&ImageId{}) + recaser.RegisterResourceId(&SharedGalleryImageId{}) } -var _ resourceids.ResourceId = &ImageId{} +var _ resourceids.ResourceId = &SharedGalleryImageId{} -// ImageId is a struct representing the Resource ID for a Image -type ImageId struct { +// SharedGalleryImageId is a struct representing the Resource ID for a Shared Gallery Image +type SharedGalleryImageId struct { SubscriptionId string LocationName string SharedGalleryName string ImageName string } -// NewImageID returns a new ImageId struct -func NewImageID(subscriptionId string, locationName string, sharedGalleryName string, imageName string) ImageId { - return ImageId{ +// NewSharedGalleryImageID returns a new SharedGalleryImageId struct +func NewSharedGalleryImageID(subscriptionId string, locationName string, sharedGalleryName string, imageName string) SharedGalleryImageId { + return SharedGalleryImageId{ SubscriptionId: subscriptionId, LocationName: locationName, SharedGalleryName: sharedGalleryName, @@ -35,15 +35,15 @@ func NewImageID(subscriptionId string, locationName string, sharedGalleryName st } } -// ParseImageID parses 'input' into a ImageId -func ParseImageID(input string) (*ImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&ImageId{}) +// ParseSharedGalleryImageID parses 'input' into a SharedGalleryImageId +func ParseSharedGalleryImageID(input string) (*SharedGalleryImageId, error) { + parser := resourceids.NewParserFromResourceIdType(&SharedGalleryImageId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := ImageId{} + id := SharedGalleryImageId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseImageID(input string) (*ImageId, error) { return &id, nil } -// ParseImageIDInsensitively parses 'input' case-insensitively into a ImageId +// ParseSharedGalleryImageIDInsensitively parses 'input' case-insensitively into a SharedGalleryImageId // note: this method should only be used for API response data and not user input -func ParseImageIDInsensitively(input string) (*ImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&ImageId{}) +func ParseSharedGalleryImageIDInsensitively(input string) (*SharedGalleryImageId, error) { + parser := resourceids.NewParserFromResourceIdType(&SharedGalleryImageId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := ImageId{} + id := SharedGalleryImageId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseImageIDInsensitively(input string) (*ImageId, error) { return &id, nil } -func (id *ImageId) FromParseResult(input resourceids.ParseResult) error { +func (id *SharedGalleryImageId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,50 +90,50 @@ func (id *ImageId) FromParseResult(input resourceids.ParseResult) error { return nil } -// ValidateImageID checks that 'input' can be parsed as a Image ID -func ValidateImageID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateSharedGalleryImageID checks that 'input' can be parsed as a Shared Gallery Image ID +func ValidateSharedGalleryImageID(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 := ParseImageID(v); err != nil { + if _, err := ParseSharedGalleryImageID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Image ID -func (id ImageId) ID() string { +// ID returns the formatted Shared Gallery Image ID +func (id SharedGalleryImageId) ID() string { fmtString := "/subscriptions/%s/providers/Microsoft.Compute/locations/%s/sharedGalleries/%s/images/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.SharedGalleryName, id.ImageName) } -// Segments returns a slice of Resource ID Segments which comprise this Image ID -func (id ImageId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Shared Gallery Image ID +func (id SharedGalleryImageId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } -// String returns a human-readable description of this Image ID -func (id ImageId) String() string { +// String returns a human-readable description of this Shared Gallery Image ID +func (id SharedGalleryImageId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Location Name: %q", id.LocationName), fmt.Sprintf("Shared Gallery Name: %q", id.SharedGalleryName), fmt.Sprintf("Image Name: %q", id.ImageName), } - return fmt.Sprintf("Image (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Shared Gallery Image (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimages/id_image_test.go b/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgalleryimage_test.go similarity index 70% rename from resource-manager/compute/2021-07-01/sharedgalleryimages/id_image_test.go rename to resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgalleryimage_test.go index a3a7a10a7e4..f31972d4494 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimages/id_image_test.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimages/id_sharedgalleryimage_test.go @@ -9,41 +9,41 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &ImageId{} +var _ resourceids.ResourceId = &SharedGalleryImageId{} -func TestNewImageID(t *testing.T) { - id := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") +func TestNewSharedGalleryImageID(t *testing.T) { + id := NewSharedGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } -func TestFormatImageID(t *testing.T) { - actual := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName" +func TestFormatSharedGalleryImageID(t *testing.T) { + actual := NewSharedGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseImageID(t *testing.T) { +func TestParseSharedGalleryImageID(t *testing.T) { testData := []struct { Input string Error bool - Expected *ImageId + Expected *SharedGalleryImageId }{ { // Incomplete URI @@ -77,44 +77,44 @@ func TestParseImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", - Expected: &ImageId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", + Expected: &SharedGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseImageID(v.Input) + actual, err := ParseSharedGalleryImageID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseImageID(t *testing.T) { } } -func TestParseImageIDInsensitively(t *testing.T) { +func TestParseSharedGalleryImageIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *ImageId + Expected *SharedGalleryImageId }{ { // Incomplete URI @@ -208,79 +208,79 @@ func TestParseImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", - Expected: &ImageId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", + Expected: &SharedGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", - Expected: &ImageId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", + Expected: &SharedGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseImageIDInsensitively(v.Input) + actual, err := ParseSharedGalleryImageIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseImageIDInsensitively(t *testing.T) { } } -func TestSegmentsForImageId(t *testing.T) { - segments := ImageId{}.Segments() +func TestSegmentsForSharedGalleryImageId(t *testing.T) { + segments := SharedGalleryImageId{}.Segments() if len(segments) == 0 { - t.Fatalf("ImageId has no segments") + t.Fatalf("SharedGalleryImageId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimages/method_get.go b/resource-manager/compute/2021-07-01/sharedgalleryimages/method_get.go index 4b49bfa2a28..3ec917f1698 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimages/method_get.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimages/method_get.go @@ -18,7 +18,7 @@ type GetOperationResponse struct { } // Get ... -func (c SharedGalleryImagesClient) Get(ctx context.Context, id ImageId) (result GetOperationResponse, err error) { +func (c SharedGalleryImagesClient) Get(ctx context.Context, id SharedGalleryImageId) (result GetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/README.md b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/README.md index 9c4f79e8d33..316cb6735eb 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/README.md +++ b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleryimageversions.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName") +id := sharedgalleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleryimageversions.NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") +id := sharedgalleryimageversions.NewSharedGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") // alternatively `client.List(ctx, id, sharedgalleryimageversions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleryimageversions.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2021-07-01/galleryimageversions/id_imageversion.go b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_imageversion.go similarity index 73% rename from resource-manager/compute/2021-07-01/galleryimageversions/id_imageversion.go rename to resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_imageversion.go index d6252874c0c..ab46812cb02 100644 --- a/resource-manager/compute/2021-07-01/galleryimageversions/id_imageversion.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_imageversion.go @@ -1,4 +1,4 @@ -package galleryimageversions +package sharedgalleryimageversions import ( "fmt" @@ -20,18 +20,18 @@ var _ resourceids.ResourceId = &ImageVersionId{} // ImageVersionId is a struct representing the Resource ID for a Image Version type ImageVersionId struct { SubscriptionId string - ResourceGroupName string - GalleryName string + LocationName string + SharedGalleryName string ImageName string VersionName string } // NewImageVersionID returns a new ImageVersionId struct -func NewImageVersionID(subscriptionId string, resourceGroupName string, galleryName string, imageName string, versionName string) ImageVersionId { +func NewImageVersionID(subscriptionId string, locationName string, sharedGalleryName string, imageName string, versionName string) ImageVersionId { return ImageVersionId{ SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - GalleryName: galleryName, + LocationName: locationName, + SharedGalleryName: sharedGalleryName, ImageName: imageName, VersionName: versionName, } @@ -77,12 +77,12 @@ func (id *ImageVersionId) FromParseResult(input resourceids.ParseResult) error { return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) } - if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + if id.LocationName, ok = input.Parsed["locationName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) } - if id.GalleryName, ok = input.Parsed["galleryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "galleryName", input) + if id.SharedGalleryName, ok = input.Parsed["sharedGalleryName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "sharedGalleryName", input) } if id.ImageName, ok = input.Parsed["imageName"]; !ok { @@ -113,8 +113,8 @@ func ValidateImageVersionID(input interface{}, key string) (warnings []string, e // ID returns the formatted Image Version ID func (id ImageVersionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/galleries/%s/images/%s/versions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.GalleryName, id.ImageName, id.VersionName) + fmtString := "/subscriptions/%s/providers/Microsoft.Compute/locations/%s/sharedGalleries/%s/images/%s/versions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.SharedGalleryName, id.ImageName, id.VersionName) } // Segments returns a slice of Resource ID Segments which comprise this Image Version ID @@ -122,16 +122,16 @@ func (id ImageVersionId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), - resourceids.UserSpecifiedSegment("galleryName", "galleryName"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } @@ -139,8 +139,8 @@ func (id ImageVersionId) Segments() []resourceids.Segment { func (id ImageVersionId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Gallery Name: %q", id.GalleryName), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Shared Gallery Name: %q", id.SharedGalleryName), fmt.Sprintf("Image Name: %q", id.ImageName), fmt.Sprintf("Version Name: %q", id.VersionName), } diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_version_test.go b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_imageversion_test.go similarity index 67% rename from resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_version_test.go rename to resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_imageversion_test.go index d1353073c28..7eaca93af0f 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_version_test.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_imageversion_test.go @@ -9,45 +9,45 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &VersionId{} +var _ resourceids.ResourceId = &ImageVersionId{} -func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName") +func TestNewImageVersionID(t *testing.T) { + id := NewImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } -func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName" +func TestFormatImageVersionID(t *testing.T) { + actual := NewImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseVersionID(t *testing.T) { +func TestParseImageVersionID(t *testing.T) { testData := []struct { Input string Error bool - Expected *VersionId + Expected *ImageVersionId }{ { // Incomplete URI @@ -81,55 +81,55 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName", - Expected: &VersionId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName", + Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseVersionID(v.Input) + actual, err := ParseImageVersionID(v.Input) if err != nil { if v.Error { continue @@ -164,11 +164,11 @@ func TestParseVersionID(t *testing.T) { } } -func TestParseVersionIDInsensitively(t *testing.T) { +func TestParseImageVersionIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *VersionId + Expected *ImageVersionId }{ { // Incomplete URI @@ -227,101 +227,101 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName", - Expected: &VersionId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName", + Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", - Expected: &VersionId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", + Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseVersionIDInsensitively(v.Input) + actual, err := ParseImageVersionIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -356,10 +356,10 @@ func TestParseVersionIDInsensitively(t *testing.T) { } } -func TestSegmentsForVersionId(t *testing.T) { - segments := VersionId{}.Segments() +func TestSegmentsForImageVersionId(t *testing.T) { + segments := ImageVersionId{}.Segments() if len(segments) == 0 { - t.Fatalf("VersionId has no segments") + t.Fatalf("ImageVersionId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_image.go b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_sharedgalleryimage.go similarity index 60% rename from resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_image.go rename to resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_sharedgalleryimage.go index 6ebaa342691..1e3273e4099 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_image.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_sharedgalleryimage.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&ImageId{}) + recaser.RegisterResourceId(&SharedGalleryImageId{}) } -var _ resourceids.ResourceId = &ImageId{} +var _ resourceids.ResourceId = &SharedGalleryImageId{} -// ImageId is a struct representing the Resource ID for a Image -type ImageId struct { +// SharedGalleryImageId is a struct representing the Resource ID for a Shared Gallery Image +type SharedGalleryImageId struct { SubscriptionId string LocationName string SharedGalleryName string ImageName string } -// NewImageID returns a new ImageId struct -func NewImageID(subscriptionId string, locationName string, sharedGalleryName string, imageName string) ImageId { - return ImageId{ +// NewSharedGalleryImageID returns a new SharedGalleryImageId struct +func NewSharedGalleryImageID(subscriptionId string, locationName string, sharedGalleryName string, imageName string) SharedGalleryImageId { + return SharedGalleryImageId{ SubscriptionId: subscriptionId, LocationName: locationName, SharedGalleryName: sharedGalleryName, @@ -35,15 +35,15 @@ func NewImageID(subscriptionId string, locationName string, sharedGalleryName st } } -// ParseImageID parses 'input' into a ImageId -func ParseImageID(input string) (*ImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&ImageId{}) +// ParseSharedGalleryImageID parses 'input' into a SharedGalleryImageId +func ParseSharedGalleryImageID(input string) (*SharedGalleryImageId, error) { + parser := resourceids.NewParserFromResourceIdType(&SharedGalleryImageId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := ImageId{} + id := SharedGalleryImageId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseImageID(input string) (*ImageId, error) { return &id, nil } -// ParseImageIDInsensitively parses 'input' case-insensitively into a ImageId +// ParseSharedGalleryImageIDInsensitively parses 'input' case-insensitively into a SharedGalleryImageId // note: this method should only be used for API response data and not user input -func ParseImageIDInsensitively(input string) (*ImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&ImageId{}) +func ParseSharedGalleryImageIDInsensitively(input string) (*SharedGalleryImageId, error) { + parser := resourceids.NewParserFromResourceIdType(&SharedGalleryImageId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := ImageId{} + id := SharedGalleryImageId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseImageIDInsensitively(input string) (*ImageId, error) { return &id, nil } -func (id *ImageId) FromParseResult(input resourceids.ParseResult) error { +func (id *SharedGalleryImageId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,50 +90,50 @@ func (id *ImageId) FromParseResult(input resourceids.ParseResult) error { return nil } -// ValidateImageID checks that 'input' can be parsed as a Image ID -func ValidateImageID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateSharedGalleryImageID checks that 'input' can be parsed as a Shared Gallery Image ID +func ValidateSharedGalleryImageID(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 := ParseImageID(v); err != nil { + if _, err := ParseSharedGalleryImageID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Image ID -func (id ImageId) ID() string { +// ID returns the formatted Shared Gallery Image ID +func (id SharedGalleryImageId) ID() string { fmtString := "/subscriptions/%s/providers/Microsoft.Compute/locations/%s/sharedGalleries/%s/images/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.SharedGalleryName, id.ImageName) } -// Segments returns a slice of Resource ID Segments which comprise this Image ID -func (id ImageId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Shared Gallery Image ID +func (id SharedGalleryImageId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } -// String returns a human-readable description of this Image ID -func (id ImageId) String() string { +// String returns a human-readable description of this Shared Gallery Image ID +func (id SharedGalleryImageId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Location Name: %q", id.LocationName), fmt.Sprintf("Shared Gallery Name: %q", id.SharedGalleryName), fmt.Sprintf("Image Name: %q", id.ImageName), } - return fmt.Sprintf("Image (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Shared Gallery Image (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_image_test.go b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_sharedgalleryimage_test.go similarity index 70% rename from resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_image_test.go rename to resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_sharedgalleryimage_test.go index 837e738dc05..12c2b0a2261 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_image_test.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_sharedgalleryimage_test.go @@ -9,41 +9,41 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &ImageId{} +var _ resourceids.ResourceId = &SharedGalleryImageId{} -func TestNewImageID(t *testing.T) { - id := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") +func TestNewSharedGalleryImageID(t *testing.T) { + id := NewSharedGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } -func TestFormatImageID(t *testing.T) { - actual := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName" +func TestFormatSharedGalleryImageID(t *testing.T) { + actual := NewSharedGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseImageID(t *testing.T) { +func TestParseSharedGalleryImageID(t *testing.T) { testData := []struct { Input string Error bool - Expected *ImageId + Expected *SharedGalleryImageId }{ { // Incomplete URI @@ -77,44 +77,44 @@ func TestParseImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", - Expected: &ImageId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", + Expected: &SharedGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseImageID(v.Input) + actual, err := ParseSharedGalleryImageID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseImageID(t *testing.T) { } } -func TestParseImageIDInsensitively(t *testing.T) { +func TestParseSharedGalleryImageIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *ImageId + Expected *SharedGalleryImageId }{ { // Incomplete URI @@ -208,79 +208,79 @@ func TestParseImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", - Expected: &ImageId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", + Expected: &SharedGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", - Expected: &ImageId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", + Expected: &SharedGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseImageIDInsensitively(v.Input) + actual, err := ParseSharedGalleryImageIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseImageIDInsensitively(t *testing.T) { } } -func TestSegmentsForImageId(t *testing.T) { - segments := ImageId{}.Segments() +func TestSegmentsForSharedGalleryImageId(t *testing.T) { + segments := SharedGalleryImageId{}.Segments() if len(segments) == 0 { - t.Fatalf("ImageId has no segments") + t.Fatalf("SharedGalleryImageId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_version.go b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_version.go deleted file mode 100644 index b210c744459..00000000000 --- a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/id_version.go +++ /dev/null @@ -1,148 +0,0 @@ -package sharedgalleryimageversions - -import ( - "fmt" - "strings" - - "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" - "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -func init() { - recaser.RegisterResourceId(&VersionId{}) -} - -var _ resourceids.ResourceId = &VersionId{} - -// VersionId is a struct representing the Resource ID for a Version -type VersionId struct { - SubscriptionId string - LocationName string - SharedGalleryName string - ImageName string - VersionName string -} - -// NewVersionID returns a new VersionId struct -func NewVersionID(subscriptionId string, locationName string, sharedGalleryName string, imageName string, versionName string) VersionId { - return VersionId{ - SubscriptionId: subscriptionId, - LocationName: locationName, - SharedGalleryName: sharedGalleryName, - ImageName: imageName, - VersionName: versionName, - } -} - -// ParseVersionID parses 'input' into a VersionId -func ParseVersionID(input string) (*VersionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VersionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VersionId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVersionIDInsensitively parses 'input' case-insensitively into a VersionId -// note: this method should only be used for API response data and not user input -func ParseVersionIDInsensitively(input string) (*VersionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VersionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VersionId{} - if err = id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VersionId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - if id.SharedGalleryName, ok = input.Parsed["sharedGalleryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "sharedGalleryName", input) - } - - if id.ImageName, ok = input.Parsed["imageName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input) - } - - if id.VersionName, ok = input.Parsed["versionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "versionName", input) - } - - return nil -} - -// ValidateVersionID checks that 'input' can be parsed as a Version ID -func ValidateVersionID(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 := ParseVersionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Version ID -func (id VersionId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Compute/locations/%s/sharedGalleries/%s/images/%s/versions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.SharedGalleryName, id.ImageName, id.VersionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Version ID -func (id VersionId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), - resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), - resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), - resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), - resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), - } -} - -// String returns a human-readable description of this Version ID -func (id VersionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Location Name: %q", id.LocationName), - fmt.Sprintf("Shared Gallery Name: %q", id.SharedGalleryName), - fmt.Sprintf("Image Name: %q", id.ImageName), - fmt.Sprintf("Version Name: %q", id.VersionName), - } - return fmt.Sprintf("Version (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/method_get.go b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/method_get.go index db662df97bd..d7170bc844d 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/method_get.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/method_get.go @@ -18,7 +18,7 @@ type GetOperationResponse struct { } // Get ... -func (c SharedGalleryImageVersionsClient) Get(ctx context.Context, id VersionId) (result GetOperationResponse, err error) { +func (c SharedGalleryImageVersionsClient) Get(ctx context.Context, id ImageVersionId) (result GetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/method_list.go b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/method_list.go index 157a30105ad..67b2c7bff22 100644 --- a/resource-manager/compute/2021-07-01/sharedgalleryimageversions/method_list.go +++ b/resource-manager/compute/2021-07-01/sharedgalleryimageversions/method_list.go @@ -64,7 +64,7 @@ func (p *ListCustomPager) NextPageLink() *odata.Link { } // List ... -func (c SharedGalleryImageVersionsClient) List(ctx context.Context, id ImageId, options ListOperationOptions) (result ListOperationResponse, err error) { +func (c SharedGalleryImageVersionsClient) List(ctx context.Context, id SharedGalleryImageId, options ListOperationOptions) (result ListOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -104,12 +104,12 @@ func (c SharedGalleryImageVersionsClient) List(ctx context.Context, id ImageId, } // ListComplete retrieves all the results into a single object -func (c SharedGalleryImageVersionsClient) ListComplete(ctx context.Context, id ImageId, options ListOperationOptions) (ListCompleteResult, error) { +func (c SharedGalleryImageVersionsClient) ListComplete(ctx context.Context, id SharedGalleryImageId, options ListOperationOptions) (ListCompleteResult, error) { return c.ListCompleteMatchingPredicate(ctx, id, options, SharedGalleryImageVersionOperationPredicate{}) } // ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SharedGalleryImageVersionsClient) ListCompleteMatchingPredicate(ctx context.Context, id ImageId, options ListOperationOptions, predicate SharedGalleryImageVersionOperationPredicate) (result ListCompleteResult, err error) { +func (c SharedGalleryImageVersionsClient) ListCompleteMatchingPredicate(ctx context.Context, id SharedGalleryImageId, options ListOperationOptions, predicate SharedGalleryImageVersionOperationPredicate) (result ListCompleteResult, err error) { items := make([]SharedGalleryImageVersion, 0) resp, err := c.List(ctx, id, options) diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/README.md b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/README.md index db4a95064bf..b5e5a0c20eb 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") +id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListTypes(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") +id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") read, err := client.ListVersions(ctx, id, virtualmachineextensionimages.DefaultListVersionsOperationOptions()) if err != nil { diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_publisher.go b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_publisher.go index 26803cae70d..75185dcd3b3 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_publisher.go +++ b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_publisher_test.go b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_publisher_test.go index a68baea12d2..a1107c02a89 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_publisher_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_type.go b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_type.go index b8d3341bc22..913ad5b4f1d 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_type.go +++ b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_type.go @@ -119,7 +119,7 @@ func (id TypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_type_test.go b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_type_test.go index 82a20b50cdb..fdd8342e8e0 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_type_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_type_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TypeId{} func TestNewTypeID(t *testing.T) { - id := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") + id := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewTypeID(t *testing.T) { } func TestFormatTypeID(t *testing.T) { - actual := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName" + actual := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_version.go b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_version.go index 56bb407edd5..428dd802d6f 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_version.go +++ b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_version.go @@ -125,7 +125,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), @@ -133,7 +133,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTypes", "types", "types"), resourceids.UserSpecifiedSegment("typeName", "typeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_version_test.go b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_version_test.go index de6f52198dc..9190aa87b20 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_version_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineextensionimages/id_version_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -30,14 +30,14 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TypeName'", id.TypeName, "typeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensions/README.md b/resource-manager/compute/2021-07-01/virtualmachineextensions/README.md index 5c655706829..f32240da79b 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensions/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachineextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") read, err := client.Get(ctx, id, virtualmachineextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtensionUpdate{ // ... diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensions/id_extension.go b/resource-manager/compute/2021-07-01/virtualmachineextensions/id_extension.go index 25ce4dd99cf..72168cd7ce0 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensions/id_extension.go +++ b/resource-manager/compute/2021-07-01/virtualmachineextensions/id_extension.go @@ -123,7 +123,7 @@ func (id ExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineextensions/id_extension_test.go b/resource-manager/compute/2021-07-01/virtualmachineextensions/id_extension_test.go index 6727e3b6c90..29ca0c38d57 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineextensions/id_extension_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineextensions/id_extension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExtensionId{} func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") + id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName" + actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineName: "vIrTuAlMaChInEnAmE", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/README.md b/resource-manager/compute/2021-07-01/virtualmachineimages/README.md index 27982835cef..bade8f25308 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") read, err := client.EdgeZoneGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") +id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") read, err := client.EdgeZoneList(ctx, id, virtualmachineimages.DefaultEdgeZoneListOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") +id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") read, err := client.EdgeZoneListOffers(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") read, err := client.EdgeZoneListPublishers(ctx, id) if err != nil { @@ -88,7 +88,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") +id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") read, err := client.EdgeZoneListSkus(ctx, id) if err != nil { @@ -104,7 +104,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") +id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") read, err := client.List(ctx, id, virtualmachineimages.DefaultListOperationOptions()) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListOffers(ctx, id) if err != nil { @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListPublishers(ctx, id) if err != nil { @@ -168,7 +168,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") +id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") read, err := client.ListSkus(ctx, id) if err != nil { diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezone.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezone.go index 9decb1ab074..4589fd49c69 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezone.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezone.go @@ -113,9 +113,9 @@ func (id EdgeZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezone_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezone_test.go index 72468a3951b..179025c0a66 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezone_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezone_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &EdgeZoneId{} func TestNewEdgeZoneID(t *testing.T) { - id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") + id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } } func TestFormatEdgeZoneID(t *testing.T) { - actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone" + actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseEdgeZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseEdgeZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezonepublisher.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezonepublisher.go index 270c659bca7..413b714876a 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezonepublisher.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezonepublisher.go @@ -119,9 +119,9 @@ func (id EdgeZonePublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezonepublisher_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezonepublisher_test.go index 0c39297640c..481cc03e568 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezonepublisher_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_edgezonepublisher_test.go @@ -12,18 +12,18 @@ import ( var _ resourceids.ResourceId = &EdgeZonePublisherId{} func TestNewEdgeZonePublisherID(t *testing.T) { - id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") + id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewEdgeZonePublisherID(t *testing.T) { } func TestFormatEdgeZonePublisherID(t *testing.T) { - actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName" + actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseEdgeZonePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseEdgeZonePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_location.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_location.go index 964d6fa45df..bc87fc5d8b3 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_location.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_location_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_location_test.go index 6c81492a53e..ba21e1bba3c 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_location_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offer.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offer.go index 0c2104719a1..555733f938b 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offer.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offer.go @@ -119,13 +119,13 @@ func (id OfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offer_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offer_test.go index da5ed77df1d..20ee9d771ba 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offer_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offer_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &OfferId{} func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") + id := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offersku.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offersku.go index 4a79b9d3b5e..616277032de 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offersku.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offersku.go @@ -131,17 +131,17 @@ func (id OfferSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offersku_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offersku_test.go index 67473168400..b580e4c3fca 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offersku_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offersku_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &OfferSkuId{} func TestNewOfferSkuID(t *testing.T) { - id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") + id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatOfferSkuID(t *testing.T) { - actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseOfferSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseOfferSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offerskuversion.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offerskuversion.go index 7dbff8871b4..c6d89f817f3 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offerskuversion.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offerskuversion.go @@ -137,19 +137,19 @@ func (id OfferSkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offerskuversion_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offerskuversion_test.go index d60eae3c964..e8bc8c4c903 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_offerskuversion_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_offerskuversion_test.go @@ -12,40 +12,40 @@ import ( var _ resourceids.ResourceId = &OfferSkuVersionId{} func TestNewOfferSkuVersionID(t *testing.T) { - id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") + id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatOfferSkuVersionID(t *testing.T) { - actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -89,80 +89,80 @@ func TestParseOfferSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -275,158 +275,158 @@ func TestParseOfferSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_publisher.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_publisher.go index f33e882af34..732498f2f76 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_publisher.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_publisher_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_publisher_test.go index 441a6a32c0b..320e179981f 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_publisher_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_sku.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_sku.go index e8d0dddeaac..86196817181 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_sku.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_sku.go @@ -125,15 +125,15 @@ func (id SkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_sku_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_sku_test.go index 0123383d4f7..7148e671250 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_sku_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_sku_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &SkuId{} func TestNewSkuID(t *testing.T) { - id := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") + id := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatSkuID(t *testing.T) { - actual := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_skuversion.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_skuversion.go index 94cefe0168e..e6327d8297c 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_skuversion.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_skuversion.go @@ -131,17 +131,17 @@ func (id SkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_skuversion_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_skuversion_test.go index 153eee929c4..71033afa5fe 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_skuversion_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_skuversion_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &SkuVersionId{} func TestNewSkuVersionID(t *testing.T) { - id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") + id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatSkuVersionID(t *testing.T) { - actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_vmimageoffer.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_vmimageoffer.go index 1d8939e1fdb..2739d80c546 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_vmimageoffer.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_vmimageoffer.go @@ -125,15 +125,15 @@ func (id VMImageOfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineimages/id_vmimageoffer_test.go b/resource-manager/compute/2021-07-01/virtualmachineimages/id_vmimageoffer_test.go index 7cef7cc7c1e..1ecef60694e 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineimages/id_vmimageoffer_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineimages/id_vmimageoffer_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VMImageOfferId{} func TestNewVMImageOfferID(t *testing.T) { - id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") + id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatVMImageOfferID(t *testing.T) { - actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVMImageOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVMImageOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineruncommands/README.md b/resource-manager/compute/2021-07-01/virtualmachineruncommands/README.md index 0c142230fd7..769e12f8ce9 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineruncommands/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachineruncommands/README.md @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") +id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") read, err := client.Get(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_location.go b/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_location.go index d8733d6665f..f23f00fe4e6 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_location.go +++ b/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_location_test.go b/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_location_test.go index 83d1e4c6807..a2db8720398 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_location_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_runcommand.go b/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_runcommand.go index 6781693a76f..64a8edf61a9 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_runcommand.go +++ b/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_runcommand.go @@ -113,7 +113,7 @@ func (id RunCommandId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRunCommands", "runCommands", "runCommands"), resourceids.UserSpecifiedSegment("commandId", "commandId"), } diff --git a/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_runcommand_test.go b/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_runcommand_test.go index e45ff7998e6..edd76a46cda 100644 --- a/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_runcommand_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachineruncommands/id_runcommand_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RunCommandId{} func TestNewRunCommandID(t *testing.T) { - id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") + id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.CommandId != "commandId" { @@ -28,8 +28,8 @@ func TestNewRunCommandID(t *testing.T) { } func TestFormatRunCommandID(t *testing.T) { - actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId" + actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRunCommandID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRunCommandIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", CommandId: "cOmMaNdId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachines/README.md b/resource-manager/compute/2021-07-01/virtualmachines/README.md index b71a92296c8..26ab6b16521 100644 --- a/resource-manager/compute/2021-07-01/virtualmachines/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachines/README.md @@ -222,7 +222,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2021-07-01/virtualmachines/id_location.go b/resource-manager/compute/2021-07-01/virtualmachines/id_location.go index 5e0c32a8f32..64438c96c4f 100644 --- a/resource-manager/compute/2021-07-01/virtualmachines/id_location.go +++ b/resource-manager/compute/2021-07-01/virtualmachines/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachines/id_location_test.go b/resource-manager/compute/2021-07-01/virtualmachines/id_location_test.go index 05747f53916..08322a2d3e4 100644 --- a/resource-manager/compute/2021-07-01/virtualmachines/id_location_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachines/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachines/model_keyvaultkeyreference.go b/resource-manager/compute/2021-07-01/virtualmachines/model_keyvaultkeyreference.go index 438a0aef731..c50244524ea 100644 --- a/resource-manager/compute/2021-07-01/virtualmachines/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2021-07-01/virtualmachines/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachines/model_keyvaultsecretreference.go b/resource-manager/compute/2021-07-01/virtualmachines/model_keyvaultsecretreference.go index c9fcd8ae2b8..b739f603f31 100644 --- a/resource-manager/compute/2021-07-01/virtualmachines/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2021-07-01/virtualmachines/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachines/model_vaultcertificate.go b/resource-manager/compute/2021-07-01/virtualmachines/model_vaultcertificate.go index 5331305fb8f..73f8924cdde 100644 --- a/resource-manager/compute/2021-07-01/virtualmachines/model_vaultcertificate.go +++ b/resource-manager/compute/2021-07-01/virtualmachines/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachines type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachines/model_winrmlistener.go b/resource-manager/compute/2021-07-01/virtualmachines/model_winrmlistener.go index e2a07b49f36..30b38d846e4 100644 --- a/resource-manager/compute/2021-07-01/virtualmachines/model_winrmlistener.go +++ b/resource-manager/compute/2021-07-01/virtualmachines/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/README.md b/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/README.md index ad429a2b185..6ad76ae0c9c 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetextensions.DefaultGetOperationOptions()) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtensionUpdate{ // ... diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go b/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go index e5f4dfee0c5..371728a2982 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go @@ -123,7 +123,7 @@ func (id VirtualMachineScaleSetExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmssExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go b/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go index 970622d627b..41e7a35c801 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineScaleSetExtensionId{} func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { - id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") + id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.ExtensionName != "vmssExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmssExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineScaleSetExtensionID(t *testing.T) { - actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName" + actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineScaleSetExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineScaleSetExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - ExtensionName: "vMsSeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesets/README.md b/resource-manager/compute/2021-07-01/virtualmachinescalesets/README.md index 4164fe55dd7..bde285e816c 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesets/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesets/README.md @@ -208,7 +208,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesets/id_location.go b/resource-manager/compute/2021-07-01/virtualmachinescalesets/id_location.go index 2ecdd131193..1e550001f84 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesets/id_location.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesets/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesets/id_location_test.go b/resource-manager/compute/2021-07-01/virtualmachinescalesets/id_location_test.go index 58dbcd4eaab..f01c16a7142 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesets/id_location_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesets/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesets/model_vaultcertificate.go b/resource-manager/compute/2021-07-01/virtualmachinescalesets/model_vaultcertificate.go index 87cebefa156..4e9173b39e6 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesets/model_vaultcertificate.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesets/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesets type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesets/model_winrmlistener.go b/resource-manager/compute/2021-07-01/virtualmachinescalesets/model_winrmlistener.go index 4f07c2d4e68..fbaee700c4e 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesets/model_winrmlistener.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesets/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/README.md b/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/README.md index 9ecdaf92805..19e2c92432e 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetvmextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtensionUpdate{ // ... diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go b/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go index af92bc251a2..52f7976168f 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go @@ -131,7 +131,7 @@ func (id VirtualMachineExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go b/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go index 2f015fd2e0e..fb282110d45 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineExtensionId{} func TestNewVirtualMachineExtensionID(t *testing.T) { - id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") + id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewVirtualMachineExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'InstanceId'", id.InstanceId, "instanceId") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineExtensionID(t *testing.T) { - actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName" + actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseVirtualMachineExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseVirtualMachineExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", InstanceId: "iNsTaNcEiD", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go b/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go index 831baeaa8f3..641c4d6cecc 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go b/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go index e0e510549a1..102c8c99c7f 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_vaultcertificate.go b/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_vaultcertificate.go index ed0fd87a8a3..2ed3161f67c 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_vaultcertificate.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesetvms type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_winrmlistener.go b/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_winrmlistener.go index 7b8e4ea9a3b..59cdd2f5c0b 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_winrmlistener.go +++ b/resource-manager/compute/2021-07-01/virtualmachinescalesetvms/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2021-07-01/virtualmachinesizes/README.md b/resource-manager/compute/2021-07-01/virtualmachinesizes/README.md index d2272ccba30..902964fb6a1 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinesizes/README.md +++ b/resource-manager/compute/2021-07-01/virtualmachinesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/compute/2021-07-01/virtualmachinesizes/id_location.go b/resource-manager/compute/2021-07-01/virtualmachinesizes/id_location.go index c3d426ecfb0..f36bb369b8b 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinesizes/id_location.go +++ b/resource-manager/compute/2021-07-01/virtualmachinesizes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2021-07-01/virtualmachinesizes/id_location_test.go b/resource-manager/compute/2021-07-01/virtualmachinesizes/id_location_test.go index 1507b0f8398..e60ddc571cb 100644 --- a/resource-manager/compute/2021-07-01/virtualmachinesizes/id_location_test.go +++ b/resource-manager/compute/2021-07-01/virtualmachinesizes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/loganalytics/README.md b/resource-manager/compute/2022-03-01/loganalytics/README.md index 1a4c1af07b0..4ea4d4cfeb0 100644 --- a/resource-manager/compute/2022-03-01/loganalytics/README.md +++ b/resource-manager/compute/2022-03-01/loganalytics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.RequestRateByIntervalInput{ // ... @@ -41,7 +41,7 @@ if err := client.ExportRequestRateByIntervalThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.LogAnalyticsInputBase{ // ... diff --git a/resource-manager/compute/2022-03-01/loganalytics/id_location.go b/resource-manager/compute/2022-03-01/loganalytics/id_location.go index 017c4298e31..893525660f2 100644 --- a/resource-manager/compute/2022-03-01/loganalytics/id_location.go +++ b/resource-manager/compute/2022-03-01/loganalytics/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2022-03-01/loganalytics/id_location_test.go b/resource-manager/compute/2022-03-01/loganalytics/id_location_test.go index 9e2582fe064..76eb5c3f415 100644 --- a/resource-manager/compute/2022-03-01/loganalytics/id_location_test.go +++ b/resource-manager/compute/2022-03-01/loganalytics/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/restorepointcollections/model_keyvaultkeyreference.go b/resource-manager/compute/2022-03-01/restorepointcollections/model_keyvaultkeyreference.go index a58940dc601..e67b885cbec 100644 --- a/resource-manager/compute/2022-03-01/restorepointcollections/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2022-03-01/restorepointcollections/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/restorepointcollections/model_keyvaultsecretreference.go b/resource-manager/compute/2022-03-01/restorepointcollections/model_keyvaultsecretreference.go index 9cdda52320c..f403c9277b7 100644 --- a/resource-manager/compute/2022-03-01/restorepointcollections/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2022-03-01/restorepointcollections/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/restorepointcollections/model_vaultcertificate.go b/resource-manager/compute/2022-03-01/restorepointcollections/model_vaultcertificate.go index 1e6b6948da0..f3fd244ab96 100644 --- a/resource-manager/compute/2022-03-01/restorepointcollections/model_vaultcertificate.go +++ b/resource-manager/compute/2022-03-01/restorepointcollections/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepointcollections type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/restorepointcollections/model_winrmlistener.go b/resource-manager/compute/2022-03-01/restorepointcollections/model_winrmlistener.go index 48cee24a28f..3b6dcd5d775 100644 --- a/resource-manager/compute/2022-03-01/restorepointcollections/model_winrmlistener.go +++ b/resource-manager/compute/2022-03-01/restorepointcollections/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/restorepoints/model_keyvaultkeyreference.go b/resource-manager/compute/2022-03-01/restorepoints/model_keyvaultkeyreference.go index f91f103e171..a84afc6404c 100644 --- a/resource-manager/compute/2022-03-01/restorepoints/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2022-03-01/restorepoints/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/restorepoints/model_keyvaultsecretreference.go b/resource-manager/compute/2022-03-01/restorepoints/model_keyvaultsecretreference.go index 4482fc4dbcb..473adafc492 100644 --- a/resource-manager/compute/2022-03-01/restorepoints/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2022-03-01/restorepoints/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/restorepoints/model_vaultcertificate.go b/resource-manager/compute/2022-03-01/restorepoints/model_vaultcertificate.go index 077c7b0db1d..7ace154164b 100644 --- a/resource-manager/compute/2022-03-01/restorepoints/model_vaultcertificate.go +++ b/resource-manager/compute/2022-03-01/restorepoints/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepoints type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/restorepoints/model_winrmlistener.go b/resource-manager/compute/2022-03-01/restorepoints/model_winrmlistener.go index c9ff579e87e..7d06a9d1480 100644 --- a/resource-manager/compute/2022-03-01/restorepoints/model_winrmlistener.go +++ b/resource-manager/compute/2022-03-01/restorepoints/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/README.md b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/README.md index 04774db5966..ac0a9ed1442 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") +id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListTypes(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") +id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") read, err := client.ListVersions(ctx, id, virtualmachineextensionimages.DefaultListVersionsOperationOptions()) if err != nil { diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_publisher.go b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_publisher.go index 26803cae70d..75185dcd3b3 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_publisher.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_publisher_test.go b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_publisher_test.go index a68baea12d2..a1107c02a89 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_publisher_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_type.go b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_type.go index b8d3341bc22..913ad5b4f1d 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_type.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_type.go @@ -119,7 +119,7 @@ func (id TypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_type_test.go b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_type_test.go index 82a20b50cdb..fdd8342e8e0 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_type_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_type_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TypeId{} func TestNewTypeID(t *testing.T) { - id := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") + id := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewTypeID(t *testing.T) { } func TestFormatTypeID(t *testing.T) { - actual := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName" + actual := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_version.go b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_version.go index 56bb407edd5..428dd802d6f 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_version.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_version.go @@ -125,7 +125,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), @@ -133,7 +133,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTypes", "types", "types"), resourceids.UserSpecifiedSegment("typeName", "typeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_version_test.go b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_version_test.go index de6f52198dc..9190aa87b20 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_version_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensionimages/id_version_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -30,14 +30,14 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TypeName'", id.TypeName, "typeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensions/README.md b/resource-manager/compute/2022-03-01/virtualmachineextensions/README.md index de25adefe2e..fbacfbbde67 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensions/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachineextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") read, err := client.Get(ctx, id, virtualmachineextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtensionUpdate{ // ... diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensions/id_extension.go b/resource-manager/compute/2022-03-01/virtualmachineextensions/id_extension.go index 25ce4dd99cf..72168cd7ce0 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensions/id_extension.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensions/id_extension.go @@ -123,7 +123,7 @@ func (id ExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensions/id_extension_test.go b/resource-manager/compute/2022-03-01/virtualmachineextensions/id_extension_test.go index 6727e3b6c90..29ca0c38d57 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensions/id_extension_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensions/id_extension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExtensionId{} func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") + id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName" + actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineName: "vIrTuAlMaChInEnAmE", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2022-03-01/virtualmachineextensions/model_keyvaultsecretreference.go index e65598f8f2e..ba308b046a4 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2022-03-01/virtualmachineextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachineextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/README.md b/resource-manager/compute/2022-03-01/virtualmachineimages/README.md index 3ed477f205f..56f762bddd7 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") read, err := client.EdgeZoneGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") +id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") read, err := client.EdgeZoneList(ctx, id, virtualmachineimages.DefaultEdgeZoneListOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") +id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") read, err := client.EdgeZoneListOffers(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") read, err := client.EdgeZoneListPublishers(ctx, id) if err != nil { @@ -88,7 +88,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") +id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") read, err := client.EdgeZoneListSkus(ctx, id) if err != nil { @@ -104,7 +104,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") +id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") read, err := client.List(ctx, id, virtualmachineimages.DefaultListOperationOptions()) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") // alternatively `client.ListByEdgeZone(ctx, id)` can be used to do batched pagination items, err := client.ListByEdgeZoneComplete(ctx, id) @@ -153,7 +153,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListOffers(ctx, id) if err != nil { @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListPublishers(ctx, id) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") +id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") read, err := client.ListSkus(ctx, id) if err != nil { diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezone.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezone.go index 9decb1ab074..4589fd49c69 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezone.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezone.go @@ -113,9 +113,9 @@ func (id EdgeZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezone_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezone_test.go index 72468a3951b..179025c0a66 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezone_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezone_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &EdgeZoneId{} func TestNewEdgeZoneID(t *testing.T) { - id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") + id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } } func TestFormatEdgeZoneID(t *testing.T) { - actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone" + actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseEdgeZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseEdgeZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezonepublisher.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezonepublisher.go index 270c659bca7..413b714876a 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezonepublisher.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezonepublisher.go @@ -119,9 +119,9 @@ func (id EdgeZonePublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezonepublisher_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezonepublisher_test.go index 0c39297640c..481cc03e568 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezonepublisher_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_edgezonepublisher_test.go @@ -12,18 +12,18 @@ import ( var _ resourceids.ResourceId = &EdgeZonePublisherId{} func TestNewEdgeZonePublisherID(t *testing.T) { - id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") + id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewEdgeZonePublisherID(t *testing.T) { } func TestFormatEdgeZonePublisherID(t *testing.T) { - actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName" + actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseEdgeZonePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseEdgeZonePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_location.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_location.go index 964d6fa45df..bc87fc5d8b3 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_location.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_location_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_location_test.go index 6c81492a53e..ba21e1bba3c 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_location_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offer.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offer.go index 0c2104719a1..555733f938b 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offer.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offer.go @@ -119,13 +119,13 @@ func (id OfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offer_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offer_test.go index da5ed77df1d..20ee9d771ba 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offer_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offer_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &OfferId{} func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") + id := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offersku.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offersku.go index 4a79b9d3b5e..616277032de 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offersku.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offersku.go @@ -131,17 +131,17 @@ func (id OfferSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offersku_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offersku_test.go index 67473168400..b580e4c3fca 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offersku_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offersku_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &OfferSkuId{} func TestNewOfferSkuID(t *testing.T) { - id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") + id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatOfferSkuID(t *testing.T) { - actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseOfferSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseOfferSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offerskuversion.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offerskuversion.go index 7dbff8871b4..c6d89f817f3 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offerskuversion.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offerskuversion.go @@ -137,19 +137,19 @@ func (id OfferSkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offerskuversion_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offerskuversion_test.go index d60eae3c964..e8bc8c4c903 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_offerskuversion_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_offerskuversion_test.go @@ -12,40 +12,40 @@ import ( var _ resourceids.ResourceId = &OfferSkuVersionId{} func TestNewOfferSkuVersionID(t *testing.T) { - id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") + id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatOfferSkuVersionID(t *testing.T) { - actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -89,80 +89,80 @@ func TestParseOfferSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -275,158 +275,158 @@ func TestParseOfferSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_publisher.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_publisher.go index f33e882af34..732498f2f76 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_publisher.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_publisher_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_publisher_test.go index 441a6a32c0b..320e179981f 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_publisher_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_sku.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_sku.go index e8d0dddeaac..86196817181 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_sku.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_sku.go @@ -125,15 +125,15 @@ func (id SkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_sku_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_sku_test.go index 0123383d4f7..7148e671250 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_sku_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_sku_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &SkuId{} func TestNewSkuID(t *testing.T) { - id := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") + id := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatSkuID(t *testing.T) { - actual := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_skuversion.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_skuversion.go index 94cefe0168e..e6327d8297c 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_skuversion.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_skuversion.go @@ -131,17 +131,17 @@ func (id SkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_skuversion_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_skuversion_test.go index 153eee929c4..71033afa5fe 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_skuversion_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_skuversion_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &SkuVersionId{} func TestNewSkuVersionID(t *testing.T) { - id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") + id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatSkuVersionID(t *testing.T) { - actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_vmimageoffer.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_vmimageoffer.go index 1d8939e1fdb..2739d80c546 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_vmimageoffer.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_vmimageoffer.go @@ -125,15 +125,15 @@ func (id VMImageOfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineimages/id_vmimageoffer_test.go b/resource-manager/compute/2022-03-01/virtualmachineimages/id_vmimageoffer_test.go index 7cef7cc7c1e..1ecef60694e 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineimages/id_vmimageoffer_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineimages/id_vmimageoffer_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VMImageOfferId{} func TestNewVMImageOfferID(t *testing.T) { - id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") + id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatVMImageOfferID(t *testing.T) { - actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVMImageOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVMImageOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineruncommands/README.md b/resource-manager/compute/2022-03-01/virtualmachineruncommands/README.md index c6810348e4d..40aeec7e044 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineruncommands/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachineruncommands/README.md @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") +id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") read, err := client.Get(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_location.go b/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_location.go index d8733d6665f..f23f00fe4e6 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_location.go +++ b/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_location_test.go b/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_location_test.go index 83d1e4c6807..a2db8720398 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_location_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_runcommand.go b/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_runcommand.go index 6781693a76f..64a8edf61a9 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_runcommand.go +++ b/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_runcommand.go @@ -113,7 +113,7 @@ func (id RunCommandId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRunCommands", "runCommands", "runCommands"), resourceids.UserSpecifiedSegment("commandId", "commandId"), } diff --git a/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_runcommand_test.go b/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_runcommand_test.go index e45ff7998e6..edd76a46cda 100644 --- a/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_runcommand_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachineruncommands/id_runcommand_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RunCommandId{} func TestNewRunCommandID(t *testing.T) { - id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") + id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.CommandId != "commandId" { @@ -28,8 +28,8 @@ func TestNewRunCommandID(t *testing.T) { } func TestFormatRunCommandID(t *testing.T) { - actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId" + actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRunCommandID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRunCommandIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", CommandId: "cOmMaNdId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachines/README.md b/resource-manager/compute/2022-03-01/virtualmachines/README.md index 660d3b27b55..6ba0005443b 100644 --- a/resource-manager/compute/2022-03-01/virtualmachines/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachines/README.md @@ -222,7 +222,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2022-03-01/virtualmachines/id_location.go b/resource-manager/compute/2022-03-01/virtualmachines/id_location.go index 5e0c32a8f32..64438c96c4f 100644 --- a/resource-manager/compute/2022-03-01/virtualmachines/id_location.go +++ b/resource-manager/compute/2022-03-01/virtualmachines/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachines/id_location_test.go b/resource-manager/compute/2022-03-01/virtualmachines/id_location_test.go index 05747f53916..08322a2d3e4 100644 --- a/resource-manager/compute/2022-03-01/virtualmachines/id_location_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachines/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachines/model_keyvaultkeyreference.go b/resource-manager/compute/2022-03-01/virtualmachines/model_keyvaultkeyreference.go index 438a0aef731..c50244524ea 100644 --- a/resource-manager/compute/2022-03-01/virtualmachines/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2022-03-01/virtualmachines/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachines/model_keyvaultsecretreference.go b/resource-manager/compute/2022-03-01/virtualmachines/model_keyvaultsecretreference.go index c9fcd8ae2b8..b739f603f31 100644 --- a/resource-manager/compute/2022-03-01/virtualmachines/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2022-03-01/virtualmachines/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachines/model_vaultcertificate.go b/resource-manager/compute/2022-03-01/virtualmachines/model_vaultcertificate.go index 5331305fb8f..73f8924cdde 100644 --- a/resource-manager/compute/2022-03-01/virtualmachines/model_vaultcertificate.go +++ b/resource-manager/compute/2022-03-01/virtualmachines/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachines type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachines/model_winrmlistener.go b/resource-manager/compute/2022-03-01/virtualmachines/model_winrmlistener.go index e2a07b49f36..30b38d846e4 100644 --- a/resource-manager/compute/2022-03-01/virtualmachines/model_winrmlistener.go +++ b/resource-manager/compute/2022-03-01/virtualmachines/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/README.md b/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/README.md index d8c2489acf2..4efc97eee1b 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetextensions.DefaultGetOperationOptions()) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtensionUpdate{ // ... diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go index e5f4dfee0c5..371728a2982 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go @@ -123,7 +123,7 @@ func (id VirtualMachineScaleSetExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmssExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go index 970622d627b..41e7a35c801 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineScaleSetExtensionId{} func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { - id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") + id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.ExtensionName != "vmssExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmssExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineScaleSetExtensionID(t *testing.T) { - actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName" + actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineScaleSetExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineScaleSetExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - ExtensionName: "vMsSeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go index f025c1653d7..31af12dcf1e 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesets/README.md b/resource-manager/compute/2022-03-01/virtualmachinescalesets/README.md index 95aa85c384e..176c8fa2862 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesets/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesets/README.md @@ -208,7 +208,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesets/id_location.go b/resource-manager/compute/2022-03-01/virtualmachinescalesets/id_location.go index 2ecdd131193..1e550001f84 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesets/id_location.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesets/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesets/id_location_test.go b/resource-manager/compute/2022-03-01/virtualmachinescalesets/id_location_test.go index 58dbcd4eaab..f01c16a7142 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesets/id_location_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesets/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go b/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go index 5443aa3fb42..c27479d1430 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_vaultcertificate.go b/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_vaultcertificate.go index 87cebefa156..4e9173b39e6 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_vaultcertificate.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesets type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_winrmlistener.go b/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_winrmlistener.go index 4f07c2d4e68..fbaee700c4e 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_winrmlistener.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesets/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/README.md b/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/README.md index 4f338126bdb..2b19040a344 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetvmextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtensionUpdate{ // ... diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go index af92bc251a2..52f7976168f 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go @@ -131,7 +131,7 @@ func (id VirtualMachineExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go index 2f015fd2e0e..fb282110d45 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineExtensionId{} func TestNewVirtualMachineExtensionID(t *testing.T) { - id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") + id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewVirtualMachineExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'InstanceId'", id.InstanceId, "instanceId") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineExtensionID(t *testing.T) { - actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName" + actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseVirtualMachineExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseVirtualMachineExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", InstanceId: "iNsTaNcEiD", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go index 10e945e8ff7..b94a17b7d3d 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvmextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go index 831baeaa8f3..641c4d6cecc 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go index e0e510549a1..102c8c99c7f 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_vaultcertificate.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_vaultcertificate.go index ed0fd87a8a3..2ed3161f67c 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_vaultcertificate.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesetvms type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_winrmlistener.go b/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_winrmlistener.go index 7b8e4ea9a3b..59cdd2f5c0b 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_winrmlistener.go +++ b/resource-manager/compute/2022-03-01/virtualmachinescalesetvms/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2022-03-01/virtualmachinesizes/README.md b/resource-manager/compute/2022-03-01/virtualmachinesizes/README.md index b9b0cd74dab..326607704a7 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinesizes/README.md +++ b/resource-manager/compute/2022-03-01/virtualmachinesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/compute/2022-03-01/virtualmachinesizes/id_location.go b/resource-manager/compute/2022-03-01/virtualmachinesizes/id_location.go index c3d426ecfb0..f36bb369b8b 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinesizes/id_location.go +++ b/resource-manager/compute/2022-03-01/virtualmachinesizes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2022-03-01/virtualmachinesizes/id_location_test.go b/resource-manager/compute/2022-03-01/virtualmachinesizes/id_location_test.go index 1507b0f8398..e60ddc571cb 100644 --- a/resource-manager/compute/2022-03-01/virtualmachinesizes/id_location_test.go +++ b/resource-manager/compute/2022-03-01/virtualmachinesizes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-02/diskencryptionsets/model_keyfordiskencryptionset.go b/resource-manager/compute/2022-03-02/diskencryptionsets/model_keyfordiskencryptionset.go index bfc2790b580..2993bffc506 100644 --- a/resource-manager/compute/2022-03-02/diskencryptionsets/model_keyfordiskencryptionset.go +++ b/resource-manager/compute/2022-03-02/diskencryptionsets/model_keyfordiskencryptionset.go @@ -4,6 +4,6 @@ package diskencryptionsets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyForDiskEncryptionSet struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault *SourceVault `json:"sourceVault,omitempty"` } diff --git a/resource-manager/compute/2022-03-02/disks/model_keyvaultandkeyreference.go b/resource-manager/compute/2022-03-02/disks/model_keyvaultandkeyreference.go index 3e61fe32839..c86fc45080b 100644 --- a/resource-manager/compute/2022-03-02/disks/model_keyvaultandkeyreference.go +++ b/resource-manager/compute/2022-03-02/disks/model_keyvaultandkeyreference.go @@ -4,6 +4,6 @@ package disks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultAndKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SourceVault `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-02/disks/model_keyvaultandsecretreference.go b/resource-manager/compute/2022-03-02/disks/model_keyvaultandsecretreference.go index 714cd7c20b7..b239f3e21e5 100644 --- a/resource-manager/compute/2022-03-02/disks/model_keyvaultandsecretreference.go +++ b/resource-manager/compute/2022-03-02/disks/model_keyvaultandsecretreference.go @@ -4,6 +4,6 @@ package disks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultAndSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SourceVault `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-02/incrementalrestorepoints/README.md b/resource-manager/compute/2022-03-02/incrementalrestorepoints/README.md index 87a03516a27..0e14efc364a 100644 --- a/resource-manager/compute/2022-03-02/incrementalrestorepoints/README.md +++ b/resource-manager/compute/2022-03-02/incrementalrestorepoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName") +id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName") read, err := client.DiskRestorePointGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName") +id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName") payload := incrementalrestorepoints.GrantAccessData{ // ... @@ -57,7 +57,7 @@ if err := client.DiskRestorePointGrantAccessThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := incrementalrestorepoints.NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName") +id := incrementalrestorepoints.NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName") // alternatively `client.DiskRestorePointListByRestorePoint(ctx, id)` can be used to do batched pagination items, err := client.DiskRestorePointListByRestorePointComplete(ctx, id) @@ -74,7 +74,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName") +id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName") if err := client.DiskRestorePointRevokeAccessThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_diskrestorepoint.go b/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_diskrestorepoint.go index 23524d3a453..0d840cfe6da 100644 --- a/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_diskrestorepoint.go +++ b/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_diskrestorepoint.go @@ -129,7 +129,7 @@ func (id DiskRestorePointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRestorePointCollections", "restorePointCollections", "restorePointCollections"), resourceids.UserSpecifiedSegment("restorePointCollectionName", "restorePointCollectionName"), resourceids.StaticSegment("staticRestorePoints", "restorePoints", "restorePoints"), - resourceids.UserSpecifiedSegment("restorePointName", "vmRestorePointName"), + resourceids.UserSpecifiedSegment("restorePointName", "restorePointName"), resourceids.StaticSegment("staticDiskRestorePoints", "diskRestorePoints", "diskRestorePoints"), resourceids.UserSpecifiedSegment("diskRestorePointName", "diskRestorePointName"), } diff --git a/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_diskrestorepoint_test.go b/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_diskrestorepoint_test.go index c64312b1967..13173781996 100644 --- a/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_diskrestorepoint_test.go +++ b/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_diskrestorepoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiskRestorePointId{} func TestNewDiskRestorePointID(t *testing.T) { - id := NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName") + id := NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDiskRestorePointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RestorePointCollectionName'", id.RestorePointCollectionName, "restorePointCollectionName") } - if id.RestorePointName != "vmRestorePointName" { - t.Fatalf("Expected %q but got %q for Segment 'RestorePointName'", id.RestorePointName, "vmRestorePointName") + if id.RestorePointName != "restorePointName" { + t.Fatalf("Expected %q but got %q for Segment 'RestorePointName'", id.RestorePointName, "restorePointName") } if id.DiskRestorePointName != "diskRestorePointName" { @@ -36,8 +36,8 @@ func TestNewDiskRestorePointID(t *testing.T) { } func TestFormatDiskRestorePointID(t *testing.T) { - actual := NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName" + actual := NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDiskRestorePointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName", Expected: &DiskRestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RestorePointCollectionName: "restorePointCollectionName", - RestorePointName: "vmRestorePointName", + RestorePointName: "restorePointName", DiskRestorePointName: "diskRestorePointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDiskRestorePointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE/dIsKrEsToRePoInTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE/dIsKrEsToRePoInTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName", Expected: &DiskRestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RestorePointCollectionName: "restorePointCollectionName", - RestorePointName: "vmRestorePointName", + RestorePointName: "restorePointName", DiskRestorePointName: "diskRestorePointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE/dIsKrEsToRePoInTs/dIsKrEsToRePoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE/dIsKrEsToRePoInTs/dIsKrEsToRePoInTnAmE", Expected: &DiskRestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RestorePointCollectionName: "rEsToRePoInTcOlLeCtIoNnAmE", - RestorePointName: "vMrEsToRePoInTnAmE", + RestorePointName: "rEsToRePoInTnAmE", DiskRestorePointName: "dIsKrEsToRePoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE/dIsKrEsToRePoInTs/dIsKrEsToRePoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE/dIsKrEsToRePoInTs/dIsKrEsToRePoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_restorepoint.go b/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_restorepoint.go index 608e63ead36..a6558c72cec 100644 --- a/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_restorepoint.go +++ b/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_restorepoint.go @@ -123,7 +123,7 @@ func (id RestorePointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRestorePointCollections", "restorePointCollections", "restorePointCollections"), resourceids.UserSpecifiedSegment("restorePointCollectionName", "restorePointCollectionName"), resourceids.StaticSegment("staticRestorePoints", "restorePoints", "restorePoints"), - resourceids.UserSpecifiedSegment("restorePointName", "vmRestorePointName"), + resourceids.UserSpecifiedSegment("restorePointName", "restorePointName"), } } diff --git a/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_restorepoint_test.go b/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_restorepoint_test.go index 0e98acc8e3b..5da7923ea8a 100644 --- a/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_restorepoint_test.go +++ b/resource-manager/compute/2022-03-02/incrementalrestorepoints/id_restorepoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RestorePointId{} func TestNewRestorePointID(t *testing.T) { - id := NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName") + id := NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRestorePointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RestorePointCollectionName'", id.RestorePointCollectionName, "restorePointCollectionName") } - if id.RestorePointName != "vmRestorePointName" { - t.Fatalf("Expected %q but got %q for Segment 'RestorePointName'", id.RestorePointName, "vmRestorePointName") + if id.RestorePointName != "restorePointName" { + t.Fatalf("Expected %q but got %q for Segment 'RestorePointName'", id.RestorePointName, "restorePointName") } } func TestFormatRestorePointID(t *testing.T) { - actual := NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName" + actual := NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRestorePointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName", Expected: &RestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RestorePointCollectionName: "restorePointCollectionName", - RestorePointName: "vmRestorePointName", + RestorePointName: "restorePointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRestorePointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName", Expected: &RestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RestorePointCollectionName: "restorePointCollectionName", - RestorePointName: "vmRestorePointName", + RestorePointName: "restorePointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE", Expected: &RestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RestorePointCollectionName: "rEsToRePoInTcOlLeCtIoNnAmE", - RestorePointName: "vMrEsToRePoInTnAmE", + RestorePointName: "rEsToRePoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-02/snapshots/model_keyvaultandkeyreference.go b/resource-manager/compute/2022-03-02/snapshots/model_keyvaultandkeyreference.go index f3f50f3491f..75cfb7991fa 100644 --- a/resource-manager/compute/2022-03-02/snapshots/model_keyvaultandkeyreference.go +++ b/resource-manager/compute/2022-03-02/snapshots/model_keyvaultandkeyreference.go @@ -4,6 +4,6 @@ package snapshots // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultAndKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SourceVault `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-02/snapshots/model_keyvaultandsecretreference.go b/resource-manager/compute/2022-03-02/snapshots/model_keyvaultandsecretreference.go index 81a108c40ca..517ea340388 100644 --- a/resource-manager/compute/2022-03-02/snapshots/model_keyvaultandsecretreference.go +++ b/resource-manager/compute/2022-03-02/snapshots/model_keyvaultandsecretreference.go @@ -4,6 +4,6 @@ package snapshots // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultAndSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SourceVault `json:"sourceVault"` } diff --git a/resource-manager/compute/2022-03-03/communitygalleries/README.md b/resource-manager/compute/2022-03-03/communitygalleries/README.md index ca4cb07f347..00d10ad3785 100644 --- a/resource-manager/compute/2022-03-03/communitygalleries/README.md +++ b/resource-manager/compute/2022-03-03/communitygalleries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleries.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") +id := communitygalleries.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/compute/2022-03-03/communitygalleries/id_communitygallery.go b/resource-manager/compute/2022-03-03/communitygalleries/id_communitygallery.go index 3d8672e9b69..d77b8b52d53 100644 --- a/resource-manager/compute/2022-03-03/communitygalleries/id_communitygallery.go +++ b/resource-manager/compute/2022-03-03/communitygalleries/id_communitygallery.go @@ -113,9 +113,9 @@ func (id CommunityGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), } } diff --git a/resource-manager/compute/2022-03-03/communitygalleries/id_communitygallery_test.go b/resource-manager/compute/2022-03-03/communitygalleries/id_communitygallery_test.go index d1b0b1c05db..325bcd4400d 100644 --- a/resource-manager/compute/2022-03-03/communitygalleries/id_communitygallery_test.go +++ b/resource-manager/compute/2022-03-03/communitygalleries/id_communitygallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryId{} func TestNewCommunityGalleryID(t *testing.T) { - id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") + id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } } func TestFormatCommunityGalleryID(t *testing.T) { - actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName" + actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseCommunityGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseCommunityGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/communitygalleryimages/README.md b/resource-manager/compute/2022-03-03/communitygalleryimages/README.md index 76b0cb60964..9f371546c6d 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimages/README.md +++ b/resource-manager/compute/2022-03-03/communitygalleryimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleryimages.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") +id := communitygalleryimages.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := communitygalleryimages.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") +id := communitygalleryimages.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygallery.go b/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygallery.go index 73185f5641d..f2d1c4611a5 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygallery.go +++ b/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygallery.go @@ -113,9 +113,9 @@ func (id CommunityGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), } } diff --git a/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygallery_test.go b/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygallery_test.go index 92d3f3a8200..4670865f3e1 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygallery_test.go +++ b/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryId{} func TestNewCommunityGalleryID(t *testing.T) { - id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") + id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } } func TestFormatCommunityGalleryID(t *testing.T) { - actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName" + actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseCommunityGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseCommunityGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygalleryimage.go b/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygalleryimage.go index af36bc3b0ab..e94cfc15022 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygalleryimage.go +++ b/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygalleryimage.go @@ -119,11 +119,11 @@ func (id CommunityGalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygalleryimage_test.go b/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygalleryimage_test.go index 269737a2b21..8e48672a727 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygalleryimage_test.go +++ b/resource-manager/compute/2022-03-03/communitygalleryimages/id_communitygalleryimage_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryImageId{} func TestNewCommunityGalleryImageID(t *testing.T) { - id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") + id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatCommunityGalleryImageID(t *testing.T) { - actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName" + actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseCommunityGalleryImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseCommunityGalleryImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/communitygalleryimageversions/README.md b/resource-manager/compute/2022-03-03/communitygalleryimageversions/README.md index ac5614337e9..b344ef3e2b4 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimageversions/README.md +++ b/resource-manager/compute/2022-03-03/communitygalleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleryimageversions.NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName") +id := communitygalleryimageversions.NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := communitygalleryimageversions.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") +id := communitygalleryimageversions.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimage.go b/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimage.go index 6e7a613b703..208959da87d 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimage.go +++ b/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimage.go @@ -119,11 +119,11 @@ func (id CommunityGalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimage_test.go b/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimage_test.go index 7b7ec63bc8e..83b69863a67 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimage_test.go +++ b/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimage_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryImageId{} func TestNewCommunityGalleryImageID(t *testing.T) { - id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") + id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatCommunityGalleryImageID(t *testing.T) { - actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName" + actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseCommunityGalleryImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseCommunityGalleryImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimageversion.go b/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimageversion.go index df7f451f227..1d726a30cbf 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimageversion.go +++ b/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimageversion.go @@ -125,13 +125,13 @@ func (id CommunityGalleryImageVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimageversion_test.go b/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimageversion_test.go index da73ee1270c..2f27f37d55e 100644 --- a/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimageversion_test.go +++ b/resource-manager/compute/2022-03-03/communitygalleryimageversions/id_communitygalleryimageversion_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryImageVersionId{} func TestNewCommunityGalleryImageVersionID(t *testing.T) { - id := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName") + id := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatCommunityGalleryImageVersionID(t *testing.T) { - actual := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName" + actual := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseCommunityGalleryImageVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseCommunityGalleryImageVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/galleryapplications/README.md b/resource-manager/compute/2022-03-03/galleryapplications/README.md index be9093723c3..2ba321fc314 100644 --- a/resource-manager/compute/2022-03-03/galleryapplications/README.md +++ b/resource-manager/compute/2022-03-03/galleryapplications/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") payload := galleryapplications.GalleryApplication{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") payload := galleryapplications.GalleryApplicationUpdate{ // ... diff --git a/resource-manager/compute/2022-03-03/galleryapplications/id_application.go b/resource-manager/compute/2022-03-03/galleryapplications/id_application.go index 865683cdda7..5b6ff82bf5b 100644 --- a/resource-manager/compute/2022-03-03/galleryapplications/id_application.go +++ b/resource-manager/compute/2022-03-03/galleryapplications/id_application.go @@ -123,7 +123,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } } diff --git a/resource-manager/compute/2022-03-03/galleryapplications/id_application_test.go b/resource-manager/compute/2022-03-03/galleryapplications/id_application_test.go index 9b358fec0af..6fbd0d8f746 100644 --- a/resource-manager/compute/2022-03-03/galleryapplications/id_application_test.go +++ b/resource-manager/compute/2022-03-03/galleryapplications/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", + ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/galleryapplicationversions/README.md b/resource-manager/compute/2022-03-03/galleryapplicationversions/README.md index 3c603b88dbd..b67175954b0 100644 --- a/resource-manager/compute/2022-03-03/galleryapplicationversions/README.md +++ b/resource-manager/compute/2022-03-03/galleryapplicationversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") payload := galleryapplicationversions.GalleryApplicationVersion{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") read, err := client.Get(ctx, id, galleryapplicationversions.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplicationversions.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") // alternatively `client.ListByGalleryApplication(ctx, id)` can be used to do batched pagination items, err := client.ListByGalleryApplicationComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") payload := galleryapplicationversions.GalleryApplicationVersionUpdate{ // ... diff --git a/resource-manager/compute/2022-03-03/galleryapplicationversions/id_application.go b/resource-manager/compute/2022-03-03/galleryapplicationversions/id_application.go index 08704b1b91f..56d6741ec00 100644 --- a/resource-manager/compute/2022-03-03/galleryapplicationversions/id_application.go +++ b/resource-manager/compute/2022-03-03/galleryapplicationversions/id_application.go @@ -123,7 +123,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } } diff --git a/resource-manager/compute/2022-03-03/galleryapplicationversions/id_application_test.go b/resource-manager/compute/2022-03-03/galleryapplicationversions/id_application_test.go index 02a985fc8a8..da5f9c61e9d 100644 --- a/resource-manager/compute/2022-03-03/galleryapplicationversions/id_application_test.go +++ b/resource-manager/compute/2022-03-03/galleryapplicationversions/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", + ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/galleryapplicationversions/id_applicationversion.go b/resource-manager/compute/2022-03-03/galleryapplicationversions/id_applicationversion.go index 545d234622c..7042840fc6e 100644 --- a/resource-manager/compute/2022-03-03/galleryapplicationversions/id_applicationversion.go +++ b/resource-manager/compute/2022-03-03/galleryapplicationversions/id_applicationversion.go @@ -129,9 +129,9 @@ func (id ApplicationVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryApplicationVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2022-03-03/galleryapplicationversions/id_applicationversion_test.go b/resource-manager/compute/2022-03-03/galleryapplicationversions/id_applicationversion_test.go index cbfc5e4c037..d1a837bdbda 100644 --- a/resource-manager/compute/2022-03-03/galleryapplicationversions/id_applicationversion_test.go +++ b/resource-manager/compute/2022-03-03/galleryapplicationversions/id_applicationversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationVersionId{} func TestNewApplicationVersionID(t *testing.T) { - id := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") + id := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewApplicationVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } - if id.VersionName != "galleryApplicationVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryApplicationVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatApplicationVersionID(t *testing.T) { - actual := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName" + actual := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseApplicationVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", - VersionName: "galleryApplicationVersionName", + ApplicationName: "applicationName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseApplicationVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", - VersionName: "galleryApplicationVersionName", + ApplicationName: "applicationName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS/gAlLeRyApPlIcAtIoNvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", - VersionName: "gAlLeRyApPlIcAtIoNvErSiOnNaMe", + ApplicationName: "aPpLiCaTiOnNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS/gAlLeRyApPlIcAtIoNvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/galleryimages/README.md b/resource-manager/compute/2022-03-03/galleryimages/README.md index feb57361f17..ed01c8aae55 100644 --- a/resource-manager/compute/2022-03-03/galleryimages/README.md +++ b/resource-manager/compute/2022-03-03/galleryimages/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") payload := galleryimages.GalleryImage{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") payload := galleryimages.GalleryImageUpdate{ // ... diff --git a/resource-manager/compute/2022-03-03/galleryimages/id_galleryimage.go b/resource-manager/compute/2022-03-03/galleryimages/id_galleryimage.go index 5883023f463..dd4c61adfae 100644 --- a/resource-manager/compute/2022-03-03/galleryimages/id_galleryimage.go +++ b/resource-manager/compute/2022-03-03/galleryimages/id_galleryimage.go @@ -123,7 +123,7 @@ func (id GalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2022-03-03/galleryimages/id_galleryimage_test.go b/resource-manager/compute/2022-03-03/galleryimages/id_galleryimage_test.go index 913b82acd35..8c77e84e750 100644 --- a/resource-manager/compute/2022-03-03/galleryimages/id_galleryimage_test.go +++ b/resource-manager/compute/2022-03-03/galleryimages/id_galleryimage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GalleryImageId{} func TestNewGalleryImageID(t *testing.T) { - id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") + id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGalleryImageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatGalleryImageID(t *testing.T) { - actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName" + actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseGalleryImageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseGalleryImageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/galleryimageversions/README.md b/resource-manager/compute/2022-03-03/galleryimageversions/README.md index a5951ef97de..0642f20a5d5 100644 --- a/resource-manager/compute/2022-03-03/galleryimageversions/README.md +++ b/resource-manager/compute/2022-03-03/galleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") payload := galleryimageversions.GalleryImageVersion{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") read, err := client.Get(ctx, id, galleryimageversions.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimageversions.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") // alternatively `client.ListByGalleryImage(ctx, id)` can be used to do batched pagination items, err := client.ListByGalleryImageComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") payload := galleryimageversions.GalleryImageVersionUpdate{ // ... diff --git a/resource-manager/compute/2022-03-03/galleryimageversions/id_galleryimage.go b/resource-manager/compute/2022-03-03/galleryimageversions/id_galleryimage.go index fdcea2d752b..0d1f7d19f12 100644 --- a/resource-manager/compute/2022-03-03/galleryimageversions/id_galleryimage.go +++ b/resource-manager/compute/2022-03-03/galleryimageversions/id_galleryimage.go @@ -123,7 +123,7 @@ func (id GalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2022-03-03/galleryimageversions/id_galleryimage_test.go b/resource-manager/compute/2022-03-03/galleryimageversions/id_galleryimage_test.go index b7cd98a82ee..d2791250c5b 100644 --- a/resource-manager/compute/2022-03-03/galleryimageversions/id_galleryimage_test.go +++ b/resource-manager/compute/2022-03-03/galleryimageversions/id_galleryimage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GalleryImageId{} func TestNewGalleryImageID(t *testing.T) { - id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") + id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGalleryImageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatGalleryImageID(t *testing.T) { - actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName" + actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseGalleryImageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseGalleryImageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/galleryimageversions/id_imageversion.go b/resource-manager/compute/2022-03-03/galleryimageversions/id_imageversion.go index d6252874c0c..2dbe8fa6f7a 100644 --- a/resource-manager/compute/2022-03-03/galleryimageversions/id_imageversion.go +++ b/resource-manager/compute/2022-03-03/galleryimageversions/id_imageversion.go @@ -129,9 +129,9 @@ func (id ImageVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2022-03-03/galleryimageversions/id_imageversion_test.go b/resource-manager/compute/2022-03-03/galleryimageversions/id_imageversion_test.go index 7a2f370f771..82bd3808fc3 100644 --- a/resource-manager/compute/2022-03-03/galleryimageversions/id_imageversion_test.go +++ b/resource-manager/compute/2022-03-03/galleryimageversions/id_imageversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ImageVersionId{} func TestNewImageVersionID(t *testing.T) { - id := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") + id := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewImageVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatImageVersionID(t *testing.T) { - actual := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName" + actual := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseImageVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName", Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseImageVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName", Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/sharedgalleries/README.md b/resource-manager/compute/2022-03-03/sharedgalleries/README.md index 2544fc4eacf..65552920cc2 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleries/README.md +++ b/resource-manager/compute/2022-03-03/sharedgalleries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleries.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") +id := sharedgalleries.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleries.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := sharedgalleries.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id, sharedgalleries.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleries.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2022-03-03/sharedgalleries/id_location.go b/resource-manager/compute/2022-03-03/sharedgalleries/id_location.go index a02aeee9e82..a2b72e84cfb 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleries/id_location.go +++ b/resource-manager/compute/2022-03-03/sharedgalleries/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2022-03-03/sharedgalleries/id_location_test.go b/resource-manager/compute/2022-03-03/sharedgalleries/id_location_test.go index 4e4d0a54829..7e29e53bdc5 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleries/id_location_test.go +++ b/resource-manager/compute/2022-03-03/sharedgalleries/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/sharedgalleries/id_sharedgallery.go b/resource-manager/compute/2022-03-03/sharedgalleries/id_sharedgallery.go index 4622271e542..49ee6bb93ea 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleries/id_sharedgallery.go +++ b/resource-manager/compute/2022-03-03/sharedgalleries/id_sharedgallery.go @@ -113,9 +113,9 @@ func (id SharedGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), } } diff --git a/resource-manager/compute/2022-03-03/sharedgalleries/id_sharedgallery_test.go b/resource-manager/compute/2022-03-03/sharedgalleries/id_sharedgallery_test.go index 4b82c4b049a..f70f26dfd8f 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleries/id_sharedgallery_test.go +++ b/resource-manager/compute/2022-03-03/sharedgalleries/id_sharedgallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &SharedGalleryId{} func TestNewSharedGalleryID(t *testing.T) { - id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") + id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } } func TestFormatSharedGalleryID(t *testing.T) { - actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName" + actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseSharedGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseSharedGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimages/README.md b/resource-manager/compute/2022-03-03/sharedgalleryimages/README.md index 4f7a3e2c3cf..adad75c3dad 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimages/README.md +++ b/resource-manager/compute/2022-03-03/sharedgalleryimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleryimages.NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") +id := sharedgalleryimages.NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleryimages.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") +id := sharedgalleryimages.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") // alternatively `client.List(ctx, id, sharedgalleryimages.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleryimages.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimages/id_image.go b/resource-manager/compute/2022-03-03/sharedgalleryimages/id_image.go index 42c59630ae7..55c3ed65914 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimages/id_image.go +++ b/resource-manager/compute/2022-03-03/sharedgalleryimages/id_image.go @@ -119,11 +119,11 @@ func (id ImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimages/id_image_test.go b/resource-manager/compute/2022-03-03/sharedgalleryimages/id_image_test.go index a3a7a10a7e4..36e20cd4d23 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimages/id_image_test.go +++ b/resource-manager/compute/2022-03-03/sharedgalleryimages/id_image_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ImageId{} func TestNewImageID(t *testing.T) { - id := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") + id := NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatImageID(t *testing.T) { - actual := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName" + actual := NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimages/id_sharedgallery.go b/resource-manager/compute/2022-03-03/sharedgalleryimages/id_sharedgallery.go index a458b9a6ca0..be4499dac00 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimages/id_sharedgallery.go +++ b/resource-manager/compute/2022-03-03/sharedgalleryimages/id_sharedgallery.go @@ -113,9 +113,9 @@ func (id SharedGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), } } diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimages/id_sharedgallery_test.go b/resource-manager/compute/2022-03-03/sharedgalleryimages/id_sharedgallery_test.go index 029a84562fd..78c44f7b95b 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimages/id_sharedgallery_test.go +++ b/resource-manager/compute/2022-03-03/sharedgalleryimages/id_sharedgallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &SharedGalleryId{} func TestNewSharedGalleryID(t *testing.T) { - id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") + id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } } func TestFormatSharedGalleryID(t *testing.T) { - actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName" + actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseSharedGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseSharedGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/README.md b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/README.md index 303421fae4a..2776c2728ad 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/README.md +++ b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleryimageversions.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName") +id := sharedgalleryimageversions.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleryimageversions.NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") +id := sharedgalleryimageversions.NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") // alternatively `client.List(ctx, id, sharedgalleryimageversions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleryimageversions.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_image.go b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_image.go index 6ebaa342691..03f60ef5cce 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_image.go +++ b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_image.go @@ -119,11 +119,11 @@ func (id ImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_image_test.go b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_image_test.go index 837e738dc05..b9102f3283e 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_image_test.go +++ b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_image_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ImageId{} func TestNewImageID(t *testing.T) { - id := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") + id := NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatImageID(t *testing.T) { - actual := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName" + actual := NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_version.go b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_version.go index b210c744459..b0f42c4f4a8 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_version.go +++ b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_version.go @@ -125,13 +125,13 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_version_test.go b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_version_test.go index d1353073c28..263d42276d9 100644 --- a/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_version_test.go +++ b/resource-manager/compute/2022-03-03/sharedgalleryimageversions/id_version_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/loganalytics/README.md b/resource-manager/compute/2023-03-01/loganalytics/README.md index 5d4263e2f88..26117516919 100644 --- a/resource-manager/compute/2023-03-01/loganalytics/README.md +++ b/resource-manager/compute/2023-03-01/loganalytics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.RequestRateByIntervalInput{ // ... @@ -41,7 +41,7 @@ if err := client.ExportRequestRateByIntervalThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.LogAnalyticsInputBase{ // ... diff --git a/resource-manager/compute/2023-03-01/loganalytics/id_location.go b/resource-manager/compute/2023-03-01/loganalytics/id_location.go index 017c4298e31..893525660f2 100644 --- a/resource-manager/compute/2023-03-01/loganalytics/id_location.go +++ b/resource-manager/compute/2023-03-01/loganalytics/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2023-03-01/loganalytics/id_location_test.go b/resource-manager/compute/2023-03-01/loganalytics/id_location_test.go index 9e2582fe064..76eb5c3f415 100644 --- a/resource-manager/compute/2023-03-01/loganalytics/id_location_test.go +++ b/resource-manager/compute/2023-03-01/loganalytics/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/restorepointcollections/model_keyvaultkeyreference.go b/resource-manager/compute/2023-03-01/restorepointcollections/model_keyvaultkeyreference.go index a58940dc601..e67b885cbec 100644 --- a/resource-manager/compute/2023-03-01/restorepointcollections/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2023-03-01/restorepointcollections/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/restorepointcollections/model_keyvaultsecretreference.go b/resource-manager/compute/2023-03-01/restorepointcollections/model_keyvaultsecretreference.go index 9cdda52320c..f403c9277b7 100644 --- a/resource-manager/compute/2023-03-01/restorepointcollections/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2023-03-01/restorepointcollections/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/restorepointcollections/model_vaultcertificate.go b/resource-manager/compute/2023-03-01/restorepointcollections/model_vaultcertificate.go index 1e6b6948da0..f3fd244ab96 100644 --- a/resource-manager/compute/2023-03-01/restorepointcollections/model_vaultcertificate.go +++ b/resource-manager/compute/2023-03-01/restorepointcollections/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepointcollections type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/restorepointcollections/model_winrmlistener.go b/resource-manager/compute/2023-03-01/restorepointcollections/model_winrmlistener.go index 48cee24a28f..3b6dcd5d775 100644 --- a/resource-manager/compute/2023-03-01/restorepointcollections/model_winrmlistener.go +++ b/resource-manager/compute/2023-03-01/restorepointcollections/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/restorepoints/model_keyvaultkeyreference.go b/resource-manager/compute/2023-03-01/restorepoints/model_keyvaultkeyreference.go index f91f103e171..a84afc6404c 100644 --- a/resource-manager/compute/2023-03-01/restorepoints/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2023-03-01/restorepoints/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/restorepoints/model_keyvaultsecretreference.go b/resource-manager/compute/2023-03-01/restorepoints/model_keyvaultsecretreference.go index 4482fc4dbcb..473adafc492 100644 --- a/resource-manager/compute/2023-03-01/restorepoints/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2023-03-01/restorepoints/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/restorepoints/model_vaultcertificate.go b/resource-manager/compute/2023-03-01/restorepoints/model_vaultcertificate.go index 077c7b0db1d..7ace154164b 100644 --- a/resource-manager/compute/2023-03-01/restorepoints/model_vaultcertificate.go +++ b/resource-manager/compute/2023-03-01/restorepoints/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepoints type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/restorepoints/model_winrmlistener.go b/resource-manager/compute/2023-03-01/restorepoints/model_winrmlistener.go index c9ff579e87e..7d06a9d1480 100644 --- a/resource-manager/compute/2023-03-01/restorepoints/model_winrmlistener.go +++ b/resource-manager/compute/2023-03-01/restorepoints/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/README.md b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/README.md index 9513f111f34..6a69aab0499 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") +id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListTypes(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") +id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") read, err := client.ListVersions(ctx, id, virtualmachineextensionimages.DefaultListVersionsOperationOptions()) if err != nil { diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_publisher.go b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_publisher.go index 26803cae70d..75185dcd3b3 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_publisher.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_publisher_test.go b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_publisher_test.go index a68baea12d2..a1107c02a89 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_publisher_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_type.go b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_type.go index b8d3341bc22..913ad5b4f1d 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_type.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_type.go @@ -119,7 +119,7 @@ func (id TypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_type_test.go b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_type_test.go index 82a20b50cdb..fdd8342e8e0 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_type_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_type_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TypeId{} func TestNewTypeID(t *testing.T) { - id := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") + id := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewTypeID(t *testing.T) { } func TestFormatTypeID(t *testing.T) { - actual := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName" + actual := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_version.go b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_version.go index 56bb407edd5..428dd802d6f 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_version.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_version.go @@ -125,7 +125,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), @@ -133,7 +133,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTypes", "types", "types"), resourceids.UserSpecifiedSegment("typeName", "typeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_version_test.go b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_version_test.go index de6f52198dc..9190aa87b20 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_version_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensionimages/id_version_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -30,14 +30,14 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TypeName'", id.TypeName, "typeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensions/README.md b/resource-manager/compute/2023-03-01/virtualmachineextensions/README.md index f489c918a4b..d71af89f528 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensions/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachineextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") read, err := client.Get(ctx, id, virtualmachineextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtensionUpdate{ // ... diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensions/id_extension.go b/resource-manager/compute/2023-03-01/virtualmachineextensions/id_extension.go index 25ce4dd99cf..72168cd7ce0 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensions/id_extension.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensions/id_extension.go @@ -123,7 +123,7 @@ func (id ExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensions/id_extension_test.go b/resource-manager/compute/2023-03-01/virtualmachineextensions/id_extension_test.go index 6727e3b6c90..29ca0c38d57 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensions/id_extension_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensions/id_extension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExtensionId{} func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") + id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName" + actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineName: "vIrTuAlMaChInEnAmE", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2023-03-01/virtualmachineextensions/model_keyvaultsecretreference.go index e65598f8f2e..ba308b046a4 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2023-03-01/virtualmachineextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachineextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/README.md b/resource-manager/compute/2023-03-01/virtualmachineimages/README.md index d0b146ea7cf..d1d2e605f6e 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") read, err := client.EdgeZoneGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") +id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") read, err := client.EdgeZoneList(ctx, id, virtualmachineimages.DefaultEdgeZoneListOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") +id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") read, err := client.EdgeZoneListOffers(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") read, err := client.EdgeZoneListPublishers(ctx, id) if err != nil { @@ -88,7 +88,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") +id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") read, err := client.EdgeZoneListSkus(ctx, id) if err != nil { @@ -104,7 +104,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") +id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") read, err := client.List(ctx, id, virtualmachineimages.DefaultListOperationOptions()) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") // alternatively `client.ListByEdgeZone(ctx, id)` can be used to do batched pagination items, err := client.ListByEdgeZoneComplete(ctx, id) @@ -153,7 +153,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListOffers(ctx, id) if err != nil { @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListPublishers(ctx, id) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") +id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") read, err := client.ListSkus(ctx, id) if err != nil { diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezone.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezone.go index 9decb1ab074..4589fd49c69 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezone.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezone.go @@ -113,9 +113,9 @@ func (id EdgeZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezone_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezone_test.go index 72468a3951b..179025c0a66 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezone_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezone_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &EdgeZoneId{} func TestNewEdgeZoneID(t *testing.T) { - id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") + id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } } func TestFormatEdgeZoneID(t *testing.T) { - actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone" + actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseEdgeZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseEdgeZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezonepublisher.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezonepublisher.go index 270c659bca7..413b714876a 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezonepublisher.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezonepublisher.go @@ -119,9 +119,9 @@ func (id EdgeZonePublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezonepublisher_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezonepublisher_test.go index 0c39297640c..481cc03e568 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezonepublisher_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_edgezonepublisher_test.go @@ -12,18 +12,18 @@ import ( var _ resourceids.ResourceId = &EdgeZonePublisherId{} func TestNewEdgeZonePublisherID(t *testing.T) { - id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") + id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewEdgeZonePublisherID(t *testing.T) { } func TestFormatEdgeZonePublisherID(t *testing.T) { - actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName" + actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseEdgeZonePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseEdgeZonePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_location.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_location.go index 964d6fa45df..bc87fc5d8b3 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_location.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_location_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_location_test.go index 6c81492a53e..ba21e1bba3c 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_location_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offer.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offer.go index 0c2104719a1..555733f938b 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offer.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offer.go @@ -119,13 +119,13 @@ func (id OfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offer_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offer_test.go index da5ed77df1d..20ee9d771ba 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offer_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offer_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &OfferId{} func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") + id := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offersku.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offersku.go index 4a79b9d3b5e..616277032de 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offersku.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offersku.go @@ -131,17 +131,17 @@ func (id OfferSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offersku_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offersku_test.go index 67473168400..b580e4c3fca 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offersku_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offersku_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &OfferSkuId{} func TestNewOfferSkuID(t *testing.T) { - id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") + id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatOfferSkuID(t *testing.T) { - actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseOfferSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseOfferSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offerskuversion.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offerskuversion.go index 7dbff8871b4..c6d89f817f3 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offerskuversion.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offerskuversion.go @@ -137,19 +137,19 @@ func (id OfferSkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offerskuversion_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offerskuversion_test.go index d60eae3c964..e8bc8c4c903 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_offerskuversion_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_offerskuversion_test.go @@ -12,40 +12,40 @@ import ( var _ resourceids.ResourceId = &OfferSkuVersionId{} func TestNewOfferSkuVersionID(t *testing.T) { - id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") + id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatOfferSkuVersionID(t *testing.T) { - actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -89,80 +89,80 @@ func TestParseOfferSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -275,158 +275,158 @@ func TestParseOfferSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_publisher.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_publisher.go index f33e882af34..732498f2f76 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_publisher.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_publisher_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_publisher_test.go index 441a6a32c0b..320e179981f 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_publisher_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_sku.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_sku.go index e8d0dddeaac..86196817181 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_sku.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_sku.go @@ -125,15 +125,15 @@ func (id SkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_sku_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_sku_test.go index 0123383d4f7..7148e671250 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_sku_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_sku_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &SkuId{} func TestNewSkuID(t *testing.T) { - id := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") + id := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatSkuID(t *testing.T) { - actual := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_skuversion.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_skuversion.go index 94cefe0168e..e6327d8297c 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_skuversion.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_skuversion.go @@ -131,17 +131,17 @@ func (id SkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_skuversion_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_skuversion_test.go index 153eee929c4..71033afa5fe 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_skuversion_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_skuversion_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &SkuVersionId{} func TestNewSkuVersionID(t *testing.T) { - id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") + id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatSkuVersionID(t *testing.T) { - actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_vmimageoffer.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_vmimageoffer.go index 1d8939e1fdb..2739d80c546 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_vmimageoffer.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_vmimageoffer.go @@ -125,15 +125,15 @@ func (id VMImageOfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineimages/id_vmimageoffer_test.go b/resource-manager/compute/2023-03-01/virtualmachineimages/id_vmimageoffer_test.go index 7cef7cc7c1e..1ecef60694e 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineimages/id_vmimageoffer_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineimages/id_vmimageoffer_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VMImageOfferId{} func TestNewVMImageOfferID(t *testing.T) { - id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") + id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatVMImageOfferID(t *testing.T) { - actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVMImageOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVMImageOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineruncommands/README.md b/resource-manager/compute/2023-03-01/virtualmachineruncommands/README.md index c060d567299..6c09b1487b4 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineruncommands/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachineruncommands/README.md @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") +id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") read, err := client.Get(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_location.go b/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_location.go index d8733d6665f..f23f00fe4e6 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_location.go +++ b/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_location_test.go b/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_location_test.go index 83d1e4c6807..a2db8720398 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_location_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_runcommand.go b/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_runcommand.go index 6781693a76f..64a8edf61a9 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_runcommand.go +++ b/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_runcommand.go @@ -113,7 +113,7 @@ func (id RunCommandId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRunCommands", "runCommands", "runCommands"), resourceids.UserSpecifiedSegment("commandId", "commandId"), } diff --git a/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_runcommand_test.go b/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_runcommand_test.go index e45ff7998e6..edd76a46cda 100644 --- a/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_runcommand_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachineruncommands/id_runcommand_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RunCommandId{} func TestNewRunCommandID(t *testing.T) { - id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") + id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.CommandId != "commandId" { @@ -28,8 +28,8 @@ func TestNewRunCommandID(t *testing.T) { } func TestFormatRunCommandID(t *testing.T) { - actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId" + actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRunCommandID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRunCommandIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", CommandId: "cOmMaNdId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachines/README.md b/resource-manager/compute/2023-03-01/virtualmachines/README.md index 6e5d550353c..084ec32a711 100644 --- a/resource-manager/compute/2023-03-01/virtualmachines/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachines/README.md @@ -222,7 +222,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2023-03-01/virtualmachines/id_location.go b/resource-manager/compute/2023-03-01/virtualmachines/id_location.go index 5e0c32a8f32..64438c96c4f 100644 --- a/resource-manager/compute/2023-03-01/virtualmachines/id_location.go +++ b/resource-manager/compute/2023-03-01/virtualmachines/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachines/id_location_test.go b/resource-manager/compute/2023-03-01/virtualmachines/id_location_test.go index 05747f53916..08322a2d3e4 100644 --- a/resource-manager/compute/2023-03-01/virtualmachines/id_location_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachines/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachines/model_keyvaultkeyreference.go b/resource-manager/compute/2023-03-01/virtualmachines/model_keyvaultkeyreference.go index 438a0aef731..c50244524ea 100644 --- a/resource-manager/compute/2023-03-01/virtualmachines/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2023-03-01/virtualmachines/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachines/model_keyvaultsecretreference.go b/resource-manager/compute/2023-03-01/virtualmachines/model_keyvaultsecretreference.go index c9fcd8ae2b8..b739f603f31 100644 --- a/resource-manager/compute/2023-03-01/virtualmachines/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2023-03-01/virtualmachines/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachines/model_vaultcertificate.go b/resource-manager/compute/2023-03-01/virtualmachines/model_vaultcertificate.go index 5331305fb8f..73f8924cdde 100644 --- a/resource-manager/compute/2023-03-01/virtualmachines/model_vaultcertificate.go +++ b/resource-manager/compute/2023-03-01/virtualmachines/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachines type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachines/model_winrmlistener.go b/resource-manager/compute/2023-03-01/virtualmachines/model_winrmlistener.go index e2a07b49f36..30b38d846e4 100644 --- a/resource-manager/compute/2023-03-01/virtualmachines/model_winrmlistener.go +++ b/resource-manager/compute/2023-03-01/virtualmachines/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/README.md b/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/README.md index 2e9d36ea247..b710cc3b112 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetextensions.DefaultGetOperationOptions()) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtensionUpdate{ // ... diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go index e5f4dfee0c5..371728a2982 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go @@ -123,7 +123,7 @@ func (id VirtualMachineScaleSetExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmssExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go index 970622d627b..41e7a35c801 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineScaleSetExtensionId{} func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { - id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") + id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.ExtensionName != "vmssExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmssExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineScaleSetExtensionID(t *testing.T) { - actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName" + actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineScaleSetExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineScaleSetExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - ExtensionName: "vMsSeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go index f025c1653d7..31af12dcf1e 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesets/README.md b/resource-manager/compute/2023-03-01/virtualmachinescalesets/README.md index 5ea30ef2209..3fd12d9f6c0 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesets/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesets/README.md @@ -208,7 +208,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesets/id_location.go b/resource-manager/compute/2023-03-01/virtualmachinescalesets/id_location.go index 2ecdd131193..1e550001f84 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesets/id_location.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesets/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesets/id_location_test.go b/resource-manager/compute/2023-03-01/virtualmachinescalesets/id_location_test.go index 58dbcd4eaab..f01c16a7142 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesets/id_location_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesets/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go b/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go index 5443aa3fb42..c27479d1430 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_vaultcertificate.go b/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_vaultcertificate.go index 87cebefa156..4e9173b39e6 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_vaultcertificate.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesets type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_winrmlistener.go b/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_winrmlistener.go index 4f07c2d4e68..fbaee700c4e 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_winrmlistener.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesets/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/README.md b/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/README.md index 88a2a99eda4..85c9bf5a725 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetvmextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtensionUpdate{ // ... diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go index af92bc251a2..52f7976168f 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go @@ -131,7 +131,7 @@ func (id VirtualMachineExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go index 2f015fd2e0e..fb282110d45 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineExtensionId{} func TestNewVirtualMachineExtensionID(t *testing.T) { - id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") + id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewVirtualMachineExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'InstanceId'", id.InstanceId, "instanceId") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineExtensionID(t *testing.T) { - actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName" + actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseVirtualMachineExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseVirtualMachineExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", InstanceId: "iNsTaNcEiD", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go index 10e945e8ff7..b94a17b7d3d 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvmextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go index 831baeaa8f3..641c4d6cecc 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go index e0e510549a1..102c8c99c7f 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_vaultcertificate.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_vaultcertificate.go index ed0fd87a8a3..2ed3161f67c 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_vaultcertificate.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesetvms type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_winrmlistener.go b/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_winrmlistener.go index 7b8e4ea9a3b..59cdd2f5c0b 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_winrmlistener.go +++ b/resource-manager/compute/2023-03-01/virtualmachinescalesetvms/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2023-03-01/virtualmachinesizes/README.md b/resource-manager/compute/2023-03-01/virtualmachinesizes/README.md index 9e6be4216e0..049761d6e47 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinesizes/README.md +++ b/resource-manager/compute/2023-03-01/virtualmachinesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/compute/2023-03-01/virtualmachinesizes/id_location.go b/resource-manager/compute/2023-03-01/virtualmachinesizes/id_location.go index c3d426ecfb0..f36bb369b8b 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinesizes/id_location.go +++ b/resource-manager/compute/2023-03-01/virtualmachinesizes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2023-03-01/virtualmachinesizes/id_location_test.go b/resource-manager/compute/2023-03-01/virtualmachinesizes/id_location_test.go index 1507b0f8398..e60ddc571cb 100644 --- a/resource-manager/compute/2023-03-01/virtualmachinesizes/id_location_test.go +++ b/resource-manager/compute/2023-03-01/virtualmachinesizes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-04-02/diskencryptionsets/model_keyfordiskencryptionset.go b/resource-manager/compute/2023-04-02/diskencryptionsets/model_keyfordiskencryptionset.go index bfc2790b580..2993bffc506 100644 --- a/resource-manager/compute/2023-04-02/diskencryptionsets/model_keyfordiskencryptionset.go +++ b/resource-manager/compute/2023-04-02/diskencryptionsets/model_keyfordiskencryptionset.go @@ -4,6 +4,6 @@ package diskencryptionsets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyForDiskEncryptionSet struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault *SourceVault `json:"sourceVault,omitempty"` } diff --git a/resource-manager/compute/2023-04-02/disks/model_keyvaultandkeyreference.go b/resource-manager/compute/2023-04-02/disks/model_keyvaultandkeyreference.go index 3e61fe32839..c86fc45080b 100644 --- a/resource-manager/compute/2023-04-02/disks/model_keyvaultandkeyreference.go +++ b/resource-manager/compute/2023-04-02/disks/model_keyvaultandkeyreference.go @@ -4,6 +4,6 @@ package disks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultAndKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SourceVault `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-04-02/disks/model_keyvaultandsecretreference.go b/resource-manager/compute/2023-04-02/disks/model_keyvaultandsecretreference.go index 714cd7c20b7..b239f3e21e5 100644 --- a/resource-manager/compute/2023-04-02/disks/model_keyvaultandsecretreference.go +++ b/resource-manager/compute/2023-04-02/disks/model_keyvaultandsecretreference.go @@ -4,6 +4,6 @@ package disks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultAndSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SourceVault `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-04-02/incrementalrestorepoints/README.md b/resource-manager/compute/2023-04-02/incrementalrestorepoints/README.md index 6676707c886..e26ec14371a 100644 --- a/resource-manager/compute/2023-04-02/incrementalrestorepoints/README.md +++ b/resource-manager/compute/2023-04-02/incrementalrestorepoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName") +id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName") read, err := client.DiskRestorePointGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName") +id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName") payload := incrementalrestorepoints.GrantAccessData{ // ... @@ -57,7 +57,7 @@ if err := client.DiskRestorePointGrantAccessThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := incrementalrestorepoints.NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName") +id := incrementalrestorepoints.NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName") // alternatively `client.DiskRestorePointListByRestorePoint(ctx, id)` can be used to do batched pagination items, err := client.DiskRestorePointListByRestorePointComplete(ctx, id) @@ -74,7 +74,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName") +id := incrementalrestorepoints.NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName") if err := client.DiskRestorePointRevokeAccessThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_diskrestorepoint.go b/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_diskrestorepoint.go index 23524d3a453..0d840cfe6da 100644 --- a/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_diskrestorepoint.go +++ b/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_diskrestorepoint.go @@ -129,7 +129,7 @@ func (id DiskRestorePointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRestorePointCollections", "restorePointCollections", "restorePointCollections"), resourceids.UserSpecifiedSegment("restorePointCollectionName", "restorePointCollectionName"), resourceids.StaticSegment("staticRestorePoints", "restorePoints", "restorePoints"), - resourceids.UserSpecifiedSegment("restorePointName", "vmRestorePointName"), + resourceids.UserSpecifiedSegment("restorePointName", "restorePointName"), resourceids.StaticSegment("staticDiskRestorePoints", "diskRestorePoints", "diskRestorePoints"), resourceids.UserSpecifiedSegment("diskRestorePointName", "diskRestorePointName"), } diff --git a/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_diskrestorepoint_test.go b/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_diskrestorepoint_test.go index c64312b1967..13173781996 100644 --- a/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_diskrestorepoint_test.go +++ b/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_diskrestorepoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiskRestorePointId{} func TestNewDiskRestorePointID(t *testing.T) { - id := NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName") + id := NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDiskRestorePointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RestorePointCollectionName'", id.RestorePointCollectionName, "restorePointCollectionName") } - if id.RestorePointName != "vmRestorePointName" { - t.Fatalf("Expected %q but got %q for Segment 'RestorePointName'", id.RestorePointName, "vmRestorePointName") + if id.RestorePointName != "restorePointName" { + t.Fatalf("Expected %q but got %q for Segment 'RestorePointName'", id.RestorePointName, "restorePointName") } if id.DiskRestorePointName != "diskRestorePointName" { @@ -36,8 +36,8 @@ func TestNewDiskRestorePointID(t *testing.T) { } func TestFormatDiskRestorePointID(t *testing.T) { - actual := NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName", "diskRestorePointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName" + actual := NewDiskRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName", "diskRestorePointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDiskRestorePointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName", Expected: &DiskRestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RestorePointCollectionName: "restorePointCollectionName", - RestorePointName: "vmRestorePointName", + RestorePointName: "restorePointName", DiskRestorePointName: "diskRestorePointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDiskRestorePointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE/dIsKrEsToRePoInTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE/dIsKrEsToRePoInTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName", Expected: &DiskRestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RestorePointCollectionName: "restorePointCollectionName", - RestorePointName: "vmRestorePointName", + RestorePointName: "restorePointName", DiskRestorePointName: "diskRestorePointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/diskRestorePoints/diskRestorePointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/diskRestorePoints/diskRestorePointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE/dIsKrEsToRePoInTs/dIsKrEsToRePoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE/dIsKrEsToRePoInTs/dIsKrEsToRePoInTnAmE", Expected: &DiskRestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RestorePointCollectionName: "rEsToRePoInTcOlLeCtIoNnAmE", - RestorePointName: "vMrEsToRePoInTnAmE", + RestorePointName: "rEsToRePoInTnAmE", DiskRestorePointName: "dIsKrEsToRePoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE/dIsKrEsToRePoInTs/dIsKrEsToRePoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE/dIsKrEsToRePoInTs/dIsKrEsToRePoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_restorepoint.go b/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_restorepoint.go index 608e63ead36..a6558c72cec 100644 --- a/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_restorepoint.go +++ b/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_restorepoint.go @@ -123,7 +123,7 @@ func (id RestorePointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRestorePointCollections", "restorePointCollections", "restorePointCollections"), resourceids.UserSpecifiedSegment("restorePointCollectionName", "restorePointCollectionName"), resourceids.StaticSegment("staticRestorePoints", "restorePoints", "restorePoints"), - resourceids.UserSpecifiedSegment("restorePointName", "vmRestorePointName"), + resourceids.UserSpecifiedSegment("restorePointName", "restorePointName"), } } diff --git a/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_restorepoint_test.go b/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_restorepoint_test.go index 0e98acc8e3b..5da7923ea8a 100644 --- a/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_restorepoint_test.go +++ b/resource-manager/compute/2023-04-02/incrementalrestorepoints/id_restorepoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RestorePointId{} func TestNewRestorePointID(t *testing.T) { - id := NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName") + id := NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRestorePointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RestorePointCollectionName'", id.RestorePointCollectionName, "restorePointCollectionName") } - if id.RestorePointName != "vmRestorePointName" { - t.Fatalf("Expected %q but got %q for Segment 'RestorePointName'", id.RestorePointName, "vmRestorePointName") + if id.RestorePointName != "restorePointName" { + t.Fatalf("Expected %q but got %q for Segment 'RestorePointName'", id.RestorePointName, "restorePointName") } } func TestFormatRestorePointID(t *testing.T) { - actual := NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "vmRestorePointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName" + actual := NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionName", "restorePointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRestorePointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName", Expected: &RestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RestorePointCollectionName: "restorePointCollectionName", - RestorePointName: "vmRestorePointName", + RestorePointName: "restorePointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRestorePointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName", Expected: &RestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RestorePointCollectionName: "restorePointCollectionName", - RestorePointName: "vmRestorePointName", + RestorePointName: "restorePointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/vmRestorePointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/restorePointCollections/restorePointCollectionName/restorePoints/restorePointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE", Expected: &RestorePointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RestorePointCollectionName: "rEsToRePoInTcOlLeCtIoNnAmE", - RestorePointName: "vMrEsToRePoInTnAmE", + RestorePointName: "rEsToRePoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/vMrEsToRePoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/rEsToRePoInTcOlLeCtIoNs/rEsToRePoInTcOlLeCtIoNnAmE/rEsToRePoInTs/rEsToRePoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-04-02/snapshots/model_keyvaultandkeyreference.go b/resource-manager/compute/2023-04-02/snapshots/model_keyvaultandkeyreference.go index f3f50f3491f..75cfb7991fa 100644 --- a/resource-manager/compute/2023-04-02/snapshots/model_keyvaultandkeyreference.go +++ b/resource-manager/compute/2023-04-02/snapshots/model_keyvaultandkeyreference.go @@ -4,6 +4,6 @@ package snapshots // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultAndKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SourceVault `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-04-02/snapshots/model_keyvaultandsecretreference.go b/resource-manager/compute/2023-04-02/snapshots/model_keyvaultandsecretreference.go index 81a108c40ca..517ea340388 100644 --- a/resource-manager/compute/2023-04-02/snapshots/model_keyvaultandsecretreference.go +++ b/resource-manager/compute/2023-04-02/snapshots/model_keyvaultandsecretreference.go @@ -4,6 +4,6 @@ package snapshots // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultAndSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SourceVault `json:"sourceVault"` } diff --git a/resource-manager/compute/2023-07-03/communitygalleries/README.md b/resource-manager/compute/2023-07-03/communitygalleries/README.md index a52f8bd5356..095299bbcf7 100644 --- a/resource-manager/compute/2023-07-03/communitygalleries/README.md +++ b/resource-manager/compute/2023-07-03/communitygalleries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleries.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") +id := communitygalleries.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/compute/2023-07-03/communitygalleries/id_communitygallery.go b/resource-manager/compute/2023-07-03/communitygalleries/id_communitygallery.go index 3d8672e9b69..d77b8b52d53 100644 --- a/resource-manager/compute/2023-07-03/communitygalleries/id_communitygallery.go +++ b/resource-manager/compute/2023-07-03/communitygalleries/id_communitygallery.go @@ -113,9 +113,9 @@ func (id CommunityGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), } } diff --git a/resource-manager/compute/2023-07-03/communitygalleries/id_communitygallery_test.go b/resource-manager/compute/2023-07-03/communitygalleries/id_communitygallery_test.go index d1b0b1c05db..325bcd4400d 100644 --- a/resource-manager/compute/2023-07-03/communitygalleries/id_communitygallery_test.go +++ b/resource-manager/compute/2023-07-03/communitygalleries/id_communitygallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryId{} func TestNewCommunityGalleryID(t *testing.T) { - id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") + id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } } func TestFormatCommunityGalleryID(t *testing.T) { - actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName" + actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseCommunityGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseCommunityGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/communitygalleryimages/README.md b/resource-manager/compute/2023-07-03/communitygalleryimages/README.md index e1a5a9dc8c2..360b4746472 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimages/README.md +++ b/resource-manager/compute/2023-07-03/communitygalleryimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleryimages.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") +id := communitygalleryimages.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := communitygalleryimages.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") +id := communitygalleryimages.NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygallery.go b/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygallery.go index 73185f5641d..f2d1c4611a5 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygallery.go +++ b/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygallery.go @@ -113,9 +113,9 @@ func (id CommunityGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), } } diff --git a/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygallery_test.go b/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygallery_test.go index 92d3f3a8200..4670865f3e1 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygallery_test.go +++ b/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryId{} func TestNewCommunityGalleryID(t *testing.T) { - id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName") + id := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } } func TestFormatCommunityGalleryID(t *testing.T) { - actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName" + actual := NewCommunityGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseCommunityGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseCommunityGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Expected: &CommunityGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygalleryimage.go b/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygalleryimage.go index af36bc3b0ab..e94cfc15022 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygalleryimage.go +++ b/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygalleryimage.go @@ -119,11 +119,11 @@ func (id CommunityGalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygalleryimage_test.go b/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygalleryimage_test.go index 269737a2b21..8e48672a727 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygalleryimage_test.go +++ b/resource-manager/compute/2023-07-03/communitygalleryimages/id_communitygalleryimage_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryImageId{} func TestNewCommunityGalleryImageID(t *testing.T) { - id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") + id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatCommunityGalleryImageID(t *testing.T) { - actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName" + actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseCommunityGalleryImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseCommunityGalleryImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/communitygalleryimageversions/README.md b/resource-manager/compute/2023-07-03/communitygalleryimageversions/README.md index 61bc690ca6a..139340273e9 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimageversions/README.md +++ b/resource-manager/compute/2023-07-03/communitygalleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := communitygalleryimageversions.NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName") +id := communitygalleryimageversions.NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := communitygalleryimageversions.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") +id := communitygalleryimageversions.NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimage.go b/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimage.go index 6e7a613b703..208959da87d 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimage.go +++ b/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimage.go @@ -119,11 +119,11 @@ func (id CommunityGalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimage_test.go b/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimage_test.go index 7b7ec63bc8e..83b69863a67 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimage_test.go +++ b/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimage_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryImageId{} func TestNewCommunityGalleryImageID(t *testing.T) { - id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName") + id := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatCommunityGalleryImageID(t *testing.T) { - actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName" + actual := NewCommunityGalleryImageID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseCommunityGalleryImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseCommunityGalleryImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe", Expected: &CommunityGalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimageversion.go b/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimageversion.go index df7f451f227..1d726a30cbf 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimageversion.go +++ b/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimageversion.go @@ -125,13 +125,13 @@ func (id CommunityGalleryImageVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticCommunityGalleries", "communityGalleries", "communityGalleries"), - resourceids.UserSpecifiedSegment("communityGalleryName", "publicGalleryName"), + resourceids.UserSpecifiedSegment("communityGalleryName", "communityGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimageversion_test.go b/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimageversion_test.go index da73ee1270c..2f27f37d55e 100644 --- a/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimageversion_test.go +++ b/resource-manager/compute/2023-07-03/communitygalleryimageversions/id_communitygalleryimageversion_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &CommunityGalleryImageVersionId{} func TestNewCommunityGalleryImageVersionID(t *testing.T) { - id := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName") + id := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.CommunityGalleryName != "publicGalleryName" { - t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "publicGalleryName") + if id.CommunityGalleryName != "communityGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'CommunityGalleryName'", id.CommunityGalleryName, "communityGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatCommunityGalleryImageVersionID(t *testing.T) { - actual := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "location", "publicGalleryName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName" + actual := NewCommunityGalleryImageVersionID("12345678-1234-9876-4563-123456789012", "locationName", "communityGalleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseCommunityGalleryImageVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseCommunityGalleryImageVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - CommunityGalleryName: "publicGalleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + CommunityGalleryName: "communityGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/communityGalleries/publicGalleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/communityGalleries/communityGalleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &CommunityGalleryImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - CommunityGalleryName: "pUbLiCgAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + LocationName: "lOcAtIoNnAmE", + CommunityGalleryName: "cOmMuNiTyGaLlErYnAmE", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/cOmMuNiTyGaLlErIeS/pUbLiCgAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/cOmMuNiTyGaLlErIeS/cOmMuNiTyGaLlErYnAmE/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/galleryapplications/README.md b/resource-manager/compute/2023-07-03/galleryapplications/README.md index 008647a479f..776309f65c7 100644 --- a/resource-manager/compute/2023-07-03/galleryapplications/README.md +++ b/resource-manager/compute/2023-07-03/galleryapplications/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") payload := galleryapplications.GalleryApplication{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") payload := galleryapplications.GalleryApplicationUpdate{ // ... diff --git a/resource-manager/compute/2023-07-03/galleryapplications/id_application.go b/resource-manager/compute/2023-07-03/galleryapplications/id_application.go index 865683cdda7..5b6ff82bf5b 100644 --- a/resource-manager/compute/2023-07-03/galleryapplications/id_application.go +++ b/resource-manager/compute/2023-07-03/galleryapplications/id_application.go @@ -123,7 +123,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } } diff --git a/resource-manager/compute/2023-07-03/galleryapplications/id_application_test.go b/resource-manager/compute/2023-07-03/galleryapplications/id_application_test.go index 9b358fec0af..6fbd0d8f746 100644 --- a/resource-manager/compute/2023-07-03/galleryapplications/id_application_test.go +++ b/resource-manager/compute/2023-07-03/galleryapplications/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", + ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/galleryapplicationversions/README.md b/resource-manager/compute/2023-07-03/galleryapplicationversions/README.md index e5e9e022e40..a092b4d70ca 100644 --- a/resource-manager/compute/2023-07-03/galleryapplicationversions/README.md +++ b/resource-manager/compute/2023-07-03/galleryapplicationversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") payload := galleryapplicationversions.GalleryApplicationVersion{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") read, err := client.Get(ctx, id, galleryapplicationversions.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") +id := galleryapplicationversions.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") // alternatively `client.ListByGalleryApplication(ctx, id)` can be used to do batched pagination items, err := client.ListByGalleryApplicationComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") +id := galleryapplicationversions.NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") payload := galleryapplicationversions.GalleryApplicationVersionUpdate{ // ... diff --git a/resource-manager/compute/2023-07-03/galleryapplicationversions/id_application.go b/resource-manager/compute/2023-07-03/galleryapplicationversions/id_application.go index 08704b1b91f..56d6741ec00 100644 --- a/resource-manager/compute/2023-07-03/galleryapplicationversions/id_application.go +++ b/resource-manager/compute/2023-07-03/galleryapplicationversions/id_application.go @@ -123,7 +123,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } } diff --git a/resource-manager/compute/2023-07-03/galleryapplicationversions/id_application_test.go b/resource-manager/compute/2023-07-03/galleryapplicationversions/id_application_test.go index 02a985fc8a8..da5f9c61e9d 100644 --- a/resource-manager/compute/2023-07-03/galleryapplicationversions/id_application_test.go +++ b/resource-manager/compute/2023-07-03/galleryapplicationversions/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", + ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", + ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/galleryapplicationversions/id_applicationversion.go b/resource-manager/compute/2023-07-03/galleryapplicationversions/id_applicationversion.go index 545d234622c..7042840fc6e 100644 --- a/resource-manager/compute/2023-07-03/galleryapplicationversions/id_applicationversion.go +++ b/resource-manager/compute/2023-07-03/galleryapplicationversions/id_applicationversion.go @@ -129,9 +129,9 @@ func (id ApplicationVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "galleryApplicationName"), + resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryApplicationVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2023-07-03/galleryapplicationversions/id_applicationversion_test.go b/resource-manager/compute/2023-07-03/galleryapplicationversions/id_applicationversion_test.go index cbfc5e4c037..d1a837bdbda 100644 --- a/resource-manager/compute/2023-07-03/galleryapplicationversions/id_applicationversion_test.go +++ b/resource-manager/compute/2023-07-03/galleryapplicationversions/id_applicationversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationVersionId{} func TestNewApplicationVersionID(t *testing.T) { - id := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName") + id := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewApplicationVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ApplicationName != "galleryApplicationName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "galleryApplicationName") + if id.ApplicationName != "applicationName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationName") } - if id.VersionName != "galleryApplicationVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryApplicationVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatApplicationVersionID(t *testing.T) { - actual := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryApplicationName", "galleryApplicationVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName" + actual := NewApplicationVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "applicationName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseApplicationVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", - VersionName: "galleryApplicationVersionName", + ApplicationName: "applicationName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseApplicationVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ApplicationName: "galleryApplicationName", - VersionName: "galleryApplicationVersionName", + ApplicationName: "applicationName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/galleryApplicationName/versions/galleryApplicationVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/applications/applicationName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS/gAlLeRyApPlIcAtIoNvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe", Expected: &ApplicationVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ApplicationName: "gAlLeRyApPlIcAtIoNnAmE", - VersionName: "gAlLeRyApPlIcAtIoNvErSiOnNaMe", + ApplicationName: "aPpLiCaTiOnNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/gAlLeRyApPlIcAtIoNnAmE/vErSiOnS/gAlLeRyApPlIcAtIoNvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/galleryimages/README.md b/resource-manager/compute/2023-07-03/galleryimages/README.md index 36ad8e1dc33..fbb9b7af96f 100644 --- a/resource-manager/compute/2023-07-03/galleryimages/README.md +++ b/resource-manager/compute/2023-07-03/galleryimages/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") payload := galleryimages.GalleryImage{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") payload := galleryimages.GalleryImageUpdate{ // ... diff --git a/resource-manager/compute/2023-07-03/galleryimages/id_galleryimage.go b/resource-manager/compute/2023-07-03/galleryimages/id_galleryimage.go index 5883023f463..dd4c61adfae 100644 --- a/resource-manager/compute/2023-07-03/galleryimages/id_galleryimage.go +++ b/resource-manager/compute/2023-07-03/galleryimages/id_galleryimage.go @@ -123,7 +123,7 @@ func (id GalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2023-07-03/galleryimages/id_galleryimage_test.go b/resource-manager/compute/2023-07-03/galleryimages/id_galleryimage_test.go index 913b82acd35..8c77e84e750 100644 --- a/resource-manager/compute/2023-07-03/galleryimages/id_galleryimage_test.go +++ b/resource-manager/compute/2023-07-03/galleryimages/id_galleryimage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GalleryImageId{} func TestNewGalleryImageID(t *testing.T) { - id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") + id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGalleryImageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatGalleryImageID(t *testing.T) { - actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName" + actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseGalleryImageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseGalleryImageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/galleryimageversions/README.md b/resource-manager/compute/2023-07-03/galleryimageversions/README.md index ee152d1584b..a4e5f3b0345 100644 --- a/resource-manager/compute/2023-07-03/galleryimageversions/README.md +++ b/resource-manager/compute/2023-07-03/galleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") payload := galleryimageversions.GalleryImageVersion{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") read, err := client.Get(ctx, id, galleryimageversions.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := galleryimageversions.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") +id := galleryimageversions.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") // alternatively `client.ListByGalleryImage(ctx, id)` can be used to do batched pagination items, err := client.ListByGalleryImageComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") +id := galleryimageversions.NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") payload := galleryimageversions.GalleryImageVersionUpdate{ // ... diff --git a/resource-manager/compute/2023-07-03/galleryimageversions/id_galleryimage.go b/resource-manager/compute/2023-07-03/galleryimageversions/id_galleryimage.go index fdcea2d752b..0d1f7d19f12 100644 --- a/resource-manager/compute/2023-07-03/galleryimageversions/id_galleryimage.go +++ b/resource-manager/compute/2023-07-03/galleryimageversions/id_galleryimage.go @@ -123,7 +123,7 @@ func (id GalleryImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2023-07-03/galleryimageversions/id_galleryimage_test.go b/resource-manager/compute/2023-07-03/galleryimageversions/id_galleryimage_test.go index b7cd98a82ee..d2791250c5b 100644 --- a/resource-manager/compute/2023-07-03/galleryimageversions/id_galleryimage_test.go +++ b/resource-manager/compute/2023-07-03/galleryimageversions/id_galleryimage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GalleryImageId{} func TestNewGalleryImageID(t *testing.T) { - id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName") + id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGalleryImageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatGalleryImageID(t *testing.T) { - actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName" + actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseGalleryImageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseGalleryImageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &GalleryImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/galleryimageversions/id_imageversion.go b/resource-manager/compute/2023-07-03/galleryimageversions/id_imageversion.go index d6252874c0c..2dbe8fa6f7a 100644 --- a/resource-manager/compute/2023-07-03/galleryimageversions/id_imageversion.go +++ b/resource-manager/compute/2023-07-03/galleryimageversions/id_imageversion.go @@ -129,9 +129,9 @@ func (id ImageVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGalleries", "galleries", "galleries"), resourceids.UserSpecifiedSegment("galleryName", "galleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2023-07-03/galleryimageversions/id_imageversion_test.go b/resource-manager/compute/2023-07-03/galleryimageversions/id_imageversion_test.go index 7a2f370f771..82bd3808fc3 100644 --- a/resource-manager/compute/2023-07-03/galleryimageversions/id_imageversion_test.go +++ b/resource-manager/compute/2023-07-03/galleryimageversions/id_imageversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ImageVersionId{} func TestNewImageVersionID(t *testing.T) { - id := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName") + id := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewImageVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'GalleryName'", id.GalleryName, "galleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatImageVersionID(t *testing.T) { - actual := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName" + actual := NewImageVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseImageVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName", Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseImageVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName", Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", GalleryName: "galleryName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/galleries/galleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &ImageVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", GalleryName: "gAlLeRyNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/gAlLeRiEs/gAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/sharedgalleries/README.md b/resource-manager/compute/2023-07-03/sharedgalleries/README.md index 43df6a4fea3..d8c6f7c12af 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleries/README.md +++ b/resource-manager/compute/2023-07-03/sharedgalleries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleries.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") +id := sharedgalleries.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleries.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := sharedgalleries.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id, sharedgalleries.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleries.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2023-07-03/sharedgalleries/id_location.go b/resource-manager/compute/2023-07-03/sharedgalleries/id_location.go index a02aeee9e82..a2b72e84cfb 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleries/id_location.go +++ b/resource-manager/compute/2023-07-03/sharedgalleries/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2023-07-03/sharedgalleries/id_location_test.go b/resource-manager/compute/2023-07-03/sharedgalleries/id_location_test.go index 4e4d0a54829..7e29e53bdc5 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleries/id_location_test.go +++ b/resource-manager/compute/2023-07-03/sharedgalleries/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/sharedgalleries/id_sharedgallery.go b/resource-manager/compute/2023-07-03/sharedgalleries/id_sharedgallery.go index 4622271e542..49ee6bb93ea 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleries/id_sharedgallery.go +++ b/resource-manager/compute/2023-07-03/sharedgalleries/id_sharedgallery.go @@ -113,9 +113,9 @@ func (id SharedGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), } } diff --git a/resource-manager/compute/2023-07-03/sharedgalleries/id_sharedgallery_test.go b/resource-manager/compute/2023-07-03/sharedgalleries/id_sharedgallery_test.go index 4b82c4b049a..f70f26dfd8f 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleries/id_sharedgallery_test.go +++ b/resource-manager/compute/2023-07-03/sharedgalleries/id_sharedgallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &SharedGalleryId{} func TestNewSharedGalleryID(t *testing.T) { - id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") + id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } } func TestFormatSharedGalleryID(t *testing.T) { - actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName" + actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseSharedGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseSharedGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimages/README.md b/resource-manager/compute/2023-07-03/sharedgalleryimages/README.md index 7afbd712edb..8b60d7d2962 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimages/README.md +++ b/resource-manager/compute/2023-07-03/sharedgalleryimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleryimages.NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") +id := sharedgalleryimages.NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleryimages.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") +id := sharedgalleryimages.NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") // alternatively `client.List(ctx, id, sharedgalleryimages.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleryimages.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimages/id_image.go b/resource-manager/compute/2023-07-03/sharedgalleryimages/id_image.go index 42c59630ae7..55c3ed65914 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimages/id_image.go +++ b/resource-manager/compute/2023-07-03/sharedgalleryimages/id_image.go @@ -119,11 +119,11 @@ func (id ImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimages/id_image_test.go b/resource-manager/compute/2023-07-03/sharedgalleryimages/id_image_test.go index a3a7a10a7e4..36e20cd4d23 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimages/id_image_test.go +++ b/resource-manager/compute/2023-07-03/sharedgalleryimages/id_image_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ImageId{} func TestNewImageID(t *testing.T) { - id := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") + id := NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatImageID(t *testing.T) { - actual := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName" + actual := NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimages/id_sharedgallery.go b/resource-manager/compute/2023-07-03/sharedgalleryimages/id_sharedgallery.go index a458b9a6ca0..be4499dac00 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimages/id_sharedgallery.go +++ b/resource-manager/compute/2023-07-03/sharedgalleryimages/id_sharedgallery.go @@ -113,9 +113,9 @@ func (id SharedGalleryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), } } diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimages/id_sharedgallery_test.go b/resource-manager/compute/2023-07-03/sharedgalleryimages/id_sharedgallery_test.go index 029a84562fd..78c44f7b95b 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimages/id_sharedgallery_test.go +++ b/resource-manager/compute/2023-07-03/sharedgalleryimages/id_sharedgallery_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &SharedGalleryId{} func TestNewSharedGalleryID(t *testing.T) { - id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName") + id := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } } func TestFormatSharedGalleryID(t *testing.T) { - actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName" + actual := NewSharedGalleryID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseSharedGalleryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseSharedGalleryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Expected: &SharedGalleryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/README.md b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/README.md index 77b316bfe6c..180cbf6b1e1 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/README.md +++ b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sharedgalleryimageversions.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName") +id := sharedgalleryimageversions.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sharedgalleryimageversions.NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") +id := sharedgalleryimageversions.NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") // alternatively `client.List(ctx, id, sharedgalleryimageversions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, sharedgalleryimageversions.DefaultListOperationOptions()) diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_image.go b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_image.go index 6ebaa342691..03f60ef5cce 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_image.go +++ b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_image.go @@ -119,11 +119,11 @@ func (id ImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), } } diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_image_test.go b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_image_test.go index 837e738dc05..b9102f3283e 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_image_test.go +++ b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_image_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ImageId{} func TestNewImageID(t *testing.T) { - id := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName") + id := NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } } func TestFormatImageID(t *testing.T) { - actual := NewImageID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName" + actual := NewImageID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseImageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseImageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", Expected: &ImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_version.go b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_version.go index b210c744459..b0f42c4f4a8 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_version.go +++ b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_version.go @@ -125,13 +125,13 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSharedGalleries", "sharedGalleries", "sharedGalleries"), - resourceids.UserSpecifiedSegment("sharedGalleryName", "galleryUniqueName"), + resourceids.UserSpecifiedSegment("sharedGalleryName", "sharedGalleryName"), resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "galleryImageName"), + resourceids.UserSpecifiedSegment("imageName", "imageName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "galleryImageVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_version_test.go b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_version_test.go index d1353073c28..263d42276d9 100644 --- a/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_version_test.go +++ b/resource-manager/compute/2023-07-03/sharedgalleryimageversions/id_version_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SharedGalleryName != "galleryUniqueName" { - t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "galleryUniqueName") + if id.SharedGalleryName != "sharedGalleryName" { + t.Fatalf("Expected %q but got %q for Segment 'SharedGalleryName'", id.SharedGalleryName, "sharedGalleryName") } - if id.ImageName != "galleryImageName" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "galleryImageName") + if id.ImageName != "imageName" { + t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageName") } - if id.VersionName != "galleryImageVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "galleryImageVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "galleryUniqueName", "galleryImageName", "galleryImageVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "sharedGalleryName", "imageName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SharedGalleryName: "galleryUniqueName", - ImageName: "galleryImageName", - VersionName: "galleryImageVersionName", + LocationName: "locationName", + SharedGalleryName: "sharedGalleryName", + ImageName: "imageName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/sharedGalleries/galleryUniqueName/images/galleryImageName/versions/galleryImageVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/sharedGalleries/sharedGalleryName/images/imageName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - SharedGalleryName: "gAlLeRyUnIqUeNaMe", - ImageName: "gAlLeRyImAgEnAmE", - VersionName: "gAlLeRyImAgEvErSiOnNaMe", + LocationName: "lOcAtIoNnAmE", + SharedGalleryName: "sHaReDgAlLeRyNaMe", + ImageName: "iMaGeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/sHaReDgAlLeRiEs/gAlLeRyUnIqUeNaMe/iMaGeS/gAlLeRyImAgEnAmE/vErSiOnS/gAlLeRyImAgEvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/sHaReDgAlLeRiEs/sHaReDgAlLeRyNaMe/iMaGeS/iMaGeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/loganalytics/README.md b/resource-manager/compute/2024-03-01/loganalytics/README.md index 3b46173c85f..dc65243e833 100644 --- a/resource-manager/compute/2024-03-01/loganalytics/README.md +++ b/resource-manager/compute/2024-03-01/loganalytics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.RequestRateByIntervalInput{ // ... @@ -41,7 +41,7 @@ if err := client.ExportRequestRateByIntervalThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.LogAnalyticsInputBase{ // ... diff --git a/resource-manager/compute/2024-03-01/loganalytics/id_location.go b/resource-manager/compute/2024-03-01/loganalytics/id_location.go index 017c4298e31..893525660f2 100644 --- a/resource-manager/compute/2024-03-01/loganalytics/id_location.go +++ b/resource-manager/compute/2024-03-01/loganalytics/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-03-01/loganalytics/id_location_test.go b/resource-manager/compute/2024-03-01/loganalytics/id_location_test.go index 9e2582fe064..76eb5c3f415 100644 --- a/resource-manager/compute/2024-03-01/loganalytics/id_location_test.go +++ b/resource-manager/compute/2024-03-01/loganalytics/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultkeyreference.go b/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultkeyreference.go index a58940dc601..e67b885cbec 100644 --- a/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultsecretreference.go b/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultsecretreference.go index 9cdda52320c..f403c9277b7 100644 --- a/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultcertificate.go b/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultcertificate.go index 1e6b6948da0..f3fd244ab96 100644 --- a/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultcertificate.go +++ b/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepointcollections type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmlistener.go b/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmlistener.go index 48cee24a28f..3b6dcd5d775 100644 --- a/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmlistener.go +++ b/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultkeyreference.go b/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultkeyreference.go index f91f103e171..a84afc6404c 100644 --- a/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultsecretreference.go b/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultsecretreference.go index 4482fc4dbcb..473adafc492 100644 --- a/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/restorepoints/model_vaultcertificate.go b/resource-manager/compute/2024-03-01/restorepoints/model_vaultcertificate.go index 077c7b0db1d..7ace154164b 100644 --- a/resource-manager/compute/2024-03-01/restorepoints/model_vaultcertificate.go +++ b/resource-manager/compute/2024-03-01/restorepoints/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepoints type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/restorepoints/model_winrmlistener.go b/resource-manager/compute/2024-03-01/restorepoints/model_winrmlistener.go index c9ff579e87e..7d06a9d1480 100644 --- a/resource-manager/compute/2024-03-01/restorepoints/model_winrmlistener.go +++ b/resource-manager/compute/2024-03-01/restorepoints/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/README.md b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/README.md index c5f361c7543..b4db400b1d7 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") +id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListTypes(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") +id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") read, err := client.ListVersions(ctx, id, virtualmachineextensionimages.DefaultListVersionsOperationOptions()) if err != nil { diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_publisher.go b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_publisher.go index 26803cae70d..75185dcd3b3 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_publisher.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_publisher_test.go b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_publisher_test.go index a68baea12d2..a1107c02a89 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_publisher_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_type.go b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_type.go index b8d3341bc22..913ad5b4f1d 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_type.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_type.go @@ -119,7 +119,7 @@ func (id TypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_type_test.go b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_type_test.go index 82a20b50cdb..fdd8342e8e0 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_type_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_type_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TypeId{} func TestNewTypeID(t *testing.T) { - id := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") + id := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewTypeID(t *testing.T) { } func TestFormatTypeID(t *testing.T) { - actual := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName" + actual := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_version.go b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_version.go index 56bb407edd5..428dd802d6f 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_version.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_version.go @@ -125,7 +125,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), @@ -133,7 +133,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTypes", "types", "types"), resourceids.UserSpecifiedSegment("typeName", "typeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_version_test.go b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_version_test.go index de6f52198dc..9190aa87b20 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_version_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensionimages/id_version_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -30,14 +30,14 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TypeName'", id.TypeName, "typeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensions/README.md b/resource-manager/compute/2024-03-01/virtualmachineextensions/README.md index 30807e77711..cb831b8f1c2 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensions/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachineextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") read, err := client.Get(ctx, id, virtualmachineextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtensionUpdate{ // ... diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensions/id_extension.go b/resource-manager/compute/2024-03-01/virtualmachineextensions/id_extension.go index 25ce4dd99cf..72168cd7ce0 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensions/id_extension.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensions/id_extension.go @@ -123,7 +123,7 @@ func (id ExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensions/id_extension_test.go b/resource-manager/compute/2024-03-01/virtualmachineextensions/id_extension_test.go index 6727e3b6c90..29ca0c38d57 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensions/id_extension_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensions/id_extension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExtensionId{} func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") + id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName" + actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineName: "vIrTuAlMaChInEnAmE", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2024-03-01/virtualmachineextensions/model_keyvaultsecretreference.go index e65598f8f2e..ba308b046a4 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-03-01/virtualmachineextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachineextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/README.md b/resource-manager/compute/2024-03-01/virtualmachineimages/README.md index b846d12324c..f13f96b3f67 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") read, err := client.EdgeZoneGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") +id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") read, err := client.EdgeZoneList(ctx, id, virtualmachineimages.DefaultEdgeZoneListOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") +id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") read, err := client.EdgeZoneListOffers(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") read, err := client.EdgeZoneListPublishers(ctx, id) if err != nil { @@ -88,7 +88,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") +id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") read, err := client.EdgeZoneListSkus(ctx, id) if err != nil { @@ -104,7 +104,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") +id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") read, err := client.List(ctx, id, virtualmachineimages.DefaultListOperationOptions()) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") // alternatively `client.ListByEdgeZone(ctx, id)` can be used to do batched pagination items, err := client.ListByEdgeZoneComplete(ctx, id) @@ -153,7 +153,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListOffers(ctx, id) if err != nil { @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListPublishers(ctx, id) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") +id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") read, err := client.ListSkus(ctx, id) if err != nil { diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezone.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezone.go index 9decb1ab074..4589fd49c69 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezone.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezone.go @@ -113,9 +113,9 @@ func (id EdgeZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezone_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezone_test.go index 72468a3951b..179025c0a66 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezone_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezone_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &EdgeZoneId{} func TestNewEdgeZoneID(t *testing.T) { - id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") + id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } } func TestFormatEdgeZoneID(t *testing.T) { - actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone" + actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseEdgeZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseEdgeZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezonepublisher.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezonepublisher.go index 270c659bca7..413b714876a 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezonepublisher.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezonepublisher.go @@ -119,9 +119,9 @@ func (id EdgeZonePublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezonepublisher_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezonepublisher_test.go index 0c39297640c..481cc03e568 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezonepublisher_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_edgezonepublisher_test.go @@ -12,18 +12,18 @@ import ( var _ resourceids.ResourceId = &EdgeZonePublisherId{} func TestNewEdgeZonePublisherID(t *testing.T) { - id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") + id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewEdgeZonePublisherID(t *testing.T) { } func TestFormatEdgeZonePublisherID(t *testing.T) { - actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName" + actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseEdgeZonePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseEdgeZonePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_location.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_location.go index 964d6fa45df..bc87fc5d8b3 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_location.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_location_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_location_test.go index 6c81492a53e..ba21e1bba3c 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_location_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offer.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offer.go index 0c2104719a1..555733f938b 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offer.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offer.go @@ -119,13 +119,13 @@ func (id OfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offer_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offer_test.go index da5ed77df1d..20ee9d771ba 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offer_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offer_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &OfferId{} func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") + id := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offersku.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offersku.go index 4a79b9d3b5e..616277032de 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offersku.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offersku.go @@ -131,17 +131,17 @@ func (id OfferSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offersku_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offersku_test.go index 67473168400..b580e4c3fca 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offersku_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offersku_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &OfferSkuId{} func TestNewOfferSkuID(t *testing.T) { - id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") + id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatOfferSkuID(t *testing.T) { - actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseOfferSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseOfferSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offerskuversion.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offerskuversion.go index 7dbff8871b4..c6d89f817f3 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offerskuversion.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offerskuversion.go @@ -137,19 +137,19 @@ func (id OfferSkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offerskuversion_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offerskuversion_test.go index d60eae3c964..e8bc8c4c903 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_offerskuversion_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_offerskuversion_test.go @@ -12,40 +12,40 @@ import ( var _ resourceids.ResourceId = &OfferSkuVersionId{} func TestNewOfferSkuVersionID(t *testing.T) { - id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") + id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatOfferSkuVersionID(t *testing.T) { - actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -89,80 +89,80 @@ func TestParseOfferSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -275,158 +275,158 @@ func TestParseOfferSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_publisher.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_publisher.go index f33e882af34..732498f2f76 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_publisher.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_publisher_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_publisher_test.go index 441a6a32c0b..320e179981f 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_publisher_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_sku.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_sku.go index e8d0dddeaac..86196817181 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_sku.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_sku.go @@ -125,15 +125,15 @@ func (id SkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_sku_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_sku_test.go index 0123383d4f7..7148e671250 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_sku_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_sku_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &SkuId{} func TestNewSkuID(t *testing.T) { - id := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") + id := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatSkuID(t *testing.T) { - actual := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_skuversion.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_skuversion.go index 94cefe0168e..e6327d8297c 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_skuversion.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_skuversion.go @@ -131,17 +131,17 @@ func (id SkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_skuversion_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_skuversion_test.go index 153eee929c4..71033afa5fe 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_skuversion_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_skuversion_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &SkuVersionId{} func TestNewSkuVersionID(t *testing.T) { - id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") + id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatSkuVersionID(t *testing.T) { - actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_vmimageoffer.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_vmimageoffer.go index 1d8939e1fdb..2739d80c546 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_vmimageoffer.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_vmimageoffer.go @@ -125,15 +125,15 @@ func (id VMImageOfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineimages/id_vmimageoffer_test.go b/resource-manager/compute/2024-03-01/virtualmachineimages/id_vmimageoffer_test.go index 7cef7cc7c1e..1ecef60694e 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineimages/id_vmimageoffer_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineimages/id_vmimageoffer_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VMImageOfferId{} func TestNewVMImageOfferID(t *testing.T) { - id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") + id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatVMImageOfferID(t *testing.T) { - actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVMImageOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVMImageOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineruncommands/README.md b/resource-manager/compute/2024-03-01/virtualmachineruncommands/README.md index 2accce568aa..f15e8b059c0 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineruncommands/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachineruncommands/README.md @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") +id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") read, err := client.Get(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_location.go b/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_location.go index d8733d6665f..f23f00fe4e6 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_location.go +++ b/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_location_test.go b/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_location_test.go index 83d1e4c6807..a2db8720398 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_location_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_runcommand.go b/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_runcommand.go index 6781693a76f..64a8edf61a9 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_runcommand.go +++ b/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_runcommand.go @@ -113,7 +113,7 @@ func (id RunCommandId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRunCommands", "runCommands", "runCommands"), resourceids.UserSpecifiedSegment("commandId", "commandId"), } diff --git a/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_runcommand_test.go b/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_runcommand_test.go index e45ff7998e6..edd76a46cda 100644 --- a/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_runcommand_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachineruncommands/id_runcommand_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RunCommandId{} func TestNewRunCommandID(t *testing.T) { - id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") + id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.CommandId != "commandId" { @@ -28,8 +28,8 @@ func TestNewRunCommandID(t *testing.T) { } func TestFormatRunCommandID(t *testing.T) { - actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId" + actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRunCommandID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRunCommandIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", CommandId: "cOmMaNdId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachines/README.md b/resource-manager/compute/2024-03-01/virtualmachines/README.md index 4cfaf8f5bff..56627935159 100644 --- a/resource-manager/compute/2024-03-01/virtualmachines/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachines/README.md @@ -239,7 +239,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2024-03-01/virtualmachines/id_location.go b/resource-manager/compute/2024-03-01/virtualmachines/id_location.go index 5e0c32a8f32..64438c96c4f 100644 --- a/resource-manager/compute/2024-03-01/virtualmachines/id_location.go +++ b/resource-manager/compute/2024-03-01/virtualmachines/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachines/id_location_test.go b/resource-manager/compute/2024-03-01/virtualmachines/id_location_test.go index 05747f53916..08322a2d3e4 100644 --- a/resource-manager/compute/2024-03-01/virtualmachines/id_location_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachines/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachines/model_keyvaultkeyreference.go b/resource-manager/compute/2024-03-01/virtualmachines/model_keyvaultkeyreference.go index 438a0aef731..c50244524ea 100644 --- a/resource-manager/compute/2024-03-01/virtualmachines/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2024-03-01/virtualmachines/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachines/model_keyvaultsecretreference.go b/resource-manager/compute/2024-03-01/virtualmachines/model_keyvaultsecretreference.go index c9fcd8ae2b8..b739f603f31 100644 --- a/resource-manager/compute/2024-03-01/virtualmachines/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-03-01/virtualmachines/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachines/model_vaultcertificate.go b/resource-manager/compute/2024-03-01/virtualmachines/model_vaultcertificate.go index 5331305fb8f..73f8924cdde 100644 --- a/resource-manager/compute/2024-03-01/virtualmachines/model_vaultcertificate.go +++ b/resource-manager/compute/2024-03-01/virtualmachines/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachines type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachines/model_winrmlistener.go b/resource-manager/compute/2024-03-01/virtualmachines/model_winrmlistener.go index e2a07b49f36..30b38d846e4 100644 --- a/resource-manager/compute/2024-03-01/virtualmachines/model_winrmlistener.go +++ b/resource-manager/compute/2024-03-01/virtualmachines/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/README.md b/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/README.md index df7b5b12daf..b99d0dae644 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetextensions.DefaultGetOperationOptions()) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtensionUpdate{ // ... diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go index e5f4dfee0c5..371728a2982 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go @@ -123,7 +123,7 @@ func (id VirtualMachineScaleSetExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmssExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go index 970622d627b..41e7a35c801 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineScaleSetExtensionId{} func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { - id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") + id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.ExtensionName != "vmssExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmssExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineScaleSetExtensionID(t *testing.T) { - actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName" + actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineScaleSetExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineScaleSetExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - ExtensionName: "vMsSeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go index f025c1653d7..31af12dcf1e 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesets/README.md b/resource-manager/compute/2024-03-01/virtualmachinescalesets/README.md index 0c7c4314997..17e44acc51c 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesets/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesets/README.md @@ -225,7 +225,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesets/id_location.go b/resource-manager/compute/2024-03-01/virtualmachinescalesets/id_location.go index 2ecdd131193..1e550001f84 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesets/id_location.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesets/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesets/id_location_test.go b/resource-manager/compute/2024-03-01/virtualmachinescalesets/id_location_test.go index 58dbcd4eaab..f01c16a7142 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesets/id_location_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesets/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go b/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go index 5443aa3fb42..c27479d1430 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_vaultcertificate.go b/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_vaultcertificate.go index 87cebefa156..4e9173b39e6 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_vaultcertificate.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesets type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_winrmlistener.go b/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_winrmlistener.go index 4f07c2d4e68..fbaee700c4e 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_winrmlistener.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesets/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/README.md b/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/README.md index 80e24f62125..46adfc9b340 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetvmextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtensionUpdate{ // ... diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go index af92bc251a2..52f7976168f 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go @@ -131,7 +131,7 @@ func (id VirtualMachineExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go index 2f015fd2e0e..fb282110d45 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineExtensionId{} func TestNewVirtualMachineExtensionID(t *testing.T) { - id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") + id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewVirtualMachineExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'InstanceId'", id.InstanceId, "instanceId") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineExtensionID(t *testing.T) { - actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName" + actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseVirtualMachineExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseVirtualMachineExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", InstanceId: "iNsTaNcEiD", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go index 10e945e8ff7..b94a17b7d3d 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvmextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go index 831baeaa8f3..641c4d6cecc 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go index e0e510549a1..102c8c99c7f 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_vaultcertificate.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_vaultcertificate.go index ed0fd87a8a3..2ed3161f67c 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_vaultcertificate.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesetvms type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_winrmlistener.go b/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_winrmlistener.go index 7b8e4ea9a3b..59cdd2f5c0b 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_winrmlistener.go +++ b/resource-manager/compute/2024-03-01/virtualmachinescalesetvms/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-03-01/virtualmachinesizes/README.md b/resource-manager/compute/2024-03-01/virtualmachinesizes/README.md index a38c14571de..233bd20893b 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinesizes/README.md +++ b/resource-manager/compute/2024-03-01/virtualmachinesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/compute/2024-03-01/virtualmachinesizes/id_location.go b/resource-manager/compute/2024-03-01/virtualmachinesizes/id_location.go index c3d426ecfb0..f36bb369b8b 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinesizes/id_location.go +++ b/resource-manager/compute/2024-03-01/virtualmachinesizes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-03-01/virtualmachinesizes/id_location_test.go b/resource-manager/compute/2024-03-01/virtualmachinesizes/id_location_test.go index 1507b0f8398..e60ddc571cb 100644 --- a/resource-manager/compute/2024-03-01/virtualmachinesizes/id_location_test.go +++ b/resource-manager/compute/2024-03-01/virtualmachinesizes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/loganalytics/README.md b/resource-manager/compute/2024-07-01/loganalytics/README.md index 2ed93371a37..1d36a75192d 100644 --- a/resource-manager/compute/2024-07-01/loganalytics/README.md +++ b/resource-manager/compute/2024-07-01/loganalytics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.RequestRateByIntervalInput{ // ... @@ -41,7 +41,7 @@ if err := client.ExportRequestRateByIntervalThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loganalytics.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loganalytics.LogAnalyticsInputBase{ // ... diff --git a/resource-manager/compute/2024-07-01/loganalytics/id_location.go b/resource-manager/compute/2024-07-01/loganalytics/id_location.go index 017c4298e31..893525660f2 100644 --- a/resource-manager/compute/2024-07-01/loganalytics/id_location.go +++ b/resource-manager/compute/2024-07-01/loganalytics/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-07-01/loganalytics/id_location_test.go b/resource-manager/compute/2024-07-01/loganalytics/id_location_test.go index 9e2582fe064..76eb5c3f415 100644 --- a/resource-manager/compute/2024-07-01/loganalytics/id_location_test.go +++ b/resource-manager/compute/2024-07-01/loganalytics/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/restorepointcollections/model_keyvaultkeyreference.go b/resource-manager/compute/2024-07-01/restorepointcollections/model_keyvaultkeyreference.go index a58940dc601..e67b885cbec 100644 --- a/resource-manager/compute/2024-07-01/restorepointcollections/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2024-07-01/restorepointcollections/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/restorepointcollections/model_keyvaultsecretreference.go b/resource-manager/compute/2024-07-01/restorepointcollections/model_keyvaultsecretreference.go index 9cdda52320c..f403c9277b7 100644 --- a/resource-manager/compute/2024-07-01/restorepointcollections/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-07-01/restorepointcollections/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/restorepointcollections/model_vaultcertificate.go b/resource-manager/compute/2024-07-01/restorepointcollections/model_vaultcertificate.go index 1e6b6948da0..f3fd244ab96 100644 --- a/resource-manager/compute/2024-07-01/restorepointcollections/model_vaultcertificate.go +++ b/resource-manager/compute/2024-07-01/restorepointcollections/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepointcollections type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/restorepointcollections/model_winrmlistener.go b/resource-manager/compute/2024-07-01/restorepointcollections/model_winrmlistener.go index 48cee24a28f..3b6dcd5d775 100644 --- a/resource-manager/compute/2024-07-01/restorepointcollections/model_winrmlistener.go +++ b/resource-manager/compute/2024-07-01/restorepointcollections/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepointcollections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/restorepoints/model_keyvaultkeyreference.go b/resource-manager/compute/2024-07-01/restorepoints/model_keyvaultkeyreference.go index f91f103e171..a84afc6404c 100644 --- a/resource-manager/compute/2024-07-01/restorepoints/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2024-07-01/restorepoints/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/restorepoints/model_keyvaultsecretreference.go b/resource-manager/compute/2024-07-01/restorepoints/model_keyvaultsecretreference.go index 4482fc4dbcb..473adafc492 100644 --- a/resource-manager/compute/2024-07-01/restorepoints/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-07-01/restorepoints/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/restorepoints/model_vaultcertificate.go b/resource-manager/compute/2024-07-01/restorepoints/model_vaultcertificate.go index 077c7b0db1d..7ace154164b 100644 --- a/resource-manager/compute/2024-07-01/restorepoints/model_vaultcertificate.go +++ b/resource-manager/compute/2024-07-01/restorepoints/model_vaultcertificate.go @@ -5,5 +5,5 @@ package restorepoints type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/restorepoints/model_winrmlistener.go b/resource-manager/compute/2024-07-01/restorepoints/model_winrmlistener.go index c9ff579e87e..7d06a9d1480 100644 --- a/resource-manager/compute/2024-07-01/restorepoints/model_winrmlistener.go +++ b/resource-manager/compute/2024-07-01/restorepoints/model_winrmlistener.go @@ -4,6 +4,6 @@ package restorepoints // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/README.md b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/README.md index bad303fe1bb..f3bf0494bbb 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") +id := virtualmachineextensionimages.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineextensionimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListTypes(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") +id := virtualmachineextensionimages.NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") read, err := client.ListVersions(ctx, id, virtualmachineextensionimages.DefaultListVersionsOperationOptions()) if err != nil { diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_publisher.go b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_publisher.go index 26803cae70d..75185dcd3b3 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_publisher.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_publisher_test.go b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_publisher_test.go index a68baea12d2..a1107c02a89 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_publisher_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_type.go b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_type.go index b8d3341bc22..913ad5b4f1d 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_type.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_type.go @@ -119,7 +119,7 @@ func (id TypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_type_test.go b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_type_test.go index 82a20b50cdb..fdd8342e8e0 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_type_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_type_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TypeId{} func TestNewTypeID(t *testing.T) { - id := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName") + id := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewTypeID(t *testing.T) { } func TestFormatTypeID(t *testing.T) { - actual := NewTypeID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName" + actual := NewTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Expected: &TypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_version.go b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_version.go index 56bb407edd5..428dd802d6f 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_version.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_version.go @@ -125,7 +125,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), @@ -133,7 +133,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTypes", "types", "types"), resourceids.UserSpecifiedSegment("typeName", "typeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_version_test.go b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_version_test.go index de6f52198dc..9190aa87b20 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_version_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensionimages/id_version_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -30,14 +30,14 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TypeName'", id.TypeName, "typeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "typeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "typeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", TypeName: "typeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmExtension/types/typeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", TypeName: "tYpEnAmE", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMeXtEnSiOn/tYpEs/tYpEnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensions/README.md b/resource-manager/compute/2024-07-01/virtualmachineextensions/README.md index bb05406ed12..5336eb48e68 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensions/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachineextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") read, err := client.Get(ctx, id, virtualmachineextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") +id := virtualmachineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := virtualmachineextensions.VirtualMachineExtensionUpdate{ // ... diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensions/id_extension.go b/resource-manager/compute/2024-07-01/virtualmachineextensions/id_extension.go index 25ce4dd99cf..72168cd7ce0 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensions/id_extension.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensions/id_extension.go @@ -123,7 +123,7 @@ func (id ExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensions/id_extension_test.go b/resource-manager/compute/2024-07-01/virtualmachineextensions/id_extension_test.go index 6727e3b6c90..29ca0c38d57 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensions/id_extension_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensions/id_extension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExtensionId{} func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName") + id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName" + actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineName: "vIrTuAlMaChInEnAmE", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2024-07-01/virtualmachineextensions/model_keyvaultsecretreference.go index e65598f8f2e..ba308b046a4 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-07-01/virtualmachineextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachineextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/README.md b/resource-manager/compute/2024-07-01/virtualmachineimages/README.md index 21604d63c72..76b13004ce3 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") read, err := client.EdgeZoneGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") +id := virtualmachineimages.NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") read, err := client.EdgeZoneList(ctx, id, virtualmachineimages.DefaultEdgeZoneListOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") +id := virtualmachineimages.NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") read, err := client.EdgeZoneListOffers(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") read, err := client.EdgeZoneListPublishers(ctx, id) if err != nil { @@ -88,7 +88,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") +id := virtualmachineimages.NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") read, err := client.EdgeZoneListSkus(ctx, id) if err != nil { @@ -104,7 +104,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") +id := virtualmachineimages.NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") +id := virtualmachineimages.NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") read, err := client.List(ctx, id, virtualmachineimages.DefaultListOperationOptions()) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") +id := virtualmachineimages.NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") // alternatively `client.ListByEdgeZone(ctx, id)` can be used to do batched pagination items, err := client.ListByEdgeZoneComplete(ctx, id) @@ -153,7 +153,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") +id := virtualmachineimages.NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") read, err := client.ListOffers(ctx, id) if err != nil { @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineimages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListPublishers(ctx, id) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") +id := virtualmachineimages.NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") read, err := client.ListSkus(ctx, id) if err != nil { diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezone.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezone.go index 9decb1ab074..4589fd49c69 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezone.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezone.go @@ -113,9 +113,9 @@ func (id EdgeZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezone_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezone_test.go index 72468a3951b..179025c0a66 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezone_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezone_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &EdgeZoneId{} func TestNewEdgeZoneID(t *testing.T) { - id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone") + id := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } } func TestFormatEdgeZoneID(t *testing.T) { - actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "location", "edgeZone").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone" + actual := NewEdgeZoneID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseEdgeZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseEdgeZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Expected: &EdgeZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezonepublisher.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezonepublisher.go index 270c659bca7..413b714876a 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezonepublisher.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezonepublisher.go @@ -119,9 +119,9 @@ func (id EdgeZonePublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezonepublisher_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezonepublisher_test.go index 0c39297640c..481cc03e568 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezonepublisher_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_edgezonepublisher_test.go @@ -12,18 +12,18 @@ import ( var _ resourceids.ResourceId = &EdgeZonePublisherId{} func TestNewEdgeZonePublisherID(t *testing.T) { - id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName") + id := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { @@ -32,8 +32,8 @@ func TestNewEdgeZonePublisherID(t *testing.T) { } func TestFormatEdgeZonePublisherID(t *testing.T) { - actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName" + actual := NewEdgeZonePublisherID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseEdgeZonePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseEdgeZonePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &EdgeZonePublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_location.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_location.go index 964d6fa45df..bc87fc5d8b3 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_location.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_location_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_location_test.go index 6c81492a53e..ba21e1bba3c 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_location_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offer.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offer.go index 0c2104719a1..555733f938b 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offer.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offer.go @@ -119,13 +119,13 @@ func (id OfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offer_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offer_test.go index da5ed77df1d..20ee9d771ba 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offer_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offer_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &OfferId{} func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer") + id := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewOfferID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,47 +77,47 @@ func TestParseOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -218,92 +218,92 @@ func TestParseOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &OfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offersku.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offersku.go index 4a79b9d3b5e..616277032de 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offersku.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offersku.go @@ -131,17 +131,17 @@ func (id OfferSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offersku_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offersku_test.go index 67473168400..b580e4c3fca 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offersku_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offersku_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &OfferSkuId{} func TestNewOfferSkuID(t *testing.T) { - id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus") + id := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatOfferSkuID(t *testing.T) { - actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewOfferSkuID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseOfferSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseOfferSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &OfferSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offerskuversion.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offerskuversion.go index 7dbff8871b4..c6d89f817f3 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offerskuversion.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offerskuversion.go @@ -137,19 +137,19 @@ func (id OfferSkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offerskuversion_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offerskuversion_test.go index d60eae3c964..e8bc8c4c903 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_offerskuversion_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_offerskuversion_test.go @@ -12,40 +12,40 @@ import ( var _ resourceids.ResourceId = &OfferSkuVersionId{} func TestNewOfferSkuVersionID(t *testing.T) { - id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version") + id := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatOfferSkuVersionID(t *testing.T) { - actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewOfferSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -89,80 +89,80 @@ func TestParseOfferSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -275,158 +275,158 @@ func TestParseOfferSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &OfferSkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_publisher.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_publisher.go index f33e882af34..732498f2f76 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_publisher.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_publisher.go @@ -113,7 +113,7 @@ func (id PublisherId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_publisher_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_publisher_test.go index 441a6a32c0b..320e179981f 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_publisher_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_publisher_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PublisherId{} func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName") + id := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { @@ -28,8 +28,8 @@ func TestNewPublisherID(t *testing.T) { } func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "location", "publisherName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName" + actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePublisherID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePublisherIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Expected: &PublisherId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_sku.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_sku.go index e8d0dddeaac..86196817181 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_sku.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_sku.go @@ -125,15 +125,15 @@ func (id SkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_sku_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_sku_test.go index 0123383d4f7..7148e671250 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_sku_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_sku_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &SkuId{} func TestNewSkuID(t *testing.T) { - id := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus") + id := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } } func TestFormatSkuID(t *testing.T) { - actual := NewSkuID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus" + actual := NewSkuID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseSkuID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseSkuIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", + OfferName: "offerName", + SkuName: "skuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Expected: &SkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_skuversion.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_skuversion.go index 94cefe0168e..e6327d8297c 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_skuversion.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_skuversion.go @@ -131,17 +131,17 @@ func (id SkuVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skus"), + resourceids.UserSpecifiedSegment("skuName", "skuName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_skuversion_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_skuversion_test.go index 153eee929c4..71033afa5fe 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_skuversion_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_skuversion_test.go @@ -12,36 +12,36 @@ import ( var _ resourceids.ResourceId = &SkuVersionId{} func TestNewSkuVersionID(t *testing.T) { - id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version") + id := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } - if id.SkuName != "skus" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skus") + if id.SkuName != "skuName" { + t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatSkuVersionID(t *testing.T) { - actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "location", "publisherName", "offer", "skus", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version" + actual := NewSkuVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "offerName", "skuName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -85,69 +85,69 @@ func TestParseSkuVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, } @@ -256,136 +256,136 @@ func TestParseSkuVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PublisherName: "publisherName", - OfferName: "offer", - SkuName: "skus", - VersionName: "version", + OfferName: "offerName", + SkuName: "skuName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/publishers/publisherName/artifactTypes/vmImage/offers/offer/skus/skus/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/skus/skuName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe", Expected: &SkuVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", - SkuName: "sKuS", - VersionName: "vErSiOn", + OfferName: "oFfErNaMe", + SkuName: "sKuNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/sKuS/sKuS/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/sKuS/sKuNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_vmimageoffer.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_vmimageoffer.go index 1d8939e1fdb..2739d80c546 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_vmimageoffer.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_vmimageoffer.go @@ -125,15 +125,15 @@ func (id VMImageOfferId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEdgeZones", "edgeZones", "edgeZones"), - resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZone"), + resourceids.UserSpecifiedSegment("edgeZoneName", "edgeZoneName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticArtifactTypes", "artifactTypes", "artifactTypes"), resourceids.StaticSegment("staticVmImage", "vmImage", "vmImage"), resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offer"), + resourceids.UserSpecifiedSegment("offerName", "offerName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineimages/id_vmimageoffer_test.go b/resource-manager/compute/2024-07-01/virtualmachineimages/id_vmimageoffer_test.go index 7cef7cc7c1e..1ecef60694e 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineimages/id_vmimageoffer_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineimages/id_vmimageoffer_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VMImageOfferId{} func TestNewVMImageOfferID(t *testing.T) { - id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer") + id := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.EdgeZoneName != "edgeZone" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZone") + if id.EdgeZoneName != "edgeZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'EdgeZoneName'", id.EdgeZoneName, "edgeZoneName") } if id.PublisherName != "publisherName" { t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.OfferName != "offer" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offer") + if id.OfferName != "offerName" { + t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerName") } } func TestFormatVMImageOfferID(t *testing.T) { - actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "location", "edgeZone", "publisherName", "offer").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer" + actual := NewVMImageOfferID("12345678-1234-9876-4563-123456789012", "locationName", "edgeZoneName", "publisherName", "offerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,58 +81,58 @@ func TestParseVMImageOfferID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, } @@ -237,114 +237,114 @@ func TestParseVMImageOfferIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - EdgeZoneName: "edgeZone", + LocationName: "locationName", + EdgeZoneName: "edgeZoneName", PublisherName: "publisherName", - OfferName: "offer", + OfferName: "offerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/edgeZones/edgeZone/publishers/publisherName/artifactTypes/vmImage/offers/offer/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/edgeZones/edgeZoneName/publishers/publisherName/artifactTypes/vmImage/offers/offerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe", Expected: &VMImageOfferId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - EdgeZoneName: "eDgEzOnE", + LocationName: "lOcAtIoNnAmE", + EdgeZoneName: "eDgEzOnEnAmE", PublisherName: "pUbLiShErNaMe", - OfferName: "oFfEr", + OfferName: "oFfErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/eDgEzOnEs/eDgEzOnE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfEr/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/eDgEzOnEs/eDgEzOnEnAmE/pUbLiShErS/pUbLiShErNaMe/aRtIfAcTtYpEs/vMiMaGe/oFfErS/oFfErNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineruncommands/README.md b/resource-manager/compute/2024-07-01/virtualmachineruncommands/README.md index 6d78b6e5772..d7d41816759 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineruncommands/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachineruncommands/README.md @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") +id := virtualmachineruncommands.NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") read, err := client.Get(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachineruncommands.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_location.go b/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_location.go index d8733d6665f..f23f00fe4e6 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_location.go +++ b/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_location_test.go b/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_location_test.go index 83d1e4c6807..a2db8720398 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_location_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_runcommand.go b/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_runcommand.go index 6781693a76f..64a8edf61a9 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_runcommand.go +++ b/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_runcommand.go @@ -113,7 +113,7 @@ func (id RunCommandId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRunCommands", "runCommands", "runCommands"), resourceids.UserSpecifiedSegment("commandId", "commandId"), } diff --git a/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_runcommand_test.go b/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_runcommand_test.go index e45ff7998e6..edd76a46cda 100644 --- a/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_runcommand_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachineruncommands/id_runcommand_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RunCommandId{} func TestNewRunCommandID(t *testing.T) { - id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId") + id := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.CommandId != "commandId" { @@ -28,8 +28,8 @@ func TestNewRunCommandID(t *testing.T) { } func TestFormatRunCommandID(t *testing.T) { - actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "location", "commandId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId" + actual := NewRunCommandID("12345678-1234-9876-4563-123456789012", "locationName", "commandId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRunCommandID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRunCommandIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/runCommands/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/runCommands/commandId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId", Expected: &RunCommandId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", CommandId: "cOmMaNdId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/rUnCoMmAnDs/cOmMaNdId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/rUnCoMmAnDs/cOmMaNdId/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachines/README.md b/resource-manager/compute/2024-07-01/virtualmachines/README.md index d525d2275a4..0364305a521 100644 --- a/resource-manager/compute/2024-07-01/virtualmachines/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachines/README.md @@ -239,7 +239,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachines.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2024-07-01/virtualmachines/id_location.go b/resource-manager/compute/2024-07-01/virtualmachines/id_location.go index 5e0c32a8f32..64438c96c4f 100644 --- a/resource-manager/compute/2024-07-01/virtualmachines/id_location.go +++ b/resource-manager/compute/2024-07-01/virtualmachines/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachines/id_location_test.go b/resource-manager/compute/2024-07-01/virtualmachines/id_location_test.go index 05747f53916..08322a2d3e4 100644 --- a/resource-manager/compute/2024-07-01/virtualmachines/id_location_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachines/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachines/model_keyvaultkeyreference.go b/resource-manager/compute/2024-07-01/virtualmachines/model_keyvaultkeyreference.go index 438a0aef731..c50244524ea 100644 --- a/resource-manager/compute/2024-07-01/virtualmachines/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2024-07-01/virtualmachines/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachines/model_keyvaultsecretreference.go b/resource-manager/compute/2024-07-01/virtualmachines/model_keyvaultsecretreference.go index c9fcd8ae2b8..b739f603f31 100644 --- a/resource-manager/compute/2024-07-01/virtualmachines/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-07-01/virtualmachines/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachines/model_vaultcertificate.go b/resource-manager/compute/2024-07-01/virtualmachines/model_vaultcertificate.go index 5331305fb8f..73f8924cdde 100644 --- a/resource-manager/compute/2024-07-01/virtualmachines/model_vaultcertificate.go +++ b/resource-manager/compute/2024-07-01/virtualmachines/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachines type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachines/model_winrmlistener.go b/resource-manager/compute/2024-07-01/virtualmachines/model_winrmlistener.go index e2a07b49f36..30b38d846e4 100644 --- a/resource-manager/compute/2024-07-01/virtualmachines/model_winrmlistener.go +++ b/resource-manager/compute/2024-07-01/virtualmachines/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/README.md b/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/README.md index 459588dc910..893ede2aa32 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetextensions.DefaultGetOperationOptions()) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") +id := virtualmachinescalesetextensions.NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") payload := virtualmachinescalesetextensions.VirtualMachineScaleSetExtensionUpdate{ // ... diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go index e5f4dfee0c5..371728a2982 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension.go @@ -123,7 +123,7 @@ func (id VirtualMachineScaleSetExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmssExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go index 970622d627b..41e7a35c801 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/id_virtualmachinescalesetextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineScaleSetExtensionId{} func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { - id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName") + id := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineScaleSetExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.ExtensionName != "vmssExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmssExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineScaleSetExtensionID(t *testing.T) { - actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "vmssExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName" + actual := NewVirtualMachineScaleSetExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineScaleSetExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineScaleSetExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - ExtensionName: "vmssExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/vmssExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineScaleSetExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - ExtensionName: "vMsSeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/vMsSeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go index f025c1653d7..31af12dcf1e 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesets/README.md b/resource-manager/compute/2024-07-01/virtualmachinescalesets/README.md index 96977b35922..ea5a47cedbd 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesets/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesets/README.md @@ -225,7 +225,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinescalesets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesets/id_location.go b/resource-manager/compute/2024-07-01/virtualmachinescalesets/id_location.go index 2ecdd131193..1e550001f84 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesets/id_location.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesets/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesets/id_location_test.go b/resource-manager/compute/2024-07-01/virtualmachinescalesets/id_location_test.go index 58dbcd4eaab..f01c16a7142 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesets/id_location_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesets/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_keyvaultsecretreference.go b/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_keyvaultsecretreference.go index 5443aa3fb42..c27479d1430 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_vaultcertificate.go b/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_vaultcertificate.go index 87cebefa156..4e9173b39e6 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_vaultcertificate.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesets type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_winrmlistener.go b/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_winrmlistener.go index 4f07c2d4e68..fbaee700c4e 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_winrmlistener.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesets/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesets // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/README.md b/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/README.md index 37c5278737a..9325f073de7 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") read, err := client.Get(ctx, id, virtualmachinescalesetvmextensions.DefaultGetOperationOptions()) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") +id := virtualmachinescalesetvmextensions.NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") payload := virtualmachinescalesetvmextensions.VirtualMachineScaleSetVMExtensionUpdate{ // ... diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go index af92bc251a2..52f7976168f 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension.go @@ -131,7 +131,7 @@ func (id VirtualMachineExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "vmExtensionName"), + resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go index 2f015fd2e0e..fb282110d45 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/id_virtualmachineextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineExtensionId{} func TestNewVirtualMachineExtensionID(t *testing.T) { - id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName") + id := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewVirtualMachineExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'InstanceId'", id.InstanceId, "instanceId") } - if id.ExtensionName != "vmExtensionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "vmExtensionName") + if id.ExtensionName != "extensionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionName") } } func TestFormatVirtualMachineExtensionID(t *testing.T) { - actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "vmExtensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName" + actual := NewVirtualMachineExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "instanceId", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseVirtualMachineExtensionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseVirtualMachineExtensionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", InstanceId: "instanceId", - ExtensionName: "vmExtensionName", + ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/vmExtensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/instanceId/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &VirtualMachineExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", InstanceId: "iNsTaNcEiD", - ExtensionName: "vMeXtEnSiOnNaMe", + ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/vMeXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/iNsTaNcEiD/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go index 10e945e8ff7..b94a17b7d3d 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetvmextensions/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvmextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go index 831baeaa8f3..641c4d6cecc 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go index e0e510549a1..102c8c99c7f 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_keyvaultsecretreference.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultSecretReference struct { - SecretUrl string `json:"secretUrl"` + SecretURL string `json:"secretUrl"` SourceVault SubResource `json:"sourceVault"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_vaultcertificate.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_vaultcertificate.go index ed0fd87a8a3..2ed3161f67c 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_vaultcertificate.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_vaultcertificate.go @@ -5,5 +5,5 @@ package virtualmachinescalesetvms type VaultCertificate struct { CertificateStore *string `json:"certificateStore,omitempty"` - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_winrmlistener.go b/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_winrmlistener.go index 7b8e4ea9a3b..59cdd2f5c0b 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_winrmlistener.go +++ b/resource-manager/compute/2024-07-01/virtualmachinescalesetvms/model_winrmlistener.go @@ -4,6 +4,6 @@ package virtualmachinescalesetvms // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WinRMListener struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` Protocol *ProtocolTypes `json:"protocol,omitempty"` } diff --git a/resource-manager/compute/2024-07-01/virtualmachinesizes/README.md b/resource-manager/compute/2024-07-01/virtualmachinesizes/README.md index 0feb225917a..4f49ad3a23d 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinesizes/README.md +++ b/resource-manager/compute/2024-07-01/virtualmachinesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/compute/2024-07-01/virtualmachinesizes/id_location.go b/resource-manager/compute/2024-07-01/virtualmachinesizes/id_location.go index c3d426ecfb0..f36bb369b8b 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinesizes/id_location.go +++ b/resource-manager/compute/2024-07-01/virtualmachinesizes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/compute/2024-07-01/virtualmachinesizes/id_location_test.go b/resource-manager/compute/2024-07-01/virtualmachinesizes/id_location_test.go index 1507b0f8398..e60ddc571cb 100644 --- a/resource-manager/compute/2024-07-01/virtualmachinesizes/id_location_test.go +++ b/resource-manager/compute/2024-07-01/virtualmachinesizes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Compute/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/datastores/README.md b/resource-manager/connectedvmware/2022-01-10-preview/datastores/README.md index b2b77fc9e2a..c1bda783855 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/datastores/README.md +++ b/resource-manager/connectedvmware/2022-01-10-preview/datastores/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") payload := datastores.Datastore{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") if err := client.DeleteThenPoll(ctx, id, datastores.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, datastores.DefaultDeleteOperationOption ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") payload := datastores.ResourcePatch{ // ... diff --git a/resource-manager/connectedvmware/2022-01-10-preview/datastores/id_datastore.go b/resource-manager/connectedvmware/2022-01-10-preview/datastores/id_datastore.go index d962a3f2ecd..626d01c3bc1 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/datastores/id_datastore.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/datastores/id_datastore.go @@ -115,7 +115,7 @@ func (id DataStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticDataStores", "dataStores", "dataStores"), - resourceids.UserSpecifiedSegment("dataStoreName", "datastoreName"), + resourceids.UserSpecifiedSegment("dataStoreName", "dataStoreName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/datastores/id_datastore_test.go b/resource-manager/connectedvmware/2022-01-10-preview/datastores/id_datastore_test.go index d5de666906a..c9577f263a9 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/datastores/id_datastore_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/datastores/id_datastore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataStoreId{} func TestNewDataStoreID(t *testing.T) { - id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") + id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataStoreName != "datastoreName" { - t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "datastoreName") + if id.DataStoreName != "dataStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "dataStoreName") } } func TestFormatDataStoreID(t *testing.T) { - actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName" + actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseDataStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/README.md b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/README.md index 6d6ac979b4a..6f4ed8abc82 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/README.md +++ b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := guestagents.NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "name") +id := guestagents.NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "guestAgentName") payload := guestagents.GuestAgent{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := guestagents.NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "name") +id := guestagents.NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "guestAgentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := guestagents.NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "name") +id := guestagents.NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "guestAgentName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestagents.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := guestagents.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") // alternatively `client.ListByVM(ctx, id)` can be used to do batched pagination items, err := client.ListByVMComplete(ctx, id) diff --git a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_guestagent.go b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_guestagent.go index 1db8d963280..616dc4484da 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_guestagent.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_guestagent.go @@ -123,7 +123,7 @@ func (id GuestAgentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticGuestAgents", "guestAgents", "guestAgents"), - resourceids.UserSpecifiedSegment("guestAgentName", "name"), + resourceids.UserSpecifiedSegment("guestAgentName", "guestAgentName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_guestagent_test.go b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_guestagent_test.go index 0af088b36ce..d1b41d5c753 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_guestagent_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_guestagent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GuestAgentId{} func TestNewGuestAgentID(t *testing.T) { - id := NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "name") + id := NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "guestAgentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGuestAgentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } - if id.GuestAgentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'GuestAgentName'", id.GuestAgentName, "name") + if id.GuestAgentName != "guestAgentName" { + t.Fatalf("Expected %q but got %q for Segment 'GuestAgentName'", id.GuestAgentName, "guestAgentName") } } func TestFormatGuestAgentID(t *testing.T) { - actual := NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/name" + actual := NewGuestAgentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "guestAgentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/guestAgentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseGuestAgentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/guestAgentName", Expected: &GuestAgentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - GuestAgentName: "name", + GuestAgentName: "guestAgentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/guestAgentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseGuestAgentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/guestAgentName", Expected: &GuestAgentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - GuestAgentName: "name", + GuestAgentName: "guestAgentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/guestAgents/guestAgentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/gUeStAgEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/gUeStAgEnTs/gUeStAgEnTnAmE", Expected: &GuestAgentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineName: "vIrTuAlMaChInEnAmE", - GuestAgentName: "nAmE", + GuestAgentName: "gUeStAgEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/gUeStAgEnTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/gUeStAgEnTs/gUeStAgEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_virtualmachine.go b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_virtualmachine.go index 63372f57c15..d40ff5d209d 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_virtualmachine.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_virtualmachine.go @@ -115,7 +115,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "name"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_virtualmachine_test.go b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_virtualmachine_test.go index e65403f4a7d..cf6c687b751 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_virtualmachine_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/guestagents/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "name") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineName: "nAmE", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/README.md b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/README.md index 0df2d6e94bf..0e9b2551985 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/README.md +++ b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hybrididentitymetadata.NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "metadataName") +id := hybrididentitymetadata.NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "hybridIdentityMetadataName") payload := hybrididentitymetadata.HybridIdentityMetadata{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hybrididentitymetadata.NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "metadataName") +id := hybrididentitymetadata.NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "hybridIdentityMetadataName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hybrididentitymetadata.NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "metadataName") +id := hybrididentitymetadata.NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "hybridIdentityMetadataName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hybrididentitymetadata.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := hybrididentitymetadata.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") // alternatively `client.ListByVM(ctx, id)` can be used to do batched pagination items, err := client.ListByVMComplete(ctx, id) diff --git a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_hybrididentitymetadata.go b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_hybrididentitymetadata.go index 1fadda3726b..706cbff351f 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_hybrididentitymetadata.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_hybrididentitymetadata.go @@ -123,7 +123,7 @@ func (id HybridIdentityMetadataId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticHybridIdentityMetadata", "hybridIdentityMetadata", "hybridIdentityMetadata"), - resourceids.UserSpecifiedSegment("hybridIdentityMetadataName", "metadataName"), + resourceids.UserSpecifiedSegment("hybridIdentityMetadataName", "hybridIdentityMetadataName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_hybrididentitymetadata_test.go b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_hybrididentitymetadata_test.go index ffafdfdd255..049647bdc8b 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_hybrididentitymetadata_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_hybrididentitymetadata_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HybridIdentityMetadataId{} func TestNewHybridIdentityMetadataID(t *testing.T) { - id := NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "metadataName") + id := NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "hybridIdentityMetadataName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHybridIdentityMetadataID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } - if id.HybridIdentityMetadataName != "metadataName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridIdentityMetadataName'", id.HybridIdentityMetadataName, "metadataName") + if id.HybridIdentityMetadataName != "hybridIdentityMetadataName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridIdentityMetadataName'", id.HybridIdentityMetadataName, "hybridIdentityMetadataName") } } func TestFormatHybridIdentityMetadataID(t *testing.T) { - actual := NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "metadataName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/metadataName" + actual := NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "hybridIdentityMetadataName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/hybridIdentityMetadataName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHybridIdentityMetadataID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/metadataName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/hybridIdentityMetadataName", Expected: &HybridIdentityMetadataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - HybridIdentityMetadataName: "metadataName", + HybridIdentityMetadataName: "hybridIdentityMetadataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/metadataName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/hybridIdentityMetadataName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHybridIdentityMetadataIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/metadataName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/hybridIdentityMetadataName", Expected: &HybridIdentityMetadataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineName: "virtualMachineName", - HybridIdentityMetadataName: "metadataName", + HybridIdentityMetadataName: "hybridIdentityMetadataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/metadataName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/hybridIdentityMetadata/hybridIdentityMetadataName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/hYbRiDiDeNtItYmEtAdAtA/mEtAdAtAnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/hYbRiDiDeNtItYmEtAdAtA/hYbRiDiDeNtItYmEtAdAtAnAmE", Expected: &HybridIdentityMetadataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineName: "vIrTuAlMaChInEnAmE", - HybridIdentityMetadataName: "mEtAdAtAnAmE", + HybridIdentityMetadataName: "hYbRiDiDeNtItYmEtAdAtAnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/hYbRiDiDeNtItYmEtAdAtA/mEtAdAtAnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/hYbRiDiDeNtItYmEtAdAtA/hYbRiDiDeNtItYmEtAdAtAnAmE/extra", Error: true, }, } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_virtualmachine.go b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_virtualmachine.go index 37dd2004f3d..99f79a9e1fe 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_virtualmachine.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_virtualmachine.go @@ -115,7 +115,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "name"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_virtualmachine_test.go b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_virtualmachine_test.go index d220d573477..35c9454f513 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_virtualmachine_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/hybrididentitymetadata/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "name") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineName: "nAmE", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/README.md b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/README.md index 49feb565b6a..816bd21a2f3 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/README.md +++ b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") payload := inventoryitems.InventoryItem{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := inventoryitems.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") // alternatively `client.ListByVCenter(ctx, id)` can be used to do batched pagination items, err := client.ListByVCenterComplete(ctx, id) diff --git a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_inventoryitem.go b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_inventoryitem.go index e51a2b2013d..781ab078a93 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_inventoryitem.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_inventoryitem.go @@ -121,7 +121,7 @@ func (id InventoryItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), resourceids.StaticSegment("staticInventoryItems", "inventoryItems", "inventoryItems"), resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemName"), } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_inventoryitem_test.go b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_inventoryitem_test.go index 06daa738f54..e6f3cf5e2f6 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_inventoryitem_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_inventoryitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InventoryItemId{} func TestNewInventoryItemID(t *testing.T) { - id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") + id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInventoryItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } if id.InventoryItemName != "inventoryItemName" { @@ -32,8 +32,8 @@ func TestNewInventoryItemID(t *testing.T) { } func TestFormatInventoryItemID(t *testing.T) { - actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName" + actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseInventoryItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName/extra", Error: true, }, } @@ -228,7 +228,7 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Error: true, }, { @@ -238,7 +238,7 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems", Error: true, }, { @@ -248,17 +248,17 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_vcenter.go b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_vcenter.go index ec7f9298ebb..cff97b1aa35 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_vcenter.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_vcenter.go @@ -115,7 +115,7 @@ func (id VCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_vcenter_test.go b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_vcenter_test.go index 64aa5c5cac0..e63606cb2f5 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_vcenter_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/inventoryitems/id_vcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VCenterId{} func TestNewVCenterID(t *testing.T) { - id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } } func TestFormatVCenterID(t *testing.T) { - actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName" + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVCenterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVCenterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/README.md b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/README.md index 82f85db6614..23bfea52f5e 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/README.md +++ b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := machineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "extensionName") +id := machineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := machineextensions.MachineExtension{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := machineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "extensionName") +id := machineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := machineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "extensionName") +id := machineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := machineextensions.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := machineextensions.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") // alternatively `client.List(ctx, id, machineextensions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, machineextensions.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := machineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "extensionName") +id := machineextensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") payload := machineextensions.MachineExtensionUpdate{ // ... diff --git a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_extension.go b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_extension.go index 35fdc3c332d..d61557e8933 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_extension.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_extension.go @@ -121,7 +121,7 @@ func (id ExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "name"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), resourceids.UserSpecifiedSegment("extensionName", "extensionName"), } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_extension_test.go b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_extension_test.go index 1c285e6cfe8..a1b17322978 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_extension_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_extension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExtensionId{} func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "extensionName") + id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "name") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } if id.ExtensionName != "extensionName" { @@ -32,8 +32,8 @@ func TestNewExtensionID(t *testing.T) { } func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "extensionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extensions/extensionName" + actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName", "extensionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extensions/extensionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseExtensionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extensions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extensions/extensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extensions/extensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseExtensionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extensions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE/eXtEnSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extensions/extensionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extensions/extensionName", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", ExtensionName: "extensionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extensions/extensionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extensions/extensionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE/eXtEnSiOnS/eXtEnSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe", Expected: &ExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineName: "nAmE", + VirtualMachineName: "vIrTuAlMaChInEnAmE", ExtensionName: "eXtEnSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/eXtEnSiOnS/eXtEnSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_virtualmachine.go b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_virtualmachine.go index 8dfd83c0a94..d8eb8db5376 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_virtualmachine.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_virtualmachine.go @@ -115,7 +115,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "name"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_virtualmachine_test.go b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_virtualmachine_test.go index 581a4138521..3402a46064e 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_virtualmachine_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/machineextensions/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "name") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineName: "nAmE", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/vcenters/README.md b/resource-manager/connectedvmware/2022-01-10-preview/vcenters/README.md index 9f59396a3d0..44ef5f67aaa 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/vcenters/README.md +++ b/resource-manager/connectedvmware/2022-01-10-preview/vcenters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") payload := vcenters.VCenter{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if err := client.DeleteThenPoll(ctx, id, vcenters.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, vcenters.DefaultDeleteOperationOptions( ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") payload := vcenters.ResourcePatch{ // ... diff --git a/resource-manager/connectedvmware/2022-01-10-preview/vcenters/id_vcenter.go b/resource-manager/connectedvmware/2022-01-10-preview/vcenters/id_vcenter.go index ae4464f50a6..18f634927c0 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/vcenters/id_vcenter.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/vcenters/id_vcenter.go @@ -115,7 +115,7 @@ func (id VCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/vcenters/id_vcenter_test.go b/resource-manager/connectedvmware/2022-01-10-preview/vcenters/id_vcenter_test.go index bf94fc94089..d85fb26664a 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/vcenters/id_vcenter_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/vcenters/id_vcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VCenterId{} func TestNewVCenterID(t *testing.T) { - id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } } func TestFormatVCenterID(t *testing.T) { - actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName" + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVCenterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVCenterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/README.md b/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/README.md index 86e9eebb9ea..cffcd9469d1 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/README.md +++ b/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") if err := client.AssessPatchesThenPoll(ctx, id); err != nil { // handle the error @@ -37,7 +37,7 @@ if err := client.AssessPatchesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") payload := virtualmachines.VirtualMachine{ // ... @@ -54,7 +54,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") if err := client.DeleteThenPoll(ctx, id, virtualmachines.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.DeleteThenPoll(ctx, id, virtualmachines.DefaultDeleteOperationO ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") read, err := client.Get(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") payload := virtualmachines.VirtualMachineInstallPatchesParameters{ // ... @@ -133,7 +133,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -145,7 +145,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") if err := client.StartThenPoll(ctx, id); err != nil { // handle the error @@ -157,7 +157,7 @@ if err := client.StartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") payload := virtualmachines.StopVirtualMachineOptions{ // ... @@ -174,7 +174,7 @@ if err := client.StopThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") payload := virtualmachines.VirtualMachineUpdate{ // ... diff --git a/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/id_virtualmachine.go b/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/id_virtualmachine.go index 82f8031e575..ba7606167c4 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/id_virtualmachine.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/id_virtualmachine.go @@ -115,7 +115,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "name"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/id_virtualmachine_test.go b/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/id_virtualmachine_test.go index 92e499027e4..cdc956f1c3f 100644 --- a/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/id_virtualmachine_test.go +++ b/resource-manager/connectedvmware/2022-01-10-preview/virtualmachines/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "name") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineName: "nAmE", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/connectedvmware/2023-10-01/datastores/README.md b/resource-manager/connectedvmware/2023-10-01/datastores/README.md index 020005ded83..9acb582408a 100644 --- a/resource-manager/connectedvmware/2023-10-01/datastores/README.md +++ b/resource-manager/connectedvmware/2023-10-01/datastores/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") payload := datastores.Datastore{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") if err := client.DeleteThenPoll(ctx, id, datastores.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, datastores.DefaultDeleteOperationOption ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") payload := datastores.ResourcePatch{ // ... diff --git a/resource-manager/connectedvmware/2023-10-01/datastores/id_datastore.go b/resource-manager/connectedvmware/2023-10-01/datastores/id_datastore.go index d962a3f2ecd..626d01c3bc1 100644 --- a/resource-manager/connectedvmware/2023-10-01/datastores/id_datastore.go +++ b/resource-manager/connectedvmware/2023-10-01/datastores/id_datastore.go @@ -115,7 +115,7 @@ func (id DataStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticDataStores", "dataStores", "dataStores"), - resourceids.UserSpecifiedSegment("dataStoreName", "datastoreName"), + resourceids.UserSpecifiedSegment("dataStoreName", "dataStoreName"), } } diff --git a/resource-manager/connectedvmware/2023-10-01/datastores/id_datastore_test.go b/resource-manager/connectedvmware/2023-10-01/datastores/id_datastore_test.go index d5de666906a..c9577f263a9 100644 --- a/resource-manager/connectedvmware/2023-10-01/datastores/id_datastore_test.go +++ b/resource-manager/connectedvmware/2023-10-01/datastores/id_datastore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataStoreId{} func TestNewDataStoreID(t *testing.T) { - id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") + id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataStoreName != "datastoreName" { - t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "datastoreName") + if id.DataStoreName != "dataStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "dataStoreName") } } func TestFormatDataStoreID(t *testing.T) { - actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName" + actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseDataStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2023-10-01/inventoryitems/README.md b/resource-manager/connectedvmware/2023-10-01/inventoryitems/README.md index ddfab1a3bff..069a42394c0 100644 --- a/resource-manager/connectedvmware/2023-10-01/inventoryitems/README.md +++ b/resource-manager/connectedvmware/2023-10-01/inventoryitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") payload := inventoryitems.InventoryItem{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := inventoryitems.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") // alternatively `client.ListByVCenter(ctx, id)` can be used to do batched pagination items, err := client.ListByVCenterComplete(ctx, id) diff --git a/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_inventoryitem.go b/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_inventoryitem.go index e51a2b2013d..781ab078a93 100644 --- a/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_inventoryitem.go +++ b/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_inventoryitem.go @@ -121,7 +121,7 @@ func (id InventoryItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), resourceids.StaticSegment("staticInventoryItems", "inventoryItems", "inventoryItems"), resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemName"), } diff --git a/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_inventoryitem_test.go b/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_inventoryitem_test.go index 06daa738f54..e6f3cf5e2f6 100644 --- a/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_inventoryitem_test.go +++ b/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_inventoryitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InventoryItemId{} func TestNewInventoryItemID(t *testing.T) { - id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") + id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInventoryItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } if id.InventoryItemName != "inventoryItemName" { @@ -32,8 +32,8 @@ func TestNewInventoryItemID(t *testing.T) { } func TestFormatInventoryItemID(t *testing.T) { - actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName" + actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseInventoryItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName/extra", Error: true, }, } @@ -228,7 +228,7 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Error: true, }, { @@ -238,7 +238,7 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems", Error: true, }, { @@ -248,17 +248,17 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_vcenter.go b/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_vcenter.go index ec7f9298ebb..cff97b1aa35 100644 --- a/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_vcenter.go +++ b/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_vcenter.go @@ -115,7 +115,7 @@ func (id VCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), } } diff --git a/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_vcenter_test.go b/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_vcenter_test.go index 64aa5c5cac0..e63606cb2f5 100644 --- a/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_vcenter_test.go +++ b/resource-manager/connectedvmware/2023-10-01/inventoryitems/id_vcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VCenterId{} func TestNewVCenterID(t *testing.T) { - id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } } func TestFormatVCenterID(t *testing.T) { - actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName" + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVCenterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVCenterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2023-10-01/vcenters/README.md b/resource-manager/connectedvmware/2023-10-01/vcenters/README.md index 96c0f556960..b09bd982232 100644 --- a/resource-manager/connectedvmware/2023-10-01/vcenters/README.md +++ b/resource-manager/connectedvmware/2023-10-01/vcenters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") payload := vcenters.VCenter{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if err := client.DeleteThenPoll(ctx, id, vcenters.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, vcenters.DefaultDeleteOperationOptions( ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") payload := vcenters.ResourcePatch{ // ... diff --git a/resource-manager/connectedvmware/2023-10-01/vcenters/id_vcenter.go b/resource-manager/connectedvmware/2023-10-01/vcenters/id_vcenter.go index ae4464f50a6..18f634927c0 100644 --- a/resource-manager/connectedvmware/2023-10-01/vcenters/id_vcenter.go +++ b/resource-manager/connectedvmware/2023-10-01/vcenters/id_vcenter.go @@ -115,7 +115,7 @@ func (id VCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), } } diff --git a/resource-manager/connectedvmware/2023-10-01/vcenters/id_vcenter_test.go b/resource-manager/connectedvmware/2023-10-01/vcenters/id_vcenter_test.go index bf94fc94089..d85fb26664a 100644 --- a/resource-manager/connectedvmware/2023-10-01/vcenters/id_vcenter_test.go +++ b/resource-manager/connectedvmware/2023-10-01/vcenters/id_vcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VCenterId{} func TestNewVCenterID(t *testing.T) { - id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } } func TestFormatVCenterID(t *testing.T) { - actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName" + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVCenterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVCenterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/README.md b/resource-manager/connectedvmware/2023-12-01/datastores/README.md index 61ec9ad1ac1..2641c8f6be5 100644 --- a/resource-manager/connectedvmware/2023-12-01/datastores/README.md +++ b/resource-manager/connectedvmware/2023-12-01/datastores/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") payload := datastores.Datastore{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") if err := client.DeleteThenPoll(ctx, id, datastores.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, datastores.DefaultDeleteOperationOption ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") payload := datastores.ResourcePatch{ // ... diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore.go b/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore.go index d962a3f2ecd..626d01c3bc1 100644 --- a/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore.go +++ b/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore.go @@ -115,7 +115,7 @@ func (id DataStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticDataStores", "dataStores", "dataStores"), - resourceids.UserSpecifiedSegment("dataStoreName", "datastoreName"), + resourceids.UserSpecifiedSegment("dataStoreName", "dataStoreName"), } } diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore_test.go b/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore_test.go index d5de666906a..c9577f263a9 100644 --- a/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore_test.go +++ b/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataStoreId{} func TestNewDataStoreID(t *testing.T) { - id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName") + id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataStoreName != "datastoreName" { - t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "datastoreName") + if id.DataStoreName != "dataStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "dataStoreName") } } func TestFormatDataStoreID(t *testing.T) { - actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "datastoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName" + actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseDataStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/README.md b/resource-manager/connectedvmware/2023-12-01/inventoryitems/README.md index abbfb3c6744..49a785dabc9 100644 --- a/resource-manager/connectedvmware/2023-12-01/inventoryitems/README.md +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") payload := inventoryitems.InventoryItem{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := inventoryitems.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") // alternatively `client.ListByVCenter(ctx, id)` can be used to do batched pagination items, err := client.ListByVCenterComplete(ctx, id) diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem.go index e51a2b2013d..781ab078a93 100644 --- a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem.go +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem.go @@ -121,7 +121,7 @@ func (id InventoryItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), resourceids.StaticSegment("staticInventoryItems", "inventoryItems", "inventoryItems"), resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemName"), } diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem_test.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem_test.go index 06daa738f54..e6f3cf5e2f6 100644 --- a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem_test.go +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InventoryItemId{} func TestNewInventoryItemID(t *testing.T) { - id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName") + id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInventoryItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } if id.InventoryItemName != "inventoryItemName" { @@ -32,8 +32,8 @@ func TestNewInventoryItemID(t *testing.T) { } func TestFormatInventoryItemID(t *testing.T) { - actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName", "inventoryItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName" + actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName", "inventoryItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseInventoryItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName/extra", Error: true, }, } @@ -228,7 +228,7 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Error: true, }, { @@ -238,7 +238,7 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems", Error: true, }, { @@ -248,17 +248,17 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/inventoryItems/inventoryItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/inventoryItems/inventoryItemName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter.go index ec7f9298ebb..cff97b1aa35 100644 --- a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter.go +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter.go @@ -115,7 +115,7 @@ func (id VCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), } } diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter_test.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter_test.go index 64aa5c5cac0..e63606cb2f5 100644 --- a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter_test.go +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VCenterId{} func TestNewVCenterID(t *testing.T) { - id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } } func TestFormatVCenterID(t *testing.T) { - actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName" + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVCenterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVCenterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, { diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/README.md b/resource-manager/connectedvmware/2023-12-01/vcenters/README.md index 0ef27aadca0..fbe96c790af 100644 --- a/resource-manager/connectedvmware/2023-12-01/vcenters/README.md +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") payload := vcenters.VCenter{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if err := client.DeleteThenPoll(ctx, id, vcenters.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, vcenters.DefaultDeleteOperationOptions( ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") payload := vcenters.ResourcePatch{ // ... diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter.go b/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter.go index ae4464f50a6..18f634927c0 100644 --- a/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter.go +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter.go @@ -115,7 +115,7 @@ func (id VCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), } } diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter_test.go b/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter_test.go index bf94fc94089..d85fb26664a 100644 --- a/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter_test.go +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VCenterId{} func TestNewVCenterID(t *testing.T) { - id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName") + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } } func TestFormatVCenterID(t *testing.T) { - actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName" + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVCenterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVCenterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VCenterName: "vcenterName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterName/extra", Error: true, }, { diff --git a/resource-manager/consumption/2023-05-01/pricesheet/model_pricesheetdownloadproperties.go b/resource-manager/consumption/2023-05-01/pricesheet/model_pricesheetdownloadproperties.go index 6fb9528e304..41654d16fa8 100644 --- a/resource-manager/consumption/2023-05-01/pricesheet/model_pricesheetdownloadproperties.go +++ b/resource-manager/consumption/2023-05-01/pricesheet/model_pricesheetdownloadproperties.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PricesheetDownloadProperties struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` + DownloadURL *string `json:"downloadUrl,omitempty"` ValidTill *string `json:"validTill,omitempty"` } diff --git a/resource-manager/consumption/2023-11-01/pricesheet/model_pricesheetdownloadproperties.go b/resource-manager/consumption/2023-11-01/pricesheet/model_pricesheetdownloadproperties.go index 6fb9528e304..41654d16fa8 100644 --- a/resource-manager/consumption/2023-11-01/pricesheet/model_pricesheetdownloadproperties.go +++ b/resource-manager/consumption/2023-11-01/pricesheet/model_pricesheetdownloadproperties.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PricesheetDownloadProperties struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` + DownloadURL *string `json:"downloadUrl,omitempty"` ValidTill *string `json:"validTill,omitempty"` } diff --git a/resource-manager/consumption/2024-08-01/pricesheet/model_pricesheetdownloadproperties.go b/resource-manager/consumption/2024-08-01/pricesheet/model_pricesheetdownloadproperties.go index 6fb9528e304..41654d16fa8 100644 --- a/resource-manager/consumption/2024-08-01/pricesheet/model_pricesheetdownloadproperties.go +++ b/resource-manager/consumption/2024-08-01/pricesheet/model_pricesheetdownloadproperties.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PricesheetDownloadProperties struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` + DownloadURL *string `json:"downloadUrl,omitempty"` ValidTill *string `json:"validTill,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/README.md b/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/README.md index b226cbd13d8..2d06326ac6c 100644 --- a/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/README.md +++ b/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availableworkloadprofiles.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availableworkloadprofiles.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.Get(ctx, id)` can be used to do batched pagination items, err := client.GetComplete(ctx, id) diff --git a/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/id_location.go b/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/id_location.go index 76b44e08ffc..dacc92090d2 100644 --- a/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/id_location.go +++ b/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/id_location_test.go b/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/id_location_test.go index 5086b71bbdd..bcbd5a2d787 100644 --- a/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/id_location_test.go +++ b/resource-manager/containerapps/2023-05-01/availableworkloadprofiles/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/billingmeters/README.md b/resource-manager/containerapps/2023-05-01/billingmeters/README.md index be672e692e7..06287a9c4ed 100644 --- a/resource-manager/containerapps/2023-05-01/billingmeters/README.md +++ b/resource-manager/containerapps/2023-05-01/billingmeters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := billingmeters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := billingmeters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2023-05-01/billingmeters/id_location.go b/resource-manager/containerapps/2023-05-01/billingmeters/id_location.go index 4dc27e9450f..67dfea3ecfc 100644 --- a/resource-manager/containerapps/2023-05-01/billingmeters/id_location.go +++ b/resource-manager/containerapps/2023-05-01/billingmeters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerapps/2023-05-01/billingmeters/id_location_test.go b/resource-manager/containerapps/2023-05-01/billingmeters/id_location_test.go index 9382a5a7e79..80dbf95c7f3 100644 --- a/resource-manager/containerapps/2023-05-01/billingmeters/id_location_test.go +++ b/resource-manager/containerapps/2023-05-01/billingmeters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/certificates/README.md b/resource-manager/containerapps/2023-05-01/certificates/README.md index 598629c26cb..7c440e4bedc 100644 --- a/resource-manager/containerapps/2023-05-01/certificates/README.md +++ b/resource-manager/containerapps/2023-05-01/certificates/README.md @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := certificates.Certificate{ // ... @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -168,7 +168,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := certificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := certificates.CertificatePatch{ // ... diff --git a/resource-manager/containerapps/2023-05-01/certificates/id_certificate.go b/resource-manager/containerapps/2023-05-01/certificates/id_certificate.go index 49eb93a7dd2..7832b378511 100644 --- a/resource-manager/containerapps/2023-05-01/certificates/id_certificate.go +++ b/resource-manager/containerapps/2023-05-01/certificates/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/containerapps/2023-05-01/certificates/id_certificate_test.go b/resource-manager/containerapps/2023-05-01/certificates/id_certificate_test.go index a2d47acd2b6..10cb10f8fee 100644 --- a/resource-manager/containerapps/2023-05-01/certificates/id_certificate_test.go +++ b/resource-manager/containerapps/2023-05-01/certificates/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/certificates/id_managedenvironment.go b/resource-manager/containerapps/2023-05-01/certificates/id_managedenvironment.go index bdca1112a93..8f1175a170e 100644 --- a/resource-manager/containerapps/2023-05-01/certificates/id_managedenvironment.go +++ b/resource-manager/containerapps/2023-05-01/certificates/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2023-05-01/certificates/id_managedenvironment_test.go b/resource-manager/containerapps/2023-05-01/certificates/id_managedenvironment_test.go index bc7219cb131..cc957bf2b81 100644 --- a/resource-manager/containerapps/2023-05-01/certificates/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2023-05-01/certificates/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/containerapps/model_containerappsecret.go b/resource-manager/containerapps/2023-05-01/containerapps/model_containerappsecret.go index 5f93d41bec2..757144a4dab 100644 --- a/resource-manager/containerapps/2023-05-01/containerapps/model_containerappsecret.go +++ b/resource-manager/containerapps/2023-05-01/containerapps/model_containerappsecret.go @@ -5,7 +5,7 @@ package containerapps type ContainerAppSecret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/containerapps/model_secret.go b/resource-manager/containerapps/2023-05-01/containerapps/model_secret.go index a1fbe4ec8f6..61a516725a0 100644 --- a/resource-manager/containerapps/2023-05-01/containerapps/model_secret.go +++ b/resource-manager/containerapps/2023-05-01/containerapps/model_secret.go @@ -5,7 +5,7 @@ package containerapps type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/containerappsauthconfigs/model_login.go b/resource-manager/containerapps/2023-05-01/containerappsauthconfigs/model_login.go index 53682d45720..0ba5fd8f699 100644 --- a/resource-manager/containerapps/2023-05-01/containerappsauthconfigs/model_login.go +++ b/resource-manager/containerapps/2023-05-01/containerappsauthconfigs/model_login.go @@ -4,9 +4,9 @@ package containerappsauthconfigs // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Login struct { - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` CookieExpiration *CookieExpiration `json:"cookieExpiration,omitempty"` Nonce *Nonce `json:"nonce,omitempty"` - PreserveUrlFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` + PreserveURLFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` Routes *LoginRoutes `json:"routes,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/containerappssourcecontrols/model_registryinfo.go b/resource-manager/containerapps/2023-05-01/containerappssourcecontrols/model_registryinfo.go index c2f9a160f71..4b1fd214594 100644 --- a/resource-manager/containerapps/2023-05-01/containerappssourcecontrols/model_registryinfo.go +++ b/resource-manager/containerapps/2023-05-01/containerappssourcecontrols/model_registryinfo.go @@ -5,6 +5,6 @@ package containerappssourcecontrols type RegistryInfo struct { RegistryPassword *string `json:"registryPassword,omitempty"` - RegistryUrl *string `json:"registryUrl,omitempty"` + RegistryURL *string `json:"registryUrl,omitempty"` RegistryUserName *string `json:"registryUserName,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/containerappssourcecontrols/model_sourcecontrolproperties.go b/resource-manager/containerapps/2023-05-01/containerappssourcecontrols/model_sourcecontrolproperties.go index 34a25bab4ce..581a51ce039 100644 --- a/resource-manager/containerapps/2023-05-01/containerappssourcecontrols/model_sourcecontrolproperties.go +++ b/resource-manager/containerapps/2023-05-01/containerappssourcecontrols/model_sourcecontrolproperties.go @@ -7,5 +7,5 @@ type SourceControlProperties struct { Branch *string `json:"branch,omitempty"` GitHubActionConfiguration *GithubActionConfiguration `json:"githubActionConfiguration,omitempty"` OperationState *SourceControlOperationState `json:"operationState,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/daprcomponents/README.md b/resource-manager/containerapps/2023-05-01/daprcomponents/README.md index 297ff91e393..34cc431d83c 100644 --- a/resource-manager/containerapps/2023-05-01/daprcomponents/README.md +++ b/resource-manager/containerapps/2023-05-01/daprcomponents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") payload := daprcomponents.DaprComponent{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsGet(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsListSecrets(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") payload := daprcomponents.DaprComponent{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.Delete(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.Get(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := daprcomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -180,7 +180,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.ListSecrets(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2023-05-01/daprcomponents/id_connectedenvironmentdaprcomponent.go b/resource-manager/containerapps/2023-05-01/daprcomponents/id_connectedenvironmentdaprcomponent.go index 79f844365dc..6fd9fb8aaa2 100644 --- a/resource-manager/containerapps/2023-05-01/daprcomponents/id_connectedenvironmentdaprcomponent.go +++ b/resource-manager/containerapps/2023-05-01/daprcomponents/id_connectedenvironmentdaprcomponent.go @@ -123,7 +123,7 @@ func (id ConnectedEnvironmentDaprComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticConnectedEnvironments", "connectedEnvironments", "connectedEnvironments"), resourceids.UserSpecifiedSegment("connectedEnvironmentName", "connectedEnvironmentName"), resourceids.StaticSegment("staticDaprComponents", "daprComponents", "daprComponents"), - resourceids.UserSpecifiedSegment("daprComponentName", "componentName"), + resourceids.UserSpecifiedSegment("daprComponentName", "daprComponentName"), } } diff --git a/resource-manager/containerapps/2023-05-01/daprcomponents/id_connectedenvironmentdaprcomponent_test.go b/resource-manager/containerapps/2023-05-01/daprcomponents/id_connectedenvironmentdaprcomponent_test.go index c4942ae6f03..3f0c9163f05 100644 --- a/resource-manager/containerapps/2023-05-01/daprcomponents/id_connectedenvironmentdaprcomponent_test.go +++ b/resource-manager/containerapps/2023-05-01/daprcomponents/id_connectedenvironmentdaprcomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectedEnvironmentDaprComponentId{} func TestNewConnectedEnvironmentDaprComponentID(t *testing.T) { - id := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") + id := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewConnectedEnvironmentDaprComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ConnectedEnvironmentName'", id.ConnectedEnvironmentName, "connectedEnvironmentName") } - if id.DaprComponentName != "componentName" { - t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "componentName") + if id.DaprComponentName != "daprComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "daprComponentName") } } func TestFormatConnectedEnvironmentDaprComponentID(t *testing.T) { - actual := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName" + actual := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseConnectedEnvironmentDaprComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ConnectedEnvironmentName: "connectedEnvironmentName", - DaprComponentName: "componentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseConnectedEnvironmentDaprComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ConnectedEnvironmentName: "connectedEnvironmentName", - DaprComponentName: "componentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/cOmPoNeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ConnectedEnvironmentName: "cOnNeCtEdEnViRoNmEnTnAmE", - DaprComponentName: "cOmPoNeNtNaMe", + DaprComponentName: "dApRcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/cOmPoNeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/daprcomponents/id_daprcomponent.go b/resource-manager/containerapps/2023-05-01/daprcomponents/id_daprcomponent.go index d5885f637cf..79e702bc196 100644 --- a/resource-manager/containerapps/2023-05-01/daprcomponents/id_daprcomponent.go +++ b/resource-manager/containerapps/2023-05-01/daprcomponents/id_daprcomponent.go @@ -121,9 +121,9 @@ func (id DaprComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDaprComponents", "daprComponents", "daprComponents"), - resourceids.UserSpecifiedSegment("daprComponentName", "componentName"), + resourceids.UserSpecifiedSegment("daprComponentName", "daprComponentName"), } } diff --git a/resource-manager/containerapps/2023-05-01/daprcomponents/id_daprcomponent_test.go b/resource-manager/containerapps/2023-05-01/daprcomponents/id_daprcomponent_test.go index e5df7ec44b3..6710fa76d6a 100644 --- a/resource-manager/containerapps/2023-05-01/daprcomponents/id_daprcomponent_test.go +++ b/resource-manager/containerapps/2023-05-01/daprcomponents/id_daprcomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DaprComponentId{} func TestNewDaprComponentID(t *testing.T) { - id := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") + id := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDaprComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } - if id.DaprComponentName != "componentName" { - t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "componentName") + if id.DaprComponentName != "daprComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "daprComponentName") } } func TestFormatDaprComponentID(t *testing.T) { - actual := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName" + actual := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDaprComponentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDaprComponentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", - DaprComponentName: "cOmPoNeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", + DaprComponentName: "dApRcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/daprcomponents/id_managedenvironment.go b/resource-manager/containerapps/2023-05-01/daprcomponents/id_managedenvironment.go index 61f3c0fc1a8..0b98a11a2b4 100644 --- a/resource-manager/containerapps/2023-05-01/daprcomponents/id_managedenvironment.go +++ b/resource-manager/containerapps/2023-05-01/daprcomponents/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2023-05-01/daprcomponents/id_managedenvironment_test.go b/resource-manager/containerapps/2023-05-01/daprcomponents/id_managedenvironment_test.go index 93df8b89833..3d16f91a9c4 100644 --- a/resource-manager/containerapps/2023-05-01/daprcomponents/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2023-05-01/daprcomponents/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/daprcomponents/model_secret.go b/resource-manager/containerapps/2023-05-01/daprcomponents/model_secret.go index a4647e5d6ec..324d56bf7cf 100644 --- a/resource-manager/containerapps/2023-05-01/daprcomponents/model_secret.go +++ b/resource-manager/containerapps/2023-05-01/daprcomponents/model_secret.go @@ -5,7 +5,7 @@ package daprcomponents type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/diagnostics/README.md b/resource-manager/containerapps/2023-05-01/diagnostics/README.md index e1433c9b122..9f680d2e99c 100644 --- a/resource-manager/containerapps/2023-05-01/diagnostics/README.md +++ b/resource-manager/containerapps/2023-05-01/diagnostics/README.md @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") +id := diagnostics.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") read, err := client.ManagedEnvironmentDiagnosticsGetDetector(ctx, id) if err != nil { @@ -122,7 +122,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentDiagnosticsListDetectors(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentDiagnosticsListDetectorsComplete(ctx, id) @@ -139,7 +139,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.ManagedEnvironmentsDiagnosticsGetRoot(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironment.go b/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironment.go index c0b7d281b8b..9462d806945 100644 --- a/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironment.go +++ b/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironment_test.go b/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironment_test.go index 0bab7b55d10..755e224d05d 100644 --- a/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironmentdetector.go b/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironmentdetector.go index 7492f11bb2f..d6d5c7c0e39 100644 --- a/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironmentdetector.go +++ b/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironmentdetector.go @@ -121,7 +121,7 @@ func (id ManagedEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironmentdetector_test.go b/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironmentdetector_test.go index 833e6202c51..f42632fecd1 100644 --- a/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironmentdetector_test.go +++ b/resource-manager/containerapps/2023-05-01/diagnostics/id_managedenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentDetectorId{} func TestNewManagedEnvironmentDetectorID(t *testing.T) { - id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") + id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { } func TestFormatManagedEnvironmentDetectorID(t *testing.T) { - actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName" + actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/diagnostics/model_secret.go b/resource-manager/containerapps/2023-05-01/diagnostics/model_secret.go index e14eebe103c..5552c0fb8b3 100644 --- a/resource-manager/containerapps/2023-05-01/diagnostics/model_secret.go +++ b/resource-manager/containerapps/2023-05-01/diagnostics/model_secret.go @@ -5,7 +5,7 @@ package diagnostics type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/jobs/README.md b/resource-manager/containerapps/2023-05-01/jobs/README.md index 07bf286239c..20c336276a8 100644 --- a/resource-manager/containerapps/2023-05-01/jobs/README.md +++ b/resource-manager/containerapps/2023-05-01/jobs/README.md @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") +id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") read, err := client.JobExecution(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if err := client.StartThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") +id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") if err := client.StopExecutionThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/containerapps/2023-05-01/jobs/id_execution.go b/resource-manager/containerapps/2023-05-01/jobs/id_execution.go index 0e09a65b4bb..de2369fda60 100644 --- a/resource-manager/containerapps/2023-05-01/jobs/id_execution.go +++ b/resource-manager/containerapps/2023-05-01/jobs/id_execution.go @@ -123,7 +123,7 @@ func (id ExecutionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticJobs", "jobs", "jobs"), resourceids.UserSpecifiedSegment("jobName", "jobName"), resourceids.StaticSegment("staticExecutions", "executions", "executions"), - resourceids.UserSpecifiedSegment("executionName", "jobExecutionName"), + resourceids.UserSpecifiedSegment("executionName", "executionName"), } } diff --git a/resource-manager/containerapps/2023-05-01/jobs/id_execution_test.go b/resource-manager/containerapps/2023-05-01/jobs/id_execution_test.go index 468ca28ab13..259f8df1ae3 100644 --- a/resource-manager/containerapps/2023-05-01/jobs/id_execution_test.go +++ b/resource-manager/containerapps/2023-05-01/jobs/id_execution_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExecutionId{} func TestNewExecutionID(t *testing.T) { - id := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") + id := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExecutionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } - if id.ExecutionName != "jobExecutionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExecutionName'", id.ExecutionName, "jobExecutionName") + if id.ExecutionName != "executionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExecutionName'", id.ExecutionName, "executionName") } } func TestFormatExecutionID(t *testing.T) { - actual := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName" + actual := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExecutionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - ExecutionName: "jobExecutionName", + ExecutionName: "executionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExecutionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - ExecutionName: "jobExecutionName", + ExecutionName: "executionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/jObExEcUtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/eXeCuTiOnNaMe", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", JobName: "jObNaMe", - ExecutionName: "jObExEcUtIoNnAmE", + ExecutionName: "eXeCuTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/jObExEcUtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/eXeCuTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/jobs/model_secret.go b/resource-manager/containerapps/2023-05-01/jobs/model_secret.go index 8aee0a491c3..ceb107ac443 100644 --- a/resource-manager/containerapps/2023-05-01/jobs/model_secret.go +++ b/resource-manager/containerapps/2023-05-01/jobs/model_secret.go @@ -5,7 +5,7 @@ package jobs type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2023-05-01/managedcertificates/README.md b/resource-manager/containerapps/2023-05-01/managedcertificates/README.md index 784d69a28dd..d4c81fe5970 100644 --- a/resource-manager/containerapps/2023-05-01/managedcertificates/README.md +++ b/resource-manager/containerapps/2023-05-01/managedcertificates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedcertificates.ManagedCertificate{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedcertificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedcertificates.ManagedCertificatePatch{ // ... diff --git a/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedcertificate.go b/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedcertificate.go index a3992714c37..f3ed5ed197f 100644 --- a/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedcertificate.go +++ b/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedcertificate.go @@ -121,7 +121,7 @@ func (id ManagedCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticManagedCertificates", "managedCertificates", "managedCertificates"), resourceids.UserSpecifiedSegment("managedCertificateName", "managedCertificateName"), } diff --git a/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedcertificate_test.go b/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedcertificate_test.go index fffa92a24d4..b22355e3dde 100644 --- a/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedcertificate_test.go +++ b/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedCertificateId{} func TestNewManagedCertificateID(t *testing.T) { - id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") + id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.ManagedCertificateName != "managedCertificateName" { @@ -32,8 +32,8 @@ func TestNewManagedCertificateID(t *testing.T) { } func TestFormatManagedCertificateID(t *testing.T) { - actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName" + actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", ManagedCertificateName: "mAnAgEdCeRtIfIcAtEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedenvironment.go b/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedenvironment.go index 9b4ea53f698..1e87b57c6ff 100644 --- a/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedenvironment.go +++ b/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedenvironment_test.go b/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedenvironment_test.go index 04818feb1c9..b21a37c9029 100644 --- a/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2023-05-01/managedcertificates/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/README.md b/resource-manager/containerapps/2023-05-01/managedenvironments/README.md index 93bb34e806d..6e387ea2965 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/README.md +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := managedenvironments.Certificate{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.CertificatesDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.CertificatesGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.CertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CertificatesListComplete(ctx, id) @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := managedenvironments.CertificatePatch{ // ... @@ -116,7 +116,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.ManagedEnvironment{ // ... @@ -133,7 +133,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -145,7 +145,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.DiagnosticsGetRoot(ctx, id) if err != nil { @@ -161,7 +161,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.Get(ctx, id) if err != nil { @@ -177,7 +177,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.GetAuthToken(ctx, id) if err != nil { @@ -227,7 +227,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ListWorkloadProfileStates(ctx, id)` can be used to do batched pagination items, err := client.ListWorkloadProfileStatesComplete(ctx, id) @@ -244,7 +244,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedenvironments.ManagedCertificate{ // ... @@ -261,7 +261,7 @@ if err := client.ManagedCertificatesCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.ManagedCertificatesDelete(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.ManagedCertificatesGet(ctx, id) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedCertificatesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedCertificatesListComplete(ctx, id) @@ -310,7 +310,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedenvironments.ManagedCertificatePatch{ // ... @@ -331,7 +331,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") +id := managedenvironments.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") read, err := client.ManagedEnvironmentDiagnosticsGetDetector(ctx, id) if err != nil { @@ -347,7 +347,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentDiagnosticsListDetectors(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentDiagnosticsListDetectorsComplete(ctx, id) @@ -364,7 +364,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.CheckNameAvailabilityRequest{ // ... @@ -385,7 +385,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.ManagedEnvironment{ // ... diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/id_certificate.go b/resource-manager/containerapps/2023-05-01/managedenvironments/id_certificate.go index bd5f3dea777..193012b6d19 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/id_certificate.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/id_certificate_test.go b/resource-manager/containerapps/2023-05-01/managedenvironments/id_certificate_test.go index 662d550ec60..93c0065d1e4 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/id_certificate_test.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedcertificate.go b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedcertificate.go index 5a6d0991d4a..59ca7e0eed9 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedcertificate.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedcertificate.go @@ -121,7 +121,7 @@ func (id ManagedCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticManagedCertificates", "managedCertificates", "managedCertificates"), resourceids.UserSpecifiedSegment("managedCertificateName", "managedCertificateName"), } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedcertificate_test.go b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedcertificate_test.go index 4c5a0b72b44..e60382d764b 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedcertificate_test.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedCertificateId{} func TestNewManagedCertificateID(t *testing.T) { - id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") + id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.ManagedCertificateName != "managedCertificateName" { @@ -32,8 +32,8 @@ func TestNewManagedCertificateID(t *testing.T) { } func TestFormatManagedCertificateID(t *testing.T) { - actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName" + actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", ManagedCertificateName: "mAnAgEdCeRtIfIcAtEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironment.go b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironment.go index 6bf99e29268..125d668f9b7 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironment.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironment_test.go b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironment_test.go index 00cb40cdb80..498a8e63f64 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironmentdetector.go b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironmentdetector.go index da9e34f72a4..cac551d356c 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironmentdetector.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironmentdetector.go @@ -121,7 +121,7 @@ func (id ManagedEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironmentdetector_test.go b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironmentdetector_test.go index dee9127f6ad..4aeba97785b 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironmentdetector_test.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironments/id_managedenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentDetectorId{} func TestNewManagedEnvironmentDetectorID(t *testing.T) { - id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") + id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { } func TestFormatManagedEnvironmentDetectorID(t *testing.T) { - actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName" + actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/README.md b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/README.md index ae9d8b96585..be40eb591e3 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/README.md +++ b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") payload := managedenvironmentsstorages.ManagedEnvironmentStorage{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironmentsstorages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_managedenvironment.go b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_managedenvironment.go index a1c7dc16d88..1c3e4c89d91 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_managedenvironment.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_managedenvironment_test.go b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_managedenvironment_test.go index 0e01fb1e367..3b2c0c8b236 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_storage.go b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_storage.go index 1e2c729257f..720c4333d52 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_storage.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_storage.go @@ -121,7 +121,7 @@ func (id StorageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticStorages", "storages", "storages"), resourceids.UserSpecifiedSegment("storageName", "storageName"), } diff --git a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_storage_test.go b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_storage_test.go index c1fbfa33b8c..4cac9e97b98 100644 --- a/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_storage_test.go +++ b/resource-manager/containerapps/2023-05-01/managedenvironmentsstorages/id_storage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageId{} func TestNewStorageID(t *testing.T) { - id := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") + id := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.StorageName != "storageName" { @@ -32,8 +32,8 @@ func TestNewStorageID(t *testing.T) { } func TestFormatStorageID(t *testing.T) { - actual := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName" + actual := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", StorageName: "storageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", StorageName: "storageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS/sToRaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS/sToRaGeNaMe", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", StorageName: "sToRaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS/sToRaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS/sToRaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/appresiliency/README.md b/resource-manager/containerapps/2024-02-02-preview/appresiliency/README.md index 77d1b2a57dc..434ca8392bc 100644 --- a/resource-manager/containerapps/2024-02-02-preview/appresiliency/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/appresiliency/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := appresiliency.NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName", "name") +id := appresiliency.NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "resiliencyPolicyName") payload := appresiliency.AppResiliency{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appresiliency.NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName", "name") +id := appresiliency.NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "resiliencyPolicyName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appresiliency.NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName", "name") +id := appresiliency.NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "resiliencyPolicyName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appresiliency.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := appresiliency.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appresiliency.NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName", "name") +id := appresiliency.NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "resiliencyPolicyName") payload := appresiliency.AppResiliency{ // ... diff --git a/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_containerapp.go b/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_containerapp.go index c0a6333325d..a5db030a490 100644 --- a/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_containerapp.go +++ b/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_containerapp.go @@ -115,7 +115,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_containerapp_test.go b/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_containerapp_test.go index fefed75e712..c458e405179 100644 --- a/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_containerapp_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_containerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_resiliencypolicy.go b/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_resiliencypolicy.go index ffe3bd2aed4..71e319e4484 100644 --- a/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_resiliencypolicy.go +++ b/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_resiliencypolicy.go @@ -121,9 +121,9 @@ func (id ResiliencyPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), resourceids.StaticSegment("staticResiliencyPolicies", "resiliencyPolicies", "resiliencyPolicies"), - resourceids.UserSpecifiedSegment("resiliencyPolicyName", "name"), + resourceids.UserSpecifiedSegment("resiliencyPolicyName", "resiliencyPolicyName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_resiliencypolicy_test.go b/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_resiliencypolicy_test.go index fb740d91fd8..03a66fafaf4 100644 --- a/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_resiliencypolicy_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/appresiliency/id_resiliencypolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ResiliencyPolicyId{} func TestNewResiliencyPolicyID(t *testing.T) { - id := NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName", "name") + id := NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "resiliencyPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewResiliencyPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } - if id.ResiliencyPolicyName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ResiliencyPolicyName'", id.ResiliencyPolicyName, "name") + if id.ResiliencyPolicyName != "resiliencyPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ResiliencyPolicyName'", id.ResiliencyPolicyName, "resiliencyPolicyName") } } func TestFormatResiliencyPolicyID(t *testing.T) { - actual := NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/resiliencyPolicies/name" + actual := NewResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "resiliencyPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/resiliencyPolicies/resiliencyPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseResiliencyPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/resiliencyPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/resiliencyPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/resiliencyPolicies/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/resiliencyPolicies/resiliencyPolicyName", Expected: &ResiliencyPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", - ResiliencyPolicyName: "name", + ContainerAppName: "containerAppName", + ResiliencyPolicyName: "resiliencyPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/resiliencyPolicies/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/resiliencyPolicies/resiliencyPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseResiliencyPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/resiliencyPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/resiliencyPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/rEsIlIeNcYpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/rEsIlIeNcYpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/resiliencyPolicies/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/resiliencyPolicies/resiliencyPolicyName", Expected: &ResiliencyPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", - ResiliencyPolicyName: "name", + ContainerAppName: "containerAppName", + ResiliencyPolicyName: "resiliencyPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/resiliencyPolicies/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/resiliencyPolicies/resiliencyPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/rEsIlIeNcYpOlIcIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/rEsIlIeNcYpOlIcIeS/rEsIlIeNcYpOlIcYnAmE", Expected: &ResiliencyPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", - ResiliencyPolicyName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", + ResiliencyPolicyName: "rEsIlIeNcYpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/rEsIlIeNcYpOlIcIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/rEsIlIeNcYpOlIcIeS/rEsIlIeNcYpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/README.md b/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/README.md index d0da1cb9320..d4e7bf7e1d5 100644 --- a/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availableworkloadprofiles.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availableworkloadprofiles.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.Get(ctx, id)` can be used to do batched pagination items, err := client.GetComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/id_location.go b/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/id_location.go index 76b44e08ffc..dacc92090d2 100644 --- a/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/id_location.go +++ b/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/id_location_test.go b/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/id_location_test.go index 5086b71bbdd..bcbd5a2d787 100644 --- a/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/id_location_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/availableworkloadprofiles/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/billingmeters/README.md b/resource-manager/containerapps/2024-02-02-preview/billingmeters/README.md index 589ecc98e69..c29e8d61540 100644 --- a/resource-manager/containerapps/2024-02-02-preview/billingmeters/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/billingmeters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := billingmeters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := billingmeters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2024-02-02-preview/billingmeters/id_location.go b/resource-manager/containerapps/2024-02-02-preview/billingmeters/id_location.go index 4dc27e9450f..67dfea3ecfc 100644 --- a/resource-manager/containerapps/2024-02-02-preview/billingmeters/id_location.go +++ b/resource-manager/containerapps/2024-02-02-preview/billingmeters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/billingmeters/id_location_test.go b/resource-manager/containerapps/2024-02-02-preview/billingmeters/id_location_test.go index 9382a5a7e79..80dbf95c7f3 100644 --- a/resource-manager/containerapps/2024-02-02-preview/billingmeters/id_location_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/billingmeters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/certificates/README.md b/resource-manager/containerapps/2024-02-02-preview/certificates/README.md index df4eb453c14..54f18d8034b 100644 --- a/resource-manager/containerapps/2024-02-02-preview/certificates/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/certificates/README.md @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := certificates.Certificate{ // ... @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -168,7 +168,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := certificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := certificates.CertificatePatch{ // ... diff --git a/resource-manager/containerapps/2024-02-02-preview/certificates/id_certificate.go b/resource-manager/containerapps/2024-02-02-preview/certificates/id_certificate.go index 49eb93a7dd2..7832b378511 100644 --- a/resource-manager/containerapps/2024-02-02-preview/certificates/id_certificate.go +++ b/resource-manager/containerapps/2024-02-02-preview/certificates/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/certificates/id_certificate_test.go b/resource-manager/containerapps/2024-02-02-preview/certificates/id_certificate_test.go index a2d47acd2b6..10cb10f8fee 100644 --- a/resource-manager/containerapps/2024-02-02-preview/certificates/id_certificate_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/certificates/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/certificates/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/certificates/id_managedenvironment.go index bdca1112a93..8f1175a170e 100644 --- a/resource-manager/containerapps/2024-02-02-preview/certificates/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/certificates/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/certificates/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/certificates/id_managedenvironment_test.go index bc7219cb131..cc957bf2b81 100644 --- a/resource-manager/containerapps/2024-02-02-preview/certificates/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/certificates/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/certificates/model_certificatekeyvaultproperties.go b/resource-manager/containerapps/2024-02-02-preview/certificates/model_certificatekeyvaultproperties.go index 7a73c937da0..c52073f7abe 100644 --- a/resource-manager/containerapps/2024-02-02-preview/certificates/model_certificatekeyvaultproperties.go +++ b/resource-manager/containerapps/2024-02-02-preview/certificates/model_certificatekeyvaultproperties.go @@ -5,5 +5,5 @@ package certificates type CertificateKeyVaultProperties struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/connectedenvironments/model_certificatekeyvaultproperties.go b/resource-manager/containerapps/2024-02-02-preview/connectedenvironments/model_certificatekeyvaultproperties.go index a8cd2499ae4..9ae11b726c2 100644 --- a/resource-manager/containerapps/2024-02-02-preview/connectedenvironments/model_certificatekeyvaultproperties.go +++ b/resource-manager/containerapps/2024-02-02-preview/connectedenvironments/model_certificatekeyvaultproperties.go @@ -5,5 +5,5 @@ package connectedenvironments type CertificateKeyVaultProperties struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerapps/README.md b/resource-manager/containerapps/2024-02-02-preview/containerapps/README.md index 98220fc8cd4..dd6ad0ebe1a 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerapps/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/containerapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") payload := containerapps.ContainerApp{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.DiagnosticsGetRoot(ctx, id) if err != nil { @@ -102,7 +102,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.DiagnosticsListDetectors(ctx, id)` can be used to do batched pagination items, err := client.DiagnosticsListDetectorsComplete(ctx, id) @@ -119,7 +119,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.DiagnosticsListRevisions(ctx, id, containerapps.DefaultDiagnosticsListRevisionsOperationOptions())` can be used to do batched pagination items, err := client.DiagnosticsListRevisionsComplete(ctx, id, containerapps.DefaultDiagnosticsListRevisionsOperationOptions()) @@ -136,7 +136,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.Get(ctx, id) if err != nil { @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.GetAuthToken(ctx, id) if err != nil { @@ -202,7 +202,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.ListCustomHostNameAnalysis(ctx, id, containerapps.DefaultListCustomHostNameAnalysisOperationOptions()) if err != nil { @@ -218,7 +218,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.ListSecrets(ctx, id) if err != nil { @@ -234,7 +234,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if err := client.StartThenPoll(ctx, id); err != nil { // handle the error @@ -246,7 +246,7 @@ if err := client.StartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if err := client.StopThenPoll(ctx, id); err != nil { // handle the error @@ -258,7 +258,7 @@ if err := client.StopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") payload := containerapps.ContainerApp{ // ... diff --git a/resource-manager/containerapps/2024-02-02-preview/containerapps/id_containerapp.go b/resource-manager/containerapps/2024-02-02-preview/containerapps/id_containerapp.go index fcd51c31d72..fcbbf0087d6 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerapps/id_containerapp.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerapps/id_containerapp.go @@ -115,7 +115,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerapps/id_containerapp_test.go b/resource-manager/containerapps/2024-02-02-preview/containerapps/id_containerapp_test.go index c07745d0b86..3a29171b576 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerapps/id_containerapp_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerapps/id_containerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerapps/model_containerappsecret.go b/resource-manager/containerapps/2024-02-02-preview/containerapps/model_containerappsecret.go index 5f93d41bec2..757144a4dab 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerapps/model_containerappsecret.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerapps/model_containerappsecret.go @@ -5,7 +5,7 @@ package containerapps type ContainerAppSecret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerapps/model_secret.go b/resource-manager/containerapps/2024-02-02-preview/containerapps/model_secret.go index a1fbe4ec8f6..61a516725a0 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerapps/model_secret.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerapps/model_secret.go @@ -5,7 +5,7 @@ package containerapps type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/README.md b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/README.md index bd1e7e714f6..78ba21ecc92 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/README.md @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsauthconfigs.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerappsauthconfigs.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ListByContainerApp(ctx, id)` can be used to do batched pagination items, err := client.ListByContainerAppComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/id_containerapp.go b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/id_containerapp.go index c92976fd926..c9f7dbaa65b 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/id_containerapp.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/id_containerapp.go @@ -115,7 +115,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/id_containerapp_test.go b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/id_containerapp_test.go index d606d18a414..34ee6ee7456 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/id_containerapp_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/id_containerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/model_blobstoragetokenstore.go b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/model_blobstoragetokenstore.go index 93510fd0017..4f3644b64d9 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/model_blobstoragetokenstore.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/model_blobstoragetokenstore.go @@ -4,5 +4,5 @@ package containerappsauthconfigs // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type BlobStorageTokenStore struct { - SasUrlSettingName string `json:"sasUrlSettingName"` + SasURLSettingName string `json:"sasUrlSettingName"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/model_login.go b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/model_login.go index 98ea1447795..c2abbcaeb5b 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/model_login.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsauthconfigs/model_login.go @@ -4,10 +4,10 @@ package containerappsauthconfigs // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Login struct { - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` CookieExpiration *CookieExpiration `json:"cookieExpiration,omitempty"` Nonce *Nonce `json:"nonce,omitempty"` - PreserveUrlFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` + PreserveURLFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` Routes *LoginRoutes `json:"routes,omitempty"` TokenStore *TokenStore `json:"tokenStore,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/README.md b/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/README.md index 62c072fae95..e9b5c620de8 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerappsbuilds.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerappsbuilds.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ByContainerAppList(ctx, id)` can be used to do batched pagination items, err := client.ByContainerAppListComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/id_containerapp.go b/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/id_containerapp.go index 80d9cd52c19..679778c13eb 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/id_containerapp.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/id_containerapp.go @@ -115,7 +115,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/id_containerapp_test.go b/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/id_containerapp_test.go index 1ac6db4bf7c..28af3433372 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/id_containerapp_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsbuilds/id_containerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappspatches/README.md b/resource-manager/containerapps/2024-02-02-preview/containerappspatches/README.md index 2f519d22c0d..9e813912808 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappspatches/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/containerappspatches/README.md @@ -64,7 +64,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappspatches.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerappspatches.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ListByContainerApp(ctx, id, containerappspatches.DefaultListByContainerAppOperationOptions())` can be used to do batched pagination items, err := client.ListByContainerAppComplete(ctx, id, containerappspatches.DefaultListByContainerAppOperationOptions()) diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappspatches/id_containerapp.go b/resource-manager/containerapps/2024-02-02-preview/containerappspatches/id_containerapp.go index 426381c46d4..d6b1d286405 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappspatches/id_containerapp.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappspatches/id_containerapp.go @@ -115,7 +115,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappspatches/id_containerapp_test.go b/resource-manager/containerapps/2024-02-02-preview/containerappspatches/id_containerapp_test.go index ec2193bfb88..36416e8be44 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappspatches/id_containerapp_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappspatches/id_containerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/README.md b/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/README.md index 377ac784e17..33fa72128dd 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/README.md @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerappsrevisions.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ListRevisions(ctx, id, containerappsrevisions.DefaultListRevisionsOperationOptions())` can be used to do batched pagination items, err := client.ListRevisionsComplete(ctx, id, containerappsrevisions.DefaultListRevisionsOperationOptions()) diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/id_containerapp.go b/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/id_containerapp.go index 9ca44a165d4..02b8ca33474 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/id_containerapp.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/id_containerapp.go @@ -115,7 +115,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/id_containerapp_test.go b/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/id_containerapp_test.go index 702345ba959..0654df56a64 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/id_containerapp_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappsrevisions/id_containerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/README.md b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/README.md index 404a739a537..89682869c8d 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/README.md @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappssourcecontrols.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := containerappssourcecontrols.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ListByContainerApp(ctx, id)` can be used to do batched pagination items, err := client.ListByContainerAppComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/id_containerapp.go b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/id_containerapp.go index a80ac8f69e2..9adb2f4ec75 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/id_containerapp.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/id_containerapp.go @@ -115,7 +115,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/id_containerapp_test.go b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/id_containerapp_test.go index 6de73adec96..83b55f61a57 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/id_containerapp_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/id_containerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/model_registryinfo.go b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/model_registryinfo.go index c2f9a160f71..4b1fd214594 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/model_registryinfo.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/model_registryinfo.go @@ -5,6 +5,6 @@ package containerappssourcecontrols type RegistryInfo struct { RegistryPassword *string `json:"registryPassword,omitempty"` - RegistryUrl *string `json:"registryUrl,omitempty"` + RegistryURL *string `json:"registryUrl,omitempty"` RegistryUserName *string `json:"registryUserName,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/model_sourcecontrolproperties.go b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/model_sourcecontrolproperties.go index 34a25bab4ce..581a51ce039 100644 --- a/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/model_sourcecontrolproperties.go +++ b/resource-manager/containerapps/2024-02-02-preview/containerappssourcecontrols/model_sourcecontrolproperties.go @@ -7,5 +7,5 @@ type SourceControlProperties struct { Branch *string `json:"branch,omitempty"` GitHubActionConfiguration *GithubActionConfiguration `json:"githubActionConfiguration,omitempty"` OperationState *SourceControlOperationState `json:"operationState,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/README.md b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/README.md index 7223db4a5af..562d4e24a4c 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := daprcomponentresiliencypolicies.NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName", "name") +id := daprcomponentresiliencypolicies.NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName", "resiliencyPolicyName") payload := daprcomponentresiliencypolicies.DaprComponentResiliencyPolicy{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponentresiliencypolicies.NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName", "name") +id := daprcomponentresiliencypolicies.NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName", "resiliencyPolicyName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponentresiliencypolicies.NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName", "name") +id := daprcomponentresiliencypolicies.NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName", "resiliencyPolicyName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponentresiliencypolicies.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponentresiliencypolicies.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponent.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponent.go index fa60c076ae4..66221b93698 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponent.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponent.go @@ -121,9 +121,9 @@ func (id DaprComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDaprComponents", "daprComponents", "daprComponents"), - resourceids.UserSpecifiedSegment("daprComponentName", "componentName"), + resourceids.UserSpecifiedSegment("daprComponentName", "daprComponentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponent_test.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponent_test.go index cc36cc5b5b6..70ac404e5d8 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponent_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DaprComponentId{} func TestNewDaprComponentID(t *testing.T) { - id := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") + id := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDaprComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } - if id.DaprComponentName != "componentName" { - t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "componentName") + if id.DaprComponentName != "daprComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "daprComponentName") } } func TestFormatDaprComponentID(t *testing.T) { - actual := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName" + actual := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDaprComponentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDaprComponentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", - DaprComponentName: "cOmPoNeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", + DaprComponentName: "dApRcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponentresiliencypolicy.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponentresiliencypolicy.go index 8e0ee99b6fe..a9ec9288516 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponentresiliencypolicy.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponentresiliencypolicy.go @@ -127,11 +127,11 @@ func (id DaprComponentResiliencyPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDaprComponents", "daprComponents", "daprComponents"), - resourceids.UserSpecifiedSegment("daprComponentName", "componentName"), + resourceids.UserSpecifiedSegment("daprComponentName", "daprComponentName"), resourceids.StaticSegment("staticResiliencyPolicies", "resiliencyPolicies", "resiliencyPolicies"), - resourceids.UserSpecifiedSegment("resiliencyPolicyName", "name"), + resourceids.UserSpecifiedSegment("resiliencyPolicyName", "resiliencyPolicyName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponentresiliencypolicy_test.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponentresiliencypolicy_test.go index af1efe8a22f..c765c8c3419 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponentresiliencypolicy_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponentresiliencypolicies/id_daprcomponentresiliencypolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DaprComponentResiliencyPolicyId{} func TestNewDaprComponentResiliencyPolicyID(t *testing.T) { - id := NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName", "name") + id := NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName", "resiliencyPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewDaprComponentResiliencyPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } - if id.DaprComponentName != "componentName" { - t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "componentName") + if id.DaprComponentName != "daprComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "daprComponentName") } - if id.ResiliencyPolicyName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ResiliencyPolicyName'", id.ResiliencyPolicyName, "name") + if id.ResiliencyPolicyName != "resiliencyPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ResiliencyPolicyName'", id.ResiliencyPolicyName, "resiliencyPolicyName") } } func TestFormatDaprComponentResiliencyPolicyID(t *testing.T) { - actual := NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/resiliencyPolicies/name" + actual := NewDaprComponentResiliencyPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName", "resiliencyPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/resiliencyPolicies/resiliencyPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseDaprComponentResiliencyPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/resiliencyPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/resiliencyPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/resiliencyPolicies/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/resiliencyPolicies/resiliencyPolicyName", Expected: &DaprComponentResiliencyPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", - ResiliencyPolicyName: "name", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", + ResiliencyPolicyName: "resiliencyPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/resiliencyPolicies/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/resiliencyPolicies/resiliencyPolicyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseDaprComponentResiliencyPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/resiliencyPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/resiliencyPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe/rEsIlIeNcYpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/rEsIlIeNcYpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/resiliencyPolicies/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/resiliencyPolicies/resiliencyPolicyName", Expected: &DaprComponentResiliencyPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", - ResiliencyPolicyName: "name", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", + ResiliencyPolicyName: "resiliencyPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/resiliencyPolicies/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/resiliencyPolicies/resiliencyPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe/rEsIlIeNcYpOlIcIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/rEsIlIeNcYpOlIcIeS/rEsIlIeNcYpOlIcYnAmE", Expected: &DaprComponentResiliencyPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", - DaprComponentName: "cOmPoNeNtNaMe", - ResiliencyPolicyName: "nAmE", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", + DaprComponentName: "dApRcOmPoNeNtNaMe", + ResiliencyPolicyName: "rEsIlIeNcYpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe/rEsIlIeNcYpOlIcIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/rEsIlIeNcYpOlIcIeS/rEsIlIeNcYpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/README.md b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/README.md index 2f30df04d78..8ad6167549c 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") payload := daprcomponents.DaprComponent{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsGet(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsListSecrets(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") payload := daprcomponents.DaprComponent{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.Delete(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.Get(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := daprcomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -180,7 +180,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.ListSecrets(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_connectedenvironmentdaprcomponent.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_connectedenvironmentdaprcomponent.go index 79f844365dc..6fd9fb8aaa2 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_connectedenvironmentdaprcomponent.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_connectedenvironmentdaprcomponent.go @@ -123,7 +123,7 @@ func (id ConnectedEnvironmentDaprComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticConnectedEnvironments", "connectedEnvironments", "connectedEnvironments"), resourceids.UserSpecifiedSegment("connectedEnvironmentName", "connectedEnvironmentName"), resourceids.StaticSegment("staticDaprComponents", "daprComponents", "daprComponents"), - resourceids.UserSpecifiedSegment("daprComponentName", "componentName"), + resourceids.UserSpecifiedSegment("daprComponentName", "daprComponentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_connectedenvironmentdaprcomponent_test.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_connectedenvironmentdaprcomponent_test.go index c4942ae6f03..3f0c9163f05 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_connectedenvironmentdaprcomponent_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_connectedenvironmentdaprcomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectedEnvironmentDaprComponentId{} func TestNewConnectedEnvironmentDaprComponentID(t *testing.T) { - id := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") + id := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewConnectedEnvironmentDaprComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ConnectedEnvironmentName'", id.ConnectedEnvironmentName, "connectedEnvironmentName") } - if id.DaprComponentName != "componentName" { - t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "componentName") + if id.DaprComponentName != "daprComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "daprComponentName") } } func TestFormatConnectedEnvironmentDaprComponentID(t *testing.T) { - actual := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName" + actual := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseConnectedEnvironmentDaprComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ConnectedEnvironmentName: "connectedEnvironmentName", - DaprComponentName: "componentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseConnectedEnvironmentDaprComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ConnectedEnvironmentName: "connectedEnvironmentName", - DaprComponentName: "componentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/cOmPoNeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ConnectedEnvironmentName: "cOnNeCtEdEnViRoNmEnTnAmE", - DaprComponentName: "cOmPoNeNtNaMe", + DaprComponentName: "dApRcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/cOmPoNeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_daprcomponent.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_daprcomponent.go index d5885f637cf..79e702bc196 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_daprcomponent.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_daprcomponent.go @@ -121,9 +121,9 @@ func (id DaprComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDaprComponents", "daprComponents", "daprComponents"), - resourceids.UserSpecifiedSegment("daprComponentName", "componentName"), + resourceids.UserSpecifiedSegment("daprComponentName", "daprComponentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_daprcomponent_test.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_daprcomponent_test.go index e5df7ec44b3..6710fa76d6a 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_daprcomponent_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_daprcomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DaprComponentId{} func TestNewDaprComponentID(t *testing.T) { - id := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") + id := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDaprComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } - if id.DaprComponentName != "componentName" { - t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "componentName") + if id.DaprComponentName != "daprComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "daprComponentName") } } func TestFormatDaprComponentID(t *testing.T) { - actual := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName" + actual := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDaprComponentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDaprComponentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", - DaprComponentName: "cOmPoNeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", + DaprComponentName: "dApRcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_managedenvironment.go index 61f3c0fc1a8..0b98a11a2b4 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_managedenvironment_test.go index 93df8b89833..3d16f91a9c4 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/model_secret.go b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/model_secret.go index a4647e5d6ec..324d56bf7cf 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprcomponents/model_secret.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprcomponents/model_secret.go @@ -5,7 +5,7 @@ package daprcomponents type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/README.md b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/README.md index 56453821f94..cf7240b2ecb 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := daprsubscriptions.NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := daprsubscriptions.NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprSubscriptionName") payload := daprsubscriptions.DaprSubscription{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprsubscriptions.NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := daprsubscriptions.NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprSubscriptionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprsubscriptions.NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := daprsubscriptions.NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprSubscriptionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprsubscriptions.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := daprsubscriptions.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_daprsubscription.go b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_daprsubscription.go index 6214eb4db70..5a3a6242c6e 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_daprsubscription.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_daprsubscription.go @@ -121,9 +121,9 @@ func (id DaprSubscriptionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDaprSubscriptions", "daprSubscriptions", "daprSubscriptions"), - resourceids.UserSpecifiedSegment("daprSubscriptionName", "name"), + resourceids.UserSpecifiedSegment("daprSubscriptionName", "daprSubscriptionName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_daprsubscription_test.go b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_daprsubscription_test.go index fdf16c408f2..f19a479b327 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_daprsubscription_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_daprsubscription_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DaprSubscriptionId{} func TestNewDaprSubscriptionID(t *testing.T) { - id := NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") + id := NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprSubscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDaprSubscriptionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } - if id.DaprSubscriptionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DaprSubscriptionName'", id.DaprSubscriptionName, "name") + if id.DaprSubscriptionName != "daprSubscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprSubscriptionName'", id.DaprSubscriptionName, "daprSubscriptionName") } } func TestFormatDaprSubscriptionID(t *testing.T) { - actual := NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprSubscriptions/name" + actual := NewDaprSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprSubscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprSubscriptions/daprSubscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDaprSubscriptionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprSubscriptions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprSubscriptions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprSubscriptions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprSubscriptions/daprSubscriptionName", Expected: &DaprSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprSubscriptionName: "name", + ManagedEnvironmentName: "managedEnvironmentName", + DaprSubscriptionName: "daprSubscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprSubscriptions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprSubscriptions/daprSubscriptionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDaprSubscriptionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprSubscriptions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprSubscriptions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRsUbScRiPtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRsUbScRiPtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprSubscriptions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprSubscriptions/daprSubscriptionName", Expected: &DaprSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprSubscriptionName: "name", + ManagedEnvironmentName: "managedEnvironmentName", + DaprSubscriptionName: "daprSubscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprSubscriptions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprSubscriptions/daprSubscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRsUbScRiPtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRsUbScRiPtIoNs/dApRsUbScRiPtIoNnAmE", Expected: &DaprSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", - DaprSubscriptionName: "nAmE", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", + DaprSubscriptionName: "dApRsUbScRiPtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRsUbScRiPtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRsUbScRiPtIoNs/dApRsUbScRiPtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_managedenvironment.go index 98ef53d0d28..c74c550385b 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_managedenvironment_test.go index af12abd12db..8f581182daf 100644 --- a/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/daprsubscriptions/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/README.md b/resource-manager/containerapps/2024-02-02-preview/diagnostics/README.md index d726cd9a60b..66ddabe4abf 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/README.md @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := diagnostics.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.ContainerAppsDiagnosticsGetRoot(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := diagnostics.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ContainerAppsDiagnosticsListDetectors(ctx, id)` can be used to do batched pagination items, err := client.ContainerAppsDiagnosticsListDetectorsComplete(ctx, id) @@ -89,7 +89,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") +id := diagnostics.NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ContainerAppsDiagnosticsListRevisions(ctx, id, diagnostics.DefaultContainerAppsDiagnosticsListRevisionsOperationOptions())` can be used to do batched pagination items, err := client.ContainerAppsDiagnosticsListRevisionsComplete(ctx, id, diagnostics.DefaultContainerAppsDiagnosticsListRevisionsOperationOptions()) @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") +id := diagnostics.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") read, err := client.ManagedEnvironmentDiagnosticsGetDetector(ctx, id) if err != nil { @@ -171,7 +171,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentDiagnosticsListDetectors(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentDiagnosticsListDetectorsComplete(ctx, id) @@ -188,7 +188,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.ManagedEnvironmentsDiagnosticsGetRoot(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_containerapp.go b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_containerapp.go index b2c0a337ade..ac0b2cd3c60 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_containerapp.go +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_containerapp.go @@ -115,7 +115,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "appName"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_containerapp_test.go b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_containerapp_test.go index b7a50ef18d2..7030ac8b313 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_containerapp_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_containerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "appName" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "appName") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "appName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "appName", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/appName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "aPpNaMe", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/aPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironment.go index c0b7d281b8b..9462d806945 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironment_test.go index 0bab7b55d10..755e224d05d 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironmentdetector.go b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironmentdetector.go index 7492f11bb2f..d6d5c7c0e39 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironmentdetector.go +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironmentdetector.go @@ -121,7 +121,7 @@ func (id ManagedEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironmentdetector_test.go b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironmentdetector_test.go index 833e6202c51..f42632fecd1 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironmentdetector_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/id_managedenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentDetectorId{} func TestNewManagedEnvironmentDetectorID(t *testing.T) { - id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") + id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { } func TestFormatManagedEnvironmentDetectorID(t *testing.T) { - actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName" + actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/model_certificatekeyvaultproperties.go b/resource-manager/containerapps/2024-02-02-preview/diagnostics/model_certificatekeyvaultproperties.go index 5f92bd2cca9..d481a5d6359 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/model_certificatekeyvaultproperties.go +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/model_certificatekeyvaultproperties.go @@ -5,5 +5,5 @@ package diagnostics type CertificateKeyVaultProperties struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/diagnostics/model_secret.go b/resource-manager/containerapps/2024-02-02-preview/diagnostics/model_secret.go index e14eebe103c..5552c0fb8b3 100644 --- a/resource-manager/containerapps/2024-02-02-preview/diagnostics/model_secret.go +++ b/resource-manager/containerapps/2024-02-02-preview/diagnostics/model_secret.go @@ -5,7 +5,7 @@ package diagnostics type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/README.md b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/README.md index 36e1240e3cf..bbf0a1409f5 100644 --- a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dotnetcomponents.NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := dotnetcomponents.NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "dotNetComponentName") payload := dotnetcomponents.DotNetComponent{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := dotnetcomponents.NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := dotnetcomponents.NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "dotNetComponentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := dotnetcomponents.NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := dotnetcomponents.NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "dotNetComponentName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dotnetcomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := dotnetcomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := dotnetcomponents.NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := dotnetcomponents.NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "dotNetComponentName") payload := dotnetcomponents.DotNetComponent{ // ... diff --git a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_dotnetcomponent.go b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_dotnetcomponent.go index efd02111dad..2410986bdc7 100644 --- a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_dotnetcomponent.go +++ b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_dotnetcomponent.go @@ -121,9 +121,9 @@ func (id DotNetComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDotNetComponents", "dotNetComponents", "dotNetComponents"), - resourceids.UserSpecifiedSegment("dotNetComponentName", "name"), + resourceids.UserSpecifiedSegment("dotNetComponentName", "dotNetComponentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_dotnetcomponent_test.go b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_dotnetcomponent_test.go index 9e520c2a7c0..6a324e0dbfa 100644 --- a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_dotnetcomponent_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_dotnetcomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DotNetComponentId{} func TestNewDotNetComponentID(t *testing.T) { - id := NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") + id := NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "dotNetComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDotNetComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } - if id.DotNetComponentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DotNetComponentName'", id.DotNetComponentName, "name") + if id.DotNetComponentName != "dotNetComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DotNetComponentName'", id.DotNetComponentName, "dotNetComponentName") } } func TestFormatDotNetComponentID(t *testing.T) { - actual := NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/dotNetComponents/name" + actual := NewDotNetComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "dotNetComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/dotNetComponents/dotNetComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDotNetComponentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/dotNetComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/dotNetComponents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/dotNetComponents/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/dotNetComponents/dotNetComponentName", Expected: &DotNetComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DotNetComponentName: "name", + ManagedEnvironmentName: "managedEnvironmentName", + DotNetComponentName: "dotNetComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/dotNetComponents/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/dotNetComponents/dotNetComponentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDotNetComponentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/dotNetComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/dotNetComponents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dOtNeTcOmPoNeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dOtNeTcOmPoNeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/dotNetComponents/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/dotNetComponents/dotNetComponentName", Expected: &DotNetComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DotNetComponentName: "name", + ManagedEnvironmentName: "managedEnvironmentName", + DotNetComponentName: "dotNetComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/dotNetComponents/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/dotNetComponents/dotNetComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dOtNeTcOmPoNeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dOtNeTcOmPoNeNtS/dOtNeTcOmPoNeNtNaMe", Expected: &DotNetComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", - DotNetComponentName: "nAmE", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", + DotNetComponentName: "dOtNeTcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dOtNeTcOmPoNeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dOtNeTcOmPoNeNtS/dOtNeTcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_managedenvironment.go index 296b699957c..f6d4bc4cf15 100644 --- a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_managedenvironment_test.go index bd55716a6a1..8f85bb73e58 100644 --- a/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/dotnetcomponents/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/functionsextension/id_function.go b/resource-manager/containerapps/2024-02-02-preview/functionsextension/id_function.go index cb616b2be8a..8cc7b0df066 100644 --- a/resource-manager/containerapps/2024-02-02-preview/functionsextension/id_function.go +++ b/resource-manager/containerapps/2024-02-02-preview/functionsextension/id_function.go @@ -133,7 +133,7 @@ func (id FunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp2", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), - resourceids.UserSpecifiedSegment("functionName", "functionAppName"), + resourceids.UserSpecifiedSegment("functionName", "functionName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/functionsextension/id_function_test.go b/resource-manager/containerapps/2024-02-02-preview/functionsextension/id_function_test.go index af950b37963..86fee327564 100644 --- a/resource-manager/containerapps/2024-02-02-preview/functionsextension/id_function_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/functionsextension/id_function_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionId{} func TestNewFunctionID(t *testing.T) { - id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName", "functionAppName") + id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RevisionName'", id.RevisionName, "revisionName") } - if id.FunctionName != "functionAppName" { - t.Fatalf("Expected %q but got %q for Segment 'FunctionName'", id.FunctionName, "functionAppName") + if id.FunctionName != "functionName" { + t.Fatalf("Expected %q but got %q for Segment 'FunctionName'", id.FunctionName, "functionName") } } func TestFormatFunctionID(t *testing.T) { - actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName", "functionAppName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionAppName" + actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -121,18 +121,18 @@ func TestParseFunctionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ContainerAppName: "containerAppName", RevisionName: "revisionName", - FunctionName: "functionAppName", + FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionName/extra", Error: true, }, } @@ -317,34 +317,34 @@ func TestParseFunctionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ContainerAppName: "containerAppName", RevisionName: "revisionName", - FunctionName: "functionAppName", + FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/containerApps/containerAppName/revisions/revisionName/providers/Microsoft.App/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE/pRoViDeRs/mIcRoSoFt.aPp/fUnCtIoNs/fUnCtIoNaPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE/pRoViDeRs/mIcRoSoFt.aPp/fUnCtIoNs/fUnCtIoNnAmE", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ContainerAppName: "cOnTaInErApPnAmE", RevisionName: "rEvIsIoNnAmE", - FunctionName: "fUnCtIoNaPpNaMe", + FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE/pRoViDeRs/mIcRoSoFt.aPp/fUnCtIoNs/fUnCtIoNaPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE/pRoViDeRs/mIcRoSoFt.aPp/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/javacomponents/README.md b/resource-manager/containerapps/2024-02-02-preview/javacomponents/README.md index e2c6d3c3383..a90c6c3c5f5 100644 --- a/resource-manager/containerapps/2024-02-02-preview/javacomponents/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/javacomponents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := javacomponents.NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := javacomponents.NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "javaComponentName") payload := javacomponents.JavaComponent{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := javacomponents.NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := javacomponents.NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "javaComponentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := javacomponents.NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := javacomponents.NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "javaComponentName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := javacomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := javacomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := javacomponents.NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") +id := javacomponents.NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "javaComponentName") payload := javacomponents.JavaComponent{ // ... diff --git a/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_javacomponent.go b/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_javacomponent.go index 64795295b36..9022042fe5e 100644 --- a/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_javacomponent.go +++ b/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_javacomponent.go @@ -121,9 +121,9 @@ func (id JavaComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticJavaComponents", "javaComponents", "javaComponents"), - resourceids.UserSpecifiedSegment("javaComponentName", "name"), + resourceids.UserSpecifiedSegment("javaComponentName", "javaComponentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_javacomponent_test.go b/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_javacomponent_test.go index 40a86529db6..fabcc9cb227 100644 --- a/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_javacomponent_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_javacomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &JavaComponentId{} func TestNewJavaComponentID(t *testing.T) { - id := NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name") + id := NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "javaComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewJavaComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } - if id.JavaComponentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'JavaComponentName'", id.JavaComponentName, "name") + if id.JavaComponentName != "javaComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'JavaComponentName'", id.JavaComponentName, "javaComponentName") } } func TestFormatJavaComponentID(t *testing.T) { - actual := NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/javaComponents/name" + actual := NewJavaComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "javaComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/javaComponents/javaComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseJavaComponentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/javaComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/javaComponents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/javaComponents/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/javaComponents/javaComponentName", Expected: &JavaComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - JavaComponentName: "name", + ManagedEnvironmentName: "managedEnvironmentName", + JavaComponentName: "javaComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/javaComponents/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/javaComponents/javaComponentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseJavaComponentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/javaComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/javaComponents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/jAvAcOmPoNeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/jAvAcOmPoNeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/javaComponents/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/javaComponents/javaComponentName", Expected: &JavaComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - JavaComponentName: "name", + ManagedEnvironmentName: "managedEnvironmentName", + JavaComponentName: "javaComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/javaComponents/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/javaComponents/javaComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/jAvAcOmPoNeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/jAvAcOmPoNeNtS/jAvAcOmPoNeNtNaMe", Expected: &JavaComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", - JavaComponentName: "nAmE", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", + JavaComponentName: "jAvAcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/jAvAcOmPoNeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/jAvAcOmPoNeNtS/jAvAcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_managedenvironment.go index 29f48037f48..c815734c19a 100644 --- a/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_managedenvironment_test.go index 6bf50181452..673ab32d0a4 100644 --- a/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/javacomponents/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/jobs/README.md b/resource-manager/containerapps/2024-02-02-preview/jobs/README.md index bd5f7f89d7b..10581f93926 100644 --- a/resource-manager/containerapps/2024-02-02-preview/jobs/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/jobs/README.md @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") +id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") read, err := client.JobExecution(ctx, id) if err != nil { @@ -219,7 +219,7 @@ if err := client.StartThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") +id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") if err := client.StopExecutionThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/containerapps/2024-02-02-preview/jobs/id_execution.go b/resource-manager/containerapps/2024-02-02-preview/jobs/id_execution.go index 0e09a65b4bb..de2369fda60 100644 --- a/resource-manager/containerapps/2024-02-02-preview/jobs/id_execution.go +++ b/resource-manager/containerapps/2024-02-02-preview/jobs/id_execution.go @@ -123,7 +123,7 @@ func (id ExecutionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticJobs", "jobs", "jobs"), resourceids.UserSpecifiedSegment("jobName", "jobName"), resourceids.StaticSegment("staticExecutions", "executions", "executions"), - resourceids.UserSpecifiedSegment("executionName", "jobExecutionName"), + resourceids.UserSpecifiedSegment("executionName", "executionName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/jobs/id_execution_test.go b/resource-manager/containerapps/2024-02-02-preview/jobs/id_execution_test.go index 468ca28ab13..259f8df1ae3 100644 --- a/resource-manager/containerapps/2024-02-02-preview/jobs/id_execution_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/jobs/id_execution_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExecutionId{} func TestNewExecutionID(t *testing.T) { - id := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") + id := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExecutionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } - if id.ExecutionName != "jobExecutionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExecutionName'", id.ExecutionName, "jobExecutionName") + if id.ExecutionName != "executionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExecutionName'", id.ExecutionName, "executionName") } } func TestFormatExecutionID(t *testing.T) { - actual := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName" + actual := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExecutionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - ExecutionName: "jobExecutionName", + ExecutionName: "executionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExecutionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - ExecutionName: "jobExecutionName", + ExecutionName: "executionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/jObExEcUtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/eXeCuTiOnNaMe", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", JobName: "jObNaMe", - ExecutionName: "jObExEcUtIoNnAmE", + ExecutionName: "eXeCuTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/jObExEcUtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/eXeCuTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/jobs/model_secret.go b/resource-manager/containerapps/2024-02-02-preview/jobs/model_secret.go index 8aee0a491c3..ceb107ac443 100644 --- a/resource-manager/containerapps/2024-02-02-preview/jobs/model_secret.go +++ b/resource-manager/containerapps/2024-02-02-preview/jobs/model_secret.go @@ -5,7 +5,7 @@ package jobs type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/README.md b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/README.md index b4ef9fe32d4..70d5f9cd1bb 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedcertificates.ManagedCertificate{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedcertificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedcertificates.ManagedCertificatePatch{ // ... diff --git a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedcertificate.go b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedcertificate.go index a3992714c37..f3ed5ed197f 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedcertificate.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedcertificate.go @@ -121,7 +121,7 @@ func (id ManagedCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticManagedCertificates", "managedCertificates", "managedCertificates"), resourceids.UserSpecifiedSegment("managedCertificateName", "managedCertificateName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedcertificate_test.go b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedcertificate_test.go index fffa92a24d4..b22355e3dde 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedcertificate_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedCertificateId{} func TestNewManagedCertificateID(t *testing.T) { - id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") + id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.ManagedCertificateName != "managedCertificateName" { @@ -32,8 +32,8 @@ func TestNewManagedCertificateID(t *testing.T) { } func TestFormatManagedCertificateID(t *testing.T) { - actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName" + actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", ManagedCertificateName: "mAnAgEdCeRtIfIcAtEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedenvironment.go index 9b4ea53f698..1e87b57c6ff 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedenvironment_test.go index 04818feb1c9..b21a37c9029 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedcertificates/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/README.md b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/README.md index 013e65c5660..82dc4c71ebe 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := managedenvironments.Certificate{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.CertificatesDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.CertificatesGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.CertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CertificatesListComplete(ctx, id) @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := managedenvironments.CertificatePatch{ // ... @@ -116,7 +116,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.ManagedEnvironment{ // ... @@ -133,7 +133,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -145,7 +145,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.DiagnosticsGetRoot(ctx, id) if err != nil { @@ -161,7 +161,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.Get(ctx, id) if err != nil { @@ -177,7 +177,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.GetAuthToken(ctx, id) if err != nil { @@ -227,7 +227,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ListWorkloadProfileStates(ctx, id)` can be used to do batched pagination items, err := client.ListWorkloadProfileStatesComplete(ctx, id) @@ -244,7 +244,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedenvironments.ManagedCertificate{ // ... @@ -261,7 +261,7 @@ if err := client.ManagedCertificatesCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.ManagedCertificatesDelete(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.ManagedCertificatesGet(ctx, id) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedCertificatesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedCertificatesListComplete(ctx, id) @@ -310,7 +310,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedenvironments.ManagedCertificatePatch{ // ... @@ -331,7 +331,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") +id := managedenvironments.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") read, err := client.ManagedEnvironmentDiagnosticsGetDetector(ctx, id) if err != nil { @@ -347,7 +347,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentDiagnosticsListDetectors(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentDiagnosticsListDetectorsComplete(ctx, id) @@ -364,7 +364,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName") +id := managedenvironments.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName") payload := managedenvironments.PrivateEndpointConnection{ // ... @@ -381,7 +381,7 @@ if err := client.ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateThenP ```go ctx := context.TODO() -id := managedenvironments.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName") +id := managedenvironments.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName") if err := client.ManagedEnvironmentPrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -393,7 +393,7 @@ if err := client.ManagedEnvironmentPrivateEndpointConnectionsDeleteThenPoll(ctx, ```go ctx := context.TODO() -id := managedenvironments.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName") +id := managedenvironments.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName") read, err := client.ManagedEnvironmentPrivateEndpointConnectionsGet(ctx, id) if err != nil { @@ -409,7 +409,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentPrivateEndpointConnectionsList(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentPrivateEndpointConnectionsListComplete(ctx, id) @@ -426,7 +426,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentPrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentPrivateLinkResourcesListComplete(ctx, id) @@ -443,7 +443,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.CheckNameAvailabilityRequest{ // ... @@ -464,7 +464,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.ManagedEnvironment{ // ... diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_certificate.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_certificate.go index bd5f3dea777..193012b6d19 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_certificate.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_certificate_test.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_certificate_test.go index 662d550ec60..93c0065d1e4 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_certificate_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedcertificate.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedcertificate.go index 5a6d0991d4a..59ca7e0eed9 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedcertificate.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedcertificate.go @@ -121,7 +121,7 @@ func (id ManagedCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticManagedCertificates", "managedCertificates", "managedCertificates"), resourceids.UserSpecifiedSegment("managedCertificateName", "managedCertificateName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedcertificate_test.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedcertificate_test.go index 4c5a0b72b44..e60382d764b 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedcertificate_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedCertificateId{} func TestNewManagedCertificateID(t *testing.T) { - id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") + id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.ManagedCertificateName != "managedCertificateName" { @@ -32,8 +32,8 @@ func TestNewManagedCertificateID(t *testing.T) { } func TestFormatManagedCertificateID(t *testing.T) { - actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName" + actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", ManagedCertificateName: "mAnAgEdCeRtIfIcAtEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironment.go index 6bf99e29268..125d668f9b7 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironment_test.go index 00cb40cdb80..498a8e63f64 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironmentdetector.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironmentdetector.go index da9e34f72a4..cac551d356c 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironmentdetector.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironmentdetector.go @@ -121,7 +121,7 @@ func (id ManagedEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironmentdetector_test.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironmentdetector_test.go index dee9127f6ad..4aeba97785b 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironmentdetector_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_managedenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentDetectorId{} func TestNewManagedEnvironmentDetectorID(t *testing.T) { - id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") + id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { } func TestFormatManagedEnvironmentDetectorID(t *testing.T) { - actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName" + actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_privateendpointconnection.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_privateendpointconnection.go index cfd02110c3f..805eb92f967 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_privateendpointconnection.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_privateendpointconnection_test.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_privateendpointconnection_test.go index f2ef8433069..040a0e6eeb6 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_privateendpointconnection_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/model_certificatekeyvaultproperties.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/model_certificatekeyvaultproperties.go index 9dab28a3a93..7cf010d99ff 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironments/model_certificatekeyvaultproperties.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironments/model_certificatekeyvaultproperties.go @@ -5,5 +5,5 @@ package managedenvironments type CertificateKeyVaultProperties struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/README.md b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/README.md index cd14d11a598..5bd9702bc6a 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") payload := managedenvironmentsstorages.ManagedEnvironmentStorage{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironmentsstorages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_managedenvironment.go index a1c7dc16d88..1c3e4c89d91 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_managedenvironment_test.go index 0e01fb1e367..3b2c0c8b236 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_storage.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_storage.go index 1e2c729257f..720c4333d52 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_storage.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_storage.go @@ -121,7 +121,7 @@ func (id StorageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticStorages", "storages", "storages"), resourceids.UserSpecifiedSegment("storageName", "storageName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_storage_test.go b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_storage_test.go index c1fbfa33b8c..4cac9e97b98 100644 --- a/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_storage_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/managedenvironmentsstorages/id_storage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageId{} func TestNewStorageID(t *testing.T) { - id := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") + id := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.StorageName != "storageName" { @@ -32,8 +32,8 @@ func TestNewStorageID(t *testing.T) { } func TestFormatStorageID(t *testing.T) { - actual := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName" + actual := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", StorageName: "storageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", StorageName: "storageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS/sToRaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS/sToRaGeNaMe", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", StorageName: "sToRaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS/sToRaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS/sToRaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/README.md b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/README.md index db6ec86d9c6..2e68421d019 100644 --- a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.ManagedEnvironmentPrivateEndpointConnectionsCreateOrUpdateThenP ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName") if err := client.ManagedEnvironmentPrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ManagedEnvironmentPrivateEndpointConnectionsDeleteThenPoll(ctx, ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName") read, err := client.ManagedEnvironmentPrivateEndpointConnectionsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := privateendpointconnections.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentPrivateEndpointConnectionsList(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentPrivateEndpointConnectionsListComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_managedenvironment.go index bc11410f20e..a1bdabee964 100644 --- a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_managedenvironment_test.go index eb47a13146a..16158943ddc 100644 --- a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_privateendpointconnection.go index e5d7c701cc5..d3e9f231466 100644 --- a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_privateendpointconnection_test.go index 4a92d99c17c..c5c261a20c5 100644 --- a/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/README.md b/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/README.md index 08f6ae204bd..ebccc246414 100644 --- a/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := privatelinkresources.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentPrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentPrivateLinkResourcesListComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/id_managedenvironment.go index 657151400db..7292780295c 100644 --- a/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/id_managedenvironment_test.go index e1a305fbc12..c1009a4cd49 100644 --- a/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/privatelinkresources/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/usages/README.md b/resource-manager/containerapps/2024-02-02-preview/usages/README.md index 6a9e2c83b61..a252b4fd251 100644 --- a/resource-manager/containerapps/2024-02-02-preview/usages/README.md +++ b/resource-manager/containerapps/2024-02-02-preview/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := usages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := usages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentUsagesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentUsagesListComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-02-02-preview/usages/id_location.go b/resource-manager/containerapps/2024-02-02-preview/usages/id_location.go index 1e1cfd74c31..0d49964ff82 100644 --- a/resource-manager/containerapps/2024-02-02-preview/usages/id_location.go +++ b/resource-manager/containerapps/2024-02-02-preview/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/usages/id_location_test.go b/resource-manager/containerapps/2024-02-02-preview/usages/id_location_test.go index 8ef45ae094e..449191cb377 100644 --- a/resource-manager/containerapps/2024-02-02-preview/usages/id_location_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-02-02-preview/usages/id_managedenvironment.go b/resource-manager/containerapps/2024-02-02-preview/usages/id_managedenvironment.go index 6925469f0c9..cb09115b8e8 100644 --- a/resource-manager/containerapps/2024-02-02-preview/usages/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-02-02-preview/usages/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-02-02-preview/usages/id_managedenvironment_test.go b/resource-manager/containerapps/2024-02-02-preview/usages/id_managedenvironment_test.go index f661d8ed220..b32da7ba8b3 100644 --- a/resource-manager/containerapps/2024-02-02-preview/usages/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-02-02-preview/usages/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/README.md b/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/README.md index 2aec5da2f01..0dc53b10036 100644 --- a/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/README.md +++ b/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availableworkloadprofiles.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availableworkloadprofiles.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.Get(ctx, id)` can be used to do batched pagination items, err := client.GetComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/id_location.go b/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/id_location.go index 76b44e08ffc..dacc92090d2 100644 --- a/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/id_location.go +++ b/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/id_location_test.go b/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/id_location_test.go index 5086b71bbdd..bcbd5a2d787 100644 --- a/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/id_location_test.go +++ b/resource-manager/containerapps/2024-03-01/availableworkloadprofiles/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/billingmeters/README.md b/resource-manager/containerapps/2024-03-01/billingmeters/README.md index c3b71d5d66d..68589e064e2 100644 --- a/resource-manager/containerapps/2024-03-01/billingmeters/README.md +++ b/resource-manager/containerapps/2024-03-01/billingmeters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := billingmeters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := billingmeters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2024-03-01/billingmeters/id_location.go b/resource-manager/containerapps/2024-03-01/billingmeters/id_location.go index 4dc27e9450f..67dfea3ecfc 100644 --- a/resource-manager/containerapps/2024-03-01/billingmeters/id_location.go +++ b/resource-manager/containerapps/2024-03-01/billingmeters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerapps/2024-03-01/billingmeters/id_location_test.go b/resource-manager/containerapps/2024-03-01/billingmeters/id_location_test.go index 9382a5a7e79..80dbf95c7f3 100644 --- a/resource-manager/containerapps/2024-03-01/billingmeters/id_location_test.go +++ b/resource-manager/containerapps/2024-03-01/billingmeters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/certificates/README.md b/resource-manager/containerapps/2024-03-01/certificates/README.md index 4c0b97a9dfd..795a7a5d36a 100644 --- a/resource-manager/containerapps/2024-03-01/certificates/README.md +++ b/resource-manager/containerapps/2024-03-01/certificates/README.md @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := certificates.Certificate{ // ... @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -168,7 +168,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := certificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := certificates.CertificatePatch{ // ... diff --git a/resource-manager/containerapps/2024-03-01/certificates/id_certificate.go b/resource-manager/containerapps/2024-03-01/certificates/id_certificate.go index 49eb93a7dd2..7832b378511 100644 --- a/resource-manager/containerapps/2024-03-01/certificates/id_certificate.go +++ b/resource-manager/containerapps/2024-03-01/certificates/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/containerapps/2024-03-01/certificates/id_certificate_test.go b/resource-manager/containerapps/2024-03-01/certificates/id_certificate_test.go index a2d47acd2b6..10cb10f8fee 100644 --- a/resource-manager/containerapps/2024-03-01/certificates/id_certificate_test.go +++ b/resource-manager/containerapps/2024-03-01/certificates/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/certificates/id_managedenvironment.go b/resource-manager/containerapps/2024-03-01/certificates/id_managedenvironment.go index bdca1112a93..8f1175a170e 100644 --- a/resource-manager/containerapps/2024-03-01/certificates/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-03-01/certificates/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/certificates/id_managedenvironment_test.go b/resource-manager/containerapps/2024-03-01/certificates/id_managedenvironment_test.go index bc7219cb131..cc957bf2b81 100644 --- a/resource-manager/containerapps/2024-03-01/certificates/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-03-01/certificates/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/containerapps/model_containerappsecret.go b/resource-manager/containerapps/2024-03-01/containerapps/model_containerappsecret.go index 5f93d41bec2..757144a4dab 100644 --- a/resource-manager/containerapps/2024-03-01/containerapps/model_containerappsecret.go +++ b/resource-manager/containerapps/2024-03-01/containerapps/model_containerappsecret.go @@ -5,7 +5,7 @@ package containerapps type ContainerAppSecret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-03-01/containerapps/model_secret.go b/resource-manager/containerapps/2024-03-01/containerapps/model_secret.go index a1fbe4ec8f6..61a516725a0 100644 --- a/resource-manager/containerapps/2024-03-01/containerapps/model_secret.go +++ b/resource-manager/containerapps/2024-03-01/containerapps/model_secret.go @@ -5,7 +5,7 @@ package containerapps type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-03-01/containerappsauthconfigs/model_blobstoragetokenstore.go b/resource-manager/containerapps/2024-03-01/containerappsauthconfigs/model_blobstoragetokenstore.go index 93510fd0017..4f3644b64d9 100644 --- a/resource-manager/containerapps/2024-03-01/containerappsauthconfigs/model_blobstoragetokenstore.go +++ b/resource-manager/containerapps/2024-03-01/containerappsauthconfigs/model_blobstoragetokenstore.go @@ -4,5 +4,5 @@ package containerappsauthconfigs // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type BlobStorageTokenStore struct { - SasUrlSettingName string `json:"sasUrlSettingName"` + SasURLSettingName string `json:"sasUrlSettingName"` } diff --git a/resource-manager/containerapps/2024-03-01/containerappsauthconfigs/model_login.go b/resource-manager/containerapps/2024-03-01/containerappsauthconfigs/model_login.go index 98ea1447795..c2abbcaeb5b 100644 --- a/resource-manager/containerapps/2024-03-01/containerappsauthconfigs/model_login.go +++ b/resource-manager/containerapps/2024-03-01/containerappsauthconfigs/model_login.go @@ -4,10 +4,10 @@ package containerappsauthconfigs // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Login struct { - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` CookieExpiration *CookieExpiration `json:"cookieExpiration,omitempty"` Nonce *Nonce `json:"nonce,omitempty"` - PreserveUrlFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` + PreserveURLFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` Routes *LoginRoutes `json:"routes,omitempty"` TokenStore *TokenStore `json:"tokenStore,omitempty"` } diff --git a/resource-manager/containerapps/2024-03-01/containerappssourcecontrols/model_registryinfo.go b/resource-manager/containerapps/2024-03-01/containerappssourcecontrols/model_registryinfo.go index c2f9a160f71..4b1fd214594 100644 --- a/resource-manager/containerapps/2024-03-01/containerappssourcecontrols/model_registryinfo.go +++ b/resource-manager/containerapps/2024-03-01/containerappssourcecontrols/model_registryinfo.go @@ -5,6 +5,6 @@ package containerappssourcecontrols type RegistryInfo struct { RegistryPassword *string `json:"registryPassword,omitempty"` - RegistryUrl *string `json:"registryUrl,omitempty"` + RegistryURL *string `json:"registryUrl,omitempty"` RegistryUserName *string `json:"registryUserName,omitempty"` } diff --git a/resource-manager/containerapps/2024-03-01/containerappssourcecontrols/model_sourcecontrolproperties.go b/resource-manager/containerapps/2024-03-01/containerappssourcecontrols/model_sourcecontrolproperties.go index 34a25bab4ce..581a51ce039 100644 --- a/resource-manager/containerapps/2024-03-01/containerappssourcecontrols/model_sourcecontrolproperties.go +++ b/resource-manager/containerapps/2024-03-01/containerappssourcecontrols/model_sourcecontrolproperties.go @@ -7,5 +7,5 @@ type SourceControlProperties struct { Branch *string `json:"branch,omitempty"` GitHubActionConfiguration *GithubActionConfiguration `json:"githubActionConfiguration,omitempty"` OperationState *SourceControlOperationState `json:"operationState,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` } diff --git a/resource-manager/containerapps/2024-03-01/daprcomponents/README.md b/resource-manager/containerapps/2024-03-01/daprcomponents/README.md index 4b53e0ab22f..98197368eee 100644 --- a/resource-manager/containerapps/2024-03-01/daprcomponents/README.md +++ b/resource-manager/containerapps/2024-03-01/daprcomponents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") payload := daprcomponents.DaprComponent{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsGet(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") +id := daprcomponents.NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") read, err := client.ConnectedEnvironmentsDaprComponentsListSecrets(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") payload := daprcomponents.DaprComponent{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.Delete(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.Get(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := daprcomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := daprcomponents.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -180,7 +180,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") +id := daprcomponents.NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") read, err := client.ListSecrets(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2024-03-01/daprcomponents/id_connectedenvironmentdaprcomponent.go b/resource-manager/containerapps/2024-03-01/daprcomponents/id_connectedenvironmentdaprcomponent.go index 79f844365dc..6fd9fb8aaa2 100644 --- a/resource-manager/containerapps/2024-03-01/daprcomponents/id_connectedenvironmentdaprcomponent.go +++ b/resource-manager/containerapps/2024-03-01/daprcomponents/id_connectedenvironmentdaprcomponent.go @@ -123,7 +123,7 @@ func (id ConnectedEnvironmentDaprComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticConnectedEnvironments", "connectedEnvironments", "connectedEnvironments"), resourceids.UserSpecifiedSegment("connectedEnvironmentName", "connectedEnvironmentName"), resourceids.StaticSegment("staticDaprComponents", "daprComponents", "daprComponents"), - resourceids.UserSpecifiedSegment("daprComponentName", "componentName"), + resourceids.UserSpecifiedSegment("daprComponentName", "daprComponentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/daprcomponents/id_connectedenvironmentdaprcomponent_test.go b/resource-manager/containerapps/2024-03-01/daprcomponents/id_connectedenvironmentdaprcomponent_test.go index c4942ae6f03..3f0c9163f05 100644 --- a/resource-manager/containerapps/2024-03-01/daprcomponents/id_connectedenvironmentdaprcomponent_test.go +++ b/resource-manager/containerapps/2024-03-01/daprcomponents/id_connectedenvironmentdaprcomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectedEnvironmentDaprComponentId{} func TestNewConnectedEnvironmentDaprComponentID(t *testing.T) { - id := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName") + id := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewConnectedEnvironmentDaprComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ConnectedEnvironmentName'", id.ConnectedEnvironmentName, "connectedEnvironmentName") } - if id.DaprComponentName != "componentName" { - t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "componentName") + if id.DaprComponentName != "daprComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "daprComponentName") } } func TestFormatConnectedEnvironmentDaprComponentID(t *testing.T) { - actual := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "componentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName" + actual := NewConnectedEnvironmentDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedEnvironmentName", "daprComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseConnectedEnvironmentDaprComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ConnectedEnvironmentName: "connectedEnvironmentName", - DaprComponentName: "componentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseConnectedEnvironmentDaprComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ConnectedEnvironmentName: "connectedEnvironmentName", - DaprComponentName: "componentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/connectedEnvironments/connectedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/cOmPoNeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe", Expected: &ConnectedEnvironmentDaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ConnectedEnvironmentName: "cOnNeCtEdEnViRoNmEnTnAmE", - DaprComponentName: "cOmPoNeNtNaMe", + DaprComponentName: "dApRcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/cOmPoNeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/cOnNeCtEdEnViRoNmEnTs/cOnNeCtEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/daprcomponents/id_daprcomponent.go b/resource-manager/containerapps/2024-03-01/daprcomponents/id_daprcomponent.go index d5885f637cf..79e702bc196 100644 --- a/resource-manager/containerapps/2024-03-01/daprcomponents/id_daprcomponent.go +++ b/resource-manager/containerapps/2024-03-01/daprcomponents/id_daprcomponent.go @@ -121,9 +121,9 @@ func (id DaprComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDaprComponents", "daprComponents", "daprComponents"), - resourceids.UserSpecifiedSegment("daprComponentName", "componentName"), + resourceids.UserSpecifiedSegment("daprComponentName", "daprComponentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/daprcomponents/id_daprcomponent_test.go b/resource-manager/containerapps/2024-03-01/daprcomponents/id_daprcomponent_test.go index e5df7ec44b3..6710fa76d6a 100644 --- a/resource-manager/containerapps/2024-03-01/daprcomponents/id_daprcomponent_test.go +++ b/resource-manager/containerapps/2024-03-01/daprcomponents/id_daprcomponent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DaprComponentId{} func TestNewDaprComponentID(t *testing.T) { - id := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName") + id := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDaprComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } - if id.DaprComponentName != "componentName" { - t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "componentName") + if id.DaprComponentName != "daprComponentName" { + t.Fatalf("Expected %q but got %q for Segment 'DaprComponentName'", id.DaprComponentName, "daprComponentName") } } func TestFormatDaprComponentID(t *testing.T) { - actual := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "componentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName" + actual := NewDaprComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "daprComponentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDaprComponentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDaprComponentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", - DaprComponentName: "componentName", + ManagedEnvironmentName: "managedEnvironmentName", + DaprComponentName: "daprComponentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/daprComponents/componentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/daprComponents/daprComponentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe", Expected: &DaprComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", - DaprComponentName: "cOmPoNeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", + DaprComponentName: "dApRcOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dApRcOmPoNeNtS/cOmPoNeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dApRcOmPoNeNtS/dApRcOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/daprcomponents/id_managedenvironment.go b/resource-manager/containerapps/2024-03-01/daprcomponents/id_managedenvironment.go index 61f3c0fc1a8..0b98a11a2b4 100644 --- a/resource-manager/containerapps/2024-03-01/daprcomponents/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-03-01/daprcomponents/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/daprcomponents/id_managedenvironment_test.go b/resource-manager/containerapps/2024-03-01/daprcomponents/id_managedenvironment_test.go index 93df8b89833..3d16f91a9c4 100644 --- a/resource-manager/containerapps/2024-03-01/daprcomponents/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-03-01/daprcomponents/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/daprcomponents/model_secret.go b/resource-manager/containerapps/2024-03-01/daprcomponents/model_secret.go index a4647e5d6ec..324d56bf7cf 100644 --- a/resource-manager/containerapps/2024-03-01/daprcomponents/model_secret.go +++ b/resource-manager/containerapps/2024-03-01/daprcomponents/model_secret.go @@ -5,7 +5,7 @@ package daprcomponents type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-03-01/diagnostics/README.md b/resource-manager/containerapps/2024-03-01/diagnostics/README.md index c667c12d13a..5f1282279da 100644 --- a/resource-manager/containerapps/2024-03-01/diagnostics/README.md +++ b/resource-manager/containerapps/2024-03-01/diagnostics/README.md @@ -139,7 +139,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "apiName") +id := diagnostics.NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "detectorPropertyName") read, err := client.JobsProxyGet(ctx, id) if err != nil { @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") +id := diagnostics.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") read, err := client.ManagedEnvironmentDiagnosticsGetDetector(ctx, id) if err != nil { @@ -171,7 +171,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentDiagnosticsListDetectors(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentDiagnosticsListDetectorsComplete(ctx, id) @@ -188,7 +188,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := diagnostics.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.ManagedEnvironmentsDiagnosticsGetRoot(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2024-03-01/diagnostics/id_detectorproperty.go b/resource-manager/containerapps/2024-03-01/diagnostics/id_detectorproperty.go index 022d4402286..c04bd05517d 100644 --- a/resource-manager/containerapps/2024-03-01/diagnostics/id_detectorproperty.go +++ b/resource-manager/containerapps/2024-03-01/diagnostics/id_detectorproperty.go @@ -123,7 +123,7 @@ func (id DetectorPropertyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticJobs", "jobs", "jobs"), resourceids.UserSpecifiedSegment("jobName", "jobName"), resourceids.StaticSegment("staticDetectorProperties", "detectorProperties", "detectorProperties"), - resourceids.UserSpecifiedSegment("detectorPropertyName", "apiName"), + resourceids.UserSpecifiedSegment("detectorPropertyName", "detectorPropertyName"), } } diff --git a/resource-manager/containerapps/2024-03-01/diagnostics/id_detectorproperty_test.go b/resource-manager/containerapps/2024-03-01/diagnostics/id_detectorproperty_test.go index d9c51c3988a..4910029dab6 100644 --- a/resource-manager/containerapps/2024-03-01/diagnostics/id_detectorproperty_test.go +++ b/resource-manager/containerapps/2024-03-01/diagnostics/id_detectorproperty_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DetectorPropertyId{} func TestNewDetectorPropertyID(t *testing.T) { - id := NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "apiName") + id := NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "detectorPropertyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDetectorPropertyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } - if id.DetectorPropertyName != "apiName" { - t.Fatalf("Expected %q but got %q for Segment 'DetectorPropertyName'", id.DetectorPropertyName, "apiName") + if id.DetectorPropertyName != "detectorPropertyName" { + t.Fatalf("Expected %q but got %q for Segment 'DetectorPropertyName'", id.DetectorPropertyName, "detectorPropertyName") } } func TestFormatDetectorPropertyID(t *testing.T) { - actual := NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "apiName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName" + actual := NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "detectorPropertyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDetectorPropertyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName", Expected: &DetectorPropertyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - DetectorPropertyName: "apiName", + DetectorPropertyName: "detectorPropertyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDetectorPropertyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName", Expected: &DetectorPropertyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - DetectorPropertyName: "apiName", + DetectorPropertyName: "detectorPropertyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/dEtEcToRpRoPeRtIeS/aPiNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/dEtEcToRpRoPeRtIeS/dEtEcToRpRoPeRtYnAmE", Expected: &DetectorPropertyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", JobName: "jObNaMe", - DetectorPropertyName: "aPiNaMe", + DetectorPropertyName: "dEtEcToRpRoPeRtYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/dEtEcToRpRoPeRtIeS/aPiNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/dEtEcToRpRoPeRtIeS/dEtEcToRpRoPeRtYnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironment.go b/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironment.go index c0b7d281b8b..9462d806945 100644 --- a/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironment_test.go b/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironment_test.go index 0bab7b55d10..755e224d05d 100644 --- a/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironmentdetector.go b/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironmentdetector.go index 7492f11bb2f..d6d5c7c0e39 100644 --- a/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironmentdetector.go +++ b/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironmentdetector.go @@ -121,7 +121,7 @@ func (id ManagedEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironmentdetector_test.go b/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironmentdetector_test.go index 833e6202c51..f42632fecd1 100644 --- a/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironmentdetector_test.go +++ b/resource-manager/containerapps/2024-03-01/diagnostics/id_managedenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentDetectorId{} func TestNewManagedEnvironmentDetectorID(t *testing.T) { - id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") + id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { } func TestFormatManagedEnvironmentDetectorID(t *testing.T) { - actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName" + actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/diagnostics/model_secret.go b/resource-manager/containerapps/2024-03-01/diagnostics/model_secret.go index e14eebe103c..5552c0fb8b3 100644 --- a/resource-manager/containerapps/2024-03-01/diagnostics/model_secret.go +++ b/resource-manager/containerapps/2024-03-01/diagnostics/model_secret.go @@ -5,7 +5,7 @@ package diagnostics type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-03-01/jobs/README.md b/resource-manager/containerapps/2024-03-01/jobs/README.md index d42e34b8753..ae8a40fa10b 100644 --- a/resource-manager/containerapps/2024-03-01/jobs/README.md +++ b/resource-manager/containerapps/2024-03-01/jobs/README.md @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") +id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") read, err := client.JobExecution(ctx, id) if err != nil { @@ -186,7 +186,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := jobs.NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "apiName") +id := jobs.NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "detectorPropertyName") read, err := client.ProxyGet(ctx, id) if err != nil { @@ -219,7 +219,7 @@ if err := client.StartThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") +id := jobs.NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") if err := client.StopExecutionThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/containerapps/2024-03-01/jobs/id_detectorproperty.go b/resource-manager/containerapps/2024-03-01/jobs/id_detectorproperty.go index 53ceeabf13e..49d9bea5bb9 100644 --- a/resource-manager/containerapps/2024-03-01/jobs/id_detectorproperty.go +++ b/resource-manager/containerapps/2024-03-01/jobs/id_detectorproperty.go @@ -123,7 +123,7 @@ func (id DetectorPropertyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticJobs", "jobs", "jobs"), resourceids.UserSpecifiedSegment("jobName", "jobName"), resourceids.StaticSegment("staticDetectorProperties", "detectorProperties", "detectorProperties"), - resourceids.UserSpecifiedSegment("detectorPropertyName", "apiName"), + resourceids.UserSpecifiedSegment("detectorPropertyName", "detectorPropertyName"), } } diff --git a/resource-manager/containerapps/2024-03-01/jobs/id_detectorproperty_test.go b/resource-manager/containerapps/2024-03-01/jobs/id_detectorproperty_test.go index fbe46729b69..ad40b146bba 100644 --- a/resource-manager/containerapps/2024-03-01/jobs/id_detectorproperty_test.go +++ b/resource-manager/containerapps/2024-03-01/jobs/id_detectorproperty_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DetectorPropertyId{} func TestNewDetectorPropertyID(t *testing.T) { - id := NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "apiName") + id := NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "detectorPropertyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDetectorPropertyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } - if id.DetectorPropertyName != "apiName" { - t.Fatalf("Expected %q but got %q for Segment 'DetectorPropertyName'", id.DetectorPropertyName, "apiName") + if id.DetectorPropertyName != "detectorPropertyName" { + t.Fatalf("Expected %q but got %q for Segment 'DetectorPropertyName'", id.DetectorPropertyName, "detectorPropertyName") } } func TestFormatDetectorPropertyID(t *testing.T) { - actual := NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "apiName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName" + actual := NewDetectorPropertyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "detectorPropertyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDetectorPropertyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName", Expected: &DetectorPropertyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - DetectorPropertyName: "apiName", + DetectorPropertyName: "detectorPropertyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDetectorPropertyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName", Expected: &DetectorPropertyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - DetectorPropertyName: "apiName", + DetectorPropertyName: "detectorPropertyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/detectorProperties/detectorPropertyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/dEtEcToRpRoPeRtIeS/aPiNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/dEtEcToRpRoPeRtIeS/dEtEcToRpRoPeRtYnAmE", Expected: &DetectorPropertyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", JobName: "jObNaMe", - DetectorPropertyName: "aPiNaMe", + DetectorPropertyName: "dEtEcToRpRoPeRtYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/dEtEcToRpRoPeRtIeS/aPiNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/dEtEcToRpRoPeRtIeS/dEtEcToRpRoPeRtYnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/jobs/id_execution.go b/resource-manager/containerapps/2024-03-01/jobs/id_execution.go index 0e09a65b4bb..de2369fda60 100644 --- a/resource-manager/containerapps/2024-03-01/jobs/id_execution.go +++ b/resource-manager/containerapps/2024-03-01/jobs/id_execution.go @@ -123,7 +123,7 @@ func (id ExecutionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticJobs", "jobs", "jobs"), resourceids.UserSpecifiedSegment("jobName", "jobName"), resourceids.StaticSegment("staticExecutions", "executions", "executions"), - resourceids.UserSpecifiedSegment("executionName", "jobExecutionName"), + resourceids.UserSpecifiedSegment("executionName", "executionName"), } } diff --git a/resource-manager/containerapps/2024-03-01/jobs/id_execution_test.go b/resource-manager/containerapps/2024-03-01/jobs/id_execution_test.go index 468ca28ab13..259f8df1ae3 100644 --- a/resource-manager/containerapps/2024-03-01/jobs/id_execution_test.go +++ b/resource-manager/containerapps/2024-03-01/jobs/id_execution_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExecutionId{} func TestNewExecutionID(t *testing.T) { - id := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName") + id := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExecutionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } - if id.ExecutionName != "jobExecutionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExecutionName'", id.ExecutionName, "jobExecutionName") + if id.ExecutionName != "executionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExecutionName'", id.ExecutionName, "executionName") } } func TestFormatExecutionID(t *testing.T) { - actual := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "jobExecutionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName" + actual := NewExecutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "executionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExecutionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - ExecutionName: "jobExecutionName", + ExecutionName: "executionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExecutionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", JobName: "jobName", - ExecutionName: "jobExecutionName", + ExecutionName: "executionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/jobExecutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/jobs/jobName/executions/executionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/jObExEcUtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/eXeCuTiOnNaMe", Expected: &ExecutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", JobName: "jObNaMe", - ExecutionName: "jObExEcUtIoNnAmE", + ExecutionName: "eXeCuTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/jObExEcUtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/jObS/jObNaMe/eXeCuTiOnS/eXeCuTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/jobs/model_secret.go b/resource-manager/containerapps/2024-03-01/jobs/model_secret.go index 8aee0a491c3..ceb107ac443 100644 --- a/resource-manager/containerapps/2024-03-01/jobs/model_secret.go +++ b/resource-manager/containerapps/2024-03-01/jobs/model_secret.go @@ -5,7 +5,7 @@ package jobs type Secret struct { Identity *string `json:"identity,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } diff --git a/resource-manager/containerapps/2024-03-01/managedcertificates/README.md b/resource-manager/containerapps/2024-03-01/managedcertificates/README.md index fc0ad524767..a4df4e46019 100644 --- a/resource-manager/containerapps/2024-03-01/managedcertificates/README.md +++ b/resource-manager/containerapps/2024-03-01/managedcertificates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedcertificates.ManagedCertificate{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcertificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedcertificates.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedcertificates.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedcertificates.ManagedCertificatePatch{ // ... diff --git a/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedcertificate.go b/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedcertificate.go index a3992714c37..f3ed5ed197f 100644 --- a/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedcertificate.go +++ b/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedcertificate.go @@ -121,7 +121,7 @@ func (id ManagedCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticManagedCertificates", "managedCertificates", "managedCertificates"), resourceids.UserSpecifiedSegment("managedCertificateName", "managedCertificateName"), } diff --git a/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedcertificate_test.go b/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedcertificate_test.go index fffa92a24d4..b22355e3dde 100644 --- a/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedcertificate_test.go +++ b/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedCertificateId{} func TestNewManagedCertificateID(t *testing.T) { - id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") + id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.ManagedCertificateName != "managedCertificateName" { @@ -32,8 +32,8 @@ func TestNewManagedCertificateID(t *testing.T) { } func TestFormatManagedCertificateID(t *testing.T) { - actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName" + actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", ManagedCertificateName: "mAnAgEdCeRtIfIcAtEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedenvironment.go b/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedenvironment.go index 9b4ea53f698..1e87b57c6ff 100644 --- a/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedenvironment_test.go b/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedenvironment_test.go index 04818feb1c9..b21a37c9029 100644 --- a/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-03-01/managedcertificates/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/README.md b/resource-manager/containerapps/2024-03-01/managedenvironments/README.md index e772c3b3b1a..4493193db8d 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/README.md +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := managedenvironments.Certificate{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.CertificatesDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") read, err := client.CertificatesGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.CertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CertificatesListComplete(ctx, id) @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") +id := managedenvironments.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") payload := managedenvironments.CertificatePatch{ // ... @@ -116,7 +116,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.ManagedEnvironment{ // ... @@ -133,7 +133,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -145,7 +145,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.DiagnosticsGetRoot(ctx, id) if err != nil { @@ -161,7 +161,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.Get(ctx, id) if err != nil { @@ -177,7 +177,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.GetAuthToken(ctx, id) if err != nil { @@ -227,7 +227,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ListWorkloadProfileStates(ctx, id)` can be used to do batched pagination items, err := client.ListWorkloadProfileStatesComplete(ctx, id) @@ -244,7 +244,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedenvironments.ManagedCertificate{ // ... @@ -261,7 +261,7 @@ if err := client.ManagedCertificatesCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.ManagedCertificatesDelete(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") read, err := client.ManagedCertificatesGet(ctx, id) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedCertificatesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedCertificatesListComplete(ctx, id) @@ -310,7 +310,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") +id := managedenvironments.NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") payload := managedenvironments.ManagedCertificatePatch{ // ... @@ -331,7 +331,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") +id := managedenvironments.NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") read, err := client.ManagedEnvironmentDiagnosticsGetDetector(ctx, id) if err != nil { @@ -347,7 +347,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentDiagnosticsListDetectors(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentDiagnosticsListDetectorsComplete(ctx, id) @@ -364,7 +364,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.CheckNameAvailabilityRequest{ // ... @@ -385,7 +385,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironments.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") payload := managedenvironments.ManagedEnvironment{ // ... diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/id_certificate.go b/resource-manager/containerapps/2024-03-01/managedenvironments/id_certificate.go index bd5f3dea777..193012b6d19 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/id_certificate.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/id_certificate_test.go b/resource-manager/containerapps/2024-03-01/managedenvironments/id_certificate_test.go index 662d550ec60..93c0065d1e4 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/id_certificate_test.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedcertificate.go b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedcertificate.go index 5a6d0991d4a..59ca7e0eed9 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedcertificate.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedcertificate.go @@ -121,7 +121,7 @@ func (id ManagedCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticManagedCertificates", "managedCertificates", "managedCertificates"), resourceids.UserSpecifiedSegment("managedCertificateName", "managedCertificateName"), } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedcertificate_test.go b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedcertificate_test.go index 4c5a0b72b44..e60382d764b 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedcertificate_test.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedCertificateId{} func TestNewManagedCertificateID(t *testing.T) { - id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName") + id := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.ManagedCertificateName != "managedCertificateName" { @@ -32,8 +32,8 @@ func TestNewManagedCertificateID(t *testing.T) { } func TestFormatManagedCertificateID(t *testing.T) { - actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "managedCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName" + actual := NewManagedCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "managedCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", ManagedCertificateName: "managedCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/managedCertificates/managedCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/managedCertificates/managedCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE", Expected: &ManagedCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", ManagedCertificateName: "mAnAgEdCeRtIfIcAtEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/mAnAgEdCeRtIfIcAtEs/mAnAgEdCeRtIfIcAtEnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironment.go b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironment.go index 6bf99e29268..125d668f9b7 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironment_test.go b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironment_test.go index 00cb40cdb80..498a8e63f64 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironmentdetector.go b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironmentdetector.go index da9e34f72a4..cac551d356c 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironmentdetector.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironmentdetector.go @@ -121,7 +121,7 @@ func (id ManagedEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironmentdetector_test.go b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironmentdetector_test.go index dee9127f6ad..4aeba97785b 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironmentdetector_test.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironments/id_managedenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentDetectorId{} func TestNewManagedEnvironmentDetectorID(t *testing.T) { - id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName") + id := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewManagedEnvironmentDetectorID(t *testing.T) { } func TestFormatManagedEnvironmentDetectorID(t *testing.T) { - actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName" + actual := NewManagedEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &ManagedEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/README.md b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/README.md index 821dcc3b1e4..3ace168cf24 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/README.md +++ b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") payload := managedenvironmentsstorages.ManagedEnvironmentStorage{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") +id := managedenvironmentsstorages.NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedenvironmentsstorages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := managedenvironmentsstorages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_managedenvironment.go b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_managedenvironment.go index a1c7dc16d88..1c3e4c89d91 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_managedenvironment_test.go b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_managedenvironment_test.go index 0e01fb1e367..3b2c0c8b236 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_storage.go b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_storage.go index 1e2c729257f..720c4333d52 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_storage.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_storage.go @@ -121,7 +121,7 @@ func (id StorageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), resourceids.StaticSegment("staticStorages", "storages", "storages"), resourceids.UserSpecifiedSegment("storageName", "storageName"), } diff --git a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_storage_test.go b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_storage_test.go index c1fbfa33b8c..4cac9e97b98 100644 --- a/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_storage_test.go +++ b/resource-manager/containerapps/2024-03-01/managedenvironmentsstorages/id_storage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageId{} func TestNewStorageID(t *testing.T) { - id := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName") + id := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } if id.StorageName != "storageName" { @@ -32,8 +32,8 @@ func TestNewStorageID(t *testing.T) { } func TestFormatStorageID(t *testing.T) { - actual := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName", "storageName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName" + actual := NewStorageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName", "storageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", StorageName: "storageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", StorageName: "storageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/storages/storageName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/storages/storageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS/sToRaGeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS/sToRaGeNaMe", Expected: &StorageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", StorageName: "sToRaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/sToRaGeS/sToRaGeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/sToRaGeS/sToRaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/usages/README.md b/resource-manager/containerapps/2024-03-01/usages/README.md index c0a9f07f960..9558ce1ecea 100644 --- a/resource-manager/containerapps/2024-03-01/usages/README.md +++ b/resource-manager/containerapps/2024-03-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := usages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") +id := usages.NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") // alternatively `client.ManagedEnvironmentUsagesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedEnvironmentUsagesListComplete(ctx, id) diff --git a/resource-manager/containerapps/2024-03-01/usages/id_location.go b/resource-manager/containerapps/2024-03-01/usages/id_location.go index 1e1cfd74c31..0d49964ff82 100644 --- a/resource-manager/containerapps/2024-03-01/usages/id_location.go +++ b/resource-manager/containerapps/2024-03-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerapps/2024-03-01/usages/id_location_test.go b/resource-manager/containerapps/2024-03-01/usages/id_location_test.go index 8ef45ae094e..449191cb377 100644 --- a/resource-manager/containerapps/2024-03-01/usages/id_location_test.go +++ b/resource-manager/containerapps/2024-03-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.App/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aPp/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerapps/2024-03-01/usages/id_managedenvironment.go b/resource-manager/containerapps/2024-03-01/usages/id_managedenvironment.go index 6925469f0c9..cb09115b8e8 100644 --- a/resource-manager/containerapps/2024-03-01/usages/id_managedenvironment.go +++ b/resource-manager/containerapps/2024-03-01/usages/id_managedenvironment.go @@ -115,7 +115,7 @@ func (id ManagedEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftApp", "Microsoft.App", "Microsoft.App"), resourceids.StaticSegment("staticManagedEnvironments", "managedEnvironments", "managedEnvironments"), - resourceids.UserSpecifiedSegment("managedEnvironmentName", "environmentName"), + resourceids.UserSpecifiedSegment("managedEnvironmentName", "managedEnvironmentName"), } } diff --git a/resource-manager/containerapps/2024-03-01/usages/id_managedenvironment_test.go b/resource-manager/containerapps/2024-03-01/usages/id_managedenvironment_test.go index f661d8ed220..b32da7ba8b3 100644 --- a/resource-manager/containerapps/2024-03-01/usages/id_managedenvironment_test.go +++ b/resource-manager/containerapps/2024-03-01/usages/id_managedenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedEnvironmentId{} func TestNewManagedEnvironmentID(t *testing.T) { - id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName") + id := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedEnvironmentName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "environmentName") + if id.ManagedEnvironmentName != "managedEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedEnvironmentName'", id.ManagedEnvironmentName, "managedEnvironmentName") } } func TestFormatManagedEnvironmentID(t *testing.T) { - actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName" + actual := NewManagedEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedEnvironmentName: "environmentName", + ManagedEnvironmentName: "managedEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.App/managedEnvironments/managedEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE", Expected: &ManagedEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedEnvironmentName: "eNvIrOnMeNtNaMe", + ManagedEnvironmentName: "mAnAgEdEnViRoNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aPp/mAnAgEdEnViRoNmEnTs/mAnAgEdEnViRoNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerinstance/2023-05-01/containerinstance/README.md b/resource-manager/containerinstance/2023-05-01/containerinstance/README.md index 27919c97b2d..a16a7947a53 100644 --- a/resource-manager/containerinstance/2023-05-01/containerinstance/README.md +++ b/resource-manager/containerinstance/2023-05-01/containerinstance/README.md @@ -234,7 +234,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerinstance.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := containerinstance.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.LocationListCachedImages(ctx, id)` can be used to do batched pagination items, err := client.LocationListCachedImagesComplete(ctx, id) @@ -251,7 +251,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerinstance.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := containerinstance.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.LocationListCapabilities(ctx, id)` can be used to do batched pagination items, err := client.LocationListCapabilitiesComplete(ctx, id) @@ -268,7 +268,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerinstance.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := containerinstance.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationListUsage(ctx, id) if err != nil { diff --git a/resource-manager/containerinstance/2023-05-01/containerinstance/id_location.go b/resource-manager/containerinstance/2023-05-01/containerinstance/id_location.go index 9600f5289c6..62c4630d9e1 100644 --- a/resource-manager/containerinstance/2023-05-01/containerinstance/id_location.go +++ b/resource-manager/containerinstance/2023-05-01/containerinstance/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerInstance", "Microsoft.ContainerInstance", "Microsoft.ContainerInstance"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerinstance/2023-05-01/containerinstance/id_location_test.go b/resource-manager/containerinstance/2023-05-01/containerinstance/id_location_test.go index 7a100a259b7..7828f2d0663 100644 --- a/resource-manager/containerinstance/2023-05-01/containerinstance/id_location_test.go +++ b/resource-manager/containerinstance/2023-05-01/containerinstance/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerInstance/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErInStAnCe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErInStAnCe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErInStAnCe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErInStAnCe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerinstance/2023-05-01/containerinstance/model_encryptionproperties.go b/resource-manager/containerinstance/2023-05-01/containerinstance/model_encryptionproperties.go index 3f9a21bcf8b..ed5dc7406f4 100644 --- a/resource-manager/containerinstance/2023-05-01/containerinstance/model_encryptionproperties.go +++ b/resource-manager/containerinstance/2023-05-01/containerinstance/model_encryptionproperties.go @@ -7,5 +7,5 @@ type EncryptionProperties struct { Identity *string `json:"identity,omitempty"` KeyName string `json:"keyName"` KeyVersion string `json:"keyVersion"` - VaultBaseUrl string `json:"vaultBaseUrl"` + VaultBaseURL string `json:"vaultBaseUrl"` } diff --git a/resource-manager/containerinstance/2023-05-01/containerinstance/model_imageregistrycredential.go b/resource-manager/containerinstance/2023-05-01/containerinstance/model_imageregistrycredential.go index 94b4c1c78ff..265ab2257cf 100644 --- a/resource-manager/containerinstance/2023-05-01/containerinstance/model_imageregistrycredential.go +++ b/resource-manager/containerinstance/2023-05-01/containerinstance/model_imageregistrycredential.go @@ -5,7 +5,7 @@ package containerinstance type ImageRegistryCredential struct { Identity *string `json:"identity,omitempty"` - IdentityUrl *string `json:"identityUrl,omitempty"` + IdentityURL *string `json:"identityUrl,omitempty"` Password *string `json:"password,omitempty"` Server string `json:"server"` Username *string `json:"username,omitempty"` diff --git a/resource-manager/containerregistry/2019-06-01-preview/registries/README.md b/resource-manager/containerregistry/2019-06-01-preview/registries/README.md index 9bed7f1c95a..1b3cf53a927 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/registries/README.md +++ b/resource-manager/containerregistry/2019-06-01-preview/registries/README.md @@ -20,13 +20,13 @@ client.Client.Authorizer = authorizer ``` -### Example Usage: `RegistriesClient.GetBuildSourceUploadUrl` +### Example Usage: `RegistriesClient.GetBuildSourceUploadURL` ```go ctx := context.TODO() id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName") -read, err := client.GetBuildSourceUploadUrl(ctx, id) +read, err := client.GetBuildSourceUploadURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/containerregistry/2019-06-01-preview/registries/method_getbuildsourceuploadurl.go b/resource-manager/containerregistry/2019-06-01-preview/registries/method_getbuildsourceuploadurl.go index 52a6376864b..ecf9f6fd4ce 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/registries/method_getbuildsourceuploadurl.go +++ b/resource-manager/containerregistry/2019-06-01-preview/registries/method_getbuildsourceuploadurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetBuildSourceUploadUrlOperationResponse struct { +type GetBuildSourceUploadURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *SourceUploadDefinition } -// GetBuildSourceUploadUrl ... -func (c RegistriesClient) GetBuildSourceUploadUrl(ctx context.Context, id RegistryId) (result GetBuildSourceUploadUrlOperationResponse, err error) { +// GetBuildSourceUploadURL ... +func (c RegistriesClient) GetBuildSourceUploadURL(ctx context.Context, id RegistryId) (result GetBuildSourceUploadURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/containerregistry/2019-06-01-preview/registries/model_sourcetriggerdescriptor.go b/resource-manager/containerregistry/2019-06-01-preview/registries/model_sourcetriggerdescriptor.go index 7af4ed8f3b5..d39b055ac23 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/registries/model_sourcetriggerdescriptor.go +++ b/resource-manager/containerregistry/2019-06-01-preview/registries/model_sourcetriggerdescriptor.go @@ -10,5 +10,5 @@ type SourceTriggerDescriptor struct { Id *string `json:"id,omitempty"` ProviderType *string `json:"providerType,omitempty"` PullRequestId *string `json:"pullRequestId,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` } diff --git a/resource-manager/containerregistry/2019-06-01-preview/registries/model_sourceuploaddefinition.go b/resource-manager/containerregistry/2019-06-01-preview/registries/model_sourceuploaddefinition.go index df0fb608b08..14bfb51a591 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/registries/model_sourceuploaddefinition.go +++ b/resource-manager/containerregistry/2019-06-01-preview/registries/model_sourceuploaddefinition.go @@ -5,5 +5,5 @@ package registries type SourceUploadDefinition struct { RelativePath *string `json:"relativePath,omitempty"` - UploadUrl *string `json:"uploadUrl,omitempty"` + UploadURL *string `json:"uploadUrl,omitempty"` } diff --git a/resource-manager/containerregistry/2019-06-01-preview/runs/README.md b/resource-manager/containerregistry/2019-06-01-preview/runs/README.md index 7b71cbcda1d..41d0028eb21 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/runs/README.md +++ b/resource-manager/containerregistry/2019-06-01-preview/runs/README.md @@ -48,13 +48,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `RunsClient.GetLogSasUrl` +### Example Usage: `RunsClient.GetLogSasURL` ```go ctx := context.TODO() id := runs.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "runId") -read, err := client.GetLogSasUrl(ctx, id) +read, err := client.GetLogSasURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/containerregistry/2019-06-01-preview/runs/method_getlogsasurl.go b/resource-manager/containerregistry/2019-06-01-preview/runs/method_getlogsasurl.go index 4a1e7d9e3de..bc5a270bdc4 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/runs/method_getlogsasurl.go +++ b/resource-manager/containerregistry/2019-06-01-preview/runs/method_getlogsasurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetLogSasUrlOperationResponse struct { +type GetLogSasURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *RunGetLogResult } -// GetLogSasUrl ... -func (c RunsClient) GetLogSasUrl(ctx context.Context, id RunId) (result GetLogSasUrlOperationResponse, err error) { +// GetLogSasURL ... +func (c RunsClient) GetLogSasURL(ctx context.Context, id RunId) (result GetLogSasURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/containerregistry/2019-06-01-preview/runs/model_sourcetriggerdescriptor.go b/resource-manager/containerregistry/2019-06-01-preview/runs/model_sourcetriggerdescriptor.go index 88e2d1d56bf..f97581f9ae2 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/runs/model_sourcetriggerdescriptor.go +++ b/resource-manager/containerregistry/2019-06-01-preview/runs/model_sourcetriggerdescriptor.go @@ -10,5 +10,5 @@ type SourceTriggerDescriptor struct { Id *string `json:"id,omitempty"` ProviderType *string `json:"providerType,omitempty"` PullRequestId *string `json:"pullRequestId,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` } diff --git a/resource-manager/containerregistry/2019-06-01-preview/taskruns/model_sourcetriggerdescriptor.go b/resource-manager/containerregistry/2019-06-01-preview/taskruns/model_sourcetriggerdescriptor.go index 188c9ef9c91..25898a1122e 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/taskruns/model_sourcetriggerdescriptor.go +++ b/resource-manager/containerregistry/2019-06-01-preview/taskruns/model_sourcetriggerdescriptor.go @@ -10,5 +10,5 @@ type SourceTriggerDescriptor struct { Id *string `json:"id,omitempty"` ProviderType *string `json:"providerType,omitempty"` PullRequestId *string `json:"pullRequestId,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` } diff --git a/resource-manager/containerregistry/2019-06-01-preview/tasks/model_sourceproperties.go b/resource-manager/containerregistry/2019-06-01-preview/tasks/model_sourceproperties.go index d29dca3df0b..b3d2e8c208f 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/tasks/model_sourceproperties.go +++ b/resource-manager/containerregistry/2019-06-01-preview/tasks/model_sourceproperties.go @@ -5,7 +5,7 @@ package tasks type SourceProperties struct { Branch *string `json:"branch,omitempty"` - RepositoryUrl string `json:"repositoryUrl"` + RepositoryURL string `json:"repositoryUrl"` SourceControlAuthProperties *AuthInfo `json:"sourceControlAuthProperties,omitempty"` SourceControlType SourceControlType `json:"sourceControlType"` } diff --git a/resource-manager/containerregistry/2019-06-01-preview/tasks/model_sourceupdateparameters.go b/resource-manager/containerregistry/2019-06-01-preview/tasks/model_sourceupdateparameters.go index 2878273d42f..e256cfdaf34 100644 --- a/resource-manager/containerregistry/2019-06-01-preview/tasks/model_sourceupdateparameters.go +++ b/resource-manager/containerregistry/2019-06-01-preview/tasks/model_sourceupdateparameters.go @@ -5,7 +5,7 @@ package tasks type SourceUpdateParameters struct { Branch *string `json:"branch,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` SourceControlAuthProperties *AuthInfoUpdateParameters `json:"sourceControlAuthProperties,omitempty"` SourceControlType *SourceControlType `json:"sourceControlType,omitempty"` } diff --git a/resource-manager/containerregistry/2023-06-01-preview/archives/README.md b/resource-manager/containerregistry/2023-06-01-preview/archives/README.md index c17da71a90e..b60cf456297 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archives/README.md +++ b/resource-manager/containerregistry/2023-06-01-preview/archives/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := archives.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName") +id := archives.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName") payload := archives.Archive{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := archives.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName") +id := archives.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := archives.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName") +id := archives.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := archives.NewPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType") +id := archives.NewPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := archives.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName") +id := archives.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName") payload := archives.ArchiveUpdateParameters{ // ... diff --git a/resource-manager/containerregistry/2023-06-01-preview/archives/id_archive.go b/resource-manager/containerregistry/2023-06-01-preview/archives/id_archive.go index 3e2460f9f43..2dc3873d7c7 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archives/id_archive.go +++ b/resource-manager/containerregistry/2023-06-01-preview/archives/id_archive.go @@ -129,7 +129,7 @@ func (id ArchiveId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticPackages", "packages", "packages"), - resourceids.UserSpecifiedSegment("packageName", "packageType"), + resourceids.UserSpecifiedSegment("packageName", "packageName"), resourceids.StaticSegment("staticArchives", "archives", "archives"), resourceids.UserSpecifiedSegment("archiveName", "archiveName"), } diff --git a/resource-manager/containerregistry/2023-06-01-preview/archives/id_archive_test.go b/resource-manager/containerregistry/2023-06-01-preview/archives/id_archive_test.go index 31776ae8901..c7703d27d5f 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archives/id_archive_test.go +++ b/resource-manager/containerregistry/2023-06-01-preview/archives/id_archive_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArchiveId{} func TestNewArchiveID(t *testing.T) { - id := NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName") + id := NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewArchiveID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.PackageName != "packageType" { - t.Fatalf("Expected %q but got %q for Segment 'PackageName'", id.PackageName, "packageType") + if id.PackageName != "packageName" { + t.Fatalf("Expected %q but got %q for Segment 'PackageName'", id.PackageName, "packageName") } if id.ArchiveName != "archiveName" { @@ -36,8 +36,8 @@ func TestNewArchiveID(t *testing.T) { } func TestFormatArchiveID(t *testing.T) { - actual := NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName" + actual := NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseArchiveID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName", Expected: &ArchiveId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PackageName: "packageType", + PackageName: "packageName", ArchiveName: "archiveName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseArchiveIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName", Expected: &ArchiveId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PackageName: "packageType", + PackageName: "packageName", ArchiveName: "archiveName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS/aRcHiVeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS/aRcHiVeNaMe", Expected: &ArchiveId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - PackageName: "pAcKaGeTyPe", + PackageName: "pAcKaGeNaMe", ArchiveName: "aRcHiVeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS/aRcHiVeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS/aRcHiVeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerregistry/2023-06-01-preview/archives/id_package.go b/resource-manager/containerregistry/2023-06-01-preview/archives/id_package.go index b5573e3617f..2d30274ba2d 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archives/id_package.go +++ b/resource-manager/containerregistry/2023-06-01-preview/archives/id_package.go @@ -123,7 +123,7 @@ func (id PackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticPackages", "packages", "packages"), - resourceids.UserSpecifiedSegment("packageName", "packageType"), + resourceids.UserSpecifiedSegment("packageName", "packageName"), } } diff --git a/resource-manager/containerregistry/2023-06-01-preview/archives/id_package_test.go b/resource-manager/containerregistry/2023-06-01-preview/archives/id_package_test.go index 7c413322975..c7b12669d2e 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archives/id_package_test.go +++ b/resource-manager/containerregistry/2023-06-01-preview/archives/id_package_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PackageId{} func TestNewPackageID(t *testing.T) { - id := NewPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType") + id := NewPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.PackageName != "packageType" { - t.Fatalf("Expected %q but got %q for Segment 'PackageName'", id.PackageName, "packageType") + if id.PackageName != "packageName" { + t.Fatalf("Expected %q but got %q for Segment 'PackageName'", id.PackageName, "packageName") } } func TestFormatPackageID(t *testing.T) { - actual := NewPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType" + actual := NewPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName", Expected: &PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PackageName: "packageType", + PackageName: "packageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName", Expected: &PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PackageName: "packageType", + PackageName: "packageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe", Expected: &PackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - PackageName: "pAcKaGeTyPe", + PackageName: "pAcKaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/README.md b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/README.md index 211d1135587..094f3017dbb 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/README.md +++ b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := archiveversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName", "archiveVersionName") +id := archiveversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName", "versionName") if err := client.CreateThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CreateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := archiveversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName", "archiveVersionName") +id := archiveversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -48,7 +48,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := archiveversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName", "archiveVersionName") +id := archiveversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -64,7 +64,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := archiveversions.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName") +id := archiveversions.NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_archive.go b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_archive.go index c3ff182a7cc..d5c824e4c51 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_archive.go +++ b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_archive.go @@ -129,7 +129,7 @@ func (id ArchiveId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticPackages", "packages", "packages"), - resourceids.UserSpecifiedSegment("packageName", "packageType"), + resourceids.UserSpecifiedSegment("packageName", "packageName"), resourceids.StaticSegment("staticArchives", "archives", "archives"), resourceids.UserSpecifiedSegment("archiveName", "archiveName"), } diff --git a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_archive_test.go b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_archive_test.go index fc0a9d9587f..0b0c4cc49be 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_archive_test.go +++ b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_archive_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArchiveId{} func TestNewArchiveID(t *testing.T) { - id := NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName") + id := NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewArchiveID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.PackageName != "packageType" { - t.Fatalf("Expected %q but got %q for Segment 'PackageName'", id.PackageName, "packageType") + if id.PackageName != "packageName" { + t.Fatalf("Expected %q but got %q for Segment 'PackageName'", id.PackageName, "packageName") } if id.ArchiveName != "archiveName" { @@ -36,8 +36,8 @@ func TestNewArchiveID(t *testing.T) { } func TestFormatArchiveID(t *testing.T) { - actual := NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName" + actual := NewArchiveID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseArchiveID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName", Expected: &ArchiveId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PackageName: "packageType", + PackageName: "packageName", ArchiveName: "archiveName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseArchiveIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName", Expected: &ArchiveId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PackageName: "packageType", + PackageName: "packageName", ArchiveName: "archiveName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS/aRcHiVeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS/aRcHiVeNaMe", Expected: &ArchiveId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - PackageName: "pAcKaGeTyPe", + PackageName: "pAcKaGeNaMe", ArchiveName: "aRcHiVeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS/aRcHiVeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS/aRcHiVeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_version.go b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_version.go index 5b8320f8644..0d98b1e1192 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_version.go +++ b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_version.go @@ -135,11 +135,11 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticPackages", "packages", "packages"), - resourceids.UserSpecifiedSegment("packageName", "packageType"), + resourceids.UserSpecifiedSegment("packageName", "packageName"), resourceids.StaticSegment("staticArchives", "archives", "archives"), resourceids.UserSpecifiedSegment("archiveName", "archiveName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "archiveVersionName"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_version_test.go b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_version_test.go index 50420bf4596..dd7ade34c06 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_version_test.go +++ b/resource-manager/containerregistry/2023-06-01-preview/archiveversions/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName", "archiveVersionName") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,22 +26,22 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.PackageName != "packageType" { - t.Fatalf("Expected %q but got %q for Segment 'PackageName'", id.PackageName, "packageType") + if id.PackageName != "packageName" { + t.Fatalf("Expected %q but got %q for Segment 'PackageName'", id.PackageName, "packageName") } if id.ArchiveName != "archiveName" { t.Fatalf("Expected %q but got %q for Segment 'ArchiveName'", id.ArchiveName, "archiveName") } - if id.VersionName != "archiveVersionName" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "archiveVersionName") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageType", "archiveName", "archiveVersionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/versions/archiveVersionName" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "packageName", "archiveName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/versions/archiveVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PackageName: "packageType", + PackageName: "packageName", ArchiveName: "archiveName", - VersionName: "archiveVersionName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/versions/archiveVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/versions/versionName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS/aRcHiVeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS/aRcHiVeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS/aRcHiVeNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS/aRcHiVeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/versions/archiveVersionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PackageName: "packageType", + PackageName: "packageName", ArchiveName: "archiveName", - VersionName: "archiveVersionName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageType/archives/archiveName/versions/archiveVersionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/packages/packageName/archives/archiveName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS/aRcHiVeNaMe/vErSiOnS/aRcHiVeVeRsIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS/aRcHiVeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - PackageName: "pAcKaGeTyPe", + PackageName: "pAcKaGeNaMe", ArchiveName: "aRcHiVeNaMe", - VersionName: "aRcHiVeVeRsIoNnAmE", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeTyPe/aRcHiVeS/aRcHiVeNaMe/vErSiOnS/aRcHiVeVeRsIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pAcKaGeS/pAcKaGeNaMe/aRcHiVeS/aRcHiVeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerregistry/2023-06-01-preview/registries/README.md b/resource-manager/containerregistry/2023-06-01-preview/registries/README.md index 5ce331f3231..8436f9db46b 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/registries/README.md +++ b/resource-manager/containerregistry/2023-06-01-preview/registries/README.md @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := registries.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "groupName") +id := registries.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "privateLinkResourceName") read, err := client.GetPrivateLinkResource(ctx, id) if err != nil { diff --git a/resource-manager/containerregistry/2023-06-01-preview/registries/id_privatelinkresource.go b/resource-manager/containerregistry/2023-06-01-preview/registries/id_privatelinkresource.go index 564fe929903..2d9dd7144e7 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/registries/id_privatelinkresource.go +++ b/resource-manager/containerregistry/2023-06-01-preview/registries/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/containerregistry/2023-06-01-preview/registries/id_privatelinkresource_test.go b/resource-manager/containerregistry/2023-06-01-preview/registries/id_privatelinkresource_test.go index 1fb9b412b5e..e83aeba74d2 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/registries/id_privatelinkresource_test.go +++ b/resource-manager/containerregistry/2023-06-01-preview/registries/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerregistry/2023-06-01-preview/webhooks/README.md b/resource-manager/containerregistry/2023-06-01-preview/webhooks/README.md index bd48f8f2904..7aa45233485 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/webhooks/README.md +++ b/resource-manager/containerregistry/2023-06-01-preview/webhooks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") payload := webhooks.WebhookCreateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") read, err := client.GetCallbackConfig(ctx, id) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") // alternatively `client.ListEvents(ctx, id)` can be used to do batched pagination items, err := client.ListEventsComplete(ctx, id) @@ -119,7 +119,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") read, err := client.Ping(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") payload := webhooks.WebhookUpdateParameters{ // ... diff --git a/resource-manager/containerregistry/2023-06-01-preview/webhooks/id_webhook.go b/resource-manager/containerregistry/2023-06-01-preview/webhooks/id_webhook.go index eda18c15f8d..aac7b42f1e7 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/webhooks/id_webhook.go +++ b/resource-manager/containerregistry/2023-06-01-preview/webhooks/id_webhook.go @@ -123,7 +123,7 @@ func (id WebHookId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), - resourceids.UserSpecifiedSegment("webHookName", "webhookName"), + resourceids.UserSpecifiedSegment("webHookName", "webHookName"), } } diff --git a/resource-manager/containerregistry/2023-06-01-preview/webhooks/id_webhook_test.go b/resource-manager/containerregistry/2023-06-01-preview/webhooks/id_webhook_test.go index 088f1d4fd79..48b371ec679 100644 --- a/resource-manager/containerregistry/2023-06-01-preview/webhooks/id_webhook_test.go +++ b/resource-manager/containerregistry/2023-06-01-preview/webhooks/id_webhook_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebHookId{} func TestNewWebHookID(t *testing.T) { - id := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") + id := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWebHookID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.WebHookName != "webhookName" { - t.Fatalf("Expected %q but got %q for Segment 'WebHookName'", id.WebHookName, "webhookName") + if id.WebHookName != "webHookName" { + t.Fatalf("Expected %q but got %q for Segment 'WebHookName'", id.WebHookName, "webHookName") } } func TestFormatWebHookID(t *testing.T) { - actual := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName" + actual := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWebHookID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName", Expected: &WebHookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - WebHookName: "webhookName", + WebHookName: "webHookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseWebHookIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName", Expected: &WebHookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - WebHookName: "webhookName", + WebHookName: "webHookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName/extra", Error: true, }, { diff --git a/resource-manager/containerregistry/2023-07-01/registries/README.md b/resource-manager/containerregistry/2023-07-01/registries/README.md index 80d93d8cf77..84353faac39 100644 --- a/resource-manager/containerregistry/2023-07-01/registries/README.md +++ b/resource-manager/containerregistry/2023-07-01/registries/README.md @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := registries.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "groupName") +id := registries.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "privateLinkResourceName") read, err := client.GetPrivateLinkResource(ctx, id) if err != nil { diff --git a/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go b/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go index 564fe929903..2d9dd7144e7 100644 --- a/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go +++ b/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource_test.go b/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource_test.go index 1fb9b412b5e..e83aeba74d2 100644 --- a/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource_test.go +++ b/resource-manager/containerregistry/2023-07-01/registries/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErReGiStRy/rEgIsTrIeS/rEgIsTrYnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerregistry/2023-07-01/webhooks/README.md b/resource-manager/containerregistry/2023-07-01/webhooks/README.md index 7b9f85f819f..c3254b2807d 100644 --- a/resource-manager/containerregistry/2023-07-01/webhooks/README.md +++ b/resource-manager/containerregistry/2023-07-01/webhooks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") payload := webhooks.WebhookCreateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") read, err := client.GetCallbackConfig(ctx, id) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") // alternatively `client.ListEvents(ctx, id)` can be used to do batched pagination items, err := client.ListEventsComplete(ctx, id) @@ -119,7 +119,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") read, err := client.Ping(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") +id := webhooks.NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") payload := webhooks.WebhookUpdateParameters{ // ... diff --git a/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go b/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go index eda18c15f8d..aac7b42f1e7 100644 --- a/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go +++ b/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook.go @@ -123,7 +123,7 @@ func (id WebHookId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), - resourceids.UserSpecifiedSegment("webHookName", "webhookName"), + resourceids.UserSpecifiedSegment("webHookName", "webHookName"), } } diff --git a/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook_test.go b/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook_test.go index 088f1d4fd79..48b371ec679 100644 --- a/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook_test.go +++ b/resource-manager/containerregistry/2023-07-01/webhooks/id_webhook_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebHookId{} func TestNewWebHookID(t *testing.T) { - id := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName") + id := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWebHookID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.WebHookName != "webhookName" { - t.Fatalf("Expected %q but got %q for Segment 'WebHookName'", id.WebHookName, "webhookName") + if id.WebHookName != "webHookName" { + t.Fatalf("Expected %q but got %q for Segment 'WebHookName'", id.WebHookName, "webHookName") } } func TestFormatWebHookID(t *testing.T) { - actual := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webhookName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName" + actual := NewWebHookID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "webHookName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWebHookID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName", Expected: &WebHookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - WebHookName: "webhookName", + WebHookName: "webHookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseWebHookIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName", Expected: &WebHookId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - WebHookName: "webhookName", + WebHookName: "webHookName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webhookName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerRegistry/registries/registryName/webHooks/webHookName/extra", Error: true, }, { diff --git a/resource-manager/containerservice/2019-08-01/agentpools/README.md b/resource-manager/containerservice/2019-08-01/agentpools/README.md index f9c21beb668..600116c99af 100644 --- a/resource-manager/containerservice/2019-08-01/agentpools/README.md +++ b/resource-manager/containerservice/2019-08-01/agentpools/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") payload := agentpools.AgentPool{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") read, err := client.GetUpgradeProfile(ctx, id) if err != nil { diff --git a/resource-manager/containerservice/2019-08-01/agentpools/id_agentpool.go b/resource-manager/containerservice/2019-08-01/agentpools/id_agentpool.go index f45a4261545..d1db170c217 100644 --- a/resource-manager/containerservice/2019-08-01/agentpools/id_agentpool.go +++ b/resource-manager/containerservice/2019-08-01/agentpools/id_agentpool.go @@ -121,7 +121,7 @@ func (id AgentPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolName"), } diff --git a/resource-manager/containerservice/2019-08-01/agentpools/id_agentpool_test.go b/resource-manager/containerservice/2019-08-01/agentpools/id_agentpool_test.go index 1186c4083bc..c11edfbefce 100644 --- a/resource-manager/containerservice/2019-08-01/agentpools/id_agentpool_test.go +++ b/resource-manager/containerservice/2019-08-01/agentpools/id_agentpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AgentPoolId{} func TestNewAgentPoolID(t *testing.T) { - id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") + id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAgentPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.AgentPoolName != "agentPoolName" { @@ -32,8 +32,8 @@ func TestNewAgentPoolID(t *testing.T) { } func TestFormatAgentPoolID(t *testing.T) { - actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName" + actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAgentPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAgentPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", AgentPoolName: "aGeNtPoOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2019-08-01/containerservices/README.md b/resource-manager/containerservice/2019-08-01/containerservices/README.md index 5b307c9ee3f..2004c2214b6 100644 --- a/resource-manager/containerservice/2019-08-01/containerservices/README.md +++ b/resource-manager/containerservice/2019-08-01/containerservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := containerservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListOrchestrators(ctx, id, containerservices.DefaultListOrchestratorsOperationOptions()) if err != nil { diff --git a/resource-manager/containerservice/2019-08-01/containerservices/id_location.go b/resource-manager/containerservice/2019-08-01/containerservices/id_location.go index a92b2952cc3..f564d702be1 100644 --- a/resource-manager/containerservice/2019-08-01/containerservices/id_location.go +++ b/resource-manager/containerservice/2019-08-01/containerservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerservice/2019-08-01/containerservices/id_location_test.go b/resource-manager/containerservice/2019-08-01/containerservices/id_location_test.go index 0b65961ff3f..53d5ebe7f58 100644 --- a/resource-manager/containerservice/2019-08-01/containerservices/id_location_test.go +++ b/resource-manager/containerservice/2019-08-01/containerservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2019-08-01/managedclusters/README.md b/resource-manager/containerservice/2019-08-01/managedclusters/README.md index 4b6073025d4..e496c04cb1a 100644 --- a/resource-manager/containerservice/2019-08-01/managedclusters/README.md +++ b/resource-manager/containerservice/2019-08-01/managedclusters/README.md @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName") +id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName") read, err := client.GetAccessProfile(ctx, id) if err != nil { diff --git a/resource-manager/containerservice/2019-08-01/managedclusters/id_accessprofile.go b/resource-manager/containerservice/2019-08-01/managedclusters/id_accessprofile.go index 292f444cb70..0cc903a7fde 100644 --- a/resource-manager/containerservice/2019-08-01/managedclusters/id_accessprofile.go +++ b/resource-manager/containerservice/2019-08-01/managedclusters/id_accessprofile.go @@ -121,9 +121,9 @@ func (id AccessProfileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticAccessProfiles", "accessProfiles", "accessProfiles"), - resourceids.UserSpecifiedSegment("accessProfileName", "roleName"), + resourceids.UserSpecifiedSegment("accessProfileName", "accessProfileName"), } } diff --git a/resource-manager/containerservice/2019-08-01/managedclusters/id_accessprofile_test.go b/resource-manager/containerservice/2019-08-01/managedclusters/id_accessprofile_test.go index d605f8b60d6..9d2f96670dd 100644 --- a/resource-manager/containerservice/2019-08-01/managedclusters/id_accessprofile_test.go +++ b/resource-manager/containerservice/2019-08-01/managedclusters/id_accessprofile_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessProfileId{} func TestNewAccessProfileID(t *testing.T) { - id := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName") + id := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAccessProfileID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } - if id.AccessProfileName != "roleName" { - t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "roleName") + if id.AccessProfileName != "accessProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "accessProfileName") } } func TestFormatAccessProfileID(t *testing.T) { - actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName" + actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessProfileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - AccessProfileName: "roleName", + ManagedClusterName: "managedClusterName", + AccessProfileName: "accessProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessProfileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - AccessProfileName: "roleName", + ManagedClusterName: "managedClusterName", + AccessProfileName: "accessProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS/aCcEsSpRoFiLeNaMe", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", - AccessProfileName: "rOlEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + AccessProfileName: "aCcEsSpRoFiLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS/rOlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS/aCcEsSpRoFiLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/agentpools/README.md b/resource-manager/containerservice/2023-03-02-preview/agentpools/README.md index 48f99637560..cbb7196fecc 100644 --- a/resource-manager/containerservice/2023-03-02-preview/agentpools/README.md +++ b/resource-manager/containerservice/2023-03-02-preview/agentpools/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { // handle the error @@ -37,7 +37,7 @@ if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") payload := agentpools.AgentPool{ // ... @@ -54,7 +54,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if err := client.DeleteThenPoll(ctx, id, agentpools.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.DeleteThenPoll(ctx, id, agentpools.DefaultDeleteOperationOption ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") read, err := client.Get(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") read, err := client.GetUpgradeProfile(ctx, id) if err != nil { @@ -131,7 +131,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if err := client.UpgradeNodeImageVersionThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/containerservice/2023-03-02-preview/agentpools/id_agentpool.go b/resource-manager/containerservice/2023-03-02-preview/agentpools/id_agentpool.go index f45a4261545..d1db170c217 100644 --- a/resource-manager/containerservice/2023-03-02-preview/agentpools/id_agentpool.go +++ b/resource-manager/containerservice/2023-03-02-preview/agentpools/id_agentpool.go @@ -121,7 +121,7 @@ func (id AgentPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolName"), } diff --git a/resource-manager/containerservice/2023-03-02-preview/agentpools/id_agentpool_test.go b/resource-manager/containerservice/2023-03-02-preview/agentpools/id_agentpool_test.go index 1186c4083bc..c11edfbefce 100644 --- a/resource-manager/containerservice/2023-03-02-preview/agentpools/id_agentpool_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/agentpools/id_agentpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AgentPoolId{} func TestNewAgentPoolID(t *testing.T) { - id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") + id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAgentPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.AgentPoolName != "agentPoolName" { @@ -32,8 +32,8 @@ func TestNewAgentPoolID(t *testing.T) { } func TestFormatAgentPoolID(t *testing.T) { - actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName" + actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAgentPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAgentPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", AgentPoolName: "aGeNtPoOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/README.md b/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/README.md index 2cf0d9912b6..eae98069171 100644 --- a/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/README.md +++ b/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") payload := maintenanceconfigurations.MaintenanceConfiguration{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go b/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go index cb14a083360..a06e5519459 100644 --- a/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go +++ b/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go @@ -121,9 +121,9 @@ func (id MaintenanceConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticMaintenanceConfigurations", "maintenanceConfigurations", "maintenanceConfigurations"), - resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "configName"), + resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "maintenanceConfigurationName"), } } diff --git a/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go b/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go index e92342634ce..d5d0ad17780 100644 --- a/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MaintenanceConfigurationId{} func TestNewMaintenanceConfigurationID(t *testing.T) { - id := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName") + id := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMaintenanceConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } - if id.MaintenanceConfigurationName != "configName" { - t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "configName") + if id.MaintenanceConfigurationName != "maintenanceConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "maintenanceConfigurationName") } } func TestFormatMaintenanceConfigurationID(t *testing.T) { - actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName" + actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMaintenanceConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - MaintenanceConfigurationName: "configName", + ManagedClusterName: "managedClusterName", + MaintenanceConfigurationName: "maintenanceConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMaintenanceConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - MaintenanceConfigurationName: "configName", + ManagedClusterName: "managedClusterName", + MaintenanceConfigurationName: "maintenanceConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/cOnFiGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNnAmE", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", - MaintenanceConfigurationName: "cOnFiGnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + MaintenanceConfigurationName: "mAiNtEnAnCeCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/cOnFiGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclusters/README.md b/resource-manager/containerservice/2023-03-02-preview/managedclusters/README.md index 508860ecbc1..f6e3e2eecfc 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclusters/README.md +++ b/resource-manager/containerservice/2023-03-02-preview/managedclusters/README.md @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName") +id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName") read, err := client.GetAccessProfile(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "commandId") +id := managedclusters.NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId") read, err := client.GetCommandResult(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.GetOSOptions(ctx, id, managedclusters.DefaultGetOSOptionsOperationOptions()) if err != nil { @@ -228,7 +228,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListKubernetesVersions(ctx, id) if err != nil { diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_accessprofile.go b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_accessprofile.go index 292f444cb70..0cc903a7fde 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_accessprofile.go +++ b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_accessprofile.go @@ -121,9 +121,9 @@ func (id AccessProfileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticAccessProfiles", "accessProfiles", "accessProfiles"), - resourceids.UserSpecifiedSegment("accessProfileName", "roleName"), + resourceids.UserSpecifiedSegment("accessProfileName", "accessProfileName"), } } diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_accessprofile_test.go b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_accessprofile_test.go index d605f8b60d6..9d2f96670dd 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_accessprofile_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_accessprofile_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessProfileId{} func TestNewAccessProfileID(t *testing.T) { - id := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName") + id := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAccessProfileID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } - if id.AccessProfileName != "roleName" { - t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "roleName") + if id.AccessProfileName != "accessProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "accessProfileName") } } func TestFormatAccessProfileID(t *testing.T) { - actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName" + actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessProfileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - AccessProfileName: "roleName", + ManagedClusterName: "managedClusterName", + AccessProfileName: "accessProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessProfileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - AccessProfileName: "roleName", + ManagedClusterName: "managedClusterName", + AccessProfileName: "accessProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS/aCcEsSpRoFiLeNaMe", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", - AccessProfileName: "rOlEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + AccessProfileName: "aCcEsSpRoFiLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS/rOlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS/aCcEsSpRoFiLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_commandresult.go b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_commandresult.go index be78edd1c37..737a71e0621 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_commandresult.go +++ b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_commandresult.go @@ -121,7 +121,7 @@ func (id CommandResultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticCommandResults", "commandResults", "commandResults"), resourceids.UserSpecifiedSegment("commandId", "commandId"), } diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_commandresult_test.go b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_commandresult_test.go index cc2eaa1878f..0c55ce098fa 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_commandresult_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_commandresult_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CommandResultId{} func TestNewCommandResultID(t *testing.T) { - id := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "commandId") + id := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCommandResultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.CommandId != "commandId" { @@ -32,8 +32,8 @@ func TestNewCommandResultID(t *testing.T) { } func TestFormatCommandResultID(t *testing.T) { - actual := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "commandId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId" + actual := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCommandResultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId", Expected: &CommandResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCommandResultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/cOmMaNdReSuLtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId", Expected: &CommandResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/cOmMaNdReSuLtS/cOmMaNdId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS/cOmMaNdId", Expected: &CommandResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", CommandId: "cOmMaNdId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/cOmMaNdReSuLtS/cOmMaNdId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS/cOmMaNdId/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_location.go b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_location.go index 39e02aa3899..79aa9b51c07 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_location.go +++ b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_location_test.go b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_location_test.go index c130eab2582..db0f4f67412 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_location_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/managedclusters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/README.md b/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/README.md index 131fe45d5d4..29bbbaa85cf 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/README.md +++ b/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotName") payload := managedclustersnapshots.ManagedClusterSnapshot{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotName") read, err := client.Get(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotName") payload := managedclustersnapshots.TagsObject{ // ... diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/id_managedclustersnapshot.go b/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/id_managedclustersnapshot.go index f67238a89db..b59b93368ea 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/id_managedclustersnapshot.go +++ b/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/id_managedclustersnapshot.go @@ -115,7 +115,7 @@ func (id ManagedClusterSnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusterSnapshots", "managedClusterSnapshots", "managedClusterSnapshots"), - resourceids.UserSpecifiedSegment("managedClusterSnapshotName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterSnapshotName", "managedClusterSnapshotName"), } } diff --git a/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go b/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go index 570e7a68e1f..a8768348d9e 100644 --- a/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterSnapshotId{} func TestNewManagedClusterSnapshotID(t *testing.T) { - id := NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterSnapshotName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterSnapshotName'", id.ManagedClusterSnapshotName, "resourceName") + if id.ManagedClusterSnapshotName != "managedClusterSnapshotName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterSnapshotName'", id.ManagedClusterSnapshotName, "managedClusterSnapshotName") } } func TestFormatManagedClusterSnapshotID(t *testing.T) { - actual := NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/resourceName" + actual := NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterSnapshotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotName", Expected: &ManagedClusterSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterSnapshotName: "resourceName", + ManagedClusterSnapshotName: "managedClusterSnapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterSnapshotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotName", Expected: &ManagedClusterSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterSnapshotName: "resourceName", + ManagedClusterSnapshotName: "managedClusterSnapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRsNaPsHoTs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRsNaPsHoTs/mAnAgEdClUsTeRsNaPsHoTnAmE", Expected: &ManagedClusterSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterSnapshotName: "rEsOuRcEnAmE", + ManagedClusterSnapshotName: "mAnAgEdClUsTeRsNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRsNaPsHoTs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRsNaPsHoTs/mAnAgEdClUsTeRsNaPsHoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/README.md b/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/README.md index a3c04c28a9d..17fa0321100 100644 --- a/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/README.md +++ b/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -37,7 +37,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/id_privateendpointconnection.go index 7ad36e39a62..383123bb5dc 100644 --- a/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/id_privateendpointconnection_test.go index 58803da09c6..f180a2cbb26 100644 --- a/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/snapshots/README.md b/resource-manager/containerservice/2023-03-02-preview/snapshots/README.md index 9344071738a..135f336c4d0 100644 --- a/resource-manager/containerservice/2023-03-02-preview/snapshots/README.md +++ b/resource-manager/containerservice/2023-03-02-preview/snapshots/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") payload := snapshots.Snapshot{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") read, err := client.Get(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") payload := snapshots.TagsObject{ // ... diff --git a/resource-manager/containerservice/2023-03-02-preview/snapshots/id_snapshot.go b/resource-manager/containerservice/2023-03-02-preview/snapshots/id_snapshot.go index 378c04ec35a..8081e44fc0b 100644 --- a/resource-manager/containerservice/2023-03-02-preview/snapshots/id_snapshot.go +++ b/resource-manager/containerservice/2023-03-02-preview/snapshots/id_snapshot.go @@ -115,7 +115,7 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), - resourceids.UserSpecifiedSegment("snapshotName", "resourceName"), + resourceids.UserSpecifiedSegment("snapshotName", "snapshotName"), } } diff --git a/resource-manager/containerservice/2023-03-02-preview/snapshots/id_snapshot_test.go b/resource-manager/containerservice/2023-03-02-preview/snapshots/id_snapshot_test.go index 19cfaa64aef..67f5a402cf0 100644 --- a/resource-manager/containerservice/2023-03-02-preview/snapshots/id_snapshot_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/snapshots/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SnapshotName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SnapshotName'", id.SnapshotName, "resourceName") + if id.SnapshotName != "snapshotName" { + t.Fatalf("Expected %q but got %q for Segment 'SnapshotName'", id.SnapshotName, "snapshotName") } } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseSnapshotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SnapshotName: "resourceName", + SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SnapshotName: "resourceName", + SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/sNaPsHoTnAmE", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SnapshotName: "rEsOuRcEnAmE", + SnapshotName: "sNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/sNaPsHoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/README.md b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/README.md index 1cca96bf358..2cd59755375 100644 --- a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/README.md +++ b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName") +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") payload := trustedaccess.TrustedAccessRoleBinding{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName") +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") read, err := client.RoleBindingsDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName") +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") read, err := client.RoleBindingsGet(ctx, id) if err != nil { @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := trustedaccess.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := trustedaccess.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.RolesList(ctx, id)` can be used to do batched pagination items, err := client.RolesListComplete(ctx, id) diff --git a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_location.go b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_location.go index ee307de7b57..9372d26414b 100644 --- a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_location.go +++ b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_location_test.go b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_location_test.go index 661192a2e37..d75d02aa0b9 100644 --- a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_location_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_trustedaccessrolebinding.go b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_trustedaccessrolebinding.go index f6b33cf608e..e53842f1ccd 100644 --- a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_trustedaccessrolebinding.go +++ b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_trustedaccessrolebinding.go @@ -121,7 +121,7 @@ func (id TrustedAccessRoleBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticTrustedAccessRoleBindings", "trustedAccessRoleBindings", "trustedAccessRoleBindings"), resourceids.UserSpecifiedSegment("trustedAccessRoleBindingName", "trustedAccessRoleBindingName"), } diff --git a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go index 4790f09de5d..bea546caaef 100644 --- a/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go +++ b/resource-manager/containerservice/2023-03-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TrustedAccessRoleBindingId{} func TestNewTrustedAccessRoleBindingID(t *testing.T) { - id := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName") + id := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTrustedAccessRoleBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.TrustedAccessRoleBindingName != "trustedAccessRoleBindingName" { @@ -32,8 +32,8 @@ func TestNewTrustedAccessRoleBindingID(t *testing.T) { } func TestFormatTrustedAccessRoleBindingID(t *testing.T) { - actual := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName" + actual := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTrustedAccessRoleBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName", Expected: &TrustedAccessRoleBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", TrustedAccessRoleBindingName: "trustedAccessRoleBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTrustedAccessRoleBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/tRuStEdAcCeSsRoLeBiNdInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName", Expected: &TrustedAccessRoleBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", TrustedAccessRoleBindingName: "trustedAccessRoleBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE", Expected: &TrustedAccessRoleBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", TrustedAccessRoleBindingName: "tRuStEdAcCeSsRoLeBiNdInGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2023-10-15/fleetmembers/README.md b/resource-manager/containerservice/2023-10-15/fleetmembers/README.md index 4209a2e308b..a7342c4c0f4 100644 --- a/resource-manager/containerservice/2023-10-15/fleetmembers/README.md +++ b/resource-manager/containerservice/2023-10-15/fleetmembers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") +id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") payload := fleetmembers.FleetMember{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload, fleetmembers.DefaultCreateOper ```go ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") +id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") if err := client.DeleteThenPoll(ctx, id, fleetmembers.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, fleetmembers.DefaultDeleteOperationOpti ```go ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") +id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") +id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") payload := fleetmembers.FleetMemberUpdate{ // ... diff --git a/resource-manager/containerservice/2023-10-15/fleetmembers/id_member.go b/resource-manager/containerservice/2023-10-15/fleetmembers/id_member.go index 09870cf1991..d2018d0f4a4 100644 --- a/resource-manager/containerservice/2023-10-15/fleetmembers/id_member.go +++ b/resource-manager/containerservice/2023-10-15/fleetmembers/id_member.go @@ -123,7 +123,7 @@ func (id MemberId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticFleets", "fleets", "fleets"), resourceids.UserSpecifiedSegment("fleetName", "fleetName"), resourceids.StaticSegment("staticMembers", "members", "members"), - resourceids.UserSpecifiedSegment("memberName", "fleetMemberName"), + resourceids.UserSpecifiedSegment("memberName", "memberName"), } } diff --git a/resource-manager/containerservice/2023-10-15/fleetmembers/id_member_test.go b/resource-manager/containerservice/2023-10-15/fleetmembers/id_member_test.go index be44480342c..05121c1da45 100644 --- a/resource-manager/containerservice/2023-10-15/fleetmembers/id_member_test.go +++ b/resource-manager/containerservice/2023-10-15/fleetmembers/id_member_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MemberId{} func TestNewMemberID(t *testing.T) { - id := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") + id := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewMemberID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'FleetName'", id.FleetName, "fleetName") } - if id.MemberName != "fleetMemberName" { - t.Fatalf("Expected %q but got %q for Segment 'MemberName'", id.MemberName, "fleetMemberName") + if id.MemberName != "memberName" { + t.Fatalf("Expected %q but got %q for Segment 'MemberName'", id.MemberName, "memberName") } } func TestFormatMemberID(t *testing.T) { - actual := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName" + actual := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseMemberID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName", Expected: &MemberId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", FleetName: "fleetName", - MemberName: "fleetMemberName", + MemberName: "memberName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseMemberIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName", Expected: &MemberId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", FleetName: "fleetName", - MemberName: "fleetMemberName", + MemberName: "memberName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtNaMe/mEmBeRs/fLeEtMeMbErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtNaMe/mEmBeRs/mEmBeRnAmE", Expected: &MemberId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", FleetName: "fLeEtNaMe", - MemberName: "fLeEtMeMbErNaMe", + MemberName: "mEmBeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtNaMe/mEmBeRs/fLeEtMeMbErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtNaMe/mEmBeRs/mEmBeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-04-01/fleetmembers/README.md b/resource-manager/containerservice/2024-04-01/fleetmembers/README.md index b881fbf04d7..49de94ba255 100644 --- a/resource-manager/containerservice/2024-04-01/fleetmembers/README.md +++ b/resource-manager/containerservice/2024-04-01/fleetmembers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") +id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") payload := fleetmembers.FleetMember{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload, fleetmembers.DefaultCreateOper ```go ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") +id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") if err := client.DeleteThenPoll(ctx, id, fleetmembers.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, fleetmembers.DefaultDeleteOperationOpti ```go ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") +id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") +id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") payload := fleetmembers.FleetMemberUpdate{ // ... diff --git a/resource-manager/containerservice/2024-04-01/fleetmembers/id_member.go b/resource-manager/containerservice/2024-04-01/fleetmembers/id_member.go index 09870cf1991..d2018d0f4a4 100644 --- a/resource-manager/containerservice/2024-04-01/fleetmembers/id_member.go +++ b/resource-manager/containerservice/2024-04-01/fleetmembers/id_member.go @@ -123,7 +123,7 @@ func (id MemberId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticFleets", "fleets", "fleets"), resourceids.UserSpecifiedSegment("fleetName", "fleetName"), resourceids.StaticSegment("staticMembers", "members", "members"), - resourceids.UserSpecifiedSegment("memberName", "fleetMemberName"), + resourceids.UserSpecifiedSegment("memberName", "memberName"), } } diff --git a/resource-manager/containerservice/2024-04-01/fleetmembers/id_member_test.go b/resource-manager/containerservice/2024-04-01/fleetmembers/id_member_test.go index be44480342c..05121c1da45 100644 --- a/resource-manager/containerservice/2024-04-01/fleetmembers/id_member_test.go +++ b/resource-manager/containerservice/2024-04-01/fleetmembers/id_member_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MemberId{} func TestNewMemberID(t *testing.T) { - id := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName") + id := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewMemberID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'FleetName'", id.FleetName, "fleetName") } - if id.MemberName != "fleetMemberName" { - t.Fatalf("Expected %q but got %q for Segment 'MemberName'", id.MemberName, "fleetMemberName") + if id.MemberName != "memberName" { + t.Fatalf("Expected %q but got %q for Segment 'MemberName'", id.MemberName, "memberName") } } func TestFormatMemberID(t *testing.T) { - actual := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "fleetMemberName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName" + actual := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetName", "memberName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseMemberID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName", Expected: &MemberId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", FleetName: "fleetName", - MemberName: "fleetMemberName", + MemberName: "memberName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseMemberIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName", Expected: &MemberId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", FleetName: "fleetName", - MemberName: "fleetMemberName", + MemberName: "memberName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/fleetMemberName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetName/members/memberName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtNaMe/mEmBeRs/fLeEtMeMbErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtNaMe/mEmBeRs/mEmBeRnAmE", Expected: &MemberId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", FleetName: "fLeEtNaMe", - MemberName: "fLeEtMeMbErNaMe", + MemberName: "mEmBeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtNaMe/mEmBeRs/fLeEtMeMbErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtNaMe/mEmBeRs/mEmBeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/agentpools/README.md b/resource-manager/containerservice/2024-05-01/agentpools/README.md index 1d17d41326e..c2bc6cedaf4 100644 --- a/resource-manager/containerservice/2024-05-01/agentpools/README.md +++ b/resource-manager/containerservice/2024-05-01/agentpools/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { // handle the error @@ -37,7 +37,7 @@ if err := client.AbortLatestOperationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") payload := agentpools.AgentPool{ // ... @@ -54,7 +54,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") read, err := client.Get(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") read, err := client.GetUpgradeProfile(ctx, id) if err != nil { @@ -131,7 +131,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") +id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if err := client.UpgradeNodeImageVersionThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/containerservice/2024-05-01/agentpools/id_agentpool.go b/resource-manager/containerservice/2024-05-01/agentpools/id_agentpool.go index f45a4261545..d1db170c217 100644 --- a/resource-manager/containerservice/2024-05-01/agentpools/id_agentpool.go +++ b/resource-manager/containerservice/2024-05-01/agentpools/id_agentpool.go @@ -121,7 +121,7 @@ func (id AgentPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolName"), } diff --git a/resource-manager/containerservice/2024-05-01/agentpools/id_agentpool_test.go b/resource-manager/containerservice/2024-05-01/agentpools/id_agentpool_test.go index 1186c4083bc..c11edfbefce 100644 --- a/resource-manager/containerservice/2024-05-01/agentpools/id_agentpool_test.go +++ b/resource-manager/containerservice/2024-05-01/agentpools/id_agentpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AgentPoolId{} func TestNewAgentPoolID(t *testing.T) { - id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName") + id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAgentPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.AgentPoolName != "agentPoolName" { @@ -32,8 +32,8 @@ func TestNewAgentPoolID(t *testing.T) { } func TestFormatAgentPoolID(t *testing.T) { - actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "agentPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName" + actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "agentPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAgentPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAgentPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", AgentPoolName: "agentPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/agentPools/agentPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/agentPools/agentPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe", Expected: &AgentPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", AgentPoolName: "aGeNtPoOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aGeNtPoOlS/aGeNtPoOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/README.md b/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/README.md index a8cc8b55e73..802c62a64b6 100644 --- a/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/README.md +++ b/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") payload := maintenanceconfigurations.MaintenanceConfiguration{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/id_maintenanceconfiguration.go b/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/id_maintenanceconfiguration.go index cb14a083360..a06e5519459 100644 --- a/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/id_maintenanceconfiguration.go +++ b/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/id_maintenanceconfiguration.go @@ -121,9 +121,9 @@ func (id MaintenanceConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticMaintenanceConfigurations", "maintenanceConfigurations", "maintenanceConfigurations"), - resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "configName"), + resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "maintenanceConfigurationName"), } } diff --git a/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go b/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go index e92342634ce..d5d0ad17780 100644 --- a/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go +++ b/resource-manager/containerservice/2024-05-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MaintenanceConfigurationId{} func TestNewMaintenanceConfigurationID(t *testing.T) { - id := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName") + id := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMaintenanceConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } - if id.MaintenanceConfigurationName != "configName" { - t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "configName") + if id.MaintenanceConfigurationName != "maintenanceConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "maintenanceConfigurationName") } } func TestFormatMaintenanceConfigurationID(t *testing.T) { - actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "configName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName" + actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "maintenanceConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMaintenanceConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - MaintenanceConfigurationName: "configName", + ManagedClusterName: "managedClusterName", + MaintenanceConfigurationName: "maintenanceConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMaintenanceConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - MaintenanceConfigurationName: "configName", + ManagedClusterName: "managedClusterName", + MaintenanceConfigurationName: "maintenanceConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/maintenanceConfigurations/configName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/maintenanceConfigurations/maintenanceConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/cOnFiGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNnAmE", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", - MaintenanceConfigurationName: "cOnFiGnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + MaintenanceConfigurationName: "mAiNtEnAnCeCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/cOnFiGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/README.md b/resource-manager/containerservice/2024-05-01/managedclusters/README.md index 4e25bf1b631..6305fbe5d08 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/README.md +++ b/resource-manager/containerservice/2024-05-01/managedclusters/README.md @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName") +id := managedclusters.NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName") read, err := client.GetAccessProfile(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "commandId") +id := managedclusters.NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId") read, err := client.GetCommandResult(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "location", "mode") +id := managedclusters.NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "locationName", "meshRevisionProfileName") read, err := client.GetMeshRevisionProfile(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "mode") +id := managedclusters.NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "meshUpgradeProfileName") read, err := client.GetMeshUpgradeProfile(ctx, id) if err != nil { @@ -244,7 +244,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListKubernetesVersions(ctx, id) if err != nil { @@ -260,7 +260,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListMeshRevisionProfiles(ctx, id)` can be used to do batched pagination items, err := client.ListMeshRevisionProfilesComplete(ctx, id) diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_accessprofile.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_accessprofile.go index 292f444cb70..0cc903a7fde 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_accessprofile.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_accessprofile.go @@ -121,9 +121,9 @@ func (id AccessProfileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticAccessProfiles", "accessProfiles", "accessProfiles"), - resourceids.UserSpecifiedSegment("accessProfileName", "roleName"), + resourceids.UserSpecifiedSegment("accessProfileName", "accessProfileName"), } } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_accessprofile_test.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_accessprofile_test.go index d605f8b60d6..9d2f96670dd 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_accessprofile_test.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_accessprofile_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessProfileId{} func TestNewAccessProfileID(t *testing.T) { - id := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName") + id := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAccessProfileID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } - if id.AccessProfileName != "roleName" { - t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "roleName") + if id.AccessProfileName != "accessProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "accessProfileName") } } func TestFormatAccessProfileID(t *testing.T) { - actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "roleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName" + actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "accessProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessProfileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - AccessProfileName: "roleName", + ManagedClusterName: "managedClusterName", + AccessProfileName: "accessProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessProfileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - AccessProfileName: "roleName", + ManagedClusterName: "managedClusterName", + AccessProfileName: "accessProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/accessProfiles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/accessProfiles/accessProfileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS/aCcEsSpRoFiLeNaMe", Expected: &AccessProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", - AccessProfileName: "rOlEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + AccessProfileName: "aCcEsSpRoFiLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/aCcEsSpRoFiLeS/rOlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aCcEsSpRoFiLeS/aCcEsSpRoFiLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_commandresult.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_commandresult.go index be78edd1c37..737a71e0621 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_commandresult.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_commandresult.go @@ -121,7 +121,7 @@ func (id CommandResultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticCommandResults", "commandResults", "commandResults"), resourceids.UserSpecifiedSegment("commandId", "commandId"), } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_commandresult_test.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_commandresult_test.go index cc2eaa1878f..0c55ce098fa 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_commandresult_test.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_commandresult_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CommandResultId{} func TestNewCommandResultID(t *testing.T) { - id := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "commandId") + id := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCommandResultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.CommandId != "commandId" { @@ -32,8 +32,8 @@ func TestNewCommandResultID(t *testing.T) { } func TestFormatCommandResultID(t *testing.T) { - actual := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "commandId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId" + actual := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "commandId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCommandResultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId", Expected: &CommandResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCommandResultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/cOmMaNdReSuLtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId", Expected: &CommandResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", CommandId: "commandId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/commandResults/commandId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/commandResults/commandId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/cOmMaNdReSuLtS/cOmMaNdId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS/cOmMaNdId", Expected: &CommandResultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", CommandId: "cOmMaNdId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/cOmMaNdReSuLtS/cOmMaNdId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/cOmMaNdReSuLtS/cOmMaNdId/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_location.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_location.go index 39e02aa3899..79aa9b51c07 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_location.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_location_test.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_location_test.go index c130eab2582..db0f4f67412 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_location_test.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_meshrevisionprofile.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_meshrevisionprofile.go index 9085f208683..009771d0a59 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_meshrevisionprofile.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_meshrevisionprofile.go @@ -113,9 +113,9 @@ func (id MeshRevisionProfileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticMeshRevisionProfiles", "meshRevisionProfiles", "meshRevisionProfiles"), - resourceids.UserSpecifiedSegment("meshRevisionProfileName", "mode"), + resourceids.UserSpecifiedSegment("meshRevisionProfileName", "meshRevisionProfileName"), } } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_meshrevisionprofile_test.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_meshrevisionprofile_test.go index bbefc213262..a4e7a52ef61 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_meshrevisionprofile_test.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_meshrevisionprofile_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &MeshRevisionProfileId{} func TestNewMeshRevisionProfileID(t *testing.T) { - id := NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "location", "mode") + id := NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "locationName", "meshRevisionProfileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.MeshRevisionProfileName != "mode" { - t.Fatalf("Expected %q but got %q for Segment 'MeshRevisionProfileName'", id.MeshRevisionProfileName, "mode") + if id.MeshRevisionProfileName != "meshRevisionProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'MeshRevisionProfileName'", id.MeshRevisionProfileName, "meshRevisionProfileName") } } func TestFormatMeshRevisionProfileID(t *testing.T) { - actual := NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "location", "mode").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/meshRevisionProfiles/mode" + actual := NewMeshRevisionProfileID("12345678-1234-9876-4563-123456789012", "locationName", "meshRevisionProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseMeshRevisionProfileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/meshRevisionProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/meshRevisionProfiles/mode", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName", Expected: &MeshRevisionProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - MeshRevisionProfileName: "mode", + LocationName: "locationName", + MeshRevisionProfileName: "meshRevisionProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/meshRevisionProfiles/mode/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseMeshRevisionProfileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/meshRevisionProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN/mEsHrEvIsIoNpRoFiLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/mEsHrEvIsIoNpRoFiLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/meshRevisionProfiles/mode", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName", Expected: &MeshRevisionProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - MeshRevisionProfileName: "mode", + LocationName: "locationName", + MeshRevisionProfileName: "meshRevisionProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/meshRevisionProfiles/mode/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/meshRevisionProfiles/meshRevisionProfileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN/mEsHrEvIsIoNpRoFiLeS/mOdE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/mEsHrEvIsIoNpRoFiLeS/mEsHrEvIsIoNpRoFiLeNaMe", Expected: &MeshRevisionProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - MeshRevisionProfileName: "mOdE", + LocationName: "lOcAtIoNnAmE", + MeshRevisionProfileName: "mEsHrEvIsIoNpRoFiLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN/mEsHrEvIsIoNpRoFiLeS/mOdE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/mEsHrEvIsIoNpRoFiLeS/mEsHrEvIsIoNpRoFiLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_meshupgradeprofile.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_meshupgradeprofile.go index 0f525e4f282..c33efc10c79 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_meshupgradeprofile.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_meshupgradeprofile.go @@ -121,9 +121,9 @@ func (id MeshUpgradeProfileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticMeshUpgradeProfiles", "meshUpgradeProfiles", "meshUpgradeProfiles"), - resourceids.UserSpecifiedSegment("meshUpgradeProfileName", "mode"), + resourceids.UserSpecifiedSegment("meshUpgradeProfileName", "meshUpgradeProfileName"), } } diff --git a/resource-manager/containerservice/2024-05-01/managedclusters/id_meshupgradeprofile_test.go b/resource-manager/containerservice/2024-05-01/managedclusters/id_meshupgradeprofile_test.go index c49eae4947d..eac2f86407e 100644 --- a/resource-manager/containerservice/2024-05-01/managedclusters/id_meshupgradeprofile_test.go +++ b/resource-manager/containerservice/2024-05-01/managedclusters/id_meshupgradeprofile_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MeshUpgradeProfileId{} func TestNewMeshUpgradeProfileID(t *testing.T) { - id := NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "mode") + id := NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "meshUpgradeProfileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMeshUpgradeProfileID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } - if id.MeshUpgradeProfileName != "mode" { - t.Fatalf("Expected %q but got %q for Segment 'MeshUpgradeProfileName'", id.MeshUpgradeProfileName, "mode") + if id.MeshUpgradeProfileName != "meshUpgradeProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'MeshUpgradeProfileName'", id.MeshUpgradeProfileName, "meshUpgradeProfileName") } } func TestFormatMeshUpgradeProfileID(t *testing.T) { - actual := NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "mode").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/meshUpgradeProfiles/mode" + actual := NewMeshUpgradeProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "meshUpgradeProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMeshUpgradeProfileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/meshUpgradeProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/meshUpgradeProfiles/mode", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName", Expected: &MeshUpgradeProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - MeshUpgradeProfileName: "mode", + ManagedClusterName: "managedClusterName", + MeshUpgradeProfileName: "meshUpgradeProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/meshUpgradeProfiles/mode/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMeshUpgradeProfileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/meshUpgradeProfiles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mEsHuPgRaDePrOfIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mEsHuPgRaDePrOfIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/meshUpgradeProfiles/mode", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName", Expected: &MeshUpgradeProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", - MeshUpgradeProfileName: "mode", + ManagedClusterName: "managedClusterName", + MeshUpgradeProfileName: "meshUpgradeProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/meshUpgradeProfiles/mode/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/meshUpgradeProfiles/meshUpgradeProfileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mEsHuPgRaDePrOfIlEs/mOdE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mEsHuPgRaDePrOfIlEs/mEsHuPgRaDePrOfIlEnAmE", Expected: &MeshUpgradeProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", - MeshUpgradeProfileName: "mOdE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", + MeshUpgradeProfileName: "mEsHuPgRaDePrOfIlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/mEsHuPgRaDePrOfIlEs/mOdE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/mEsHuPgRaDePrOfIlEs/mEsHuPgRaDePrOfIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/privateendpointconnections/README.md b/resource-manager/containerservice/2024-05-01/privateendpointconnections/README.md index 5503a038c49..bfe800e392f 100644 --- a/resource-manager/containerservice/2024-05-01/privateendpointconnections/README.md +++ b/resource-manager/containerservice/2024-05-01/privateendpointconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -37,7 +37,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/containerservice/2024-05-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/containerservice/2024-05-01/privateendpointconnections/id_privateendpointconnection.go index 7ad36e39a62..383123bb5dc 100644 --- a/resource-manager/containerservice/2024-05-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/containerservice/2024-05-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/containerservice/2024-05-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/containerservice/2024-05-01/privateendpointconnections/id_privateendpointconnection_test.go index 58803da09c6..f180a2cbb26 100644 --- a/resource-manager/containerservice/2024-05-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/containerservice/2024-05-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/snapshots/README.md b/resource-manager/containerservice/2024-05-01/snapshots/README.md index c7b3935881e..61d9d7ea273 100644 --- a/resource-manager/containerservice/2024-05-01/snapshots/README.md +++ b/resource-manager/containerservice/2024-05-01/snapshots/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") payload := snapshots.Snapshot{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") read, err := client.Get(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") payload := snapshots.TagsObject{ // ... diff --git a/resource-manager/containerservice/2024-05-01/snapshots/id_snapshot.go b/resource-manager/containerservice/2024-05-01/snapshots/id_snapshot.go index 378c04ec35a..8081e44fc0b 100644 --- a/resource-manager/containerservice/2024-05-01/snapshots/id_snapshot.go +++ b/resource-manager/containerservice/2024-05-01/snapshots/id_snapshot.go @@ -115,7 +115,7 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), - resourceids.UserSpecifiedSegment("snapshotName", "resourceName"), + resourceids.UserSpecifiedSegment("snapshotName", "snapshotName"), } } diff --git a/resource-manager/containerservice/2024-05-01/snapshots/id_snapshot_test.go b/resource-manager/containerservice/2024-05-01/snapshots/id_snapshot_test.go index 19cfaa64aef..67f5a402cf0 100644 --- a/resource-manager/containerservice/2024-05-01/snapshots/id_snapshot_test.go +++ b/resource-manager/containerservice/2024-05-01/snapshots/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SnapshotName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SnapshotName'", id.SnapshotName, "resourceName") + if id.SnapshotName != "snapshotName" { + t.Fatalf("Expected %q but got %q for Segment 'SnapshotName'", id.SnapshotName, "snapshotName") } } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseSnapshotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SnapshotName: "resourceName", + SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SnapshotName: "resourceName", + SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/sNaPsHoTnAmE", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SnapshotName: "rEsOuRcEnAmE", + SnapshotName: "sNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/sNaPsHoTs/sNaPsHoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/trustedaccess/README.md b/resource-manager/containerservice/2024-05-01/trustedaccess/README.md index 4a176c30043..4e3b28865e7 100644 --- a/resource-manager/containerservice/2024-05-01/trustedaccess/README.md +++ b/resource-manager/containerservice/2024-05-01/trustedaccess/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName") +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") payload := trustedaccess.TrustedAccessRoleBinding{ // ... @@ -42,7 +42,7 @@ if err := client.RoleBindingsCreateOrUpdateThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName") +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") if err := client.RoleBindingsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.RoleBindingsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName") +id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") read, err := client.RoleBindingsGet(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := trustedaccess.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := trustedaccess.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.RolesList(ctx, id)` can be used to do batched pagination items, err := client.RolesListComplete(ctx, id) diff --git a/resource-manager/containerservice/2024-05-01/trustedaccess/id_location.go b/resource-manager/containerservice/2024-05-01/trustedaccess/id_location.go index ee307de7b57..9372d26414b 100644 --- a/resource-manager/containerservice/2024-05-01/trustedaccess/id_location.go +++ b/resource-manager/containerservice/2024-05-01/trustedaccess/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/containerservice/2024-05-01/trustedaccess/id_location_test.go b/resource-manager/containerservice/2024-05-01/trustedaccess/id_location_test.go index 661192a2e37..d75d02aa0b9 100644 --- a/resource-manager/containerservice/2024-05-01/trustedaccess/id_location_test.go +++ b/resource-manager/containerservice/2024-05-01/trustedaccess/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/containerservice/2024-05-01/trustedaccess/id_trustedaccessrolebinding.go b/resource-manager/containerservice/2024-05-01/trustedaccess/id_trustedaccessrolebinding.go index f6b33cf608e..e53842f1ccd 100644 --- a/resource-manager/containerservice/2024-05-01/trustedaccess/id_trustedaccessrolebinding.go +++ b/resource-manager/containerservice/2024-05-01/trustedaccess/id_trustedaccessrolebinding.go @@ -121,7 +121,7 @@ func (id TrustedAccessRoleBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticTrustedAccessRoleBindings", "trustedAccessRoleBindings", "trustedAccessRoleBindings"), resourceids.UserSpecifiedSegment("trustedAccessRoleBindingName", "trustedAccessRoleBindingName"), } diff --git a/resource-manager/containerservice/2024-05-01/trustedaccess/id_trustedaccessrolebinding_test.go b/resource-manager/containerservice/2024-05-01/trustedaccess/id_trustedaccessrolebinding_test.go index 4790f09de5d..bea546caaef 100644 --- a/resource-manager/containerservice/2024-05-01/trustedaccess/id_trustedaccessrolebinding_test.go +++ b/resource-manager/containerservice/2024-05-01/trustedaccess/id_trustedaccessrolebinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TrustedAccessRoleBindingId{} func TestNewTrustedAccessRoleBindingID(t *testing.T) { - id := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName") + id := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTrustedAccessRoleBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "resourceName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.TrustedAccessRoleBindingName != "trustedAccessRoleBindingName" { @@ -32,8 +32,8 @@ func TestNewTrustedAccessRoleBindingID(t *testing.T) { } func TestFormatTrustedAccessRoleBindingID(t *testing.T) { - actual := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "trustedAccessRoleBindingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName" + actual := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "trustedAccessRoleBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTrustedAccessRoleBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName", Expected: &TrustedAccessRoleBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", TrustedAccessRoleBindingName: "trustedAccessRoleBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTrustedAccessRoleBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/tRuStEdAcCeSsRoLeBiNdInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName", Expected: &TrustedAccessRoleBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "resourceName", + ManagedClusterName: "managedClusterName", TrustedAccessRoleBindingName: "trustedAccessRoleBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/resourceName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterName/trustedAccessRoleBindings/trustedAccessRoleBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE", Expected: &TrustedAccessRoleBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "rEsOuRcEnAmE", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", TrustedAccessRoleBindingName: "tRuStEdAcCeSsRoLeBiNdInGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/rEsOuRcEnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/README.md b/resource-manager/cosmosdb/2022-05-15/cosmosdb/README.md index 5e131b32418..e5d87588b03 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/README.md +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.CassandraKeyspaceCreateUpdateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.CassandraTableCreateUpdateParameters{ // ... @@ -59,7 +59,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != nil { // handle the error @@ -83,7 +83,7 @@ if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspace(ctx, id) if err != nil { @@ -99,7 +99,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) if err != nil { @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTable(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTableThroughput(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.CassandraResourcesListCassandraKeyspaces(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesListCassandraTables(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -191,7 +191,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThe ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -215,7 +215,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -227,7 +227,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPo ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -244,7 +244,7 @@ if err := client.CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -261,7 +261,7 @@ if err := client.CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetricDefinitions(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetrics(ctx, id, cosmosdb.DefaultCollectionListMetricsOperationOptions()) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListUsages(ctx, id, cosmosdb.DefaultCollectionListUsagesOperationOptions()) if err != nil { @@ -309,7 +309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionListMetricsOperationOptions()) if err != nil { @@ -325,7 +325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListUsages(ctx, id, cosmosdb.DefaultCollectionPartitionListUsagesOperationOptions()) if err != nil { @@ -341,7 +341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionPartitionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionRegionListMetricsOperationOptions()) if err != nil { @@ -357,7 +357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionRegionListMetricsOperationOptions()) if err != nil { @@ -373,7 +373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") +id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") read, err := client.DatabaseAccountRegionListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountRegionListMetricsOperationOptions()) if err != nil { @@ -405,7 +405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountCreateUpdateParameters{ // ... @@ -422,7 +422,7 @@ if err := client.DatabaseAccountsCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -434,7 +434,7 @@ if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.FailoverPolicies{ // ... @@ -451,7 +451,7 @@ if err := client.DatabaseAccountsFailoverPriorityChangeThenPoll(ctx, id, payload ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGet(ctx, id) if err != nil { @@ -467,7 +467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGetReadOnlyKeys(ctx, id) if err != nil { @@ -515,7 +515,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListConnectionStrings(ctx, id) if err != nil { @@ -531,7 +531,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListKeys(ctx, id) if err != nil { @@ -547,7 +547,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetricDefinitions(ctx, id) if err != nil { @@ -563,7 +563,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountsListMetricsOperationOptions()) if err != nil { @@ -579,7 +579,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListReadOnlyKeys(ctx, id) if err != nil { @@ -595,7 +595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListUsages(ctx, id, cosmosdb.DefaultDatabaseAccountsListUsagesOperationOptions()) if err != nil { @@ -611,7 +611,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -628,7 +628,7 @@ if err := client.DatabaseAccountsOfflineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -645,7 +645,7 @@ if err := client.DatabaseAccountsOnlineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountRegenerateKeyParameters{ // ... @@ -662,7 +662,7 @@ if err := client.DatabaseAccountsRegenerateKeyThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountUpdateParameters{ // ... @@ -679,7 +679,7 @@ if err := client.DatabaseAccountsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetricDefinitions(ctx, id) if err != nil { @@ -695,7 +695,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetrics(ctx, id, cosmosdb.DefaultDatabaseListMetricsOperationOptions()) if err != nil { @@ -711,7 +711,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListUsages(ctx, id, cosmosdb.DefaultDatabaseListUsagesOperationOptions()) if err != nil { @@ -727,7 +727,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.GremlinDatabaseCreateUpdateParameters{ // ... @@ -744,7 +744,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.GremlinGraphCreateUpdateParameters{ // ... @@ -761,7 +761,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -773,7 +773,7 @@ if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil { // handle the error @@ -785,7 +785,7 @@ if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabase(ctx, id) if err != nil { @@ -801,7 +801,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabaseThroughput(ctx, id) if err != nil { @@ -817,7 +817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraph(ctx, id) if err != nil { @@ -833,7 +833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraphThroughput(ctx, id) if err != nil { @@ -849,7 +849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.GremlinResourcesListGremlinDatabases(ctx, id) if err != nil { @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesListGremlinGraphs(ctx, id) if err != nil { @@ -881,7 +881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -893,7 +893,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -905,7 +905,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -917,7 +917,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id) ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -929,7 +929,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -946,7 +946,7 @@ if err := client.GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -963,7 +963,7 @@ if err := client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsGet(ctx, id) if err != nil { @@ -995,7 +995,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.MongoDBCollectionCreateUpdateParameters{ // ... @@ -1012,7 +1012,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.MongoDBDatabaseCreateUpdateParameters{ // ... @@ -1029,7 +1029,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err != nil { // handle the error @@ -1041,7 +1041,7 @@ if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err ! ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1053,7 +1053,7 @@ if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollection(ctx, id) if err != nil { @@ -1069,7 +1069,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) if err != nil { @@ -1085,7 +1085,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabase(ctx, id) if err != nil { @@ -1101,7 +1101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) if err != nil { @@ -1117,7 +1117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesListMongoDBCollections(ctx, id) if err != nil { @@ -1133,7 +1133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoDBDatabases(ctx, id) if err != nil { @@ -1149,7 +1149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1161,7 +1161,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1173,7 +1173,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenP ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1185,7 +1185,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1197,7 +1197,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1214,7 +1214,7 @@ if err := client.MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1231,7 +1231,7 @@ if err := client.MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdListMetricsOperationOptions()) if err != nil { @@ -1247,7 +1247,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdRegionListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions()) if err != nil { @@ -1263,7 +1263,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.PercentileListMetrics(ctx, id, cosmosdb.DefaultPercentileListMetricsOperationOptions()) if err != nil { @@ -1279,7 +1279,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") +id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") read, err := client.PercentileSourceTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileSourceTargetListMetricsOperationOptions()) if err != nil { @@ -1295,7 +1295,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") +id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") read, err := client.PercentileTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileTargetListMetricsOperationOptions()) if err != nil { @@ -1311,7 +1311,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.SqlContainerCreateUpdateParameters{ // ... @@ -1328,7 +1328,7 @@ if err := client.SqlResourcesCreateUpdateSqlContainerThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.SqlDatabaseCreateUpdateParameters{ // ... @@ -1345,7 +1345,7 @@ if err := client.SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") payload := cosmosdb.SqlStoredProcedureCreateUpdateParameters{ // ... @@ -1362,7 +1362,7 @@ if err := client.SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") payload := cosmosdb.SqlTriggerCreateUpdateParameters{ // ... @@ -1379,7 +1379,7 @@ if err := client.SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") payload := cosmosdb.SqlUserDefinedFunctionCreateUpdateParameters{ // ... @@ -1396,7 +1396,7 @@ if err := client.SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { // handle the error @@ -1408,7 +1408,7 @@ if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1420,7 +1420,7 @@ if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != nil { // handle the error @@ -1432,7 +1432,7 @@ if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != n ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { // handle the error @@ -1444,7 +1444,7 @@ if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err != nil { // handle the error @@ -1456,7 +1456,7 @@ if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainer(ctx, id) if err != nil { @@ -1472,7 +1472,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainerThroughput(ctx, id) if err != nil { @@ -1488,7 +1488,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabase(ctx, id) if err != nil { @@ -1504,7 +1504,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabaseThroughput(ctx, id) if err != nil { @@ -1520,7 +1520,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") read, err := client.SqlResourcesGetSqlStoredProcedure(ctx, id) if err != nil { @@ -1536,7 +1536,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") read, err := client.SqlResourcesGetSqlTrigger(ctx, id) if err != nil { @@ -1552,7 +1552,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") read, err := client.SqlResourcesGetSqlUserDefinedFunction(ctx, id) if err != nil { @@ -1568,7 +1568,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListSqlContainers(ctx, id) if err != nil { @@ -1584,7 +1584,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlDatabases(ctx, id) if err != nil { @@ -1600,7 +1600,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlStoredProcedures(ctx, id) if err != nil { @@ -1616,7 +1616,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlTriggers(ctx, id) if err != nil { @@ -1632,7 +1632,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlUserDefinedFunctions(ctx, id) if err != nil { @@ -1648,7 +1648,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1660,7 +1660,7 @@ if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); er ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1672,7 +1672,7 @@ if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1684,7 +1684,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1696,7 +1696,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1713,7 +1713,7 @@ if err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1730,7 +1730,7 @@ if err := client.SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.TableCreateUpdateParameters{ // ... @@ -1747,7 +1747,7 @@ if err := client.TableResourcesCreateUpdateTableThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { // handle the error @@ -1759,7 +1759,7 @@ if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTable(ctx, id) if err != nil { @@ -1775,7 +1775,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTableThroughput(ctx, id) if err != nil { @@ -1791,7 +1791,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.TableResourcesListTables(ctx, id) if err != nil { @@ -1807,7 +1807,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1819,7 +1819,7 @@ if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1831,7 +1831,7 @@ if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspace.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspace.go index 4ce40124431..c7e797b1802 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspace.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspace.go @@ -121,9 +121,9 @@ func (id CassandraKeyspaceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspace_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspace_test.go index 2c41b074274..1f760780ed8 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspace_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceId{} func TestNewCassandraKeyspaceID(t *testing.T) { - id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") + id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCassandraKeyspaceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } } func TestFormatCassandraKeyspaceID(t *testing.T) { - actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName" + actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCassandraKeyspaceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCassandraKeyspaceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspacetable.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspacetable.go index 939b9bdce12..5609bfaea81 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspacetable.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspacetable.go @@ -127,9 +127,9 @@ func (id CassandraKeyspaceTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspacetable_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspacetable_test.go index 0d6746660eb..de5ca96190f 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspacetable_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_cassandrakeyspacetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceTableId{} func TestNewCassandraKeyspaceTableID(t *testing.T) { - id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") + id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } if id.TableName != "tableName" { @@ -36,8 +36,8 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { } func TestFormatCassandraKeyspaceTableID(t *testing.T) { - actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName" + actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCassandraKeyspaceTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCassandraKeyspaceTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collection.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collection.go index 7a48b54fbb3..20b1d5d4051 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collection.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collection.go @@ -127,11 +127,11 @@ func (id CollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collection_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collection_test.go index af80428336c..5d25b21a81e 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collection_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionId{} func TestNewCollectionID(t *testing.T) { - id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") + id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatCollectionID(t *testing.T) { - actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid" + actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collectionpartitionkeyrangeid.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collectionpartitionkeyrangeid.go index 0372c743649..a8f1146d844 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collectionpartitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collectionpartitionkeyrangeid.go @@ -139,13 +139,13 @@ func (id CollectionPartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go index 51120cbbc59..7a4dd109319 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionPartitionKeyRangeIdId{} func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { - id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -44,8 +44,8 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { } func TestFormatCollectionPartitionKeyRangeIdID(t *testing.T) { - actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseCollectionPartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseCollectionPartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_container.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_container.go index 9fc554842ed..52411ec0fb4 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_container.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_container_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_container_test.go index e4a16015b14..f6673f4842c 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_container_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_database.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_database.go index 32a5b840398..c73ee48b681 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_database.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_database.go @@ -121,9 +121,9 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_database_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_database_test.go index 48cd6308772..c1750285bd3 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_database_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databaseaccount.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databaseaccount.go index 2ca27074b00..dfad7d15d85 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databaseaccount_test.go index a3631600aea..d8132b226fc 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databasecollection.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databasecollection.go index 4029bc74189..81c3be1f181 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databasecollection.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databasecollection.go @@ -133,13 +133,13 @@ func (id DatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databasecollection_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databasecollection_test.go index c2a9406bb53..8d0ed01afa3 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databasecollection_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_databasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseCollectionId{} func TestNewDatabaseCollectionID(t *testing.T) { - id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") + id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatDatabaseCollectionID(t *testing.T) { - actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid" + actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_graph.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_graph.go index 7a55f30993c..e520754fd71 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_graph.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_graph_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_graph_test.go index 54c0bd78a11..1f089c40924 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_graph_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_gremlindatabase.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_gremlindatabase.go index 8bfcc87e575..5ef8dfa4e09 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_gremlindatabase.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_gremlindatabase.go @@ -121,9 +121,9 @@ func (id GremlinDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_gremlindatabase_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_gremlindatabase_test.go index 1750dbc731f..a988d8e29ed 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_gremlindatabase_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_gremlindatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GremlinDatabaseId{} func TestNewGremlinDatabaseID(t *testing.T) { - id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGremlinDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } } func TestFormatGremlinDatabaseID(t *testing.T) { - actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName" + actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGremlinDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGremlinDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_location.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_location.go index febfbe7d88f..483a412e5c7 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_location.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_location_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_location_test.go index c94c6add0bd..803c3f2c435 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_location_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabase.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabase.go index 75875a6ac54..93bc507bbf9 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabase.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabase.go @@ -121,9 +121,9 @@ func (id MongodbDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabase_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabase_test.go index 13fca77bd6a..fbe5814e30c 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabase_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseId{} func TestNewMongodbDatabaseID(t *testing.T) { - id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMongodbDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } } func TestFormatMongodbDatabaseID(t *testing.T) { - actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName" + actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabasecollection.go index 7ddcf2cbb6d..8b233638340 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabasecollection_test.go index b311d450e34..96fb623f632 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_partitionkeyrangeid.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_partitionkeyrangeid.go index 88f0f4a92d5..0f54ae80af9 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_partitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_partitionkeyrangeid.go @@ -133,11 +133,11 @@ func (id PartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_partitionkeyrangeid_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_partitionkeyrangeid_test.go index d96f13f7d9f..d06f8a1ceda 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_partitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_partitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PartitionKeyRangeIdId{} func TestNewPartitionKeyRangeIdID(t *testing.T) { - id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -40,8 +40,8 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { } func TestFormatPartitionKeyRangeIdID(t *testing.T) { - actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParsePartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParsePartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_region.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_region.go index 4f0f50bcdef..36fb36b86d2 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_region.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_region.go @@ -121,9 +121,9 @@ func (id RegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_region_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_region_test.go index 416fa31d29e..45452117088 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_region_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_region_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegionId{} func TestNewRegionID(t *testing.T) { - id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") + id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } } func TestFormatRegionID(t *testing.T) { - actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region" + actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sourceregiontargetregion.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sourceregiontargetregion.go index eaa24e25c65..2112d234a8e 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sourceregiontargetregion.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sourceregiontargetregion.go @@ -127,11 +127,11 @@ func (id SourceRegionTargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSourceRegion", "sourceRegion", "sourceRegion"), - resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegion"), + resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegionName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sourceregiontargetregion_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sourceregiontargetregion_test.go index d96342f3531..9acfe7a194e 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sourceregiontargetregion_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sourceregiontargetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SourceRegionTargetRegionId{} func TestNewSourceRegionTargetRegionID(t *testing.T) { - id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") + id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSourceRegionTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SourceRegionName != "sourceRegion" { - t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegion") + if id.SourceRegionName != "sourceRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegionName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatSourceRegionTargetRegionID(t *testing.T) { - actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion" + actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSourceRegionTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSourceRegionTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SourceRegionName: "sOuRcErEgIoN", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SourceRegionName: "sOuRcErEgIoNnAmE", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sqldatabase.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sqldatabase.go index d92d2bbbf59..21d4f894dd5 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sqldatabase.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sqldatabase.go @@ -121,9 +121,9 @@ func (id SqlDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sqldatabase_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sqldatabase_test.go index f9999bbfaa0..5751b55efa6 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sqldatabase_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_sqldatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlDatabaseId{} func TestNewSqlDatabaseID(t *testing.T) { - id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSqlDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } } func TestFormatSqlDatabaseID(t *testing.T) { - actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName" + actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_storedprocedure.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_storedprocedure.go index 72b9abbafe9..31dd78cfcba 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_storedprocedure.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_storedprocedure.go @@ -133,9 +133,9 @@ func (id StoredProcedureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticStoredProcedures", "storedProcedures", "storedProcedures"), diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_storedprocedure_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_storedprocedure_test.go index ccb86f85be8..602b81d744b 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_storedprocedure_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_storedprocedure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StoredProcedureId{} func TestNewStoredProcedureID(t *testing.T) { - id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") + id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewStoredProcedureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewStoredProcedureID(t *testing.T) { } func TestFormatStoredProcedureID(t *testing.T) { - actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName" + actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseStoredProcedureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseStoredProcedureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", StoredProcedureName: "sToReDpRoCeDuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_table.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_table.go index ecf9d97c31e..db828313697 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_table.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_table_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_table_test.go index 1e9703fdba1..861ecae041b 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_table_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_targetregion.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_targetregion.go index 213d48cf619..c07e6abe2a3 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_targetregion.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_targetregion.go @@ -121,9 +121,9 @@ func (id TargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_targetregion_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_targetregion_test.go index 5a026cdd4cd..636fb4b33f6 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_targetregion_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_targetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TargetRegionId{} func TestNewTargetRegionID(t *testing.T) { - id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") + id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatTargetRegionID(t *testing.T) { - actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion" + actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_trigger.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_trigger.go index 8c6760bfa3d..79ef1f4abbf 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_trigger.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_trigger.go @@ -133,9 +133,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_trigger_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_trigger_test.go index 2033539a5a9..42683f03ca2 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_trigger_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_userdefinedfunction.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_userdefinedfunction.go index c09e749c3cb..eb5d1f446fd 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_userdefinedfunction.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_userdefinedfunction.go @@ -133,9 +133,9 @@ func (id UserDefinedFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticUserDefinedFunctions", "userDefinedFunctions", "userDefinedFunctions"), diff --git a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_userdefinedfunction_test.go b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_userdefinedfunction_test.go index 0f53e3aa1bf..ca957175cbc 100644 --- a/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_userdefinedfunction_test.go +++ b/resource-manager/cosmosdb/2022-05-15/cosmosdb/id_userdefinedfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserDefinedFunctionId{} func TestNewUserDefinedFunctionID(t *testing.T) { - id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") + id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewUserDefinedFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewUserDefinedFunctionID(t *testing.T) { } func TestFormatUserDefinedFunctionID(t *testing.T) { - actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" + actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseUserDefinedFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseUserDefinedFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", UserDefinedFunctionName: "uSeRdEfInEdFuNcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/datatransfer/README.md b/resource-manager/cosmosdb/2022-05-15/datatransfer/README.md index 496362cab90..1b707a63c86 100644 --- a/resource-manager/cosmosdb/2022-05-15/datatransfer/README.md +++ b/resource-manager/cosmosdb/2022-05-15/datatransfer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := datatransfer.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-05-15/datatransfer/id_service.go b/resource-manager/cosmosdb/2022-05-15/datatransfer/id_service.go index 6f3fabaa7b7..58fd3f22eb2 100644 --- a/resource-manager/cosmosdb/2022-05-15/datatransfer/id_service.go +++ b/resource-manager/cosmosdb/2022-05-15/datatransfer/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/datatransfer/id_service_test.go b/resource-manager/cosmosdb/2022-05-15/datatransfer/id_service_test.go index accfb95c7e8..b3261c00b8b 100644 --- a/resource-manager/cosmosdb/2022-05-15/datatransfer/id_service_test.go +++ b/resource-manager/cosmosdb/2022-05-15/datatransfer/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/graphapicompute/README.md b/resource-manager/cosmosdb/2022-05-15/graphapicompute/README.md index 02b414b3ec6..1a02cb9a936 100644 --- a/resource-manager/cosmosdb/2022-05-15/graphapicompute/README.md +++ b/resource-manager/cosmosdb/2022-05-15/graphapicompute/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := graphapicompute.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-05-15/graphapicompute/id_service.go b/resource-manager/cosmosdb/2022-05-15/graphapicompute/id_service.go index 37a699c2693..a4987f4b408 100644 --- a/resource-manager/cosmosdb/2022-05-15/graphapicompute/id_service.go +++ b/resource-manager/cosmosdb/2022-05-15/graphapicompute/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/graphapicompute/id_service_test.go b/resource-manager/cosmosdb/2022-05-15/graphapicompute/id_service_test.go index 20302671509..4be092ed7b2 100644 --- a/resource-manager/cosmosdb/2022-05-15/graphapicompute/id_service_test.go +++ b/resource-manager/cosmosdb/2022-05-15/graphapicompute/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/managedcassandras/README.md b/resource-manager/cosmosdb/2022-05-15/managedcassandras/README.md index a629ae6b21a..e3a4c61856a 100644 --- a/resource-manager/cosmosdb/2022-05-15/managedcassandras/README.md +++ b/resource-manager/cosmosdb/2022-05-15/managedcassandras/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraClustersCreateUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersGet(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.CommandPostBody{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { // handle the error @@ -143,7 +143,7 @@ if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersStatus(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -176,7 +176,7 @@ if err := client.CassandraClustersUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... @@ -193,7 +193,7 @@ if err := client.CassandraDataCentersCreateUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -205,7 +205,7 @@ if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") read, err := client.CassandraDataCentersGet(ctx, id) if err != nil { @@ -221,7 +221,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraDataCentersList(ctx, id) if err != nil { @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... diff --git a/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_cassandracluster.go b/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_cassandracluster.go index 43ce8c1202c..b189a0db128 100644 --- a/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_cassandracluster.go +++ b/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_cassandracluster.go @@ -115,7 +115,7 @@ func (id CassandraClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_cassandracluster_test.go b/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_cassandracluster_test.go index b21a0ee8614..6e99daf02bb 100644 --- a/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_cassandracluster_test.go +++ b/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_cassandracluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraClusterId{} func TestNewCassandraClusterID(t *testing.T) { - id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCassandraClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } } func TestFormatCassandraClusterID(t *testing.T) { - actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName" + actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCassandraClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCassandraClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_datacenter.go b/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_datacenter.go index 8736ef94f6f..5c5a637c822 100644 --- a/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_datacenter.go +++ b/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_datacenter.go @@ -121,7 +121,7 @@ func (id DataCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), resourceids.StaticSegment("staticDataCenters", "dataCenters", "dataCenters"), resourceids.UserSpecifiedSegment("dataCenterName", "dataCenterName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_datacenter_test.go b/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_datacenter_test.go index 66e81bfb94f..e958093a948 100644 --- a/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_datacenter_test.go +++ b/resource-manager/cosmosdb/2022-05-15/managedcassandras/id_datacenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataCenterId{} func TestNewDataCenterID(t *testing.T) { - id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") + id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDataCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } if id.DataCenterName != "dataCenterName" { @@ -32,8 +32,8 @@ func TestNewDataCenterID(t *testing.T) { } func TestFormatDataCenterID(t *testing.T) { - actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName" + actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDataCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDataCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", DataCenterName: "dAtAcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/README.md b/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/README.md index 7b677ab1fd2..48206f0c895 100644 --- a/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/README.md +++ b/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := materializedviewsbuilder.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/id_service.go b/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/id_service.go index 3af930e9bc6..2eb7e5e0d31 100644 --- a/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/id_service.go +++ b/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/id_service_test.go b/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/id_service_test.go index 8d14f132a1e..577612d3e07 100644 --- a/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/id_service_test.go +++ b/resource-manager/cosmosdb/2022-05-15/materializedviewsbuilder/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/README.md b/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/README.md index 155b8814263..f9a1d7c131e 100644 --- a/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/README.md +++ b/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := notebookworkspacesresource.ARMProxyResource{ // ... @@ -41,7 +41,7 @@ if err := client.NotebookWorkspacesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListByDatabaseAccount(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListConnectionInfo(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != nil { // handle the error @@ -113,7 +113,7 @@ if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesStartThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/id_databaseaccount.go b/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/id_databaseaccount.go index cc1cfbae97b..48f82ab040b 100644 --- a/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/id_databaseaccount_test.go index 765176e522b..4b238cf57bd 100644 --- a/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-05-15/notebookworkspacesresource/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/README.md b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/README.md index 3425f95806b..b7ccc384e4b 100644 --- a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/README.md +++ b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_databaseaccount.go b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_databaseaccount.go index 2d03a12f035..0ef32fef9c1 100644 --- a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_databaseaccount_test.go index def6cb01a81..fe0be2f9ad1 100644 --- a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_privateendpointconnection.go index 404b3ec4b99..ad4cd96d133 100644 --- a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_privateendpointconnection_test.go index 616287d8b5e..6f7f6251e0b 100644 --- a/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/cosmosdb/2022-05-15/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/README.md b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/README.md index 6eae09d51d5..d7f2b2ef399 100644 --- a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/README.md +++ b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_databaseaccount.go b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_databaseaccount.go index da2cafa82ce..09df5d78d9d 100644 --- a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_databaseaccount_test.go index 54eac6dbdc6..aa4eb501a97 100644 --- a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_privatelinkresource.go b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_privatelinkresource.go index 14bd8a6525e..22240869721 100644 --- a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_privatelinkresource_test.go index df3663505ef..8994ca6277c 100644 --- a/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/cosmosdb/2022-05-15/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/rbacs/README.md b/resource-manager/cosmosdb/2022-05-15/rbacs/README.md index 1037819df1a..0cc274b1b4d 100644 --- a/resource-manager/cosmosdb/2022-05-15/rbacs/README.md +++ b/resource-manager/cosmosdb/2022-05-15/rbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") payload := rbacs.SqlRoleAssignmentCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleAssignmentThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") payload := rbacs.SqlRoleDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleDefinitionThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.SqlResourcesGetSqlRoleAssignment(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") read, err := client.SqlResourcesGetSqlRoleDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleAssignments(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-05-15/rbacs/id_account.go b/resource-manager/cosmosdb/2022-05-15/rbacs/id_account.go index 71408ced400..2fd416725b1 100644 --- a/resource-manager/cosmosdb/2022-05-15/rbacs/id_account.go +++ b/resource-manager/cosmosdb/2022-05-15/rbacs/id_account.go @@ -121,7 +121,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleAssignments", "sqlRoleAssignments", "sqlRoleAssignments"), resourceids.ScopeSegment("roleAssignmentId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } diff --git a/resource-manager/cosmosdb/2022-05-15/rbacs/id_account_test.go b/resource-manager/cosmosdb/2022-05-15/rbacs/id_account_test.go index 28a5f3a07bb..ad2c1bacfd4 100644 --- a/resource-manager/cosmosdb/2022-05-15/rbacs/id_account_test.go +++ b/resource-manager/cosmosdb/2022-05-15/rbacs/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleAssignmentId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewAccountID(t *testing.T) { } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,21 +87,21 @@ func TestParseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -223,41 +223,41 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleAssignmentId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/cosmosdb/2022-05-15/rbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2022-05-15/rbacs/id_databaseaccount.go index a75e72bbb29..eea55d3e517 100644 --- a/resource-manager/cosmosdb/2022-05-15/rbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-05-15/rbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/rbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-05-15/rbacs/id_databaseaccount_test.go index f7b7f6e34a5..85257d9182a 100644 --- a/resource-manager/cosmosdb/2022-05-15/rbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-05-15/rbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/rbacs/id_sqlroledefinition.go b/resource-manager/cosmosdb/2022-05-15/rbacs/id_sqlroledefinition.go index 8b5ee24533d..fb415467ab6 100644 --- a/resource-manager/cosmosdb/2022-05-15/rbacs/id_sqlroledefinition.go +++ b/resource-manager/cosmosdb/2022-05-15/rbacs/id_sqlroledefinition.go @@ -121,7 +121,7 @@ func (id SqlRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleDefinitions", "sqlRoleDefinitions", "sqlRoleDefinitions"), resourceids.UserSpecifiedSegment("roleDefinitionId", "roleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2022-05-15/rbacs/id_sqlroledefinition_test.go b/resource-manager/cosmosdb/2022-05-15/rbacs/id_sqlroledefinition_test.go index e54bbbbe92a..d5f64dcc134 100644 --- a/resource-manager/cosmosdb/2022-05-15/rbacs/id_sqlroledefinition_test.go +++ b/resource-manager/cosmosdb/2022-05-15/rbacs/id_sqlroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlRoleDefinitionId{} func TestNewSqlRoleDefinitionID(t *testing.T) { - id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") + id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleDefinitionId != "roleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { } func TestFormatSqlRoleDefinitionID(t *testing.T) { - actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId" + actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleDefinitionId: "rOlEdEfInItIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/README.md b/resource-manager/cosmosdb/2022-05-15/restorables/README.md index 361a2cd7dd8..8df819e0e2c 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/README.md +++ b/resource-manager/cosmosdb/2022-05-15/restorables/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -42,7 +42,7 @@ if err := client.MongoDBResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableDatabaseAccountsGetByLocation(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RestorableDatabaseAccountsListByLocation(ctx, id) if err != nil { @@ -90,7 +90,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbCollectionsList(ctx, id, restorables.DefaultRestorableMongodbCollectionsListOperationOptions()) if err != nil { @@ -106,7 +106,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbDatabasesList(ctx, id) if err != nil { @@ -122,7 +122,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbResourcesList(ctx, id, restorables.DefaultRestorableMongodbResourcesListOperationOptions()) if err != nil { @@ -138,7 +138,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlContainersList(ctx, id, restorables.DefaultRestorableSqlContainersListOperationOptions()) if err != nil { @@ -154,7 +154,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlDatabasesList(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlResourcesList(ctx, id, restorables.DefaultRestorableSqlResourcesListOperationOptions()) if err != nil { @@ -186,7 +186,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := restorables.ContinuousBackupRestoreLocation{ // ... diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/id_container.go b/resource-manager/cosmosdb/2022-05-15/restorables/id_container.go index 9398504f72d..cc01b7113aa 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/id_container.go +++ b/resource-manager/cosmosdb/2022-05-15/restorables/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/id_container_test.go b/resource-manager/cosmosdb/2022-05-15/restorables/id_container_test.go index 0cea9d939ac..97675cfd2b9 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/id_container_test.go +++ b/resource-manager/cosmosdb/2022-05-15/restorables/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/id_location.go b/resource-manager/cosmosdb/2022-05-15/restorables/id_location.go index 79632e8074a..c7c3d4a6d23 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/id_location.go +++ b/resource-manager/cosmosdb/2022-05-15/restorables/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/id_location_test.go b/resource-manager/cosmosdb/2022-05-15/restorables/id_location_test.go index 00f77288bb6..08c58d5f34f 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/id_location_test.go +++ b/resource-manager/cosmosdb/2022-05-15/restorables/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2022-05-15/restorables/id_mongodbdatabasecollection.go index c5b408846b1..863a29287de 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2022-05-15/restorables/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2022-05-15/restorables/id_mongodbdatabasecollection_test.go index 846b1efd302..77437dc2f70 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2022-05-15/restorables/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/id_restorabledatabaseaccount.go b/resource-manager/cosmosdb/2022-05-15/restorables/id_restorabledatabaseaccount.go index 1397a41ed1b..712ea35cfc0 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/id_restorabledatabaseaccount.go +++ b/resource-manager/cosmosdb/2022-05-15/restorables/id_restorabledatabaseaccount.go @@ -113,7 +113,7 @@ func (id RestorableDatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRestorableDatabaseAccounts", "restorableDatabaseAccounts", "restorableDatabaseAccounts"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/cosmosdb/2022-05-15/restorables/id_restorabledatabaseaccount_test.go b/resource-manager/cosmosdb/2022-05-15/restorables/id_restorabledatabaseaccount_test.go index 0608b8c7799..9a42672ab61 100644 --- a/resource-manager/cosmosdb/2022-05-15/restorables/id_restorabledatabaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-05-15/restorables/id_restorabledatabaseaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RestorableDatabaseAccountId{} func TestNewRestorableDatabaseAccountID(t *testing.T) { - id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") + id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InstanceId != "instanceId" { @@ -28,8 +28,8 @@ func TestNewRestorableDatabaseAccountID(t *testing.T) { } func TestFormatRestorableDatabaseAccountID(t *testing.T) { - actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId" + actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRestorableDatabaseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRestorableDatabaseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/services/README.md b/resource-manager/cosmosdb/2022-05-15/services/README.md index 2f221fb8868..118e86fea3b 100644 --- a/resource-manager/cosmosdb/2022-05-15/services/README.md +++ b/resource-manager/cosmosdb/2022-05-15/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ServiceList(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-05-15/services/id_databaseaccount.go b/resource-manager/cosmosdb/2022-05-15/services/id_databaseaccount.go index d076efa0b15..16e2d04be53 100644 --- a/resource-manager/cosmosdb/2022-05-15/services/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-05-15/services/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-05-15/services/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-05-15/services/id_databaseaccount_test.go index b7ab3d22543..1b08a40dab2 100644 --- a/resource-manager/cosmosdb/2022-05-15/services/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-05-15/services/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/README.md b/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/README.md index 77abcb8350d..cf6a53db932 100644 --- a/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/README.md +++ b/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := sqldedicatedgateway.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/id_service.go b/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/id_service.go index fae29f8aa18..f628c9a4812 100644 --- a/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/id_service.go +++ b/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/id_service_test.go b/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/id_service_test.go index 93def5b81b2..4c591e81432 100644 --- a/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/id_service_test.go +++ b/resource-manager/cosmosdb/2022-05-15/sqldedicatedgateway/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/README.md b/resource-manager/cosmosdb/2022-11-15/cosmosdb/README.md index 6739637426c..f77b4e65a7c 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/README.md +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.CassandraKeyspaceCreateUpdateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.CassandraTableCreateUpdateParameters{ // ... @@ -59,7 +59,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != nil { // handle the error @@ -83,7 +83,7 @@ if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspace(ctx, id) if err != nil { @@ -99,7 +99,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) if err != nil { @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTable(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTableThroughput(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.CassandraResourcesListCassandraKeyspaces(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesListCassandraTables(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -191,7 +191,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThe ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -215,7 +215,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -227,7 +227,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPo ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -244,7 +244,7 @@ if err := client.CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -261,7 +261,7 @@ if err := client.CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetricDefinitions(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetrics(ctx, id, cosmosdb.DefaultCollectionListMetricsOperationOptions()) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListUsages(ctx, id, cosmosdb.DefaultCollectionListUsagesOperationOptions()) if err != nil { @@ -309,7 +309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionListMetricsOperationOptions()) if err != nil { @@ -325,7 +325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListUsages(ctx, id, cosmosdb.DefaultCollectionPartitionListUsagesOperationOptions()) if err != nil { @@ -341,7 +341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionPartitionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionRegionListMetricsOperationOptions()) if err != nil { @@ -357,7 +357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionRegionListMetricsOperationOptions()) if err != nil { @@ -373,7 +373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") +id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") read, err := client.DatabaseAccountRegionListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountRegionListMetricsOperationOptions()) if err != nil { @@ -405,7 +405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountCreateUpdateParameters{ // ... @@ -422,7 +422,7 @@ if err := client.DatabaseAccountsCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -434,7 +434,7 @@ if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.FailoverPolicies{ // ... @@ -451,7 +451,7 @@ if err := client.DatabaseAccountsFailoverPriorityChangeThenPoll(ctx, id, payload ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGet(ctx, id) if err != nil { @@ -467,7 +467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGetReadOnlyKeys(ctx, id) if err != nil { @@ -515,7 +515,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListConnectionStrings(ctx, id) if err != nil { @@ -531,7 +531,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListKeys(ctx, id) if err != nil { @@ -547,7 +547,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetricDefinitions(ctx, id) if err != nil { @@ -563,7 +563,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountsListMetricsOperationOptions()) if err != nil { @@ -579,7 +579,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListReadOnlyKeys(ctx, id) if err != nil { @@ -595,7 +595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListUsages(ctx, id, cosmosdb.DefaultDatabaseAccountsListUsagesOperationOptions()) if err != nil { @@ -611,7 +611,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -628,7 +628,7 @@ if err := client.DatabaseAccountsOfflineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -645,7 +645,7 @@ if err := client.DatabaseAccountsOnlineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountRegenerateKeyParameters{ // ... @@ -662,7 +662,7 @@ if err := client.DatabaseAccountsRegenerateKeyThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountUpdateParameters{ // ... @@ -679,7 +679,7 @@ if err := client.DatabaseAccountsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetricDefinitions(ctx, id) if err != nil { @@ -695,7 +695,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetrics(ctx, id, cosmosdb.DefaultDatabaseListMetricsOperationOptions()) if err != nil { @@ -711,7 +711,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListUsages(ctx, id, cosmosdb.DefaultDatabaseListUsagesOperationOptions()) if err != nil { @@ -727,7 +727,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.GremlinDatabaseCreateUpdateParameters{ // ... @@ -744,7 +744,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.GremlinGraphCreateUpdateParameters{ // ... @@ -761,7 +761,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -773,7 +773,7 @@ if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil { // handle the error @@ -785,7 +785,7 @@ if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabase(ctx, id) if err != nil { @@ -801,7 +801,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabaseThroughput(ctx, id) if err != nil { @@ -817,7 +817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraph(ctx, id) if err != nil { @@ -833,7 +833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraphThroughput(ctx, id) if err != nil { @@ -849,7 +849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.GremlinResourcesListGremlinDatabases(ctx, id) if err != nil { @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesListGremlinGraphs(ctx, id) if err != nil { @@ -881,7 +881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -893,7 +893,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -905,7 +905,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -917,7 +917,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id) ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -929,7 +929,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -946,7 +946,7 @@ if err := client.GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -963,7 +963,7 @@ if err := client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsGet(ctx, id) if err != nil { @@ -995,7 +995,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.MongoDBCollectionCreateUpdateParameters{ // ... @@ -1012,7 +1012,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.MongoDBDatabaseCreateUpdateParameters{ // ... @@ -1029,7 +1029,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err != nil { // handle the error @@ -1041,7 +1041,7 @@ if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err ! ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1053,7 +1053,7 @@ if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollection(ctx, id) if err != nil { @@ -1069,7 +1069,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) if err != nil { @@ -1085,7 +1085,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabase(ctx, id) if err != nil { @@ -1101,7 +1101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) if err != nil { @@ -1117,7 +1117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesListMongoDBCollections(ctx, id) if err != nil { @@ -1133,7 +1133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoDBDatabases(ctx, id) if err != nil { @@ -1149,7 +1149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1161,7 +1161,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1173,7 +1173,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenP ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1185,7 +1185,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1197,7 +1197,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1214,7 +1214,7 @@ if err := client.MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1231,7 +1231,7 @@ if err := client.MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdListMetricsOperationOptions()) if err != nil { @@ -1247,7 +1247,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdRegionListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions()) if err != nil { @@ -1263,7 +1263,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.PercentileListMetrics(ctx, id, cosmosdb.DefaultPercentileListMetricsOperationOptions()) if err != nil { @@ -1279,7 +1279,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") +id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") read, err := client.PercentileSourceTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileSourceTargetListMetricsOperationOptions()) if err != nil { @@ -1295,7 +1295,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") +id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") read, err := client.PercentileTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileTargetListMetricsOperationOptions()) if err != nil { @@ -1311,7 +1311,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") payload := cosmosdb.ClientEncryptionKeyCreateUpdateParameters{ // ... @@ -1328,7 +1328,7 @@ if err := client.SqlResourcesCreateUpdateClientEncryptionKeyThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.SqlContainerCreateUpdateParameters{ // ... @@ -1345,7 +1345,7 @@ if err := client.SqlResourcesCreateUpdateSqlContainerThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.SqlDatabaseCreateUpdateParameters{ // ... @@ -1362,7 +1362,7 @@ if err := client.SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") payload := cosmosdb.SqlStoredProcedureCreateUpdateParameters{ // ... @@ -1379,7 +1379,7 @@ if err := client.SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") payload := cosmosdb.SqlTriggerCreateUpdateParameters{ // ... @@ -1396,7 +1396,7 @@ if err := client.SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") payload := cosmosdb.SqlUserDefinedFunctionCreateUpdateParameters{ // ... @@ -1413,7 +1413,7 @@ if err := client.SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { // handle the error @@ -1425,7 +1425,7 @@ if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1437,7 +1437,7 @@ if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != nil { // handle the error @@ -1449,7 +1449,7 @@ if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != n ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { // handle the error @@ -1461,7 +1461,7 @@ if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err != nil { // handle the error @@ -1473,7 +1473,7 @@ if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") read, err := client.SqlResourcesGetClientEncryptionKey(ctx, id) if err != nil { @@ -1489,7 +1489,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainer(ctx, id) if err != nil { @@ -1505,7 +1505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainerThroughput(ctx, id) if err != nil { @@ -1521,7 +1521,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabase(ctx, id) if err != nil { @@ -1537,7 +1537,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabaseThroughput(ctx, id) if err != nil { @@ -1553,7 +1553,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") read, err := client.SqlResourcesGetSqlStoredProcedure(ctx, id) if err != nil { @@ -1569,7 +1569,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") read, err := client.SqlResourcesGetSqlTrigger(ctx, id) if err != nil { @@ -1585,7 +1585,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") read, err := client.SqlResourcesGetSqlUserDefinedFunction(ctx, id) if err != nil { @@ -1601,7 +1601,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListClientEncryptionKeys(ctx, id) if err != nil { @@ -1617,7 +1617,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListSqlContainers(ctx, id) if err != nil { @@ -1633,7 +1633,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlDatabases(ctx, id) if err != nil { @@ -1649,7 +1649,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlStoredProcedures(ctx, id) if err != nil { @@ -1665,7 +1665,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlTriggers(ctx, id) if err != nil { @@ -1681,7 +1681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlUserDefinedFunctions(ctx, id) if err != nil { @@ -1697,7 +1697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1709,7 +1709,7 @@ if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); er ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1721,7 +1721,7 @@ if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1733,7 +1733,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1745,7 +1745,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1762,7 +1762,7 @@ if err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1779,7 +1779,7 @@ if err := client.SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.TableCreateUpdateParameters{ // ... @@ -1796,7 +1796,7 @@ if err := client.TableResourcesCreateUpdateTableThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { // handle the error @@ -1808,7 +1808,7 @@ if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTable(ctx, id) if err != nil { @@ -1824,7 +1824,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTableThroughput(ctx, id) if err != nil { @@ -1840,7 +1840,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.TableResourcesListTables(ctx, id) if err != nil { @@ -1856,7 +1856,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1868,7 +1868,7 @@ if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1880,7 +1880,7 @@ if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace.go index 4ce40124431..c7e797b1802 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace.go @@ -121,9 +121,9 @@ func (id CassandraKeyspaceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace_test.go index 2c41b074274..1f760780ed8 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceId{} func TestNewCassandraKeyspaceID(t *testing.T) { - id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") + id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCassandraKeyspaceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } } func TestFormatCassandraKeyspaceID(t *testing.T) { - actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName" + actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCassandraKeyspaceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCassandraKeyspaceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable.go index 939b9bdce12..5609bfaea81 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable.go @@ -127,9 +127,9 @@ func (id CassandraKeyspaceTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable_test.go index 0d6746660eb..de5ca96190f 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_cassandrakeyspacetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceTableId{} func TestNewCassandraKeyspaceTableID(t *testing.T) { - id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") + id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } if id.TableName != "tableName" { @@ -36,8 +36,8 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { } func TestFormatCassandraKeyspaceTableID(t *testing.T) { - actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName" + actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCassandraKeyspaceTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCassandraKeyspaceTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey.go index edcfeff0f1c..1369551418f 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey.go @@ -127,9 +127,9 @@ func (id ClientEncryptionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticClientEncryptionKeys", "clientEncryptionKeys", "clientEncryptionKeys"), resourceids.UserSpecifiedSegment("clientEncryptionKeyName", "clientEncryptionKeyName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey_test.go index 41cdccd06c3..e0353898a57 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_clientencryptionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ClientEncryptionKeyId{} func TestNewClientEncryptionKeyID(t *testing.T) { - id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") + id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewClientEncryptionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ClientEncryptionKeyName != "clientEncryptionKeyName" { @@ -36,8 +36,8 @@ func TestNewClientEncryptionKeyID(t *testing.T) { } func TestFormatClientEncryptionKeyID(t *testing.T) { - actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName" + actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseClientEncryptionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseClientEncryptionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ClientEncryptionKeyName: "cLiEnTeNcRyPtIoNkEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection.go index 7a48b54fbb3..20b1d5d4051 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection.go @@ -127,11 +127,11 @@ func (id CollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection_test.go index af80428336c..5d25b21a81e 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionId{} func TestNewCollectionID(t *testing.T) { - id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") + id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatCollectionID(t *testing.T) { - actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid" + actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go index 0372c743649..a8f1146d844 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go @@ -139,13 +139,13 @@ func (id CollectionPartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go index 51120cbbc59..7a4dd109319 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionPartitionKeyRangeIdId{} func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { - id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -44,8 +44,8 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { } func TestFormatCollectionPartitionKeyRangeIdID(t *testing.T) { - actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseCollectionPartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseCollectionPartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container.go index 9fc554842ed..52411ec0fb4 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container_test.go index e4a16015b14..f6673f4842c 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database.go index 32a5b840398..c73ee48b681 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database.go @@ -121,9 +121,9 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database_test.go index 48cd6308772..c1750285bd3 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount.go index 2ca27074b00..dfad7d15d85 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount_test.go index a3631600aea..d8132b226fc 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection.go index 4029bc74189..81c3be1f181 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection.go @@ -133,13 +133,13 @@ func (id DatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection_test.go index c2a9406bb53..8d0ed01afa3 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_databasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseCollectionId{} func TestNewDatabaseCollectionID(t *testing.T) { - id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") + id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatDatabaseCollectionID(t *testing.T) { - actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid" + actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph.go index 7a55f30993c..e520754fd71 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph_test.go index 54c0bd78a11..1f089c40924 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase.go index 8bfcc87e575..5ef8dfa4e09 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase.go @@ -121,9 +121,9 @@ func (id GremlinDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase_test.go index 1750dbc731f..a988d8e29ed 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_gremlindatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GremlinDatabaseId{} func TestNewGremlinDatabaseID(t *testing.T) { - id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGremlinDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } } func TestFormatGremlinDatabaseID(t *testing.T) { - actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName" + actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGremlinDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGremlinDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location.go index febfbe7d88f..483a412e5c7 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location_test.go index c94c6add0bd..803c3f2c435 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase.go index 75875a6ac54..93bc507bbf9 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase.go @@ -121,9 +121,9 @@ func (id MongodbDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase_test.go index 13fca77bd6a..fbe5814e30c 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseId{} func TestNewMongodbDatabaseID(t *testing.T) { - id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMongodbDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } } func TestFormatMongodbDatabaseID(t *testing.T) { - actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName" + actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection.go index 7ddcf2cbb6d..8b233638340 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection_test.go index b311d450e34..96fb623f632 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid.go index 88f0f4a92d5..0f54ae80af9 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid.go @@ -133,11 +133,11 @@ func (id PartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid_test.go index d96f13f7d9f..d06f8a1ceda 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_partitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PartitionKeyRangeIdId{} func TestNewPartitionKeyRangeIdID(t *testing.T) { - id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -40,8 +40,8 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { } func TestFormatPartitionKeyRangeIdID(t *testing.T) { - actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParsePartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParsePartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region.go index 4f0f50bcdef..36fb36b86d2 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region.go @@ -121,9 +121,9 @@ func (id RegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region_test.go index 416fa31d29e..45452117088 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_region_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegionId{} func TestNewRegionID(t *testing.T) { - id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") + id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } } func TestFormatRegionID(t *testing.T) { - actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region" + actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion.go index eaa24e25c65..2112d234a8e 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion.go @@ -127,11 +127,11 @@ func (id SourceRegionTargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSourceRegion", "sourceRegion", "sourceRegion"), - resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegion"), + resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegionName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion_test.go index d96342f3531..9acfe7a194e 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sourceregiontargetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SourceRegionTargetRegionId{} func TestNewSourceRegionTargetRegionID(t *testing.T) { - id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") + id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSourceRegionTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SourceRegionName != "sourceRegion" { - t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegion") + if id.SourceRegionName != "sourceRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegionName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatSourceRegionTargetRegionID(t *testing.T) { - actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion" + actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSourceRegionTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSourceRegionTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SourceRegionName: "sOuRcErEgIoN", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SourceRegionName: "sOuRcErEgIoNnAmE", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase.go index d92d2bbbf59..21d4f894dd5 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase.go @@ -121,9 +121,9 @@ func (id SqlDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase_test.go index f9999bbfaa0..5751b55efa6 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_sqldatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlDatabaseId{} func TestNewSqlDatabaseID(t *testing.T) { - id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSqlDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } } func TestFormatSqlDatabaseID(t *testing.T) { - actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName" + actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure.go index 72b9abbafe9..31dd78cfcba 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure.go @@ -133,9 +133,9 @@ func (id StoredProcedureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticStoredProcedures", "storedProcedures", "storedProcedures"), diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure_test.go index ccb86f85be8..602b81d744b 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_storedprocedure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StoredProcedureId{} func TestNewStoredProcedureID(t *testing.T) { - id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") + id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewStoredProcedureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewStoredProcedureID(t *testing.T) { } func TestFormatStoredProcedureID(t *testing.T) { - actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName" + actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseStoredProcedureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseStoredProcedureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", StoredProcedureName: "sToReDpRoCeDuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table.go index ecf9d97c31e..db828313697 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table_test.go index 1e9703fdba1..861ecae041b 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion.go index 213d48cf619..c07e6abe2a3 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion.go @@ -121,9 +121,9 @@ func (id TargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion_test.go index 5a026cdd4cd..636fb4b33f6 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_targetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TargetRegionId{} func TestNewTargetRegionID(t *testing.T) { - id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") + id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatTargetRegionID(t *testing.T) { - actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion" + actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger.go index 8c6760bfa3d..79ef1f4abbf 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger.go @@ -133,9 +133,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger_test.go index 2033539a5a9..42683f03ca2 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction.go index c09e749c3cb..eb5d1f446fd 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction.go @@ -133,9 +133,9 @@ func (id UserDefinedFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticUserDefinedFunctions", "userDefinedFunctions", "userDefinedFunctions"), diff --git a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction_test.go b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction_test.go index 0f53e3aa1bf..ca957175cbc 100644 --- a/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction_test.go +++ b/resource-manager/cosmosdb/2022-11-15/cosmosdb/id_userdefinedfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserDefinedFunctionId{} func TestNewUserDefinedFunctionID(t *testing.T) { - id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") + id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewUserDefinedFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewUserDefinedFunctionID(t *testing.T) { } func TestFormatUserDefinedFunctionID(t *testing.T) { - actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" + actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseUserDefinedFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseUserDefinedFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", UserDefinedFunctionName: "uSeRdEfInEdFuNcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/datatransfer/README.md b/resource-manager/cosmosdb/2022-11-15/datatransfer/README.md index f57cff92591..3a77d378aa3 100644 --- a/resource-manager/cosmosdb/2022-11-15/datatransfer/README.md +++ b/resource-manager/cosmosdb/2022-11-15/datatransfer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := datatransfer.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/datatransfer/id_service.go b/resource-manager/cosmosdb/2022-11-15/datatransfer/id_service.go index 6f3fabaa7b7..58fd3f22eb2 100644 --- a/resource-manager/cosmosdb/2022-11-15/datatransfer/id_service.go +++ b/resource-manager/cosmosdb/2022-11-15/datatransfer/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/datatransfer/id_service_test.go b/resource-manager/cosmosdb/2022-11-15/datatransfer/id_service_test.go index accfb95c7e8..b3261c00b8b 100644 --- a/resource-manager/cosmosdb/2022-11-15/datatransfer/id_service_test.go +++ b/resource-manager/cosmosdb/2022-11-15/datatransfer/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/graphapicompute/README.md b/resource-manager/cosmosdb/2022-11-15/graphapicompute/README.md index 053a6ff9c0a..0f276a56925 100644 --- a/resource-manager/cosmosdb/2022-11-15/graphapicompute/README.md +++ b/resource-manager/cosmosdb/2022-11-15/graphapicompute/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := graphapicompute.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/graphapicompute/id_service.go b/resource-manager/cosmosdb/2022-11-15/graphapicompute/id_service.go index 37a699c2693..a4987f4b408 100644 --- a/resource-manager/cosmosdb/2022-11-15/graphapicompute/id_service.go +++ b/resource-manager/cosmosdb/2022-11-15/graphapicompute/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/graphapicompute/id_service_test.go b/resource-manager/cosmosdb/2022-11-15/graphapicompute/id_service_test.go index 20302671509..4be092ed7b2 100644 --- a/resource-manager/cosmosdb/2022-11-15/graphapicompute/id_service_test.go +++ b/resource-manager/cosmosdb/2022-11-15/graphapicompute/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/managedcassandras/README.md b/resource-manager/cosmosdb/2022-11-15/managedcassandras/README.md index f42c1fccdf0..591b2eac02f 100644 --- a/resource-manager/cosmosdb/2022-11-15/managedcassandras/README.md +++ b/resource-manager/cosmosdb/2022-11-15/managedcassandras/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraClustersCreateUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersGet(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.CommandPostBody{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { // handle the error @@ -143,7 +143,7 @@ if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersStatus(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -176,7 +176,7 @@ if err := client.CassandraClustersUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... @@ -193,7 +193,7 @@ if err := client.CassandraDataCentersCreateUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -205,7 +205,7 @@ if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") read, err := client.CassandraDataCentersGet(ctx, id) if err != nil { @@ -221,7 +221,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraDataCentersList(ctx, id) if err != nil { @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... diff --git a/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_cassandracluster.go b/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_cassandracluster.go index 43ce8c1202c..b189a0db128 100644 --- a/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_cassandracluster.go +++ b/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_cassandracluster.go @@ -115,7 +115,7 @@ func (id CassandraClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_cassandracluster_test.go b/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_cassandracluster_test.go index b21a0ee8614..6e99daf02bb 100644 --- a/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_cassandracluster_test.go +++ b/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_cassandracluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraClusterId{} func TestNewCassandraClusterID(t *testing.T) { - id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCassandraClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } } func TestFormatCassandraClusterID(t *testing.T) { - actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName" + actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCassandraClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCassandraClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_datacenter.go b/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_datacenter.go index 8736ef94f6f..5c5a637c822 100644 --- a/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_datacenter.go +++ b/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_datacenter.go @@ -121,7 +121,7 @@ func (id DataCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), resourceids.StaticSegment("staticDataCenters", "dataCenters", "dataCenters"), resourceids.UserSpecifiedSegment("dataCenterName", "dataCenterName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_datacenter_test.go b/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_datacenter_test.go index 66e81bfb94f..e958093a948 100644 --- a/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_datacenter_test.go +++ b/resource-manager/cosmosdb/2022-11-15/managedcassandras/id_datacenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataCenterId{} func TestNewDataCenterID(t *testing.T) { - id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") + id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDataCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } if id.DataCenterName != "dataCenterName" { @@ -32,8 +32,8 @@ func TestNewDataCenterID(t *testing.T) { } func TestFormatDataCenterID(t *testing.T) { - actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName" + actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDataCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDataCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", DataCenterName: "dAtAcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/README.md b/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/README.md index 7cdc06bb3f2..7f8a07f4279 100644 --- a/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/README.md +++ b/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := materializedviewsbuilder.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/id_service.go b/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/id_service.go index 3af930e9bc6..2eb7e5e0d31 100644 --- a/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/id_service.go +++ b/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/id_service_test.go b/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/id_service_test.go index 8d14f132a1e..577612d3e07 100644 --- a/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/id_service_test.go +++ b/resource-manager/cosmosdb/2022-11-15/materializedviewsbuilder/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/mongorbacs/README.md b/resource-manager/cosmosdb/2022-11-15/mongorbacs/README.md index d3d88f03c74..7586b599dd4 100644 --- a/resource-manager/cosmosdb/2022-11-15/mongorbacs/README.md +++ b/resource-manager/cosmosdb/2022-11-15/mongorbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") payload := mongorbacs.MongoRoleDefinitionCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") payload := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") read, err := client.MongoDBResourcesGetMongoRoleDefinition(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") read, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoRoleDefinitions(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoUserDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go index 5dcb902abb5..35b2f7f690f 100644 --- a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount_test.go index 8cf97bbace8..18a73206d20 100644 --- a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go index 88c7ce70b53..859adbfb63f 100644 --- a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go +++ b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition.go @@ -121,7 +121,7 @@ func (id MongodbRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbRoleDefinitions", "mongodbRoleDefinitions", "mongodbRoleDefinitions"), resourceids.UserSpecifiedSegment("mongoRoleDefinitionId", "mongoRoleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition_test.go b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition_test.go index 635bde6bf7f..667a0b36da3 100644 --- a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition_test.go +++ b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbRoleDefinitionId{} func TestNewMongodbRoleDefinitionID(t *testing.T) { - id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") + id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoRoleDefinitionId != "mongoRoleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { } func TestFormatMongodbRoleDefinitionID(t *testing.T) { - actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId" + actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoRoleDefinitionId: "mOnGoRoLeDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go index d3ad61af293..68a38ae9094 100644 --- a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go +++ b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition.go @@ -121,7 +121,7 @@ func (id MongodbUserDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbUserDefinitions", "mongodbUserDefinitions", "mongodbUserDefinitions"), resourceids.UserSpecifiedSegment("mongoUserDefinitionId", "mongoUserDefinitionId"), } diff --git a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition_test.go b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition_test.go index c89f631908a..eb010d3045a 100644 --- a/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition_test.go +++ b/resource-manager/cosmosdb/2022-11-15/mongorbacs/id_mongodbuserdefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbUserDefinitionId{} func TestNewMongodbUserDefinitionID(t *testing.T) { - id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") + id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoUserDefinitionId != "mongoUserDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { } func TestFormatMongodbUserDefinitionID(t *testing.T) { - actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId" + actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbUserDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbUserDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoUserDefinitionId: "mOnGoUsErDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/README.md b/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/README.md index 29d1313ca55..f930d8e0aa1 100644 --- a/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/README.md +++ b/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := notebookworkspacesresource.ARMProxyResource{ // ... @@ -41,7 +41,7 @@ if err := client.NotebookWorkspacesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListByDatabaseAccount(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListConnectionInfo(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != nil { // handle the error @@ -113,7 +113,7 @@ if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesStartThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/id_databaseaccount.go b/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/id_databaseaccount.go index cc1cfbae97b..48f82ab040b 100644 --- a/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/id_databaseaccount_test.go index 765176e522b..4b238cf57bd 100644 --- a/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-11-15/notebookworkspacesresource/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/README.md b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/README.md index fbc9e172746..de5cf50a8b6 100644 --- a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/README.md +++ b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_databaseaccount.go b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_databaseaccount.go index 2d03a12f035..0ef32fef9c1 100644 --- a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_databaseaccount_test.go index def6cb01a81..fe0be2f9ad1 100644 --- a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_privateendpointconnection.go index 404b3ec4b99..ad4cd96d133 100644 --- a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_privateendpointconnection_test.go index 616287d8b5e..6f7f6251e0b 100644 --- a/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/cosmosdb/2022-11-15/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/README.md b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/README.md index 14c4638c6f0..e07fd245167 100644 --- a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/README.md +++ b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_databaseaccount.go b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_databaseaccount.go index da2cafa82ce..09df5d78d9d 100644 --- a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_databaseaccount_test.go index 54eac6dbdc6..aa4eb501a97 100644 --- a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_privatelinkresource.go b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_privatelinkresource.go index 14bd8a6525e..22240869721 100644 --- a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_privatelinkresource_test.go index df3663505ef..8994ca6277c 100644 --- a/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/cosmosdb/2022-11-15/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/rbacs/README.md b/resource-manager/cosmosdb/2022-11-15/rbacs/README.md index e36b859ca83..0b9df4bde4a 100644 --- a/resource-manager/cosmosdb/2022-11-15/rbacs/README.md +++ b/resource-manager/cosmosdb/2022-11-15/rbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") payload := rbacs.SqlRoleAssignmentCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleAssignmentThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") payload := rbacs.SqlRoleDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleDefinitionThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.SqlResourcesGetSqlRoleAssignment(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") read, err := client.SqlResourcesGetSqlRoleDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleAssignments(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/rbacs/id_account.go b/resource-manager/cosmosdb/2022-11-15/rbacs/id_account.go index 71408ced400..2fd416725b1 100644 --- a/resource-manager/cosmosdb/2022-11-15/rbacs/id_account.go +++ b/resource-manager/cosmosdb/2022-11-15/rbacs/id_account.go @@ -121,7 +121,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleAssignments", "sqlRoleAssignments", "sqlRoleAssignments"), resourceids.ScopeSegment("roleAssignmentId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } diff --git a/resource-manager/cosmosdb/2022-11-15/rbacs/id_account_test.go b/resource-manager/cosmosdb/2022-11-15/rbacs/id_account_test.go index 28a5f3a07bb..ad2c1bacfd4 100644 --- a/resource-manager/cosmosdb/2022-11-15/rbacs/id_account_test.go +++ b/resource-manager/cosmosdb/2022-11-15/rbacs/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleAssignmentId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewAccountID(t *testing.T) { } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,21 +87,21 @@ func TestParseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -223,41 +223,41 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleAssignmentId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/cosmosdb/2022-11-15/rbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2022-11-15/rbacs/id_databaseaccount.go index a75e72bbb29..eea55d3e517 100644 --- a/resource-manager/cosmosdb/2022-11-15/rbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-11-15/rbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/rbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-11-15/rbacs/id_databaseaccount_test.go index f7b7f6e34a5..85257d9182a 100644 --- a/resource-manager/cosmosdb/2022-11-15/rbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-11-15/rbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/rbacs/id_sqlroledefinition.go b/resource-manager/cosmosdb/2022-11-15/rbacs/id_sqlroledefinition.go index 8b5ee24533d..fb415467ab6 100644 --- a/resource-manager/cosmosdb/2022-11-15/rbacs/id_sqlroledefinition.go +++ b/resource-manager/cosmosdb/2022-11-15/rbacs/id_sqlroledefinition.go @@ -121,7 +121,7 @@ func (id SqlRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleDefinitions", "sqlRoleDefinitions", "sqlRoleDefinitions"), resourceids.UserSpecifiedSegment("roleDefinitionId", "roleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2022-11-15/rbacs/id_sqlroledefinition_test.go b/resource-manager/cosmosdb/2022-11-15/rbacs/id_sqlroledefinition_test.go index e54bbbbe92a..d5f64dcc134 100644 --- a/resource-manager/cosmosdb/2022-11-15/rbacs/id_sqlroledefinition_test.go +++ b/resource-manager/cosmosdb/2022-11-15/rbacs/id_sqlroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlRoleDefinitionId{} func TestNewSqlRoleDefinitionID(t *testing.T) { - id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") + id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleDefinitionId != "roleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { } func TestFormatSqlRoleDefinitionID(t *testing.T) { - actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId" + actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleDefinitionId: "rOlEdEfInItIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/README.md b/resource-manager/cosmosdb/2022-11-15/restorables/README.md index 0bfaafa56f9..1abb541b9db 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/README.md +++ b/resource-manager/cosmosdb/2022-11-15/restorables/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -42,7 +42,7 @@ if err := client.GremlinResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -59,7 +59,7 @@ if err := client.MongoDBResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableDatabaseAccountsGetByLocation(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RestorableDatabaseAccountsListByLocation(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinDatabasesList(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinGraphsList(ctx, id, restorables.DefaultRestorableGremlinGraphsListOperationOptions()) if err != nil { @@ -139,7 +139,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinResourcesList(ctx, id, restorables.DefaultRestorableGremlinResourcesListOperationOptions()) if err != nil { @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbCollectionsList(ctx, id, restorables.DefaultRestorableMongodbCollectionsListOperationOptions()) if err != nil { @@ -171,7 +171,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbDatabasesList(ctx, id) if err != nil { @@ -187,7 +187,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbResourcesList(ctx, id, restorables.DefaultRestorableMongodbResourcesListOperationOptions()) if err != nil { @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlContainersList(ctx, id, restorables.DefaultRestorableSqlContainersListOperationOptions()) if err != nil { @@ -219,7 +219,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlDatabasesList(ctx, id) if err != nil { @@ -235,7 +235,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlResourcesList(ctx, id, restorables.DefaultRestorableSqlResourcesListOperationOptions()) if err != nil { @@ -251,7 +251,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTableResourcesList(ctx, id, restorables.DefaultRestorableTableResourcesListOperationOptions()) if err != nil { @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTablesList(ctx, id, restorables.DefaultRestorableTablesListOperationOptions()) if err != nil { @@ -283,7 +283,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -300,7 +300,7 @@ if err := client.SqlResourcesRetrieveContinuousBackupInformationThenPoll(ctx, id ```go ctx := context.TODO() -id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := restorables.ContinuousBackupRestoreLocation{ // ... diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_container.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_container.go index 9398504f72d..cc01b7113aa 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_container.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_container_test.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_container_test.go index 0cea9d939ac..97675cfd2b9 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_container_test.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_graph.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_graph.go index 9904c179afc..b5c11de6742 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_graph.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_graph_test.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_graph_test.go index b604d40e75f..633f0c50588 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_graph_test.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_location.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_location.go index 79632e8074a..c7c3d4a6d23 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_location.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_location_test.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_location_test.go index 00f77288bb6..08c58d5f34f 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_location_test.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_mongodbdatabasecollection.go index c5b408846b1..863a29287de 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_mongodbdatabasecollection_test.go index 846b1efd302..77437dc2f70 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_restorabledatabaseaccount.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_restorabledatabaseaccount.go index 1397a41ed1b..712ea35cfc0 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_restorabledatabaseaccount.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_restorabledatabaseaccount.go @@ -113,7 +113,7 @@ func (id RestorableDatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRestorableDatabaseAccounts", "restorableDatabaseAccounts", "restorableDatabaseAccounts"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_restorabledatabaseaccount_test.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_restorabledatabaseaccount_test.go index 0608b8c7799..9a42672ab61 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_restorabledatabaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_restorabledatabaseaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RestorableDatabaseAccountId{} func TestNewRestorableDatabaseAccountID(t *testing.T) { - id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") + id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InstanceId != "instanceId" { @@ -28,8 +28,8 @@ func TestNewRestorableDatabaseAccountID(t *testing.T) { } func TestFormatRestorableDatabaseAccountID(t *testing.T) { - actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId" + actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRestorableDatabaseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRestorableDatabaseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_table.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_table.go index 9c44038270c..6b9e3c73fa6 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_table.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/restorables/id_table_test.go b/resource-manager/cosmosdb/2022-11-15/restorables/id_table_test.go index d0b8fe67a87..432623c34aa 100644 --- a/resource-manager/cosmosdb/2022-11-15/restorables/id_table_test.go +++ b/resource-manager/cosmosdb/2022-11-15/restorables/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/services/README.md b/resource-manager/cosmosdb/2022-11-15/services/README.md index 3986fae9de6..2f366f7d0fd 100644 --- a/resource-manager/cosmosdb/2022-11-15/services/README.md +++ b/resource-manager/cosmosdb/2022-11-15/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ServiceList(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/services/id_databaseaccount.go b/resource-manager/cosmosdb/2022-11-15/services/id_databaseaccount.go index d076efa0b15..16e2d04be53 100644 --- a/resource-manager/cosmosdb/2022-11-15/services/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2022-11-15/services/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2022-11-15/services/id_databaseaccount_test.go b/resource-manager/cosmosdb/2022-11-15/services/id_databaseaccount_test.go index b7ab3d22543..1b08a40dab2 100644 --- a/resource-manager/cosmosdb/2022-11-15/services/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2022-11-15/services/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/README.md b/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/README.md index 94a6354006a..9fdf4b147a4 100644 --- a/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/README.md +++ b/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := sqldedicatedgateway.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/id_service.go b/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/id_service.go index fae29f8aa18..f628c9a4812 100644 --- a/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/id_service.go +++ b/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/id_service_test.go b/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/id_service_test.go index 93def5b81b2..4c591e81432 100644 --- a/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/id_service_test.go +++ b/resource-manager/cosmosdb/2022-11-15/sqldedicatedgateway/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/README.md b/resource-manager/cosmosdb/2023-04-15/cosmosdb/README.md index 7140db60ddc..6837cde63de 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/README.md +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.CassandraKeyspaceCreateUpdateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.CassandraTableCreateUpdateParameters{ // ... @@ -59,7 +59,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != nil { // handle the error @@ -83,7 +83,7 @@ if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspace(ctx, id) if err != nil { @@ -99,7 +99,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) if err != nil { @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTable(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTableThroughput(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.CassandraResourcesListCassandraKeyspaces(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesListCassandraTables(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -191,7 +191,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThe ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -215,7 +215,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -227,7 +227,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPo ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -244,7 +244,7 @@ if err := client.CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -261,7 +261,7 @@ if err := client.CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetricDefinitions(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetrics(ctx, id, cosmosdb.DefaultCollectionListMetricsOperationOptions()) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListUsages(ctx, id, cosmosdb.DefaultCollectionListUsagesOperationOptions()) if err != nil { @@ -309,7 +309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionListMetricsOperationOptions()) if err != nil { @@ -325,7 +325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListUsages(ctx, id, cosmosdb.DefaultCollectionPartitionListUsagesOperationOptions()) if err != nil { @@ -341,7 +341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionPartitionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionRegionListMetricsOperationOptions()) if err != nil { @@ -357,7 +357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionRegionListMetricsOperationOptions()) if err != nil { @@ -373,7 +373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") +id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") read, err := client.DatabaseAccountRegionListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountRegionListMetricsOperationOptions()) if err != nil { @@ -405,7 +405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountCreateUpdateParameters{ // ... @@ -422,7 +422,7 @@ if err := client.DatabaseAccountsCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -434,7 +434,7 @@ if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.FailoverPolicies{ // ... @@ -451,7 +451,7 @@ if err := client.DatabaseAccountsFailoverPriorityChangeThenPoll(ctx, id, payload ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGet(ctx, id) if err != nil { @@ -467,7 +467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGetReadOnlyKeys(ctx, id) if err != nil { @@ -515,7 +515,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListConnectionStrings(ctx, id) if err != nil { @@ -531,7 +531,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListKeys(ctx, id) if err != nil { @@ -547,7 +547,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetricDefinitions(ctx, id) if err != nil { @@ -563,7 +563,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountsListMetricsOperationOptions()) if err != nil { @@ -579,7 +579,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListReadOnlyKeys(ctx, id) if err != nil { @@ -595,7 +595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListUsages(ctx, id, cosmosdb.DefaultDatabaseAccountsListUsagesOperationOptions()) if err != nil { @@ -611,7 +611,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -628,7 +628,7 @@ if err := client.DatabaseAccountsOfflineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -645,7 +645,7 @@ if err := client.DatabaseAccountsOnlineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountRegenerateKeyParameters{ // ... @@ -662,7 +662,7 @@ if err := client.DatabaseAccountsRegenerateKeyThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountUpdateParameters{ // ... @@ -679,7 +679,7 @@ if err := client.DatabaseAccountsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetricDefinitions(ctx, id) if err != nil { @@ -695,7 +695,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetrics(ctx, id, cosmosdb.DefaultDatabaseListMetricsOperationOptions()) if err != nil { @@ -711,7 +711,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListUsages(ctx, id, cosmosdb.DefaultDatabaseListUsagesOperationOptions()) if err != nil { @@ -727,7 +727,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.GremlinDatabaseCreateUpdateParameters{ // ... @@ -744,7 +744,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.GremlinGraphCreateUpdateParameters{ // ... @@ -761,7 +761,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -773,7 +773,7 @@ if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil { // handle the error @@ -785,7 +785,7 @@ if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabase(ctx, id) if err != nil { @@ -801,7 +801,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabaseThroughput(ctx, id) if err != nil { @@ -817,7 +817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraph(ctx, id) if err != nil { @@ -833,7 +833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraphThroughput(ctx, id) if err != nil { @@ -849,7 +849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.GremlinResourcesListGremlinDatabases(ctx, id) if err != nil { @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesListGremlinGraphs(ctx, id) if err != nil { @@ -881,7 +881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -893,7 +893,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -905,7 +905,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -917,7 +917,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id) ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -929,7 +929,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -946,7 +946,7 @@ if err := client.GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -963,7 +963,7 @@ if err := client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsGet(ctx, id) if err != nil { @@ -995,7 +995,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.MongoDBCollectionCreateUpdateParameters{ // ... @@ -1012,7 +1012,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.MongoDBDatabaseCreateUpdateParameters{ // ... @@ -1029,7 +1029,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err != nil { // handle the error @@ -1041,7 +1041,7 @@ if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err ! ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1053,7 +1053,7 @@ if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollection(ctx, id) if err != nil { @@ -1069,7 +1069,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) if err != nil { @@ -1085,7 +1085,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabase(ctx, id) if err != nil { @@ -1101,7 +1101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) if err != nil { @@ -1117,7 +1117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesListMongoDBCollections(ctx, id) if err != nil { @@ -1133,7 +1133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoDBDatabases(ctx, id) if err != nil { @@ -1149,7 +1149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1161,7 +1161,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1173,7 +1173,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenP ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1185,7 +1185,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1197,7 +1197,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1214,7 +1214,7 @@ if err := client.MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1231,7 +1231,7 @@ if err := client.MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdListMetricsOperationOptions()) if err != nil { @@ -1247,7 +1247,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdRegionListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions()) if err != nil { @@ -1263,7 +1263,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.PercentileListMetrics(ctx, id, cosmosdb.DefaultPercentileListMetricsOperationOptions()) if err != nil { @@ -1279,7 +1279,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") +id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") read, err := client.PercentileSourceTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileSourceTargetListMetricsOperationOptions()) if err != nil { @@ -1295,7 +1295,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") +id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") read, err := client.PercentileTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileTargetListMetricsOperationOptions()) if err != nil { @@ -1311,7 +1311,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") payload := cosmosdb.ClientEncryptionKeyCreateUpdateParameters{ // ... @@ -1328,7 +1328,7 @@ if err := client.SqlResourcesCreateUpdateClientEncryptionKeyThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.SqlContainerCreateUpdateParameters{ // ... @@ -1345,7 +1345,7 @@ if err := client.SqlResourcesCreateUpdateSqlContainerThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.SqlDatabaseCreateUpdateParameters{ // ... @@ -1362,7 +1362,7 @@ if err := client.SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") payload := cosmosdb.SqlStoredProcedureCreateUpdateParameters{ // ... @@ -1379,7 +1379,7 @@ if err := client.SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") payload := cosmosdb.SqlTriggerCreateUpdateParameters{ // ... @@ -1396,7 +1396,7 @@ if err := client.SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") payload := cosmosdb.SqlUserDefinedFunctionCreateUpdateParameters{ // ... @@ -1413,7 +1413,7 @@ if err := client.SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { // handle the error @@ -1425,7 +1425,7 @@ if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1437,7 +1437,7 @@ if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != nil { // handle the error @@ -1449,7 +1449,7 @@ if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != n ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { // handle the error @@ -1461,7 +1461,7 @@ if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err != nil { // handle the error @@ -1473,7 +1473,7 @@ if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") read, err := client.SqlResourcesGetClientEncryptionKey(ctx, id) if err != nil { @@ -1489,7 +1489,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainer(ctx, id) if err != nil { @@ -1505,7 +1505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainerThroughput(ctx, id) if err != nil { @@ -1521,7 +1521,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabase(ctx, id) if err != nil { @@ -1537,7 +1537,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabaseThroughput(ctx, id) if err != nil { @@ -1553,7 +1553,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") read, err := client.SqlResourcesGetSqlStoredProcedure(ctx, id) if err != nil { @@ -1569,7 +1569,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") read, err := client.SqlResourcesGetSqlTrigger(ctx, id) if err != nil { @@ -1585,7 +1585,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") read, err := client.SqlResourcesGetSqlUserDefinedFunction(ctx, id) if err != nil { @@ -1601,7 +1601,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListClientEncryptionKeys(ctx, id) if err != nil { @@ -1617,7 +1617,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListSqlContainers(ctx, id) if err != nil { @@ -1633,7 +1633,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlDatabases(ctx, id) if err != nil { @@ -1649,7 +1649,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlStoredProcedures(ctx, id) if err != nil { @@ -1665,7 +1665,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlTriggers(ctx, id) if err != nil { @@ -1681,7 +1681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlUserDefinedFunctions(ctx, id) if err != nil { @@ -1697,7 +1697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1709,7 +1709,7 @@ if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); er ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1721,7 +1721,7 @@ if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1733,7 +1733,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1745,7 +1745,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1762,7 +1762,7 @@ if err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1779,7 +1779,7 @@ if err := client.SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.TableCreateUpdateParameters{ // ... @@ -1796,7 +1796,7 @@ if err := client.TableResourcesCreateUpdateTableThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { // handle the error @@ -1808,7 +1808,7 @@ if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTable(ctx, id) if err != nil { @@ -1824,7 +1824,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTableThroughput(ctx, id) if err != nil { @@ -1840,7 +1840,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.TableResourcesListTables(ctx, id) if err != nil { @@ -1856,7 +1856,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1868,7 +1868,7 @@ if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1880,7 +1880,7 @@ if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspace.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspace.go index 4ce40124431..c7e797b1802 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspace.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspace.go @@ -121,9 +121,9 @@ func (id CassandraKeyspaceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspace_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspace_test.go index 2c41b074274..1f760780ed8 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspace_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceId{} func TestNewCassandraKeyspaceID(t *testing.T) { - id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") + id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCassandraKeyspaceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } } func TestFormatCassandraKeyspaceID(t *testing.T) { - actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName" + actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCassandraKeyspaceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCassandraKeyspaceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspacetable.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspacetable.go index 939b9bdce12..5609bfaea81 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspacetable.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspacetable.go @@ -127,9 +127,9 @@ func (id CassandraKeyspaceTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspacetable_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspacetable_test.go index 0d6746660eb..de5ca96190f 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspacetable_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_cassandrakeyspacetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceTableId{} func TestNewCassandraKeyspaceTableID(t *testing.T) { - id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") + id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } if id.TableName != "tableName" { @@ -36,8 +36,8 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { } func TestFormatCassandraKeyspaceTableID(t *testing.T) { - actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName" + actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCassandraKeyspaceTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCassandraKeyspaceTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_clientencryptionkey.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_clientencryptionkey.go index edcfeff0f1c..1369551418f 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_clientencryptionkey.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_clientencryptionkey.go @@ -127,9 +127,9 @@ func (id ClientEncryptionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticClientEncryptionKeys", "clientEncryptionKeys", "clientEncryptionKeys"), resourceids.UserSpecifiedSegment("clientEncryptionKeyName", "clientEncryptionKeyName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_clientencryptionkey_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_clientencryptionkey_test.go index 41cdccd06c3..e0353898a57 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_clientencryptionkey_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_clientencryptionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ClientEncryptionKeyId{} func TestNewClientEncryptionKeyID(t *testing.T) { - id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") + id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewClientEncryptionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ClientEncryptionKeyName != "clientEncryptionKeyName" { @@ -36,8 +36,8 @@ func TestNewClientEncryptionKeyID(t *testing.T) { } func TestFormatClientEncryptionKeyID(t *testing.T) { - actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName" + actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseClientEncryptionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseClientEncryptionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ClientEncryptionKeyName: "cLiEnTeNcRyPtIoNkEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collection.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collection.go index 7a48b54fbb3..20b1d5d4051 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collection.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collection.go @@ -127,11 +127,11 @@ func (id CollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collection_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collection_test.go index af80428336c..5d25b21a81e 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collection_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionId{} func TestNewCollectionID(t *testing.T) { - id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") + id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatCollectionID(t *testing.T) { - actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid" + actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collectionpartitionkeyrangeid.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collectionpartitionkeyrangeid.go index 0372c743649..a8f1146d844 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collectionpartitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collectionpartitionkeyrangeid.go @@ -139,13 +139,13 @@ func (id CollectionPartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go index 51120cbbc59..7a4dd109319 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionPartitionKeyRangeIdId{} func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { - id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -44,8 +44,8 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { } func TestFormatCollectionPartitionKeyRangeIdID(t *testing.T) { - actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseCollectionPartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseCollectionPartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_container.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_container.go index 9fc554842ed..52411ec0fb4 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_container.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_container_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_container_test.go index e4a16015b14..f6673f4842c 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_container_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_database.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_database.go index 32a5b840398..c73ee48b681 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_database.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_database.go @@ -121,9 +121,9 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_database_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_database_test.go index 48cd6308772..c1750285bd3 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_database_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databaseaccount.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databaseaccount.go index 2ca27074b00..dfad7d15d85 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databaseaccount_test.go index a3631600aea..d8132b226fc 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databasecollection.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databasecollection.go index 4029bc74189..81c3be1f181 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databasecollection.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databasecollection.go @@ -133,13 +133,13 @@ func (id DatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databasecollection_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databasecollection_test.go index c2a9406bb53..8d0ed01afa3 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databasecollection_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_databasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseCollectionId{} func TestNewDatabaseCollectionID(t *testing.T) { - id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") + id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatDatabaseCollectionID(t *testing.T) { - actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid" + actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_graph.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_graph.go index 7a55f30993c..e520754fd71 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_graph.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_graph_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_graph_test.go index 54c0bd78a11..1f089c40924 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_graph_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_gremlindatabase.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_gremlindatabase.go index 8bfcc87e575..5ef8dfa4e09 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_gremlindatabase.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_gremlindatabase.go @@ -121,9 +121,9 @@ func (id GremlinDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_gremlindatabase_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_gremlindatabase_test.go index 1750dbc731f..a988d8e29ed 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_gremlindatabase_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_gremlindatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GremlinDatabaseId{} func TestNewGremlinDatabaseID(t *testing.T) { - id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGremlinDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } } func TestFormatGremlinDatabaseID(t *testing.T) { - actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName" + actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGremlinDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGremlinDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_location.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_location.go index febfbe7d88f..483a412e5c7 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_location.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_location_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_location_test.go index c94c6add0bd..803c3f2c435 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_location_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabase.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabase.go index 75875a6ac54..93bc507bbf9 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabase.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabase.go @@ -121,9 +121,9 @@ func (id MongodbDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabase_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabase_test.go index 13fca77bd6a..fbe5814e30c 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabase_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseId{} func TestNewMongodbDatabaseID(t *testing.T) { - id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMongodbDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } } func TestFormatMongodbDatabaseID(t *testing.T) { - actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName" + actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabasecollection.go index 7ddcf2cbb6d..8b233638340 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabasecollection_test.go index b311d450e34..96fb623f632 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_partitionkeyrangeid.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_partitionkeyrangeid.go index 88f0f4a92d5..0f54ae80af9 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_partitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_partitionkeyrangeid.go @@ -133,11 +133,11 @@ func (id PartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_partitionkeyrangeid_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_partitionkeyrangeid_test.go index d96f13f7d9f..d06f8a1ceda 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_partitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_partitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PartitionKeyRangeIdId{} func TestNewPartitionKeyRangeIdID(t *testing.T) { - id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -40,8 +40,8 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { } func TestFormatPartitionKeyRangeIdID(t *testing.T) { - actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParsePartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParsePartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_region.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_region.go index 4f0f50bcdef..36fb36b86d2 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_region.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_region.go @@ -121,9 +121,9 @@ func (id RegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_region_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_region_test.go index 416fa31d29e..45452117088 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_region_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_region_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegionId{} func TestNewRegionID(t *testing.T) { - id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") + id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } } func TestFormatRegionID(t *testing.T) { - actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region" + actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sourceregiontargetregion.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sourceregiontargetregion.go index eaa24e25c65..2112d234a8e 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sourceregiontargetregion.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sourceregiontargetregion.go @@ -127,11 +127,11 @@ func (id SourceRegionTargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSourceRegion", "sourceRegion", "sourceRegion"), - resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegion"), + resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegionName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sourceregiontargetregion_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sourceregiontargetregion_test.go index d96342f3531..9acfe7a194e 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sourceregiontargetregion_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sourceregiontargetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SourceRegionTargetRegionId{} func TestNewSourceRegionTargetRegionID(t *testing.T) { - id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") + id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSourceRegionTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SourceRegionName != "sourceRegion" { - t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegion") + if id.SourceRegionName != "sourceRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegionName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatSourceRegionTargetRegionID(t *testing.T) { - actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion" + actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSourceRegionTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSourceRegionTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SourceRegionName: "sOuRcErEgIoN", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SourceRegionName: "sOuRcErEgIoNnAmE", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sqldatabase.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sqldatabase.go index d92d2bbbf59..21d4f894dd5 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sqldatabase.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sqldatabase.go @@ -121,9 +121,9 @@ func (id SqlDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sqldatabase_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sqldatabase_test.go index f9999bbfaa0..5751b55efa6 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sqldatabase_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_sqldatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlDatabaseId{} func TestNewSqlDatabaseID(t *testing.T) { - id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSqlDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } } func TestFormatSqlDatabaseID(t *testing.T) { - actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName" + actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_storedprocedure.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_storedprocedure.go index 72b9abbafe9..31dd78cfcba 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_storedprocedure.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_storedprocedure.go @@ -133,9 +133,9 @@ func (id StoredProcedureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticStoredProcedures", "storedProcedures", "storedProcedures"), diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_storedprocedure_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_storedprocedure_test.go index ccb86f85be8..602b81d744b 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_storedprocedure_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_storedprocedure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StoredProcedureId{} func TestNewStoredProcedureID(t *testing.T) { - id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") + id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewStoredProcedureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewStoredProcedureID(t *testing.T) { } func TestFormatStoredProcedureID(t *testing.T) { - actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName" + actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseStoredProcedureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseStoredProcedureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", StoredProcedureName: "sToReDpRoCeDuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_table.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_table.go index ecf9d97c31e..db828313697 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_table.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_table_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_table_test.go index 1e9703fdba1..861ecae041b 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_table_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_targetregion.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_targetregion.go index 213d48cf619..c07e6abe2a3 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_targetregion.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_targetregion.go @@ -121,9 +121,9 @@ func (id TargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_targetregion_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_targetregion_test.go index 5a026cdd4cd..636fb4b33f6 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_targetregion_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_targetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TargetRegionId{} func TestNewTargetRegionID(t *testing.T) { - id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") + id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatTargetRegionID(t *testing.T) { - actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion" + actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_trigger.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_trigger.go index 8c6760bfa3d..79ef1f4abbf 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_trigger.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_trigger.go @@ -133,9 +133,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_trigger_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_trigger_test.go index 2033539a5a9..42683f03ca2 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_trigger_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_userdefinedfunction.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_userdefinedfunction.go index c09e749c3cb..eb5d1f446fd 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_userdefinedfunction.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_userdefinedfunction.go @@ -133,9 +133,9 @@ func (id UserDefinedFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticUserDefinedFunctions", "userDefinedFunctions", "userDefinedFunctions"), diff --git a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_userdefinedfunction_test.go b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_userdefinedfunction_test.go index 0f53e3aa1bf..ca957175cbc 100644 --- a/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_userdefinedfunction_test.go +++ b/resource-manager/cosmosdb/2023-04-15/cosmosdb/id_userdefinedfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserDefinedFunctionId{} func TestNewUserDefinedFunctionID(t *testing.T) { - id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") + id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewUserDefinedFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewUserDefinedFunctionID(t *testing.T) { } func TestFormatUserDefinedFunctionID(t *testing.T) { - actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" + actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseUserDefinedFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseUserDefinedFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", UserDefinedFunctionName: "uSeRdEfInEdFuNcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/datatransfer/README.md b/resource-manager/cosmosdb/2023-04-15/datatransfer/README.md index d28491a2e41..f4c84dc1167 100644 --- a/resource-manager/cosmosdb/2023-04-15/datatransfer/README.md +++ b/resource-manager/cosmosdb/2023-04-15/datatransfer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := datatransfer.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/datatransfer/id_service.go b/resource-manager/cosmosdb/2023-04-15/datatransfer/id_service.go index 6f3fabaa7b7..58fd3f22eb2 100644 --- a/resource-manager/cosmosdb/2023-04-15/datatransfer/id_service.go +++ b/resource-manager/cosmosdb/2023-04-15/datatransfer/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/datatransfer/id_service_test.go b/resource-manager/cosmosdb/2023-04-15/datatransfer/id_service_test.go index accfb95c7e8..b3261c00b8b 100644 --- a/resource-manager/cosmosdb/2023-04-15/datatransfer/id_service_test.go +++ b/resource-manager/cosmosdb/2023-04-15/datatransfer/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/graphapicompute/README.md b/resource-manager/cosmosdb/2023-04-15/graphapicompute/README.md index d1ccb8143a5..444817581a4 100644 --- a/resource-manager/cosmosdb/2023-04-15/graphapicompute/README.md +++ b/resource-manager/cosmosdb/2023-04-15/graphapicompute/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := graphapicompute.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/graphapicompute/id_service.go b/resource-manager/cosmosdb/2023-04-15/graphapicompute/id_service.go index 37a699c2693..a4987f4b408 100644 --- a/resource-manager/cosmosdb/2023-04-15/graphapicompute/id_service.go +++ b/resource-manager/cosmosdb/2023-04-15/graphapicompute/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/graphapicompute/id_service_test.go b/resource-manager/cosmosdb/2023-04-15/graphapicompute/id_service_test.go index 20302671509..4be092ed7b2 100644 --- a/resource-manager/cosmosdb/2023-04-15/graphapicompute/id_service_test.go +++ b/resource-manager/cosmosdb/2023-04-15/graphapicompute/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/managedcassandras/README.md b/resource-manager/cosmosdb/2023-04-15/managedcassandras/README.md index e8d711dd427..86fef7b2b74 100644 --- a/resource-manager/cosmosdb/2023-04-15/managedcassandras/README.md +++ b/resource-manager/cosmosdb/2023-04-15/managedcassandras/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraClustersCreateUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersGet(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.CommandPostBody{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { // handle the error @@ -143,7 +143,7 @@ if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersStatus(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -176,7 +176,7 @@ if err := client.CassandraClustersUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... @@ -193,7 +193,7 @@ if err := client.CassandraDataCentersCreateUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -205,7 +205,7 @@ if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") read, err := client.CassandraDataCentersGet(ctx, id) if err != nil { @@ -221,7 +221,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraDataCentersList(ctx, id) if err != nil { @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... diff --git a/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_cassandracluster.go b/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_cassandracluster.go index 43ce8c1202c..b189a0db128 100644 --- a/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_cassandracluster.go +++ b/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_cassandracluster.go @@ -115,7 +115,7 @@ func (id CassandraClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_cassandracluster_test.go b/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_cassandracluster_test.go index b21a0ee8614..6e99daf02bb 100644 --- a/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_cassandracluster_test.go +++ b/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_cassandracluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraClusterId{} func TestNewCassandraClusterID(t *testing.T) { - id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCassandraClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } } func TestFormatCassandraClusterID(t *testing.T) { - actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName" + actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCassandraClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCassandraClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_datacenter.go b/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_datacenter.go index 8736ef94f6f..5c5a637c822 100644 --- a/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_datacenter.go +++ b/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_datacenter.go @@ -121,7 +121,7 @@ func (id DataCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), resourceids.StaticSegment("staticDataCenters", "dataCenters", "dataCenters"), resourceids.UserSpecifiedSegment("dataCenterName", "dataCenterName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_datacenter_test.go b/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_datacenter_test.go index 66e81bfb94f..e958093a948 100644 --- a/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_datacenter_test.go +++ b/resource-manager/cosmosdb/2023-04-15/managedcassandras/id_datacenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataCenterId{} func TestNewDataCenterID(t *testing.T) { - id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") + id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDataCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } if id.DataCenterName != "dataCenterName" { @@ -32,8 +32,8 @@ func TestNewDataCenterID(t *testing.T) { } func TestFormatDataCenterID(t *testing.T) { - actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName" + actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDataCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDataCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", DataCenterName: "dAtAcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/README.md b/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/README.md index 5fd74bce424..169626add7f 100644 --- a/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/README.md +++ b/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := materializedviewsbuilder.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/id_service.go b/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/id_service.go index 3af930e9bc6..2eb7e5e0d31 100644 --- a/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/id_service.go +++ b/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/id_service_test.go b/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/id_service_test.go index 8d14f132a1e..577612d3e07 100644 --- a/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/id_service_test.go +++ b/resource-manager/cosmosdb/2023-04-15/materializedviewsbuilder/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/mongorbacs/README.md b/resource-manager/cosmosdb/2023-04-15/mongorbacs/README.md index cd1f35925c6..00fe0036f36 100644 --- a/resource-manager/cosmosdb/2023-04-15/mongorbacs/README.md +++ b/resource-manager/cosmosdb/2023-04-15/mongorbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") payload := mongorbacs.MongoRoleDefinitionCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") payload := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") read, err := client.MongoDBResourcesGetMongoRoleDefinition(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") read, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoRoleDefinitions(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoUserDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_databaseaccount.go index 5dcb902abb5..35b2f7f690f 100644 --- a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_databaseaccount_test.go index 8cf97bbace8..18a73206d20 100644 --- a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbroledefinition.go b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbroledefinition.go index 88c7ce70b53..859adbfb63f 100644 --- a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbroledefinition.go +++ b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbroledefinition.go @@ -121,7 +121,7 @@ func (id MongodbRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbRoleDefinitions", "mongodbRoleDefinitions", "mongodbRoleDefinitions"), resourceids.UserSpecifiedSegment("mongoRoleDefinitionId", "mongoRoleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbroledefinition_test.go b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbroledefinition_test.go index 635bde6bf7f..667a0b36da3 100644 --- a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbroledefinition_test.go +++ b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbRoleDefinitionId{} func TestNewMongodbRoleDefinitionID(t *testing.T) { - id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") + id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoRoleDefinitionId != "mongoRoleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { } func TestFormatMongodbRoleDefinitionID(t *testing.T) { - actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId" + actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoRoleDefinitionId: "mOnGoRoLeDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbuserdefinition.go b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbuserdefinition.go index d3ad61af293..68a38ae9094 100644 --- a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbuserdefinition.go +++ b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbuserdefinition.go @@ -121,7 +121,7 @@ func (id MongodbUserDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbUserDefinitions", "mongodbUserDefinitions", "mongodbUserDefinitions"), resourceids.UserSpecifiedSegment("mongoUserDefinitionId", "mongoUserDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbuserdefinition_test.go b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbuserdefinition_test.go index c89f631908a..eb010d3045a 100644 --- a/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbuserdefinition_test.go +++ b/resource-manager/cosmosdb/2023-04-15/mongorbacs/id_mongodbuserdefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbUserDefinitionId{} func TestNewMongodbUserDefinitionID(t *testing.T) { - id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") + id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoUserDefinitionId != "mongoUserDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { } func TestFormatMongodbUserDefinitionID(t *testing.T) { - actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId" + actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbUserDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbUserDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoUserDefinitionId: "mOnGoUsErDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/README.md b/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/README.md index ee822e570f3..1b565cc1e77 100644 --- a/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/README.md +++ b/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := notebookworkspacesresource.ARMProxyResource{ // ... @@ -41,7 +41,7 @@ if err := client.NotebookWorkspacesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListByDatabaseAccount(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListConnectionInfo(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != nil { // handle the error @@ -113,7 +113,7 @@ if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesStartThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/id_databaseaccount.go b/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/id_databaseaccount.go index cc1cfbae97b..48f82ab040b 100644 --- a/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/id_databaseaccount_test.go index 765176e522b..4b238cf57bd 100644 --- a/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-04-15/notebookworkspacesresource/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/README.md b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/README.md index 10d1118e82f..8a0bd09958e 100644 --- a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/README.md +++ b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_databaseaccount.go b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_databaseaccount.go index 2d03a12f035..0ef32fef9c1 100644 --- a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_databaseaccount_test.go index def6cb01a81..fe0be2f9ad1 100644 --- a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_privateendpointconnection.go index 404b3ec4b99..ad4cd96d133 100644 --- a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_privateendpointconnection_test.go index 616287d8b5e..6f7f6251e0b 100644 --- a/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/cosmosdb/2023-04-15/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/README.md b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/README.md index 67e70889bd8..9cb7a8a9e93 100644 --- a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/README.md +++ b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_databaseaccount.go b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_databaseaccount.go index da2cafa82ce..09df5d78d9d 100644 --- a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_databaseaccount_test.go index 54eac6dbdc6..aa4eb501a97 100644 --- a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_privatelinkresource.go b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_privatelinkresource.go index 14bd8a6525e..22240869721 100644 --- a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_privatelinkresource_test.go index df3663505ef..8994ca6277c 100644 --- a/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/cosmosdb/2023-04-15/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/rbacs/README.md b/resource-manager/cosmosdb/2023-04-15/rbacs/README.md index e87503907b5..71165c00c17 100644 --- a/resource-manager/cosmosdb/2023-04-15/rbacs/README.md +++ b/resource-manager/cosmosdb/2023-04-15/rbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") payload := rbacs.SqlRoleAssignmentCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleAssignmentThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") payload := rbacs.SqlRoleDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleDefinitionThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.SqlResourcesGetSqlRoleAssignment(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") read, err := client.SqlResourcesGetSqlRoleDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleAssignments(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/rbacs/id_account.go b/resource-manager/cosmosdb/2023-04-15/rbacs/id_account.go index 71408ced400..2fd416725b1 100644 --- a/resource-manager/cosmosdb/2023-04-15/rbacs/id_account.go +++ b/resource-manager/cosmosdb/2023-04-15/rbacs/id_account.go @@ -121,7 +121,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleAssignments", "sqlRoleAssignments", "sqlRoleAssignments"), resourceids.ScopeSegment("roleAssignmentId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } diff --git a/resource-manager/cosmosdb/2023-04-15/rbacs/id_account_test.go b/resource-manager/cosmosdb/2023-04-15/rbacs/id_account_test.go index 28a5f3a07bb..ad2c1bacfd4 100644 --- a/resource-manager/cosmosdb/2023-04-15/rbacs/id_account_test.go +++ b/resource-manager/cosmosdb/2023-04-15/rbacs/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleAssignmentId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewAccountID(t *testing.T) { } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,21 +87,21 @@ func TestParseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -223,41 +223,41 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleAssignmentId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/cosmosdb/2023-04-15/rbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2023-04-15/rbacs/id_databaseaccount.go index a75e72bbb29..eea55d3e517 100644 --- a/resource-manager/cosmosdb/2023-04-15/rbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-04-15/rbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/rbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-04-15/rbacs/id_databaseaccount_test.go index f7b7f6e34a5..85257d9182a 100644 --- a/resource-manager/cosmosdb/2023-04-15/rbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-04-15/rbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/rbacs/id_sqlroledefinition.go b/resource-manager/cosmosdb/2023-04-15/rbacs/id_sqlroledefinition.go index 8b5ee24533d..fb415467ab6 100644 --- a/resource-manager/cosmosdb/2023-04-15/rbacs/id_sqlroledefinition.go +++ b/resource-manager/cosmosdb/2023-04-15/rbacs/id_sqlroledefinition.go @@ -121,7 +121,7 @@ func (id SqlRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleDefinitions", "sqlRoleDefinitions", "sqlRoleDefinitions"), resourceids.UserSpecifiedSegment("roleDefinitionId", "roleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-04-15/rbacs/id_sqlroledefinition_test.go b/resource-manager/cosmosdb/2023-04-15/rbacs/id_sqlroledefinition_test.go index e54bbbbe92a..d5f64dcc134 100644 --- a/resource-manager/cosmosdb/2023-04-15/rbacs/id_sqlroledefinition_test.go +++ b/resource-manager/cosmosdb/2023-04-15/rbacs/id_sqlroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlRoleDefinitionId{} func TestNewSqlRoleDefinitionID(t *testing.T) { - id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") + id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleDefinitionId != "roleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { } func TestFormatSqlRoleDefinitionID(t *testing.T) { - actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId" + actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleDefinitionId: "rOlEdEfInItIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/README.md b/resource-manager/cosmosdb/2023-04-15/restorables/README.md index e8c549b2e96..9ccb170a819 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/README.md +++ b/resource-manager/cosmosdb/2023-04-15/restorables/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -42,7 +42,7 @@ if err := client.GremlinResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -59,7 +59,7 @@ if err := client.MongoDBResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableDatabaseAccountsGetByLocation(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RestorableDatabaseAccountsListByLocation(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinDatabasesList(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinGraphsList(ctx, id, restorables.DefaultRestorableGremlinGraphsListOperationOptions()) if err != nil { @@ -139,7 +139,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinResourcesList(ctx, id, restorables.DefaultRestorableGremlinResourcesListOperationOptions()) if err != nil { @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbCollectionsList(ctx, id, restorables.DefaultRestorableMongodbCollectionsListOperationOptions()) if err != nil { @@ -171,7 +171,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbDatabasesList(ctx, id) if err != nil { @@ -187,7 +187,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbResourcesList(ctx, id, restorables.DefaultRestorableMongodbResourcesListOperationOptions()) if err != nil { @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlContainersList(ctx, id, restorables.DefaultRestorableSqlContainersListOperationOptions()) if err != nil { @@ -219,7 +219,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlDatabasesList(ctx, id) if err != nil { @@ -235,7 +235,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlResourcesList(ctx, id, restorables.DefaultRestorableSqlResourcesListOperationOptions()) if err != nil { @@ -251,7 +251,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTableResourcesList(ctx, id, restorables.DefaultRestorableTableResourcesListOperationOptions()) if err != nil { @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTablesList(ctx, id, restorables.DefaultRestorableTablesListOperationOptions()) if err != nil { @@ -283,7 +283,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -300,7 +300,7 @@ if err := client.SqlResourcesRetrieveContinuousBackupInformationThenPoll(ctx, id ```go ctx := context.TODO() -id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := restorables.ContinuousBackupRestoreLocation{ // ... diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_container.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_container.go index 9398504f72d..cc01b7113aa 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_container.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_container_test.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_container_test.go index 0cea9d939ac..97675cfd2b9 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_container_test.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_graph.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_graph.go index 9904c179afc..b5c11de6742 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_graph.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_graph_test.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_graph_test.go index b604d40e75f..633f0c50588 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_graph_test.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_location.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_location.go index 79632e8074a..c7c3d4a6d23 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_location.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_location_test.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_location_test.go index 00f77288bb6..08c58d5f34f 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_location_test.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_mongodbdatabasecollection.go index c5b408846b1..863a29287de 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_mongodbdatabasecollection_test.go index 846b1efd302..77437dc2f70 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_restorabledatabaseaccount.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_restorabledatabaseaccount.go index 1397a41ed1b..712ea35cfc0 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_restorabledatabaseaccount.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_restorabledatabaseaccount.go @@ -113,7 +113,7 @@ func (id RestorableDatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRestorableDatabaseAccounts", "restorableDatabaseAccounts", "restorableDatabaseAccounts"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_restorabledatabaseaccount_test.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_restorabledatabaseaccount_test.go index 0608b8c7799..9a42672ab61 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_restorabledatabaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_restorabledatabaseaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RestorableDatabaseAccountId{} func TestNewRestorableDatabaseAccountID(t *testing.T) { - id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") + id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InstanceId != "instanceId" { @@ -28,8 +28,8 @@ func TestNewRestorableDatabaseAccountID(t *testing.T) { } func TestFormatRestorableDatabaseAccountID(t *testing.T) { - actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId" + actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRestorableDatabaseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRestorableDatabaseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_table.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_table.go index 9c44038270c..6b9e3c73fa6 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_table.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/restorables/id_table_test.go b/resource-manager/cosmosdb/2023-04-15/restorables/id_table_test.go index d0b8fe67a87..432623c34aa 100644 --- a/resource-manager/cosmosdb/2023-04-15/restorables/id_table_test.go +++ b/resource-manager/cosmosdb/2023-04-15/restorables/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/services/README.md b/resource-manager/cosmosdb/2023-04-15/services/README.md index dd0a2d117b3..5a3c618591a 100644 --- a/resource-manager/cosmosdb/2023-04-15/services/README.md +++ b/resource-manager/cosmosdb/2023-04-15/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ServiceList(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/services/id_databaseaccount.go b/resource-manager/cosmosdb/2023-04-15/services/id_databaseaccount.go index d076efa0b15..16e2d04be53 100644 --- a/resource-manager/cosmosdb/2023-04-15/services/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-04-15/services/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-04-15/services/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-04-15/services/id_databaseaccount_test.go index b7ab3d22543..1b08a40dab2 100644 --- a/resource-manager/cosmosdb/2023-04-15/services/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-04-15/services/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/README.md b/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/README.md index 34679e68975..49ed04a9a61 100644 --- a/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/README.md +++ b/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := sqldedicatedgateway.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/id_service.go b/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/id_service.go index fae29f8aa18..f628c9a4812 100644 --- a/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/id_service.go +++ b/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/id_service_test.go b/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/id_service_test.go index 93def5b81b2..4c591e81432 100644 --- a/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/id_service_test.go +++ b/resource-manager/cosmosdb/2023-04-15/sqldedicatedgateway/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/README.md b/resource-manager/cosmosdb/2023-09-15/cosmosdb/README.md index dcc6846f8ea..ed624ab6ed9 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/README.md +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.CassandraKeyspaceCreateUpdateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.CassandraTableCreateUpdateParameters{ // ... @@ -59,7 +59,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != nil { // handle the error @@ -83,7 +83,7 @@ if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspace(ctx, id) if err != nil { @@ -99,7 +99,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) if err != nil { @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTable(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTableThroughput(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.CassandraResourcesListCassandraKeyspaces(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesListCassandraTables(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -191,7 +191,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThe ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -215,7 +215,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -227,7 +227,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPo ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -244,7 +244,7 @@ if err := client.CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -261,7 +261,7 @@ if err := client.CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetricDefinitions(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetrics(ctx, id, cosmosdb.DefaultCollectionListMetricsOperationOptions()) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListUsages(ctx, id, cosmosdb.DefaultCollectionListUsagesOperationOptions()) if err != nil { @@ -309,7 +309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionListMetricsOperationOptions()) if err != nil { @@ -325,7 +325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListUsages(ctx, id, cosmosdb.DefaultCollectionPartitionListUsagesOperationOptions()) if err != nil { @@ -341,7 +341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionPartitionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionRegionListMetricsOperationOptions()) if err != nil { @@ -357,7 +357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionRegionListMetricsOperationOptions()) if err != nil { @@ -373,7 +373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") +id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") read, err := client.DatabaseAccountRegionListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountRegionListMetricsOperationOptions()) if err != nil { @@ -405,7 +405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountCreateUpdateParameters{ // ... @@ -422,7 +422,7 @@ if err := client.DatabaseAccountsCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -434,7 +434,7 @@ if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.FailoverPolicies{ // ... @@ -451,7 +451,7 @@ if err := client.DatabaseAccountsFailoverPriorityChangeThenPoll(ctx, id, payload ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGet(ctx, id) if err != nil { @@ -467,7 +467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGetReadOnlyKeys(ctx, id) if err != nil { @@ -515,7 +515,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListConnectionStrings(ctx, id) if err != nil { @@ -531,7 +531,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListKeys(ctx, id) if err != nil { @@ -547,7 +547,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetricDefinitions(ctx, id) if err != nil { @@ -563,7 +563,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountsListMetricsOperationOptions()) if err != nil { @@ -579,7 +579,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListReadOnlyKeys(ctx, id) if err != nil { @@ -595,7 +595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListUsages(ctx, id, cosmosdb.DefaultDatabaseAccountsListUsagesOperationOptions()) if err != nil { @@ -611,7 +611,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -628,7 +628,7 @@ if err := client.DatabaseAccountsOfflineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -645,7 +645,7 @@ if err := client.DatabaseAccountsOnlineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountRegenerateKeyParameters{ // ... @@ -662,7 +662,7 @@ if err := client.DatabaseAccountsRegenerateKeyThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountUpdateParameters{ // ... @@ -679,7 +679,7 @@ if err := client.DatabaseAccountsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetricDefinitions(ctx, id) if err != nil { @@ -695,7 +695,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetrics(ctx, id, cosmosdb.DefaultDatabaseListMetricsOperationOptions()) if err != nil { @@ -711,7 +711,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListUsages(ctx, id, cosmosdb.DefaultDatabaseListUsagesOperationOptions()) if err != nil { @@ -727,7 +727,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.GremlinDatabaseCreateUpdateParameters{ // ... @@ -744,7 +744,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.GremlinGraphCreateUpdateParameters{ // ... @@ -761,7 +761,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -773,7 +773,7 @@ if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil { // handle the error @@ -785,7 +785,7 @@ if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabase(ctx, id) if err != nil { @@ -801,7 +801,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabaseThroughput(ctx, id) if err != nil { @@ -817,7 +817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraph(ctx, id) if err != nil { @@ -833,7 +833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraphThroughput(ctx, id) if err != nil { @@ -849,7 +849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.GremlinResourcesListGremlinDatabases(ctx, id) if err != nil { @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesListGremlinGraphs(ctx, id) if err != nil { @@ -881,7 +881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -893,7 +893,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -905,7 +905,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -917,7 +917,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id) ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -929,7 +929,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -946,7 +946,7 @@ if err := client.GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -963,7 +963,7 @@ if err := client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsGet(ctx, id) if err != nil { @@ -995,7 +995,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.MongoDBCollectionCreateUpdateParameters{ // ... @@ -1012,7 +1012,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.MongoDBDatabaseCreateUpdateParameters{ // ... @@ -1029,7 +1029,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err != nil { // handle the error @@ -1041,7 +1041,7 @@ if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err ! ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1053,7 +1053,7 @@ if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollection(ctx, id) if err != nil { @@ -1069,7 +1069,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) if err != nil { @@ -1085,7 +1085,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabase(ctx, id) if err != nil { @@ -1101,7 +1101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) if err != nil { @@ -1117,7 +1117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesListMongoDBCollections(ctx, id) if err != nil { @@ -1133,7 +1133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoDBDatabases(ctx, id) if err != nil { @@ -1149,7 +1149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1161,7 +1161,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1173,7 +1173,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenP ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1185,7 +1185,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1197,7 +1197,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1214,7 +1214,7 @@ if err := client.MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1231,7 +1231,7 @@ if err := client.MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdListMetricsOperationOptions()) if err != nil { @@ -1247,7 +1247,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdRegionListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions()) if err != nil { @@ -1263,7 +1263,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.PercentileListMetrics(ctx, id, cosmosdb.DefaultPercentileListMetricsOperationOptions()) if err != nil { @@ -1279,7 +1279,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") +id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") read, err := client.PercentileSourceTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileSourceTargetListMetricsOperationOptions()) if err != nil { @@ -1295,7 +1295,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") +id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") read, err := client.PercentileTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileTargetListMetricsOperationOptions()) if err != nil { @@ -1311,7 +1311,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") payload := cosmosdb.ClientEncryptionKeyCreateUpdateParameters{ // ... @@ -1328,7 +1328,7 @@ if err := client.SqlResourcesCreateUpdateClientEncryptionKeyThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.SqlContainerCreateUpdateParameters{ // ... @@ -1345,7 +1345,7 @@ if err := client.SqlResourcesCreateUpdateSqlContainerThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.SqlDatabaseCreateUpdateParameters{ // ... @@ -1362,7 +1362,7 @@ if err := client.SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") payload := cosmosdb.SqlStoredProcedureCreateUpdateParameters{ // ... @@ -1379,7 +1379,7 @@ if err := client.SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") payload := cosmosdb.SqlTriggerCreateUpdateParameters{ // ... @@ -1396,7 +1396,7 @@ if err := client.SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") payload := cosmosdb.SqlUserDefinedFunctionCreateUpdateParameters{ // ... @@ -1413,7 +1413,7 @@ if err := client.SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { // handle the error @@ -1425,7 +1425,7 @@ if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1437,7 +1437,7 @@ if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != nil { // handle the error @@ -1449,7 +1449,7 @@ if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != n ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { // handle the error @@ -1461,7 +1461,7 @@ if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err != nil { // handle the error @@ -1473,7 +1473,7 @@ if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") read, err := client.SqlResourcesGetClientEncryptionKey(ctx, id) if err != nil { @@ -1489,7 +1489,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainer(ctx, id) if err != nil { @@ -1505,7 +1505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainerThroughput(ctx, id) if err != nil { @@ -1521,7 +1521,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabase(ctx, id) if err != nil { @@ -1537,7 +1537,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabaseThroughput(ctx, id) if err != nil { @@ -1553,7 +1553,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") read, err := client.SqlResourcesGetSqlStoredProcedure(ctx, id) if err != nil { @@ -1569,7 +1569,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") read, err := client.SqlResourcesGetSqlTrigger(ctx, id) if err != nil { @@ -1585,7 +1585,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") read, err := client.SqlResourcesGetSqlUserDefinedFunction(ctx, id) if err != nil { @@ -1601,7 +1601,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListClientEncryptionKeys(ctx, id) if err != nil { @@ -1617,7 +1617,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListSqlContainers(ctx, id) if err != nil { @@ -1633,7 +1633,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlDatabases(ctx, id) if err != nil { @@ -1649,7 +1649,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlStoredProcedures(ctx, id) if err != nil { @@ -1665,7 +1665,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlTriggers(ctx, id) if err != nil { @@ -1681,7 +1681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlUserDefinedFunctions(ctx, id) if err != nil { @@ -1697,7 +1697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1709,7 +1709,7 @@ if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); er ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1721,7 +1721,7 @@ if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1733,7 +1733,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1745,7 +1745,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1762,7 +1762,7 @@ if err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1779,7 +1779,7 @@ if err := client.SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.TableCreateUpdateParameters{ // ... @@ -1796,7 +1796,7 @@ if err := client.TableResourcesCreateUpdateTableThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { // handle the error @@ -1808,7 +1808,7 @@ if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTable(ctx, id) if err != nil { @@ -1824,7 +1824,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTableThroughput(ctx, id) if err != nil { @@ -1840,7 +1840,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.TableResourcesListTables(ctx, id) if err != nil { @@ -1856,7 +1856,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1868,7 +1868,7 @@ if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1880,7 +1880,7 @@ if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspace.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspace.go index 4ce40124431..c7e797b1802 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspace.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspace.go @@ -121,9 +121,9 @@ func (id CassandraKeyspaceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspace_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspace_test.go index 2c41b074274..1f760780ed8 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspace_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceId{} func TestNewCassandraKeyspaceID(t *testing.T) { - id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") + id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCassandraKeyspaceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } } func TestFormatCassandraKeyspaceID(t *testing.T) { - actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName" + actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCassandraKeyspaceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCassandraKeyspaceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspacetable.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspacetable.go index 939b9bdce12..5609bfaea81 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspacetable.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspacetable.go @@ -127,9 +127,9 @@ func (id CassandraKeyspaceTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspacetable_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspacetable_test.go index 0d6746660eb..de5ca96190f 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspacetable_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_cassandrakeyspacetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceTableId{} func TestNewCassandraKeyspaceTableID(t *testing.T) { - id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") + id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } if id.TableName != "tableName" { @@ -36,8 +36,8 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { } func TestFormatCassandraKeyspaceTableID(t *testing.T) { - actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName" + actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCassandraKeyspaceTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCassandraKeyspaceTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_clientencryptionkey.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_clientencryptionkey.go index edcfeff0f1c..1369551418f 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_clientencryptionkey.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_clientencryptionkey.go @@ -127,9 +127,9 @@ func (id ClientEncryptionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticClientEncryptionKeys", "clientEncryptionKeys", "clientEncryptionKeys"), resourceids.UserSpecifiedSegment("clientEncryptionKeyName", "clientEncryptionKeyName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_clientencryptionkey_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_clientencryptionkey_test.go index 41cdccd06c3..e0353898a57 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_clientencryptionkey_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_clientencryptionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ClientEncryptionKeyId{} func TestNewClientEncryptionKeyID(t *testing.T) { - id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") + id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewClientEncryptionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ClientEncryptionKeyName != "clientEncryptionKeyName" { @@ -36,8 +36,8 @@ func TestNewClientEncryptionKeyID(t *testing.T) { } func TestFormatClientEncryptionKeyID(t *testing.T) { - actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName" + actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseClientEncryptionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseClientEncryptionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ClientEncryptionKeyName: "cLiEnTeNcRyPtIoNkEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collection.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collection.go index 7a48b54fbb3..20b1d5d4051 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collection.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collection.go @@ -127,11 +127,11 @@ func (id CollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collection_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collection_test.go index af80428336c..5d25b21a81e 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collection_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionId{} func TestNewCollectionID(t *testing.T) { - id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") + id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatCollectionID(t *testing.T) { - actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid" + actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collectionpartitionkeyrangeid.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collectionpartitionkeyrangeid.go index 0372c743649..a8f1146d844 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collectionpartitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collectionpartitionkeyrangeid.go @@ -139,13 +139,13 @@ func (id CollectionPartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go index 51120cbbc59..7a4dd109319 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionPartitionKeyRangeIdId{} func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { - id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -44,8 +44,8 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { } func TestFormatCollectionPartitionKeyRangeIdID(t *testing.T) { - actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseCollectionPartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseCollectionPartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_container.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_container.go index 9fc554842ed..52411ec0fb4 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_container.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_container_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_container_test.go index e4a16015b14..f6673f4842c 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_container_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_database.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_database.go index 32a5b840398..c73ee48b681 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_database.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_database.go @@ -121,9 +121,9 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_database_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_database_test.go index 48cd6308772..c1750285bd3 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_database_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databaseaccount.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databaseaccount.go index 2ca27074b00..dfad7d15d85 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databaseaccount_test.go index a3631600aea..d8132b226fc 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databasecollection.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databasecollection.go index 4029bc74189..81c3be1f181 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databasecollection.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databasecollection.go @@ -133,13 +133,13 @@ func (id DatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databasecollection_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databasecollection_test.go index c2a9406bb53..8d0ed01afa3 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databasecollection_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_databasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseCollectionId{} func TestNewDatabaseCollectionID(t *testing.T) { - id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") + id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatDatabaseCollectionID(t *testing.T) { - actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid" + actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_graph.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_graph.go index 7a55f30993c..e520754fd71 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_graph.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_graph_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_graph_test.go index 54c0bd78a11..1f089c40924 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_graph_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_gremlindatabase.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_gremlindatabase.go index 8bfcc87e575..5ef8dfa4e09 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_gremlindatabase.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_gremlindatabase.go @@ -121,9 +121,9 @@ func (id GremlinDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_gremlindatabase_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_gremlindatabase_test.go index 1750dbc731f..a988d8e29ed 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_gremlindatabase_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_gremlindatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GremlinDatabaseId{} func TestNewGremlinDatabaseID(t *testing.T) { - id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGremlinDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } } func TestFormatGremlinDatabaseID(t *testing.T) { - actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName" + actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGremlinDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGremlinDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_location.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_location.go index febfbe7d88f..483a412e5c7 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_location.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_location_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_location_test.go index c94c6add0bd..803c3f2c435 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_location_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabase.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabase.go index 75875a6ac54..93bc507bbf9 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabase.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabase.go @@ -121,9 +121,9 @@ func (id MongodbDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabase_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabase_test.go index 13fca77bd6a..fbe5814e30c 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabase_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseId{} func TestNewMongodbDatabaseID(t *testing.T) { - id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMongodbDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } } func TestFormatMongodbDatabaseID(t *testing.T) { - actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName" + actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabasecollection.go index 7ddcf2cbb6d..8b233638340 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabasecollection_test.go index b311d450e34..96fb623f632 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_partitionkeyrangeid.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_partitionkeyrangeid.go index 88f0f4a92d5..0f54ae80af9 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_partitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_partitionkeyrangeid.go @@ -133,11 +133,11 @@ func (id PartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_partitionkeyrangeid_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_partitionkeyrangeid_test.go index d96f13f7d9f..d06f8a1ceda 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_partitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_partitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PartitionKeyRangeIdId{} func TestNewPartitionKeyRangeIdID(t *testing.T) { - id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -40,8 +40,8 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { } func TestFormatPartitionKeyRangeIdID(t *testing.T) { - actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParsePartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParsePartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_region.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_region.go index 4f0f50bcdef..36fb36b86d2 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_region.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_region.go @@ -121,9 +121,9 @@ func (id RegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_region_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_region_test.go index 416fa31d29e..45452117088 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_region_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_region_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegionId{} func TestNewRegionID(t *testing.T) { - id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") + id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } } func TestFormatRegionID(t *testing.T) { - actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region" + actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sourceregiontargetregion.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sourceregiontargetregion.go index eaa24e25c65..2112d234a8e 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sourceregiontargetregion.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sourceregiontargetregion.go @@ -127,11 +127,11 @@ func (id SourceRegionTargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSourceRegion", "sourceRegion", "sourceRegion"), - resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegion"), + resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegionName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sourceregiontargetregion_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sourceregiontargetregion_test.go index d96342f3531..9acfe7a194e 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sourceregiontargetregion_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sourceregiontargetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SourceRegionTargetRegionId{} func TestNewSourceRegionTargetRegionID(t *testing.T) { - id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") + id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSourceRegionTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SourceRegionName != "sourceRegion" { - t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegion") + if id.SourceRegionName != "sourceRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegionName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatSourceRegionTargetRegionID(t *testing.T) { - actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion" + actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSourceRegionTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSourceRegionTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SourceRegionName: "sOuRcErEgIoN", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SourceRegionName: "sOuRcErEgIoNnAmE", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sqldatabase.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sqldatabase.go index d92d2bbbf59..21d4f894dd5 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sqldatabase.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sqldatabase.go @@ -121,9 +121,9 @@ func (id SqlDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sqldatabase_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sqldatabase_test.go index f9999bbfaa0..5751b55efa6 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sqldatabase_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_sqldatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlDatabaseId{} func TestNewSqlDatabaseID(t *testing.T) { - id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSqlDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } } func TestFormatSqlDatabaseID(t *testing.T) { - actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName" + actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_storedprocedure.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_storedprocedure.go index 72b9abbafe9..31dd78cfcba 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_storedprocedure.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_storedprocedure.go @@ -133,9 +133,9 @@ func (id StoredProcedureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticStoredProcedures", "storedProcedures", "storedProcedures"), diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_storedprocedure_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_storedprocedure_test.go index ccb86f85be8..602b81d744b 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_storedprocedure_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_storedprocedure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StoredProcedureId{} func TestNewStoredProcedureID(t *testing.T) { - id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") + id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewStoredProcedureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewStoredProcedureID(t *testing.T) { } func TestFormatStoredProcedureID(t *testing.T) { - actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName" + actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseStoredProcedureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseStoredProcedureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", StoredProcedureName: "sToReDpRoCeDuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_table.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_table.go index ecf9d97c31e..db828313697 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_table.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_table_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_table_test.go index 1e9703fdba1..861ecae041b 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_table_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_targetregion.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_targetregion.go index 213d48cf619..c07e6abe2a3 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_targetregion.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_targetregion.go @@ -121,9 +121,9 @@ func (id TargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_targetregion_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_targetregion_test.go index 5a026cdd4cd..636fb4b33f6 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_targetregion_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_targetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TargetRegionId{} func TestNewTargetRegionID(t *testing.T) { - id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") + id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatTargetRegionID(t *testing.T) { - actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion" + actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_trigger.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_trigger.go index 8c6760bfa3d..79ef1f4abbf 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_trigger.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_trigger.go @@ -133,9 +133,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_trigger_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_trigger_test.go index 2033539a5a9..42683f03ca2 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_trigger_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_userdefinedfunction.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_userdefinedfunction.go index c09e749c3cb..eb5d1f446fd 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_userdefinedfunction.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_userdefinedfunction.go @@ -133,9 +133,9 @@ func (id UserDefinedFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticUserDefinedFunctions", "userDefinedFunctions", "userDefinedFunctions"), diff --git a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_userdefinedfunction_test.go b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_userdefinedfunction_test.go index 0f53e3aa1bf..ca957175cbc 100644 --- a/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_userdefinedfunction_test.go +++ b/resource-manager/cosmosdb/2023-09-15/cosmosdb/id_userdefinedfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserDefinedFunctionId{} func TestNewUserDefinedFunctionID(t *testing.T) { - id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") + id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewUserDefinedFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewUserDefinedFunctionID(t *testing.T) { } func TestFormatUserDefinedFunctionID(t *testing.T) { - actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" + actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseUserDefinedFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseUserDefinedFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", UserDefinedFunctionName: "uSeRdEfInEdFuNcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/datatransfer/README.md b/resource-manager/cosmosdb/2023-09-15/datatransfer/README.md index 8e4764b34f8..f47cdd08566 100644 --- a/resource-manager/cosmosdb/2023-09-15/datatransfer/README.md +++ b/resource-manager/cosmosdb/2023-09-15/datatransfer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := datatransfer.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/datatransfer/id_service.go b/resource-manager/cosmosdb/2023-09-15/datatransfer/id_service.go index 6f3fabaa7b7..58fd3f22eb2 100644 --- a/resource-manager/cosmosdb/2023-09-15/datatransfer/id_service.go +++ b/resource-manager/cosmosdb/2023-09-15/datatransfer/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/datatransfer/id_service_test.go b/resource-manager/cosmosdb/2023-09-15/datatransfer/id_service_test.go index accfb95c7e8..b3261c00b8b 100644 --- a/resource-manager/cosmosdb/2023-09-15/datatransfer/id_service_test.go +++ b/resource-manager/cosmosdb/2023-09-15/datatransfer/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/graphapicompute/README.md b/resource-manager/cosmosdb/2023-09-15/graphapicompute/README.md index ede5017dc73..513b1459a20 100644 --- a/resource-manager/cosmosdb/2023-09-15/graphapicompute/README.md +++ b/resource-manager/cosmosdb/2023-09-15/graphapicompute/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := graphapicompute.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/graphapicompute/id_service.go b/resource-manager/cosmosdb/2023-09-15/graphapicompute/id_service.go index 37a699c2693..a4987f4b408 100644 --- a/resource-manager/cosmosdb/2023-09-15/graphapicompute/id_service.go +++ b/resource-manager/cosmosdb/2023-09-15/graphapicompute/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/graphapicompute/id_service_test.go b/resource-manager/cosmosdb/2023-09-15/graphapicompute/id_service_test.go index 20302671509..4be092ed7b2 100644 --- a/resource-manager/cosmosdb/2023-09-15/graphapicompute/id_service_test.go +++ b/resource-manager/cosmosdb/2023-09-15/graphapicompute/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/managedcassandras/README.md b/resource-manager/cosmosdb/2023-09-15/managedcassandras/README.md index 6936515c7a3..31e9206a7e5 100644 --- a/resource-manager/cosmosdb/2023-09-15/managedcassandras/README.md +++ b/resource-manager/cosmosdb/2023-09-15/managedcassandras/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraClustersCreateUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersGet(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.CommandPostBody{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { // handle the error @@ -143,7 +143,7 @@ if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersStatus(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -176,7 +176,7 @@ if err := client.CassandraClustersUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... @@ -193,7 +193,7 @@ if err := client.CassandraDataCentersCreateUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -205,7 +205,7 @@ if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") read, err := client.CassandraDataCentersGet(ctx, id) if err != nil { @@ -221,7 +221,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraDataCentersList(ctx, id) if err != nil { @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... diff --git a/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_cassandracluster.go b/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_cassandracluster.go index 43ce8c1202c..b189a0db128 100644 --- a/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_cassandracluster.go +++ b/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_cassandracluster.go @@ -115,7 +115,7 @@ func (id CassandraClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_cassandracluster_test.go b/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_cassandracluster_test.go index b21a0ee8614..6e99daf02bb 100644 --- a/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_cassandracluster_test.go +++ b/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_cassandracluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraClusterId{} func TestNewCassandraClusterID(t *testing.T) { - id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCassandraClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } } func TestFormatCassandraClusterID(t *testing.T) { - actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName" + actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCassandraClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCassandraClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_datacenter.go b/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_datacenter.go index 8736ef94f6f..5c5a637c822 100644 --- a/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_datacenter.go +++ b/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_datacenter.go @@ -121,7 +121,7 @@ func (id DataCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), resourceids.StaticSegment("staticDataCenters", "dataCenters", "dataCenters"), resourceids.UserSpecifiedSegment("dataCenterName", "dataCenterName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_datacenter_test.go b/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_datacenter_test.go index 66e81bfb94f..e958093a948 100644 --- a/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_datacenter_test.go +++ b/resource-manager/cosmosdb/2023-09-15/managedcassandras/id_datacenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataCenterId{} func TestNewDataCenterID(t *testing.T) { - id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") + id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDataCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } if id.DataCenterName != "dataCenterName" { @@ -32,8 +32,8 @@ func TestNewDataCenterID(t *testing.T) { } func TestFormatDataCenterID(t *testing.T) { - actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName" + actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDataCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDataCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", DataCenterName: "dAtAcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/README.md b/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/README.md index d28e7724db7..f257a8b6efa 100644 --- a/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/README.md +++ b/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := materializedviewsbuilder.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/id_service.go b/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/id_service.go index 3af930e9bc6..2eb7e5e0d31 100644 --- a/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/id_service.go +++ b/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/id_service_test.go b/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/id_service_test.go index 8d14f132a1e..577612d3e07 100644 --- a/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/id_service_test.go +++ b/resource-manager/cosmosdb/2023-09-15/materializedviewsbuilder/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/mongorbacs/README.md b/resource-manager/cosmosdb/2023-09-15/mongorbacs/README.md index b41a73d340f..58e1ccfeb4a 100644 --- a/resource-manager/cosmosdb/2023-09-15/mongorbacs/README.md +++ b/resource-manager/cosmosdb/2023-09-15/mongorbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") payload := mongorbacs.MongoRoleDefinitionCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") payload := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") read, err := client.MongoDBResourcesGetMongoRoleDefinition(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") read, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoRoleDefinitions(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoUserDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_databaseaccount.go index 5dcb902abb5..35b2f7f690f 100644 --- a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_databaseaccount_test.go index 8cf97bbace8..18a73206d20 100644 --- a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbroledefinition.go b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbroledefinition.go index 88c7ce70b53..859adbfb63f 100644 --- a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbroledefinition.go +++ b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbroledefinition.go @@ -121,7 +121,7 @@ func (id MongodbRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbRoleDefinitions", "mongodbRoleDefinitions", "mongodbRoleDefinitions"), resourceids.UserSpecifiedSegment("mongoRoleDefinitionId", "mongoRoleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbroledefinition_test.go b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbroledefinition_test.go index 635bde6bf7f..667a0b36da3 100644 --- a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbroledefinition_test.go +++ b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbRoleDefinitionId{} func TestNewMongodbRoleDefinitionID(t *testing.T) { - id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") + id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoRoleDefinitionId != "mongoRoleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { } func TestFormatMongodbRoleDefinitionID(t *testing.T) { - actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId" + actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoRoleDefinitionId: "mOnGoRoLeDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbuserdefinition.go b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbuserdefinition.go index d3ad61af293..68a38ae9094 100644 --- a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbuserdefinition.go +++ b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbuserdefinition.go @@ -121,7 +121,7 @@ func (id MongodbUserDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbUserDefinitions", "mongodbUserDefinitions", "mongodbUserDefinitions"), resourceids.UserSpecifiedSegment("mongoUserDefinitionId", "mongoUserDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbuserdefinition_test.go b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbuserdefinition_test.go index c89f631908a..eb010d3045a 100644 --- a/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbuserdefinition_test.go +++ b/resource-manager/cosmosdb/2023-09-15/mongorbacs/id_mongodbuserdefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbUserDefinitionId{} func TestNewMongodbUserDefinitionID(t *testing.T) { - id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") + id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoUserDefinitionId != "mongoUserDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { } func TestFormatMongodbUserDefinitionID(t *testing.T) { - actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId" + actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbUserDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbUserDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoUserDefinitionId: "mOnGoUsErDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/README.md b/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/README.md index 2c797c8c300..a9e7db9a16a 100644 --- a/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/README.md +++ b/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := notebookworkspacesresource.ARMProxyResource{ // ... @@ -41,7 +41,7 @@ if err := client.NotebookWorkspacesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListByDatabaseAccount(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListConnectionInfo(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != nil { // handle the error @@ -113,7 +113,7 @@ if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesStartThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/id_databaseaccount.go b/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/id_databaseaccount.go index cc1cfbae97b..48f82ab040b 100644 --- a/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/id_databaseaccount_test.go index 765176e522b..4b238cf57bd 100644 --- a/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-09-15/notebookworkspacesresource/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/README.md b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/README.md index 063801a4a0d..5dd65052953 100644 --- a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/README.md +++ b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_databaseaccount.go b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_databaseaccount.go index 2d03a12f035..0ef32fef9c1 100644 --- a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_databaseaccount_test.go index def6cb01a81..fe0be2f9ad1 100644 --- a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_privateendpointconnection.go index 404b3ec4b99..ad4cd96d133 100644 --- a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_privateendpointconnection_test.go index 616287d8b5e..6f7f6251e0b 100644 --- a/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/cosmosdb/2023-09-15/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/README.md b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/README.md index 22eb3e09e08..f2303e99ee2 100644 --- a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/README.md +++ b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_databaseaccount.go b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_databaseaccount.go index da2cafa82ce..09df5d78d9d 100644 --- a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_databaseaccount_test.go index 54eac6dbdc6..aa4eb501a97 100644 --- a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_privatelinkresource.go b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_privatelinkresource.go index 14bd8a6525e..22240869721 100644 --- a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_privatelinkresource_test.go index df3663505ef..8994ca6277c 100644 --- a/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/cosmosdb/2023-09-15/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/rbacs/README.md b/resource-manager/cosmosdb/2023-09-15/rbacs/README.md index 57391507198..650183b1001 100644 --- a/resource-manager/cosmosdb/2023-09-15/rbacs/README.md +++ b/resource-manager/cosmosdb/2023-09-15/rbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") payload := rbacs.SqlRoleAssignmentCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleAssignmentThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") payload := rbacs.SqlRoleDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleDefinitionThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.SqlResourcesGetSqlRoleAssignment(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") read, err := client.SqlResourcesGetSqlRoleDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleAssignments(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/rbacs/id_account.go b/resource-manager/cosmosdb/2023-09-15/rbacs/id_account.go index 71408ced400..2fd416725b1 100644 --- a/resource-manager/cosmosdb/2023-09-15/rbacs/id_account.go +++ b/resource-manager/cosmosdb/2023-09-15/rbacs/id_account.go @@ -121,7 +121,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleAssignments", "sqlRoleAssignments", "sqlRoleAssignments"), resourceids.ScopeSegment("roleAssignmentId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } diff --git a/resource-manager/cosmosdb/2023-09-15/rbacs/id_account_test.go b/resource-manager/cosmosdb/2023-09-15/rbacs/id_account_test.go index 28a5f3a07bb..ad2c1bacfd4 100644 --- a/resource-manager/cosmosdb/2023-09-15/rbacs/id_account_test.go +++ b/resource-manager/cosmosdb/2023-09-15/rbacs/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleAssignmentId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewAccountID(t *testing.T) { } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,21 +87,21 @@ func TestParseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -223,41 +223,41 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleAssignmentId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/cosmosdb/2023-09-15/rbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2023-09-15/rbacs/id_databaseaccount.go index a75e72bbb29..eea55d3e517 100644 --- a/resource-manager/cosmosdb/2023-09-15/rbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-09-15/rbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/rbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-09-15/rbacs/id_databaseaccount_test.go index f7b7f6e34a5..85257d9182a 100644 --- a/resource-manager/cosmosdb/2023-09-15/rbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-09-15/rbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/rbacs/id_sqlroledefinition.go b/resource-manager/cosmosdb/2023-09-15/rbacs/id_sqlroledefinition.go index 8b5ee24533d..fb415467ab6 100644 --- a/resource-manager/cosmosdb/2023-09-15/rbacs/id_sqlroledefinition.go +++ b/resource-manager/cosmosdb/2023-09-15/rbacs/id_sqlroledefinition.go @@ -121,7 +121,7 @@ func (id SqlRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleDefinitions", "sqlRoleDefinitions", "sqlRoleDefinitions"), resourceids.UserSpecifiedSegment("roleDefinitionId", "roleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-09-15/rbacs/id_sqlroledefinition_test.go b/resource-manager/cosmosdb/2023-09-15/rbacs/id_sqlroledefinition_test.go index e54bbbbe92a..d5f64dcc134 100644 --- a/resource-manager/cosmosdb/2023-09-15/rbacs/id_sqlroledefinition_test.go +++ b/resource-manager/cosmosdb/2023-09-15/rbacs/id_sqlroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlRoleDefinitionId{} func TestNewSqlRoleDefinitionID(t *testing.T) { - id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") + id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleDefinitionId != "roleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { } func TestFormatSqlRoleDefinitionID(t *testing.T) { - actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId" + actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleDefinitionId: "rOlEdEfInItIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/README.md b/resource-manager/cosmosdb/2023-09-15/restorables/README.md index 127c81a1774..13e0f40fc0c 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/README.md +++ b/resource-manager/cosmosdb/2023-09-15/restorables/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -42,7 +42,7 @@ if err := client.GremlinResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -59,7 +59,7 @@ if err := client.MongoDBResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableDatabaseAccountsGetByLocation(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RestorableDatabaseAccountsListByLocation(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinDatabasesList(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinGraphsList(ctx, id, restorables.DefaultRestorableGremlinGraphsListOperationOptions()) if err != nil { @@ -139,7 +139,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinResourcesList(ctx, id, restorables.DefaultRestorableGremlinResourcesListOperationOptions()) if err != nil { @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbCollectionsList(ctx, id, restorables.DefaultRestorableMongodbCollectionsListOperationOptions()) if err != nil { @@ -171,7 +171,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbDatabasesList(ctx, id) if err != nil { @@ -187,7 +187,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbResourcesList(ctx, id, restorables.DefaultRestorableMongodbResourcesListOperationOptions()) if err != nil { @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlContainersList(ctx, id, restorables.DefaultRestorableSqlContainersListOperationOptions()) if err != nil { @@ -219,7 +219,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlDatabasesList(ctx, id) if err != nil { @@ -235,7 +235,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlResourcesList(ctx, id, restorables.DefaultRestorableSqlResourcesListOperationOptions()) if err != nil { @@ -251,7 +251,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTableResourcesList(ctx, id, restorables.DefaultRestorableTableResourcesListOperationOptions()) if err != nil { @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTablesList(ctx, id, restorables.DefaultRestorableTablesListOperationOptions()) if err != nil { @@ -283,7 +283,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -300,7 +300,7 @@ if err := client.SqlResourcesRetrieveContinuousBackupInformationThenPoll(ctx, id ```go ctx := context.TODO() -id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := restorables.ContinuousBackupRestoreLocation{ // ... diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_container.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_container.go index 9398504f72d..cc01b7113aa 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_container.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_container_test.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_container_test.go index 0cea9d939ac..97675cfd2b9 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_container_test.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_graph.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_graph.go index 9904c179afc..b5c11de6742 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_graph.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_graph_test.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_graph_test.go index b604d40e75f..633f0c50588 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_graph_test.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_location.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_location.go index 79632e8074a..c7c3d4a6d23 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_location.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_location_test.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_location_test.go index 00f77288bb6..08c58d5f34f 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_location_test.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_mongodbdatabasecollection.go index c5b408846b1..863a29287de 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_mongodbdatabasecollection_test.go index 846b1efd302..77437dc2f70 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_restorabledatabaseaccount.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_restorabledatabaseaccount.go index 1397a41ed1b..712ea35cfc0 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_restorabledatabaseaccount.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_restorabledatabaseaccount.go @@ -113,7 +113,7 @@ func (id RestorableDatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRestorableDatabaseAccounts", "restorableDatabaseAccounts", "restorableDatabaseAccounts"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_restorabledatabaseaccount_test.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_restorabledatabaseaccount_test.go index 0608b8c7799..9a42672ab61 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_restorabledatabaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_restorabledatabaseaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RestorableDatabaseAccountId{} func TestNewRestorableDatabaseAccountID(t *testing.T) { - id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") + id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InstanceId != "instanceId" { @@ -28,8 +28,8 @@ func TestNewRestorableDatabaseAccountID(t *testing.T) { } func TestFormatRestorableDatabaseAccountID(t *testing.T) { - actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId" + actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRestorableDatabaseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRestorableDatabaseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_table.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_table.go index 9c44038270c..6b9e3c73fa6 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_table.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/restorables/id_table_test.go b/resource-manager/cosmosdb/2023-09-15/restorables/id_table_test.go index d0b8fe67a87..432623c34aa 100644 --- a/resource-manager/cosmosdb/2023-09-15/restorables/id_table_test.go +++ b/resource-manager/cosmosdb/2023-09-15/restorables/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/services/README.md b/resource-manager/cosmosdb/2023-09-15/services/README.md index cabd0850b9d..e15173ae77b 100644 --- a/resource-manager/cosmosdb/2023-09-15/services/README.md +++ b/resource-manager/cosmosdb/2023-09-15/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ServiceList(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/services/id_databaseaccount.go b/resource-manager/cosmosdb/2023-09-15/services/id_databaseaccount.go index d076efa0b15..16e2d04be53 100644 --- a/resource-manager/cosmosdb/2023-09-15/services/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-09-15/services/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-09-15/services/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-09-15/services/id_databaseaccount_test.go index b7ab3d22543..1b08a40dab2 100644 --- a/resource-manager/cosmosdb/2023-09-15/services/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-09-15/services/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/README.md b/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/README.md index bb61a972b0c..029fbfcbc5f 100644 --- a/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/README.md +++ b/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := sqldedicatedgateway.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/id_service.go b/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/id_service.go index fae29f8aa18..f628c9a4812 100644 --- a/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/id_service.go +++ b/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/id_service_test.go b/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/id_service_test.go index 93def5b81b2..4c591e81432 100644 --- a/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/id_service_test.go +++ b/resource-manager/cosmosdb/2023-09-15/sqldedicatedgateway/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/README.md b/resource-manager/cosmosdb/2023-11-15/cosmosdb/README.md index f0c8da58543..8da4e0a42b0 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/README.md +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.CassandraKeyspaceCreateUpdateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.CassandraTableCreateUpdateParameters{ // ... @@ -59,7 +59,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != nil { // handle the error @@ -83,7 +83,7 @@ if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspace(ctx, id) if err != nil { @@ -99,7 +99,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) if err != nil { @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTable(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTableThroughput(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.CassandraResourcesListCassandraKeyspaces(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesListCassandraTables(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -191,7 +191,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThe ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -215,7 +215,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -227,7 +227,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPo ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -244,7 +244,7 @@ if err := client.CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -261,7 +261,7 @@ if err := client.CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetricDefinitions(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetrics(ctx, id, cosmosdb.DefaultCollectionListMetricsOperationOptions()) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListUsages(ctx, id, cosmosdb.DefaultCollectionListUsagesOperationOptions()) if err != nil { @@ -309,7 +309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionListMetricsOperationOptions()) if err != nil { @@ -325,7 +325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListUsages(ctx, id, cosmosdb.DefaultCollectionPartitionListUsagesOperationOptions()) if err != nil { @@ -341,7 +341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionPartitionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionRegionListMetricsOperationOptions()) if err != nil { @@ -357,7 +357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionRegionListMetricsOperationOptions()) if err != nil { @@ -373,7 +373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") +id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") read, err := client.DatabaseAccountRegionListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountRegionListMetricsOperationOptions()) if err != nil { @@ -405,7 +405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountCreateUpdateParameters{ // ... @@ -422,7 +422,7 @@ if err := client.DatabaseAccountsCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -434,7 +434,7 @@ if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.FailoverPolicies{ // ... @@ -451,7 +451,7 @@ if err := client.DatabaseAccountsFailoverPriorityChangeThenPoll(ctx, id, payload ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGet(ctx, id) if err != nil { @@ -467,7 +467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGetReadOnlyKeys(ctx, id) if err != nil { @@ -515,7 +515,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListConnectionStrings(ctx, id) if err != nil { @@ -531,7 +531,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListKeys(ctx, id) if err != nil { @@ -547,7 +547,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetricDefinitions(ctx, id) if err != nil { @@ -563,7 +563,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountsListMetricsOperationOptions()) if err != nil { @@ -579,7 +579,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListReadOnlyKeys(ctx, id) if err != nil { @@ -595,7 +595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListUsages(ctx, id, cosmosdb.DefaultDatabaseAccountsListUsagesOperationOptions()) if err != nil { @@ -611,7 +611,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -628,7 +628,7 @@ if err := client.DatabaseAccountsOfflineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -645,7 +645,7 @@ if err := client.DatabaseAccountsOnlineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountRegenerateKeyParameters{ // ... @@ -662,7 +662,7 @@ if err := client.DatabaseAccountsRegenerateKeyThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountUpdateParameters{ // ... @@ -679,7 +679,7 @@ if err := client.DatabaseAccountsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetricDefinitions(ctx, id) if err != nil { @@ -695,7 +695,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetrics(ctx, id, cosmosdb.DefaultDatabaseListMetricsOperationOptions()) if err != nil { @@ -711,7 +711,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListUsages(ctx, id, cosmosdb.DefaultDatabaseListUsagesOperationOptions()) if err != nil { @@ -727,7 +727,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.GremlinDatabaseCreateUpdateParameters{ // ... @@ -744,7 +744,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.GremlinGraphCreateUpdateParameters{ // ... @@ -761,7 +761,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -773,7 +773,7 @@ if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil { // handle the error @@ -785,7 +785,7 @@ if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabase(ctx, id) if err != nil { @@ -801,7 +801,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabaseThroughput(ctx, id) if err != nil { @@ -817,7 +817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraph(ctx, id) if err != nil { @@ -833,7 +833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraphThroughput(ctx, id) if err != nil { @@ -849,7 +849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.GremlinResourcesListGremlinDatabases(ctx, id) if err != nil { @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesListGremlinGraphs(ctx, id) if err != nil { @@ -881,7 +881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -893,7 +893,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -905,7 +905,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -917,7 +917,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id) ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -929,7 +929,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -946,7 +946,7 @@ if err := client.GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -963,7 +963,7 @@ if err := client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsGet(ctx, id) if err != nil { @@ -995,7 +995,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.MongoDBCollectionCreateUpdateParameters{ // ... @@ -1012,7 +1012,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.MongoDBDatabaseCreateUpdateParameters{ // ... @@ -1029,7 +1029,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err != nil { // handle the error @@ -1041,7 +1041,7 @@ if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err ! ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1053,7 +1053,7 @@ if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollection(ctx, id) if err != nil { @@ -1069,7 +1069,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) if err != nil { @@ -1085,7 +1085,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabase(ctx, id) if err != nil { @@ -1101,7 +1101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) if err != nil { @@ -1117,7 +1117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesListMongoDBCollections(ctx, id) if err != nil { @@ -1133,7 +1133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoDBDatabases(ctx, id) if err != nil { @@ -1149,7 +1149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1161,7 +1161,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1173,7 +1173,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenP ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1185,7 +1185,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1197,7 +1197,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1214,7 +1214,7 @@ if err := client.MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1231,7 +1231,7 @@ if err := client.MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdListMetricsOperationOptions()) if err != nil { @@ -1247,7 +1247,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdRegionListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions()) if err != nil { @@ -1263,7 +1263,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.PercentileListMetrics(ctx, id, cosmosdb.DefaultPercentileListMetricsOperationOptions()) if err != nil { @@ -1279,7 +1279,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") +id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") read, err := client.PercentileSourceTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileSourceTargetListMetricsOperationOptions()) if err != nil { @@ -1295,7 +1295,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") +id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") read, err := client.PercentileTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileTargetListMetricsOperationOptions()) if err != nil { @@ -1311,7 +1311,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") payload := cosmosdb.ClientEncryptionKeyCreateUpdateParameters{ // ... @@ -1328,7 +1328,7 @@ if err := client.SqlResourcesCreateUpdateClientEncryptionKeyThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.SqlContainerCreateUpdateParameters{ // ... @@ -1345,7 +1345,7 @@ if err := client.SqlResourcesCreateUpdateSqlContainerThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.SqlDatabaseCreateUpdateParameters{ // ... @@ -1362,7 +1362,7 @@ if err := client.SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") payload := cosmosdb.SqlStoredProcedureCreateUpdateParameters{ // ... @@ -1379,7 +1379,7 @@ if err := client.SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") payload := cosmosdb.SqlTriggerCreateUpdateParameters{ // ... @@ -1396,7 +1396,7 @@ if err := client.SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") payload := cosmosdb.SqlUserDefinedFunctionCreateUpdateParameters{ // ... @@ -1413,7 +1413,7 @@ if err := client.SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { // handle the error @@ -1425,7 +1425,7 @@ if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1437,7 +1437,7 @@ if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != nil { // handle the error @@ -1449,7 +1449,7 @@ if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != n ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { // handle the error @@ -1461,7 +1461,7 @@ if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err != nil { // handle the error @@ -1473,7 +1473,7 @@ if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") read, err := client.SqlResourcesGetClientEncryptionKey(ctx, id) if err != nil { @@ -1489,7 +1489,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainer(ctx, id) if err != nil { @@ -1505,7 +1505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainerThroughput(ctx, id) if err != nil { @@ -1521,7 +1521,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabase(ctx, id) if err != nil { @@ -1537,7 +1537,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabaseThroughput(ctx, id) if err != nil { @@ -1553,7 +1553,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") read, err := client.SqlResourcesGetSqlStoredProcedure(ctx, id) if err != nil { @@ -1569,7 +1569,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") read, err := client.SqlResourcesGetSqlTrigger(ctx, id) if err != nil { @@ -1585,7 +1585,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") read, err := client.SqlResourcesGetSqlUserDefinedFunction(ctx, id) if err != nil { @@ -1601,7 +1601,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListClientEncryptionKeys(ctx, id) if err != nil { @@ -1617,7 +1617,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListSqlContainers(ctx, id) if err != nil { @@ -1633,7 +1633,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlDatabases(ctx, id) if err != nil { @@ -1649,7 +1649,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlStoredProcedures(ctx, id) if err != nil { @@ -1665,7 +1665,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlTriggers(ctx, id) if err != nil { @@ -1681,7 +1681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlUserDefinedFunctions(ctx, id) if err != nil { @@ -1697,7 +1697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1709,7 +1709,7 @@ if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); er ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1721,7 +1721,7 @@ if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1733,7 +1733,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1745,7 +1745,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1762,7 +1762,7 @@ if err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1779,7 +1779,7 @@ if err := client.SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.TableCreateUpdateParameters{ // ... @@ -1796,7 +1796,7 @@ if err := client.TableResourcesCreateUpdateTableThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { // handle the error @@ -1808,7 +1808,7 @@ if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTable(ctx, id) if err != nil { @@ -1824,7 +1824,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTableThroughput(ctx, id) if err != nil { @@ -1840,7 +1840,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.TableResourcesListTables(ctx, id) if err != nil { @@ -1856,7 +1856,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1868,7 +1868,7 @@ if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1880,7 +1880,7 @@ if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspace.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspace.go index 4ce40124431..c7e797b1802 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspace.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspace.go @@ -121,9 +121,9 @@ func (id CassandraKeyspaceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspace_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspace_test.go index 2c41b074274..1f760780ed8 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspace_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceId{} func TestNewCassandraKeyspaceID(t *testing.T) { - id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") + id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCassandraKeyspaceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } } func TestFormatCassandraKeyspaceID(t *testing.T) { - actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName" + actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCassandraKeyspaceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCassandraKeyspaceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspacetable.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspacetable.go index 939b9bdce12..5609bfaea81 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspacetable.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspacetable.go @@ -127,9 +127,9 @@ func (id CassandraKeyspaceTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspacetable_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspacetable_test.go index 0d6746660eb..de5ca96190f 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspacetable_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_cassandrakeyspacetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceTableId{} func TestNewCassandraKeyspaceTableID(t *testing.T) { - id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") + id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } if id.TableName != "tableName" { @@ -36,8 +36,8 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { } func TestFormatCassandraKeyspaceTableID(t *testing.T) { - actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName" + actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCassandraKeyspaceTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCassandraKeyspaceTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_clientencryptionkey.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_clientencryptionkey.go index edcfeff0f1c..1369551418f 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_clientencryptionkey.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_clientencryptionkey.go @@ -127,9 +127,9 @@ func (id ClientEncryptionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticClientEncryptionKeys", "clientEncryptionKeys", "clientEncryptionKeys"), resourceids.UserSpecifiedSegment("clientEncryptionKeyName", "clientEncryptionKeyName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_clientencryptionkey_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_clientencryptionkey_test.go index 41cdccd06c3..e0353898a57 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_clientencryptionkey_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_clientencryptionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ClientEncryptionKeyId{} func TestNewClientEncryptionKeyID(t *testing.T) { - id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") + id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewClientEncryptionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ClientEncryptionKeyName != "clientEncryptionKeyName" { @@ -36,8 +36,8 @@ func TestNewClientEncryptionKeyID(t *testing.T) { } func TestFormatClientEncryptionKeyID(t *testing.T) { - actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName" + actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseClientEncryptionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseClientEncryptionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ClientEncryptionKeyName: "cLiEnTeNcRyPtIoNkEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collection.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collection.go index 7a48b54fbb3..20b1d5d4051 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collection.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collection.go @@ -127,11 +127,11 @@ func (id CollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collection_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collection_test.go index af80428336c..5d25b21a81e 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collection_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionId{} func TestNewCollectionID(t *testing.T) { - id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") + id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatCollectionID(t *testing.T) { - actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid" + actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go index 0372c743649..a8f1146d844 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collectionpartitionkeyrangeid.go @@ -139,13 +139,13 @@ func (id CollectionPartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go index 51120cbbc59..7a4dd109319 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionPartitionKeyRangeIdId{} func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { - id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -44,8 +44,8 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { } func TestFormatCollectionPartitionKeyRangeIdID(t *testing.T) { - actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseCollectionPartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseCollectionPartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_container.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_container.go index 9fc554842ed..52411ec0fb4 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_container.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_container_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_container_test.go index e4a16015b14..f6673f4842c 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_container_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_database.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_database.go index 32a5b840398..c73ee48b681 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_database.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_database.go @@ -121,9 +121,9 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_database_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_database_test.go index 48cd6308772..c1750285bd3 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_database_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databaseaccount.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databaseaccount.go index 2ca27074b00..dfad7d15d85 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databaseaccount_test.go index a3631600aea..d8132b226fc 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databasecollection.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databasecollection.go index 4029bc74189..81c3be1f181 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databasecollection.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databasecollection.go @@ -133,13 +133,13 @@ func (id DatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databasecollection_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databasecollection_test.go index c2a9406bb53..8d0ed01afa3 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databasecollection_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_databasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseCollectionId{} func TestNewDatabaseCollectionID(t *testing.T) { - id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") + id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatDatabaseCollectionID(t *testing.T) { - actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid" + actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_graph.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_graph.go index 7a55f30993c..e520754fd71 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_graph.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_graph_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_graph_test.go index 54c0bd78a11..1f089c40924 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_graph_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_gremlindatabase.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_gremlindatabase.go index 8bfcc87e575..5ef8dfa4e09 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_gremlindatabase.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_gremlindatabase.go @@ -121,9 +121,9 @@ func (id GremlinDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_gremlindatabase_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_gremlindatabase_test.go index 1750dbc731f..a988d8e29ed 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_gremlindatabase_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_gremlindatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GremlinDatabaseId{} func TestNewGremlinDatabaseID(t *testing.T) { - id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGremlinDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } } func TestFormatGremlinDatabaseID(t *testing.T) { - actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName" + actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGremlinDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGremlinDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_location.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_location.go index febfbe7d88f..483a412e5c7 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_location.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_location_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_location_test.go index c94c6add0bd..803c3f2c435 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_location_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabase.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabase.go index 75875a6ac54..93bc507bbf9 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabase.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabase.go @@ -121,9 +121,9 @@ func (id MongodbDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabase_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabase_test.go index 13fca77bd6a..fbe5814e30c 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabase_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseId{} func TestNewMongodbDatabaseID(t *testing.T) { - id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMongodbDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } } func TestFormatMongodbDatabaseID(t *testing.T) { - actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName" + actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabasecollection.go index 7ddcf2cbb6d..8b233638340 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabasecollection_test.go index b311d450e34..96fb623f632 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_partitionkeyrangeid.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_partitionkeyrangeid.go index 88f0f4a92d5..0f54ae80af9 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_partitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_partitionkeyrangeid.go @@ -133,11 +133,11 @@ func (id PartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_partitionkeyrangeid_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_partitionkeyrangeid_test.go index d96f13f7d9f..d06f8a1ceda 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_partitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_partitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PartitionKeyRangeIdId{} func TestNewPartitionKeyRangeIdID(t *testing.T) { - id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -40,8 +40,8 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { } func TestFormatPartitionKeyRangeIdID(t *testing.T) { - actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParsePartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParsePartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_region.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_region.go index 4f0f50bcdef..36fb36b86d2 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_region.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_region.go @@ -121,9 +121,9 @@ func (id RegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_region_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_region_test.go index 416fa31d29e..45452117088 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_region_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_region_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegionId{} func TestNewRegionID(t *testing.T) { - id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") + id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } } func TestFormatRegionID(t *testing.T) { - actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region" + actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sourceregiontargetregion.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sourceregiontargetregion.go index eaa24e25c65..2112d234a8e 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sourceregiontargetregion.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sourceregiontargetregion.go @@ -127,11 +127,11 @@ func (id SourceRegionTargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSourceRegion", "sourceRegion", "sourceRegion"), - resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegion"), + resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegionName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sourceregiontargetregion_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sourceregiontargetregion_test.go index d96342f3531..9acfe7a194e 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sourceregiontargetregion_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sourceregiontargetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SourceRegionTargetRegionId{} func TestNewSourceRegionTargetRegionID(t *testing.T) { - id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") + id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSourceRegionTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SourceRegionName != "sourceRegion" { - t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegion") + if id.SourceRegionName != "sourceRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegionName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatSourceRegionTargetRegionID(t *testing.T) { - actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion" + actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSourceRegionTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSourceRegionTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SourceRegionName: "sOuRcErEgIoN", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SourceRegionName: "sOuRcErEgIoNnAmE", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sqldatabase.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sqldatabase.go index d92d2bbbf59..21d4f894dd5 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sqldatabase.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sqldatabase.go @@ -121,9 +121,9 @@ func (id SqlDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sqldatabase_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sqldatabase_test.go index f9999bbfaa0..5751b55efa6 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sqldatabase_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_sqldatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlDatabaseId{} func TestNewSqlDatabaseID(t *testing.T) { - id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSqlDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } } func TestFormatSqlDatabaseID(t *testing.T) { - actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName" + actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_storedprocedure.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_storedprocedure.go index 72b9abbafe9..31dd78cfcba 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_storedprocedure.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_storedprocedure.go @@ -133,9 +133,9 @@ func (id StoredProcedureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticStoredProcedures", "storedProcedures", "storedProcedures"), diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_storedprocedure_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_storedprocedure_test.go index ccb86f85be8..602b81d744b 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_storedprocedure_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_storedprocedure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StoredProcedureId{} func TestNewStoredProcedureID(t *testing.T) { - id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") + id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewStoredProcedureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewStoredProcedureID(t *testing.T) { } func TestFormatStoredProcedureID(t *testing.T) { - actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName" + actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseStoredProcedureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseStoredProcedureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", StoredProcedureName: "sToReDpRoCeDuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_table.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_table.go index ecf9d97c31e..db828313697 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_table.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_table_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_table_test.go index 1e9703fdba1..861ecae041b 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_table_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_targetregion.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_targetregion.go index 213d48cf619..c07e6abe2a3 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_targetregion.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_targetregion.go @@ -121,9 +121,9 @@ func (id TargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_targetregion_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_targetregion_test.go index 5a026cdd4cd..636fb4b33f6 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_targetregion_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_targetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TargetRegionId{} func TestNewTargetRegionID(t *testing.T) { - id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") + id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatTargetRegionID(t *testing.T) { - actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion" + actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_trigger.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_trigger.go index 8c6760bfa3d..79ef1f4abbf 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_trigger.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_trigger.go @@ -133,9 +133,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_trigger_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_trigger_test.go index 2033539a5a9..42683f03ca2 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_trigger_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_userdefinedfunction.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_userdefinedfunction.go index c09e749c3cb..eb5d1f446fd 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_userdefinedfunction.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_userdefinedfunction.go @@ -133,9 +133,9 @@ func (id UserDefinedFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticUserDefinedFunctions", "userDefinedFunctions", "userDefinedFunctions"), diff --git a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_userdefinedfunction_test.go b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_userdefinedfunction_test.go index 0f53e3aa1bf..ca957175cbc 100644 --- a/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_userdefinedfunction_test.go +++ b/resource-manager/cosmosdb/2023-11-15/cosmosdb/id_userdefinedfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserDefinedFunctionId{} func TestNewUserDefinedFunctionID(t *testing.T) { - id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") + id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewUserDefinedFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewUserDefinedFunctionID(t *testing.T) { } func TestFormatUserDefinedFunctionID(t *testing.T) { - actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" + actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseUserDefinedFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseUserDefinedFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", UserDefinedFunctionName: "uSeRdEfInEdFuNcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/datatransfer/README.md b/resource-manager/cosmosdb/2023-11-15/datatransfer/README.md index 63594d5ae9f..167ab58d58c 100644 --- a/resource-manager/cosmosdb/2023-11-15/datatransfer/README.md +++ b/resource-manager/cosmosdb/2023-11-15/datatransfer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := datatransfer.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/datatransfer/id_service.go b/resource-manager/cosmosdb/2023-11-15/datatransfer/id_service.go index 6f3fabaa7b7..58fd3f22eb2 100644 --- a/resource-manager/cosmosdb/2023-11-15/datatransfer/id_service.go +++ b/resource-manager/cosmosdb/2023-11-15/datatransfer/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/datatransfer/id_service_test.go b/resource-manager/cosmosdb/2023-11-15/datatransfer/id_service_test.go index accfb95c7e8..b3261c00b8b 100644 --- a/resource-manager/cosmosdb/2023-11-15/datatransfer/id_service_test.go +++ b/resource-manager/cosmosdb/2023-11-15/datatransfer/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/graphapicompute/README.md b/resource-manager/cosmosdb/2023-11-15/graphapicompute/README.md index f9660f53ecc..996e7dc3adb 100644 --- a/resource-manager/cosmosdb/2023-11-15/graphapicompute/README.md +++ b/resource-manager/cosmosdb/2023-11-15/graphapicompute/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := graphapicompute.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/graphapicompute/id_service.go b/resource-manager/cosmosdb/2023-11-15/graphapicompute/id_service.go index 37a699c2693..a4987f4b408 100644 --- a/resource-manager/cosmosdb/2023-11-15/graphapicompute/id_service.go +++ b/resource-manager/cosmosdb/2023-11-15/graphapicompute/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/graphapicompute/id_service_test.go b/resource-manager/cosmosdb/2023-11-15/graphapicompute/id_service_test.go index 20302671509..4be092ed7b2 100644 --- a/resource-manager/cosmosdb/2023-11-15/graphapicompute/id_service_test.go +++ b/resource-manager/cosmosdb/2023-11-15/graphapicompute/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/managedcassandras/README.md b/resource-manager/cosmosdb/2023-11-15/managedcassandras/README.md index cba56674dbe..7d21daf7ffd 100644 --- a/resource-manager/cosmosdb/2023-11-15/managedcassandras/README.md +++ b/resource-manager/cosmosdb/2023-11-15/managedcassandras/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraClustersCreateUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersGet(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.CommandPostBody{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { // handle the error @@ -143,7 +143,7 @@ if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersStatus(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -176,7 +176,7 @@ if err := client.CassandraClustersUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... @@ -193,7 +193,7 @@ if err := client.CassandraDataCentersCreateUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -205,7 +205,7 @@ if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") read, err := client.CassandraDataCentersGet(ctx, id) if err != nil { @@ -221,7 +221,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraDataCentersList(ctx, id) if err != nil { @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... diff --git a/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_cassandracluster.go b/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_cassandracluster.go index 43ce8c1202c..b189a0db128 100644 --- a/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_cassandracluster.go +++ b/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_cassandracluster.go @@ -115,7 +115,7 @@ func (id CassandraClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_cassandracluster_test.go b/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_cassandracluster_test.go index b21a0ee8614..6e99daf02bb 100644 --- a/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_cassandracluster_test.go +++ b/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_cassandracluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraClusterId{} func TestNewCassandraClusterID(t *testing.T) { - id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCassandraClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } } func TestFormatCassandraClusterID(t *testing.T) { - actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName" + actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCassandraClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCassandraClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_datacenter.go b/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_datacenter.go index 8736ef94f6f..5c5a637c822 100644 --- a/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_datacenter.go +++ b/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_datacenter.go @@ -121,7 +121,7 @@ func (id DataCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), resourceids.StaticSegment("staticDataCenters", "dataCenters", "dataCenters"), resourceids.UserSpecifiedSegment("dataCenterName", "dataCenterName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_datacenter_test.go b/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_datacenter_test.go index 66e81bfb94f..e958093a948 100644 --- a/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_datacenter_test.go +++ b/resource-manager/cosmosdb/2023-11-15/managedcassandras/id_datacenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataCenterId{} func TestNewDataCenterID(t *testing.T) { - id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") + id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDataCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } if id.DataCenterName != "dataCenterName" { @@ -32,8 +32,8 @@ func TestNewDataCenterID(t *testing.T) { } func TestFormatDataCenterID(t *testing.T) { - actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName" + actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDataCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDataCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", DataCenterName: "dAtAcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/README.md b/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/README.md index f3e6ed52ade..9fc13dd8325 100644 --- a/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/README.md +++ b/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := materializedviewsbuilder.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/id_service.go b/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/id_service.go index 3af930e9bc6..2eb7e5e0d31 100644 --- a/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/id_service.go +++ b/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/id_service_test.go b/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/id_service_test.go index 8d14f132a1e..577612d3e07 100644 --- a/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/id_service_test.go +++ b/resource-manager/cosmosdb/2023-11-15/materializedviewsbuilder/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/mongorbacs/README.md b/resource-manager/cosmosdb/2023-11-15/mongorbacs/README.md index 135c87255f0..ffca9406bc6 100644 --- a/resource-manager/cosmosdb/2023-11-15/mongorbacs/README.md +++ b/resource-manager/cosmosdb/2023-11-15/mongorbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") payload := mongorbacs.MongoRoleDefinitionCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") payload := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") read, err := client.MongoDBResourcesGetMongoRoleDefinition(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") read, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoRoleDefinitions(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoUserDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_databaseaccount.go index 5dcb902abb5..35b2f7f690f 100644 --- a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_databaseaccount_test.go index 8cf97bbace8..18a73206d20 100644 --- a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbroledefinition.go b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbroledefinition.go index 88c7ce70b53..859adbfb63f 100644 --- a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbroledefinition.go +++ b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbroledefinition.go @@ -121,7 +121,7 @@ func (id MongodbRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbRoleDefinitions", "mongodbRoleDefinitions", "mongodbRoleDefinitions"), resourceids.UserSpecifiedSegment("mongoRoleDefinitionId", "mongoRoleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbroledefinition_test.go b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbroledefinition_test.go index 635bde6bf7f..667a0b36da3 100644 --- a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbroledefinition_test.go +++ b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbRoleDefinitionId{} func TestNewMongodbRoleDefinitionID(t *testing.T) { - id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") + id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoRoleDefinitionId != "mongoRoleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { } func TestFormatMongodbRoleDefinitionID(t *testing.T) { - actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId" + actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoRoleDefinitionId: "mOnGoRoLeDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbuserdefinition.go b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbuserdefinition.go index d3ad61af293..68a38ae9094 100644 --- a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbuserdefinition.go +++ b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbuserdefinition.go @@ -121,7 +121,7 @@ func (id MongodbUserDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbUserDefinitions", "mongodbUserDefinitions", "mongodbUserDefinitions"), resourceids.UserSpecifiedSegment("mongoUserDefinitionId", "mongoUserDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbuserdefinition_test.go b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbuserdefinition_test.go index c89f631908a..eb010d3045a 100644 --- a/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbuserdefinition_test.go +++ b/resource-manager/cosmosdb/2023-11-15/mongorbacs/id_mongodbuserdefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbUserDefinitionId{} func TestNewMongodbUserDefinitionID(t *testing.T) { - id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") + id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoUserDefinitionId != "mongoUserDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { } func TestFormatMongodbUserDefinitionID(t *testing.T) { - actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId" + actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbUserDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbUserDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoUserDefinitionId: "mOnGoUsErDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/README.md b/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/README.md index c9114ad67d2..337236e6f2b 100644 --- a/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/README.md +++ b/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := notebookworkspacesresource.ARMProxyResource{ // ... @@ -41,7 +41,7 @@ if err := client.NotebookWorkspacesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListByDatabaseAccount(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListConnectionInfo(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != nil { // handle the error @@ -113,7 +113,7 @@ if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesStartThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/id_databaseaccount.go b/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/id_databaseaccount.go index cc1cfbae97b..48f82ab040b 100644 --- a/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/id_databaseaccount_test.go index 765176e522b..4b238cf57bd 100644 --- a/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-11-15/notebookworkspacesresource/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/README.md b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/README.md index 154eddbec6e..4d9bdec3c52 100644 --- a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/README.md +++ b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_databaseaccount.go b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_databaseaccount.go index 2d03a12f035..0ef32fef9c1 100644 --- a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_databaseaccount_test.go index def6cb01a81..fe0be2f9ad1 100644 --- a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_privateendpointconnection.go index 404b3ec4b99..ad4cd96d133 100644 --- a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_privateendpointconnection_test.go index 616287d8b5e..6f7f6251e0b 100644 --- a/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/cosmosdb/2023-11-15/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/README.md b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/README.md index c1f0fd1967a..e87a3d10884 100644 --- a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/README.md +++ b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_databaseaccount.go b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_databaseaccount.go index da2cafa82ce..09df5d78d9d 100644 --- a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_databaseaccount_test.go index 54eac6dbdc6..aa4eb501a97 100644 --- a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_privatelinkresource.go b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_privatelinkresource.go index 14bd8a6525e..22240869721 100644 --- a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_privatelinkresource_test.go index df3663505ef..8994ca6277c 100644 --- a/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/cosmosdb/2023-11-15/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/rbacs/README.md b/resource-manager/cosmosdb/2023-11-15/rbacs/README.md index cbb0b6227ad..c68703846d0 100644 --- a/resource-manager/cosmosdb/2023-11-15/rbacs/README.md +++ b/resource-manager/cosmosdb/2023-11-15/rbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") payload := rbacs.SqlRoleAssignmentCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleAssignmentThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") payload := rbacs.SqlRoleDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleDefinitionThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.SqlResourcesGetSqlRoleAssignment(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") read, err := client.SqlResourcesGetSqlRoleDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleAssignments(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/rbacs/id_account.go b/resource-manager/cosmosdb/2023-11-15/rbacs/id_account.go index 71408ced400..2fd416725b1 100644 --- a/resource-manager/cosmosdb/2023-11-15/rbacs/id_account.go +++ b/resource-manager/cosmosdb/2023-11-15/rbacs/id_account.go @@ -121,7 +121,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleAssignments", "sqlRoleAssignments", "sqlRoleAssignments"), resourceids.ScopeSegment("roleAssignmentId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } diff --git a/resource-manager/cosmosdb/2023-11-15/rbacs/id_account_test.go b/resource-manager/cosmosdb/2023-11-15/rbacs/id_account_test.go index 28a5f3a07bb..ad2c1bacfd4 100644 --- a/resource-manager/cosmosdb/2023-11-15/rbacs/id_account_test.go +++ b/resource-manager/cosmosdb/2023-11-15/rbacs/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleAssignmentId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewAccountID(t *testing.T) { } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,21 +87,21 @@ func TestParseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -223,41 +223,41 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleAssignmentId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/cosmosdb/2023-11-15/rbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2023-11-15/rbacs/id_databaseaccount.go index a75e72bbb29..eea55d3e517 100644 --- a/resource-manager/cosmosdb/2023-11-15/rbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-11-15/rbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/rbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-11-15/rbacs/id_databaseaccount_test.go index f7b7f6e34a5..85257d9182a 100644 --- a/resource-manager/cosmosdb/2023-11-15/rbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-11-15/rbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/rbacs/id_sqlroledefinition.go b/resource-manager/cosmosdb/2023-11-15/rbacs/id_sqlroledefinition.go index 8b5ee24533d..fb415467ab6 100644 --- a/resource-manager/cosmosdb/2023-11-15/rbacs/id_sqlroledefinition.go +++ b/resource-manager/cosmosdb/2023-11-15/rbacs/id_sqlroledefinition.go @@ -121,7 +121,7 @@ func (id SqlRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleDefinitions", "sqlRoleDefinitions", "sqlRoleDefinitions"), resourceids.UserSpecifiedSegment("roleDefinitionId", "roleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2023-11-15/rbacs/id_sqlroledefinition_test.go b/resource-manager/cosmosdb/2023-11-15/rbacs/id_sqlroledefinition_test.go index e54bbbbe92a..d5f64dcc134 100644 --- a/resource-manager/cosmosdb/2023-11-15/rbacs/id_sqlroledefinition_test.go +++ b/resource-manager/cosmosdb/2023-11-15/rbacs/id_sqlroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlRoleDefinitionId{} func TestNewSqlRoleDefinitionID(t *testing.T) { - id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") + id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleDefinitionId != "roleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { } func TestFormatSqlRoleDefinitionID(t *testing.T) { - actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId" + actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleDefinitionId: "rOlEdEfInItIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/README.md b/resource-manager/cosmosdb/2023-11-15/restorables/README.md index e8f871b7fda..7109d1a8f48 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/README.md +++ b/resource-manager/cosmosdb/2023-11-15/restorables/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -42,7 +42,7 @@ if err := client.GremlinResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -59,7 +59,7 @@ if err := client.MongoDBResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableDatabaseAccountsGetByLocation(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RestorableDatabaseAccountsListByLocation(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinDatabasesList(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinGraphsList(ctx, id, restorables.DefaultRestorableGremlinGraphsListOperationOptions()) if err != nil { @@ -139,7 +139,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinResourcesList(ctx, id, restorables.DefaultRestorableGremlinResourcesListOperationOptions()) if err != nil { @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbCollectionsList(ctx, id, restorables.DefaultRestorableMongodbCollectionsListOperationOptions()) if err != nil { @@ -171,7 +171,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbDatabasesList(ctx, id) if err != nil { @@ -187,7 +187,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbResourcesList(ctx, id, restorables.DefaultRestorableMongodbResourcesListOperationOptions()) if err != nil { @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlContainersList(ctx, id, restorables.DefaultRestorableSqlContainersListOperationOptions()) if err != nil { @@ -219,7 +219,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlDatabasesList(ctx, id) if err != nil { @@ -235,7 +235,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlResourcesList(ctx, id, restorables.DefaultRestorableSqlResourcesListOperationOptions()) if err != nil { @@ -251,7 +251,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTableResourcesList(ctx, id, restorables.DefaultRestorableTableResourcesListOperationOptions()) if err != nil { @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTablesList(ctx, id, restorables.DefaultRestorableTablesListOperationOptions()) if err != nil { @@ -283,7 +283,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -300,7 +300,7 @@ if err := client.SqlResourcesRetrieveContinuousBackupInformationThenPoll(ctx, id ```go ctx := context.TODO() -id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := restorables.ContinuousBackupRestoreLocation{ // ... diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_container.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_container.go index 9398504f72d..cc01b7113aa 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_container.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_container_test.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_container_test.go index 0cea9d939ac..97675cfd2b9 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_container_test.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_graph.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_graph.go index 9904c179afc..b5c11de6742 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_graph.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_graph_test.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_graph_test.go index b604d40e75f..633f0c50588 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_graph_test.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_location.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_location.go index 79632e8074a..c7c3d4a6d23 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_location.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_location_test.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_location_test.go index 00f77288bb6..08c58d5f34f 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_location_test.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_mongodbdatabasecollection.go index c5b408846b1..863a29287de 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_mongodbdatabasecollection_test.go index 846b1efd302..77437dc2f70 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_restorabledatabaseaccount.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_restorabledatabaseaccount.go index 1397a41ed1b..712ea35cfc0 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_restorabledatabaseaccount.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_restorabledatabaseaccount.go @@ -113,7 +113,7 @@ func (id RestorableDatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRestorableDatabaseAccounts", "restorableDatabaseAccounts", "restorableDatabaseAccounts"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_restorabledatabaseaccount_test.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_restorabledatabaseaccount_test.go index 0608b8c7799..9a42672ab61 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_restorabledatabaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_restorabledatabaseaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RestorableDatabaseAccountId{} func TestNewRestorableDatabaseAccountID(t *testing.T) { - id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") + id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InstanceId != "instanceId" { @@ -28,8 +28,8 @@ func TestNewRestorableDatabaseAccountID(t *testing.T) { } func TestFormatRestorableDatabaseAccountID(t *testing.T) { - actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId" + actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRestorableDatabaseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRestorableDatabaseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_table.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_table.go index 9c44038270c..6b9e3c73fa6 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_table.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/restorables/id_table_test.go b/resource-manager/cosmosdb/2023-11-15/restorables/id_table_test.go index d0b8fe67a87..432623c34aa 100644 --- a/resource-manager/cosmosdb/2023-11-15/restorables/id_table_test.go +++ b/resource-manager/cosmosdb/2023-11-15/restorables/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/services/README.md b/resource-manager/cosmosdb/2023-11-15/services/README.md index dd18139a0ce..0e57a2ed183 100644 --- a/resource-manager/cosmosdb/2023-11-15/services/README.md +++ b/resource-manager/cosmosdb/2023-11-15/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ServiceList(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/services/id_databaseaccount.go b/resource-manager/cosmosdb/2023-11-15/services/id_databaseaccount.go index d076efa0b15..16e2d04be53 100644 --- a/resource-manager/cosmosdb/2023-11-15/services/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2023-11-15/services/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2023-11-15/services/id_databaseaccount_test.go b/resource-manager/cosmosdb/2023-11-15/services/id_databaseaccount_test.go index b7ab3d22543..1b08a40dab2 100644 --- a/resource-manager/cosmosdb/2023-11-15/services/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2023-11-15/services/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/README.md b/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/README.md index f51d0220301..e0c64bd08ea 100644 --- a/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/README.md +++ b/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := sqldedicatedgateway.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/id_service.go b/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/id_service.go index fae29f8aa18..f628c9a4812 100644 --- a/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/id_service.go +++ b/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/id_service_test.go b/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/id_service_test.go index 93def5b81b2..4c591e81432 100644 --- a/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/id_service_test.go +++ b/resource-manager/cosmosdb/2023-11-15/sqldedicatedgateway/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/README.md b/resource-manager/cosmosdb/2024-05-15/cosmosdb/README.md index a8696cd53ee..d67d97bdd9f 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/README.md +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.CassandraKeyspaceCreateUpdateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.CassandraTableCreateUpdateParameters{ // ... @@ -59,7 +59,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != nil { // handle the error @@ -83,7 +83,7 @@ if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspace(ctx, id) if err != nil { @@ -99,7 +99,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) if err != nil { @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTable(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTableThroughput(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.CassandraResourcesListCassandraKeyspaces(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesListCassandraTables(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -191,7 +191,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThe ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -215,7 +215,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -227,7 +227,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPo ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -244,7 +244,7 @@ if err := client.CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -261,7 +261,7 @@ if err := client.CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetricDefinitions(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetrics(ctx, id, cosmosdb.DefaultCollectionListMetricsOperationOptions()) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListUsages(ctx, id, cosmosdb.DefaultCollectionListUsagesOperationOptions()) if err != nil { @@ -309,7 +309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionListMetricsOperationOptions()) if err != nil { @@ -325,7 +325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListUsages(ctx, id, cosmosdb.DefaultCollectionPartitionListUsagesOperationOptions()) if err != nil { @@ -341,7 +341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionPartitionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionRegionListMetricsOperationOptions()) if err != nil { @@ -357,7 +357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionRegionListMetricsOperationOptions()) if err != nil { @@ -373,7 +373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") +id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") read, err := client.DatabaseAccountRegionListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountRegionListMetricsOperationOptions()) if err != nil { @@ -405,7 +405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountCreateUpdateParameters{ // ... @@ -422,7 +422,7 @@ if err := client.DatabaseAccountsCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -434,7 +434,7 @@ if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.FailoverPolicies{ // ... @@ -451,7 +451,7 @@ if err := client.DatabaseAccountsFailoverPriorityChangeThenPoll(ctx, id, payload ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGet(ctx, id) if err != nil { @@ -467,7 +467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGetReadOnlyKeys(ctx, id) if err != nil { @@ -515,7 +515,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListConnectionStrings(ctx, id) if err != nil { @@ -531,7 +531,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListKeys(ctx, id) if err != nil { @@ -547,7 +547,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetricDefinitions(ctx, id) if err != nil { @@ -563,7 +563,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountsListMetricsOperationOptions()) if err != nil { @@ -579,7 +579,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListReadOnlyKeys(ctx, id) if err != nil { @@ -595,7 +595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListUsages(ctx, id, cosmosdb.DefaultDatabaseAccountsListUsagesOperationOptions()) if err != nil { @@ -611,7 +611,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -628,7 +628,7 @@ if err := client.DatabaseAccountsOfflineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -645,7 +645,7 @@ if err := client.DatabaseAccountsOnlineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountRegenerateKeyParameters{ // ... @@ -662,7 +662,7 @@ if err := client.DatabaseAccountsRegenerateKeyThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountUpdateParameters{ // ... @@ -679,7 +679,7 @@ if err := client.DatabaseAccountsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetricDefinitions(ctx, id) if err != nil { @@ -695,7 +695,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetrics(ctx, id, cosmosdb.DefaultDatabaseListMetricsOperationOptions()) if err != nil { @@ -711,7 +711,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListUsages(ctx, id, cosmosdb.DefaultDatabaseListUsagesOperationOptions()) if err != nil { @@ -727,7 +727,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.GremlinDatabaseCreateUpdateParameters{ // ... @@ -744,7 +744,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.GremlinGraphCreateUpdateParameters{ // ... @@ -761,7 +761,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -773,7 +773,7 @@ if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil { // handle the error @@ -785,7 +785,7 @@ if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabase(ctx, id) if err != nil { @@ -801,7 +801,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabaseThroughput(ctx, id) if err != nil { @@ -817,7 +817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraph(ctx, id) if err != nil { @@ -833,7 +833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraphThroughput(ctx, id) if err != nil { @@ -849,7 +849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.GremlinResourcesListGremlinDatabases(ctx, id) if err != nil { @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesListGremlinGraphs(ctx, id) if err != nil { @@ -881,7 +881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -893,7 +893,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -905,7 +905,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -917,7 +917,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id) ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -929,7 +929,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -946,7 +946,7 @@ if err := client.GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -963,7 +963,7 @@ if err := client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsGet(ctx, id) if err != nil { @@ -995,7 +995,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.MongoDBCollectionCreateUpdateParameters{ // ... @@ -1012,7 +1012,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.MongoDBDatabaseCreateUpdateParameters{ // ... @@ -1029,7 +1029,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err != nil { // handle the error @@ -1041,7 +1041,7 @@ if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err ! ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1053,7 +1053,7 @@ if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollection(ctx, id) if err != nil { @@ -1069,7 +1069,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) if err != nil { @@ -1085,7 +1085,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabase(ctx, id) if err != nil { @@ -1101,7 +1101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) if err != nil { @@ -1117,7 +1117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesListMongoDBCollections(ctx, id) if err != nil { @@ -1133,7 +1133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoDBDatabases(ctx, id) if err != nil { @@ -1149,7 +1149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1161,7 +1161,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1173,7 +1173,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenP ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1185,7 +1185,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1197,7 +1197,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1214,7 +1214,7 @@ if err := client.MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1231,7 +1231,7 @@ if err := client.MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdListMetricsOperationOptions()) if err != nil { @@ -1247,7 +1247,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdRegionListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions()) if err != nil { @@ -1263,7 +1263,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.PercentileListMetrics(ctx, id, cosmosdb.DefaultPercentileListMetricsOperationOptions()) if err != nil { @@ -1279,7 +1279,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") +id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") read, err := client.PercentileSourceTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileSourceTargetListMetricsOperationOptions()) if err != nil { @@ -1295,7 +1295,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") +id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") read, err := client.PercentileTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileTargetListMetricsOperationOptions()) if err != nil { @@ -1311,7 +1311,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") payload := cosmosdb.ClientEncryptionKeyCreateUpdateParameters{ // ... @@ -1328,7 +1328,7 @@ if err := client.SqlResourcesCreateUpdateClientEncryptionKeyThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.SqlContainerCreateUpdateParameters{ // ... @@ -1345,7 +1345,7 @@ if err := client.SqlResourcesCreateUpdateSqlContainerThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.SqlDatabaseCreateUpdateParameters{ // ... @@ -1362,7 +1362,7 @@ if err := client.SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") payload := cosmosdb.SqlStoredProcedureCreateUpdateParameters{ // ... @@ -1379,7 +1379,7 @@ if err := client.SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") payload := cosmosdb.SqlTriggerCreateUpdateParameters{ // ... @@ -1396,7 +1396,7 @@ if err := client.SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") payload := cosmosdb.SqlUserDefinedFunctionCreateUpdateParameters{ // ... @@ -1413,7 +1413,7 @@ if err := client.SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { // handle the error @@ -1425,7 +1425,7 @@ if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1437,7 +1437,7 @@ if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != nil { // handle the error @@ -1449,7 +1449,7 @@ if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != n ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { // handle the error @@ -1461,7 +1461,7 @@ if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err != nil { // handle the error @@ -1473,7 +1473,7 @@ if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") read, err := client.SqlResourcesGetClientEncryptionKey(ctx, id) if err != nil { @@ -1489,7 +1489,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainer(ctx, id) if err != nil { @@ -1505,7 +1505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainerThroughput(ctx, id) if err != nil { @@ -1521,7 +1521,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabase(ctx, id) if err != nil { @@ -1537,7 +1537,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabaseThroughput(ctx, id) if err != nil { @@ -1553,7 +1553,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") read, err := client.SqlResourcesGetSqlStoredProcedure(ctx, id) if err != nil { @@ -1569,7 +1569,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") read, err := client.SqlResourcesGetSqlTrigger(ctx, id) if err != nil { @@ -1585,7 +1585,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") read, err := client.SqlResourcesGetSqlUserDefinedFunction(ctx, id) if err != nil { @@ -1601,7 +1601,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListClientEncryptionKeys(ctx, id) if err != nil { @@ -1617,7 +1617,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListSqlContainers(ctx, id) if err != nil { @@ -1633,7 +1633,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlDatabases(ctx, id) if err != nil { @@ -1649,7 +1649,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlStoredProcedures(ctx, id) if err != nil { @@ -1665,7 +1665,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlTriggers(ctx, id) if err != nil { @@ -1681,7 +1681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlUserDefinedFunctions(ctx, id) if err != nil { @@ -1697,7 +1697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1709,7 +1709,7 @@ if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); er ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1721,7 +1721,7 @@ if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1733,7 +1733,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1745,7 +1745,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1762,7 +1762,7 @@ if err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1779,7 +1779,7 @@ if err := client.SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.TableCreateUpdateParameters{ // ... @@ -1796,7 +1796,7 @@ if err := client.TableResourcesCreateUpdateTableThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { // handle the error @@ -1808,7 +1808,7 @@ if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTable(ctx, id) if err != nil { @@ -1824,7 +1824,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTableThroughput(ctx, id) if err != nil { @@ -1840,7 +1840,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.TableResourcesListTables(ctx, id) if err != nil { @@ -1856,7 +1856,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1868,7 +1868,7 @@ if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1880,7 +1880,7 @@ if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspace.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspace.go index 4ce40124431..c7e797b1802 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspace.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspace.go @@ -121,9 +121,9 @@ func (id CassandraKeyspaceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspace_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspace_test.go index 2c41b074274..1f760780ed8 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspace_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceId{} func TestNewCassandraKeyspaceID(t *testing.T) { - id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") + id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCassandraKeyspaceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } } func TestFormatCassandraKeyspaceID(t *testing.T) { - actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName" + actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCassandraKeyspaceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCassandraKeyspaceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspacetable.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspacetable.go index 939b9bdce12..5609bfaea81 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspacetable.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspacetable.go @@ -127,9 +127,9 @@ func (id CassandraKeyspaceTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspacetable_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspacetable_test.go index 0d6746660eb..de5ca96190f 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspacetable_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_cassandrakeyspacetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceTableId{} func TestNewCassandraKeyspaceTableID(t *testing.T) { - id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") + id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } if id.TableName != "tableName" { @@ -36,8 +36,8 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { } func TestFormatCassandraKeyspaceTableID(t *testing.T) { - actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName" + actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCassandraKeyspaceTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCassandraKeyspaceTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_clientencryptionkey.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_clientencryptionkey.go index edcfeff0f1c..1369551418f 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_clientencryptionkey.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_clientencryptionkey.go @@ -127,9 +127,9 @@ func (id ClientEncryptionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticClientEncryptionKeys", "clientEncryptionKeys", "clientEncryptionKeys"), resourceids.UserSpecifiedSegment("clientEncryptionKeyName", "clientEncryptionKeyName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_clientencryptionkey_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_clientencryptionkey_test.go index 41cdccd06c3..e0353898a57 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_clientencryptionkey_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_clientencryptionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ClientEncryptionKeyId{} func TestNewClientEncryptionKeyID(t *testing.T) { - id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") + id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewClientEncryptionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ClientEncryptionKeyName != "clientEncryptionKeyName" { @@ -36,8 +36,8 @@ func TestNewClientEncryptionKeyID(t *testing.T) { } func TestFormatClientEncryptionKeyID(t *testing.T) { - actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName" + actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseClientEncryptionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseClientEncryptionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ClientEncryptionKeyName: "cLiEnTeNcRyPtIoNkEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collection.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collection.go index 7a48b54fbb3..20b1d5d4051 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collection.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collection.go @@ -127,11 +127,11 @@ func (id CollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collection_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collection_test.go index af80428336c..5d25b21a81e 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collection_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionId{} func TestNewCollectionID(t *testing.T) { - id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") + id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatCollectionID(t *testing.T) { - actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid" + actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collectionpartitionkeyrangeid.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collectionpartitionkeyrangeid.go index 0372c743649..a8f1146d844 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collectionpartitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collectionpartitionkeyrangeid.go @@ -139,13 +139,13 @@ func (id CollectionPartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go index 51120cbbc59..7a4dd109319 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionPartitionKeyRangeIdId{} func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { - id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -44,8 +44,8 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { } func TestFormatCollectionPartitionKeyRangeIdID(t *testing.T) { - actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseCollectionPartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseCollectionPartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_container.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_container.go index 9fc554842ed..52411ec0fb4 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_container.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_container_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_container_test.go index e4a16015b14..f6673f4842c 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_container_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_database.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_database.go index 32a5b840398..c73ee48b681 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_database.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_database.go @@ -121,9 +121,9 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_database_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_database_test.go index 48cd6308772..c1750285bd3 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_database_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databaseaccount.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databaseaccount.go index 2ca27074b00..dfad7d15d85 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databaseaccount_test.go index a3631600aea..d8132b226fc 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databasecollection.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databasecollection.go index 4029bc74189..81c3be1f181 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databasecollection.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databasecollection.go @@ -133,13 +133,13 @@ func (id DatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databasecollection_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databasecollection_test.go index c2a9406bb53..8d0ed01afa3 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databasecollection_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_databasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseCollectionId{} func TestNewDatabaseCollectionID(t *testing.T) { - id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") + id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatDatabaseCollectionID(t *testing.T) { - actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid" + actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_graph.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_graph.go index 7a55f30993c..e520754fd71 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_graph.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_graph_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_graph_test.go index 54c0bd78a11..1f089c40924 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_graph_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_gremlindatabase.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_gremlindatabase.go index 8bfcc87e575..5ef8dfa4e09 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_gremlindatabase.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_gremlindatabase.go @@ -121,9 +121,9 @@ func (id GremlinDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_gremlindatabase_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_gremlindatabase_test.go index 1750dbc731f..a988d8e29ed 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_gremlindatabase_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_gremlindatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GremlinDatabaseId{} func TestNewGremlinDatabaseID(t *testing.T) { - id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGremlinDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } } func TestFormatGremlinDatabaseID(t *testing.T) { - actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName" + actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGremlinDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGremlinDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_location.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_location.go index febfbe7d88f..483a412e5c7 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_location.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_location_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_location_test.go index c94c6add0bd..803c3f2c435 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_location_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabase.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabase.go index 75875a6ac54..93bc507bbf9 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabase.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabase.go @@ -121,9 +121,9 @@ func (id MongodbDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabase_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabase_test.go index 13fca77bd6a..fbe5814e30c 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabase_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseId{} func TestNewMongodbDatabaseID(t *testing.T) { - id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMongodbDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } } func TestFormatMongodbDatabaseID(t *testing.T) { - actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName" + actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabasecollection.go index 7ddcf2cbb6d..8b233638340 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabasecollection_test.go index b311d450e34..96fb623f632 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_partitionkeyrangeid.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_partitionkeyrangeid.go index 88f0f4a92d5..0f54ae80af9 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_partitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_partitionkeyrangeid.go @@ -133,11 +133,11 @@ func (id PartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_partitionkeyrangeid_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_partitionkeyrangeid_test.go index d96f13f7d9f..d06f8a1ceda 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_partitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_partitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PartitionKeyRangeIdId{} func TestNewPartitionKeyRangeIdID(t *testing.T) { - id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -40,8 +40,8 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { } func TestFormatPartitionKeyRangeIdID(t *testing.T) { - actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParsePartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParsePartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_region.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_region.go index 4f0f50bcdef..36fb36b86d2 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_region.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_region.go @@ -121,9 +121,9 @@ func (id RegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_region_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_region_test.go index 416fa31d29e..45452117088 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_region_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_region_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegionId{} func TestNewRegionID(t *testing.T) { - id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") + id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } } func TestFormatRegionID(t *testing.T) { - actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region" + actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sourceregiontargetregion.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sourceregiontargetregion.go index eaa24e25c65..2112d234a8e 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sourceregiontargetregion.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sourceregiontargetregion.go @@ -127,11 +127,11 @@ func (id SourceRegionTargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSourceRegion", "sourceRegion", "sourceRegion"), - resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegion"), + resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegionName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sourceregiontargetregion_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sourceregiontargetregion_test.go index d96342f3531..9acfe7a194e 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sourceregiontargetregion_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sourceregiontargetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SourceRegionTargetRegionId{} func TestNewSourceRegionTargetRegionID(t *testing.T) { - id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") + id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSourceRegionTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SourceRegionName != "sourceRegion" { - t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegion") + if id.SourceRegionName != "sourceRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegionName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatSourceRegionTargetRegionID(t *testing.T) { - actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion" + actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSourceRegionTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSourceRegionTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SourceRegionName: "sOuRcErEgIoN", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SourceRegionName: "sOuRcErEgIoNnAmE", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sqldatabase.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sqldatabase.go index d92d2bbbf59..21d4f894dd5 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sqldatabase.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sqldatabase.go @@ -121,9 +121,9 @@ func (id SqlDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sqldatabase_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sqldatabase_test.go index f9999bbfaa0..5751b55efa6 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sqldatabase_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_sqldatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlDatabaseId{} func TestNewSqlDatabaseID(t *testing.T) { - id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSqlDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } } func TestFormatSqlDatabaseID(t *testing.T) { - actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName" + actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_storedprocedure.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_storedprocedure.go index 72b9abbafe9..31dd78cfcba 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_storedprocedure.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_storedprocedure.go @@ -133,9 +133,9 @@ func (id StoredProcedureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticStoredProcedures", "storedProcedures", "storedProcedures"), diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_storedprocedure_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_storedprocedure_test.go index ccb86f85be8..602b81d744b 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_storedprocedure_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_storedprocedure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StoredProcedureId{} func TestNewStoredProcedureID(t *testing.T) { - id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") + id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewStoredProcedureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewStoredProcedureID(t *testing.T) { } func TestFormatStoredProcedureID(t *testing.T) { - actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName" + actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseStoredProcedureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseStoredProcedureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", StoredProcedureName: "sToReDpRoCeDuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_table.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_table.go index ecf9d97c31e..db828313697 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_table.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_table_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_table_test.go index 1e9703fdba1..861ecae041b 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_table_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_targetregion.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_targetregion.go index 213d48cf619..c07e6abe2a3 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_targetregion.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_targetregion.go @@ -121,9 +121,9 @@ func (id TargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_targetregion_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_targetregion_test.go index 5a026cdd4cd..636fb4b33f6 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_targetregion_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_targetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TargetRegionId{} func TestNewTargetRegionID(t *testing.T) { - id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") + id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatTargetRegionID(t *testing.T) { - actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion" + actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_trigger.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_trigger.go index 8c6760bfa3d..79ef1f4abbf 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_trigger.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_trigger.go @@ -133,9 +133,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_trigger_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_trigger_test.go index 2033539a5a9..42683f03ca2 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_trigger_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_userdefinedfunction.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_userdefinedfunction.go index c09e749c3cb..eb5d1f446fd 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_userdefinedfunction.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_userdefinedfunction.go @@ -133,9 +133,9 @@ func (id UserDefinedFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticUserDefinedFunctions", "userDefinedFunctions", "userDefinedFunctions"), diff --git a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_userdefinedfunction_test.go b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_userdefinedfunction_test.go index 0f53e3aa1bf..ca957175cbc 100644 --- a/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_userdefinedfunction_test.go +++ b/resource-manager/cosmosdb/2024-05-15/cosmosdb/id_userdefinedfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserDefinedFunctionId{} func TestNewUserDefinedFunctionID(t *testing.T) { - id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") + id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewUserDefinedFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewUserDefinedFunctionID(t *testing.T) { } func TestFormatUserDefinedFunctionID(t *testing.T) { - actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" + actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseUserDefinedFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseUserDefinedFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", UserDefinedFunctionName: "uSeRdEfInEdFuNcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/datatransfer/README.md b/resource-manager/cosmosdb/2024-05-15/datatransfer/README.md index 830c915368c..174577f9406 100644 --- a/resource-manager/cosmosdb/2024-05-15/datatransfer/README.md +++ b/resource-manager/cosmosdb/2024-05-15/datatransfer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := datatransfer.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/datatransfer/id_service.go b/resource-manager/cosmosdb/2024-05-15/datatransfer/id_service.go index 6f3fabaa7b7..58fd3f22eb2 100644 --- a/resource-manager/cosmosdb/2024-05-15/datatransfer/id_service.go +++ b/resource-manager/cosmosdb/2024-05-15/datatransfer/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/datatransfer/id_service_test.go b/resource-manager/cosmosdb/2024-05-15/datatransfer/id_service_test.go index accfb95c7e8..b3261c00b8b 100644 --- a/resource-manager/cosmosdb/2024-05-15/datatransfer/id_service_test.go +++ b/resource-manager/cosmosdb/2024-05-15/datatransfer/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/graphapicompute/README.md b/resource-manager/cosmosdb/2024-05-15/graphapicompute/README.md index ac93706d4c3..8876f5826f7 100644 --- a/resource-manager/cosmosdb/2024-05-15/graphapicompute/README.md +++ b/resource-manager/cosmosdb/2024-05-15/graphapicompute/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := graphapicompute.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/graphapicompute/id_service.go b/resource-manager/cosmosdb/2024-05-15/graphapicompute/id_service.go index 37a699c2693..a4987f4b408 100644 --- a/resource-manager/cosmosdb/2024-05-15/graphapicompute/id_service.go +++ b/resource-manager/cosmosdb/2024-05-15/graphapicompute/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/graphapicompute/id_service_test.go b/resource-manager/cosmosdb/2024-05-15/graphapicompute/id_service_test.go index 20302671509..4be092ed7b2 100644 --- a/resource-manager/cosmosdb/2024-05-15/graphapicompute/id_service_test.go +++ b/resource-manager/cosmosdb/2024-05-15/graphapicompute/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/managedcassandras/README.md b/resource-manager/cosmosdb/2024-05-15/managedcassandras/README.md index 4208240e3f7..146b0eb86b3 100644 --- a/resource-manager/cosmosdb/2024-05-15/managedcassandras/README.md +++ b/resource-manager/cosmosdb/2024-05-15/managedcassandras/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraClustersCreateUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersGet(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.CommandPostBody{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { // handle the error @@ -143,7 +143,7 @@ if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersStatus(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -176,7 +176,7 @@ if err := client.CassandraClustersUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... @@ -193,7 +193,7 @@ if err := client.CassandraDataCentersCreateUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -205,7 +205,7 @@ if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") read, err := client.CassandraDataCentersGet(ctx, id) if err != nil { @@ -221,7 +221,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraDataCentersList(ctx, id) if err != nil { @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... diff --git a/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_cassandracluster.go b/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_cassandracluster.go index 43ce8c1202c..b189a0db128 100644 --- a/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_cassandracluster.go +++ b/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_cassandracluster.go @@ -115,7 +115,7 @@ func (id CassandraClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_cassandracluster_test.go b/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_cassandracluster_test.go index b21a0ee8614..6e99daf02bb 100644 --- a/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_cassandracluster_test.go +++ b/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_cassandracluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraClusterId{} func TestNewCassandraClusterID(t *testing.T) { - id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCassandraClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } } func TestFormatCassandraClusterID(t *testing.T) { - actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName" + actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCassandraClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCassandraClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_datacenter.go b/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_datacenter.go index 8736ef94f6f..5c5a637c822 100644 --- a/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_datacenter.go +++ b/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_datacenter.go @@ -121,7 +121,7 @@ func (id DataCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), resourceids.StaticSegment("staticDataCenters", "dataCenters", "dataCenters"), resourceids.UserSpecifiedSegment("dataCenterName", "dataCenterName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_datacenter_test.go b/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_datacenter_test.go index 66e81bfb94f..e958093a948 100644 --- a/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_datacenter_test.go +++ b/resource-manager/cosmosdb/2024-05-15/managedcassandras/id_datacenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataCenterId{} func TestNewDataCenterID(t *testing.T) { - id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") + id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDataCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } if id.DataCenterName != "dataCenterName" { @@ -32,8 +32,8 @@ func TestNewDataCenterID(t *testing.T) { } func TestFormatDataCenterID(t *testing.T) { - actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName" + actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDataCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDataCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", DataCenterName: "dAtAcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/README.md b/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/README.md index 0ea9534835e..1bd32e2997e 100644 --- a/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/README.md +++ b/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := materializedviewsbuilder.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/id_service.go b/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/id_service.go index 3af930e9bc6..2eb7e5e0d31 100644 --- a/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/id_service.go +++ b/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/id_service_test.go b/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/id_service_test.go index 8d14f132a1e..577612d3e07 100644 --- a/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/id_service_test.go +++ b/resource-manager/cosmosdb/2024-05-15/materializedviewsbuilder/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/mongorbacs/README.md b/resource-manager/cosmosdb/2024-05-15/mongorbacs/README.md index 5c2d3fd9446..418d92d0894 100644 --- a/resource-manager/cosmosdb/2024-05-15/mongorbacs/README.md +++ b/resource-manager/cosmosdb/2024-05-15/mongorbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") payload := mongorbacs.MongoRoleDefinitionCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") payload := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") read, err := client.MongoDBResourcesGetMongoRoleDefinition(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") read, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoRoleDefinitions(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoUserDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_databaseaccount.go index 5dcb902abb5..35b2f7f690f 100644 --- a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_databaseaccount_test.go index 8cf97bbace8..18a73206d20 100644 --- a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbroledefinition.go b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbroledefinition.go index 88c7ce70b53..859adbfb63f 100644 --- a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbroledefinition.go +++ b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbroledefinition.go @@ -121,7 +121,7 @@ func (id MongodbRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbRoleDefinitions", "mongodbRoleDefinitions", "mongodbRoleDefinitions"), resourceids.UserSpecifiedSegment("mongoRoleDefinitionId", "mongoRoleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbroledefinition_test.go b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbroledefinition_test.go index 635bde6bf7f..667a0b36da3 100644 --- a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbroledefinition_test.go +++ b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbRoleDefinitionId{} func TestNewMongodbRoleDefinitionID(t *testing.T) { - id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") + id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoRoleDefinitionId != "mongoRoleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { } func TestFormatMongodbRoleDefinitionID(t *testing.T) { - actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId" + actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoRoleDefinitionId: "mOnGoRoLeDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbuserdefinition.go b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbuserdefinition.go index d3ad61af293..68a38ae9094 100644 --- a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbuserdefinition.go +++ b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbuserdefinition.go @@ -121,7 +121,7 @@ func (id MongodbUserDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbUserDefinitions", "mongodbUserDefinitions", "mongodbUserDefinitions"), resourceids.UserSpecifiedSegment("mongoUserDefinitionId", "mongoUserDefinitionId"), } diff --git a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbuserdefinition_test.go b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbuserdefinition_test.go index c89f631908a..eb010d3045a 100644 --- a/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbuserdefinition_test.go +++ b/resource-manager/cosmosdb/2024-05-15/mongorbacs/id_mongodbuserdefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbUserDefinitionId{} func TestNewMongodbUserDefinitionID(t *testing.T) { - id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") + id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoUserDefinitionId != "mongoUserDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { } func TestFormatMongodbUserDefinitionID(t *testing.T) { - actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId" + actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbUserDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbUserDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoUserDefinitionId: "mOnGoUsErDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/README.md b/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/README.md index 3b909100661..4dffb3b0cef 100644 --- a/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/README.md +++ b/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := notebookworkspacesresource.ARMProxyResource{ // ... @@ -41,7 +41,7 @@ if err := client.NotebookWorkspacesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListByDatabaseAccount(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListConnectionInfo(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != nil { // handle the error @@ -113,7 +113,7 @@ if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesStartThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/id_databaseaccount.go b/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/id_databaseaccount.go index cc1cfbae97b..48f82ab040b 100644 --- a/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/id_databaseaccount_test.go index 765176e522b..4b238cf57bd 100644 --- a/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-05-15/notebookworkspacesresource/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/README.md b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/README.md index 3f00393f031..a2bfbd90f37 100644 --- a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/README.md +++ b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_databaseaccount.go b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_databaseaccount.go index 2d03a12f035..0ef32fef9c1 100644 --- a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_databaseaccount_test.go index def6cb01a81..fe0be2f9ad1 100644 --- a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_privateendpointconnection.go index 404b3ec4b99..ad4cd96d133 100644 --- a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_privateendpointconnection_test.go index 616287d8b5e..6f7f6251e0b 100644 --- a/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/cosmosdb/2024-05-15/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/README.md b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/README.md index 38412cc7896..126ec53b443 100644 --- a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/README.md +++ b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_databaseaccount.go b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_databaseaccount.go index da2cafa82ce..09df5d78d9d 100644 --- a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_databaseaccount_test.go index 54eac6dbdc6..aa4eb501a97 100644 --- a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_privatelinkresource.go b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_privatelinkresource.go index 14bd8a6525e..22240869721 100644 --- a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_privatelinkresource_test.go index df3663505ef..8994ca6277c 100644 --- a/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/cosmosdb/2024-05-15/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/rbacs/README.md b/resource-manager/cosmosdb/2024-05-15/rbacs/README.md index e092001be36..397d75e60e4 100644 --- a/resource-manager/cosmosdb/2024-05-15/rbacs/README.md +++ b/resource-manager/cosmosdb/2024-05-15/rbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") payload := rbacs.SqlRoleAssignmentCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleAssignmentThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") payload := rbacs.SqlRoleDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleDefinitionThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.SqlResourcesGetSqlRoleAssignment(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") read, err := client.SqlResourcesGetSqlRoleDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleAssignments(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/rbacs/id_account.go b/resource-manager/cosmosdb/2024-05-15/rbacs/id_account.go index 71408ced400..2fd416725b1 100644 --- a/resource-manager/cosmosdb/2024-05-15/rbacs/id_account.go +++ b/resource-manager/cosmosdb/2024-05-15/rbacs/id_account.go @@ -121,7 +121,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleAssignments", "sqlRoleAssignments", "sqlRoleAssignments"), resourceids.ScopeSegment("roleAssignmentId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } diff --git a/resource-manager/cosmosdb/2024-05-15/rbacs/id_account_test.go b/resource-manager/cosmosdb/2024-05-15/rbacs/id_account_test.go index 28a5f3a07bb..ad2c1bacfd4 100644 --- a/resource-manager/cosmosdb/2024-05-15/rbacs/id_account_test.go +++ b/resource-manager/cosmosdb/2024-05-15/rbacs/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleAssignmentId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewAccountID(t *testing.T) { } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,21 +87,21 @@ func TestParseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -223,41 +223,41 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleAssignmentId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/cosmosdb/2024-05-15/rbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2024-05-15/rbacs/id_databaseaccount.go index a75e72bbb29..eea55d3e517 100644 --- a/resource-manager/cosmosdb/2024-05-15/rbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-05-15/rbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/rbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-05-15/rbacs/id_databaseaccount_test.go index f7b7f6e34a5..85257d9182a 100644 --- a/resource-manager/cosmosdb/2024-05-15/rbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-05-15/rbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/rbacs/id_sqlroledefinition.go b/resource-manager/cosmosdb/2024-05-15/rbacs/id_sqlroledefinition.go index 8b5ee24533d..fb415467ab6 100644 --- a/resource-manager/cosmosdb/2024-05-15/rbacs/id_sqlroledefinition.go +++ b/resource-manager/cosmosdb/2024-05-15/rbacs/id_sqlroledefinition.go @@ -121,7 +121,7 @@ func (id SqlRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleDefinitions", "sqlRoleDefinitions", "sqlRoleDefinitions"), resourceids.UserSpecifiedSegment("roleDefinitionId", "roleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2024-05-15/rbacs/id_sqlroledefinition_test.go b/resource-manager/cosmosdb/2024-05-15/rbacs/id_sqlroledefinition_test.go index e54bbbbe92a..d5f64dcc134 100644 --- a/resource-manager/cosmosdb/2024-05-15/rbacs/id_sqlroledefinition_test.go +++ b/resource-manager/cosmosdb/2024-05-15/rbacs/id_sqlroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlRoleDefinitionId{} func TestNewSqlRoleDefinitionID(t *testing.T) { - id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") + id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleDefinitionId != "roleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { } func TestFormatSqlRoleDefinitionID(t *testing.T) { - actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId" + actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleDefinitionId: "rOlEdEfInItIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/README.md b/resource-manager/cosmosdb/2024-05-15/restorables/README.md index d4d3b220ec0..cff1881099a 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/README.md +++ b/resource-manager/cosmosdb/2024-05-15/restorables/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -42,7 +42,7 @@ if err := client.GremlinResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -59,7 +59,7 @@ if err := client.MongoDBResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableDatabaseAccountsGetByLocation(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RestorableDatabaseAccountsListByLocation(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinDatabasesList(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinGraphsList(ctx, id, restorables.DefaultRestorableGremlinGraphsListOperationOptions()) if err != nil { @@ -139,7 +139,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinResourcesList(ctx, id, restorables.DefaultRestorableGremlinResourcesListOperationOptions()) if err != nil { @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbCollectionsList(ctx, id, restorables.DefaultRestorableMongodbCollectionsListOperationOptions()) if err != nil { @@ -171,7 +171,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbDatabasesList(ctx, id) if err != nil { @@ -187,7 +187,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbResourcesList(ctx, id, restorables.DefaultRestorableMongodbResourcesListOperationOptions()) if err != nil { @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlContainersList(ctx, id, restorables.DefaultRestorableSqlContainersListOperationOptions()) if err != nil { @@ -219,7 +219,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlDatabasesList(ctx, id) if err != nil { @@ -235,7 +235,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlResourcesList(ctx, id, restorables.DefaultRestorableSqlResourcesListOperationOptions()) if err != nil { @@ -251,7 +251,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTableResourcesList(ctx, id, restorables.DefaultRestorableTableResourcesListOperationOptions()) if err != nil { @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTablesList(ctx, id, restorables.DefaultRestorableTablesListOperationOptions()) if err != nil { @@ -283,7 +283,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -300,7 +300,7 @@ if err := client.SqlResourcesRetrieveContinuousBackupInformationThenPoll(ctx, id ```go ctx := context.TODO() -id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := restorables.ContinuousBackupRestoreLocation{ // ... diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_container.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_container.go index 9398504f72d..cc01b7113aa 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_container.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_container_test.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_container_test.go index 0cea9d939ac..97675cfd2b9 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_container_test.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_graph.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_graph.go index 9904c179afc..b5c11de6742 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_graph.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_graph_test.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_graph_test.go index b604d40e75f..633f0c50588 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_graph_test.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_location.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_location.go index 79632e8074a..c7c3d4a6d23 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_location.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_location_test.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_location_test.go index 00f77288bb6..08c58d5f34f 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_location_test.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_mongodbdatabasecollection.go index c5b408846b1..863a29287de 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_mongodbdatabasecollection_test.go index 846b1efd302..77437dc2f70 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_restorabledatabaseaccount.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_restorabledatabaseaccount.go index 1397a41ed1b..712ea35cfc0 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_restorabledatabaseaccount.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_restorabledatabaseaccount.go @@ -113,7 +113,7 @@ func (id RestorableDatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRestorableDatabaseAccounts", "restorableDatabaseAccounts", "restorableDatabaseAccounts"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_restorabledatabaseaccount_test.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_restorabledatabaseaccount_test.go index 0608b8c7799..9a42672ab61 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_restorabledatabaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_restorabledatabaseaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RestorableDatabaseAccountId{} func TestNewRestorableDatabaseAccountID(t *testing.T) { - id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") + id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InstanceId != "instanceId" { @@ -28,8 +28,8 @@ func TestNewRestorableDatabaseAccountID(t *testing.T) { } func TestFormatRestorableDatabaseAccountID(t *testing.T) { - actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId" + actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRestorableDatabaseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRestorableDatabaseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_table.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_table.go index 9c44038270c..6b9e3c73fa6 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_table.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/restorables/id_table_test.go b/resource-manager/cosmosdb/2024-05-15/restorables/id_table_test.go index d0b8fe67a87..432623c34aa 100644 --- a/resource-manager/cosmosdb/2024-05-15/restorables/id_table_test.go +++ b/resource-manager/cosmosdb/2024-05-15/restorables/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/services/README.md b/resource-manager/cosmosdb/2024-05-15/services/README.md index 193e82f5a41..935da28f8a6 100644 --- a/resource-manager/cosmosdb/2024-05-15/services/README.md +++ b/resource-manager/cosmosdb/2024-05-15/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ServiceList(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/services/id_databaseaccount.go b/resource-manager/cosmosdb/2024-05-15/services/id_databaseaccount.go index d076efa0b15..16e2d04be53 100644 --- a/resource-manager/cosmosdb/2024-05-15/services/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-05-15/services/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-05-15/services/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-05-15/services/id_databaseaccount_test.go index b7ab3d22543..1b08a40dab2 100644 --- a/resource-manager/cosmosdb/2024-05-15/services/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-05-15/services/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/README.md b/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/README.md index fb2b7a7150e..ec3b92be26f 100644 --- a/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/README.md +++ b/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := sqldedicatedgateway.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/id_service.go b/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/id_service.go index fae29f8aa18..f628c9a4812 100644 --- a/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/id_service.go +++ b/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/id_service_test.go b/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/id_service_test.go index 93def5b81b2..4c591e81432 100644 --- a/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/id_service_test.go +++ b/resource-manager/cosmosdb/2024-05-15/sqldedicatedgateway/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/README.md b/resource-manager/cosmosdb/2024-08-15/cosmosdb/README.md index 762ffb6d39a..7da7765db47 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/README.md +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.CassandraKeyspaceCreateUpdateParameters{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraKeyspaceThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.CassandraTableCreateUpdateParameters{ // ... @@ -59,7 +59,7 @@ if err := client.CassandraResourcesCreateUpdateCassandraTableThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.CassandraResourcesDeleteCassandraKeyspaceThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != nil { // handle the error @@ -83,7 +83,7 @@ if err := client.CassandraResourcesDeleteCassandraTableThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspace(ctx, id) if err != nil { @@ -99,7 +99,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesGetCassandraKeyspaceThroughput(ctx, id) if err != nil { @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTable(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") read, err := client.CassandraResourcesGetCassandraTableThroughput(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.CassandraResourcesListCassandraKeyspaces(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") read, err := client.CassandraResourcesListCassandraTables(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -191,7 +191,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputThe ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -215,7 +215,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -227,7 +227,7 @@ if err := client.CassandraResourcesMigrateCassandraTableToManualThroughputThenPo ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") +id := cosmosdb.NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -244,7 +244,7 @@ if err := client.CassandraResourcesUpdateCassandraKeyspaceThroughputThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") +id := cosmosdb.NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -261,7 +261,7 @@ if err := client.CassandraResourcesUpdateCassandraTableThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetricDefinitions(ctx, id) if err != nil { @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListMetrics(ctx, id, cosmosdb.DefaultCollectionListMetricsOperationOptions()) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionListUsages(ctx, id, cosmosdb.DefaultCollectionListUsagesOperationOptions()) if err != nil { @@ -309,7 +309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionListMetricsOperationOptions()) if err != nil { @@ -325,7 +325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") +id := cosmosdb.NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") read, err := client.CollectionPartitionListUsages(ctx, id, cosmosdb.DefaultCollectionPartitionListUsagesOperationOptions()) if err != nil { @@ -341,7 +341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionPartitionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionPartitionRegionListMetricsOperationOptions()) if err != nil { @@ -357,7 +357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") +id := cosmosdb.NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") read, err := client.CollectionRegionListMetrics(ctx, id, cosmosdb.DefaultCollectionRegionListMetricsOperationOptions()) if err != nil { @@ -373,7 +373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") +id := cosmosdb.NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") read, err := client.DatabaseAccountRegionListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountRegionListMetricsOperationOptions()) if err != nil { @@ -405,7 +405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountCreateUpdateParameters{ // ... @@ -422,7 +422,7 @@ if err := client.DatabaseAccountsCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -434,7 +434,7 @@ if err := client.DatabaseAccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.FailoverPolicies{ // ... @@ -451,7 +451,7 @@ if err := client.DatabaseAccountsFailoverPriorityChangeThenPoll(ctx, id, payload ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGet(ctx, id) if err != nil { @@ -467,7 +467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsGetReadOnlyKeys(ctx, id) if err != nil { @@ -515,7 +515,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListConnectionStrings(ctx, id) if err != nil { @@ -531,7 +531,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListKeys(ctx, id) if err != nil { @@ -547,7 +547,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetricDefinitions(ctx, id) if err != nil { @@ -563,7 +563,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListMetrics(ctx, id, cosmosdb.DefaultDatabaseAccountsListMetricsOperationOptions()) if err != nil { @@ -579,7 +579,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListReadOnlyKeys(ctx, id) if err != nil { @@ -595,7 +595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.DatabaseAccountsListUsages(ctx, id, cosmosdb.DefaultDatabaseAccountsListUsagesOperationOptions()) if err != nil { @@ -611,7 +611,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -628,7 +628,7 @@ if err := client.DatabaseAccountsOfflineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.RegionForOnlineOffline{ // ... @@ -645,7 +645,7 @@ if err := client.DatabaseAccountsOnlineRegionThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountRegenerateKeyParameters{ // ... @@ -662,7 +662,7 @@ if err := client.DatabaseAccountsRegenerateKeyThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := cosmosdb.DatabaseAccountUpdateParameters{ // ... @@ -679,7 +679,7 @@ if err := client.DatabaseAccountsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetricDefinitions(ctx, id) if err != nil { @@ -695,7 +695,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListMetrics(ctx, id, cosmosdb.DefaultDatabaseListMetricsOperationOptions()) if err != nil { @@ -711,7 +711,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") +id := cosmosdb.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") read, err := client.DatabaseListUsages(ctx, id, cosmosdb.DefaultDatabaseListUsagesOperationOptions()) if err != nil { @@ -727,7 +727,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.GremlinDatabaseCreateUpdateParameters{ // ... @@ -744,7 +744,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.GremlinGraphCreateUpdateParameters{ // ... @@ -761,7 +761,7 @@ if err := client.GremlinResourcesCreateUpdateGremlinGraphThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -773,7 +773,7 @@ if err := client.GremlinResourcesDeleteGremlinDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil { // handle the error @@ -785,7 +785,7 @@ if err := client.GremlinResourcesDeleteGremlinGraphThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabase(ctx, id) if err != nil { @@ -801,7 +801,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesGetGremlinDatabaseThroughput(ctx, id) if err != nil { @@ -817,7 +817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraph(ctx, id) if err != nil { @@ -833,7 +833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") read, err := client.GremlinResourcesGetGremlinGraphThroughput(ctx, id) if err != nil { @@ -849,7 +849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.GremlinResourcesListGremlinDatabases(ctx, id) if err != nil { @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") read, err := client.GremlinResourcesListGremlinGraphs(ctx, id) if err != nil { @@ -881,7 +881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -893,7 +893,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -905,7 +905,7 @@ if err := client.GremlinResourcesMigrateGremlinDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -917,7 +917,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToAutoscaleThenPoll(ctx, id) ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -929,7 +929,7 @@ if err := client.GremlinResourcesMigrateGremlinGraphToManualThroughputThenPoll(c ```go ctx := context.TODO() -id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -946,7 +946,7 @@ if err := client.GremlinResourcesUpdateGremlinDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := cosmosdb.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -963,7 +963,7 @@ if err := client.GremlinResourcesUpdateGremlinGraphThroughputThenPoll(ctx, id, p ```go ctx := context.TODO() -id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := cosmosdb.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsGet(ctx, id) if err != nil { @@ -995,7 +995,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.MongoDBCollectionCreateUpdateParameters{ // ... @@ -1012,7 +1012,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBCollectionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.MongoDBDatabaseCreateUpdateParameters{ // ... @@ -1029,7 +1029,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoDBDatabaseThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err != nil { // handle the error @@ -1041,7 +1041,7 @@ if err := client.MongoDBResourcesDeleteMongoDBCollectionThenPoll(ctx, id); err ! ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1053,7 +1053,7 @@ if err := client.MongoDBResourcesDeleteMongoDBDatabaseThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollection(ctx, id) if err != nil { @@ -1069,7 +1069,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") read, err := client.MongoDBResourcesGetMongoDBCollectionThroughput(ctx, id) if err != nil { @@ -1085,7 +1085,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabase(ctx, id) if err != nil { @@ -1101,7 +1101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesGetMongoDBDatabaseThroughput(ctx, id) if err != nil { @@ -1117,7 +1117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") read, err := client.MongoDBResourcesListMongoDBCollections(ctx, id) if err != nil { @@ -1133,7 +1133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoDBDatabases(ctx, id) if err != nil { @@ -1149,7 +1149,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1161,7 +1161,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleThenPoll(ctx ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1173,7 +1173,7 @@ if err := client.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputThenP ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1185,7 +1185,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1197,7 +1197,7 @@ if err := client.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputThenPol ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := cosmosdb.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1214,7 +1214,7 @@ if err := client.MongoDBResourcesUpdateMongoDBCollectionThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1231,7 +1231,7 @@ if err := client.MongoDBResourcesUpdateMongoDBDatabaseThroughputThenPoll(ctx, id ```go ctx := context.TODO() -id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdListMetricsOperationOptions()) if err != nil { @@ -1247,7 +1247,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") +id := cosmosdb.NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") read, err := client.PartitionKeyRangeIdRegionListMetrics(ctx, id, cosmosdb.DefaultPartitionKeyRangeIdRegionListMetricsOperationOptions()) if err != nil { @@ -1263,7 +1263,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.PercentileListMetrics(ctx, id, cosmosdb.DefaultPercentileListMetricsOperationOptions()) if err != nil { @@ -1279,7 +1279,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") +id := cosmosdb.NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") read, err := client.PercentileSourceTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileSourceTargetListMetricsOperationOptions()) if err != nil { @@ -1295,7 +1295,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") +id := cosmosdb.NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") read, err := client.PercentileTargetListMetrics(ctx, id, cosmosdb.DefaultPercentileTargetListMetricsOperationOptions()) if err != nil { @@ -1311,7 +1311,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") payload := cosmosdb.ClientEncryptionKeyCreateUpdateParameters{ // ... @@ -1328,7 +1328,7 @@ if err := client.SqlResourcesCreateUpdateClientEncryptionKeyThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.SqlContainerCreateUpdateParameters{ // ... @@ -1345,7 +1345,7 @@ if err := client.SqlResourcesCreateUpdateSqlContainerThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.SqlDatabaseCreateUpdateParameters{ // ... @@ -1362,7 +1362,7 @@ if err := client.SqlResourcesCreateUpdateSqlDatabaseThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") payload := cosmosdb.SqlStoredProcedureCreateUpdateParameters{ // ... @@ -1379,7 +1379,7 @@ if err := client.SqlResourcesCreateUpdateSqlStoredProcedureThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") payload := cosmosdb.SqlTriggerCreateUpdateParameters{ // ... @@ -1396,7 +1396,7 @@ if err := client.SqlResourcesCreateUpdateSqlTriggerThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") payload := cosmosdb.SqlUserDefinedFunctionCreateUpdateParameters{ // ... @@ -1413,7 +1413,7 @@ if err := client.SqlResourcesCreateUpdateSqlUserDefinedFunctionThenPoll(ctx, id, ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { // handle the error @@ -1425,7 +1425,7 @@ if err := client.SqlResourcesDeleteSqlContainerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { // handle the error @@ -1437,7 +1437,7 @@ if err := client.SqlResourcesDeleteSqlDatabaseThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != nil { // handle the error @@ -1449,7 +1449,7 @@ if err := client.SqlResourcesDeleteSqlStoredProcedureThenPoll(ctx, id); err != n ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { // handle the error @@ -1461,7 +1461,7 @@ if err := client.SqlResourcesDeleteSqlTriggerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err != nil { // handle the error @@ -1473,7 +1473,7 @@ if err := client.SqlResourcesDeleteSqlUserDefinedFunctionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") +id := cosmosdb.NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") read, err := client.SqlResourcesGetClientEncryptionKey(ctx, id) if err != nil { @@ -1489,7 +1489,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainer(ctx, id) if err != nil { @@ -1505,7 +1505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesGetSqlContainerThroughput(ctx, id) if err != nil { @@ -1521,7 +1521,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabase(ctx, id) if err != nil { @@ -1537,7 +1537,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesGetSqlDatabaseThroughput(ctx, id) if err != nil { @@ -1553,7 +1553,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") +id := cosmosdb.NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") read, err := client.SqlResourcesGetSqlStoredProcedure(ctx, id) if err != nil { @@ -1569,7 +1569,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") +id := cosmosdb.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") read, err := client.SqlResourcesGetSqlTrigger(ctx, id) if err != nil { @@ -1585,7 +1585,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") +id := cosmosdb.NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") read, err := client.SqlResourcesGetSqlUserDefinedFunction(ctx, id) if err != nil { @@ -1601,7 +1601,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListClientEncryptionKeys(ctx, id) if err != nil { @@ -1617,7 +1617,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") read, err := client.SqlResourcesListSqlContainers(ctx, id) if err != nil { @@ -1633,7 +1633,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlDatabases(ctx, id) if err != nil { @@ -1649,7 +1649,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlStoredProcedures(ctx, id) if err != nil { @@ -1665,7 +1665,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlTriggers(ctx, id) if err != nil { @@ -1681,7 +1681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") read, err := client.SqlResourcesListSqlUserDefinedFunctions(ctx, id) if err != nil { @@ -1697,7 +1697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1709,7 +1709,7 @@ if err := client.SqlResourcesMigrateSqlContainerToAutoscaleThenPoll(ctx, id); er ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1721,7 +1721,7 @@ if err := client.SqlResourcesMigrateSqlContainerToManualThroughputThenPoll(ctx, ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1733,7 +1733,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToAutoscaleThenPoll(ctx, id); err ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1745,7 +1745,7 @@ if err := client.SqlResourcesMigrateSqlDatabaseToManualThroughputThenPoll(ctx, i ```go ctx := context.TODO() -id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := cosmosdb.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1762,7 +1762,7 @@ if err := client.SqlResourcesUpdateSqlContainerThroughputThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") +id := cosmosdb.NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... @@ -1779,7 +1779,7 @@ if err := client.SqlResourcesUpdateSqlDatabaseThroughputThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.TableCreateUpdateParameters{ // ... @@ -1796,7 +1796,7 @@ if err := client.TableResourcesCreateUpdateTableThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { // handle the error @@ -1808,7 +1808,7 @@ if err := client.TableResourcesDeleteTableThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTable(ctx, id) if err != nil { @@ -1824,7 +1824,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") read, err := client.TableResourcesGetTableThroughput(ctx, id) if err != nil { @@ -1840,7 +1840,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := cosmosdb.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.TableResourcesListTables(ctx, id) if err != nil { @@ -1856,7 +1856,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != nil { // handle the error @@ -1868,7 +1868,7 @@ if err := client.TableResourcesMigrateTableToAutoscaleThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); err != nil { // handle the error @@ -1880,7 +1880,7 @@ if err := client.TableResourcesMigrateTableToManualThroughputThenPoll(ctx, id); ```go ctx := context.TODO() -id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := cosmosdb.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := cosmosdb.ThroughputSettingsUpdateParameters{ // ... diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspace.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspace.go index 4ce40124431..c7e797b1802 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspace.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspace.go @@ -121,9 +121,9 @@ func (id CassandraKeyspaceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspace_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspace_test.go index 2c41b074274..1f760780ed8 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspace_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceId{} func TestNewCassandraKeyspaceID(t *testing.T) { - id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName") + id := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCassandraKeyspaceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } } func TestFormatCassandraKeyspaceID(t *testing.T) { - actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName" + actual := NewCassandraKeyspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCassandraKeyspaceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCassandraKeyspaceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Expected: &CassandraKeyspaceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspacetable.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspacetable.go index 939b9bdce12..5609bfaea81 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspacetable.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspacetable.go @@ -127,9 +127,9 @@ func (id CassandraKeyspaceTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticCassandraKeyspaces", "cassandraKeyspaces", "cassandraKeyspaces"), - resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "keyspaceName"), + resourceids.UserSpecifiedSegment("cassandraKeyspaceName", "cassandraKeyspaceName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspacetable_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspacetable_test.go index 0d6746660eb..de5ca96190f 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspacetable_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_cassandrakeyspacetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraKeyspaceTableId{} func TestNewCassandraKeyspaceTableID(t *testing.T) { - id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName") + id := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.CassandraKeyspaceName != "keyspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "keyspaceName") + if id.CassandraKeyspaceName != "cassandraKeyspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraKeyspaceName'", id.CassandraKeyspaceName, "cassandraKeyspaceName") } if id.TableName != "tableName" { @@ -36,8 +36,8 @@ func TestNewCassandraKeyspaceTableID(t *testing.T) { } func TestFormatCassandraKeyspaceTableID(t *testing.T) { - actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "keyspaceName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName" + actual := NewCassandraKeyspaceTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "cassandraKeyspaceName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCassandraKeyspaceTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCassandraKeyspaceTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - CassandraKeyspaceName: "keyspaceName", + DatabaseAccountName: "databaseAccountName", + CassandraKeyspaceName: "cassandraKeyspaceName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/cassandraKeyspaces/keyspaceName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/cassandraKeyspaces/cassandraKeyspaceName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe", Expected: &CassandraKeyspaceTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - CassandraKeyspaceName: "kEySpAcEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + CassandraKeyspaceName: "cAsSaNdRaKeYsPaCeNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/kEySpAcEnAmE/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/cAsSaNdRaKeYsPaCeS/cAsSaNdRaKeYsPaCeNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_clientencryptionkey.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_clientencryptionkey.go index edcfeff0f1c..1369551418f 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_clientencryptionkey.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_clientencryptionkey.go @@ -127,9 +127,9 @@ func (id ClientEncryptionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticClientEncryptionKeys", "clientEncryptionKeys", "clientEncryptionKeys"), resourceids.UserSpecifiedSegment("clientEncryptionKeyName", "clientEncryptionKeyName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_clientencryptionkey_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_clientencryptionkey_test.go index 41cdccd06c3..e0353898a57 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_clientencryptionkey_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_clientencryptionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ClientEncryptionKeyId{} func TestNewClientEncryptionKeyID(t *testing.T) { - id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName") + id := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewClientEncryptionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ClientEncryptionKeyName != "clientEncryptionKeyName" { @@ -36,8 +36,8 @@ func TestNewClientEncryptionKeyID(t *testing.T) { } func TestFormatClientEncryptionKeyID(t *testing.T) { - actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "clientEncryptionKeyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName" + actual := NewClientEncryptionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "clientEncryptionKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseClientEncryptionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseClientEncryptionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ClientEncryptionKeyName: "clientEncryptionKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/clientEncryptionKeys/clientEncryptionKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe", Expected: &ClientEncryptionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ClientEncryptionKeyName: "cLiEnTeNcRyPtIoNkEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cLiEnTeNcRyPtIoNkEyS/cLiEnTeNcRyPtIoNkEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collection.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collection.go index 7a48b54fbb3..20b1d5d4051 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collection.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collection.go @@ -127,11 +127,11 @@ func (id CollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collection_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collection_test.go index af80428336c..5d25b21a81e 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collection_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionId{} func TestNewCollectionID(t *testing.T) { - id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid") + id := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatCollectionID(t *testing.T) { - actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid" + actual := NewCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &CollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collectionpartitionkeyrangeid.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collectionpartitionkeyrangeid.go index 0372c743649..a8f1146d844 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collectionpartitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collectionpartitionkeyrangeid.go @@ -139,13 +139,13 @@ func (id CollectionPartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go index 51120cbbc59..7a4dd109319 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_collectionpartitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CollectionPartitionKeyRangeIdId{} func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { - id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -44,8 +44,8 @@ func TestNewCollectionPartitionKeyRangeIdID(t *testing.T) { } func TestFormatCollectionPartitionKeyRangeIdID(t *testing.T) { - actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewCollectionPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseCollectionPartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseCollectionPartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &CollectionPartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_container.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_container.go index 9fc554842ed..52411ec0fb4 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_container.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_container_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_container_test.go index e4a16015b14..f6673f4842c 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_container_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_database.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_database.go index 32a5b840398..c73ee48b681 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_database.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_database.go @@ -121,9 +121,9 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_database_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_database_test.go index 48cd6308772..c1750285bd3 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_database_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databaseaccount.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databaseaccount.go index 2ca27074b00..dfad7d15d85 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databaseaccount_test.go index a3631600aea..d8132b226fc 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databasecollection.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databasecollection.go index 4029bc74189..81c3be1f181 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databasecollection.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databasecollection.go @@ -133,13 +133,13 @@ func (id DatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databasecollection_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databasecollection_test.go index c2a9406bb53..8d0ed01afa3 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databasecollection_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_databasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseCollectionId{} func TestNewDatabaseCollectionID(t *testing.T) { - id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid") + id := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } } func TestFormatDatabaseCollectionID(t *testing.T) { - actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region", "databaseRid", "collectionRid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid" + actual := NewDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName", "databaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", + DatabaseName: "databaseName", + CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/databases/databaseRid/collections/collectionRid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/databases/databaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &DatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_graph.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_graph.go index 7a55f30993c..e520754fd71 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_graph.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_graph_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_graph_test.go index 54c0bd78a11..1f089c40924 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_graph_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_gremlindatabase.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_gremlindatabase.go index 8bfcc87e575..5ef8dfa4e09 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_gremlindatabase.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_gremlindatabase.go @@ -121,9 +121,9 @@ func (id GremlinDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_gremlindatabase_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_gremlindatabase_test.go index 1750dbc731f..a988d8e29ed 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_gremlindatabase_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_gremlindatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GremlinDatabaseId{} func TestNewGremlinDatabaseID(t *testing.T) { - id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGremlinDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } } func TestFormatGremlinDatabaseID(t *testing.T) { - actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName" + actual := NewGremlinDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGremlinDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGremlinDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Expected: &GremlinDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_location.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_location.go index febfbe7d88f..483a412e5c7 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_location.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_location_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_location_test.go index c94c6add0bd..803c3f2c435 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_location_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabase.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabase.go index 75875a6ac54..93bc507bbf9 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabase.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabase.go @@ -121,9 +121,9 @@ func (id MongodbDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabase_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabase_test.go index 13fca77bd6a..fbe5814e30c 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabase_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseId{} func TestNewMongodbDatabaseID(t *testing.T) { - id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMongodbDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } } func TestFormatMongodbDatabaseID(t *testing.T) { - actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName" + actual := NewMongodbDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Expected: &MongodbDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabasecollection.go index 7ddcf2cbb6d..8b233638340 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabasecollection_test.go index b311d450e34..96fb623f632 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_partitionkeyrangeid.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_partitionkeyrangeid.go index 88f0f4a92d5..0f54ae80af9 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_partitionkeyrangeid.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_partitionkeyrangeid.go @@ -133,11 +133,11 @@ func (id PartitionKeyRangeIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), - resourceids.UserSpecifiedSegment("databaseName", "databaseRid"), + resourceids.UserSpecifiedSegment("databaseName", "databaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), - resourceids.UserSpecifiedSegment("collectionName", "collectionRid"), + resourceids.UserSpecifiedSegment("collectionName", "collectionName"), resourceids.StaticSegment("staticPartitionKeyRangeId", "partitionKeyRangeId", "partitionKeyRangeId"), resourceids.UserSpecifiedSegment("partitionKeyRangeId", "partitionKeyRangeId"), } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_partitionkeyrangeid_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_partitionkeyrangeid_test.go index d96f13f7d9f..d06f8a1ceda 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_partitionkeyrangeid_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_partitionkeyrangeid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PartitionKeyRangeIdId{} func TestNewPartitionKeyRangeIdID(t *testing.T) { - id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId") + id := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.DatabaseName != "databaseRid" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseRid") + if id.DatabaseName != "databaseName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.CollectionName != "collectionRid" { - t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionRid") + if id.CollectionName != "collectionName" { + t.Fatalf("Expected %q but got %q for Segment 'CollectionName'", id.CollectionName, "collectionName") } if id.PartitionKeyRangeId != "partitionKeyRangeId" { @@ -40,8 +40,8 @@ func TestNewPartitionKeyRangeIdID(t *testing.T) { } func TestFormatPartitionKeyRangeIdID(t *testing.T) { - actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseRid", "collectionRid", "partitionKeyRangeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId" + actual := NewPartitionKeyRangeIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "databaseName", "collectionName", "partitionKeyRangeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParsePartitionKeyRangeIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParsePartitionKeyRangeIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - DatabaseName: "databaseRid", - CollectionName: "collectionRid", + DatabaseAccountName: "databaseAccountName", + DatabaseName: "databaseName", + CollectionName: "collectionName", PartitionKeyRangeId: "partitionKeyRangeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/databases/databaseRid/collections/collectionRid/partitionKeyRangeId/partitionKeyRangeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/databases/databaseName/collections/collectionName/partitionKeyRangeId/partitionKeyRangeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId", Expected: &PartitionKeyRangeIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - DatabaseName: "dAtAbAsErId", - CollectionName: "cOlLeCtIoNrId", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + DatabaseName: "dAtAbAsEnAmE", + CollectionName: "cOlLeCtIoNnAmE", PartitionKeyRangeId: "pArTiTiOnKeYrAnGeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/dAtAbAsEs/dAtAbAsErId/cOlLeCtIoNs/cOlLeCtIoNrId/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/dAtAbAsEs/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/pArTiTiOnKeYrAnGeId/pArTiTiOnKeYrAnGeId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_region.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_region.go index 4f0f50bcdef..36fb36b86d2 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_region.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_region.go @@ -121,9 +121,9 @@ func (id RegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticRegion", "region", "region"), - resourceids.UserSpecifiedSegment("regionName", "region"), + resourceids.UserSpecifiedSegment("regionName", "regionName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_region_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_region_test.go index 416fa31d29e..45452117088 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_region_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_region_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegionId{} func TestNewRegionID(t *testing.T) { - id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region") + id := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.RegionName != "region" { - t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "region") + if id.RegionName != "regionName" { + t.Fatalf("Expected %q but got %q for Segment 'RegionName'", id.RegionName, "regionName") } } func TestFormatRegionID(t *testing.T) { - actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "region").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region" + actual := NewRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "regionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - RegionName: "region", + DatabaseAccountName: "databaseAccountName", + RegionName: "regionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/region/region/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/region/regionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE", Expected: &RegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - RegionName: "rEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + RegionName: "rEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/rEgIoN/rEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/rEgIoN/rEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sourceregiontargetregion.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sourceregiontargetregion.go index eaa24e25c65..2112d234a8e 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sourceregiontargetregion.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sourceregiontargetregion.go @@ -127,11 +127,11 @@ func (id SourceRegionTargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSourceRegion", "sourceRegion", "sourceRegion"), - resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegion"), + resourceids.UserSpecifiedSegment("sourceRegionName", "sourceRegionName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sourceregiontargetregion_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sourceregiontargetregion_test.go index d96342f3531..9acfe7a194e 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sourceregiontargetregion_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sourceregiontargetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SourceRegionTargetRegionId{} func TestNewSourceRegionTargetRegionID(t *testing.T) { - id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion") + id := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSourceRegionTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SourceRegionName != "sourceRegion" { - t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegion") + if id.SourceRegionName != "sourceRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceRegionName'", id.SourceRegionName, "sourceRegionName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatSourceRegionTargetRegionID(t *testing.T) { - actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "sourceRegion", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion" + actual := NewSourceRegionTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sourceRegionName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSourceRegionTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSourceRegionTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SourceRegionName: "sourceRegion", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + SourceRegionName: "sourceRegionName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sourceRegion/sourceRegion/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sourceRegion/sourceRegionName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &SourceRegionTargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SourceRegionName: "sOuRcErEgIoN", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SourceRegionName: "sOuRcErEgIoNnAmE", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoN/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sOuRcErEgIoN/sOuRcErEgIoNnAmE/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sqldatabase.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sqldatabase.go index d92d2bbbf59..21d4f894dd5 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sqldatabase.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sqldatabase.go @@ -121,9 +121,9 @@ func (id SqlDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sqldatabase_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sqldatabase_test.go index f9999bbfaa0..5751b55efa6 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sqldatabase_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_sqldatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlDatabaseId{} func TestNewSqlDatabaseID(t *testing.T) { - id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName") + id := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSqlDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } } func TestFormatSqlDatabaseID(t *testing.T) { - actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName" + actual := NewSqlDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Expected: &SqlDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_storedprocedure.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_storedprocedure.go index 72b9abbafe9..31dd78cfcba 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_storedprocedure.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_storedprocedure.go @@ -133,9 +133,9 @@ func (id StoredProcedureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticStoredProcedures", "storedProcedures", "storedProcedures"), diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_storedprocedure_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_storedprocedure_test.go index ccb86f85be8..602b81d744b 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_storedprocedure_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_storedprocedure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StoredProcedureId{} func TestNewStoredProcedureID(t *testing.T) { - id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName") + id := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewStoredProcedureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewStoredProcedureID(t *testing.T) { } func TestFormatStoredProcedureID(t *testing.T) { - actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "storedProcedureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName" + actual := NewStoredProcedureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "storedProcedureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseStoredProcedureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseStoredProcedureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", StoredProcedureName: "storedProcedureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/storedProcedures/storedProcedureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/storedProcedures/storedProcedureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe", Expected: &StoredProcedureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", StoredProcedureName: "sToReDpRoCeDuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/sToReDpRoCeDuReS/sToReDpRoCeDuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_table.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_table.go index ecf9d97c31e..db828313697 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_table.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_table_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_table_test.go index 1e9703fdba1..861ecae041b 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_table_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_targetregion.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_targetregion.go index 213d48cf619..c07e6abe2a3 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_targetregion.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_targetregion.go @@ -121,9 +121,9 @@ func (id TargetRegionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTargetRegion", "targetRegion", "targetRegion"), - resourceids.UserSpecifiedSegment("targetRegionName", "targetRegion"), + resourceids.UserSpecifiedSegment("targetRegionName", "targetRegionName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_targetregion_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_targetregion_test.go index 5a026cdd4cd..636fb4b33f6 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_targetregion_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_targetregion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TargetRegionId{} func TestNewTargetRegionID(t *testing.T) { - id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion") + id := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTargetRegionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.TargetRegionName != "targetRegion" { - t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegion") + if id.TargetRegionName != "targetRegionName" { + t.Fatalf("Expected %q but got %q for Segment 'TargetRegionName'", id.TargetRegionName, "targetRegionName") } } func TestFormatTargetRegionID(t *testing.T) { - actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "targetRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion" + actual := NewTargetRegionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "targetRegionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTargetRegionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTargetRegionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - TargetRegionName: "targetRegion", + DatabaseAccountName: "databaseAccountName", + TargetRegionName: "targetRegionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/targetRegion/targetRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/targetRegion/targetRegionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE", Expected: &TargetRegionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - TargetRegionName: "tArGeTrEgIoN", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + TargetRegionName: "tArGeTrEgIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tArGeTrEgIoN/tArGeTrEgIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_trigger.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_trigger.go index 8c6760bfa3d..79ef1f4abbf 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_trigger.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_trigger.go @@ -133,9 +133,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_trigger_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_trigger_test.go index 2033539a5a9..42683f03ca2 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_trigger_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_userdefinedfunction.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_userdefinedfunction.go index c09e749c3cb..eb5d1f446fd 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_userdefinedfunction.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_userdefinedfunction.go @@ -133,9 +133,9 @@ func (id UserDefinedFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), resourceids.StaticSegment("staticUserDefinedFunctions", "userDefinedFunctions", "userDefinedFunctions"), diff --git a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_userdefinedfunction_test.go b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_userdefinedfunction_test.go index 0f53e3aa1bf..ca957175cbc 100644 --- a/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_userdefinedfunction_test.go +++ b/resource-manager/cosmosdb/2024-08-15/cosmosdb/id_userdefinedfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserDefinedFunctionId{} func TestNewUserDefinedFunctionID(t *testing.T) { - id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName") + id := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewUserDefinedFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -40,8 +40,8 @@ func TestNewUserDefinedFunctionID(t *testing.T) { } func TestFormatUserDefinedFunctionID(t *testing.T) { - actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName", "userDefinedFunctionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" + actual := NewUserDefinedFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName", "userDefinedFunctionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseUserDefinedFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseUserDefinedFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", UserDefinedFunctionName: "userDefinedFunctionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/userDefinedFunctions/userDefinedFunctionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe", Expected: &UserDefinedFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", UserDefinedFunctionName: "uSeRdEfInEdFuNcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/uSeRdEfInEdFuNcTiOnS/uSeRdEfInEdFuNcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/datatransfer/README.md b/resource-manager/cosmosdb/2024-08-15/datatransfer/README.md index e666d37a1c7..09cb0296ac9 100644 --- a/resource-manager/cosmosdb/2024-08-15/datatransfer/README.md +++ b/resource-manager/cosmosdb/2024-08-15/datatransfer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := datatransfer.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := datatransfer.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/datatransfer/id_service.go b/resource-manager/cosmosdb/2024-08-15/datatransfer/id_service.go index 6f3fabaa7b7..58fd3f22eb2 100644 --- a/resource-manager/cosmosdb/2024-08-15/datatransfer/id_service.go +++ b/resource-manager/cosmosdb/2024-08-15/datatransfer/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/datatransfer/id_service_test.go b/resource-manager/cosmosdb/2024-08-15/datatransfer/id_service_test.go index accfb95c7e8..b3261c00b8b 100644 --- a/resource-manager/cosmosdb/2024-08-15/datatransfer/id_service_test.go +++ b/resource-manager/cosmosdb/2024-08-15/datatransfer/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/graphapicompute/README.md b/resource-manager/cosmosdb/2024-08-15/graphapicompute/README.md index 8b9778528ce..27901f6d182 100644 --- a/resource-manager/cosmosdb/2024-08-15/graphapicompute/README.md +++ b/resource-manager/cosmosdb/2024-08-15/graphapicompute/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := graphapicompute.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := graphapicompute.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/graphapicompute/id_service.go b/resource-manager/cosmosdb/2024-08-15/graphapicompute/id_service.go index 37a699c2693..a4987f4b408 100644 --- a/resource-manager/cosmosdb/2024-08-15/graphapicompute/id_service.go +++ b/resource-manager/cosmosdb/2024-08-15/graphapicompute/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/graphapicompute/id_service_test.go b/resource-manager/cosmosdb/2024-08-15/graphapicompute/id_service_test.go index 20302671509..4be092ed7b2 100644 --- a/resource-manager/cosmosdb/2024-08-15/graphapicompute/id_service_test.go +++ b/resource-manager/cosmosdb/2024-08-15/graphapicompute/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/managedcassandras/README.md b/resource-manager/cosmosdb/2024-08-15/managedcassandras/README.md index cdedf1cd70a..4836f9e1c91 100644 --- a/resource-manager/cosmosdb/2024-08-15/managedcassandras/README.md +++ b/resource-manager/cosmosdb/2024-08-15/managedcassandras/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -42,7 +42,7 @@ if err := client.CassandraClustersCreateUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.CassandraClustersDeallocateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.CassandraClustersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersGet(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.CommandPostBody{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { // handle the error @@ -143,7 +143,7 @@ if err := client.CassandraClustersStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraClustersStatus(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") payload := managedcassandras.ClusterResource{ // ... @@ -176,7 +176,7 @@ if err := client.CassandraClustersUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... @@ -193,7 +193,7 @@ if err := client.CassandraDataCentersCreateUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -205,7 +205,7 @@ if err := client.CassandraDataCentersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") read, err := client.CassandraDataCentersGet(ctx, id) if err != nil { @@ -221,7 +221,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcassandras.NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") read, err := client.CassandraDataCentersList(ctx, id) if err != nil { @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") +id := managedcassandras.NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") payload := managedcassandras.DataCenterResource{ // ... diff --git a/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_cassandracluster.go b/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_cassandracluster.go index 43ce8c1202c..b189a0db128 100644 --- a/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_cassandracluster.go +++ b/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_cassandracluster.go @@ -115,7 +115,7 @@ func (id CassandraClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_cassandracluster_test.go b/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_cassandracluster_test.go index b21a0ee8614..6e99daf02bb 100644 --- a/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_cassandracluster_test.go +++ b/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_cassandracluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CassandraClusterId{} func TestNewCassandraClusterID(t *testing.T) { - id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCassandraClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } } func TestFormatCassandraClusterID(t *testing.T) { - actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName" + actual := NewCassandraClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCassandraClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCassandraClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Expected: &CassandraClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_datacenter.go b/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_datacenter.go index 8736ef94f6f..5c5a637c822 100644 --- a/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_datacenter.go +++ b/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_datacenter.go @@ -121,7 +121,7 @@ func (id DataCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticCassandraClusters", "cassandraClusters", "cassandraClusters"), - resourceids.UserSpecifiedSegment("cassandraClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("cassandraClusterName", "cassandraClusterName"), resourceids.StaticSegment("staticDataCenters", "dataCenters", "dataCenters"), resourceids.UserSpecifiedSegment("dataCenterName", "dataCenterName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_datacenter_test.go b/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_datacenter_test.go index 66e81bfb94f..e958093a948 100644 --- a/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_datacenter_test.go +++ b/resource-manager/cosmosdb/2024-08-15/managedcassandras/id_datacenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataCenterId{} func TestNewDataCenterID(t *testing.T) { - id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName") + id := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDataCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CassandraClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "clusterName") + if id.CassandraClusterName != "cassandraClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CassandraClusterName'", id.CassandraClusterName, "cassandraClusterName") } if id.DataCenterName != "dataCenterName" { @@ -32,8 +32,8 @@ func TestNewDataCenterID(t *testing.T) { } func TestFormatDataCenterID(t *testing.T) { - actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "dataCenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName" + actual := NewDataCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cassandraClusterName", "dataCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDataCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDataCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CassandraClusterName: "clusterName", + CassandraClusterName: "cassandraClusterName", DataCenterName: "dataCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/clusterName/dataCenters/dataCenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/cassandraClusters/cassandraClusterName/dataCenters/dataCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE", Expected: &DataCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CassandraClusterName: "cLuStErNaMe", + CassandraClusterName: "cAsSaNdRaClUsTeRnAmE", DataCenterName: "dAtAcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cLuStErNaMe/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/cAsSaNdRaClUsTeRs/cAsSaNdRaClUsTeRnAmE/dAtAcEnTeRs/dAtAcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/README.md b/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/README.md index 034417d36ac..a060aa1d786 100644 --- a/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/README.md +++ b/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := materializedviewsbuilder.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := materializedviewsbuilder.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/id_service.go b/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/id_service.go index 3af930e9bc6..2eb7e5e0d31 100644 --- a/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/id_service.go +++ b/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/id_service_test.go b/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/id_service_test.go index 8d14f132a1e..577612d3e07 100644 --- a/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/id_service_test.go +++ b/resource-manager/cosmosdb/2024-08-15/materializedviewsbuilder/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/mongorbacs/README.md b/resource-manager/cosmosdb/2024-08-15/mongorbacs/README.md index 91b773b34d6..8d762f54249 100644 --- a/resource-manager/cosmosdb/2024-08-15/mongorbacs/README.md +++ b/resource-manager/cosmosdb/2024-08-15/mongorbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") payload := mongorbacs.MongoRoleDefinitionCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoRoleDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") payload := mongorbacs.MongoUserDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.MongoDBResourcesCreateUpdateMongoUserDefinitionThenPoll(ctx, id ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.MongoDBResourcesDeleteMongoRoleDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.MongoDBResourcesDeleteMongoUserDefinitionThenPoll(ctx, id); err ```go ctx := context.TODO() -id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") +id := mongorbacs.NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") read, err := client.MongoDBResourcesGetMongoRoleDefinition(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") +id := mongorbacs.NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") read, err := client.MongoDBResourcesGetMongoUserDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoRoleDefinitions(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := mongorbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.MongoDBResourcesListMongoUserDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_databaseaccount.go index 5dcb902abb5..35b2f7f690f 100644 --- a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_databaseaccount_test.go index 8cf97bbace8..18a73206d20 100644 --- a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbroledefinition.go b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbroledefinition.go index 88c7ce70b53..859adbfb63f 100644 --- a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbroledefinition.go +++ b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbroledefinition.go @@ -121,7 +121,7 @@ func (id MongodbRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbRoleDefinitions", "mongodbRoleDefinitions", "mongodbRoleDefinitions"), resourceids.UserSpecifiedSegment("mongoRoleDefinitionId", "mongoRoleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbroledefinition_test.go b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbroledefinition_test.go index 635bde6bf7f..667a0b36da3 100644 --- a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbroledefinition_test.go +++ b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbRoleDefinitionId{} func TestNewMongodbRoleDefinitionID(t *testing.T) { - id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId") + id := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoRoleDefinitionId != "mongoRoleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbRoleDefinitionID(t *testing.T) { } func TestFormatMongodbRoleDefinitionID(t *testing.T) { - actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoRoleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId" + actual := NewMongodbRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoRoleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoRoleDefinitionId: "mongoRoleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbRoleDefinitions/mongoRoleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId", Expected: &MongodbRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoRoleDefinitionId: "mOnGoRoLeDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbRoLeDeFiNiTiOnS/mOnGoRoLeDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbuserdefinition.go b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbuserdefinition.go index d3ad61af293..68a38ae9094 100644 --- a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbuserdefinition.go +++ b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbuserdefinition.go @@ -121,7 +121,7 @@ func (id MongodbUserDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbUserDefinitions", "mongodbUserDefinitions", "mongodbUserDefinitions"), resourceids.UserSpecifiedSegment("mongoUserDefinitionId", "mongoUserDefinitionId"), } diff --git a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbuserdefinition_test.go b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbuserdefinition_test.go index c89f631908a..eb010d3045a 100644 --- a/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbuserdefinition_test.go +++ b/resource-manager/cosmosdb/2024-08-15/mongorbacs/id_mongodbuserdefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbUserDefinitionId{} func TestNewMongodbUserDefinitionID(t *testing.T) { - id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId") + id := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.MongoUserDefinitionId != "mongoUserDefinitionId" { @@ -32,8 +32,8 @@ func TestNewMongodbUserDefinitionID(t *testing.T) { } func TestFormatMongodbUserDefinitionID(t *testing.T) { - actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "mongoUserDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId" + actual := NewMongodbUserDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongoUserDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMongodbUserDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMongodbUserDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", MongoUserDefinitionId: "mongoUserDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbUserDefinitions/mongoUserDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId", Expected: &MongodbUserDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", MongoUserDefinitionId: "mOnGoUsErDeFiNiTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbUsErDeFiNiTiOnS/mOnGoUsErDeFiNiTiOnId/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/README.md b/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/README.md index 69531e86ec6..b95e5cc974b 100644 --- a/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/README.md +++ b/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") payload := notebookworkspacesresource.ARMProxyResource{ // ... @@ -41,7 +41,7 @@ if err := client.NotebookWorkspacesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.NotebookWorkspacesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListByDatabaseAccount(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.NotebookWorkspacesListConnectionInfo(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != nil { // handle the error @@ -113,7 +113,7 @@ if err := client.NotebookWorkspacesRegenerateAuthTokenThenPoll(ctx, id); err != ```go ctx := context.TODO() -id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := notebookworkspacesresource.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if err := client.NotebookWorkspacesStartThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/id_databaseaccount.go b/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/id_databaseaccount.go index cc1cfbae97b..48f82ab040b 100644 --- a/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/id_databaseaccount_test.go index 765176e522b..4b238cf57bd 100644 --- a/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-08-15/notebookworkspacesresource/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/README.md b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/README.md index b11a5b0269d..11b7319493a 100644 --- a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/README.md +++ b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privateendpointconnections.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_databaseaccount.go b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_databaseaccount.go index 2d03a12f035..0ef32fef9c1 100644 --- a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_databaseaccount_test.go index def6cb01a81..fe0be2f9ad1 100644 --- a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_privateendpointconnection.go index 404b3ec4b99..ad4cd96d133 100644 --- a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_privateendpointconnection_test.go index 616287d8b5e..6f7f6251e0b 100644 --- a/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/cosmosdb/2024-08-15/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/README.md b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/README.md index d9b0f10b3b6..7dbe49dfb8b 100644 --- a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/README.md +++ b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := privatelinkresources.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ListByDatabaseAccount(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_databaseaccount.go b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_databaseaccount.go index da2cafa82ce..09df5d78d9d 100644 --- a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_databaseaccount_test.go index 54eac6dbdc6..aa4eb501a97 100644 --- a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_privatelinkresource.go b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_privatelinkresource.go index 14bd8a6525e..22240869721 100644 --- a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_privatelinkresource_test.go index df3663505ef..8994ca6277c 100644 --- a/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/cosmosdb/2024-08-15/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - PrivateLinkResourceName: "groupName", + DatabaseAccountName: "databaseAccountName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/rbacs/README.md b/resource-manager/cosmosdb/2024-08-15/rbacs/README.md index bf087a6e7e0..8af2345f983 100644 --- a/resource-manager/cosmosdb/2024-08-15/rbacs/README.md +++ b/resource-manager/cosmosdb/2024-08-15/rbacs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") payload := rbacs.SqlRoleAssignmentCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleAssignmentThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") payload := rbacs.SqlRoleDefinitionCreateUpdateParameters{ // ... @@ -58,7 +58,7 @@ if err := client.SqlResourcesCreateUpdateSqlRoleDefinitionThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.SqlResourcesDeleteSqlRoleAssignmentThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.SqlResourcesDeleteSqlRoleDefinitionThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := rbacs.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.SqlResourcesGetSqlRoleAssignment(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") +id := rbacs.NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") read, err := client.SqlResourcesGetSqlRoleDefinition(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleAssignments(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := rbacs.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.SqlResourcesListSqlRoleDefinitions(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/rbacs/id_account.go b/resource-manager/cosmosdb/2024-08-15/rbacs/id_account.go index 71408ced400..2fd416725b1 100644 --- a/resource-manager/cosmosdb/2024-08-15/rbacs/id_account.go +++ b/resource-manager/cosmosdb/2024-08-15/rbacs/id_account.go @@ -121,7 +121,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleAssignments", "sqlRoleAssignments", "sqlRoleAssignments"), resourceids.ScopeSegment("roleAssignmentId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } diff --git a/resource-manager/cosmosdb/2024-08-15/rbacs/id_account_test.go b/resource-manager/cosmosdb/2024-08-15/rbacs/id_account_test.go index 28a5f3a07bb..ad2c1bacfd4 100644 --- a/resource-manager/cosmosdb/2024-08-15/rbacs/id_account_test.go +++ b/resource-manager/cosmosdb/2024-08-15/rbacs/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleAssignmentId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewAccountID(t *testing.T) { } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,21 +87,21 @@ func TestParseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -223,41 +223,41 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleAssignments/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleAssignmentId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeAsSiGnMeNtS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleAssignmentId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/cosmosdb/2024-08-15/rbacs/id_databaseaccount.go b/resource-manager/cosmosdb/2024-08-15/rbacs/id_databaseaccount.go index a75e72bbb29..eea55d3e517 100644 --- a/resource-manager/cosmosdb/2024-08-15/rbacs/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-08-15/rbacs/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/rbacs/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-08-15/rbacs/id_databaseaccount_test.go index f7b7f6e34a5..85257d9182a 100644 --- a/resource-manager/cosmosdb/2024-08-15/rbacs/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-08-15/rbacs/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/rbacs/id_sqlroledefinition.go b/resource-manager/cosmosdb/2024-08-15/rbacs/id_sqlroledefinition.go index 8b5ee24533d..fb415467ab6 100644 --- a/resource-manager/cosmosdb/2024-08-15/rbacs/id_sqlroledefinition.go +++ b/resource-manager/cosmosdb/2024-08-15/rbacs/id_sqlroledefinition.go @@ -121,7 +121,7 @@ func (id SqlRoleDefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlRoleDefinitions", "sqlRoleDefinitions", "sqlRoleDefinitions"), resourceids.UserSpecifiedSegment("roleDefinitionId", "roleDefinitionId"), } diff --git a/resource-manager/cosmosdb/2024-08-15/rbacs/id_sqlroledefinition_test.go b/resource-manager/cosmosdb/2024-08-15/rbacs/id_sqlroledefinition_test.go index e54bbbbe92a..d5f64dcc134 100644 --- a/resource-manager/cosmosdb/2024-08-15/rbacs/id_sqlroledefinition_test.go +++ b/resource-manager/cosmosdb/2024-08-15/rbacs/id_sqlroledefinition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SqlRoleDefinitionId{} func TestNewSqlRoleDefinitionID(t *testing.T) { - id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId") + id := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.RoleDefinitionId != "roleDefinitionId" { @@ -32,8 +32,8 @@ func TestNewSqlRoleDefinitionID(t *testing.T) { } func TestFormatSqlRoleDefinitionID(t *testing.T) { - actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "roleDefinitionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId" + actual := NewSqlRoleDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "roleDefinitionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSqlRoleDefinitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSqlRoleDefinitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", RoleDefinitionId: "roleDefinitionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlRoleDefinitions/roleDefinitionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD", Expected: &SqlRoleDefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", RoleDefinitionId: "rOlEdEfInItIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlRoLeDeFiNiTiOnS/rOlEdEfInItIoNiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/README.md b/resource-manager/cosmosdb/2024-08-15/restorables/README.md index 2c719b09f05..db7c4c0ccc7 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/README.md +++ b/resource-manager/cosmosdb/2024-08-15/restorables/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") +id := restorables.NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -42,7 +42,7 @@ if err := client.GremlinResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") +id := restorables.NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -59,7 +59,7 @@ if err := client.MongoDBResourcesRetrieveContinuousBackupInformationThenPoll(ctx ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableDatabaseAccountsGetByLocation(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := restorables.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RestorableDatabaseAccountsListByLocation(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinDatabasesList(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinGraphsList(ctx, id, restorables.DefaultRestorableGremlinGraphsListOperationOptions()) if err != nil { @@ -139,7 +139,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableGremlinResourcesList(ctx, id, restorables.DefaultRestorableGremlinResourcesListOperationOptions()) if err != nil { @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbCollectionsList(ctx, id, restorables.DefaultRestorableMongodbCollectionsListOperationOptions()) if err != nil { @@ -171,7 +171,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbDatabasesList(ctx, id) if err != nil { @@ -187,7 +187,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableMongodbResourcesList(ctx, id, restorables.DefaultRestorableMongodbResourcesListOperationOptions()) if err != nil { @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlContainersList(ctx, id, restorables.DefaultRestorableSqlContainersListOperationOptions()) if err != nil { @@ -219,7 +219,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlDatabasesList(ctx, id) if err != nil { @@ -235,7 +235,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableSqlResourcesList(ctx, id, restorables.DefaultRestorableSqlResourcesListOperationOptions()) if err != nil { @@ -251,7 +251,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTableResourcesList(ctx, id, restorables.DefaultRestorableTableResourcesListOperationOptions()) if err != nil { @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") +id := restorables.NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") read, err := client.RestorableTablesList(ctx, id, restorables.DefaultRestorableTablesListOperationOptions()) if err != nil { @@ -283,7 +283,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") +id := restorables.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") payload := restorables.ContinuousBackupRestoreLocation{ // ... @@ -300,7 +300,7 @@ if err := client.SqlResourcesRetrieveContinuousBackupInformationThenPoll(ctx, id ```go ctx := context.TODO() -id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := restorables.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") payload := restorables.ContinuousBackupRestoreLocation{ // ... diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_container.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_container.go index 9398504f72d..cc01b7113aa 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_container.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_container.go @@ -127,9 +127,9 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticSqlDatabases", "sqlDatabases", "sqlDatabases"), - resourceids.UserSpecifiedSegment("sqlDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("sqlDatabaseName", "sqlDatabaseName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), resourceids.UserSpecifiedSegment("containerName", "containerName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_container_test.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_container_test.go index 0cea9d939ac..97675cfd2b9 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_container_test.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.SqlDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "databaseName") + if id.SqlDatabaseName != "sqlDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'SqlDatabaseName'", id.SqlDatabaseName, "sqlDatabaseName") } if id.ContainerName != "containerName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "sqlDatabaseName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - SqlDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + SqlDatabaseName: "sqlDatabaseName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlDatabases/databaseName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/sqlDatabases/sqlDatabaseName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - SqlDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + SqlDatabaseName: "sQlDaTaBaSeNaMe", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sQlDaTaBaSeS/dAtAbAsEnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sQlDaTaBaSeS/sQlDaTaBaSeNaMe/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_graph.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_graph.go index 9904c179afc..b5c11de6742 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_graph.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_graph.go @@ -127,9 +127,9 @@ func (id GraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticGremlinDatabases", "gremlinDatabases", "gremlinDatabases"), - resourceids.UserSpecifiedSegment("gremlinDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("gremlinDatabaseName", "gremlinDatabaseName"), resourceids.StaticSegment("staticGraphs", "graphs", "graphs"), resourceids.UserSpecifiedSegment("graphName", "graphName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_graph_test.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_graph_test.go index b604d40e75f..633f0c50588 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_graph_test.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_graph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GraphId{} func TestNewGraphID(t *testing.T) { - id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName") + id := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.GremlinDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "databaseName") + if id.GremlinDatabaseName != "gremlinDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'GremlinDatabaseName'", id.GremlinDatabaseName, "gremlinDatabaseName") } if id.GraphName != "graphName" { @@ -36,8 +36,8 @@ func TestNewGraphID(t *testing.T) { } func TestFormatGraphID(t *testing.T) { - actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "graphName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName" + actual := NewGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "gremlinDatabaseName", "graphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - GremlinDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + GremlinDatabaseName: "gremlinDatabaseName", GraphName: "graphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/gremlinDatabases/databaseName/graphs/graphName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/gremlinDatabases/gremlinDatabaseName/graphs/graphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe", Expected: &GraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - GremlinDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + GremlinDatabaseName: "gReMlInDaTaBaSeNaMe", GraphName: "gRaPhNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/gReMlInDaTaBaSeS/dAtAbAsEnAmE/gRaPhS/gRaPhNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/gReMlInDaTaBaSeS/gReMlInDaTaBaSeNaMe/gRaPhS/gRaPhNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_location.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_location.go index 79632e8074a..c7c3d4a6d23 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_location.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_location_test.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_location_test.go index 00f77288bb6..08c58d5f34f 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_location_test.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_mongodbdatabasecollection.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_mongodbdatabasecollection.go index c5b408846b1..863a29287de 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_mongodbdatabasecollection.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_mongodbdatabasecollection.go @@ -127,9 +127,9 @@ func (id MongodbDatabaseCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticMongodbDatabases", "mongodbDatabases", "mongodbDatabases"), - resourceids.UserSpecifiedSegment("mongodbDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("mongodbDatabaseName", "mongodbDatabaseName"), resourceids.StaticSegment("staticCollections", "collections", "collections"), resourceids.UserSpecifiedSegment("collectionName", "collectionName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_mongodbdatabasecollection_test.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_mongodbdatabasecollection_test.go index 846b1efd302..77437dc2f70 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_mongodbdatabasecollection_test.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_mongodbdatabasecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MongodbDatabaseCollectionId{} func TestNewMongodbDatabaseCollectionID(t *testing.T) { - id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName") + id := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } - if id.MongodbDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "databaseName") + if id.MongodbDatabaseName != "mongodbDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'MongodbDatabaseName'", id.MongodbDatabaseName, "mongodbDatabaseName") } if id.CollectionName != "collectionName" { @@ -36,8 +36,8 @@ func TestNewMongodbDatabaseCollectionID(t *testing.T) { } func TestFormatMongodbDatabaseCollectionID(t *testing.T) { - actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "databaseName", "collectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName" + actual := NewMongodbDatabaseCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "mongodbDatabaseName", "collectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseMongodbDatabaseCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseMongodbDatabaseCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", - MongodbDatabaseName: "databaseName", + DatabaseAccountName: "databaseAccountName", + MongodbDatabaseName: "mongodbDatabaseName", CollectionName: "collectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/mongodbDatabases/databaseName/collections/collectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/mongodbDatabases/mongodbDatabaseName/collections/collectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE", Expected: &MongodbDatabaseCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", - MongodbDatabaseName: "dAtAbAsEnAmE", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", + MongodbDatabaseName: "mOnGoDbDaTaBaSeNaMe", CollectionName: "cOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/mOnGoDbDaTaBaSeS/dAtAbAsEnAmE/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/mOnGoDbDaTaBaSeS/mOnGoDbDaTaBaSeNaMe/cOlLeCtIoNs/cOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_restorabledatabaseaccount.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_restorabledatabaseaccount.go index 1397a41ed1b..712ea35cfc0 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_restorabledatabaseaccount.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_restorabledatabaseaccount.go @@ -113,7 +113,7 @@ func (id RestorableDatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticRestorableDatabaseAccounts", "restorableDatabaseAccounts", "restorableDatabaseAccounts"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_restorabledatabaseaccount_test.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_restorabledatabaseaccount_test.go index 0608b8c7799..9a42672ab61 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_restorabledatabaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_restorabledatabaseaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &RestorableDatabaseAccountId{} func TestNewRestorableDatabaseAccountID(t *testing.T) { - id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId") + id := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InstanceId != "instanceId" { @@ -28,8 +28,8 @@ func TestNewRestorableDatabaseAccountID(t *testing.T) { } func TestFormatRestorableDatabaseAccountID(t *testing.T) { - actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "location", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId" + actual := NewRestorableDatabaseAccountID("12345678-1234-9876-4563-123456789012", "locationName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseRestorableDatabaseAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseRestorableDatabaseAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/restorableDatabaseAccounts/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/restorableDatabaseAccounts/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD", Expected: &RestorableDatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/rEsToRaBlEdAtAbAsEaCcOuNtS/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_table.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_table.go index 9c44038270c..6b9e3c73fa6 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_table.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticTables", "tables", "tables"), resourceids.UserSpecifiedSegment("tableName", "tableName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/restorables/id_table_test.go b/resource-manager/cosmosdb/2024-08-15/restorables/id_table_test.go index d0b8fe67a87..432623c34aa 100644 --- a/resource-manager/cosmosdb/2024-08-15/restorables/id_table_test.go +++ b/resource-manager/cosmosdb/2024-08-15/restorables/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/services/README.md b/resource-manager/cosmosdb/2024-08-15/services/README.md index 88c3c955b44..22309066837 100644 --- a/resource-manager/cosmosdb/2024-08-15/services/README.md +++ b/resource-manager/cosmosdb/2024-08-15/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := services.NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") read, err := client.ServiceList(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/services/id_databaseaccount.go b/resource-manager/cosmosdb/2024-08-15/services/id_databaseaccount.go index d076efa0b15..16e2d04be53 100644 --- a/resource-manager/cosmosdb/2024-08-15/services/id_databaseaccount.go +++ b/resource-manager/cosmosdb/2024-08-15/services/id_databaseaccount.go @@ -115,7 +115,7 @@ func (id DatabaseAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), } } diff --git a/resource-manager/cosmosdb/2024-08-15/services/id_databaseaccount_test.go b/resource-manager/cosmosdb/2024-08-15/services/id_databaseaccount_test.go index b7ab3d22543..1b08a40dab2 100644 --- a/resource-manager/cosmosdb/2024-08-15/services/id_databaseaccount_test.go +++ b/resource-manager/cosmosdb/2024-08-15/services/id_databaseaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseAccountId{} func TestNewDatabaseAccountID(t *testing.T) { - id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDatabaseAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } } func TestFormatDatabaseAccountID(t *testing.T) { - actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName" + actual := NewDatabaseAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDatabaseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDatabaseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Expected: &DatabaseAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/README.md b/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/README.md index 336aaa21459..e6b3d6c68f2 100644 --- a/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/README.md +++ b/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") payload := sqldedicatedgateway.ServiceResourceCreateUpdateParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ServiceCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServiceDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") +id := sqldedicatedgateway.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") read, err := client.ServiceGet(ctx, id) if err != nil { diff --git a/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/id_service.go b/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/id_service.go index fae29f8aa18..f628c9a4812 100644 --- a/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/id_service.go +++ b/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/id_service.go @@ -121,7 +121,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticDatabaseAccounts", "databaseAccounts", "databaseAccounts"), - resourceids.UserSpecifiedSegment("databaseAccountName", "accountName"), + resourceids.UserSpecifiedSegment("databaseAccountName", "databaseAccountName"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } diff --git a/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/id_service_test.go b/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/id_service_test.go index 93def5b81b2..4c591e81432 100644 --- a/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/id_service_test.go +++ b/resource-manager/cosmosdb/2024-08-15/sqldedicatedgateway/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DatabaseAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "accountName") + if id.DatabaseAccountName != "databaseAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'DatabaseAccountName'", id.DatabaseAccountName, "databaseAccountName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "databaseAccountName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DatabaseAccountName: "accountName", + DatabaseAccountName: "databaseAccountName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/accountName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DocumentDB/databaseAccounts/databaseAccountName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DatabaseAccountName: "aCcOuNtNaMe", + DatabaseAccountName: "dAtAbAsEaCcOuNtNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/aCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/dAtAbAsEaCcOuNtS/dAtAbAsEaCcOuNtNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2021-10-01/reservedinstances/model_reporturl.go b/resource-manager/costmanagement/2021-10-01/reservedinstances/model_reporturl.go index 3af012168f3..7d04013f0d2 100644 --- a/resource-manager/costmanagement/2021-10-01/reservedinstances/model_reporturl.go +++ b/resource-manager/costmanagement/2021-10-01/reservedinstances/model_reporturl.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ReportURL struct { - ReportUrl *ReservationReportSchema `json:"reportUrl,omitempty"` + ReportURL *ReservationReportSchema `json:"reportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2021-10-01/usagedetails/model_downloadurl.go b/resource-manager/costmanagement/2021-10-01/usagedetails/model_downloadurl.go index b9d137a9b72..a8bf373e661 100644 --- a/resource-manager/costmanagement/2021-10-01/usagedetails/model_downloadurl.go +++ b/resource-manager/costmanagement/2021-10-01/usagedetails/model_downloadurl.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DownloadURL struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` + DownloadURL *string `json:"downloadUrl,omitempty"` ValidTill *string `json:"validTill,omitempty"` } diff --git a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/README.md b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/README.md index 3c76511c7e6..6570b9d31c9 100644 --- a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/README.md +++ b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/README.md @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Delete(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.DeleteByScope(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Execute(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.ExecuteByScope(ctx, id) if err != nil { @@ -172,7 +172,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Get(ctx, id) if err != nil { @@ -188,7 +188,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.GetByScope(ctx, id) if err != nil { diff --git a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scheduledaction.go b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scheduledaction.go index 1b3794907e5..458a9d73124 100644 --- a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scheduledaction.go +++ b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scheduledaction.go @@ -99,7 +99,7 @@ func (id ScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scheduledaction_test.go b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scheduledaction_test.go index 16d8b52a868..89e2ea6ee79 100644 --- a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scheduledaction_test.go +++ b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scheduledaction_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ScheduledActionId{} func TestNewScheduledActionID(t *testing.T) { - id := NewScheduledActionID("name") + id := NewScheduledActionID("scheduledActionName") - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScheduledActionID(t *testing.T) { - actual := NewScheduledActionID("name").ID() - expected := "/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScheduledActionID("scheduledActionName").ID() + expected := "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScheduledActionId{ - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scopedscheduledaction.go b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scopedscheduledaction.go index 09cfb4824ac..1b37877a4c8 100644 --- a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scopedscheduledaction.go +++ b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scopedscheduledaction.go @@ -106,7 +106,7 @@ func (id ScopedScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scopedscheduledaction_test.go b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scopedscheduledaction_test.go index d8e8530e078..3559c945001 100644 --- a/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scopedscheduledaction_test.go +++ b/resource-manager/costmanagement/2022-06-01-preview/scheduledactions/id_scopedscheduledaction_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedScheduledActionId{} func TestNewScopedScheduledActionID(t *testing.T) { - id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") + id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScopedScheduledActionID(t *testing.T) { - actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScopedScheduledActionId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2022-10-01/pricesheets/method_pricesheetdownload.go b/resource-manager/costmanagement/2022-10-01/pricesheets/method_pricesheetdownload.go index 9b672893cd2..cb6c930c15b 100644 --- a/resource-manager/costmanagement/2022-10-01/pricesheets/method_pricesheetdownload.go +++ b/resource-manager/costmanagement/2022-10-01/pricesheets/method_pricesheetdownload.go @@ -18,7 +18,7 @@ type PriceSheetDownloadOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownload ... diff --git a/resource-manager/costmanagement/2022-10-01/pricesheets/method_pricesheetdownloadbybillingprofile.go b/resource-manager/costmanagement/2022-10-01/pricesheets/method_pricesheetdownloadbybillingprofile.go index 1274bea00f3..636b2f1c724 100644 --- a/resource-manager/costmanagement/2022-10-01/pricesheets/method_pricesheetdownloadbybillingprofile.go +++ b/resource-manager/costmanagement/2022-10-01/pricesheets/method_pricesheetdownloadbybillingprofile.go @@ -18,7 +18,7 @@ type PriceSheetDownloadByBillingProfileOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownloadByBillingProfile ... diff --git a/resource-manager/costmanagement/2022-10-01/pricesheets/model_downloadurl.go b/resource-manager/costmanagement/2022-10-01/pricesheets/model_downloadurl.go index 9464230c2e1..93d31a01c23 100644 --- a/resource-manager/costmanagement/2022-10-01/pricesheets/model_downloadurl.go +++ b/resource-manager/costmanagement/2022-10-01/pricesheets/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2022-10-01/reservedinstances/model_reporturl.go b/resource-manager/costmanagement/2022-10-01/reservedinstances/model_reporturl.go index 3af012168f3..7d04013f0d2 100644 --- a/resource-manager/costmanagement/2022-10-01/reservedinstances/model_reporturl.go +++ b/resource-manager/costmanagement/2022-10-01/reservedinstances/model_reporturl.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ReportURL struct { - ReportUrl *ReservationReportSchema `json:"reportUrl,omitempty"` + ReportURL *ReservationReportSchema `json:"reportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2022-10-01/scheduledactions/README.md b/resource-manager/costmanagement/2022-10-01/scheduledactions/README.md index 4bdbb3b9277..24ff0eb9894 100644 --- a/resource-manager/costmanagement/2022-10-01/scheduledactions/README.md +++ b/resource-manager/costmanagement/2022-10-01/scheduledactions/README.md @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Delete(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.DeleteByScope(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Get(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.GetByScope(ctx, id) if err != nil { @@ -206,7 +206,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Run(ctx, id) if err != nil { @@ -222,7 +222,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.RunByScope(ctx, id) if err != nil { diff --git a/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scheduledaction.go b/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scheduledaction.go index 1b3794907e5..458a9d73124 100644 --- a/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scheduledaction.go +++ b/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scheduledaction.go @@ -99,7 +99,7 @@ func (id ScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scheduledaction_test.go b/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scheduledaction_test.go index 16d8b52a868..89e2ea6ee79 100644 --- a/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scheduledaction_test.go +++ b/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scheduledaction_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ScheduledActionId{} func TestNewScheduledActionID(t *testing.T) { - id := NewScheduledActionID("name") + id := NewScheduledActionID("scheduledActionName") - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScheduledActionID(t *testing.T) { - actual := NewScheduledActionID("name").ID() - expected := "/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScheduledActionID("scheduledActionName").ID() + expected := "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScheduledActionId{ - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scopedscheduledaction.go b/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scopedscheduledaction.go index 09cfb4824ac..1b37877a4c8 100644 --- a/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scopedscheduledaction.go +++ b/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scopedscheduledaction.go @@ -106,7 +106,7 @@ func (id ScopedScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scopedscheduledaction_test.go b/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scopedscheduledaction_test.go index d8e8530e078..3559c945001 100644 --- a/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scopedscheduledaction_test.go +++ b/resource-manager/costmanagement/2022-10-01/scheduledactions/id_scopedscheduledaction_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedScheduledActionId{} func TestNewScopedScheduledActionID(t *testing.T) { - id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") + id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScopedScheduledActionID(t *testing.T) { - actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScopedScheduledActionId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2022-10-01/usagedetails/model_downloadurl.go b/resource-manager/costmanagement/2022-10-01/usagedetails/model_downloadurl.go index 6daa403f2d5..7278274783b 100644 --- a/resource-manager/costmanagement/2022-10-01/usagedetails/model_downloadurl.go +++ b/resource-manager/costmanagement/2022-10-01/usagedetails/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2022-10-01/usagedetails/model_generatedetailedcostreportoperationresult.go b/resource-manager/costmanagement/2022-10-01/usagedetails/model_generatedetailedcostreportoperationresult.go index 206d4b00fec..9c696947355 100644 --- a/resource-manager/costmanagement/2022-10-01/usagedetails/model_generatedetailedcostreportoperationresult.go +++ b/resource-manager/costmanagement/2022-10-01/usagedetails/model_generatedetailedcostreportoperationresult.go @@ -6,6 +6,6 @@ package usagedetails type GenerateDetailedCostReportOperationResult struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *DownloadUrl `json:"properties,omitempty"` + Properties *DownloadURL `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/costmanagement/2023-03-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go b/resource-manager/costmanagement/2023-03-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go index 319d5c09d3b..859e35f431b 100644 --- a/resource-manager/costmanagement/2023-03-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go +++ b/resource-manager/costmanagement/2023-03-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go @@ -10,8 +10,8 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AsyncOperationStatusProperties struct { - ReportUrl *BenefitUtilizationSummaryReportSchema `json:"reportUrl,omitempty"` - SecondaryReportUrl *BenefitUtilizationSummaryReportSchema `json:"secondaryReportUrl,omitempty"` + ReportURL *BenefitUtilizationSummaryReportSchema `json:"reportUrl,omitempty"` + SecondaryReportURL *BenefitUtilizationSummaryReportSchema `json:"secondaryReportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2023-03-01/pricesheets/method_pricesheetdownload.go b/resource-manager/costmanagement/2023-03-01/pricesheets/method_pricesheetdownload.go index 9b672893cd2..cb6c930c15b 100644 --- a/resource-manager/costmanagement/2023-03-01/pricesheets/method_pricesheetdownload.go +++ b/resource-manager/costmanagement/2023-03-01/pricesheets/method_pricesheetdownload.go @@ -18,7 +18,7 @@ type PriceSheetDownloadOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownload ... diff --git a/resource-manager/costmanagement/2023-03-01/pricesheets/method_pricesheetdownloadbybillingprofile.go b/resource-manager/costmanagement/2023-03-01/pricesheets/method_pricesheetdownloadbybillingprofile.go index 1274bea00f3..636b2f1c724 100644 --- a/resource-manager/costmanagement/2023-03-01/pricesheets/method_pricesheetdownloadbybillingprofile.go +++ b/resource-manager/costmanagement/2023-03-01/pricesheets/method_pricesheetdownloadbybillingprofile.go @@ -18,7 +18,7 @@ type PriceSheetDownloadByBillingProfileOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownloadByBillingProfile ... diff --git a/resource-manager/costmanagement/2023-03-01/pricesheets/model_downloadurl.go b/resource-manager/costmanagement/2023-03-01/pricesheets/model_downloadurl.go index 9464230c2e1..93d31a01c23 100644 --- a/resource-manager/costmanagement/2023-03-01/pricesheets/model_downloadurl.go +++ b/resource-manager/costmanagement/2023-03-01/pricesheets/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2023-03-01/reservedinstances/model_reporturl.go b/resource-manager/costmanagement/2023-03-01/reservedinstances/model_reporturl.go index 3af012168f3..7d04013f0d2 100644 --- a/resource-manager/costmanagement/2023-03-01/reservedinstances/model_reporturl.go +++ b/resource-manager/costmanagement/2023-03-01/reservedinstances/model_reporturl.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ReportURL struct { - ReportUrl *ReservationReportSchema `json:"reportUrl,omitempty"` + ReportURL *ReservationReportSchema `json:"reportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2023-03-01/scheduledactions/README.md b/resource-manager/costmanagement/2023-03-01/scheduledactions/README.md index 127db14df2b..a220eb730ef 100644 --- a/resource-manager/costmanagement/2023-03-01/scheduledactions/README.md +++ b/resource-manager/costmanagement/2023-03-01/scheduledactions/README.md @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Delete(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.DeleteByScope(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Get(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.GetByScope(ctx, id) if err != nil { @@ -206,7 +206,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Run(ctx, id) if err != nil { @@ -222,7 +222,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.RunByScope(ctx, id) if err != nil { diff --git a/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scheduledaction.go b/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scheduledaction.go index 1b3794907e5..458a9d73124 100644 --- a/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scheduledaction.go +++ b/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scheduledaction.go @@ -99,7 +99,7 @@ func (id ScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scheduledaction_test.go b/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scheduledaction_test.go index 16d8b52a868..89e2ea6ee79 100644 --- a/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scheduledaction_test.go +++ b/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scheduledaction_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ScheduledActionId{} func TestNewScheduledActionID(t *testing.T) { - id := NewScheduledActionID("name") + id := NewScheduledActionID("scheduledActionName") - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScheduledActionID(t *testing.T) { - actual := NewScheduledActionID("name").ID() - expected := "/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScheduledActionID("scheduledActionName").ID() + expected := "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScheduledActionId{ - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scopedscheduledaction.go b/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scopedscheduledaction.go index 09cfb4824ac..1b37877a4c8 100644 --- a/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scopedscheduledaction.go +++ b/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scopedscheduledaction.go @@ -106,7 +106,7 @@ func (id ScopedScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scopedscheduledaction_test.go b/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scopedscheduledaction_test.go index d8e8530e078..3559c945001 100644 --- a/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scopedscheduledaction_test.go +++ b/resource-manager/costmanagement/2023-03-01/scheduledactions/id_scopedscheduledaction_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedScheduledActionId{} func TestNewScopedScheduledActionID(t *testing.T) { - id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") + id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScopedScheduledActionID(t *testing.T) { - actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScopedScheduledActionId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-03-01/usagedetails/model_downloadurl.go b/resource-manager/costmanagement/2023-03-01/usagedetails/model_downloadurl.go index 6daa403f2d5..7278274783b 100644 --- a/resource-manager/costmanagement/2023-03-01/usagedetails/model_downloadurl.go +++ b/resource-manager/costmanagement/2023-03-01/usagedetails/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2023-03-01/usagedetails/model_generatedetailedcostreportoperationresult.go b/resource-manager/costmanagement/2023-03-01/usagedetails/model_generatedetailedcostreportoperationresult.go index 206d4b00fec..9c696947355 100644 --- a/resource-manager/costmanagement/2023-03-01/usagedetails/model_generatedetailedcostreportoperationresult.go +++ b/resource-manager/costmanagement/2023-03-01/usagedetails/model_generatedetailedcostreportoperationresult.go @@ -6,6 +6,6 @@ package usagedetails type GenerateDetailedCostReportOperationResult struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *DownloadUrl `json:"properties,omitempty"` + Properties *DownloadURL `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/costmanagement/2023-07-01-preview/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go b/resource-manager/costmanagement/2023-07-01-preview/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go index 319d5c09d3b..859e35f431b 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go +++ b/resource-manager/costmanagement/2023-07-01-preview/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go @@ -10,8 +10,8 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AsyncOperationStatusProperties struct { - ReportUrl *BenefitUtilizationSummaryReportSchema `json:"reportUrl,omitempty"` - SecondaryReportUrl *BenefitUtilizationSummaryReportSchema `json:"secondaryReportUrl,omitempty"` + ReportURL *BenefitUtilizationSummaryReportSchema `json:"reportUrl,omitempty"` + SecondaryReportURL *BenefitUtilizationSummaryReportSchema `json:"secondaryReportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2023-07-01-preview/pricesheets/method_pricesheetdownload.go b/resource-manager/costmanagement/2023-07-01-preview/pricesheets/method_pricesheetdownload.go index 9b672893cd2..cb6c930c15b 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/pricesheets/method_pricesheetdownload.go +++ b/resource-manager/costmanagement/2023-07-01-preview/pricesheets/method_pricesheetdownload.go @@ -18,7 +18,7 @@ type PriceSheetDownloadOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownload ... diff --git a/resource-manager/costmanagement/2023-07-01-preview/pricesheets/method_pricesheetdownloadbybillingprofile.go b/resource-manager/costmanagement/2023-07-01-preview/pricesheets/method_pricesheetdownloadbybillingprofile.go index 1274bea00f3..636b2f1c724 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/pricesheets/method_pricesheetdownloadbybillingprofile.go +++ b/resource-manager/costmanagement/2023-07-01-preview/pricesheets/method_pricesheetdownloadbybillingprofile.go @@ -18,7 +18,7 @@ type PriceSheetDownloadByBillingProfileOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownloadByBillingProfile ... diff --git a/resource-manager/costmanagement/2023-07-01-preview/pricesheets/model_downloadurl.go b/resource-manager/costmanagement/2023-07-01-preview/pricesheets/model_downloadurl.go index 9464230c2e1..93d31a01c23 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/pricesheets/model_downloadurl.go +++ b/resource-manager/costmanagement/2023-07-01-preview/pricesheets/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2023-07-01-preview/reservedinstances/model_reporturl.go b/resource-manager/costmanagement/2023-07-01-preview/reservedinstances/model_reporturl.go index 3af012168f3..7d04013f0d2 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/reservedinstances/model_reporturl.go +++ b/resource-manager/costmanagement/2023-07-01-preview/reservedinstances/model_reporturl.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ReportURL struct { - ReportUrl *ReservationReportSchema `json:"reportUrl,omitempty"` + ReportURL *ReservationReportSchema `json:"reportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/README.md b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/README.md index e644e054b89..af8861d5a37 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/README.md +++ b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/README.md @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Delete(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.DeleteByScope(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Get(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.GetByScope(ctx, id) if err != nil { @@ -206,7 +206,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Run(ctx, id) if err != nil { @@ -222,7 +222,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.RunByScope(ctx, id) if err != nil { diff --git a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scheduledaction.go b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scheduledaction.go index 1b3794907e5..458a9d73124 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scheduledaction.go +++ b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scheduledaction.go @@ -99,7 +99,7 @@ func (id ScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scheduledaction_test.go b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scheduledaction_test.go index 16d8b52a868..89e2ea6ee79 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scheduledaction_test.go +++ b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scheduledaction_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ScheduledActionId{} func TestNewScheduledActionID(t *testing.T) { - id := NewScheduledActionID("name") + id := NewScheduledActionID("scheduledActionName") - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScheduledActionID(t *testing.T) { - actual := NewScheduledActionID("name").ID() - expected := "/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScheduledActionID("scheduledActionName").ID() + expected := "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScheduledActionId{ - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scopedscheduledaction.go b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scopedscheduledaction.go index 09cfb4824ac..1b37877a4c8 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scopedscheduledaction.go +++ b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scopedscheduledaction.go @@ -106,7 +106,7 @@ func (id ScopedScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scopedscheduledaction_test.go b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scopedscheduledaction_test.go index d8e8530e078..3559c945001 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scopedscheduledaction_test.go +++ b/resource-manager/costmanagement/2023-07-01-preview/scheduledactions/id_scopedscheduledaction_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedScheduledActionId{} func TestNewScopedScheduledActionID(t *testing.T) { - id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") + id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScopedScheduledActionID(t *testing.T) { - actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScopedScheduledActionId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-07-01-preview/usagedetails/model_downloadurl.go b/resource-manager/costmanagement/2023-07-01-preview/usagedetails/model_downloadurl.go index 6daa403f2d5..7278274783b 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/usagedetails/model_downloadurl.go +++ b/resource-manager/costmanagement/2023-07-01-preview/usagedetails/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2023-07-01-preview/usagedetails/model_generatedetailedcostreportoperationresult.go b/resource-manager/costmanagement/2023-07-01-preview/usagedetails/model_generatedetailedcostreportoperationresult.go index 206d4b00fec..9c696947355 100644 --- a/resource-manager/costmanagement/2023-07-01-preview/usagedetails/model_generatedetailedcostreportoperationresult.go +++ b/resource-manager/costmanagement/2023-07-01-preview/usagedetails/model_generatedetailedcostreportoperationresult.go @@ -6,6 +6,6 @@ package usagedetails type GenerateDetailedCostReportOperationResult struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *DownloadUrl `json:"properties,omitempty"` + Properties *DownloadURL `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/costmanagement/2023-08-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go b/resource-manager/costmanagement/2023-08-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go index 319d5c09d3b..859e35f431b 100644 --- a/resource-manager/costmanagement/2023-08-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go +++ b/resource-manager/costmanagement/2023-08-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go @@ -10,8 +10,8 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AsyncOperationStatusProperties struct { - ReportUrl *BenefitUtilizationSummaryReportSchema `json:"reportUrl,omitempty"` - SecondaryReportUrl *BenefitUtilizationSummaryReportSchema `json:"secondaryReportUrl,omitempty"` + ReportURL *BenefitUtilizationSummaryReportSchema `json:"reportUrl,omitempty"` + SecondaryReportURL *BenefitUtilizationSummaryReportSchema `json:"secondaryReportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2023-08-01/costallocationrules/README.md b/resource-manager/costmanagement/2023-08-01/costallocationrules/README.md index 00ccb57a7a3..9b0c88929dc 100644 --- a/resource-manager/costmanagement/2023-08-01/costallocationrules/README.md +++ b/resource-manager/costmanagement/2023-08-01/costallocationrules/README.md @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "ruleName") +id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName") payload := costallocationrules.CostAllocationRuleDefinition{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "ruleName") +id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "ruleName") +id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/costmanagement/2023-08-01/costallocationrules/id_costallocationrule.go b/resource-manager/costmanagement/2023-08-01/costallocationrules/id_costallocationrule.go index 68ab78f31c0..aff8f005604 100644 --- a/resource-manager/costmanagement/2023-08-01/costallocationrules/id_costallocationrule.go +++ b/resource-manager/costmanagement/2023-08-01/costallocationrules/id_costallocationrule.go @@ -109,7 +109,7 @@ func (id CostAllocationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticCostAllocationRules", "costAllocationRules", "costAllocationRules"), - resourceids.UserSpecifiedSegment("costAllocationRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("costAllocationRuleName", "costAllocationRuleName"), } } diff --git a/resource-manager/costmanagement/2023-08-01/costallocationrules/id_costallocationrule_test.go b/resource-manager/costmanagement/2023-08-01/costallocationrules/id_costallocationrule_test.go index 15f9606d86a..40749d33db7 100644 --- a/resource-manager/costmanagement/2023-08-01/costallocationrules/id_costallocationrule_test.go +++ b/resource-manager/costmanagement/2023-08-01/costallocationrules/id_costallocationrule_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &CostAllocationRuleId{} func TestNewCostAllocationRuleID(t *testing.T) { - id := NewCostAllocationRuleID("billingAccountId", "ruleName") + id := NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName") if id.BillingAccountId != "billingAccountId" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountId'", id.BillingAccountId, "billingAccountId") } - if id.CostAllocationRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'CostAllocationRuleName'", id.CostAllocationRuleName, "ruleName") + if id.CostAllocationRuleName != "costAllocationRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'CostAllocationRuleName'", id.CostAllocationRuleName, "costAllocationRuleName") } } func TestFormatCostAllocationRuleID(t *testing.T) { - actual := NewCostAllocationRuleID("billingAccountId", "ruleName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName" + actual := NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -79,15 +79,15 @@ func TestParseCostAllocationRuleID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName", Expected: &CostAllocationRuleId{ BillingAccountId: "billingAccountId", - CostAllocationRuleName: "ruleName", + CostAllocationRuleName: "costAllocationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName/extra", Error: true, }, } @@ -200,28 +200,28 @@ func TestParseCostAllocationRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName", Expected: &CostAllocationRuleId{ BillingAccountId: "billingAccountId", - CostAllocationRuleName: "ruleName", + CostAllocationRuleName: "costAllocationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTiD/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/cOsTaLlOcAtIoNrUlEs/rUlEnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTiD/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/cOsTaLlOcAtIoNrUlEs/cOsTaLlOcAtIoNrUlEnAmE", Expected: &CostAllocationRuleId{ BillingAccountId: "bIlLiNgAcCoUnTiD", - CostAllocationRuleName: "rUlEnAmE", + CostAllocationRuleName: "cOsTaLlOcAtIoNrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTiD/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/cOsTaLlOcAtIoNrUlEs/rUlEnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTiD/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/cOsTaLlOcAtIoNrUlEs/cOsTaLlOcAtIoNrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-08-01/pricesheets/method_pricesheetdownload.go b/resource-manager/costmanagement/2023-08-01/pricesheets/method_pricesheetdownload.go index 9b672893cd2..cb6c930c15b 100644 --- a/resource-manager/costmanagement/2023-08-01/pricesheets/method_pricesheetdownload.go +++ b/resource-manager/costmanagement/2023-08-01/pricesheets/method_pricesheetdownload.go @@ -18,7 +18,7 @@ type PriceSheetDownloadOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownload ... diff --git a/resource-manager/costmanagement/2023-08-01/pricesheets/method_pricesheetdownloadbybillingprofile.go b/resource-manager/costmanagement/2023-08-01/pricesheets/method_pricesheetdownloadbybillingprofile.go index 1274bea00f3..636b2f1c724 100644 --- a/resource-manager/costmanagement/2023-08-01/pricesheets/method_pricesheetdownloadbybillingprofile.go +++ b/resource-manager/costmanagement/2023-08-01/pricesheets/method_pricesheetdownloadbybillingprofile.go @@ -18,7 +18,7 @@ type PriceSheetDownloadByBillingProfileOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownloadByBillingProfile ... diff --git a/resource-manager/costmanagement/2023-08-01/pricesheets/model_downloadurl.go b/resource-manager/costmanagement/2023-08-01/pricesheets/model_downloadurl.go index 9464230c2e1..93d31a01c23 100644 --- a/resource-manager/costmanagement/2023-08-01/pricesheets/model_downloadurl.go +++ b/resource-manager/costmanagement/2023-08-01/pricesheets/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2023-08-01/reservedinstances/model_reporturl.go b/resource-manager/costmanagement/2023-08-01/reservedinstances/model_reporturl.go index 3af012168f3..7d04013f0d2 100644 --- a/resource-manager/costmanagement/2023-08-01/reservedinstances/model_reporturl.go +++ b/resource-manager/costmanagement/2023-08-01/reservedinstances/model_reporturl.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ReportURL struct { - ReportUrl *ReservationReportSchema `json:"reportUrl,omitempty"` + ReportURL *ReservationReportSchema `json:"reportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2023-08-01/scheduledactions/README.md b/resource-manager/costmanagement/2023-08-01/scheduledactions/README.md index d04b8d7042f..bb3b0437086 100644 --- a/resource-manager/costmanagement/2023-08-01/scheduledactions/README.md +++ b/resource-manager/costmanagement/2023-08-01/scheduledactions/README.md @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Delete(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.DeleteByScope(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Get(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.GetByScope(ctx, id) if err != nil { @@ -206,7 +206,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Run(ctx, id) if err != nil { @@ -222,7 +222,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.RunByScope(ctx, id) if err != nil { diff --git a/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scheduledaction.go b/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scheduledaction.go index 1b3794907e5..458a9d73124 100644 --- a/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scheduledaction.go +++ b/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scheduledaction.go @@ -99,7 +99,7 @@ func (id ScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scheduledaction_test.go b/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scheduledaction_test.go index 16d8b52a868..89e2ea6ee79 100644 --- a/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scheduledaction_test.go +++ b/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scheduledaction_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ScheduledActionId{} func TestNewScheduledActionID(t *testing.T) { - id := NewScheduledActionID("name") + id := NewScheduledActionID("scheduledActionName") - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScheduledActionID(t *testing.T) { - actual := NewScheduledActionID("name").ID() - expected := "/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScheduledActionID("scheduledActionName").ID() + expected := "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScheduledActionId{ - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scopedscheduledaction.go b/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scopedscheduledaction.go index 09cfb4824ac..1b37877a4c8 100644 --- a/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scopedscheduledaction.go +++ b/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scopedscheduledaction.go @@ -106,7 +106,7 @@ func (id ScopedScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scopedscheduledaction_test.go b/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scopedscheduledaction_test.go index d8e8530e078..3559c945001 100644 --- a/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scopedscheduledaction_test.go +++ b/resource-manager/costmanagement/2023-08-01/scheduledactions/id_scopedscheduledaction_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedScheduledActionId{} func TestNewScopedScheduledActionID(t *testing.T) { - id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") + id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScopedScheduledActionID(t *testing.T) { - actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScopedScheduledActionId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-08-01/usagedetails/model_downloadurl.go b/resource-manager/costmanagement/2023-08-01/usagedetails/model_downloadurl.go index 6daa403f2d5..7278274783b 100644 --- a/resource-manager/costmanagement/2023-08-01/usagedetails/model_downloadurl.go +++ b/resource-manager/costmanagement/2023-08-01/usagedetails/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2023-08-01/usagedetails/model_generatedetailedcostreportoperationresult.go b/resource-manager/costmanagement/2023-08-01/usagedetails/model_generatedetailedcostreportoperationresult.go index 206d4b00fec..9c696947355 100644 --- a/resource-manager/costmanagement/2023-08-01/usagedetails/model_generatedetailedcostreportoperationresult.go +++ b/resource-manager/costmanagement/2023-08-01/usagedetails/model_generatedetailedcostreportoperationresult.go @@ -6,6 +6,6 @@ package usagedetails type GenerateDetailedCostReportOperationResult struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *DownloadUrl `json:"properties,omitempty"` + Properties *DownloadURL `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/costmanagement/2023-11-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go b/resource-manager/costmanagement/2023-11-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go index 319d5c09d3b..859e35f431b 100644 --- a/resource-manager/costmanagement/2023-11-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go +++ b/resource-manager/costmanagement/2023-11-01/benefitutilizationsummariesasync/model_asyncoperationstatusproperties.go @@ -10,8 +10,8 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AsyncOperationStatusProperties struct { - ReportUrl *BenefitUtilizationSummaryReportSchema `json:"reportUrl,omitempty"` - SecondaryReportUrl *BenefitUtilizationSummaryReportSchema `json:"secondaryReportUrl,omitempty"` + ReportURL *BenefitUtilizationSummaryReportSchema `json:"reportUrl,omitempty"` + SecondaryReportURL *BenefitUtilizationSummaryReportSchema `json:"secondaryReportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2023-11-01/costallocationrules/README.md b/resource-manager/costmanagement/2023-11-01/costallocationrules/README.md index a7914362742..30b4c15c8b6 100644 --- a/resource-manager/costmanagement/2023-11-01/costallocationrules/README.md +++ b/resource-manager/costmanagement/2023-11-01/costallocationrules/README.md @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "ruleName") +id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName") payload := costallocationrules.CostAllocationRuleDefinition{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "ruleName") +id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "ruleName") +id := costallocationrules.NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/costmanagement/2023-11-01/costallocationrules/id_costallocationrule.go b/resource-manager/costmanagement/2023-11-01/costallocationrules/id_costallocationrule.go index 68ab78f31c0..aff8f005604 100644 --- a/resource-manager/costmanagement/2023-11-01/costallocationrules/id_costallocationrule.go +++ b/resource-manager/costmanagement/2023-11-01/costallocationrules/id_costallocationrule.go @@ -109,7 +109,7 @@ func (id CostAllocationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticCostAllocationRules", "costAllocationRules", "costAllocationRules"), - resourceids.UserSpecifiedSegment("costAllocationRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("costAllocationRuleName", "costAllocationRuleName"), } } diff --git a/resource-manager/costmanagement/2023-11-01/costallocationrules/id_costallocationrule_test.go b/resource-manager/costmanagement/2023-11-01/costallocationrules/id_costallocationrule_test.go index 15f9606d86a..40749d33db7 100644 --- a/resource-manager/costmanagement/2023-11-01/costallocationrules/id_costallocationrule_test.go +++ b/resource-manager/costmanagement/2023-11-01/costallocationrules/id_costallocationrule_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &CostAllocationRuleId{} func TestNewCostAllocationRuleID(t *testing.T) { - id := NewCostAllocationRuleID("billingAccountId", "ruleName") + id := NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName") if id.BillingAccountId != "billingAccountId" { t.Fatalf("Expected %q but got %q for Segment 'BillingAccountId'", id.BillingAccountId, "billingAccountId") } - if id.CostAllocationRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'CostAllocationRuleName'", id.CostAllocationRuleName, "ruleName") + if id.CostAllocationRuleName != "costAllocationRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'CostAllocationRuleName'", id.CostAllocationRuleName, "costAllocationRuleName") } } func TestFormatCostAllocationRuleID(t *testing.T) { - actual := NewCostAllocationRuleID("billingAccountId", "ruleName").ID() - expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName" + actual := NewCostAllocationRuleID("billingAccountId", "costAllocationRuleName").ID() + expected := "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -79,15 +79,15 @@ func TestParseCostAllocationRuleID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName", Expected: &CostAllocationRuleId{ BillingAccountId: "billingAccountId", - CostAllocationRuleName: "ruleName", + CostAllocationRuleName: "costAllocationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName/extra", Error: true, }, } @@ -200,28 +200,28 @@ func TestParseCostAllocationRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName", Expected: &CostAllocationRuleId{ BillingAccountId: "billingAccountId", - CostAllocationRuleName: "ruleName", + CostAllocationRuleName: "costAllocationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/ruleName/extra", + Input: "/providers/Microsoft.Billing/billingAccounts/billingAccountId/providers/Microsoft.CostManagement/costAllocationRules/costAllocationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTiD/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/cOsTaLlOcAtIoNrUlEs/rUlEnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTiD/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/cOsTaLlOcAtIoNrUlEs/cOsTaLlOcAtIoNrUlEnAmE", Expected: &CostAllocationRuleId{ BillingAccountId: "bIlLiNgAcCoUnTiD", - CostAllocationRuleName: "rUlEnAmE", + CostAllocationRuleName: "cOsTaLlOcAtIoNrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTiD/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/cOsTaLlOcAtIoNrUlEs/rUlEnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.bIlLiNg/bIlLiNgAcCoUnTs/bIlLiNgAcCoUnTiD/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/cOsTaLlOcAtIoNrUlEs/cOsTaLlOcAtIoNrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-11-01/pricesheets/method_pricesheetdownloadbyinvoice.go b/resource-manager/costmanagement/2023-11-01/pricesheets/method_pricesheetdownloadbyinvoice.go index aba1c310390..a9a52a70870 100644 --- a/resource-manager/costmanagement/2023-11-01/pricesheets/method_pricesheetdownloadbyinvoice.go +++ b/resource-manager/costmanagement/2023-11-01/pricesheets/method_pricesheetdownloadbyinvoice.go @@ -18,7 +18,7 @@ type PriceSheetDownloadByInvoiceOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *DownloadUrl + Model *DownloadURL } // PriceSheetDownloadByInvoice ... diff --git a/resource-manager/costmanagement/2023-11-01/pricesheets/model_downloadurl.go b/resource-manager/costmanagement/2023-11-01/pricesheets/model_downloadurl.go index 9464230c2e1..93d31a01c23 100644 --- a/resource-manager/costmanagement/2023-11-01/pricesheets/model_downloadurl.go +++ b/resource-manager/costmanagement/2023-11-01/pricesheets/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2023-11-01/pricesheets/model_eapricesheetdownloadproperties.go b/resource-manager/costmanagement/2023-11-01/pricesheets/model_eapricesheetdownloadproperties.go index ce463c3ad87..0a85d5cc484 100644 --- a/resource-manager/costmanagement/2023-11-01/pricesheets/model_eapricesheetdownloadproperties.go +++ b/resource-manager/costmanagement/2023-11-01/pricesheets/model_eapricesheetdownloadproperties.go @@ -11,7 +11,7 @@ import ( type EAPricesheetDownloadProperties struct { DownloadFileProperties *EAPriceSheetProperties `json:"downloadFileProperties,omitempty"` - DownloadUrl *string `json:"downloadUrl,omitempty"` + DownloadURL *string `json:"downloadUrl,omitempty"` ValidTill *string `json:"validTill,omitempty"` } diff --git a/resource-manager/costmanagement/2023-11-01/pricesheets/model_pricesheetdownloadproperties.go b/resource-manager/costmanagement/2023-11-01/pricesheets/model_pricesheetdownloadproperties.go index 07b7acfcc3d..44f5639bb2f 100644 --- a/resource-manager/costmanagement/2023-11-01/pricesheets/model_pricesheetdownloadproperties.go +++ b/resource-manager/costmanagement/2023-11-01/pricesheets/model_pricesheetdownloadproperties.go @@ -11,7 +11,7 @@ import ( type PricesheetDownloadProperties struct { DownloadFileProperties *MCAPriceSheetProperties `json:"downloadFileProperties,omitempty"` - DownloadUrl *string `json:"downloadUrl,omitempty"` + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` } diff --git a/resource-manager/costmanagement/2023-11-01/reservedinstances/model_reporturl.go b/resource-manager/costmanagement/2023-11-01/reservedinstances/model_reporturl.go index 3af012168f3..7d04013f0d2 100644 --- a/resource-manager/costmanagement/2023-11-01/reservedinstances/model_reporturl.go +++ b/resource-manager/costmanagement/2023-11-01/reservedinstances/model_reporturl.go @@ -10,7 +10,7 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ReportURL struct { - ReportUrl *ReservationReportSchema `json:"reportUrl,omitempty"` + ReportURL *ReservationReportSchema `json:"reportUrl,omitempty"` ValidUntil *string `json:"validUntil,omitempty"` } diff --git a/resource-manager/costmanagement/2023-11-01/scheduledactions/README.md b/resource-manager/costmanagement/2023-11-01/scheduledactions/README.md index b1f78e33d8b..0b52f8a9c25 100644 --- a/resource-manager/costmanagement/2023-11-01/scheduledactions/README.md +++ b/resource-manager/costmanagement/2023-11-01/scheduledactions/README.md @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") payload := scheduledactions.ScheduledAction{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Delete(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.DeleteByScope(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Get(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.GetByScope(ctx, id) if err != nil { @@ -206,7 +206,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := scheduledactions.NewScheduledActionID("name") +id := scheduledactions.NewScheduledActionID("scheduledActionName") read, err := client.Run(ctx, id) if err != nil { @@ -222,7 +222,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := scheduledactions.NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") read, err := client.RunByScope(ctx, id) if err != nil { diff --git a/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scheduledaction.go b/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scheduledaction.go index 1b3794907e5..458a9d73124 100644 --- a/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scheduledaction.go +++ b/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scheduledaction.go @@ -99,7 +99,7 @@ func (id ScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scheduledaction_test.go b/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scheduledaction_test.go index 16d8b52a868..89e2ea6ee79 100644 --- a/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scheduledaction_test.go +++ b/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scheduledaction_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ScheduledActionId{} func TestNewScheduledActionID(t *testing.T) { - id := NewScheduledActionID("name") + id := NewScheduledActionID("scheduledActionName") - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScheduledActionID(t *testing.T) { - actual := NewScheduledActionID("name").ID() - expected := "/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScheduledActionID("scheduledActionName").ID() + expected := "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScheduledActionId{ - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScheduledActionId{ - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scopedscheduledaction.go b/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scopedscheduledaction.go index 09cfb4824ac..1b37877a4c8 100644 --- a/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scopedscheduledaction.go +++ b/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scopedscheduledaction.go @@ -106,7 +106,7 @@ func (id ScopedScheduledActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCostManagement", "Microsoft.CostManagement", "Microsoft.CostManagement"), resourceids.StaticSegment("staticScheduledActions", "scheduledActions", "scheduledActions"), - resourceids.UserSpecifiedSegment("scheduledActionName", "name"), + resourceids.UserSpecifiedSegment("scheduledActionName", "scheduledActionName"), } } diff --git a/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scopedscheduledaction_test.go b/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scopedscheduledaction_test.go index d8e8530e078..3559c945001 100644 --- a/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scopedscheduledaction_test.go +++ b/resource-manager/costmanagement/2023-11-01/scheduledactions/id_scopedscheduledaction_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedScheduledActionId{} func TestNewScopedScheduledActionID(t *testing.T) { - id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") + id := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.ScheduledActionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "name") + if id.ScheduledActionName != "scheduledActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledActionName'", id.ScheduledActionName, "scheduledActionName") } } func TestFormatScopedScheduledActionID(t *testing.T) { - actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name" + actual := NewScopedScheduledActionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "scheduledActionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedScheduledActionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedScheduledActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName", Expected: &ScopedScheduledActionId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ScheduledActionName: "name", + ScheduledActionName: "scheduledActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.CostManagement/scheduledActions/scheduledActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe", Expected: &ScopedScheduledActionId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ScheduledActionName: "nAmE", + ScheduledActionName: "sChEdUlEdAcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.cOsTmAnAgEmEnT/sChEdUlEdAcTiOnS/sChEdUlEdAcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/costmanagement/2023-11-01/usagedetails/model_downloadurl.go b/resource-manager/costmanagement/2023-11-01/usagedetails/model_downloadurl.go index 6daa403f2d5..7278274783b 100644 --- a/resource-manager/costmanagement/2023-11-01/usagedetails/model_downloadurl.go +++ b/resource-manager/costmanagement/2023-11-01/usagedetails/model_downloadurl.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DownloadUrl struct { - DownloadUrl *string `json:"downloadUrl,omitempty"` +type DownloadURL struct { + DownloadURL *string `json:"downloadUrl,omitempty"` ExpiryTime *string `json:"expiryTime,omitempty"` ValidTill *string `json:"validTill,omitempty"` } -func (o *DownloadUrl) GetExpiryTimeAsTime() (*time.Time, error) { +func (o *DownloadURL) GetExpiryTimeAsTime() (*time.Time, error) { if o.ExpiryTime == nil { return nil, nil } return dates.ParseAsFormat(o.ExpiryTime, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetExpiryTimeAsTime(input time.Time) { +func (o *DownloadURL) SetExpiryTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ExpiryTime = &formatted } -func (o *DownloadUrl) GetValidTillAsTime() (*time.Time, error) { +func (o *DownloadURL) GetValidTillAsTime() (*time.Time, error) { if o.ValidTill == nil { return nil, nil } return dates.ParseAsFormat(o.ValidTill, "2006-01-02T15:04:05Z07:00") } -func (o *DownloadUrl) SetValidTillAsTime(input time.Time) { +func (o *DownloadURL) SetValidTillAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.ValidTill = &formatted } diff --git a/resource-manager/costmanagement/2023-11-01/usagedetails/model_generatedetailedcostreportoperationresult.go b/resource-manager/costmanagement/2023-11-01/usagedetails/model_generatedetailedcostreportoperationresult.go index 206d4b00fec..9c696947355 100644 --- a/resource-manager/costmanagement/2023-11-01/usagedetails/model_generatedetailedcostreportoperationresult.go +++ b/resource-manager/costmanagement/2023-11-01/usagedetails/model_generatedetailedcostreportoperationresult.go @@ -6,6 +6,6 @@ package usagedetails type GenerateDetailedCostReportOperationResult struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *DownloadUrl `json:"properties,omitempty"` + Properties *DownloadURL `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/dashboard/2022-08-01/grafanaresource/README.md b/resource-manager/dashboard/2022-08-01/grafanaresource/README.md index cca84ce1526..5463531f161 100644 --- a/resource-manager/dashboard/2022-08-01/grafanaresource/README.md +++ b/resource-manager/dashboard/2022-08-01/grafanaresource/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") payload := grafanaresource.ManagedGrafana{ // ... @@ -42,7 +42,7 @@ if err := client.GrafanaCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if err := client.GrafanaDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.GrafanaDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") read, err := client.GrafanaGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") payload := grafanaresource.ManagedGrafanaUpdateParameters{ // ... diff --git a/resource-manager/dashboard/2022-08-01/grafanaresource/id_grafana.go b/resource-manager/dashboard/2022-08-01/grafanaresource/id_grafana.go index 0efcac4ffc9..96ad1bf2caf 100644 --- a/resource-manager/dashboard/2022-08-01/grafanaresource/id_grafana.go +++ b/resource-manager/dashboard/2022-08-01/grafanaresource/id_grafana.go @@ -115,7 +115,7 @@ func (id GrafanaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), } } diff --git a/resource-manager/dashboard/2022-08-01/grafanaresource/id_grafana_test.go b/resource-manager/dashboard/2022-08-01/grafanaresource/id_grafana_test.go index fb48de8605c..438f98758b9 100644 --- a/resource-manager/dashboard/2022-08-01/grafanaresource/id_grafana_test.go +++ b/resource-manager/dashboard/2022-08-01/grafanaresource/id_grafana_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GrafanaId{} func TestNewGrafanaID(t *testing.T) { - id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewGrafanaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } } func TestFormatGrafanaID(t *testing.T) { - actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName" + actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseGrafanaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseGrafanaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2022-08-01/privateendpointconnection/README.md b/resource-manager/dashboard/2022-08-01/privateendpointconnection/README.md index d253694bc24..8de2a17886e 100644 --- a/resource-manager/dashboard/2022-08-01/privateendpointconnection/README.md +++ b/resource-manager/dashboard/2022-08-01/privateendpointconnection/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName") payload := privateendpointconnection.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.ApproveThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := privateendpointconnection.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_grafana.go b/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_grafana.go index 6d8ee96984d..5dbf3ad1135 100644 --- a/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_grafana.go +++ b/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_grafana.go @@ -115,7 +115,7 @@ func (id GrafanaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), } } diff --git a/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_grafana_test.go b/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_grafana_test.go index dba208981ee..8d7b15766a9 100644 --- a/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_grafana_test.go +++ b/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_grafana_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GrafanaId{} func TestNewGrafanaID(t *testing.T) { - id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewGrafanaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } } func TestFormatGrafanaID(t *testing.T) { - actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName" + actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseGrafanaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseGrafanaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_privateendpointconnection.go b/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_privateendpointconnection.go index a3b08b359de..482d0d491b5 100644 --- a/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_privateendpointconnection.go +++ b/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_privateendpointconnection_test.go b/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_privateendpointconnection_test.go index 4f6f5dccedc..b043bff6455 100644 --- a/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_privateendpointconnection_test.go +++ b/resource-manager/dashboard/2022-08-01/privateendpointconnection/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2022-08-01/privatelinkresource/README.md b/resource-manager/dashboard/2022-08-01/privatelinkresource/README.md index a22e4f7bbad..770a3387653 100644 --- a/resource-manager/dashboard/2022-08-01/privatelinkresource/README.md +++ b/resource-manager/dashboard/2022-08-01/privatelinkresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") +id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := privatelinkresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/dashboard/2022-08-01/privatelinkresource/id_grafana.go b/resource-manager/dashboard/2022-08-01/privatelinkresource/id_grafana.go index 3d2421c76f3..0db525e40c5 100644 --- a/resource-manager/dashboard/2022-08-01/privatelinkresource/id_grafana.go +++ b/resource-manager/dashboard/2022-08-01/privatelinkresource/id_grafana.go @@ -115,7 +115,7 @@ func (id GrafanaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), } } diff --git a/resource-manager/dashboard/2022-08-01/privatelinkresource/id_grafana_test.go b/resource-manager/dashboard/2022-08-01/privatelinkresource/id_grafana_test.go index 434f9cf008a..e8feeb3f139 100644 --- a/resource-manager/dashboard/2022-08-01/privatelinkresource/id_grafana_test.go +++ b/resource-manager/dashboard/2022-08-01/privatelinkresource/id_grafana_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GrafanaId{} func TestNewGrafanaID(t *testing.T) { - id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewGrafanaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } } func TestFormatGrafanaID(t *testing.T) { - actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName" + actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseGrafanaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseGrafanaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2022-08-01/privatelinkresource/id_privatelinkresource.go b/resource-manager/dashboard/2022-08-01/privatelinkresource/id_privatelinkresource.go index b264b7e191a..c87f8566bfb 100644 --- a/resource-manager/dashboard/2022-08-01/privatelinkresource/id_privatelinkresource.go +++ b/resource-manager/dashboard/2022-08-01/privatelinkresource/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } diff --git a/resource-manager/dashboard/2022-08-01/privatelinkresource/id_privatelinkresource_test.go b/resource-manager/dashboard/2022-08-01/privatelinkresource/id_privatelinkresource_test.go index a5a65faa848..5d55b95c0bb 100644 --- a/resource-manager/dashboard/2022-08-01/privatelinkresource/id_privatelinkresource_test.go +++ b/resource-manager/dashboard/2022-08-01/privatelinkresource/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } if id.PrivateLinkResourceName != "privateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2023-09-01/grafanaplugin/README.md b/resource-manager/dashboard/2023-09-01/grafanaplugin/README.md index 95d6fc085e8..fffd0d19a0f 100644 --- a/resource-manager/dashboard/2023-09-01/grafanaplugin/README.md +++ b/resource-manager/dashboard/2023-09-01/grafanaplugin/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := grafanaplugin.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaplugin.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") // alternatively `client.GrafanaFetchAvailablePlugins(ctx, id)` can be used to do batched pagination items, err := client.GrafanaFetchAvailablePluginsComplete(ctx, id) diff --git a/resource-manager/dashboard/2023-09-01/grafanaplugin/id_grafana.go b/resource-manager/dashboard/2023-09-01/grafanaplugin/id_grafana.go index 8708c9ead89..dd5d468bfdf 100644 --- a/resource-manager/dashboard/2023-09-01/grafanaplugin/id_grafana.go +++ b/resource-manager/dashboard/2023-09-01/grafanaplugin/id_grafana.go @@ -115,7 +115,7 @@ func (id GrafanaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), } } diff --git a/resource-manager/dashboard/2023-09-01/grafanaplugin/id_grafana_test.go b/resource-manager/dashboard/2023-09-01/grafanaplugin/id_grafana_test.go index ea9582b6d14..9c151609189 100644 --- a/resource-manager/dashboard/2023-09-01/grafanaplugin/id_grafana_test.go +++ b/resource-manager/dashboard/2023-09-01/grafanaplugin/id_grafana_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GrafanaId{} func TestNewGrafanaID(t *testing.T) { - id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewGrafanaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } } func TestFormatGrafanaID(t *testing.T) { - actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName" + actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseGrafanaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseGrafanaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2023-09-01/grafanaresource/README.md b/resource-manager/dashboard/2023-09-01/grafanaresource/README.md index 2a2f8dd386b..e7a2180d1d9 100644 --- a/resource-manager/dashboard/2023-09-01/grafanaresource/README.md +++ b/resource-manager/dashboard/2023-09-01/grafanaresource/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") read, err := client.GrafanaCheckEnterpriseDetails(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") payload := grafanaresource.ManagedGrafana{ // ... @@ -58,7 +58,7 @@ if err := client.GrafanaCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if err := client.GrafanaDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.GrafanaDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") read, err := client.GrafanaGet(ctx, id) if err != nil { @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := grafanaresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") payload := grafanaresource.ManagedGrafanaUpdateParameters{ // ... diff --git a/resource-manager/dashboard/2023-09-01/grafanaresource/id_grafana.go b/resource-manager/dashboard/2023-09-01/grafanaresource/id_grafana.go index 0efcac4ffc9..96ad1bf2caf 100644 --- a/resource-manager/dashboard/2023-09-01/grafanaresource/id_grafana.go +++ b/resource-manager/dashboard/2023-09-01/grafanaresource/id_grafana.go @@ -115,7 +115,7 @@ func (id GrafanaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), } } diff --git a/resource-manager/dashboard/2023-09-01/grafanaresource/id_grafana_test.go b/resource-manager/dashboard/2023-09-01/grafanaresource/id_grafana_test.go index fb48de8605c..438f98758b9 100644 --- a/resource-manager/dashboard/2023-09-01/grafanaresource/id_grafana_test.go +++ b/resource-manager/dashboard/2023-09-01/grafanaresource/id_grafana_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GrafanaId{} func TestNewGrafanaID(t *testing.T) { - id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewGrafanaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } } func TestFormatGrafanaID(t *testing.T) { - actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName" + actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseGrafanaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseGrafanaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/README.md b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/README.md index 97578f71ac9..6d68e00ec46 100644 --- a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/README.md +++ b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedprivateendpoints.NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "managedPrivateEndpointName") +id := managedprivateendpoints.NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "managedPrivateEndpointName") payload := managedprivateendpoints.ManagedPrivateEndpointModel{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedprivateendpoints.NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "managedPrivateEndpointName") +id := managedprivateendpoints.NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "managedPrivateEndpointName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedprivateendpoints.NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "managedPrivateEndpointName") +id := managedprivateendpoints.NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "managedPrivateEndpointName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedprivateendpoints.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := managedprivateendpoints.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedprivateendpoints.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := managedprivateendpoints.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.RefreshThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedprivateendpoints.NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "managedPrivateEndpointName") +id := managedprivateendpoints.NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "managedPrivateEndpointName") payload := managedprivateendpoints.ManagedPrivateEndpointUpdateParameters{ // ... diff --git a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_grafana.go b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_grafana.go index 841d1c53664..2a7fb9d4c02 100644 --- a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_grafana.go +++ b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_grafana.go @@ -115,7 +115,7 @@ func (id GrafanaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), } } diff --git a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_grafana_test.go b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_grafana_test.go index 8942640a71c..b1dd43ffab9 100644 --- a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_grafana_test.go +++ b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_grafana_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GrafanaId{} func TestNewGrafanaID(t *testing.T) { - id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewGrafanaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } } func TestFormatGrafanaID(t *testing.T) { - actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName" + actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseGrafanaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseGrafanaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_managedprivateendpoint.go b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_managedprivateendpoint.go index 0b97ff51f2c..f62eda38b79 100644 --- a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_managedprivateendpoint.go +++ b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_managedprivateendpoint.go @@ -121,7 +121,7 @@ func (id ManagedPrivateEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), resourceids.StaticSegment("staticManagedPrivateEndpoints", "managedPrivateEndpoints", "managedPrivateEndpoints"), resourceids.UserSpecifiedSegment("managedPrivateEndpointName", "managedPrivateEndpointName"), } diff --git a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_managedprivateendpoint_test.go b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_managedprivateendpoint_test.go index 588bd61827b..df907e9393c 100644 --- a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_managedprivateendpoint_test.go +++ b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/id_managedprivateendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedPrivateEndpointId{} func TestNewManagedPrivateEndpointID(t *testing.T) { - id := NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "managedPrivateEndpointName") + id := NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "managedPrivateEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagedPrivateEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } if id.ManagedPrivateEndpointName != "managedPrivateEndpointName" { @@ -32,8 +32,8 @@ func TestNewManagedPrivateEndpointID(t *testing.T) { } func TestFormatManagedPrivateEndpointID(t *testing.T) { - actual := NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "managedPrivateEndpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/managedPrivateEndpoints/managedPrivateEndpointName" + actual := NewManagedPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "managedPrivateEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/managedPrivateEndpoints/managedPrivateEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseManagedPrivateEndpointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/managedPrivateEndpoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/managedPrivateEndpoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/managedPrivateEndpoints/managedPrivateEndpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/managedPrivateEndpoints/managedPrivateEndpointName", Expected: &ManagedPrivateEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", ManagedPrivateEndpointName: "managedPrivateEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/managedPrivateEndpoints/managedPrivateEndpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/managedPrivateEndpoints/managedPrivateEndpointName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseManagedPrivateEndpointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/managedPrivateEndpoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/managedPrivateEndpoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/mAnAgEdPrIvAtEeNdPoInTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/mAnAgEdPrIvAtEeNdPoInTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/managedPrivateEndpoints/managedPrivateEndpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/managedPrivateEndpoints/managedPrivateEndpointName", Expected: &ManagedPrivateEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", ManagedPrivateEndpointName: "managedPrivateEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/managedPrivateEndpoints/managedPrivateEndpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/managedPrivateEndpoints/managedPrivateEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/mAnAgEdPrIvAtEeNdPoInTs/mAnAgEdPrIvAtEeNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/mAnAgEdPrIvAtEeNdPoInTs/mAnAgEdPrIvAtEeNdPoInTnAmE", Expected: &ManagedPrivateEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", ManagedPrivateEndpointName: "mAnAgEdPrIvAtEeNdPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/mAnAgEdPrIvAtEeNdPoInTs/mAnAgEdPrIvAtEeNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/mAnAgEdPrIvAtEeNdPoInTs/mAnAgEdPrIvAtEeNdPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/model_managedprivateendpointmodelproperties.go b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/model_managedprivateendpointmodelproperties.go index d1b96efedee..babce0bcb68 100644 --- a/resource-manager/dashboard/2023-09-01/managedprivateendpoints/model_managedprivateendpointmodelproperties.go +++ b/resource-manager/dashboard/2023-09-01/managedprivateendpoints/model_managedprivateendpointmodelproperties.go @@ -9,7 +9,7 @@ type ManagedPrivateEndpointModelProperties struct { PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"` PrivateLinkResourceRegion *string `json:"privateLinkResourceRegion,omitempty"` PrivateLinkServicePrivateIP *string `json:"privateLinkServicePrivateIP,omitempty"` - PrivateLinkServiceUrl *string `json:"privateLinkServiceUrl,omitempty"` + PrivateLinkServiceURL *string `json:"privateLinkServiceUrl,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` RequestMessage *string `json:"requestMessage,omitempty"` } diff --git a/resource-manager/dashboard/2023-09-01/privateendpointconnection/README.md b/resource-manager/dashboard/2023-09-01/privateendpointconnection/README.md index cf43578eb2b..dc299bdca87 100644 --- a/resource-manager/dashboard/2023-09-01/privateendpointconnection/README.md +++ b/resource-manager/dashboard/2023-09-01/privateendpointconnection/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName") payload := privateendpointconnection.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.ApproveThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := privateendpointconnection.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_grafana.go b/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_grafana.go index 6d8ee96984d..5dbf3ad1135 100644 --- a/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_grafana.go +++ b/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_grafana.go @@ -115,7 +115,7 @@ func (id GrafanaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), } } diff --git a/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_grafana_test.go b/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_grafana_test.go index dba208981ee..8d7b15766a9 100644 --- a/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_grafana_test.go +++ b/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_grafana_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GrafanaId{} func TestNewGrafanaID(t *testing.T) { - id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewGrafanaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } } func TestFormatGrafanaID(t *testing.T) { - actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName" + actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseGrafanaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseGrafanaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_privateendpointconnection.go b/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_privateendpointconnection.go index a3b08b359de..482d0d491b5 100644 --- a/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_privateendpointconnection.go +++ b/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_privateendpointconnection_test.go b/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_privateendpointconnection_test.go index 4f6f5dccedc..b043bff6455 100644 --- a/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_privateendpointconnection_test.go +++ b/resource-manager/dashboard/2023-09-01/privateendpointconnection/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2023-09-01/privatelinkresource/README.md b/resource-manager/dashboard/2023-09-01/privatelinkresource/README.md index 10488bea78f..c02706ff7be 100644 --- a/resource-manager/dashboard/2023-09-01/privatelinkresource/README.md +++ b/resource-manager/dashboard/2023-09-01/privatelinkresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") +id := privatelinkresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") +id := privatelinkresource.NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/dashboard/2023-09-01/privatelinkresource/id_grafana.go b/resource-manager/dashboard/2023-09-01/privatelinkresource/id_grafana.go index 3d2421c76f3..0db525e40c5 100644 --- a/resource-manager/dashboard/2023-09-01/privatelinkresource/id_grafana.go +++ b/resource-manager/dashboard/2023-09-01/privatelinkresource/id_grafana.go @@ -115,7 +115,7 @@ func (id GrafanaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), } } diff --git a/resource-manager/dashboard/2023-09-01/privatelinkresource/id_grafana_test.go b/resource-manager/dashboard/2023-09-01/privatelinkresource/id_grafana_test.go index 434f9cf008a..e8feeb3f139 100644 --- a/resource-manager/dashboard/2023-09-01/privatelinkresource/id_grafana_test.go +++ b/resource-manager/dashboard/2023-09-01/privatelinkresource/id_grafana_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GrafanaId{} func TestNewGrafanaID(t *testing.T) { - id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + id := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewGrafanaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } } func TestFormatGrafanaID(t *testing.T) { - actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName" + actual := NewGrafanaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseGrafanaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseGrafanaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Expected: &GrafanaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/extra", Error: true, }, } diff --git a/resource-manager/dashboard/2023-09-01/privatelinkresource/id_privatelinkresource.go b/resource-manager/dashboard/2023-09-01/privatelinkresource/id_privatelinkresource.go index b264b7e191a..c87f8566bfb 100644 --- a/resource-manager/dashboard/2023-09-01/privatelinkresource/id_privatelinkresource.go +++ b/resource-manager/dashboard/2023-09-01/privatelinkresource/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDashboard", "Microsoft.Dashboard", "Microsoft.Dashboard"), resourceids.StaticSegment("staticGrafana", "grafana", "grafana"), - resourceids.UserSpecifiedSegment("grafanaName", "workspaceName"), + resourceids.UserSpecifiedSegment("grafanaName", "grafanaName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } diff --git a/resource-manager/dashboard/2023-09-01/privatelinkresource/id_privatelinkresource_test.go b/resource-manager/dashboard/2023-09-01/privatelinkresource/id_privatelinkresource_test.go index a5a65faa848..5d55b95c0bb 100644 --- a/resource-manager/dashboard/2023-09-01/privatelinkresource/id_privatelinkresource_test.go +++ b/resource-manager/dashboard/2023-09-01/privatelinkresource/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.GrafanaName != "workspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "workspaceName") + if id.GrafanaName != "grafanaName" { + t.Fatalf("Expected %q but got %q for Segment 'GrafanaName'", id.GrafanaName, "grafanaName") } if id.PrivateLinkResourceName != "privateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "grafanaName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - GrafanaName: "workspaceName", + GrafanaName: "grafanaName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/workspaceName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Dashboard/grafana/grafanaName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GrafanaName: "wOrKsPaCeNaMe", + GrafanaName: "gRaFaNaNaMe", PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAsHbOaRd/gRaFaNa/gRaFaNaNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/addons/README.md b/resource-manager/databoxedge/2022-03-01/addons/README.md index d3793ed4d3c..d84b766a007 100644 --- a/resource-manager/databoxedge/2022-03-01/addons/README.md +++ b/resource-manager/databoxedge/2022-03-01/addons/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") payload := addons.Addon{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := addons.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := addons.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") // alternatively `client.ListByRole(ctx, id)` can be used to do batched pagination items, err := client.ListByRoleComplete(ctx, id) diff --git a/resource-manager/databoxedge/2022-03-01/addons/id_addon.go b/resource-manager/databoxedge/2022-03-01/addons/id_addon.go index 4fd88976567..703deec398d 100644 --- a/resource-manager/databoxedge/2022-03-01/addons/id_addon.go +++ b/resource-manager/databoxedge/2022-03-01/addons/id_addon.go @@ -127,7 +127,7 @@ func (id AddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), resourceids.UserSpecifiedSegment("roleName", "roleName"), resourceids.StaticSegment("staticAddons", "addons", "addons"), diff --git a/resource-manager/databoxedge/2022-03-01/addons/id_addon_test.go b/resource-manager/databoxedge/2022-03-01/addons/id_addon_test.go index bcffdb293af..6c392a52c74 100644 --- a/resource-manager/databoxedge/2022-03-01/addons/id_addon_test.go +++ b/resource-manager/databoxedge/2022-03-01/addons/id_addon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AddonId{} func TestNewAddonID(t *testing.T) { - id := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") + id := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.RoleName != "roleName" { @@ -36,8 +36,8 @@ func TestNewAddonID(t *testing.T) { } func TestFormatAddonID(t *testing.T) { - actual := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName" + actual := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", AddonName: "addonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", AddonName: "addonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", RoleName: "rOlEnAmE", AddonName: "aDdOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/addons/id_role.go b/resource-manager/databoxedge/2022-03-01/addons/id_role.go index bba3763684b..cbe52077a18 100644 --- a/resource-manager/databoxedge/2022-03-01/addons/id_role.go +++ b/resource-manager/databoxedge/2022-03-01/addons/id_role.go @@ -121,9 +121,9 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), - resourceids.UserSpecifiedSegment("roleName", "name"), + resourceids.UserSpecifiedSegment("roleName", "roleName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/addons/id_role_test.go b/resource-manager/databoxedge/2022-03-01/addons/id_role_test.go index 67cd0e066de..5b7b8f82009 100644 --- a/resource-manager/databoxedge/2022-03-01/addons/id_role_test.go +++ b/resource-manager/databoxedge/2022-03-01/addons/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.RoleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "name") + if id.RoleName != "roleName" { + t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "roleName") } } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - RoleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/alerts/README.md b/resource-manager/databoxedge/2022-03-01/alerts/README.md index 6577b39f23d..cdff2b43f99 100644 --- a/resource-manager/databoxedge/2022-03-01/alerts/README.md +++ b/resource-manager/databoxedge/2022-03-01/alerts/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := alerts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2022-03-01/alerts/id_alert.go b/resource-manager/databoxedge/2022-03-01/alerts/id_alert.go index a730d5e2274..263bc837fff 100644 --- a/resource-manager/databoxedge/2022-03-01/alerts/id_alert.go +++ b/resource-manager/databoxedge/2022-03-01/alerts/id_alert.go @@ -121,9 +121,9 @@ func (id AlertId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticAlerts", "alerts", "alerts"), - resourceids.UserSpecifiedSegment("alertName", "name"), + resourceids.UserSpecifiedSegment("alertName", "alertName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/alerts/id_alert_test.go b/resource-manager/databoxedge/2022-03-01/alerts/id_alert_test.go index 02b952e148d..930d5772864 100644 --- a/resource-manager/databoxedge/2022-03-01/alerts/id_alert_test.go +++ b/resource-manager/databoxedge/2022-03-01/alerts/id_alert_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AlertId{} func TestNewAlertID(t *testing.T) { - id := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAlertID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.AlertName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'AlertName'", id.AlertName, "name") + if id.AlertName != "alertName" { + t.Fatalf("Expected %q but got %q for Segment 'AlertName'", id.AlertName, "alertName") } } func TestFormatAlertID(t *testing.T) { - actual := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name" + actual := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAlertID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - AlertName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAlertIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - AlertName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS/aLeRtNaMe", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - AlertName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + AlertName: "aLeRtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS/aLeRtNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/alerts/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/alerts/id_databoxedgedevice.go index b5fcf00cb03..c7845ee88cc 100644 --- a/resource-manager/databoxedge/2022-03-01/alerts/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/alerts/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/alerts/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/alerts/id_databoxedgedevice_test.go index 04521a95a5a..53e2537956d 100644 --- a/resource-manager/databoxedge/2022-03-01/alerts/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/alerts/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/README.md b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/README.md index fcdfdf8ff00..0632ef114cc 100644 --- a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/README.md +++ b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") payload := bandwidthschedules.BandwidthSchedule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := bandwidthschedules.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_bandwidthschedule.go b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_bandwidthschedule.go index df13af7ee7e..41909024796 100644 --- a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_bandwidthschedule.go +++ b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_bandwidthschedule.go @@ -121,9 +121,9 @@ func (id BandwidthScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticBandwidthSchedules", "bandwidthSchedules", "bandwidthSchedules"), - resourceids.UserSpecifiedSegment("bandwidthScheduleName", "name"), + resourceids.UserSpecifiedSegment("bandwidthScheduleName", "bandwidthScheduleName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_bandwidthschedule_test.go b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_bandwidthschedule_test.go index 13514614bad..cf6ec10fcd4 100644 --- a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_bandwidthschedule_test.go +++ b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_bandwidthschedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BandwidthScheduleId{} func TestNewBandwidthScheduleID(t *testing.T) { - id := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewBandwidthScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.BandwidthScheduleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'BandwidthScheduleName'", id.BandwidthScheduleName, "name") + if id.BandwidthScheduleName != "bandwidthScheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'BandwidthScheduleName'", id.BandwidthScheduleName, "bandwidthScheduleName") } } func TestFormatBandwidthScheduleID(t *testing.T) { - actual := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name" + actual := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBandwidthScheduleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - BandwidthScheduleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + BandwidthScheduleName: "bandwidthScheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBandwidthScheduleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - BandwidthScheduleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + BandwidthScheduleName: "bandwidthScheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS/bAnDwIdThScHeDuLeNaMe", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - BandwidthScheduleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + BandwidthScheduleName: "bAnDwIdThScHeDuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS/bAnDwIdThScHeDuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_databoxedgedevice.go index 96dcf9e535c..59f1e5d0765 100644 --- a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_databoxedgedevice_test.go index 2ccabd5c76c..89880e9f8cf 100644 --- a/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/bandwidthschedules/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/containers/README.md b/resource-manager/databoxedge/2022-03-01/containers/README.md index 386a25d403f..54b3bb30304 100644 --- a/resource-manager/databoxedge/2022-03-01/containers/README.md +++ b/resource-manager/databoxedge/2022-03-01/containers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") payload := containers.Container{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containers.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := containers.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") // alternatively `client.ListByStorageAccount(ctx, id)` can be used to do batched pagination items, err := client.ListByStorageAccountComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/databoxedge/2022-03-01/containers/id_container.go b/resource-manager/databoxedge/2022-03-01/containers/id_container.go index 52bbd14a4ca..5186ea465a8 100644 --- a/resource-manager/databoxedge/2022-03-01/containers/id_container.go +++ b/resource-manager/databoxedge/2022-03-01/containers/id_container.go @@ -127,7 +127,7 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), diff --git a/resource-manager/databoxedge/2022-03-01/containers/id_container_test.go b/resource-manager/databoxedge/2022-03-01/containers/id_container_test.go index 4ca274bfae3..d0ba8742c62 100644 --- a/resource-manager/databoxedge/2022-03-01/containers/id_container_test.go +++ b/resource-manager/databoxedge/2022-03-01/containers/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/containers/id_storageaccount.go b/resource-manager/databoxedge/2022-03-01/containers/id_storageaccount.go index d50a0d70ff9..36b079935cc 100644 --- a/resource-manager/databoxedge/2022-03-01/containers/id_storageaccount.go +++ b/resource-manager/databoxedge/2022-03-01/containers/id_storageaccount.go @@ -121,7 +121,7 @@ func (id StorageAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), } diff --git a/resource-manager/databoxedge/2022-03-01/containers/id_storageaccount_test.go b/resource-manager/databoxedge/2022-03-01/containers/id_storageaccount_test.go index 4cb39161d5d..90f0b8f9a4e 100644 --- a/resource-manager/databoxedge/2022-03-01/containers/id_storageaccount_test.go +++ b/resource-manager/databoxedge/2022-03-01/containers/id_storageaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountId{} func TestNewStorageAccountID(t *testing.T) { - id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") + id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -32,8 +32,8 @@ func TestNewStorageAccountID(t *testing.T) { } func TestFormatStorageAccountID(t *testing.T) { - actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName" + actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/README.md b/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/README.md index de64be9b5d1..e96fa64d38d 100644 --- a/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/README.md +++ b/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devicecapacitycheck.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devicecapacitycheck.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devicecapacitycheck.DeviceCapacityRequestInfo{ // ... diff --git a/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/id_databoxedgedevice.go index 226c9b858ed..b5e03fb1153 100644 --- a/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/id_databoxedgedevice_test.go index 2ef2ae0d7bd..21182e65d4b 100644 --- a/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/devicecapacitycheck/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/README.md b/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/README.md index 2ed65228d4d..4db12ca1745 100644 --- a/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/README.md +++ b/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devicecapacityinfo.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devicecapacityinfo.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDeviceCapacityInfo(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/id_databoxedgedevice.go index 5e800fb6abd..39936712f1b 100644 --- a/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/id_databoxedgedevice_test.go index 7f5a848b33b..43c3cee23c5 100644 --- a/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/devicecapacityinfo/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/devices/README.md b/resource-manager/databoxedge/2022-03-01/devices/README.md index 2d136191d3e..4643ced09e0 100644 --- a/resource-manager/databoxedge/2022-03-01/devices/README.md +++ b/resource-manager/databoxedge/2022-03-01/devices/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDevice{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.SecuritySettings{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateSecuritySettingsThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -75,7 +75,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DownloadUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -87,7 +87,7 @@ if err := client.DownloadUpdatesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GenerateCertificate(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.Get(ctx, id) if err != nil { @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetExtendedInformation(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetNetworkSettings(ctx, id) if err != nil { @@ -151,7 +151,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetUpdateSummary(ctx, id) if err != nil { @@ -167,7 +167,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.InstallUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -213,7 +213,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.ScanForUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -225,7 +225,7 @@ if err := client.ScanForUpdatesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDevicePatch{ // ... @@ -246,7 +246,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDeviceExtendedInfoPatch{ // ... @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.UploadCertificateRequest{ // ... diff --git a/resource-manager/databoxedge/2022-03-01/devices/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/devices/id_databoxedgedevice.go index f03c67cea72..aa83e45ad1a 100644 --- a/resource-manager/databoxedge/2022-03-01/devices/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/devices/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/devices/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/devices/id_databoxedgedevice_test.go index 91650f6ae01..a9568fcc10d 100644 --- a/resource-manager/databoxedge/2022-03-01/devices/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/devices/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/devices/model_databoxedgedeviceextendedinfopatch.go b/resource-manager/databoxedge/2022-03-01/devices/model_databoxedgedeviceextendedinfopatch.go index 2c17a01f322..54f13a08cba 100644 --- a/resource-manager/databoxedge/2022-03-01/devices/model_databoxedgedeviceextendedinfopatch.go +++ b/resource-manager/databoxedge/2022-03-01/devices/model_databoxedgedeviceextendedinfopatch.go @@ -7,6 +7,6 @@ type DataBoxEdgeDeviceExtendedInfoPatch struct { ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` ClientSecretStoreId *string `json:"clientSecretStoreId,omitempty"` - ClientSecretStoreUrl *string `json:"clientSecretStoreUrl,omitempty"` + ClientSecretStoreURL *string `json:"clientSecretStoreUrl,omitempty"` SyncStatus *KeyVaultSyncStatus `json:"syncStatus,omitempty"` } diff --git a/resource-manager/databoxedge/2022-03-01/devices/model_databoxedgedeviceextendedinfoproperties.go b/resource-manager/databoxedge/2022-03-01/devices/model_databoxedgedeviceextendedinfoproperties.go index 377a5796b40..3fcbcddecda 100644 --- a/resource-manager/databoxedge/2022-03-01/devices/model_databoxedgedeviceextendedinfoproperties.go +++ b/resource-manager/databoxedge/2022-03-01/devices/model_databoxedgedeviceextendedinfoproperties.go @@ -7,7 +7,7 @@ type DataBoxEdgeDeviceExtendedInfoProperties struct { ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` ClientSecretStoreId *string `json:"clientSecretStoreId,omitempty"` - ClientSecretStoreUrl *string `json:"clientSecretStoreUrl,omitempty"` + ClientSecretStoreURL *string `json:"clientSecretStoreUrl,omitempty"` CloudWitnessContainerName *string `json:"cloudWitnessContainerName,omitempty"` CloudWitnessStorageAccountName *string `json:"cloudWitnessStorageAccountName,omitempty"` CloudWitnessStorageEndpoint *string `json:"cloudWitnessStorageEndpoint,omitempty"` diff --git a/resource-manager/databoxedge/2022-03-01/diagnosticsettings/README.md b/resource-manager/databoxedge/2022-03-01/diagnosticsettings/README.md index ecf0bd2af87..3ecce08cfc8 100644 --- a/resource-manager/databoxedge/2022-03-01/diagnosticsettings/README.md +++ b/resource-manager/databoxedge/2022-03-01/diagnosticsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDiagnosticProactiveLogCollectionSettings(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDiagnosticRemoteSupportSettings(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := diagnosticsettings.DiagnosticProactiveLogCollectionSettings{ // ... @@ -73,7 +73,7 @@ if err := client.UpdateDiagnosticProactiveLogCollectionSettingsThenPoll(ctx, id, ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := diagnosticsettings.DiagnosticRemoteSupportSettings{ // ... diff --git a/resource-manager/databoxedge/2022-03-01/diagnosticsettings/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/diagnosticsettings/id_databoxedgedevice.go index ba09a0cab74..980cd98137e 100644 --- a/resource-manager/databoxedge/2022-03-01/diagnosticsettings/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/diagnosticsettings/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/diagnosticsettings/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/diagnosticsettings/id_databoxedgedevice_test.go index 32134b679eb..1f95240758b 100644 --- a/resource-manager/databoxedge/2022-03-01/diagnosticsettings/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/diagnosticsettings/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/jobs/README.md b/resource-manager/databoxedge/2022-03-01/jobs/README.md index ade2d45bdcd..aa8c4e742e4 100644 --- a/resource-manager/databoxedge/2022-03-01/jobs/README.md +++ b/resource-manager/databoxedge/2022-03-01/jobs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobs.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := jobs.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2022-03-01/jobs/id_job.go b/resource-manager/databoxedge/2022-03-01/jobs/id_job.go index f2ab8798927..b7fc9620ae4 100644 --- a/resource-manager/databoxedge/2022-03-01/jobs/id_job.go +++ b/resource-manager/databoxedge/2022-03-01/jobs/id_job.go @@ -121,9 +121,9 @@ func (id JobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticJobs", "jobs", "jobs"), - resourceids.UserSpecifiedSegment("jobName", "name"), + resourceids.UserSpecifiedSegment("jobName", "jobName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/jobs/id_job_test.go b/resource-manager/databoxedge/2022-03-01/jobs/id_job_test.go index 74c9947f809..b11e0b3edde 100644 --- a/resource-manager/databoxedge/2022-03-01/jobs/id_job_test.go +++ b/resource-manager/databoxedge/2022-03-01/jobs/id_job_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &JobId{} func TestNewJobID(t *testing.T) { - id := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.JobName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "name") + if id.JobName != "jobName" { + t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } } func TestFormatJobID(t *testing.T) { - actual := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name" + actual := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - JobName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + JobName: "jobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - JobName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + JobName: "jobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS/jObNaMe", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - JobName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + JobName: "jObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS/jObNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/monitoringconfig/README.md b/resource-manager/databoxedge/2022-03-01/monitoringconfig/README.md index 88bc88223a5..55d63968a0c 100644 --- a/resource-manager/databoxedge/2022-03-01/monitoringconfig/README.md +++ b/resource-manager/databoxedge/2022-03-01/monitoringconfig/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") payload := monitoringconfig.MonitoringMetricConfiguration{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/databoxedge/2022-03-01/monitoringconfig/id_role.go b/resource-manager/databoxedge/2022-03-01/monitoringconfig/id_role.go index 243e09fa51b..0adc2fcb125 100644 --- a/resource-manager/databoxedge/2022-03-01/monitoringconfig/id_role.go +++ b/resource-manager/databoxedge/2022-03-01/monitoringconfig/id_role.go @@ -121,9 +121,9 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), - resourceids.UserSpecifiedSegment("roleName", "name"), + resourceids.UserSpecifiedSegment("roleName", "roleName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/monitoringconfig/id_role_test.go b/resource-manager/databoxedge/2022-03-01/monitoringconfig/id_role_test.go index 626cc1793aa..ff6895da2da 100644 --- a/resource-manager/databoxedge/2022-03-01/monitoringconfig/id_role_test.go +++ b/resource-manager/databoxedge/2022-03-01/monitoringconfig/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.RoleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "name") + if id.RoleName != "roleName" { + t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "roleName") } } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - RoleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/nodes/README.md b/resource-manager/databoxedge/2022-03-01/nodes/README.md index 7d3d62c453f..f20cde38bba 100644 --- a/resource-manager/databoxedge/2022-03-01/nodes/README.md +++ b/resource-manager/databoxedge/2022-03-01/nodes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nodes.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := nodes.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2022-03-01/nodes/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/nodes/id_databoxedgedevice.go index 69e20c29386..7b40d74d15b 100644 --- a/resource-manager/databoxedge/2022-03-01/nodes/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/nodes/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/nodes/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/nodes/id_databoxedgedevice_test.go index d904d34a511..99fc3841dd6 100644 --- a/resource-manager/databoxedge/2022-03-01/nodes/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/nodes/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/orders/README.md b/resource-manager/databoxedge/2022-03-01/orders/README.md index bc287907c9c..dcaebd7cda8 100644 --- a/resource-manager/databoxedge/2022-03-01/orders/README.md +++ b/resource-manager/databoxedge/2022-03-01/orders/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := orders.Order{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.ListDCAccessCode(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2022-03-01/orders/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/orders/id_databoxedgedevice.go index 2d5c8c7ddf6..9886512c76f 100644 --- a/resource-manager/databoxedge/2022-03-01/orders/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/orders/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/orders/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/orders/id_databoxedgedevice_test.go index 19e9a928d12..6851a9df540 100644 --- a/resource-manager/databoxedge/2022-03-01/orders/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/orders/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/orders/model_trackinginfo.go b/resource-manager/databoxedge/2022-03-01/orders/model_trackinginfo.go index 5f899baae95..bbd7b1f5994 100644 --- a/resource-manager/databoxedge/2022-03-01/orders/model_trackinginfo.go +++ b/resource-manager/databoxedge/2022-03-01/orders/model_trackinginfo.go @@ -7,5 +7,5 @@ type TrackingInfo struct { CarrierName *string `json:"carrierName,omitempty"` SerialNumber *string `json:"serialNumber,omitempty"` TrackingId *string `json:"trackingId,omitempty"` - TrackingUrl *string `json:"trackingUrl,omitempty"` + TrackingURL *string `json:"trackingUrl,omitempty"` } diff --git a/resource-manager/databoxedge/2022-03-01/roles/README.md b/resource-manager/databoxedge/2022-03-01/roles/README.md index d8d474e16ed..be1e63bcbed 100644 --- a/resource-manager/databoxedge/2022-03-01/roles/README.md +++ b/resource-manager/databoxedge/2022-03-01/roles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") payload := roles.Role{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := roles.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := roles.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2022-03-01/roles/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/roles/id_databoxedgedevice.go index 197fe1be8fd..3266a6b8f0b 100644 --- a/resource-manager/databoxedge/2022-03-01/roles/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/roles/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/roles/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/roles/id_databoxedgedevice_test.go index 2d81ea2d76d..fafa4ca1c13 100644 --- a/resource-manager/databoxedge/2022-03-01/roles/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/roles/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/roles/id_role.go b/resource-manager/databoxedge/2022-03-01/roles/id_role.go index adb514576eb..706f5ef7a8d 100644 --- a/resource-manager/databoxedge/2022-03-01/roles/id_role.go +++ b/resource-manager/databoxedge/2022-03-01/roles/id_role.go @@ -121,9 +121,9 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), - resourceids.UserSpecifiedSegment("roleName", "name"), + resourceids.UserSpecifiedSegment("roleName", "roleName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/roles/id_role_test.go b/resource-manager/databoxedge/2022-03-01/roles/id_role_test.go index 95516abe80b..a8ab469d829 100644 --- a/resource-manager/databoxedge/2022-03-01/roles/id_role_test.go +++ b/resource-manager/databoxedge/2022-03-01/roles/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.RoleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "name") + if id.RoleName != "roleName" { + t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "roleName") } } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - RoleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/roles/model_imagerepositorycredential.go b/resource-manager/databoxedge/2022-03-01/roles/model_imagerepositorycredential.go index c12e0c94315..1d94d008851 100644 --- a/resource-manager/databoxedge/2022-03-01/roles/model_imagerepositorycredential.go +++ b/resource-manager/databoxedge/2022-03-01/roles/model_imagerepositorycredential.go @@ -4,7 +4,7 @@ package roles // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ImageRepositoryCredential struct { - ImageRepositoryUrl string `json:"imageRepositoryUrl"` + ImageRepositoryURL string `json:"imageRepositoryUrl"` Password *AsymmetricEncryptedSecret `json:"password,omitempty"` UserName string `json:"userName"` } diff --git a/resource-manager/databoxedge/2022-03-01/shares/README.md b/resource-manager/databoxedge/2022-03-01/shares/README.md index 86d9bbd72d4..5b8d244106d 100644 --- a/resource-manager/databoxedge/2022-03-01/shares/README.md +++ b/resource-manager/databoxedge/2022-03-01/shares/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") payload := shares.Share{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := shares.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := shares.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/databoxedge/2022-03-01/shares/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/shares/id_databoxedgedevice.go index 9517dbf8090..6198bc4c0b5 100644 --- a/resource-manager/databoxedge/2022-03-01/shares/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/shares/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/shares/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/shares/id_databoxedgedevice_test.go index aea194345a8..fb9b4c12b65 100644 --- a/resource-manager/databoxedge/2022-03-01/shares/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/shares/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/shares/id_share.go b/resource-manager/databoxedge/2022-03-01/shares/id_share.go index 4a84cda5833..cb0af998e81 100644 --- a/resource-manager/databoxedge/2022-03-01/shares/id_share.go +++ b/resource-manager/databoxedge/2022-03-01/shares/id_share.go @@ -121,9 +121,9 @@ func (id ShareId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticShares", "shares", "shares"), - resourceids.UserSpecifiedSegment("shareName", "name"), + resourceids.UserSpecifiedSegment("shareName", "shareName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/shares/id_share_test.go b/resource-manager/databoxedge/2022-03-01/shares/id_share_test.go index 74f716f006b..81c376cb17d 100644 --- a/resource-manager/databoxedge/2022-03-01/shares/id_share_test.go +++ b/resource-manager/databoxedge/2022-03-01/shares/id_share_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ShareId{} func TestNewShareID(t *testing.T) { - id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewShareID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.ShareName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ShareName'", id.ShareName, "name") + if id.ShareName != "shareName" { + t.Fatalf("Expected %q but got %q for Segment 'ShareName'", id.ShareName, "shareName") } } func TestFormatShareID(t *testing.T) { - actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name" + actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseShareID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - ShareName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseShareIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - ShareName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS/sHaReNaMe", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - ShareName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + ShareName: "sHaReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS/sHaReNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/README.md b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/README.md index da05f0cb973..6ff72e0f3a9 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/README.md +++ b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") payload := storageaccountcredentials.StorageAccountCredential{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := storageaccountcredentials.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_databoxedgedevice.go index 531f0753d2c..051a0a5b034 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_databoxedgedevice_test.go index a85599fda40..ea5be1f306b 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_storageaccountcredential.go b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_storageaccountcredential.go index 4fc0474ec8e..d7908dbf136 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_storageaccountcredential.go +++ b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_storageaccountcredential.go @@ -121,9 +121,9 @@ func (id StorageAccountCredentialId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccountCredentials", "storageAccountCredentials", "storageAccountCredentials"), - resourceids.UserSpecifiedSegment("storageAccountCredentialName", "name"), + resourceids.UserSpecifiedSegment("storageAccountCredentialName", "storageAccountCredentialName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_storageaccountcredential_test.go b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_storageaccountcredential_test.go index 360d63a4dd0..8754282d130 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_storageaccountcredential_test.go +++ b/resource-manager/databoxedge/2022-03-01/storageaccountcredentials/id_storageaccountcredential_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountCredentialId{} func TestNewStorageAccountCredentialID(t *testing.T) { - id := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewStorageAccountCredentialID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.StorageAccountCredentialName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountCredentialName'", id.StorageAccountCredentialName, "name") + if id.StorageAccountCredentialName != "storageAccountCredentialName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountCredentialName'", id.StorageAccountCredentialName, "storageAccountCredentialName") } } func TestFormatStorageAccountCredentialID(t *testing.T) { - actual := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name" + actual := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountCredentialID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - StorageAccountCredentialName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + StorageAccountCredentialName: "storageAccountCredentialName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountCredentialIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - StorageAccountCredentialName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + StorageAccountCredentialName: "storageAccountCredentialName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs/sToRaGeAcCoUnTcReDeNtIaLnAmE", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - StorageAccountCredentialName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + StorageAccountCredentialName: "sToRaGeAcCoUnTcReDeNtIaLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs/sToRaGeAcCoUnTcReDeNtIaLnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/storageaccounts/README.md b/resource-manager/databoxedge/2022-03-01/storageaccounts/README.md index 06bc462dde0..7a1fe4d095b 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccounts/README.md +++ b/resource-manager/databoxedge/2022-03-01/storageaccounts/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") payload := storageaccounts.StorageAccount{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := storageaccounts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := storageaccounts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2022-03-01/storageaccounts/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/storageaccounts/id_databoxedgedevice.go index f9d282c5a7e..512fb6fcd81 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccounts/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/storageaccounts/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/storageaccounts/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/storageaccounts/id_databoxedgedevice_test.go index 94b173558a3..10c168cc452 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccounts/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/storageaccounts/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/storageaccounts/id_storageaccount.go b/resource-manager/databoxedge/2022-03-01/storageaccounts/id_storageaccount.go index ceaefbfb0f0..d237cf8fd56 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccounts/id_storageaccount.go +++ b/resource-manager/databoxedge/2022-03-01/storageaccounts/id_storageaccount.go @@ -121,7 +121,7 @@ func (id StorageAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), } diff --git a/resource-manager/databoxedge/2022-03-01/storageaccounts/id_storageaccount_test.go b/resource-manager/databoxedge/2022-03-01/storageaccounts/id_storageaccount_test.go index 3f03bb4f0d2..0e8fbe54585 100644 --- a/resource-manager/databoxedge/2022-03-01/storageaccounts/id_storageaccount_test.go +++ b/resource-manager/databoxedge/2022-03-01/storageaccounts/id_storageaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountId{} func TestNewStorageAccountID(t *testing.T) { - id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") + id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -32,8 +32,8 @@ func TestNewStorageAccountID(t *testing.T) { } func TestFormatStorageAccountID(t *testing.T) { - actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName" + actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/supportpackages/README.md b/resource-manager/databoxedge/2022-03-01/supportpackages/README.md index d91d3973013..7910e096fbc 100644 --- a/resource-manager/databoxedge/2022-03-01/supportpackages/README.md +++ b/resource-manager/databoxedge/2022-03-01/supportpackages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := supportpackages.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := supportpackages.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := supportpackages.TriggerSupportPackageRequest{ // ... diff --git a/resource-manager/databoxedge/2022-03-01/supportpackages/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/supportpackages/id_databoxedgedevice.go index 8fe85584c50..b24d3bea878 100644 --- a/resource-manager/databoxedge/2022-03-01/supportpackages/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/supportpackages/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/supportpackages/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/supportpackages/id_databoxedgedevice_test.go index b19b0fadba7..ab4b9e7a8fe 100644 --- a/resource-manager/databoxedge/2022-03-01/supportpackages/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/supportpackages/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/triggers/README.md b/resource-manager/databoxedge/2022-03-01/triggers/README.md index 1f1d742f836..955992d136c 100644 --- a/resource-manager/databoxedge/2022-03-01/triggers/README.md +++ b/resource-manager/databoxedge/2022-03-01/triggers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") payload := triggers.Trigger{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := triggers.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := triggers.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id, triggers.DefaultListByDataBoxEdgeDeviceOperationOptions())` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id, triggers.DefaultListByDataBoxEdgeDeviceOperationOptions()) diff --git a/resource-manager/databoxedge/2022-03-01/triggers/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/triggers/id_databoxedgedevice.go index 2a7b0261a2c..2b5bc84233e 100644 --- a/resource-manager/databoxedge/2022-03-01/triggers/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/triggers/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/triggers/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/triggers/id_databoxedgedevice_test.go index 75429c6a00c..14d3eb5a289 100644 --- a/resource-manager/databoxedge/2022-03-01/triggers/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/triggers/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/triggers/id_trigger.go b/resource-manager/databoxedge/2022-03-01/triggers/id_trigger.go index a8ccd2b3e42..a3a8d6f22c3 100644 --- a/resource-manager/databoxedge/2022-03-01/triggers/id_trigger.go +++ b/resource-manager/databoxedge/2022-03-01/triggers/id_trigger.go @@ -121,9 +121,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), - resourceids.UserSpecifiedSegment("triggerName", "name"), + resourceids.UserSpecifiedSegment("triggerName", "triggerName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/triggers/id_trigger_test.go b/resource-manager/databoxedge/2022-03-01/triggers/id_trigger_test.go index 1c5cfaae7be..98cb8a0b1b8 100644 --- a/resource-manager/databoxedge/2022-03-01/triggers/id_trigger_test.go +++ b/resource-manager/databoxedge/2022-03-01/triggers/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.TriggerName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'TriggerName'", id.TriggerName, "name") + if id.TriggerName != "triggerName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggerName'", id.TriggerName, "triggerName") } } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - TriggerName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - TriggerName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - TriggerName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/users/README.md b/resource-manager/databoxedge/2022-03-01/users/README.md index d641e89e973..50a0bc4a7fb 100644 --- a/resource-manager/databoxedge/2022-03-01/users/README.md +++ b/resource-manager/databoxedge/2022-03-01/users/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") payload := users.User{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := users.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := users.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id, users.DefaultListByDataBoxEdgeDeviceOperationOptions())` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id, users.DefaultListByDataBoxEdgeDeviceOperationOptions()) diff --git a/resource-manager/databoxedge/2022-03-01/users/id_databoxedgedevice.go b/resource-manager/databoxedge/2022-03-01/users/id_databoxedgedevice.go index 3294352d71a..174cacd35d5 100644 --- a/resource-manager/databoxedge/2022-03-01/users/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2022-03-01/users/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/users/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2022-03-01/users/id_databoxedgedevice_test.go index b7e892a08e8..1192b9a5a99 100644 --- a/resource-manager/databoxedge/2022-03-01/users/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2022-03-01/users/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2022-03-01/users/id_user.go b/resource-manager/databoxedge/2022-03-01/users/id_user.go index 138411a0d48..1325a5bae94 100644 --- a/resource-manager/databoxedge/2022-03-01/users/id_user.go +++ b/resource-manager/databoxedge/2022-03-01/users/id_user.go @@ -121,9 +121,9 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "name"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/databoxedge/2022-03-01/users/id_user_test.go b/resource-manager/databoxedge/2022-03-01/users/id_user_test.go index 0b968336b13..c14aaa18c4d 100644 --- a/resource-manager/databoxedge/2022-03-01/users/id_user_test.go +++ b/resource-manager/databoxedge/2022-03-01/users/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.UserName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "name") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUserID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - UserName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - UserName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - UserName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/addons/README.md b/resource-manager/databoxedge/2023-07-01/addons/README.md index 231fff6ea01..dc78e25abb4 100644 --- a/resource-manager/databoxedge/2023-07-01/addons/README.md +++ b/resource-manager/databoxedge/2023-07-01/addons/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") payload := addons.Addon{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := addons.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") +id := addons.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") // alternatively `client.ListByRole(ctx, id)` can be used to do batched pagination items, err := client.ListByRoleComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-07-01/addons/id_addon.go b/resource-manager/databoxedge/2023-07-01/addons/id_addon.go index 4fd88976567..703deec398d 100644 --- a/resource-manager/databoxedge/2023-07-01/addons/id_addon.go +++ b/resource-manager/databoxedge/2023-07-01/addons/id_addon.go @@ -127,7 +127,7 @@ func (id AddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), resourceids.UserSpecifiedSegment("roleName", "roleName"), resourceids.StaticSegment("staticAddons", "addons", "addons"), diff --git a/resource-manager/databoxedge/2023-07-01/addons/id_addon_test.go b/resource-manager/databoxedge/2023-07-01/addons/id_addon_test.go index bcffdb293af..6c392a52c74 100644 --- a/resource-manager/databoxedge/2023-07-01/addons/id_addon_test.go +++ b/resource-manager/databoxedge/2023-07-01/addons/id_addon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AddonId{} func TestNewAddonID(t *testing.T) { - id := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") + id := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.RoleName != "roleName" { @@ -36,8 +36,8 @@ func TestNewAddonID(t *testing.T) { } func TestFormatAddonID(t *testing.T) { - actual := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName" + actual := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", AddonName: "addonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", AddonName: "addonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", RoleName: "rOlEnAmE", AddonName: "aDdOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/addons/id_role.go b/resource-manager/databoxedge/2023-07-01/addons/id_role.go index 42f4256cc29..cbe52077a18 100644 --- a/resource-manager/databoxedge/2023-07-01/addons/id_role.go +++ b/resource-manager/databoxedge/2023-07-01/addons/id_role.go @@ -121,7 +121,7 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), resourceids.UserSpecifiedSegment("roleName", "roleName"), } diff --git a/resource-manager/databoxedge/2023-07-01/addons/id_role_test.go b/resource-manager/databoxedge/2023-07-01/addons/id_role_test.go index 8dba9b4c259..5b7b8f82009 100644 --- a/resource-manager/databoxedge/2023-07-01/addons/id_role_test.go +++ b/resource-manager/databoxedge/2023-07-01/addons/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.RoleName != "roleName" { @@ -32,8 +32,8 @@ func TestNewRoleID(t *testing.T) { } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/alerts/README.md b/resource-manager/databoxedge/2023-07-01/alerts/README.md index 70061b9e07b..979ddc37568 100644 --- a/resource-manager/databoxedge/2023-07-01/alerts/README.md +++ b/resource-manager/databoxedge/2023-07-01/alerts/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := alerts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-07-01/alerts/id_alert.go b/resource-manager/databoxedge/2023-07-01/alerts/id_alert.go index a730d5e2274..263bc837fff 100644 --- a/resource-manager/databoxedge/2023-07-01/alerts/id_alert.go +++ b/resource-manager/databoxedge/2023-07-01/alerts/id_alert.go @@ -121,9 +121,9 @@ func (id AlertId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticAlerts", "alerts", "alerts"), - resourceids.UserSpecifiedSegment("alertName", "name"), + resourceids.UserSpecifiedSegment("alertName", "alertName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/alerts/id_alert_test.go b/resource-manager/databoxedge/2023-07-01/alerts/id_alert_test.go index 02b952e148d..930d5772864 100644 --- a/resource-manager/databoxedge/2023-07-01/alerts/id_alert_test.go +++ b/resource-manager/databoxedge/2023-07-01/alerts/id_alert_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AlertId{} func TestNewAlertID(t *testing.T) { - id := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAlertID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.AlertName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'AlertName'", id.AlertName, "name") + if id.AlertName != "alertName" { + t.Fatalf("Expected %q but got %q for Segment 'AlertName'", id.AlertName, "alertName") } } func TestFormatAlertID(t *testing.T) { - actual := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name" + actual := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAlertID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - AlertName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAlertIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - AlertName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS/aLeRtNaMe", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - AlertName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + AlertName: "aLeRtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS/aLeRtNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/alerts/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/alerts/id_databoxedgedevice.go index b5fcf00cb03..c7845ee88cc 100644 --- a/resource-manager/databoxedge/2023-07-01/alerts/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/alerts/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/alerts/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/alerts/id_databoxedgedevice_test.go index 04521a95a5a..53e2537956d 100644 --- a/resource-manager/databoxedge/2023-07-01/alerts/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/alerts/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/README.md b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/README.md index 8b51f321b90..01108be9776 100644 --- a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/README.md +++ b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") payload := bandwidthschedules.BandwidthSchedule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := bandwidthschedules.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_bandwidthschedule.go b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_bandwidthschedule.go index df13af7ee7e..41909024796 100644 --- a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_bandwidthschedule.go +++ b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_bandwidthschedule.go @@ -121,9 +121,9 @@ func (id BandwidthScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticBandwidthSchedules", "bandwidthSchedules", "bandwidthSchedules"), - resourceids.UserSpecifiedSegment("bandwidthScheduleName", "name"), + resourceids.UserSpecifiedSegment("bandwidthScheduleName", "bandwidthScheduleName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_bandwidthschedule_test.go b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_bandwidthschedule_test.go index 13514614bad..cf6ec10fcd4 100644 --- a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_bandwidthschedule_test.go +++ b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_bandwidthschedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BandwidthScheduleId{} func TestNewBandwidthScheduleID(t *testing.T) { - id := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewBandwidthScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.BandwidthScheduleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'BandwidthScheduleName'", id.BandwidthScheduleName, "name") + if id.BandwidthScheduleName != "bandwidthScheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'BandwidthScheduleName'", id.BandwidthScheduleName, "bandwidthScheduleName") } } func TestFormatBandwidthScheduleID(t *testing.T) { - actual := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name" + actual := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBandwidthScheduleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - BandwidthScheduleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + BandwidthScheduleName: "bandwidthScheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBandwidthScheduleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - BandwidthScheduleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + BandwidthScheduleName: "bandwidthScheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS/bAnDwIdThScHeDuLeNaMe", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - BandwidthScheduleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + BandwidthScheduleName: "bAnDwIdThScHeDuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS/bAnDwIdThScHeDuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_databoxedgedevice.go index 96dcf9e535c..59f1e5d0765 100644 --- a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_databoxedgedevice_test.go index 2ccabd5c76c..89880e9f8cf 100644 --- a/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/bandwidthschedules/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/containers/README.md b/resource-manager/databoxedge/2023-07-01/containers/README.md index 1d912565c80..3ea609376c1 100644 --- a/resource-manager/databoxedge/2023-07-01/containers/README.md +++ b/resource-manager/databoxedge/2023-07-01/containers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") payload := containers.Container{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containers.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := containers.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") // alternatively `client.ListByStorageAccount(ctx, id)` can be used to do batched pagination items, err := client.ListByStorageAccountComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/databoxedge/2023-07-01/containers/id_container.go b/resource-manager/databoxedge/2023-07-01/containers/id_container.go index 52bbd14a4ca..5186ea465a8 100644 --- a/resource-manager/databoxedge/2023-07-01/containers/id_container.go +++ b/resource-manager/databoxedge/2023-07-01/containers/id_container.go @@ -127,7 +127,7 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), diff --git a/resource-manager/databoxedge/2023-07-01/containers/id_container_test.go b/resource-manager/databoxedge/2023-07-01/containers/id_container_test.go index 4ca274bfae3..d0ba8742c62 100644 --- a/resource-manager/databoxedge/2023-07-01/containers/id_container_test.go +++ b/resource-manager/databoxedge/2023-07-01/containers/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/containers/id_storageaccount.go b/resource-manager/databoxedge/2023-07-01/containers/id_storageaccount.go index d50a0d70ff9..36b079935cc 100644 --- a/resource-manager/databoxedge/2023-07-01/containers/id_storageaccount.go +++ b/resource-manager/databoxedge/2023-07-01/containers/id_storageaccount.go @@ -121,7 +121,7 @@ func (id StorageAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), } diff --git a/resource-manager/databoxedge/2023-07-01/containers/id_storageaccount_test.go b/resource-manager/databoxedge/2023-07-01/containers/id_storageaccount_test.go index 4cb39161d5d..90f0b8f9a4e 100644 --- a/resource-manager/databoxedge/2023-07-01/containers/id_storageaccount_test.go +++ b/resource-manager/databoxedge/2023-07-01/containers/id_storageaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountId{} func TestNewStorageAccountID(t *testing.T) { - id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") + id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -32,8 +32,8 @@ func TestNewStorageAccountID(t *testing.T) { } func TestFormatStorageAccountID(t *testing.T) { - actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName" + actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/README.md b/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/README.md index 6f7021a8aba..d06323d316f 100644 --- a/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/README.md +++ b/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devicecapacitycheck.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devicecapacitycheck.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devicecapacitycheck.DeviceCapacityRequestInfo{ // ... diff --git a/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/id_databoxedgedevice.go index 226c9b858ed..b5e03fb1153 100644 --- a/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/id_databoxedgedevice_test.go index 2ef2ae0d7bd..21182e65d4b 100644 --- a/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/devicecapacitycheck/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/README.md b/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/README.md index b0d62db9e3d..23528a0f951 100644 --- a/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/README.md +++ b/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devicecapacityinfo.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devicecapacityinfo.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDeviceCapacityInfo(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/id_databoxedgedevice.go index 5e800fb6abd..39936712f1b 100644 --- a/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/id_databoxedgedevice_test.go index 7f5a848b33b..43c3cee23c5 100644 --- a/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/devicecapacityinfo/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/devices/README.md b/resource-manager/databoxedge/2023-07-01/devices/README.md index 857ca5493ec..953f937b4c9 100644 --- a/resource-manager/databoxedge/2023-07-01/devices/README.md +++ b/resource-manager/databoxedge/2023-07-01/devices/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDevice{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.SecuritySettings{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateSecuritySettingsThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -75,7 +75,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DownloadUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -87,7 +87,7 @@ if err := client.DownloadUpdatesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GenerateCertificate(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.Get(ctx, id) if err != nil { @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetExtendedInformation(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetNetworkSettings(ctx, id) if err != nil { @@ -151,7 +151,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetUpdateSummary(ctx, id) if err != nil { @@ -167,7 +167,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.InstallUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -213,7 +213,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.ScanForUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -225,7 +225,7 @@ if err := client.ScanForUpdatesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDevicePatch{ // ... @@ -246,7 +246,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDeviceExtendedInfoPatch{ // ... @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.UploadCertificateRequest{ // ... diff --git a/resource-manager/databoxedge/2023-07-01/devices/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/devices/id_databoxedgedevice.go index f03c67cea72..aa83e45ad1a 100644 --- a/resource-manager/databoxedge/2023-07-01/devices/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/devices/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/devices/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/devices/id_databoxedgedevice_test.go index 91650f6ae01..a9568fcc10d 100644 --- a/resource-manager/databoxedge/2023-07-01/devices/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/devices/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/devices/model_databoxedgedeviceextendedinfopatch.go b/resource-manager/databoxedge/2023-07-01/devices/model_databoxedgedeviceextendedinfopatch.go index 2c17a01f322..54f13a08cba 100644 --- a/resource-manager/databoxedge/2023-07-01/devices/model_databoxedgedeviceextendedinfopatch.go +++ b/resource-manager/databoxedge/2023-07-01/devices/model_databoxedgedeviceextendedinfopatch.go @@ -7,6 +7,6 @@ type DataBoxEdgeDeviceExtendedInfoPatch struct { ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` ClientSecretStoreId *string `json:"clientSecretStoreId,omitempty"` - ClientSecretStoreUrl *string `json:"clientSecretStoreUrl,omitempty"` + ClientSecretStoreURL *string `json:"clientSecretStoreUrl,omitempty"` SyncStatus *KeyVaultSyncStatus `json:"syncStatus,omitempty"` } diff --git a/resource-manager/databoxedge/2023-07-01/devices/model_databoxedgedeviceextendedinfoproperties.go b/resource-manager/databoxedge/2023-07-01/devices/model_databoxedgedeviceextendedinfoproperties.go index 377a5796b40..3fcbcddecda 100644 --- a/resource-manager/databoxedge/2023-07-01/devices/model_databoxedgedeviceextendedinfoproperties.go +++ b/resource-manager/databoxedge/2023-07-01/devices/model_databoxedgedeviceextendedinfoproperties.go @@ -7,7 +7,7 @@ type DataBoxEdgeDeviceExtendedInfoProperties struct { ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` ClientSecretStoreId *string `json:"clientSecretStoreId,omitempty"` - ClientSecretStoreUrl *string `json:"clientSecretStoreUrl,omitempty"` + ClientSecretStoreURL *string `json:"clientSecretStoreUrl,omitempty"` CloudWitnessContainerName *string `json:"cloudWitnessContainerName,omitempty"` CloudWitnessStorageAccountName *string `json:"cloudWitnessStorageAccountName,omitempty"` CloudWitnessStorageEndpoint *string `json:"cloudWitnessStorageEndpoint,omitempty"` diff --git a/resource-manager/databoxedge/2023-07-01/diagnosticsettings/README.md b/resource-manager/databoxedge/2023-07-01/diagnosticsettings/README.md index ac6531e5c47..931c38b350c 100644 --- a/resource-manager/databoxedge/2023-07-01/diagnosticsettings/README.md +++ b/resource-manager/databoxedge/2023-07-01/diagnosticsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDiagnosticProactiveLogCollectionSettings(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDiagnosticRemoteSupportSettings(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := diagnosticsettings.DiagnosticProactiveLogCollectionSettings{ // ... @@ -73,7 +73,7 @@ if err := client.UpdateDiagnosticProactiveLogCollectionSettingsThenPoll(ctx, id, ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := diagnosticsettings.DiagnosticRemoteSupportSettings{ // ... diff --git a/resource-manager/databoxedge/2023-07-01/diagnosticsettings/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/diagnosticsettings/id_databoxedgedevice.go index ba09a0cab74..980cd98137e 100644 --- a/resource-manager/databoxedge/2023-07-01/diagnosticsettings/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/diagnosticsettings/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/diagnosticsettings/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/diagnosticsettings/id_databoxedgedevice_test.go index 32134b679eb..1f95240758b 100644 --- a/resource-manager/databoxedge/2023-07-01/diagnosticsettings/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/diagnosticsettings/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/jobs/README.md b/resource-manager/databoxedge/2023-07-01/jobs/README.md index 2252288e5a5..1d54ece43ab 100644 --- a/resource-manager/databoxedge/2023-07-01/jobs/README.md +++ b/resource-manager/databoxedge/2023-07-01/jobs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobs.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := jobs.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2023-07-01/jobs/id_job.go b/resource-manager/databoxedge/2023-07-01/jobs/id_job.go index f2ab8798927..b7fc9620ae4 100644 --- a/resource-manager/databoxedge/2023-07-01/jobs/id_job.go +++ b/resource-manager/databoxedge/2023-07-01/jobs/id_job.go @@ -121,9 +121,9 @@ func (id JobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticJobs", "jobs", "jobs"), - resourceids.UserSpecifiedSegment("jobName", "name"), + resourceids.UserSpecifiedSegment("jobName", "jobName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/jobs/id_job_test.go b/resource-manager/databoxedge/2023-07-01/jobs/id_job_test.go index 74c9947f809..b11e0b3edde 100644 --- a/resource-manager/databoxedge/2023-07-01/jobs/id_job_test.go +++ b/resource-manager/databoxedge/2023-07-01/jobs/id_job_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &JobId{} func TestNewJobID(t *testing.T) { - id := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.JobName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "name") + if id.JobName != "jobName" { + t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } } func TestFormatJobID(t *testing.T) { - actual := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name" + actual := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - JobName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + JobName: "jobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - JobName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + JobName: "jobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS/jObNaMe", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - JobName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + JobName: "jObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS/jObNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/monitoringconfig/README.md b/resource-manager/databoxedge/2023-07-01/monitoringconfig/README.md index d447c2789a4..41612cd95f7 100644 --- a/resource-manager/databoxedge/2023-07-01/monitoringconfig/README.md +++ b/resource-manager/databoxedge/2023-07-01/monitoringconfig/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") payload := monitoringconfig.MonitoringMetricConfiguration{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-07-01/monitoringconfig/id_role.go b/resource-manager/databoxedge/2023-07-01/monitoringconfig/id_role.go index 458f4c54eb4..0adc2fcb125 100644 --- a/resource-manager/databoxedge/2023-07-01/monitoringconfig/id_role.go +++ b/resource-manager/databoxedge/2023-07-01/monitoringconfig/id_role.go @@ -121,7 +121,7 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), resourceids.UserSpecifiedSegment("roleName", "roleName"), } diff --git a/resource-manager/databoxedge/2023-07-01/monitoringconfig/id_role_test.go b/resource-manager/databoxedge/2023-07-01/monitoringconfig/id_role_test.go index 5e2cb7e6b5c..ff6895da2da 100644 --- a/resource-manager/databoxedge/2023-07-01/monitoringconfig/id_role_test.go +++ b/resource-manager/databoxedge/2023-07-01/monitoringconfig/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.RoleName != "roleName" { @@ -32,8 +32,8 @@ func TestNewRoleID(t *testing.T) { } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/nodes/README.md b/resource-manager/databoxedge/2023-07-01/nodes/README.md index 00a4aed7728..6d138eebed9 100644 --- a/resource-manager/databoxedge/2023-07-01/nodes/README.md +++ b/resource-manager/databoxedge/2023-07-01/nodes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nodes.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := nodes.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-07-01/nodes/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/nodes/id_databoxedgedevice.go index 69e20c29386..7b40d74d15b 100644 --- a/resource-manager/databoxedge/2023-07-01/nodes/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/nodes/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/nodes/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/nodes/id_databoxedgedevice_test.go index d904d34a511..99fc3841dd6 100644 --- a/resource-manager/databoxedge/2023-07-01/nodes/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/nodes/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/orders/README.md b/resource-manager/databoxedge/2023-07-01/orders/README.md index 26c9dafd5e0..dc52eec2158 100644 --- a/resource-manager/databoxedge/2023-07-01/orders/README.md +++ b/resource-manager/databoxedge/2023-07-01/orders/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := orders.Order{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.ListDCAccessCode(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2023-07-01/orders/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/orders/id_databoxedgedevice.go index 2d5c8c7ddf6..9886512c76f 100644 --- a/resource-manager/databoxedge/2023-07-01/orders/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/orders/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/orders/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/orders/id_databoxedgedevice_test.go index 19e9a928d12..6851a9df540 100644 --- a/resource-manager/databoxedge/2023-07-01/orders/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/orders/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/orders/model_trackinginfo.go b/resource-manager/databoxedge/2023-07-01/orders/model_trackinginfo.go index 5f899baae95..bbd7b1f5994 100644 --- a/resource-manager/databoxedge/2023-07-01/orders/model_trackinginfo.go +++ b/resource-manager/databoxedge/2023-07-01/orders/model_trackinginfo.go @@ -7,5 +7,5 @@ type TrackingInfo struct { CarrierName *string `json:"carrierName,omitempty"` SerialNumber *string `json:"serialNumber,omitempty"` TrackingId *string `json:"trackingId,omitempty"` - TrackingUrl *string `json:"trackingUrl,omitempty"` + TrackingURL *string `json:"trackingUrl,omitempty"` } diff --git a/resource-manager/databoxedge/2023-07-01/roles/README.md b/resource-manager/databoxedge/2023-07-01/roles/README.md index af4fd9d6171..2d137f11cb6 100644 --- a/resource-manager/databoxedge/2023-07-01/roles/README.md +++ b/resource-manager/databoxedge/2023-07-01/roles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") payload := roles.Role{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := roles.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := roles.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-07-01/roles/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/roles/id_databoxedgedevice.go index 197fe1be8fd..3266a6b8f0b 100644 --- a/resource-manager/databoxedge/2023-07-01/roles/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/roles/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/roles/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/roles/id_databoxedgedevice_test.go index 2d81ea2d76d..fafa4ca1c13 100644 --- a/resource-manager/databoxedge/2023-07-01/roles/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/roles/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/roles/id_role.go b/resource-manager/databoxedge/2023-07-01/roles/id_role.go index 1a1de7ae3aa..706f5ef7a8d 100644 --- a/resource-manager/databoxedge/2023-07-01/roles/id_role.go +++ b/resource-manager/databoxedge/2023-07-01/roles/id_role.go @@ -121,7 +121,7 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), resourceids.UserSpecifiedSegment("roleName", "roleName"), } diff --git a/resource-manager/databoxedge/2023-07-01/roles/id_role_test.go b/resource-manager/databoxedge/2023-07-01/roles/id_role_test.go index e4619476ed0..a8ab469d829 100644 --- a/resource-manager/databoxedge/2023-07-01/roles/id_role_test.go +++ b/resource-manager/databoxedge/2023-07-01/roles/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.RoleName != "roleName" { @@ -32,8 +32,8 @@ func TestNewRoleID(t *testing.T) { } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/roles/model_imagerepositorycredential.go b/resource-manager/databoxedge/2023-07-01/roles/model_imagerepositorycredential.go index c12e0c94315..1d94d008851 100644 --- a/resource-manager/databoxedge/2023-07-01/roles/model_imagerepositorycredential.go +++ b/resource-manager/databoxedge/2023-07-01/roles/model_imagerepositorycredential.go @@ -4,7 +4,7 @@ package roles // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ImageRepositoryCredential struct { - ImageRepositoryUrl string `json:"imageRepositoryUrl"` + ImageRepositoryURL string `json:"imageRepositoryUrl"` Password *AsymmetricEncryptedSecret `json:"password,omitempty"` UserName string `json:"userName"` } diff --git a/resource-manager/databoxedge/2023-07-01/shares/README.md b/resource-manager/databoxedge/2023-07-01/shares/README.md index fe603902428..1702457b768 100644 --- a/resource-manager/databoxedge/2023-07-01/shares/README.md +++ b/resource-manager/databoxedge/2023-07-01/shares/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") payload := shares.Share{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := shares.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := shares.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/databoxedge/2023-07-01/shares/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/shares/id_databoxedgedevice.go index 9517dbf8090..6198bc4c0b5 100644 --- a/resource-manager/databoxedge/2023-07-01/shares/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/shares/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/shares/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/shares/id_databoxedgedevice_test.go index aea194345a8..fb9b4c12b65 100644 --- a/resource-manager/databoxedge/2023-07-01/shares/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/shares/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/shares/id_share.go b/resource-manager/databoxedge/2023-07-01/shares/id_share.go index 4a84cda5833..cb0af998e81 100644 --- a/resource-manager/databoxedge/2023-07-01/shares/id_share.go +++ b/resource-manager/databoxedge/2023-07-01/shares/id_share.go @@ -121,9 +121,9 @@ func (id ShareId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticShares", "shares", "shares"), - resourceids.UserSpecifiedSegment("shareName", "name"), + resourceids.UserSpecifiedSegment("shareName", "shareName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/shares/id_share_test.go b/resource-manager/databoxedge/2023-07-01/shares/id_share_test.go index 74f716f006b..81c376cb17d 100644 --- a/resource-manager/databoxedge/2023-07-01/shares/id_share_test.go +++ b/resource-manager/databoxedge/2023-07-01/shares/id_share_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ShareId{} func TestNewShareID(t *testing.T) { - id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewShareID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.ShareName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ShareName'", id.ShareName, "name") + if id.ShareName != "shareName" { + t.Fatalf("Expected %q but got %q for Segment 'ShareName'", id.ShareName, "shareName") } } func TestFormatShareID(t *testing.T) { - actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name" + actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseShareID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - ShareName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseShareIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - ShareName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS/sHaReNaMe", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - ShareName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + ShareName: "sHaReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS/sHaReNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/README.md b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/README.md index 6a04a67ebf1..ad6f507d0b8 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/README.md +++ b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") payload := storageaccountcredentials.StorageAccountCredential{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := storageaccountcredentials.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_databoxedgedevice.go index 531f0753d2c..051a0a5b034 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_databoxedgedevice_test.go index a85599fda40..ea5be1f306b 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_storageaccountcredential.go b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_storageaccountcredential.go index 4fc0474ec8e..d7908dbf136 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_storageaccountcredential.go +++ b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_storageaccountcredential.go @@ -121,9 +121,9 @@ func (id StorageAccountCredentialId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccountCredentials", "storageAccountCredentials", "storageAccountCredentials"), - resourceids.UserSpecifiedSegment("storageAccountCredentialName", "name"), + resourceids.UserSpecifiedSegment("storageAccountCredentialName", "storageAccountCredentialName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_storageaccountcredential_test.go b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_storageaccountcredential_test.go index 360d63a4dd0..8754282d130 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_storageaccountcredential_test.go +++ b/resource-manager/databoxedge/2023-07-01/storageaccountcredentials/id_storageaccountcredential_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountCredentialId{} func TestNewStorageAccountCredentialID(t *testing.T) { - id := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewStorageAccountCredentialID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.StorageAccountCredentialName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountCredentialName'", id.StorageAccountCredentialName, "name") + if id.StorageAccountCredentialName != "storageAccountCredentialName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountCredentialName'", id.StorageAccountCredentialName, "storageAccountCredentialName") } } func TestFormatStorageAccountCredentialID(t *testing.T) { - actual := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name" + actual := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountCredentialID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - StorageAccountCredentialName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + StorageAccountCredentialName: "storageAccountCredentialName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountCredentialIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - StorageAccountCredentialName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + StorageAccountCredentialName: "storageAccountCredentialName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs/sToRaGeAcCoUnTcReDeNtIaLnAmE", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - StorageAccountCredentialName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + StorageAccountCredentialName: "sToRaGeAcCoUnTcReDeNtIaLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs/sToRaGeAcCoUnTcReDeNtIaLnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/storageaccounts/README.md b/resource-manager/databoxedge/2023-07-01/storageaccounts/README.md index c7b9f2d9c82..fd2edebcf7c 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccounts/README.md +++ b/resource-manager/databoxedge/2023-07-01/storageaccounts/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") payload := storageaccounts.StorageAccount{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := storageaccounts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := storageaccounts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-07-01/storageaccounts/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/storageaccounts/id_databoxedgedevice.go index f9d282c5a7e..512fb6fcd81 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccounts/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/storageaccounts/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/storageaccounts/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/storageaccounts/id_databoxedgedevice_test.go index 94b173558a3..10c168cc452 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccounts/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/storageaccounts/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/storageaccounts/id_storageaccount.go b/resource-manager/databoxedge/2023-07-01/storageaccounts/id_storageaccount.go index ceaefbfb0f0..d237cf8fd56 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccounts/id_storageaccount.go +++ b/resource-manager/databoxedge/2023-07-01/storageaccounts/id_storageaccount.go @@ -121,7 +121,7 @@ func (id StorageAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), } diff --git a/resource-manager/databoxedge/2023-07-01/storageaccounts/id_storageaccount_test.go b/resource-manager/databoxedge/2023-07-01/storageaccounts/id_storageaccount_test.go index 3f03bb4f0d2..0e8fbe54585 100644 --- a/resource-manager/databoxedge/2023-07-01/storageaccounts/id_storageaccount_test.go +++ b/resource-manager/databoxedge/2023-07-01/storageaccounts/id_storageaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountId{} func TestNewStorageAccountID(t *testing.T) { - id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") + id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -32,8 +32,8 @@ func TestNewStorageAccountID(t *testing.T) { } func TestFormatStorageAccountID(t *testing.T) { - actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName" + actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/supportpackages/README.md b/resource-manager/databoxedge/2023-07-01/supportpackages/README.md index ab61b5a55a5..939097cf9e8 100644 --- a/resource-manager/databoxedge/2023-07-01/supportpackages/README.md +++ b/resource-manager/databoxedge/2023-07-01/supportpackages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := supportpackages.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := supportpackages.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := supportpackages.TriggerSupportPackageRequest{ // ... diff --git a/resource-manager/databoxedge/2023-07-01/supportpackages/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/supportpackages/id_databoxedgedevice.go index 8fe85584c50..b24d3bea878 100644 --- a/resource-manager/databoxedge/2023-07-01/supportpackages/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/supportpackages/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/supportpackages/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/supportpackages/id_databoxedgedevice_test.go index b19b0fadba7..ab4b9e7a8fe 100644 --- a/resource-manager/databoxedge/2023-07-01/supportpackages/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/supportpackages/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/triggers/README.md b/resource-manager/databoxedge/2023-07-01/triggers/README.md index 92a6f7d895d..684df87f4c6 100644 --- a/resource-manager/databoxedge/2023-07-01/triggers/README.md +++ b/resource-manager/databoxedge/2023-07-01/triggers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") payload := triggers.Trigger{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := triggers.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := triggers.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id, triggers.DefaultListByDataBoxEdgeDeviceOperationOptions())` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id, triggers.DefaultListByDataBoxEdgeDeviceOperationOptions()) diff --git a/resource-manager/databoxedge/2023-07-01/triggers/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/triggers/id_databoxedgedevice.go index 2a7b0261a2c..2b5bc84233e 100644 --- a/resource-manager/databoxedge/2023-07-01/triggers/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/triggers/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/triggers/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/triggers/id_databoxedgedevice_test.go index 75429c6a00c..14d3eb5a289 100644 --- a/resource-manager/databoxedge/2023-07-01/triggers/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/triggers/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/triggers/id_trigger.go b/resource-manager/databoxedge/2023-07-01/triggers/id_trigger.go index a8ccd2b3e42..a3a8d6f22c3 100644 --- a/resource-manager/databoxedge/2023-07-01/triggers/id_trigger.go +++ b/resource-manager/databoxedge/2023-07-01/triggers/id_trigger.go @@ -121,9 +121,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), - resourceids.UserSpecifiedSegment("triggerName", "name"), + resourceids.UserSpecifiedSegment("triggerName", "triggerName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/triggers/id_trigger_test.go b/resource-manager/databoxedge/2023-07-01/triggers/id_trigger_test.go index 1c5cfaae7be..98cb8a0b1b8 100644 --- a/resource-manager/databoxedge/2023-07-01/triggers/id_trigger_test.go +++ b/resource-manager/databoxedge/2023-07-01/triggers/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.TriggerName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'TriggerName'", id.TriggerName, "name") + if id.TriggerName != "triggerName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggerName'", id.TriggerName, "triggerName") } } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - TriggerName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - TriggerName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - TriggerName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/users/README.md b/resource-manager/databoxedge/2023-07-01/users/README.md index e9ee2ea6987..af30e2090e6 100644 --- a/resource-manager/databoxedge/2023-07-01/users/README.md +++ b/resource-manager/databoxedge/2023-07-01/users/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") payload := users.User{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := users.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := users.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id, users.DefaultListByDataBoxEdgeDeviceOperationOptions())` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id, users.DefaultListByDataBoxEdgeDeviceOperationOptions()) diff --git a/resource-manager/databoxedge/2023-07-01/users/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-07-01/users/id_databoxedgedevice.go index 3294352d71a..174cacd35d5 100644 --- a/resource-manager/databoxedge/2023-07-01/users/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-07-01/users/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/users/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-07-01/users/id_databoxedgedevice_test.go index b7e892a08e8..1192b9a5a99 100644 --- a/resource-manager/databoxedge/2023-07-01/users/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-07-01/users/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-07-01/users/id_user.go b/resource-manager/databoxedge/2023-07-01/users/id_user.go index 138411a0d48..1325a5bae94 100644 --- a/resource-manager/databoxedge/2023-07-01/users/id_user.go +++ b/resource-manager/databoxedge/2023-07-01/users/id_user.go @@ -121,9 +121,9 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "name"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/databoxedge/2023-07-01/users/id_user_test.go b/resource-manager/databoxedge/2023-07-01/users/id_user_test.go index 0b968336b13..c14aaa18c4d 100644 --- a/resource-manager/databoxedge/2023-07-01/users/id_user_test.go +++ b/resource-manager/databoxedge/2023-07-01/users/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.UserName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "name") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUserID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - UserName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - UserName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - UserName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/addons/README.md b/resource-manager/databoxedge/2023-12-01/addons/README.md index 2101150f2f2..cc8b20c542f 100644 --- a/resource-manager/databoxedge/2023-12-01/addons/README.md +++ b/resource-manager/databoxedge/2023-12-01/addons/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") payload := addons.Addon{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") +id := addons.NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := addons.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := addons.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") // alternatively `client.ListByRole(ctx, id)` can be used to do batched pagination items, err := client.ListByRoleComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-12-01/addons/id_addon.go b/resource-manager/databoxedge/2023-12-01/addons/id_addon.go index 4fd88976567..703deec398d 100644 --- a/resource-manager/databoxedge/2023-12-01/addons/id_addon.go +++ b/resource-manager/databoxedge/2023-12-01/addons/id_addon.go @@ -127,7 +127,7 @@ func (id AddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), resourceids.UserSpecifiedSegment("roleName", "roleName"), resourceids.StaticSegment("staticAddons", "addons", "addons"), diff --git a/resource-manager/databoxedge/2023-12-01/addons/id_addon_test.go b/resource-manager/databoxedge/2023-12-01/addons/id_addon_test.go index bcffdb293af..6c392a52c74 100644 --- a/resource-manager/databoxedge/2023-12-01/addons/id_addon_test.go +++ b/resource-manager/databoxedge/2023-12-01/addons/id_addon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AddonId{} func TestNewAddonID(t *testing.T) { - id := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName") + id := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.RoleName != "roleName" { @@ -36,8 +36,8 @@ func TestNewAddonID(t *testing.T) { } func TestFormatAddonID(t *testing.T) { - actual := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "roleName", "addonName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName" + actual := NewAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName", "addonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", AddonName: "addonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", RoleName: "roleName", AddonName: "addonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/roleName/addons/addonName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/addons/addonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe", Expected: &AddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", RoleName: "rOlEnAmE", AddonName: "aDdOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/aDdOnS/aDdOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/addons/id_role.go b/resource-manager/databoxedge/2023-12-01/addons/id_role.go index bba3763684b..cbe52077a18 100644 --- a/resource-manager/databoxedge/2023-12-01/addons/id_role.go +++ b/resource-manager/databoxedge/2023-12-01/addons/id_role.go @@ -121,9 +121,9 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), - resourceids.UserSpecifiedSegment("roleName", "name"), + resourceids.UserSpecifiedSegment("roleName", "roleName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/addons/id_role_test.go b/resource-manager/databoxedge/2023-12-01/addons/id_role_test.go index 67cd0e066de..5b7b8f82009 100644 --- a/resource-manager/databoxedge/2023-12-01/addons/id_role_test.go +++ b/resource-manager/databoxedge/2023-12-01/addons/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.RoleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "name") + if id.RoleName != "roleName" { + t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "roleName") } } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - RoleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/alerts/README.md b/resource-manager/databoxedge/2023-12-01/alerts/README.md index a7c9df3a545..93d77112721 100644 --- a/resource-manager/databoxedge/2023-12-01/alerts/README.md +++ b/resource-manager/databoxedge/2023-12-01/alerts/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := alerts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-12-01/alerts/id_alert.go b/resource-manager/databoxedge/2023-12-01/alerts/id_alert.go index a730d5e2274..263bc837fff 100644 --- a/resource-manager/databoxedge/2023-12-01/alerts/id_alert.go +++ b/resource-manager/databoxedge/2023-12-01/alerts/id_alert.go @@ -121,9 +121,9 @@ func (id AlertId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticAlerts", "alerts", "alerts"), - resourceids.UserSpecifiedSegment("alertName", "name"), + resourceids.UserSpecifiedSegment("alertName", "alertName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/alerts/id_alert_test.go b/resource-manager/databoxedge/2023-12-01/alerts/id_alert_test.go index 02b952e148d..930d5772864 100644 --- a/resource-manager/databoxedge/2023-12-01/alerts/id_alert_test.go +++ b/resource-manager/databoxedge/2023-12-01/alerts/id_alert_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AlertId{} func TestNewAlertID(t *testing.T) { - id := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAlertID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.AlertName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'AlertName'", id.AlertName, "name") + if id.AlertName != "alertName" { + t.Fatalf("Expected %q but got %q for Segment 'AlertName'", id.AlertName, "alertName") } } func TestFormatAlertID(t *testing.T) { - actual := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name" + actual := NewAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "alertName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAlertID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - AlertName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAlertIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - AlertName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/alerts/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/alerts/alertName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS/aLeRtNaMe", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - AlertName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + AlertName: "aLeRtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/aLeRtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/aLeRtS/aLeRtNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/alerts/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/alerts/id_databoxedgedevice.go index b5fcf00cb03..c7845ee88cc 100644 --- a/resource-manager/databoxedge/2023-12-01/alerts/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/alerts/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/alerts/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/alerts/id_databoxedgedevice_test.go index 04521a95a5a..53e2537956d 100644 --- a/resource-manager/databoxedge/2023-12-01/alerts/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/alerts/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/README.md b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/README.md index 605fa670d62..843c06604cf 100644 --- a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/README.md +++ b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") payload := bandwidthschedules.BandwidthSchedule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := bandwidthschedules.NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := bandwidthschedules.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := bandwidthschedules.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_bandwidthschedule.go b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_bandwidthschedule.go index df13af7ee7e..41909024796 100644 --- a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_bandwidthschedule.go +++ b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_bandwidthschedule.go @@ -121,9 +121,9 @@ func (id BandwidthScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticBandwidthSchedules", "bandwidthSchedules", "bandwidthSchedules"), - resourceids.UserSpecifiedSegment("bandwidthScheduleName", "name"), + resourceids.UserSpecifiedSegment("bandwidthScheduleName", "bandwidthScheduleName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_bandwidthschedule_test.go b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_bandwidthschedule_test.go index 13514614bad..cf6ec10fcd4 100644 --- a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_bandwidthschedule_test.go +++ b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_bandwidthschedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BandwidthScheduleId{} func TestNewBandwidthScheduleID(t *testing.T) { - id := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewBandwidthScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.BandwidthScheduleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'BandwidthScheduleName'", id.BandwidthScheduleName, "name") + if id.BandwidthScheduleName != "bandwidthScheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'BandwidthScheduleName'", id.BandwidthScheduleName, "bandwidthScheduleName") } } func TestFormatBandwidthScheduleID(t *testing.T) { - actual := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name" + actual := NewBandwidthScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "bandwidthScheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBandwidthScheduleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - BandwidthScheduleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + BandwidthScheduleName: "bandwidthScheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBandwidthScheduleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - BandwidthScheduleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + BandwidthScheduleName: "bandwidthScheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/bandwidthSchedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/bandwidthSchedules/bandwidthScheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS/bAnDwIdThScHeDuLeNaMe", Expected: &BandwidthScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - BandwidthScheduleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + BandwidthScheduleName: "bAnDwIdThScHeDuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/bAnDwIdThScHeDuLeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/bAnDwIdThScHeDuLeS/bAnDwIdThScHeDuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_databoxedgedevice.go index 96dcf9e535c..59f1e5d0765 100644 --- a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_databoxedgedevice_test.go index 2ccabd5c76c..89880e9f8cf 100644 --- a/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/bandwidthschedules/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/containers/README.md b/resource-manager/databoxedge/2023-12-01/containers/README.md index 1661c72896d..7ff3743dd74 100644 --- a/resource-manager/databoxedge/2023-12-01/containers/README.md +++ b/resource-manager/databoxedge/2023-12-01/containers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") payload := containers.Container{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containers.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := containers.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") // alternatively `client.ListByStorageAccount(ctx, id)` can be used to do batched pagination items, err := client.ListByStorageAccountComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") +id := containers.NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/databoxedge/2023-12-01/containers/id_container.go b/resource-manager/databoxedge/2023-12-01/containers/id_container.go index 52bbd14a4ca..5186ea465a8 100644 --- a/resource-manager/databoxedge/2023-12-01/containers/id_container.go +++ b/resource-manager/databoxedge/2023-12-01/containers/id_container.go @@ -127,7 +127,7 @@ func (id ContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticContainers", "containers", "containers"), diff --git a/resource-manager/databoxedge/2023-12-01/containers/id_container_test.go b/resource-manager/databoxedge/2023-12-01/containers/id_container_test.go index 4ca274bfae3..d0ba8742c62 100644 --- a/resource-manager/databoxedge/2023-12-01/containers/id_container_test.go +++ b/resource-manager/databoxedge/2023-12-01/containers/id_container_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContainerId{} func TestNewContainerID(t *testing.T) { - id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName") + id := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -36,8 +36,8 @@ func TestNewContainerID(t *testing.T) { } func TestFormatContainerID(t *testing.T) { - actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName" + actual := NewContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName", "containerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", ContainerName: "containerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/containers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/containers/containerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe", Expected: &ContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", ContainerName: "cOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/cOnTaInErS/cOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/containers/id_storageaccount.go b/resource-manager/databoxedge/2023-12-01/containers/id_storageaccount.go index d50a0d70ff9..36b079935cc 100644 --- a/resource-manager/databoxedge/2023-12-01/containers/id_storageaccount.go +++ b/resource-manager/databoxedge/2023-12-01/containers/id_storageaccount.go @@ -121,7 +121,7 @@ func (id StorageAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), } diff --git a/resource-manager/databoxedge/2023-12-01/containers/id_storageaccount_test.go b/resource-manager/databoxedge/2023-12-01/containers/id_storageaccount_test.go index 4cb39161d5d..90f0b8f9a4e 100644 --- a/resource-manager/databoxedge/2023-12-01/containers/id_storageaccount_test.go +++ b/resource-manager/databoxedge/2023-12-01/containers/id_storageaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountId{} func TestNewStorageAccountID(t *testing.T) { - id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") + id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -32,8 +32,8 @@ func TestNewStorageAccountID(t *testing.T) { } func TestFormatStorageAccountID(t *testing.T) { - actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName" + actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/README.md b/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/README.md index 6a9cbfa3eb0..961f0da1fbc 100644 --- a/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/README.md +++ b/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devicecapacitycheck.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devicecapacitycheck.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devicecapacitycheck.DeviceCapacityRequestInfo{ // ... diff --git a/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/id_databoxedgedevice.go index 226c9b858ed..b5e03fb1153 100644 --- a/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/id_databoxedgedevice_test.go index 2ef2ae0d7bd..21182e65d4b 100644 --- a/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/devicecapacitycheck/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/README.md b/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/README.md index 187d2edaa03..ed5c9dde90b 100644 --- a/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/README.md +++ b/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devicecapacityinfo.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devicecapacityinfo.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDeviceCapacityInfo(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/id_databoxedgedevice.go index 5e800fb6abd..39936712f1b 100644 --- a/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/id_databoxedgedevice_test.go index 7f5a848b33b..43c3cee23c5 100644 --- a/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/devicecapacityinfo/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/devices/README.md b/resource-manager/databoxedge/2023-12-01/devices/README.md index 9a70e58c408..19ad9df6396 100644 --- a/resource-manager/databoxedge/2023-12-01/devices/README.md +++ b/resource-manager/databoxedge/2023-12-01/devices/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDevice{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.SecuritySettings{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateSecuritySettingsThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -75,7 +75,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DownloadUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -87,7 +87,7 @@ if err := client.DownloadUpdatesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GenerateCertificate(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.Get(ctx, id) if err != nil { @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetExtendedInformation(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetNetworkSettings(ctx, id) if err != nil { @@ -151,7 +151,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetUpdateSummary(ctx, id) if err != nil { @@ -167,7 +167,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.InstallUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -213,7 +213,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.ScanForUpdatesThenPoll(ctx, id); err != nil { // handle the error @@ -225,7 +225,7 @@ if err := client.ScanForUpdatesThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDevicePatch{ // ... @@ -246,7 +246,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.DataBoxEdgeDeviceExtendedInfoPatch{ // ... @@ -267,7 +267,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := devices.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := devices.UploadCertificateRequest{ // ... diff --git a/resource-manager/databoxedge/2023-12-01/devices/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/devices/id_databoxedgedevice.go index f03c67cea72..aa83e45ad1a 100644 --- a/resource-manager/databoxedge/2023-12-01/devices/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/devices/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/devices/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/devices/id_databoxedgedevice_test.go index 91650f6ae01..a9568fcc10d 100644 --- a/resource-manager/databoxedge/2023-12-01/devices/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/devices/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/devices/model_databoxedgedeviceextendedinfopatch.go b/resource-manager/databoxedge/2023-12-01/devices/model_databoxedgedeviceextendedinfopatch.go index 2c17a01f322..54f13a08cba 100644 --- a/resource-manager/databoxedge/2023-12-01/devices/model_databoxedgedeviceextendedinfopatch.go +++ b/resource-manager/databoxedge/2023-12-01/devices/model_databoxedgedeviceextendedinfopatch.go @@ -7,6 +7,6 @@ type DataBoxEdgeDeviceExtendedInfoPatch struct { ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` ClientSecretStoreId *string `json:"clientSecretStoreId,omitempty"` - ClientSecretStoreUrl *string `json:"clientSecretStoreUrl,omitempty"` + ClientSecretStoreURL *string `json:"clientSecretStoreUrl,omitempty"` SyncStatus *KeyVaultSyncStatus `json:"syncStatus,omitempty"` } diff --git a/resource-manager/databoxedge/2023-12-01/devices/model_databoxedgedeviceextendedinfoproperties.go b/resource-manager/databoxedge/2023-12-01/devices/model_databoxedgedeviceextendedinfoproperties.go index 377a5796b40..3fcbcddecda 100644 --- a/resource-manager/databoxedge/2023-12-01/devices/model_databoxedgedeviceextendedinfoproperties.go +++ b/resource-manager/databoxedge/2023-12-01/devices/model_databoxedgedeviceextendedinfoproperties.go @@ -7,7 +7,7 @@ type DataBoxEdgeDeviceExtendedInfoProperties struct { ChannelIntegrityKeyName *string `json:"channelIntegrityKeyName,omitempty"` ChannelIntegrityKeyVersion *string `json:"channelIntegrityKeyVersion,omitempty"` ClientSecretStoreId *string `json:"clientSecretStoreId,omitempty"` - ClientSecretStoreUrl *string `json:"clientSecretStoreUrl,omitempty"` + ClientSecretStoreURL *string `json:"clientSecretStoreUrl,omitempty"` CloudWitnessContainerName *string `json:"cloudWitnessContainerName,omitempty"` CloudWitnessStorageAccountName *string `json:"cloudWitnessStorageAccountName,omitempty"` CloudWitnessStorageEndpoint *string `json:"cloudWitnessStorageEndpoint,omitempty"` diff --git a/resource-manager/databoxedge/2023-12-01/diagnosticsettings/README.md b/resource-manager/databoxedge/2023-12-01/diagnosticsettings/README.md index f64e5727b53..3b6b51c8945 100644 --- a/resource-manager/databoxedge/2023-12-01/diagnosticsettings/README.md +++ b/resource-manager/databoxedge/2023-12-01/diagnosticsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDiagnosticProactiveLogCollectionSettings(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.GetDiagnosticRemoteSupportSettings(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := diagnosticsettings.DiagnosticProactiveLogCollectionSettings{ // ... @@ -73,7 +73,7 @@ if err := client.UpdateDiagnosticProactiveLogCollectionSettingsThenPoll(ctx, id, ```go ctx := context.TODO() -id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := diagnosticsettings.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := diagnosticsettings.DiagnosticRemoteSupportSettings{ // ... diff --git a/resource-manager/databoxedge/2023-12-01/diagnosticsettings/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/diagnosticsettings/id_databoxedgedevice.go index ba09a0cab74..980cd98137e 100644 --- a/resource-manager/databoxedge/2023-12-01/diagnosticsettings/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/diagnosticsettings/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/diagnosticsettings/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/diagnosticsettings/id_databoxedgedevice_test.go index 32134b679eb..1f95240758b 100644 --- a/resource-manager/databoxedge/2023-12-01/diagnosticsettings/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/diagnosticsettings/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/jobs/README.md b/resource-manager/databoxedge/2023-12-01/jobs/README.md index 8b134e86f8f..bda419bc5aa 100644 --- a/resource-manager/databoxedge/2023-12-01/jobs/README.md +++ b/resource-manager/databoxedge/2023-12-01/jobs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobs.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := jobs.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2023-12-01/jobs/id_job.go b/resource-manager/databoxedge/2023-12-01/jobs/id_job.go index f2ab8798927..b7fc9620ae4 100644 --- a/resource-manager/databoxedge/2023-12-01/jobs/id_job.go +++ b/resource-manager/databoxedge/2023-12-01/jobs/id_job.go @@ -121,9 +121,9 @@ func (id JobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticJobs", "jobs", "jobs"), - resourceids.UserSpecifiedSegment("jobName", "name"), + resourceids.UserSpecifiedSegment("jobName", "jobName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/jobs/id_job_test.go b/resource-manager/databoxedge/2023-12-01/jobs/id_job_test.go index 74c9947f809..b11e0b3edde 100644 --- a/resource-manager/databoxedge/2023-12-01/jobs/id_job_test.go +++ b/resource-manager/databoxedge/2023-12-01/jobs/id_job_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &JobId{} func TestNewJobID(t *testing.T) { - id := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.JobName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "name") + if id.JobName != "jobName" { + t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } } func TestFormatJobID(t *testing.T) { - actual := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name" + actual := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "jobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - JobName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + JobName: "jobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - JobName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + JobName: "jobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/jobs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/jobs/jobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS/jObNaMe", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - JobName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + JobName: "jObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/jObS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/jObS/jObNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/monitoringconfig/README.md b/resource-manager/databoxedge/2023-12-01/monitoringconfig/README.md index ce38eb88502..afd8c5a412f 100644 --- a/resource-manager/databoxedge/2023-12-01/monitoringconfig/README.md +++ b/resource-manager/databoxedge/2023-12-01/monitoringconfig/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") payload := monitoringconfig.MonitoringMetricConfiguration{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := monitoringconfig.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-12-01/monitoringconfig/id_role.go b/resource-manager/databoxedge/2023-12-01/monitoringconfig/id_role.go index 243e09fa51b..0adc2fcb125 100644 --- a/resource-manager/databoxedge/2023-12-01/monitoringconfig/id_role.go +++ b/resource-manager/databoxedge/2023-12-01/monitoringconfig/id_role.go @@ -121,9 +121,9 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), - resourceids.UserSpecifiedSegment("roleName", "name"), + resourceids.UserSpecifiedSegment("roleName", "roleName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/monitoringconfig/id_role_test.go b/resource-manager/databoxedge/2023-12-01/monitoringconfig/id_role_test.go index 626cc1793aa..ff6895da2da 100644 --- a/resource-manager/databoxedge/2023-12-01/monitoringconfig/id_role_test.go +++ b/resource-manager/databoxedge/2023-12-01/monitoringconfig/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.RoleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "name") + if id.RoleName != "roleName" { + t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "roleName") } } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - RoleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/nodes/README.md b/resource-manager/databoxedge/2023-12-01/nodes/README.md index 2b87ea32c20..35fe2311a86 100644 --- a/resource-manager/databoxedge/2023-12-01/nodes/README.md +++ b/resource-manager/databoxedge/2023-12-01/nodes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nodes.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := nodes.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-12-01/nodes/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/nodes/id_databoxedgedevice.go index 69e20c29386..7b40d74d15b 100644 --- a/resource-manager/databoxedge/2023-12-01/nodes/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/nodes/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/nodes/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/nodes/id_databoxedgedevice_test.go index d904d34a511..99fc3841dd6 100644 --- a/resource-manager/databoxedge/2023-12-01/nodes/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/nodes/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/orders/README.md b/resource-manager/databoxedge/2023-12-01/orders/README.md index 7483cf76927..952944ad274 100644 --- a/resource-manager/databoxedge/2023-12-01/orders/README.md +++ b/resource-manager/databoxedge/2023-12-01/orders/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := orders.Order{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := orders.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") read, err := client.ListDCAccessCode(ctx, id) if err != nil { diff --git a/resource-manager/databoxedge/2023-12-01/orders/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/orders/id_databoxedgedevice.go index 2d5c8c7ddf6..9886512c76f 100644 --- a/resource-manager/databoxedge/2023-12-01/orders/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/orders/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/orders/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/orders/id_databoxedgedevice_test.go index 19e9a928d12..6851a9df540 100644 --- a/resource-manager/databoxedge/2023-12-01/orders/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/orders/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/orders/model_trackinginfo.go b/resource-manager/databoxedge/2023-12-01/orders/model_trackinginfo.go index 5f899baae95..bbd7b1f5994 100644 --- a/resource-manager/databoxedge/2023-12-01/orders/model_trackinginfo.go +++ b/resource-manager/databoxedge/2023-12-01/orders/model_trackinginfo.go @@ -7,5 +7,5 @@ type TrackingInfo struct { CarrierName *string `json:"carrierName,omitempty"` SerialNumber *string `json:"serialNumber,omitempty"` TrackingId *string `json:"trackingId,omitempty"` - TrackingUrl *string `json:"trackingUrl,omitempty"` + TrackingURL *string `json:"trackingUrl,omitempty"` } diff --git a/resource-manager/databoxedge/2023-12-01/roles/README.md b/resource-manager/databoxedge/2023-12-01/roles/README.md index 1425728b4ed..2c9a557710f 100644 --- a/resource-manager/databoxedge/2023-12-01/roles/README.md +++ b/resource-manager/databoxedge/2023-12-01/roles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") payload := roles.Role{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := roles.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := roles.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-12-01/roles/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/roles/id_databoxedgedevice.go index 197fe1be8fd..3266a6b8f0b 100644 --- a/resource-manager/databoxedge/2023-12-01/roles/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/roles/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/roles/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/roles/id_databoxedgedevice_test.go index 2d81ea2d76d..fafa4ca1c13 100644 --- a/resource-manager/databoxedge/2023-12-01/roles/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/roles/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/roles/id_role.go b/resource-manager/databoxedge/2023-12-01/roles/id_role.go index adb514576eb..706f5ef7a8d 100644 --- a/resource-manager/databoxedge/2023-12-01/roles/id_role.go +++ b/resource-manager/databoxedge/2023-12-01/roles/id_role.go @@ -121,9 +121,9 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticRoles", "roles", "roles"), - resourceids.UserSpecifiedSegment("roleName", "name"), + resourceids.UserSpecifiedSegment("roleName", "roleName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/roles/id_role_test.go b/resource-manager/databoxedge/2023-12-01/roles/id_role_test.go index 95516abe80b..a8ab469d829 100644 --- a/resource-manager/databoxedge/2023-12-01/roles/id_role_test.go +++ b/resource-manager/databoxedge/2023-12-01/roles/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.RoleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "name") + if id.RoleName != "roleName" { + t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "roleName") } } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - RoleName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/roles/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - RoleName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/rOlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/roles/model_imagerepositorycredential.go b/resource-manager/databoxedge/2023-12-01/roles/model_imagerepositorycredential.go index c12e0c94315..1d94d008851 100644 --- a/resource-manager/databoxedge/2023-12-01/roles/model_imagerepositorycredential.go +++ b/resource-manager/databoxedge/2023-12-01/roles/model_imagerepositorycredential.go @@ -4,7 +4,7 @@ package roles // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ImageRepositoryCredential struct { - ImageRepositoryUrl string `json:"imageRepositoryUrl"` + ImageRepositoryURL string `json:"imageRepositoryUrl"` Password *AsymmetricEncryptedSecret `json:"password,omitempty"` UserName string `json:"userName"` } diff --git a/resource-manager/databoxedge/2023-12-01/shares/README.md b/resource-manager/databoxedge/2023-12-01/shares/README.md index dc629c9b41a..b83ba2fe029 100644 --- a/resource-manager/databoxedge/2023-12-01/shares/README.md +++ b/resource-manager/databoxedge/2023-12-01/shares/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") payload := shares.Share{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := shares.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := shares.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := shares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/databoxedge/2023-12-01/shares/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/shares/id_databoxedgedevice.go index 9517dbf8090..6198bc4c0b5 100644 --- a/resource-manager/databoxedge/2023-12-01/shares/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/shares/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/shares/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/shares/id_databoxedgedevice_test.go index aea194345a8..fb9b4c12b65 100644 --- a/resource-manager/databoxedge/2023-12-01/shares/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/shares/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/shares/id_share.go b/resource-manager/databoxedge/2023-12-01/shares/id_share.go index 4a84cda5833..cb0af998e81 100644 --- a/resource-manager/databoxedge/2023-12-01/shares/id_share.go +++ b/resource-manager/databoxedge/2023-12-01/shares/id_share.go @@ -121,9 +121,9 @@ func (id ShareId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticShares", "shares", "shares"), - resourceids.UserSpecifiedSegment("shareName", "name"), + resourceids.UserSpecifiedSegment("shareName", "shareName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/shares/id_share_test.go b/resource-manager/databoxedge/2023-12-01/shares/id_share_test.go index 74f716f006b..81c376cb17d 100644 --- a/resource-manager/databoxedge/2023-12-01/shares/id_share_test.go +++ b/resource-manager/databoxedge/2023-12-01/shares/id_share_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ShareId{} func TestNewShareID(t *testing.T) { - id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewShareID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.ShareName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ShareName'", id.ShareName, "name") + if id.ShareName != "shareName" { + t.Fatalf("Expected %q but got %q for Segment 'ShareName'", id.ShareName, "shareName") } } func TestFormatShareID(t *testing.T) { - actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name" + actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "shareName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseShareID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - ShareName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseShareIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - ShareName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/shares/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/shares/shareName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS/sHaReNaMe", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - ShareName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + ShareName: "sHaReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sHaReS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sHaReS/sHaReNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/README.md b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/README.md index 3b373fb68fb..c6dcd4ee471 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/README.md +++ b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") payload := storageaccountcredentials.StorageAccountCredential{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := storageaccountcredentials.NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := storageaccountcredentials.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := storageaccountcredentials.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_databoxedgedevice.go index 531f0753d2c..051a0a5b034 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_databoxedgedevice_test.go index a85599fda40..ea5be1f306b 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_storageaccountcredential.go b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_storageaccountcredential.go index 4fc0474ec8e..d7908dbf136 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_storageaccountcredential.go +++ b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_storageaccountcredential.go @@ -121,9 +121,9 @@ func (id StorageAccountCredentialId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccountCredentials", "storageAccountCredentials", "storageAccountCredentials"), - resourceids.UserSpecifiedSegment("storageAccountCredentialName", "name"), + resourceids.UserSpecifiedSegment("storageAccountCredentialName", "storageAccountCredentialName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_storageaccountcredential_test.go b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_storageaccountcredential_test.go index 360d63a4dd0..8754282d130 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_storageaccountcredential_test.go +++ b/resource-manager/databoxedge/2023-12-01/storageaccountcredentials/id_storageaccountcredential_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountCredentialId{} func TestNewStorageAccountCredentialID(t *testing.T) { - id := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewStorageAccountCredentialID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.StorageAccountCredentialName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountCredentialName'", id.StorageAccountCredentialName, "name") + if id.StorageAccountCredentialName != "storageAccountCredentialName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountCredentialName'", id.StorageAccountCredentialName, "storageAccountCredentialName") } } func TestFormatStorageAccountCredentialID(t *testing.T) { - actual := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name" + actual := NewStorageAccountCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountCredentialName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountCredentialID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - StorageAccountCredentialName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + StorageAccountCredentialName: "storageAccountCredentialName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountCredentialIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - StorageAccountCredentialName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + StorageAccountCredentialName: "storageAccountCredentialName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccountCredentials/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccountCredentials/storageAccountCredentialName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs/sToRaGeAcCoUnTcReDeNtIaLnAmE", Expected: &StorageAccountCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - StorageAccountCredentialName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + StorageAccountCredentialName: "sToRaGeAcCoUnTcReDeNtIaLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTcReDeNtIaLs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTcReDeNtIaLs/sToRaGeAcCoUnTcReDeNtIaLnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/storageaccounts/README.md b/resource-manager/databoxedge/2023-12-01/storageaccounts/README.md index 74750bd474b..b035afdf39f 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccounts/README.md +++ b/resource-manager/databoxedge/2023-12-01/storageaccounts/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") payload := storageaccounts.StorageAccount{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") +id := storageaccounts.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := storageaccounts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := storageaccounts.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id)` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id) diff --git a/resource-manager/databoxedge/2023-12-01/storageaccounts/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/storageaccounts/id_databoxedgedevice.go index f9d282c5a7e..512fb6fcd81 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccounts/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/storageaccounts/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/storageaccounts/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/storageaccounts/id_databoxedgedevice_test.go index 94b173558a3..10c168cc452 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccounts/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/storageaccounts/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/storageaccounts/id_storageaccount.go b/resource-manager/databoxedge/2023-12-01/storageaccounts/id_storageaccount.go index ceaefbfb0f0..d237cf8fd56 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccounts/id_storageaccount.go +++ b/resource-manager/databoxedge/2023-12-01/storageaccounts/id_storageaccount.go @@ -121,7 +121,7 @@ func (id StorageAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), } diff --git a/resource-manager/databoxedge/2023-12-01/storageaccounts/id_storageaccount_test.go b/resource-manager/databoxedge/2023-12-01/storageaccounts/id_storageaccount_test.go index 3f03bb4f0d2..0e8fbe54585 100644 --- a/resource-manager/databoxedge/2023-12-01/storageaccounts/id_storageaccount_test.go +++ b/resource-manager/databoxedge/2023-12-01/storageaccounts/id_storageaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageAccountId{} func TestNewStorageAccountID(t *testing.T) { - id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName") + id := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } if id.StorageAccountName != "storageAccountName" { @@ -32,8 +32,8 @@ func TestNewStorageAccountID(t *testing.T) { } func TestFormatStorageAccountID(t *testing.T) { - actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "storageAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName" + actual := NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "storageAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", StorageAccountName: "storageAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/storageAccounts/storageAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/storageAccounts/storageAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Expected: &StorageAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", StorageAccountName: "sToRaGeAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/supportpackages/README.md b/resource-manager/databoxedge/2023-12-01/supportpackages/README.md index cd71cca2f42..b17317a8c8b 100644 --- a/resource-manager/databoxedge/2023-12-01/supportpackages/README.md +++ b/resource-manager/databoxedge/2023-12-01/supportpackages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := supportpackages.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := supportpackages.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") payload := supportpackages.TriggerSupportPackageRequest{ // ... diff --git a/resource-manager/databoxedge/2023-12-01/supportpackages/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/supportpackages/id_databoxedgedevice.go index 8fe85584c50..b24d3bea878 100644 --- a/resource-manager/databoxedge/2023-12-01/supportpackages/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/supportpackages/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/supportpackages/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/supportpackages/id_databoxedgedevice_test.go index b19b0fadba7..ab4b9e7a8fe 100644 --- a/resource-manager/databoxedge/2023-12-01/supportpackages/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/supportpackages/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/triggers/README.md b/resource-manager/databoxedge/2023-12-01/triggers/README.md index 57134b9b396..3f9f2ddb301 100644 --- a/resource-manager/databoxedge/2023-12-01/triggers/README.md +++ b/resource-manager/databoxedge/2023-12-01/triggers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") payload := triggers.Trigger{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := triggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := triggers.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := triggers.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id, triggers.DefaultListByDataBoxEdgeDeviceOperationOptions())` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id, triggers.DefaultListByDataBoxEdgeDeviceOperationOptions()) diff --git a/resource-manager/databoxedge/2023-12-01/triggers/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/triggers/id_databoxedgedevice.go index 2a7b0261a2c..2b5bc84233e 100644 --- a/resource-manager/databoxedge/2023-12-01/triggers/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/triggers/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/triggers/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/triggers/id_databoxedgedevice_test.go index 75429c6a00c..14d3eb5a289 100644 --- a/resource-manager/databoxedge/2023-12-01/triggers/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/triggers/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/triggers/id_trigger.go b/resource-manager/databoxedge/2023-12-01/triggers/id_trigger.go index a8ccd2b3e42..a3a8d6f22c3 100644 --- a/resource-manager/databoxedge/2023-12-01/triggers/id_trigger.go +++ b/resource-manager/databoxedge/2023-12-01/triggers/id_trigger.go @@ -121,9 +121,9 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticTriggers", "triggers", "triggers"), - resourceids.UserSpecifiedSegment("triggerName", "name"), + resourceids.UserSpecifiedSegment("triggerName", "triggerName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/triggers/id_trigger_test.go b/resource-manager/databoxedge/2023-12-01/triggers/id_trigger_test.go index 1c5cfaae7be..98cb8a0b1b8 100644 --- a/resource-manager/databoxedge/2023-12-01/triggers/id_trigger_test.go +++ b/resource-manager/databoxedge/2023-12-01/triggers/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.TriggerName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'TriggerName'", id.TriggerName, "name") + if id.TriggerName != "triggerName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggerName'", id.TriggerName, "triggerName") } } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - TriggerName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - TriggerName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/triggers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - TriggerName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/tRiGgErS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/users/README.md b/resource-manager/databoxedge/2023-12-01/users/README.md index d860f969a7b..6e4b786e31b 100644 --- a/resource-manager/databoxedge/2023-12-01/users/README.md +++ b/resource-manager/databoxedge/2023-12-01/users/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") payload := users.User{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := users.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") +id := users.NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") // alternatively `client.ListByDataBoxEdgeDevice(ctx, id, users.DefaultListByDataBoxEdgeDeviceOperationOptions())` can be used to do batched pagination items, err := client.ListByDataBoxEdgeDeviceComplete(ctx, id, users.DefaultListByDataBoxEdgeDeviceOperationOptions()) diff --git a/resource-manager/databoxedge/2023-12-01/users/id_databoxedgedevice.go b/resource-manager/databoxedge/2023-12-01/users/id_databoxedgedevice.go index 3294352d71a..174cacd35d5 100644 --- a/resource-manager/databoxedge/2023-12-01/users/id_databoxedgedevice.go +++ b/resource-manager/databoxedge/2023-12-01/users/id_databoxedgedevice.go @@ -115,7 +115,7 @@ func (id DataBoxEdgeDeviceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/users/id_databoxedgedevice_test.go b/resource-manager/databoxedge/2023-12-01/users/id_databoxedgedevice_test.go index b7e892a08e8..1192b9a5a99 100644 --- a/resource-manager/databoxedge/2023-12-01/users/id_databoxedgedevice_test.go +++ b/resource-manager/databoxedge/2023-12-01/users/id_databoxedgedevice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataBoxEdgeDeviceId{} func TestNewDataBoxEdgeDeviceID(t *testing.T) { - id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName") + id := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDataBoxEdgeDeviceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } } func TestFormatDataBoxEdgeDeviceID(t *testing.T) { - actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName" + actual := NewDataBoxEdgeDeviceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDataBoxEdgeDeviceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDataBoxEdgeDeviceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Expected: &DataBoxEdgeDeviceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/databoxedge/2023-12-01/users/id_user.go b/resource-manager/databoxedge/2023-12-01/users/id_user.go index 138411a0d48..1325a5bae94 100644 --- a/resource-manager/databoxedge/2023-12-01/users/id_user.go +++ b/resource-manager/databoxedge/2023-12-01/users/id_user.go @@ -121,9 +121,9 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataBoxEdge", "Microsoft.DataBoxEdge", "Microsoft.DataBoxEdge"), resourceids.StaticSegment("staticDataBoxEdgeDevices", "dataBoxEdgeDevices", "dataBoxEdgeDevices"), - resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "deviceName"), + resourceids.UserSpecifiedSegment("dataBoxEdgeDeviceName", "dataBoxEdgeDeviceName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "name"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/databoxedge/2023-12-01/users/id_user_test.go b/resource-manager/databoxedge/2023-12-01/users/id_user_test.go index 0b968336b13..c14aaa18c4d 100644 --- a/resource-manager/databoxedge/2023-12-01/users/id_user_test.go +++ b/resource-manager/databoxedge/2023-12-01/users/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DataBoxEdgeDeviceName != "deviceName" { - t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "deviceName") + if id.DataBoxEdgeDeviceName != "dataBoxEdgeDeviceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataBoxEdgeDeviceName'", id.DataBoxEdgeDeviceName, "dataBoxEdgeDeviceName") } - if id.UserName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "name") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deviceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataBoxEdgeDeviceName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUserID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - UserName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DataBoxEdgeDeviceName: "deviceName", - UserName: "name", + DataBoxEdgeDeviceName: "dataBoxEdgeDeviceName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/deviceName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dataBoxEdgeDeviceName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataBoxEdgeDeviceName: "dEvIcEnAmE", - UserName: "nAmE", + DataBoxEdgeDeviceName: "dAtAbOxEdGeDeViCeNaMe", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dEvIcEnAmE/uSeRs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbOxEdGe/dAtAbOxEdGeDeViCeS/dAtAbOxEdGeDeViCeNaMe/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/databricks/2022-04-01-preview/accessconnector/README.md b/resource-manager/databricks/2022-04-01-preview/accessconnector/README.md index 8f2243ea1bd..0231052a4b1 100644 --- a/resource-manager/databricks/2022-04-01-preview/accessconnector/README.md +++ b/resource-manager/databricks/2022-04-01-preview/accessconnector/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") payload := accessconnector.AccessConnector{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") payload := accessconnector.AccessConnectorUpdate{ // ... diff --git a/resource-manager/databricks/2022-04-01-preview/accessconnector/id_accessconnector.go b/resource-manager/databricks/2022-04-01-preview/accessconnector/id_accessconnector.go index d8c8ccda2e6..7c4211c6630 100644 --- a/resource-manager/databricks/2022-04-01-preview/accessconnector/id_accessconnector.go +++ b/resource-manager/databricks/2022-04-01-preview/accessconnector/id_accessconnector.go @@ -115,7 +115,7 @@ func (id AccessConnectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDatabricks", "Microsoft.Databricks", "Microsoft.Databricks"), resourceids.StaticSegment("staticAccessConnectors", "accessConnectors", "accessConnectors"), - resourceids.UserSpecifiedSegment("accessConnectorName", "connectorName"), + resourceids.UserSpecifiedSegment("accessConnectorName", "accessConnectorName"), } } diff --git a/resource-manager/databricks/2022-04-01-preview/accessconnector/id_accessconnector_test.go b/resource-manager/databricks/2022-04-01-preview/accessconnector/id_accessconnector_test.go index aa8d80efdeb..b0d888fc2f5 100644 --- a/resource-manager/databricks/2022-04-01-preview/accessconnector/id_accessconnector_test.go +++ b/resource-manager/databricks/2022-04-01-preview/accessconnector/id_accessconnector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessConnectorId{} func TestNewAccessConnectorID(t *testing.T) { - id := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") + id := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAccessConnectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AccessConnectorName != "connectorName" { - t.Fatalf("Expected %q but got %q for Segment 'AccessConnectorName'", id.AccessConnectorName, "connectorName") + if id.AccessConnectorName != "accessConnectorName" { + t.Fatalf("Expected %q but got %q for Segment 'AccessConnectorName'", id.AccessConnectorName, "accessConnectorName") } } func TestFormatAccessConnectorID(t *testing.T) { - actual := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName" + actual := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAccessConnectorID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccessConnectorName: "connectorName", + AccessConnectorName: "accessConnectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAccessConnectorIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccessConnectorName: "connectorName", + AccessConnectorName: "accessConnectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/cOnNeCtOrNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/aCcEsScOnNeCtOrNaMe", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AccessConnectorName: "cOnNeCtOrNaMe", + AccessConnectorName: "aCcEsScOnNeCtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/cOnNeCtOrNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/aCcEsScOnNeCtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/databricks/2022-04-01-preview/vnetpeering/README.md b/resource-manager/databricks/2022-04-01-preview/vnetpeering/README.md index d6aa45880fc..e276b404aa0 100644 --- a/resource-manager/databricks/2022-04-01-preview/vnetpeering/README.md +++ b/resource-manager/databricks/2022-04-01-preview/vnetpeering/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName") +id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName") payload := vnetpeering.VirtualNetworkPeering{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName") +id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName") +id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/databricks/2022-04-01-preview/vnetpeering/id_virtualnetworkpeering.go b/resource-manager/databricks/2022-04-01-preview/vnetpeering/id_virtualnetworkpeering.go index cb5bd158c46..5e8f7275ac1 100644 --- a/resource-manager/databricks/2022-04-01-preview/vnetpeering/id_virtualnetworkpeering.go +++ b/resource-manager/databricks/2022-04-01-preview/vnetpeering/id_virtualnetworkpeering.go @@ -123,7 +123,7 @@ func (id VirtualNetworkPeeringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticVirtualNetworkPeerings", "virtualNetworkPeerings", "virtualNetworkPeerings"), - resourceids.UserSpecifiedSegment("virtualNetworkPeeringName", "peeringName"), + resourceids.UserSpecifiedSegment("virtualNetworkPeeringName", "virtualNetworkPeeringName"), } } diff --git a/resource-manager/databricks/2022-04-01-preview/vnetpeering/id_virtualnetworkpeering_test.go b/resource-manager/databricks/2022-04-01-preview/vnetpeering/id_virtualnetworkpeering_test.go index 8148aca2b8a..fd5bf6ffdc1 100644 --- a/resource-manager/databricks/2022-04-01-preview/vnetpeering/id_virtualnetworkpeering_test.go +++ b/resource-manager/databricks/2022-04-01-preview/vnetpeering/id_virtualnetworkpeering_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkPeeringId{} func TestNewVirtualNetworkPeeringID(t *testing.T) { - id := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName") + id := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualNetworkPeeringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.VirtualNetworkPeeringName != "peeringName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkPeeringName'", id.VirtualNetworkPeeringName, "peeringName") + if id.VirtualNetworkPeeringName != "virtualNetworkPeeringName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkPeeringName'", id.VirtualNetworkPeeringName, "virtualNetworkPeeringName") } } func TestFormatVirtualNetworkPeeringID(t *testing.T) { - actual := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName" + actual := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualNetworkPeeringID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName", Expected: &VirtualNetworkPeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - VirtualNetworkPeeringName: "peeringName", + VirtualNetworkPeeringName: "virtualNetworkPeeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualNetworkPeeringIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName", Expected: &VirtualNetworkPeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - VirtualNetworkPeeringName: "peeringName", + VirtualNetworkPeeringName: "virtualNetworkPeeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/wOrKsPaCeS/wOrKsPaCeNaMe/vIrTuAlNeTwOrKpEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/wOrKsPaCeS/wOrKsPaCeNaMe/vIrTuAlNeTwOrKpEeRiNgS/vIrTuAlNeTwOrKpEeRiNgNaMe", Expected: &VirtualNetworkPeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - VirtualNetworkPeeringName: "pEeRiNgNaMe", + VirtualNetworkPeeringName: "vIrTuAlNeTwOrKpEeRiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/wOrKsPaCeS/wOrKsPaCeNaMe/vIrTuAlNeTwOrKpEeRiNgS/pEeRiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/wOrKsPaCeS/wOrKsPaCeNaMe/vIrTuAlNeTwOrKpEeRiNgS/vIrTuAlNeTwOrKpEeRiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/databricks/2022-04-01-preview/workspaces/model_workspaceproperties.go b/resource-manager/databricks/2022-04-01-preview/workspaces/model_workspaceproperties.go index f5241b4722f..e3129a32bd7 100644 --- a/resource-manager/databricks/2022-04-01-preview/workspaces/model_workspaceproperties.go +++ b/resource-manager/databricks/2022-04-01-preview/workspaces/model_workspaceproperties.go @@ -26,7 +26,7 @@ type WorkspaceProperties struct { UiDefinitionUri *string `json:"uiDefinitionUri,omitempty"` UpdatedBy *CreatedBy `json:"updatedBy,omitempty"` WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceUrl *string `json:"workspaceUrl,omitempty"` + WorkspaceURL *string `json:"workspaceUrl,omitempty"` } func (o *WorkspaceProperties) GetCreatedDateTimeAsTime() (*time.Time, error) { diff --git a/resource-manager/databricks/2022-10-01-preview/accessconnector/README.md b/resource-manager/databricks/2022-10-01-preview/accessconnector/README.md index 26d48319869..17add237dc1 100644 --- a/resource-manager/databricks/2022-10-01-preview/accessconnector/README.md +++ b/resource-manager/databricks/2022-10-01-preview/accessconnector/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") payload := accessconnector.AccessConnector{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") payload := accessconnector.AccessConnectorUpdate{ // ... diff --git a/resource-manager/databricks/2022-10-01-preview/accessconnector/id_accessconnector.go b/resource-manager/databricks/2022-10-01-preview/accessconnector/id_accessconnector.go index d8c8ccda2e6..7c4211c6630 100644 --- a/resource-manager/databricks/2022-10-01-preview/accessconnector/id_accessconnector.go +++ b/resource-manager/databricks/2022-10-01-preview/accessconnector/id_accessconnector.go @@ -115,7 +115,7 @@ func (id AccessConnectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDatabricks", "Microsoft.Databricks", "Microsoft.Databricks"), resourceids.StaticSegment("staticAccessConnectors", "accessConnectors", "accessConnectors"), - resourceids.UserSpecifiedSegment("accessConnectorName", "connectorName"), + resourceids.UserSpecifiedSegment("accessConnectorName", "accessConnectorName"), } } diff --git a/resource-manager/databricks/2022-10-01-preview/accessconnector/id_accessconnector_test.go b/resource-manager/databricks/2022-10-01-preview/accessconnector/id_accessconnector_test.go index aa8d80efdeb..b0d888fc2f5 100644 --- a/resource-manager/databricks/2022-10-01-preview/accessconnector/id_accessconnector_test.go +++ b/resource-manager/databricks/2022-10-01-preview/accessconnector/id_accessconnector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessConnectorId{} func TestNewAccessConnectorID(t *testing.T) { - id := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") + id := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAccessConnectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AccessConnectorName != "connectorName" { - t.Fatalf("Expected %q but got %q for Segment 'AccessConnectorName'", id.AccessConnectorName, "connectorName") + if id.AccessConnectorName != "accessConnectorName" { + t.Fatalf("Expected %q but got %q for Segment 'AccessConnectorName'", id.AccessConnectorName, "accessConnectorName") } } func TestFormatAccessConnectorID(t *testing.T) { - actual := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName" + actual := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAccessConnectorID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccessConnectorName: "connectorName", + AccessConnectorName: "accessConnectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAccessConnectorIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccessConnectorName: "connectorName", + AccessConnectorName: "accessConnectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/cOnNeCtOrNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/aCcEsScOnNeCtOrNaMe", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AccessConnectorName: "cOnNeCtOrNaMe", + AccessConnectorName: "aCcEsScOnNeCtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/cOnNeCtOrNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/aCcEsScOnNeCtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/databricks/2024-05-01/accessconnector/README.md b/resource-manager/databricks/2024-05-01/accessconnector/README.md index 6e38356a760..dc297defad8 100644 --- a/resource-manager/databricks/2024-05-01/accessconnector/README.md +++ b/resource-manager/databricks/2024-05-01/accessconnector/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") payload := accessconnector.AccessConnector{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") +id := accessconnector.NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") payload := accessconnector.AccessConnectorUpdate{ // ... diff --git a/resource-manager/databricks/2024-05-01/accessconnector/id_accessconnector.go b/resource-manager/databricks/2024-05-01/accessconnector/id_accessconnector.go index d8c8ccda2e6..7c4211c6630 100644 --- a/resource-manager/databricks/2024-05-01/accessconnector/id_accessconnector.go +++ b/resource-manager/databricks/2024-05-01/accessconnector/id_accessconnector.go @@ -115,7 +115,7 @@ func (id AccessConnectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDatabricks", "Microsoft.Databricks", "Microsoft.Databricks"), resourceids.StaticSegment("staticAccessConnectors", "accessConnectors", "accessConnectors"), - resourceids.UserSpecifiedSegment("accessConnectorName", "connectorName"), + resourceids.UserSpecifiedSegment("accessConnectorName", "accessConnectorName"), } } diff --git a/resource-manager/databricks/2024-05-01/accessconnector/id_accessconnector_test.go b/resource-manager/databricks/2024-05-01/accessconnector/id_accessconnector_test.go index aa8d80efdeb..b0d888fc2f5 100644 --- a/resource-manager/databricks/2024-05-01/accessconnector/id_accessconnector_test.go +++ b/resource-manager/databricks/2024-05-01/accessconnector/id_accessconnector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessConnectorId{} func TestNewAccessConnectorID(t *testing.T) { - id := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName") + id := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAccessConnectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AccessConnectorName != "connectorName" { - t.Fatalf("Expected %q but got %q for Segment 'AccessConnectorName'", id.AccessConnectorName, "connectorName") + if id.AccessConnectorName != "accessConnectorName" { + t.Fatalf("Expected %q but got %q for Segment 'AccessConnectorName'", id.AccessConnectorName, "accessConnectorName") } } func TestFormatAccessConnectorID(t *testing.T) { - actual := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName" + actual := NewAccessConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accessConnectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAccessConnectorID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccessConnectorName: "connectorName", + AccessConnectorName: "accessConnectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAccessConnectorIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccessConnectorName: "connectorName", + AccessConnectorName: "accessConnectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/accessConnectors/accessConnectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/cOnNeCtOrNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/aCcEsScOnNeCtOrNaMe", Expected: &AccessConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AccessConnectorName: "cOnNeCtOrNaMe", + AccessConnectorName: "aCcEsScOnNeCtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/cOnNeCtOrNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/aCcEsScOnNeCtOrS/aCcEsScOnNeCtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/databricks/2024-05-01/vnetpeering/README.md b/resource-manager/databricks/2024-05-01/vnetpeering/README.md index 0946aa34c2c..732163ae364 100644 --- a/resource-manager/databricks/2024-05-01/vnetpeering/README.md +++ b/resource-manager/databricks/2024-05-01/vnetpeering/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName") +id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName") payload := vnetpeering.VirtualNetworkPeering{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName") +id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName") +id := vnetpeering.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/databricks/2024-05-01/vnetpeering/id_virtualnetworkpeering.go b/resource-manager/databricks/2024-05-01/vnetpeering/id_virtualnetworkpeering.go index cb5bd158c46..5e8f7275ac1 100644 --- a/resource-manager/databricks/2024-05-01/vnetpeering/id_virtualnetworkpeering.go +++ b/resource-manager/databricks/2024-05-01/vnetpeering/id_virtualnetworkpeering.go @@ -123,7 +123,7 @@ func (id VirtualNetworkPeeringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticVirtualNetworkPeerings", "virtualNetworkPeerings", "virtualNetworkPeerings"), - resourceids.UserSpecifiedSegment("virtualNetworkPeeringName", "peeringName"), + resourceids.UserSpecifiedSegment("virtualNetworkPeeringName", "virtualNetworkPeeringName"), } } diff --git a/resource-manager/databricks/2024-05-01/vnetpeering/id_virtualnetworkpeering_test.go b/resource-manager/databricks/2024-05-01/vnetpeering/id_virtualnetworkpeering_test.go index 8148aca2b8a..fd5bf6ffdc1 100644 --- a/resource-manager/databricks/2024-05-01/vnetpeering/id_virtualnetworkpeering_test.go +++ b/resource-manager/databricks/2024-05-01/vnetpeering/id_virtualnetworkpeering_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkPeeringId{} func TestNewVirtualNetworkPeeringID(t *testing.T) { - id := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName") + id := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualNetworkPeeringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.VirtualNetworkPeeringName != "peeringName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkPeeringName'", id.VirtualNetworkPeeringName, "peeringName") + if id.VirtualNetworkPeeringName != "virtualNetworkPeeringName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkPeeringName'", id.VirtualNetworkPeeringName, "virtualNetworkPeeringName") } } func TestFormatVirtualNetworkPeeringID(t *testing.T) { - actual := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "peeringName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName" + actual := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "virtualNetworkPeeringName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualNetworkPeeringID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName", Expected: &VirtualNetworkPeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - VirtualNetworkPeeringName: "peeringName", + VirtualNetworkPeeringName: "virtualNetworkPeeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualNetworkPeeringIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName", Expected: &VirtualNetworkPeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - VirtualNetworkPeeringName: "peeringName", + VirtualNetworkPeeringName: "virtualNetworkPeeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Databricks/workspaces/workspaceName/virtualNetworkPeerings/virtualNetworkPeeringName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/wOrKsPaCeS/wOrKsPaCeNaMe/vIrTuAlNeTwOrKpEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/wOrKsPaCeS/wOrKsPaCeNaMe/vIrTuAlNeTwOrKpEeRiNgS/vIrTuAlNeTwOrKpEeRiNgNaMe", Expected: &VirtualNetworkPeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - VirtualNetworkPeeringName: "pEeRiNgNaMe", + VirtualNetworkPeeringName: "vIrTuAlNeTwOrKpEeRiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/wOrKsPaCeS/wOrKsPaCeNaMe/vIrTuAlNeTwOrKpEeRiNgS/pEeRiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAbRiCkS/wOrKsPaCeS/wOrKsPaCeNaMe/vIrTuAlNeTwOrKpEeRiNgS/vIrTuAlNeTwOrKpEeRiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/databricks/2024-05-01/workspaces/model_workspaceproperties.go b/resource-manager/databricks/2024-05-01/workspaces/model_workspaceproperties.go index 4d9c704b2d6..091ed4067cd 100644 --- a/resource-manager/databricks/2024-05-01/workspaces/model_workspaceproperties.go +++ b/resource-manager/databricks/2024-05-01/workspaces/model_workspaceproperties.go @@ -31,7 +31,7 @@ type WorkspaceProperties struct { UiDefinitionUri *string `json:"uiDefinitionUri,omitempty"` UpdatedBy *CreatedBy `json:"updatedBy,omitempty"` WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceUrl *string `json:"workspaceUrl,omitempty"` + WorkspaceURL *string `json:"workspaceUrl,omitempty"` } func (o *WorkspaceProperties) GetCreatedDateTimeAsTime() (*time.Time, error) { diff --git a/resource-manager/datadog/2021-03-01/rules/README.md b/resource-manager/datadog/2021-03-01/rules/README.md index c38a7e411ea..79992fcbe1b 100644 --- a/resource-manager/datadog/2021-03-01/rules/README.md +++ b/resource-manager/datadog/2021-03-01/rules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := rules.MonitoringTagRules{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.TagRulesGet(ctx, id) if err != nil { diff --git a/resource-manager/datadog/2021-03-01/rules/id_tagrule.go b/resource-manager/datadog/2021-03-01/rules/id_tagrule.go index b4eae6727c3..e08c204523b 100644 --- a/resource-manager/datadog/2021-03-01/rules/id_tagrule.go +++ b/resource-manager/datadog/2021-03-01/rules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/datadog/2021-03-01/rules/id_tagrule_test.go b/resource-manager/datadog/2021-03-01/rules/id_tagrule_test.go index dc850dc3cff..96eea9c53a4 100644 --- a/resource-manager/datadog/2021-03-01/rules/id_tagrule_test.go +++ b/resource-manager/datadog/2021-03-01/rules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datadog/2021-03-01/singlesignon/README.md b/resource-manager/datadog/2021-03-01/singlesignon/README.md index b6887a3a712..2f4d54dc537 100644 --- a/resource-manager/datadog/2021-03-01/singlesignon/README.md +++ b/resource-manager/datadog/2021-03-01/singlesignon/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") payload := singlesignon.DatadogSingleSignOnResource{ // ... @@ -41,7 +41,7 @@ if err := client.ConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") read, err := client.ConfigurationsGet(ctx, id) if err != nil { diff --git a/resource-manager/datadog/2021-03-01/singlesignon/id_singlesignonconfiguration.go b/resource-manager/datadog/2021-03-01/singlesignon/id_singlesignonconfiguration.go index 05f9761401c..623f7daf3f5 100644 --- a/resource-manager/datadog/2021-03-01/singlesignon/id_singlesignonconfiguration.go +++ b/resource-manager/datadog/2021-03-01/singlesignon/id_singlesignonconfiguration.go @@ -123,7 +123,7 @@ func (id SingleSignOnConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticSingleSignOnConfigurations", "singleSignOnConfigurations", "singleSignOnConfigurations"), - resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "singleSignOnConfigurationName"), } } diff --git a/resource-manager/datadog/2021-03-01/singlesignon/id_singlesignonconfiguration_test.go b/resource-manager/datadog/2021-03-01/singlesignon/id_singlesignonconfiguration_test.go index cfc142568b7..36b9754415d 100644 --- a/resource-manager/datadog/2021-03-01/singlesignon/id_singlesignonconfiguration_test.go +++ b/resource-manager/datadog/2021-03-01/singlesignon/id_singlesignonconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SingleSignOnConfigurationId{} func TestNewSingleSignOnConfigurationID(t *testing.T) { - id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") + id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSingleSignOnConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.SingleSignOnConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "configurationName") + if id.SingleSignOnConfigurationName != "singleSignOnConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "singleSignOnConfigurationName") } } func TestFormatSingleSignOnConfigurationID(t *testing.T) { - actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName" + actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSingleSignOnConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSingleSignOnConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - SingleSignOnConfigurationName: "cOnFiGuRaTiOnNaMe", + SingleSignOnConfigurationName: "sInGlEsIgNoNcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/datadog/2021-03-01/singlesignon/model_datadogsinglesignonproperties.go b/resource-manager/datadog/2021-03-01/singlesignon/model_datadogsinglesignonproperties.go index 106a6b056ac..6ee23f09143 100644 --- a/resource-manager/datadog/2021-03-01/singlesignon/model_datadogsinglesignonproperties.go +++ b/resource-manager/datadog/2021-03-01/singlesignon/model_datadogsinglesignonproperties.go @@ -7,5 +7,5 @@ type DatadogSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/datadog/2022-06-01/rules/README.md b/resource-manager/datadog/2022-06-01/rules/README.md index b826434a008..c951b4a6aee 100644 --- a/resource-manager/datadog/2022-06-01/rules/README.md +++ b/resource-manager/datadog/2022-06-01/rules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := rules.MonitoringTagRules{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.TagRulesGet(ctx, id) if err != nil { diff --git a/resource-manager/datadog/2022-06-01/rules/id_tagrule.go b/resource-manager/datadog/2022-06-01/rules/id_tagrule.go index b4eae6727c3..e08c204523b 100644 --- a/resource-manager/datadog/2022-06-01/rules/id_tagrule.go +++ b/resource-manager/datadog/2022-06-01/rules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/datadog/2022-06-01/rules/id_tagrule_test.go b/resource-manager/datadog/2022-06-01/rules/id_tagrule_test.go index dc850dc3cff..96eea9c53a4 100644 --- a/resource-manager/datadog/2022-06-01/rules/id_tagrule_test.go +++ b/resource-manager/datadog/2022-06-01/rules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datadog/2022-06-01/singlesignon/README.md b/resource-manager/datadog/2022-06-01/singlesignon/README.md index a23756a61eb..97774a8b8aa 100644 --- a/resource-manager/datadog/2022-06-01/singlesignon/README.md +++ b/resource-manager/datadog/2022-06-01/singlesignon/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") payload := singlesignon.DatadogSingleSignOnResource{ // ... @@ -41,7 +41,7 @@ if err := client.ConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") read, err := client.ConfigurationsGet(ctx, id) if err != nil { diff --git a/resource-manager/datadog/2022-06-01/singlesignon/id_singlesignonconfiguration.go b/resource-manager/datadog/2022-06-01/singlesignon/id_singlesignonconfiguration.go index 05f9761401c..623f7daf3f5 100644 --- a/resource-manager/datadog/2022-06-01/singlesignon/id_singlesignonconfiguration.go +++ b/resource-manager/datadog/2022-06-01/singlesignon/id_singlesignonconfiguration.go @@ -123,7 +123,7 @@ func (id SingleSignOnConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticSingleSignOnConfigurations", "singleSignOnConfigurations", "singleSignOnConfigurations"), - resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "singleSignOnConfigurationName"), } } diff --git a/resource-manager/datadog/2022-06-01/singlesignon/id_singlesignonconfiguration_test.go b/resource-manager/datadog/2022-06-01/singlesignon/id_singlesignonconfiguration_test.go index cfc142568b7..36b9754415d 100644 --- a/resource-manager/datadog/2022-06-01/singlesignon/id_singlesignonconfiguration_test.go +++ b/resource-manager/datadog/2022-06-01/singlesignon/id_singlesignonconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SingleSignOnConfigurationId{} func TestNewSingleSignOnConfigurationID(t *testing.T) { - id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") + id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSingleSignOnConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.SingleSignOnConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "configurationName") + if id.SingleSignOnConfigurationName != "singleSignOnConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "singleSignOnConfigurationName") } } func TestFormatSingleSignOnConfigurationID(t *testing.T) { - actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName" + actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSingleSignOnConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSingleSignOnConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - SingleSignOnConfigurationName: "cOnFiGuRaTiOnNaMe", + SingleSignOnConfigurationName: "sInGlEsIgNoNcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/datadog/2022-06-01/singlesignon/model_datadogsinglesignonproperties.go b/resource-manager/datadog/2022-06-01/singlesignon/model_datadogsinglesignonproperties.go index 106a6b056ac..6ee23f09143 100644 --- a/resource-manager/datadog/2022-06-01/singlesignon/model_datadogsinglesignonproperties.go +++ b/resource-manager/datadog/2022-06-01/singlesignon/model_datadogsinglesignonproperties.go @@ -7,5 +7,5 @@ type DatadogSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/datadog/2023-01-01/monitoredsubscriptions/README.md b/resource-manager/datadog/2023-01-01/monitoredsubscriptions/README.md index 7545aa3a40d..33a20049004 100644 --- a/resource-manager/datadog/2023-01-01/monitoredsubscriptions/README.md +++ b/resource-manager/datadog/2023-01-01/monitoredsubscriptions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := monitoredsubscriptions.NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := monitoredsubscriptions.NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "monitoredSubscriptionName") payload := monitoredsubscriptions.MonitoredSubscriptionProperties{ // ... @@ -41,7 +41,7 @@ if err := client.CreateorUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := monitoredsubscriptions.NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := monitoredsubscriptions.NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "monitoredSubscriptionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := monitoredsubscriptions.NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := monitoredsubscriptions.NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "monitoredSubscriptionName") read, err := client.Get(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := monitoredsubscriptions.NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := monitoredsubscriptions.NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "monitoredSubscriptionName") payload := monitoredsubscriptions.MonitoredSubscriptionProperties{ // ... diff --git a/resource-manager/datadog/2023-01-01/monitoredsubscriptions/id_monitoredsubscription.go b/resource-manager/datadog/2023-01-01/monitoredsubscriptions/id_monitoredsubscription.go index dc43f99ade4..3ffec73bd3b 100644 --- a/resource-manager/datadog/2023-01-01/monitoredsubscriptions/id_monitoredsubscription.go +++ b/resource-manager/datadog/2023-01-01/monitoredsubscriptions/id_monitoredsubscription.go @@ -123,7 +123,7 @@ func (id MonitoredSubscriptionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticMonitoredSubscriptions", "monitoredSubscriptions", "monitoredSubscriptions"), - resourceids.UserSpecifiedSegment("monitoredSubscriptionName", "configurationName"), + resourceids.UserSpecifiedSegment("monitoredSubscriptionName", "monitoredSubscriptionName"), } } diff --git a/resource-manager/datadog/2023-01-01/monitoredsubscriptions/id_monitoredsubscription_test.go b/resource-manager/datadog/2023-01-01/monitoredsubscriptions/id_monitoredsubscription_test.go index 33d7ed69d88..616c38c517f 100644 --- a/resource-manager/datadog/2023-01-01/monitoredsubscriptions/id_monitoredsubscription_test.go +++ b/resource-manager/datadog/2023-01-01/monitoredsubscriptions/id_monitoredsubscription_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MonitoredSubscriptionId{} func TestNewMonitoredSubscriptionID(t *testing.T) { - id := NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") + id := NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "monitoredSubscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewMonitoredSubscriptionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.MonitoredSubscriptionName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'MonitoredSubscriptionName'", id.MonitoredSubscriptionName, "configurationName") + if id.MonitoredSubscriptionName != "monitoredSubscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'MonitoredSubscriptionName'", id.MonitoredSubscriptionName, "monitoredSubscriptionName") } } func TestFormatMonitoredSubscriptionID(t *testing.T) { - actual := NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/configurationName" + actual := NewMonitoredSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "monitoredSubscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/monitoredSubscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseMonitoredSubscriptionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/monitoredSubscriptionName", Expected: &MonitoredSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - MonitoredSubscriptionName: "configurationName", + MonitoredSubscriptionName: "monitoredSubscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/monitoredSubscriptionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseMonitoredSubscriptionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/monitoredSubscriptionName", Expected: &MonitoredSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - MonitoredSubscriptionName: "configurationName", + MonitoredSubscriptionName: "monitoredSubscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/monitoredSubscriptions/monitoredSubscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/mOnItOrEdSuBsCrIpTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/mOnItOrEdSuBsCrIpTiOnS/mOnItOrEdSuBsCrIpTiOnNaMe", Expected: &MonitoredSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - MonitoredSubscriptionName: "cOnFiGuRaTiOnNaMe", + MonitoredSubscriptionName: "mOnItOrEdSuBsCrIpTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/mOnItOrEdSuBsCrIpTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/mOnItOrEdSuBsCrIpTiOnS/mOnItOrEdSuBsCrIpTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/datadog/2023-01-01/rules/README.md b/resource-manager/datadog/2023-01-01/rules/README.md index e04040a15d5..0eb87604e6b 100644 --- a/resource-manager/datadog/2023-01-01/rules/README.md +++ b/resource-manager/datadog/2023-01-01/rules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := rules.MonitoringTagRules{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.TagRulesGet(ctx, id) if err != nil { diff --git a/resource-manager/datadog/2023-01-01/rules/id_tagrule.go b/resource-manager/datadog/2023-01-01/rules/id_tagrule.go index b4eae6727c3..e08c204523b 100644 --- a/resource-manager/datadog/2023-01-01/rules/id_tagrule.go +++ b/resource-manager/datadog/2023-01-01/rules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/datadog/2023-01-01/rules/id_tagrule_test.go b/resource-manager/datadog/2023-01-01/rules/id_tagrule_test.go index dc850dc3cff..96eea9c53a4 100644 --- a/resource-manager/datadog/2023-01-01/rules/id_tagrule_test.go +++ b/resource-manager/datadog/2023-01-01/rules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datadog/2023-01-01/singlesignon/README.md b/resource-manager/datadog/2023-01-01/singlesignon/README.md index 77475c4a307..028c0226aac 100644 --- a/resource-manager/datadog/2023-01-01/singlesignon/README.md +++ b/resource-manager/datadog/2023-01-01/singlesignon/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") payload := singlesignon.DatadogSingleSignOnResource{ // ... @@ -41,7 +41,7 @@ if err := client.ConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") read, err := client.ConfigurationsGet(ctx, id) if err != nil { diff --git a/resource-manager/datadog/2023-01-01/singlesignon/id_singlesignonconfiguration.go b/resource-manager/datadog/2023-01-01/singlesignon/id_singlesignonconfiguration.go index 05f9761401c..623f7daf3f5 100644 --- a/resource-manager/datadog/2023-01-01/singlesignon/id_singlesignonconfiguration.go +++ b/resource-manager/datadog/2023-01-01/singlesignon/id_singlesignonconfiguration.go @@ -123,7 +123,7 @@ func (id SingleSignOnConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticSingleSignOnConfigurations", "singleSignOnConfigurations", "singleSignOnConfigurations"), - resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "singleSignOnConfigurationName"), } } diff --git a/resource-manager/datadog/2023-01-01/singlesignon/id_singlesignonconfiguration_test.go b/resource-manager/datadog/2023-01-01/singlesignon/id_singlesignonconfiguration_test.go index cfc142568b7..36b9754415d 100644 --- a/resource-manager/datadog/2023-01-01/singlesignon/id_singlesignonconfiguration_test.go +++ b/resource-manager/datadog/2023-01-01/singlesignon/id_singlesignonconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SingleSignOnConfigurationId{} func TestNewSingleSignOnConfigurationID(t *testing.T) { - id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") + id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSingleSignOnConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.SingleSignOnConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "configurationName") + if id.SingleSignOnConfigurationName != "singleSignOnConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "singleSignOnConfigurationName") } } func TestFormatSingleSignOnConfigurationID(t *testing.T) { - actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName" + actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSingleSignOnConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSingleSignOnConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Datadog/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - SingleSignOnConfigurationName: "cOnFiGuRaTiOnNaMe", + SingleSignOnConfigurationName: "sInGlEsIgNoNcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAdOg/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/datadog/2023-01-01/singlesignon/model_datadogsinglesignonproperties.go b/resource-manager/datadog/2023-01-01/singlesignon/model_datadogsinglesignonproperties.go index 106a6b056ac..6ee23f09143 100644 --- a/resource-manager/datadog/2023-01-01/singlesignon/model_datadogsinglesignonproperties.go +++ b/resource-manager/datadog/2023-01-01/singlesignon/model_datadogsinglesignonproperties.go @@ -7,5 +7,5 @@ type DatadogSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/datafactory/2018-06-01/changedatacapture/README.md b/resource-manager/datafactory/2018-06-01/changedatacapture/README.md index 09d80cdbccf..302878ab584 100644 --- a/resource-manager/datafactory/2018-06-01/changedatacapture/README.md +++ b/resource-manager/datafactory/2018-06-01/changedatacapture/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "changeDataCaptureName") +id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "adfcdcName") payload := changedatacapture.ChangeDataCaptureResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "changeDataCaptureName") +id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "adfcdcName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "changeDataCaptureName") +id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "adfcdcName") read, err := client.Get(ctx, id, changedatacapture.DefaultGetOperationOptions()) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "changeDataCaptureName") +id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "adfcdcName") read, err := client.Start(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "changeDataCaptureName") +id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "adfcdcName") read, err := client.Status(ctx, id) if err != nil { @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "changeDataCaptureName") +id := changedatacapture.NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "adfcdcName") read, err := client.Stop(ctx, id) if err != nil { diff --git a/resource-manager/datafactory/2018-06-01/changedatacapture/id_adfcdc.go b/resource-manager/datafactory/2018-06-01/changedatacapture/id_adfcdc.go index 4d8c29351e5..1e11d80a552 100644 --- a/resource-manager/datafactory/2018-06-01/changedatacapture/id_adfcdc.go +++ b/resource-manager/datafactory/2018-06-01/changedatacapture/id_adfcdc.go @@ -123,7 +123,7 @@ func (id AdfcdcId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticFactories", "factories", "factories"), resourceids.UserSpecifiedSegment("factoryName", "factoryName"), resourceids.StaticSegment("staticAdfcdcs", "adfcdcs", "adfcdcs"), - resourceids.UserSpecifiedSegment("adfcdcName", "changeDataCaptureName"), + resourceids.UserSpecifiedSegment("adfcdcName", "adfcdcName"), } } diff --git a/resource-manager/datafactory/2018-06-01/changedatacapture/id_adfcdc_test.go b/resource-manager/datafactory/2018-06-01/changedatacapture/id_adfcdc_test.go index b08d65d7a24..fead0977d58 100644 --- a/resource-manager/datafactory/2018-06-01/changedatacapture/id_adfcdc_test.go +++ b/resource-manager/datafactory/2018-06-01/changedatacapture/id_adfcdc_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AdfcdcId{} func TestNewAdfcdcID(t *testing.T) { - id := NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "changeDataCaptureName") + id := NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "adfcdcName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAdfcdcID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'FactoryName'", id.FactoryName, "factoryName") } - if id.AdfcdcName != "changeDataCaptureName" { - t.Fatalf("Expected %q but got %q for Segment 'AdfcdcName'", id.AdfcdcName, "changeDataCaptureName") + if id.AdfcdcName != "adfcdcName" { + t.Fatalf("Expected %q but got %q for Segment 'AdfcdcName'", id.AdfcdcName, "adfcdcName") } } func TestFormatAdfcdcID(t *testing.T) { - actual := NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "changeDataCaptureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/changeDataCaptureName" + actual := NewAdfcdcID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "adfcdcName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/adfcdcName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAdfcdcID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/changeDataCaptureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/adfcdcName", Expected: &AdfcdcId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", FactoryName: "factoryName", - AdfcdcName: "changeDataCaptureName", + AdfcdcName: "adfcdcName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/changeDataCaptureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/adfcdcName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAdfcdcIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/changeDataCaptureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/adfcdcName", Expected: &AdfcdcId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", FactoryName: "factoryName", - AdfcdcName: "changeDataCaptureName", + AdfcdcName: "adfcdcName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/changeDataCaptureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/adfcdcs/adfcdcName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAfAcToRy/fAcToRiEs/fAcToRyNaMe/aDfCdCs/cHaNgEdAtAcApTuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAfAcToRy/fAcToRiEs/fAcToRyNaMe/aDfCdCs/aDfCdCnAmE", Expected: &AdfcdcId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", FactoryName: "fAcToRyNaMe", - AdfcdcName: "cHaNgEdAtAcApTuReNaMe", + AdfcdcName: "aDfCdCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAfAcToRy/fAcToRiEs/fAcToRyNaMe/aDfCdCs/cHaNgEdAtAcApTuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtAfAcToRy/fAcToRiEs/fAcToRyNaMe/aDfCdCs/aDfCdCnAmE/extra", Error: true, }, } diff --git a/resource-manager/datafactory/2018-06-01/credentials/model_secretbase.go b/resource-manager/datafactory/2018-06-01/credentials/model_secretbase.go index 4b6a082dcb3..aed98bd0af6 100644 --- a/resource-manager/datafactory/2018-06-01/credentials/model_secretbase.go +++ b/resource-manager/datafactory/2018-06-01/credentials/model_secretbase.go @@ -61,6 +61,14 @@ func UnmarshalSecretBaseImplementation(input []byte) (SecretBase, error) { return out, nil } + if strings.EqualFold(value, "SecureString") { + var out SecureString + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecureString: %+v", err) + } + return out, nil + } + var parent BaseSecretBaseImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseSecretBaseImpl: %+v", err) diff --git a/resource-manager/datafactory/2018-06-01/credentials/model_securestring.go b/resource-manager/datafactory/2018-06-01/credentials/model_securestring.go new file mode 100644 index 00000000000..37c17e70853 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/credentials/model_securestring.go @@ -0,0 +1,50 @@ +package credentials + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ SecretBase = SecureString{} + +type SecureString struct { + Value string `json:"value"` + + // Fields inherited from SecretBase + + Type string `json:"type"` +} + +func (s SecureString) SecretBase() BaseSecretBaseImpl { + return BaseSecretBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = SecureString{} + +func (s SecureString) MarshalJSON() ([]byte, error) { + type wrapper SecureString + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecureString: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecureString: %+v", err) + } + + decoded["type"] = "SecureString" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecureString: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/constants.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/constants.go index 927e0185e4c..934d75ca2c7 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/constants.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/constants.go @@ -9,6 +9,361 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AmazonRdsForSqlAuthenticationType string + +const ( + AmazonRdsForSqlAuthenticationTypeSQL AmazonRdsForSqlAuthenticationType = "SQL" + AmazonRdsForSqlAuthenticationTypeWindows AmazonRdsForSqlAuthenticationType = "Windows" +) + +func PossibleValuesForAmazonRdsForSqlAuthenticationType() []string { + return []string{ + string(AmazonRdsForSqlAuthenticationTypeSQL), + string(AmazonRdsForSqlAuthenticationTypeWindows), + } +} + +func (s *AmazonRdsForSqlAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAmazonRdsForSqlAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAmazonRdsForSqlAuthenticationType(input string) (*AmazonRdsForSqlAuthenticationType, error) { + vals := map[string]AmazonRdsForSqlAuthenticationType{ + "sql": AmazonRdsForSqlAuthenticationTypeSQL, + "windows": AmazonRdsForSqlAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AmazonRdsForSqlAuthenticationType(input) + return &out, nil +} + +type AzureSqlDWAuthenticationType string + +const ( + AzureSqlDWAuthenticationTypeSQL AzureSqlDWAuthenticationType = "SQL" + AzureSqlDWAuthenticationTypeServicePrincipal AzureSqlDWAuthenticationType = "ServicePrincipal" + AzureSqlDWAuthenticationTypeSystemAssignedManagedIdentity AzureSqlDWAuthenticationType = "SystemAssignedManagedIdentity" + AzureSqlDWAuthenticationTypeUserAssignedManagedIdentity AzureSqlDWAuthenticationType = "UserAssignedManagedIdentity" +) + +func PossibleValuesForAzureSqlDWAuthenticationType() []string { + return []string{ + string(AzureSqlDWAuthenticationTypeSQL), + string(AzureSqlDWAuthenticationTypeServicePrincipal), + string(AzureSqlDWAuthenticationTypeSystemAssignedManagedIdentity), + string(AzureSqlDWAuthenticationTypeUserAssignedManagedIdentity), + } +} + +func (s *AzureSqlDWAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureSqlDWAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureSqlDWAuthenticationType(input string) (*AzureSqlDWAuthenticationType, error) { + vals := map[string]AzureSqlDWAuthenticationType{ + "sql": AzureSqlDWAuthenticationTypeSQL, + "serviceprincipal": AzureSqlDWAuthenticationTypeServicePrincipal, + "systemassignedmanagedidentity": AzureSqlDWAuthenticationTypeSystemAssignedManagedIdentity, + "userassignedmanagedidentity": AzureSqlDWAuthenticationTypeUserAssignedManagedIdentity, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureSqlDWAuthenticationType(input) + return &out, nil +} + +type AzureSqlDatabaseAuthenticationType string + +const ( + AzureSqlDatabaseAuthenticationTypeSQL AzureSqlDatabaseAuthenticationType = "SQL" + AzureSqlDatabaseAuthenticationTypeServicePrincipal AzureSqlDatabaseAuthenticationType = "ServicePrincipal" + AzureSqlDatabaseAuthenticationTypeSystemAssignedManagedIdentity AzureSqlDatabaseAuthenticationType = "SystemAssignedManagedIdentity" + AzureSqlDatabaseAuthenticationTypeUserAssignedManagedIdentity AzureSqlDatabaseAuthenticationType = "UserAssignedManagedIdentity" +) + +func PossibleValuesForAzureSqlDatabaseAuthenticationType() []string { + return []string{ + string(AzureSqlDatabaseAuthenticationTypeSQL), + string(AzureSqlDatabaseAuthenticationTypeServicePrincipal), + string(AzureSqlDatabaseAuthenticationTypeSystemAssignedManagedIdentity), + string(AzureSqlDatabaseAuthenticationTypeUserAssignedManagedIdentity), + } +} + +func (s *AzureSqlDatabaseAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureSqlDatabaseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureSqlDatabaseAuthenticationType(input string) (*AzureSqlDatabaseAuthenticationType, error) { + vals := map[string]AzureSqlDatabaseAuthenticationType{ + "sql": AzureSqlDatabaseAuthenticationTypeSQL, + "serviceprincipal": AzureSqlDatabaseAuthenticationTypeServicePrincipal, + "systemassignedmanagedidentity": AzureSqlDatabaseAuthenticationTypeSystemAssignedManagedIdentity, + "userassignedmanagedidentity": AzureSqlDatabaseAuthenticationTypeUserAssignedManagedIdentity, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureSqlDatabaseAuthenticationType(input) + return &out, nil +} + +type AzureSqlMIAuthenticationType string + +const ( + AzureSqlMIAuthenticationTypeSQL AzureSqlMIAuthenticationType = "SQL" + AzureSqlMIAuthenticationTypeServicePrincipal AzureSqlMIAuthenticationType = "ServicePrincipal" + AzureSqlMIAuthenticationTypeSystemAssignedManagedIdentity AzureSqlMIAuthenticationType = "SystemAssignedManagedIdentity" + AzureSqlMIAuthenticationTypeUserAssignedManagedIdentity AzureSqlMIAuthenticationType = "UserAssignedManagedIdentity" +) + +func PossibleValuesForAzureSqlMIAuthenticationType() []string { + return []string{ + string(AzureSqlMIAuthenticationTypeSQL), + string(AzureSqlMIAuthenticationTypeServicePrincipal), + string(AzureSqlMIAuthenticationTypeSystemAssignedManagedIdentity), + string(AzureSqlMIAuthenticationTypeUserAssignedManagedIdentity), + } +} + +func (s *AzureSqlMIAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureSqlMIAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureSqlMIAuthenticationType(input string) (*AzureSqlMIAuthenticationType, error) { + vals := map[string]AzureSqlMIAuthenticationType{ + "sql": AzureSqlMIAuthenticationTypeSQL, + "serviceprincipal": AzureSqlMIAuthenticationTypeServicePrincipal, + "systemassignedmanagedidentity": AzureSqlMIAuthenticationTypeSystemAssignedManagedIdentity, + "userassignedmanagedidentity": AzureSqlMIAuthenticationTypeUserAssignedManagedIdentity, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureSqlMIAuthenticationType(input) + return &out, nil +} + +type AzureStorageAuthenticationType string + +const ( + AzureStorageAuthenticationTypeAccountKey AzureStorageAuthenticationType = "AccountKey" + AzureStorageAuthenticationTypeAnonymous AzureStorageAuthenticationType = "Anonymous" + AzureStorageAuthenticationTypeMsi AzureStorageAuthenticationType = "Msi" + AzureStorageAuthenticationTypeSasUri AzureStorageAuthenticationType = "SasUri" + AzureStorageAuthenticationTypeServicePrincipal AzureStorageAuthenticationType = "ServicePrincipal" +) + +func PossibleValuesForAzureStorageAuthenticationType() []string { + return []string{ + string(AzureStorageAuthenticationTypeAccountKey), + string(AzureStorageAuthenticationTypeAnonymous), + string(AzureStorageAuthenticationTypeMsi), + string(AzureStorageAuthenticationTypeSasUri), + string(AzureStorageAuthenticationTypeServicePrincipal), + } +} + +func (s *AzureStorageAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureStorageAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureStorageAuthenticationType(input string) (*AzureStorageAuthenticationType, error) { + vals := map[string]AzureStorageAuthenticationType{ + "accountkey": AzureStorageAuthenticationTypeAccountKey, + "anonymous": AzureStorageAuthenticationTypeAnonymous, + "msi": AzureStorageAuthenticationTypeMsi, + "sasuri": AzureStorageAuthenticationTypeSasUri, + "serviceprincipal": AzureStorageAuthenticationTypeServicePrincipal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureStorageAuthenticationType(input) + return &out, nil +} + +type CosmosDbConnectionMode string + +const ( + CosmosDbConnectionModeDirect CosmosDbConnectionMode = "Direct" + CosmosDbConnectionModeGateway CosmosDbConnectionMode = "Gateway" +) + +func PossibleValuesForCosmosDbConnectionMode() []string { + return []string{ + string(CosmosDbConnectionModeDirect), + string(CosmosDbConnectionModeGateway), + } +} + +func (s *CosmosDbConnectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCosmosDbConnectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCosmosDbConnectionMode(input string) (*CosmosDbConnectionMode, error) { + vals := map[string]CosmosDbConnectionMode{ + "direct": CosmosDbConnectionModeDirect, + "gateway": CosmosDbConnectionModeGateway, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CosmosDbConnectionMode(input) + return &out, nil +} + +type CredentialReferenceType string + +const ( + CredentialReferenceTypeCredentialReference CredentialReferenceType = "CredentialReference" +) + +func PossibleValuesForCredentialReferenceType() []string { + return []string{ + string(CredentialReferenceTypeCredentialReference), + } +} + +func (s *CredentialReferenceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCredentialReferenceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCredentialReferenceType(input string) (*CredentialReferenceType, error) { + vals := map[string]CredentialReferenceType{ + "credentialreference": CredentialReferenceTypeCredentialReference, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CredentialReferenceType(input) + return &out, nil +} + +type DataFlowComputeType string + +const ( + DataFlowComputeTypeComputeOptimized DataFlowComputeType = "ComputeOptimized" + DataFlowComputeTypeGeneral DataFlowComputeType = "General" + DataFlowComputeTypeMemoryOptimized DataFlowComputeType = "MemoryOptimized" +) + +func PossibleValuesForDataFlowComputeType() []string { + return []string{ + string(DataFlowComputeTypeComputeOptimized), + string(DataFlowComputeTypeGeneral), + string(DataFlowComputeTypeMemoryOptimized), + } +} + +func (s *DataFlowComputeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDataFlowComputeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDataFlowComputeType(input string) (*DataFlowComputeType, error) { + vals := map[string]DataFlowComputeType{ + "computeoptimized": DataFlowComputeTypeComputeOptimized, + "general": DataFlowComputeTypeGeneral, + "memoryoptimized": DataFlowComputeTypeMemoryOptimized, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataFlowComputeType(input) + return &out, nil +} + type DataFlowDebugCommandType string const ( @@ -53,26 +408,24 @@ func parseDataFlowDebugCommandType(input string) (*DataFlowDebugCommandType, err return &out, nil } -type IntegrationRuntimeType string +type DataFlowReferenceType string const ( - IntegrationRuntimeTypeManaged IntegrationRuntimeType = "Managed" - IntegrationRuntimeTypeSelfHosted IntegrationRuntimeType = "SelfHosted" + DataFlowReferenceTypeDataFlowReference DataFlowReferenceType = "DataFlowReference" ) -func PossibleValuesForIntegrationRuntimeType() []string { +func PossibleValuesForDataFlowReferenceType() []string { return []string{ - string(IntegrationRuntimeTypeManaged), - string(IntegrationRuntimeTypeSelfHosted), + string(DataFlowReferenceTypeDataFlowReference), } } -func (s *IntegrationRuntimeType) UnmarshalJSON(bytes []byte) error { +func (s *DataFlowReferenceType) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseIntegrationRuntimeType(decoded) + out, err := parseDataFlowReferenceType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -80,50 +433,37 @@ func (s *IntegrationRuntimeType) UnmarshalJSON(bytes []byte) error { return nil } -func parseIntegrationRuntimeType(input string) (*IntegrationRuntimeType, error) { - vals := map[string]IntegrationRuntimeType{ - "managed": IntegrationRuntimeTypeManaged, - "selfhosted": IntegrationRuntimeTypeSelfHosted, +func parseDataFlowReferenceType(input string) (*DataFlowReferenceType, error) { + vals := map[string]DataFlowReferenceType{ + "dataflowreference": DataFlowReferenceTypeDataFlowReference, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := IntegrationRuntimeType(input) + out := DataFlowReferenceType(input) return &out, nil } -type ParameterType string +type DatasetReferenceType string const ( - ParameterTypeArray ParameterType = "Array" - ParameterTypeBool ParameterType = "Bool" - ParameterTypeFloat ParameterType = "Float" - ParameterTypeInt ParameterType = "Int" - ParameterTypeObject ParameterType = "Object" - ParameterTypeSecureString ParameterType = "SecureString" - ParameterTypeString ParameterType = "String" + DatasetReferenceTypeDatasetReference DatasetReferenceType = "DatasetReference" ) -func PossibleValuesForParameterType() []string { +func PossibleValuesForDatasetReferenceType() []string { return []string{ - string(ParameterTypeArray), - string(ParameterTypeBool), - string(ParameterTypeFloat), - string(ParameterTypeInt), - string(ParameterTypeObject), - string(ParameterTypeSecureString), - string(ParameterTypeString), + string(DatasetReferenceTypeDatasetReference), } } -func (s *ParameterType) UnmarshalJSON(bytes []byte) error { +func (s *DatasetReferenceType) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseParameterType(decoded) + out, err := parseDatasetReferenceType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -131,7 +471,975 @@ func (s *ParameterType) UnmarshalJSON(bytes []byte) error { return nil } -func parseParameterType(input string) (*ParameterType, error) { +func parseDatasetReferenceType(input string) (*DatasetReferenceType, error) { + vals := map[string]DatasetReferenceType{ + "datasetreference": DatasetReferenceTypeDatasetReference, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatasetReferenceType(input) + return &out, nil +} + +type Db2AuthenticationType string + +const ( + Db2AuthenticationTypeBasic Db2AuthenticationType = "Basic" +) + +func PossibleValuesForDb2AuthenticationType() []string { + return []string{ + string(Db2AuthenticationTypeBasic), + } +} + +func (s *Db2AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDb2AuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDb2AuthenticationType(input string) (*Db2AuthenticationType, error) { + vals := map[string]Db2AuthenticationType{ + "basic": Db2AuthenticationTypeBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Db2AuthenticationType(input) + return &out, nil +} + +type FtpAuthenticationType string + +const ( + FtpAuthenticationTypeAnonymous FtpAuthenticationType = "Anonymous" + FtpAuthenticationTypeBasic FtpAuthenticationType = "Basic" +) + +func PossibleValuesForFtpAuthenticationType() []string { + return []string{ + string(FtpAuthenticationTypeAnonymous), + string(FtpAuthenticationTypeBasic), + } +} + +func (s *FtpAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFtpAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFtpAuthenticationType(input string) (*FtpAuthenticationType, error) { + vals := map[string]FtpAuthenticationType{ + "anonymous": FtpAuthenticationTypeAnonymous, + "basic": FtpAuthenticationTypeBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FtpAuthenticationType(input) + return &out, nil +} + +type GoogleAdWordsAuthenticationType string + +const ( + GoogleAdWordsAuthenticationTypeServiceAuthentication GoogleAdWordsAuthenticationType = "ServiceAuthentication" + GoogleAdWordsAuthenticationTypeUserAuthentication GoogleAdWordsAuthenticationType = "UserAuthentication" +) + +func PossibleValuesForGoogleAdWordsAuthenticationType() []string { + return []string{ + string(GoogleAdWordsAuthenticationTypeServiceAuthentication), + string(GoogleAdWordsAuthenticationTypeUserAuthentication), + } +} + +func (s *GoogleAdWordsAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGoogleAdWordsAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGoogleAdWordsAuthenticationType(input string) (*GoogleAdWordsAuthenticationType, error) { + vals := map[string]GoogleAdWordsAuthenticationType{ + "serviceauthentication": GoogleAdWordsAuthenticationTypeServiceAuthentication, + "userauthentication": GoogleAdWordsAuthenticationTypeUserAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GoogleAdWordsAuthenticationType(input) + return &out, nil +} + +type GoogleBigQueryAuthenticationType string + +const ( + GoogleBigQueryAuthenticationTypeServiceAuthentication GoogleBigQueryAuthenticationType = "ServiceAuthentication" + GoogleBigQueryAuthenticationTypeUserAuthentication GoogleBigQueryAuthenticationType = "UserAuthentication" +) + +func PossibleValuesForGoogleBigQueryAuthenticationType() []string { + return []string{ + string(GoogleBigQueryAuthenticationTypeServiceAuthentication), + string(GoogleBigQueryAuthenticationTypeUserAuthentication), + } +} + +func (s *GoogleBigQueryAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGoogleBigQueryAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGoogleBigQueryAuthenticationType(input string) (*GoogleBigQueryAuthenticationType, error) { + vals := map[string]GoogleBigQueryAuthenticationType{ + "serviceauthentication": GoogleBigQueryAuthenticationTypeServiceAuthentication, + "userauthentication": GoogleBigQueryAuthenticationTypeUserAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GoogleBigQueryAuthenticationType(input) + return &out, nil +} + +type GoogleBigQueryV2AuthenticationType string + +const ( + GoogleBigQueryV2AuthenticationTypeServiceAuthentication GoogleBigQueryV2AuthenticationType = "ServiceAuthentication" + GoogleBigQueryV2AuthenticationTypeUserAuthentication GoogleBigQueryV2AuthenticationType = "UserAuthentication" +) + +func PossibleValuesForGoogleBigQueryV2AuthenticationType() []string { + return []string{ + string(GoogleBigQueryV2AuthenticationTypeServiceAuthentication), + string(GoogleBigQueryV2AuthenticationTypeUserAuthentication), + } +} + +func (s *GoogleBigQueryV2AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGoogleBigQueryV2AuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGoogleBigQueryV2AuthenticationType(input string) (*GoogleBigQueryV2AuthenticationType, error) { + vals := map[string]GoogleBigQueryV2AuthenticationType{ + "serviceauthentication": GoogleBigQueryV2AuthenticationTypeServiceAuthentication, + "userauthentication": GoogleBigQueryV2AuthenticationTypeUserAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GoogleBigQueryV2AuthenticationType(input) + return &out, nil +} + +type HBaseAuthenticationType string + +const ( + HBaseAuthenticationTypeAnonymous HBaseAuthenticationType = "Anonymous" + HBaseAuthenticationTypeBasic HBaseAuthenticationType = "Basic" +) + +func PossibleValuesForHBaseAuthenticationType() []string { + return []string{ + string(HBaseAuthenticationTypeAnonymous), + string(HBaseAuthenticationTypeBasic), + } +} + +func (s *HBaseAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHBaseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHBaseAuthenticationType(input string) (*HBaseAuthenticationType, error) { + vals := map[string]HBaseAuthenticationType{ + "anonymous": HBaseAuthenticationTypeAnonymous, + "basic": HBaseAuthenticationTypeBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HBaseAuthenticationType(input) + return &out, nil +} + +type HTTPAuthenticationType string + +const ( + HTTPAuthenticationTypeAnonymous HTTPAuthenticationType = "Anonymous" + HTTPAuthenticationTypeBasic HTTPAuthenticationType = "Basic" + HTTPAuthenticationTypeClientCertificate HTTPAuthenticationType = "ClientCertificate" + HTTPAuthenticationTypeDigest HTTPAuthenticationType = "Digest" + HTTPAuthenticationTypeWindows HTTPAuthenticationType = "Windows" +) + +func PossibleValuesForHTTPAuthenticationType() []string { + return []string{ + string(HTTPAuthenticationTypeAnonymous), + string(HTTPAuthenticationTypeBasic), + string(HTTPAuthenticationTypeClientCertificate), + string(HTTPAuthenticationTypeDigest), + string(HTTPAuthenticationTypeWindows), + } +} + +func (s *HTTPAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHTTPAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHTTPAuthenticationType(input string) (*HTTPAuthenticationType, error) { + vals := map[string]HTTPAuthenticationType{ + "anonymous": HTTPAuthenticationTypeAnonymous, + "basic": HTTPAuthenticationTypeBasic, + "clientcertificate": HTTPAuthenticationTypeClientCertificate, + "digest": HTTPAuthenticationTypeDigest, + "windows": HTTPAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HTTPAuthenticationType(input) + return &out, nil +} + +type HiveAuthenticationType string + +const ( + HiveAuthenticationTypeAnonymous HiveAuthenticationType = "Anonymous" + HiveAuthenticationTypeUsername HiveAuthenticationType = "Username" + HiveAuthenticationTypeUsernameAndPassword HiveAuthenticationType = "UsernameAndPassword" + HiveAuthenticationTypeWindowsAzureHDInsightService HiveAuthenticationType = "WindowsAzureHDInsightService" +) + +func PossibleValuesForHiveAuthenticationType() []string { + return []string{ + string(HiveAuthenticationTypeAnonymous), + string(HiveAuthenticationTypeUsername), + string(HiveAuthenticationTypeUsernameAndPassword), + string(HiveAuthenticationTypeWindowsAzureHDInsightService), + } +} + +func (s *HiveAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHiveAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHiveAuthenticationType(input string) (*HiveAuthenticationType, error) { + vals := map[string]HiveAuthenticationType{ + "anonymous": HiveAuthenticationTypeAnonymous, + "username": HiveAuthenticationTypeUsername, + "usernameandpassword": HiveAuthenticationTypeUsernameAndPassword, + "windowsazurehdinsightservice": HiveAuthenticationTypeWindowsAzureHDInsightService, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HiveAuthenticationType(input) + return &out, nil +} + +type HiveServerType string + +const ( + HiveServerTypeHiveServerOne HiveServerType = "HiveServer1" + HiveServerTypeHiveServerTwo HiveServerType = "HiveServer2" + HiveServerTypeHiveThriftServer HiveServerType = "HiveThriftServer" +) + +func PossibleValuesForHiveServerType() []string { + return []string{ + string(HiveServerTypeHiveServerOne), + string(HiveServerTypeHiveServerTwo), + string(HiveServerTypeHiveThriftServer), + } +} + +func (s *HiveServerType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHiveServerType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHiveServerType(input string) (*HiveServerType, error) { + vals := map[string]HiveServerType{ + "hiveserver1": HiveServerTypeHiveServerOne, + "hiveserver2": HiveServerTypeHiveServerTwo, + "hivethriftserver": HiveServerTypeHiveThriftServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HiveServerType(input) + return &out, nil +} + +type HiveThriftTransportProtocol string + +const ( + HiveThriftTransportProtocolBinary HiveThriftTransportProtocol = "Binary" + HiveThriftTransportProtocolHTTP HiveThriftTransportProtocol = "HTTP " + HiveThriftTransportProtocolSASL HiveThriftTransportProtocol = "SASL" +) + +func PossibleValuesForHiveThriftTransportProtocol() []string { + return []string{ + string(HiveThriftTransportProtocolBinary), + string(HiveThriftTransportProtocolHTTP), + string(HiveThriftTransportProtocolSASL), + } +} + +func (s *HiveThriftTransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHiveThriftTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHiveThriftTransportProtocol(input string) (*HiveThriftTransportProtocol, error) { + vals := map[string]HiveThriftTransportProtocol{ + "binary": HiveThriftTransportProtocolBinary, + "http ": HiveThriftTransportProtocolHTTP, + "sasl": HiveThriftTransportProtocolSASL, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HiveThriftTransportProtocol(input) + return &out, nil +} + +type ImpalaAuthenticationType string + +const ( + ImpalaAuthenticationTypeAnonymous ImpalaAuthenticationType = "Anonymous" + ImpalaAuthenticationTypeSASLUsername ImpalaAuthenticationType = "SASLUsername" + ImpalaAuthenticationTypeUsernameAndPassword ImpalaAuthenticationType = "UsernameAndPassword" +) + +func PossibleValuesForImpalaAuthenticationType() []string { + return []string{ + string(ImpalaAuthenticationTypeAnonymous), + string(ImpalaAuthenticationTypeSASLUsername), + string(ImpalaAuthenticationTypeUsernameAndPassword), + } +} + +func (s *ImpalaAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseImpalaAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseImpalaAuthenticationType(input string) (*ImpalaAuthenticationType, error) { + vals := map[string]ImpalaAuthenticationType{ + "anonymous": ImpalaAuthenticationTypeAnonymous, + "saslusername": ImpalaAuthenticationTypeSASLUsername, + "usernameandpassword": ImpalaAuthenticationTypeUsernameAndPassword, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ImpalaAuthenticationType(input) + return &out, nil +} + +type IntegrationRuntimeEdition string + +const ( + IntegrationRuntimeEditionEnterprise IntegrationRuntimeEdition = "Enterprise" + IntegrationRuntimeEditionStandard IntegrationRuntimeEdition = "Standard" +) + +func PossibleValuesForIntegrationRuntimeEdition() []string { + return []string{ + string(IntegrationRuntimeEditionEnterprise), + string(IntegrationRuntimeEditionStandard), + } +} + +func (s *IntegrationRuntimeEdition) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIntegrationRuntimeEdition(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIntegrationRuntimeEdition(input string) (*IntegrationRuntimeEdition, error) { + vals := map[string]IntegrationRuntimeEdition{ + "enterprise": IntegrationRuntimeEditionEnterprise, + "standard": IntegrationRuntimeEditionStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IntegrationRuntimeEdition(input) + return &out, nil +} + +type IntegrationRuntimeEntityReferenceType string + +const ( + IntegrationRuntimeEntityReferenceTypeIntegrationRuntimeReference IntegrationRuntimeEntityReferenceType = "IntegrationRuntimeReference" + IntegrationRuntimeEntityReferenceTypeLinkedServiceReference IntegrationRuntimeEntityReferenceType = "LinkedServiceReference" +) + +func PossibleValuesForIntegrationRuntimeEntityReferenceType() []string { + return []string{ + string(IntegrationRuntimeEntityReferenceTypeIntegrationRuntimeReference), + string(IntegrationRuntimeEntityReferenceTypeLinkedServiceReference), + } +} + +func (s *IntegrationRuntimeEntityReferenceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIntegrationRuntimeEntityReferenceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIntegrationRuntimeEntityReferenceType(input string) (*IntegrationRuntimeEntityReferenceType, error) { + vals := map[string]IntegrationRuntimeEntityReferenceType{ + "integrationruntimereference": IntegrationRuntimeEntityReferenceTypeIntegrationRuntimeReference, + "linkedservicereference": IntegrationRuntimeEntityReferenceTypeLinkedServiceReference, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IntegrationRuntimeEntityReferenceType(input) + return &out, nil +} + +type IntegrationRuntimeLicenseType string + +const ( + IntegrationRuntimeLicenseTypeBasePrice IntegrationRuntimeLicenseType = "BasePrice" + IntegrationRuntimeLicenseTypeLicenseIncluded IntegrationRuntimeLicenseType = "LicenseIncluded" +) + +func PossibleValuesForIntegrationRuntimeLicenseType() []string { + return []string{ + string(IntegrationRuntimeLicenseTypeBasePrice), + string(IntegrationRuntimeLicenseTypeLicenseIncluded), + } +} + +func (s *IntegrationRuntimeLicenseType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIntegrationRuntimeLicenseType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIntegrationRuntimeLicenseType(input string) (*IntegrationRuntimeLicenseType, error) { + vals := map[string]IntegrationRuntimeLicenseType{ + "baseprice": IntegrationRuntimeLicenseTypeBasePrice, + "licenseincluded": IntegrationRuntimeLicenseTypeLicenseIncluded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IntegrationRuntimeLicenseType(input) + return &out, nil +} + +type IntegrationRuntimeSsisCatalogPricingTier string + +const ( + IntegrationRuntimeSsisCatalogPricingTierBasic IntegrationRuntimeSsisCatalogPricingTier = "Basic" + IntegrationRuntimeSsisCatalogPricingTierPremium IntegrationRuntimeSsisCatalogPricingTier = "Premium" + IntegrationRuntimeSsisCatalogPricingTierPremiumRS IntegrationRuntimeSsisCatalogPricingTier = "PremiumRS" + IntegrationRuntimeSsisCatalogPricingTierStandard IntegrationRuntimeSsisCatalogPricingTier = "Standard" +) + +func PossibleValuesForIntegrationRuntimeSsisCatalogPricingTier() []string { + return []string{ + string(IntegrationRuntimeSsisCatalogPricingTierBasic), + string(IntegrationRuntimeSsisCatalogPricingTierPremium), + string(IntegrationRuntimeSsisCatalogPricingTierPremiumRS), + string(IntegrationRuntimeSsisCatalogPricingTierStandard), + } +} + +func (s *IntegrationRuntimeSsisCatalogPricingTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIntegrationRuntimeSsisCatalogPricingTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIntegrationRuntimeSsisCatalogPricingTier(input string) (*IntegrationRuntimeSsisCatalogPricingTier, error) { + vals := map[string]IntegrationRuntimeSsisCatalogPricingTier{ + "basic": IntegrationRuntimeSsisCatalogPricingTierBasic, + "premium": IntegrationRuntimeSsisCatalogPricingTierPremium, + "premiumrs": IntegrationRuntimeSsisCatalogPricingTierPremiumRS, + "standard": IntegrationRuntimeSsisCatalogPricingTierStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IntegrationRuntimeSsisCatalogPricingTier(input) + return &out, nil +} + +type IntegrationRuntimeState string + +const ( + IntegrationRuntimeStateAccessDenied IntegrationRuntimeState = "AccessDenied" + IntegrationRuntimeStateInitial IntegrationRuntimeState = "Initial" + IntegrationRuntimeStateLimited IntegrationRuntimeState = "Limited" + IntegrationRuntimeStateNeedRegistration IntegrationRuntimeState = "NeedRegistration" + IntegrationRuntimeStateOffline IntegrationRuntimeState = "Offline" + IntegrationRuntimeStateOnline IntegrationRuntimeState = "Online" + IntegrationRuntimeStateStarted IntegrationRuntimeState = "Started" + IntegrationRuntimeStateStarting IntegrationRuntimeState = "Starting" + IntegrationRuntimeStateStopped IntegrationRuntimeState = "Stopped" + IntegrationRuntimeStateStopping IntegrationRuntimeState = "Stopping" +) + +func PossibleValuesForIntegrationRuntimeState() []string { + return []string{ + string(IntegrationRuntimeStateAccessDenied), + string(IntegrationRuntimeStateInitial), + string(IntegrationRuntimeStateLimited), + string(IntegrationRuntimeStateNeedRegistration), + string(IntegrationRuntimeStateOffline), + string(IntegrationRuntimeStateOnline), + string(IntegrationRuntimeStateStarted), + string(IntegrationRuntimeStateStarting), + string(IntegrationRuntimeStateStopped), + string(IntegrationRuntimeStateStopping), + } +} + +func (s *IntegrationRuntimeState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIntegrationRuntimeState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIntegrationRuntimeState(input string) (*IntegrationRuntimeState, error) { + vals := map[string]IntegrationRuntimeState{ + "accessdenied": IntegrationRuntimeStateAccessDenied, + "initial": IntegrationRuntimeStateInitial, + "limited": IntegrationRuntimeStateLimited, + "needregistration": IntegrationRuntimeStateNeedRegistration, + "offline": IntegrationRuntimeStateOffline, + "online": IntegrationRuntimeStateOnline, + "started": IntegrationRuntimeStateStarted, + "starting": IntegrationRuntimeStateStarting, + "stopped": IntegrationRuntimeStateStopped, + "stopping": IntegrationRuntimeStateStopping, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IntegrationRuntimeState(input) + return &out, nil +} + +type IntegrationRuntimeType string + +const ( + IntegrationRuntimeTypeManaged IntegrationRuntimeType = "Managed" + IntegrationRuntimeTypeSelfHosted IntegrationRuntimeType = "SelfHosted" +) + +func PossibleValuesForIntegrationRuntimeType() []string { + return []string{ + string(IntegrationRuntimeTypeManaged), + string(IntegrationRuntimeTypeSelfHosted), + } +} + +func (s *IntegrationRuntimeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIntegrationRuntimeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIntegrationRuntimeType(input string) (*IntegrationRuntimeType, error) { + vals := map[string]IntegrationRuntimeType{ + "managed": IntegrationRuntimeTypeManaged, + "selfhosted": IntegrationRuntimeTypeSelfHosted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IntegrationRuntimeType(input) + return &out, nil +} + +type ManagedVirtualNetworkReferenceType string + +const ( + ManagedVirtualNetworkReferenceTypeManagedVirtualNetworkReference ManagedVirtualNetworkReferenceType = "ManagedVirtualNetworkReference" +) + +func PossibleValuesForManagedVirtualNetworkReferenceType() []string { + return []string{ + string(ManagedVirtualNetworkReferenceTypeManagedVirtualNetworkReference), + } +} + +func (s *ManagedVirtualNetworkReferenceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseManagedVirtualNetworkReferenceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseManagedVirtualNetworkReferenceType(input string) (*ManagedVirtualNetworkReferenceType, error) { + vals := map[string]ManagedVirtualNetworkReferenceType{ + "managedvirtualnetworkreference": ManagedVirtualNetworkReferenceTypeManagedVirtualNetworkReference, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ManagedVirtualNetworkReferenceType(input) + return &out, nil +} + +type MongoDbAuthenticationType string + +const ( + MongoDbAuthenticationTypeAnonymous MongoDbAuthenticationType = "Anonymous" + MongoDbAuthenticationTypeBasic MongoDbAuthenticationType = "Basic" +) + +func PossibleValuesForMongoDbAuthenticationType() []string { + return []string{ + string(MongoDbAuthenticationTypeAnonymous), + string(MongoDbAuthenticationTypeBasic), + } +} + +func (s *MongoDbAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbAuthenticationType(input string) (*MongoDbAuthenticationType, error) { + vals := map[string]MongoDbAuthenticationType{ + "anonymous": MongoDbAuthenticationTypeAnonymous, + "basic": MongoDbAuthenticationTypeBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbAuthenticationType(input) + return &out, nil +} + +type ODataAadServicePrincipalCredentialType string + +const ( + ODataAadServicePrincipalCredentialTypeServicePrincipalCert ODataAadServicePrincipalCredentialType = "ServicePrincipalCert" + ODataAadServicePrincipalCredentialTypeServicePrincipalKey ODataAadServicePrincipalCredentialType = "ServicePrincipalKey" +) + +func PossibleValuesForODataAadServicePrincipalCredentialType() []string { + return []string{ + string(ODataAadServicePrincipalCredentialTypeServicePrincipalCert), + string(ODataAadServicePrincipalCredentialTypeServicePrincipalKey), + } +} + +func (s *ODataAadServicePrincipalCredentialType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseODataAadServicePrincipalCredentialType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseODataAadServicePrincipalCredentialType(input string) (*ODataAadServicePrincipalCredentialType, error) { + vals := map[string]ODataAadServicePrincipalCredentialType{ + "serviceprincipalcert": ODataAadServicePrincipalCredentialTypeServicePrincipalCert, + "serviceprincipalkey": ODataAadServicePrincipalCredentialTypeServicePrincipalKey, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ODataAadServicePrincipalCredentialType(input) + return &out, nil +} + +type ODataAuthenticationType string + +const ( + ODataAuthenticationTypeAadServicePrincipal ODataAuthenticationType = "AadServicePrincipal" + ODataAuthenticationTypeAnonymous ODataAuthenticationType = "Anonymous" + ODataAuthenticationTypeBasic ODataAuthenticationType = "Basic" + ODataAuthenticationTypeManagedServiceIdentity ODataAuthenticationType = "ManagedServiceIdentity" + ODataAuthenticationTypeWindows ODataAuthenticationType = "Windows" +) + +func PossibleValuesForODataAuthenticationType() []string { + return []string{ + string(ODataAuthenticationTypeAadServicePrincipal), + string(ODataAuthenticationTypeAnonymous), + string(ODataAuthenticationTypeBasic), + string(ODataAuthenticationTypeManagedServiceIdentity), + string(ODataAuthenticationTypeWindows), + } +} + +func (s *ODataAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseODataAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseODataAuthenticationType(input string) (*ODataAuthenticationType, error) { + vals := map[string]ODataAuthenticationType{ + "aadserviceprincipal": ODataAuthenticationTypeAadServicePrincipal, + "anonymous": ODataAuthenticationTypeAnonymous, + "basic": ODataAuthenticationTypeBasic, + "managedserviceidentity": ODataAuthenticationTypeManagedServiceIdentity, + "windows": ODataAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ODataAuthenticationType(input) + return &out, nil +} + +type ParameterType string + +const ( + ParameterTypeArray ParameterType = "Array" + ParameterTypeBool ParameterType = "Bool" + ParameterTypeFloat ParameterType = "Float" + ParameterTypeInt ParameterType = "Int" + ParameterTypeObject ParameterType = "Object" + ParameterTypeSecureString ParameterType = "SecureString" + ParameterTypeString ParameterType = "String" +) + +func PossibleValuesForParameterType() []string { + return []string{ + string(ParameterTypeArray), + string(ParameterTypeBool), + string(ParameterTypeFloat), + string(ParameterTypeInt), + string(ParameterTypeObject), + string(ParameterTypeSecureString), + string(ParameterTypeString), + } +} + +func (s *ParameterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseParameterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseParameterType(input string) (*ParameterType, error) { vals := map[string]ParameterType{ "array": ParameterTypeArray, "bool": ParameterTypeBool, @@ -146,6 +1454,783 @@ func parseParameterType(input string) (*ParameterType, error) { } // otherwise presume it's an undefined value and best-effort it - out := ParameterType(input) + out := ParameterType(input) + return &out, nil +} + +type PhoenixAuthenticationType string + +const ( + PhoenixAuthenticationTypeAnonymous PhoenixAuthenticationType = "Anonymous" + PhoenixAuthenticationTypeUsernameAndPassword PhoenixAuthenticationType = "UsernameAndPassword" + PhoenixAuthenticationTypeWindowsAzureHDInsightService PhoenixAuthenticationType = "WindowsAzureHDInsightService" +) + +func PossibleValuesForPhoenixAuthenticationType() []string { + return []string{ + string(PhoenixAuthenticationTypeAnonymous), + string(PhoenixAuthenticationTypeUsernameAndPassword), + string(PhoenixAuthenticationTypeWindowsAzureHDInsightService), + } +} + +func (s *PhoenixAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePhoenixAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePhoenixAuthenticationType(input string) (*PhoenixAuthenticationType, error) { + vals := map[string]PhoenixAuthenticationType{ + "anonymous": PhoenixAuthenticationTypeAnonymous, + "usernameandpassword": PhoenixAuthenticationTypeUsernameAndPassword, + "windowsazurehdinsightservice": PhoenixAuthenticationTypeWindowsAzureHDInsightService, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PhoenixAuthenticationType(input) + return &out, nil +} + +type PrestoAuthenticationType string + +const ( + PrestoAuthenticationTypeAnonymous PrestoAuthenticationType = "Anonymous" + PrestoAuthenticationTypeLDAP PrestoAuthenticationType = "LDAP" +) + +func PossibleValuesForPrestoAuthenticationType() []string { + return []string{ + string(PrestoAuthenticationTypeAnonymous), + string(PrestoAuthenticationTypeLDAP), + } +} + +func (s *PrestoAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePrestoAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePrestoAuthenticationType(input string) (*PrestoAuthenticationType, error) { + vals := map[string]PrestoAuthenticationType{ + "anonymous": PrestoAuthenticationTypeAnonymous, + "ldap": PrestoAuthenticationTypeLDAP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrestoAuthenticationType(input) + return &out, nil +} + +type RestServiceAuthenticationType string + +const ( + RestServiceAuthenticationTypeAadServicePrincipal RestServiceAuthenticationType = "AadServicePrincipal" + RestServiceAuthenticationTypeAnonymous RestServiceAuthenticationType = "Anonymous" + RestServiceAuthenticationTypeBasic RestServiceAuthenticationType = "Basic" + RestServiceAuthenticationTypeManagedServiceIdentity RestServiceAuthenticationType = "ManagedServiceIdentity" + RestServiceAuthenticationTypeOAuthTwoClientCredential RestServiceAuthenticationType = "OAuth2ClientCredential" +) + +func PossibleValuesForRestServiceAuthenticationType() []string { + return []string{ + string(RestServiceAuthenticationTypeAadServicePrincipal), + string(RestServiceAuthenticationTypeAnonymous), + string(RestServiceAuthenticationTypeBasic), + string(RestServiceAuthenticationTypeManagedServiceIdentity), + string(RestServiceAuthenticationTypeOAuthTwoClientCredential), + } +} + +func (s *RestServiceAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRestServiceAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRestServiceAuthenticationType(input string) (*RestServiceAuthenticationType, error) { + vals := map[string]RestServiceAuthenticationType{ + "aadserviceprincipal": RestServiceAuthenticationTypeAadServicePrincipal, + "anonymous": RestServiceAuthenticationTypeAnonymous, + "basic": RestServiceAuthenticationTypeBasic, + "managedserviceidentity": RestServiceAuthenticationTypeManagedServiceIdentity, + "oauth2clientcredential": RestServiceAuthenticationTypeOAuthTwoClientCredential, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RestServiceAuthenticationType(input) + return &out, nil +} + +type SapHanaAuthenticationType string + +const ( + SapHanaAuthenticationTypeBasic SapHanaAuthenticationType = "Basic" + SapHanaAuthenticationTypeWindows SapHanaAuthenticationType = "Windows" +) + +func PossibleValuesForSapHanaAuthenticationType() []string { + return []string{ + string(SapHanaAuthenticationTypeBasic), + string(SapHanaAuthenticationTypeWindows), + } +} + +func (s *SapHanaAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSapHanaAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSapHanaAuthenticationType(input string) (*SapHanaAuthenticationType, error) { + vals := map[string]SapHanaAuthenticationType{ + "basic": SapHanaAuthenticationTypeBasic, + "windows": SapHanaAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SapHanaAuthenticationType(input) + return &out, nil +} + +type ServiceNowAuthenticationType string + +const ( + ServiceNowAuthenticationTypeBasic ServiceNowAuthenticationType = "Basic" + ServiceNowAuthenticationTypeOAuthTwo ServiceNowAuthenticationType = "OAuth2" +) + +func PossibleValuesForServiceNowAuthenticationType() []string { + return []string{ + string(ServiceNowAuthenticationTypeBasic), + string(ServiceNowAuthenticationTypeOAuthTwo), + } +} + +func (s *ServiceNowAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceNowAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceNowAuthenticationType(input string) (*ServiceNowAuthenticationType, error) { + vals := map[string]ServiceNowAuthenticationType{ + "basic": ServiceNowAuthenticationTypeBasic, + "oauth2": ServiceNowAuthenticationTypeOAuthTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceNowAuthenticationType(input) + return &out, nil +} + +type ServiceNowV2AuthenticationType string + +const ( + ServiceNowV2AuthenticationTypeBasic ServiceNowV2AuthenticationType = "Basic" + ServiceNowV2AuthenticationTypeOAuthTwo ServiceNowV2AuthenticationType = "OAuth2" +) + +func PossibleValuesForServiceNowV2AuthenticationType() []string { + return []string{ + string(ServiceNowV2AuthenticationTypeBasic), + string(ServiceNowV2AuthenticationTypeOAuthTwo), + } +} + +func (s *ServiceNowV2AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceNowV2AuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceNowV2AuthenticationType(input string) (*ServiceNowV2AuthenticationType, error) { + vals := map[string]ServiceNowV2AuthenticationType{ + "basic": ServiceNowV2AuthenticationTypeBasic, + "oauth2": ServiceNowV2AuthenticationTypeOAuthTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceNowV2AuthenticationType(input) + return &out, nil +} + +type SftpAuthenticationType string + +const ( + SftpAuthenticationTypeBasic SftpAuthenticationType = "Basic" + SftpAuthenticationTypeMultiFactor SftpAuthenticationType = "MultiFactor" + SftpAuthenticationTypeSshPublicKey SftpAuthenticationType = "SshPublicKey" +) + +func PossibleValuesForSftpAuthenticationType() []string { + return []string{ + string(SftpAuthenticationTypeBasic), + string(SftpAuthenticationTypeMultiFactor), + string(SftpAuthenticationTypeSshPublicKey), + } +} + +func (s *SftpAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSftpAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSftpAuthenticationType(input string) (*SftpAuthenticationType, error) { + vals := map[string]SftpAuthenticationType{ + "basic": SftpAuthenticationTypeBasic, + "multifactor": SftpAuthenticationTypeMultiFactor, + "sshpublickey": SftpAuthenticationTypeSshPublicKey, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SftpAuthenticationType(input) + return &out, nil +} + +type SnowflakeAuthenticationType string + +const ( + SnowflakeAuthenticationTypeAADServicePrincipal SnowflakeAuthenticationType = "AADServicePrincipal" + SnowflakeAuthenticationTypeBasic SnowflakeAuthenticationType = "Basic" + SnowflakeAuthenticationTypeKeyPair SnowflakeAuthenticationType = "KeyPair" +) + +func PossibleValuesForSnowflakeAuthenticationType() []string { + return []string{ + string(SnowflakeAuthenticationTypeAADServicePrincipal), + string(SnowflakeAuthenticationTypeBasic), + string(SnowflakeAuthenticationTypeKeyPair), + } +} + +func (s *SnowflakeAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSnowflakeAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSnowflakeAuthenticationType(input string) (*SnowflakeAuthenticationType, error) { + vals := map[string]SnowflakeAuthenticationType{ + "aadserviceprincipal": SnowflakeAuthenticationTypeAADServicePrincipal, + "basic": SnowflakeAuthenticationTypeBasic, + "keypair": SnowflakeAuthenticationTypeKeyPair, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SnowflakeAuthenticationType(input) + return &out, nil +} + +type SparkAuthenticationType string + +const ( + SparkAuthenticationTypeAnonymous SparkAuthenticationType = "Anonymous" + SparkAuthenticationTypeUsername SparkAuthenticationType = "Username" + SparkAuthenticationTypeUsernameAndPassword SparkAuthenticationType = "UsernameAndPassword" + SparkAuthenticationTypeWindowsAzureHDInsightService SparkAuthenticationType = "WindowsAzureHDInsightService" +) + +func PossibleValuesForSparkAuthenticationType() []string { + return []string{ + string(SparkAuthenticationTypeAnonymous), + string(SparkAuthenticationTypeUsername), + string(SparkAuthenticationTypeUsernameAndPassword), + string(SparkAuthenticationTypeWindowsAzureHDInsightService), + } +} + +func (s *SparkAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSparkAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSparkAuthenticationType(input string) (*SparkAuthenticationType, error) { + vals := map[string]SparkAuthenticationType{ + "anonymous": SparkAuthenticationTypeAnonymous, + "username": SparkAuthenticationTypeUsername, + "usernameandpassword": SparkAuthenticationTypeUsernameAndPassword, + "windowsazurehdinsightservice": SparkAuthenticationTypeWindowsAzureHDInsightService, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SparkAuthenticationType(input) + return &out, nil +} + +type SparkServerType string + +const ( + SparkServerTypeSharkServer SparkServerType = "SharkServer" + SparkServerTypeSharkServerTwo SparkServerType = "SharkServer2" + SparkServerTypeSparkThriftServer SparkServerType = "SparkThriftServer" +) + +func PossibleValuesForSparkServerType() []string { + return []string{ + string(SparkServerTypeSharkServer), + string(SparkServerTypeSharkServerTwo), + string(SparkServerTypeSparkThriftServer), + } +} + +func (s *SparkServerType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSparkServerType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSparkServerType(input string) (*SparkServerType, error) { + vals := map[string]SparkServerType{ + "sharkserver": SparkServerTypeSharkServer, + "sharkserver2": SparkServerTypeSharkServerTwo, + "sparkthriftserver": SparkServerTypeSparkThriftServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SparkServerType(input) + return &out, nil +} + +type SparkThriftTransportProtocol string + +const ( + SparkThriftTransportProtocolBinary SparkThriftTransportProtocol = "Binary" + SparkThriftTransportProtocolHTTP SparkThriftTransportProtocol = "HTTP " + SparkThriftTransportProtocolSASL SparkThriftTransportProtocol = "SASL" +) + +func PossibleValuesForSparkThriftTransportProtocol() []string { + return []string{ + string(SparkThriftTransportProtocolBinary), + string(SparkThriftTransportProtocolHTTP), + string(SparkThriftTransportProtocolSASL), + } +} + +func (s *SparkThriftTransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSparkThriftTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSparkThriftTransportProtocol(input string) (*SparkThriftTransportProtocol, error) { + vals := map[string]SparkThriftTransportProtocol{ + "binary": SparkThriftTransportProtocolBinary, + "http ": SparkThriftTransportProtocolHTTP, + "sasl": SparkThriftTransportProtocolSASL, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SparkThriftTransportProtocol(input) + return &out, nil +} + +type SqlAlwaysEncryptedAkvAuthType string + +const ( + SqlAlwaysEncryptedAkvAuthTypeManagedIdentity SqlAlwaysEncryptedAkvAuthType = "ManagedIdentity" + SqlAlwaysEncryptedAkvAuthTypeServicePrincipal SqlAlwaysEncryptedAkvAuthType = "ServicePrincipal" + SqlAlwaysEncryptedAkvAuthTypeUserAssignedManagedIdentity SqlAlwaysEncryptedAkvAuthType = "UserAssignedManagedIdentity" +) + +func PossibleValuesForSqlAlwaysEncryptedAkvAuthType() []string { + return []string{ + string(SqlAlwaysEncryptedAkvAuthTypeManagedIdentity), + string(SqlAlwaysEncryptedAkvAuthTypeServicePrincipal), + string(SqlAlwaysEncryptedAkvAuthTypeUserAssignedManagedIdentity), + } +} + +func (s *SqlAlwaysEncryptedAkvAuthType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlAlwaysEncryptedAkvAuthType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlAlwaysEncryptedAkvAuthType(input string) (*SqlAlwaysEncryptedAkvAuthType, error) { + vals := map[string]SqlAlwaysEncryptedAkvAuthType{ + "managedidentity": SqlAlwaysEncryptedAkvAuthTypeManagedIdentity, + "serviceprincipal": SqlAlwaysEncryptedAkvAuthTypeServicePrincipal, + "userassignedmanagedidentity": SqlAlwaysEncryptedAkvAuthTypeUserAssignedManagedIdentity, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlAlwaysEncryptedAkvAuthType(input) + return &out, nil +} + +type SqlServerAuthenticationType string + +const ( + SqlServerAuthenticationTypeSQL SqlServerAuthenticationType = "SQL" + SqlServerAuthenticationTypeUserAssignedManagedIdentity SqlServerAuthenticationType = "UserAssignedManagedIdentity" + SqlServerAuthenticationTypeWindows SqlServerAuthenticationType = "Windows" +) + +func PossibleValuesForSqlServerAuthenticationType() []string { + return []string{ + string(SqlServerAuthenticationTypeSQL), + string(SqlServerAuthenticationTypeUserAssignedManagedIdentity), + string(SqlServerAuthenticationTypeWindows), + } +} + +func (s *SqlServerAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlServerAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlServerAuthenticationType(input string) (*SqlServerAuthenticationType, error) { + vals := map[string]SqlServerAuthenticationType{ + "sql": SqlServerAuthenticationTypeSQL, + "userassignedmanagedidentity": SqlServerAuthenticationTypeUserAssignedManagedIdentity, + "windows": SqlServerAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlServerAuthenticationType(input) + return &out, nil +} + +type SybaseAuthenticationType string + +const ( + SybaseAuthenticationTypeBasic SybaseAuthenticationType = "Basic" + SybaseAuthenticationTypeWindows SybaseAuthenticationType = "Windows" +) + +func PossibleValuesForSybaseAuthenticationType() []string { + return []string{ + string(SybaseAuthenticationTypeBasic), + string(SybaseAuthenticationTypeWindows), + } +} + +func (s *SybaseAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSybaseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSybaseAuthenticationType(input string) (*SybaseAuthenticationType, error) { + vals := map[string]SybaseAuthenticationType{ + "basic": SybaseAuthenticationTypeBasic, + "windows": SybaseAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SybaseAuthenticationType(input) + return &out, nil +} + +type TeamDeskAuthenticationType string + +const ( + TeamDeskAuthenticationTypeBasic TeamDeskAuthenticationType = "Basic" + TeamDeskAuthenticationTypeToken TeamDeskAuthenticationType = "Token" +) + +func PossibleValuesForTeamDeskAuthenticationType() []string { + return []string{ + string(TeamDeskAuthenticationTypeBasic), + string(TeamDeskAuthenticationTypeToken), + } +} + +func (s *TeamDeskAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTeamDeskAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTeamDeskAuthenticationType(input string) (*TeamDeskAuthenticationType, error) { + vals := map[string]TeamDeskAuthenticationType{ + "basic": TeamDeskAuthenticationTypeBasic, + "token": TeamDeskAuthenticationTypeToken, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TeamDeskAuthenticationType(input) + return &out, nil +} + +type TeradataAuthenticationType string + +const ( + TeradataAuthenticationTypeBasic TeradataAuthenticationType = "Basic" + TeradataAuthenticationTypeWindows TeradataAuthenticationType = "Windows" +) + +func PossibleValuesForTeradataAuthenticationType() []string { + return []string{ + string(TeradataAuthenticationTypeBasic), + string(TeradataAuthenticationTypeWindows), + } +} + +func (s *TeradataAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTeradataAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTeradataAuthenticationType(input string) (*TeradataAuthenticationType, error) { + vals := map[string]TeradataAuthenticationType{ + "basic": TeradataAuthenticationTypeBasic, + "windows": TeradataAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TeradataAuthenticationType(input) + return &out, nil +} + +type WebAuthenticationType string + +const ( + WebAuthenticationTypeAnonymous WebAuthenticationType = "Anonymous" + WebAuthenticationTypeBasic WebAuthenticationType = "Basic" + WebAuthenticationTypeClientCertificate WebAuthenticationType = "ClientCertificate" +) + +func PossibleValuesForWebAuthenticationType() []string { + return []string{ + string(WebAuthenticationTypeAnonymous), + string(WebAuthenticationTypeBasic), + string(WebAuthenticationTypeClientCertificate), + } +} + +func (s *WebAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebAuthenticationType(input string) (*WebAuthenticationType, error) { + vals := map[string]WebAuthenticationType{ + "anonymous": WebAuthenticationTypeAnonymous, + "basic": WebAuthenticationTypeBasic, + "clientcertificate": WebAuthenticationTypeClientCertificate, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebAuthenticationType(input) + return &out, nil +} + +type ZendeskAuthenticationType string + +const ( + ZendeskAuthenticationTypeBasic ZendeskAuthenticationType = "Basic" + ZendeskAuthenticationTypeToken ZendeskAuthenticationType = "Token" +) + +func PossibleValuesForZendeskAuthenticationType() []string { + return []string{ + string(ZendeskAuthenticationTypeBasic), + string(ZendeskAuthenticationTypeToken), + } +} + +func (s *ZendeskAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseZendeskAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseZendeskAuthenticationType(input string) (*ZendeskAuthenticationType, error) { + vals := map[string]ZendeskAuthenticationType{ + "basic": ZendeskAuthenticationTypeBasic, + "token": ZendeskAuthenticationTypeToken, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ZendeskAuthenticationType(input) return &out, nil } diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwslinkedservice.go new file mode 100644 index 00000000000..1ad8efc8870 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AmazonMWSLinkedService{} + +type AmazonMWSLinkedService struct { + TypeProperties AmazonMWSLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AmazonMWSLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AmazonMWSLinkedService{} + +func (s AmazonMWSLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AmazonMWSLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonMWSLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonMWSLinkedService: %+v", err) + } + + decoded["type"] = "AmazonMWS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonMWSLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonMWSLinkedService{} + +func (s *AmazonMWSLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AmazonMWSLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonMWSLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AmazonMWSLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwslinkedservicetypeproperties.go new file mode 100644 index 00000000000..d853ff8c36e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwslinkedservicetypeproperties.go @@ -0,0 +1,72 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonMWSLinkedServiceTypeProperties struct { + AccessKeyId string `json:"accessKeyId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + MarketplaceID string `json:"marketplaceID"` + MwsAuthToken SecretBase `json:"mwsAuthToken"` + SecretKey SecretBase `json:"secretKey"` + SellerID string `json:"sellerID"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &AmazonMWSLinkedServiceTypeProperties{} + +func (s *AmazonMWSLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccessKeyId string `json:"accessKeyId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + MarketplaceID string `json:"marketplaceID"` + SellerID string `json:"sellerID"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccessKeyId = decoded.AccessKeyId + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.MarketplaceID = decoded.MarketplaceID + s.SellerID = decoded.SellerID + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonMWSLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["mwsAuthToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'MwsAuthToken' for 'AmazonMWSLinkedServiceTypeProperties': %+v", err) + } + s.MwsAuthToken = impl + } + + if v, ok := temp["secretKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SecretKey' for 'AmazonMWSLinkedServiceTypeProperties': %+v", err) + } + s.SecretKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwsobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwsobjectdataset.go new file mode 100644 index 00000000000..431b317adb4 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonmwsobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AmazonMWSObjectDataset{} + +type AmazonMWSObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AmazonMWSObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AmazonMWSObjectDataset{} + +func (s AmazonMWSObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper AmazonMWSObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonMWSObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonMWSObjectDataset: %+v", err) + } + + decoded["type"] = "AmazonMWSObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonMWSObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonMWSObjectDataset{} + +func (s *AmazonMWSObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonMWSObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AmazonMWSObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforlinkedservicetypeproperties.go new file mode 100644 index 00000000000..8ac1a552a90 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforlinkedservicetypeproperties.go @@ -0,0 +1,45 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonRdsForLinkedServiceTypeProperties struct { + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` +} + +var _ json.Unmarshaler = &AmazonRdsForLinkedServiceTypeProperties{} + +func (s *AmazonRdsForLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ConnectionString = decoded.ConnectionString + s.EncryptedCredential = decoded.EncryptedCredential + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRdsForLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'AmazonRdsForLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororaclelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororaclelinkedservice.go new file mode 100644 index 00000000000..989ed25697b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororaclelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AmazonRdsForOracleLinkedService{} + +type AmazonRdsForOracleLinkedService struct { + TypeProperties AmazonRdsForLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AmazonRdsForOracleLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AmazonRdsForOracleLinkedService{} + +func (s AmazonRdsForOracleLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AmazonRdsForOracleLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonRdsForOracleLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonRdsForOracleLinkedService: %+v", err) + } + + decoded["type"] = "AmazonRdsForOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonRdsForOracleLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonRdsForOracleLinkedService{} + +func (s *AmazonRdsForOracleLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AmazonRdsForLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRdsForOracleLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AmazonRdsForOracleLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororacletabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororacletabledataset.go new file mode 100644 index 00000000000..b287195efa9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororacletabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AmazonRdsForOracleTableDataset{} + +type AmazonRdsForOracleTableDataset struct { + TypeProperties *AmazonRdsForOracleTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AmazonRdsForOracleTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AmazonRdsForOracleTableDataset{} + +func (s AmazonRdsForOracleTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AmazonRdsForOracleTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonRdsForOracleTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonRdsForOracleTableDataset: %+v", err) + } + + decoded["type"] = "AmazonRdsForOracleTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonRdsForOracleTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonRdsForOracleTableDataset{} + +func (s *AmazonRdsForOracleTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AmazonRdsForOracleTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRdsForOracleTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AmazonRdsForOracleTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororacletabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororacletabledatasettypeproperties.go new file mode 100644 index 00000000000..b18c2a95cf5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsfororacletabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonRdsForOracleTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlserverlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlserverlinkedservice.go new file mode 100644 index 00000000000..b4ac4562398 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlserverlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AmazonRdsForSqlServerLinkedService{} + +type AmazonRdsForSqlServerLinkedService struct { + TypeProperties AmazonRdsForSqlServerLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AmazonRdsForSqlServerLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AmazonRdsForSqlServerLinkedService{} + +func (s AmazonRdsForSqlServerLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AmazonRdsForSqlServerLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonRdsForSqlServerLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonRdsForSqlServerLinkedService: %+v", err) + } + + decoded["type"] = "AmazonRdsForSqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonRdsForSqlServerLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonRdsForSqlServerLinkedService{} + +func (s *AmazonRdsForSqlServerLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AmazonRdsForSqlServerLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRdsForSqlServerLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AmazonRdsForSqlServerLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlserverlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlserverlinkedservicetypeproperties.go new file mode 100644 index 00000000000..0deab33d812 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlserverlinkedservicetypeproperties.go @@ -0,0 +1,111 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonRdsForSqlServerLinkedServiceTypeProperties struct { + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *AmazonRdsForSqlAuthenticationType `json:"authenticationType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Password SecretBase `json:"password"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &AmazonRdsForSqlServerLinkedServiceTypeProperties{} + +func (s *AmazonRdsForSqlServerLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *AmazonRdsForSqlAuthenticationType `json:"authenticationType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AlwaysEncryptedSettings = decoded.AlwaysEncryptedSettings + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout + s.ConnectionString = decoded.ConnectionString + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt + s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.TrustServerCertificate = decoded.TrustServerCertificate + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRdsForSqlServerLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'AmazonRdsForSqlServerLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlservertabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlservertabledataset.go new file mode 100644 index 00000000000..2e3c7f67ee2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlservertabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AmazonRdsForSqlServerTableDataset{} + +type AmazonRdsForSqlServerTableDataset struct { + TypeProperties *AmazonRdsForSqlServerTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AmazonRdsForSqlServerTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AmazonRdsForSqlServerTableDataset{} + +func (s AmazonRdsForSqlServerTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AmazonRdsForSqlServerTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonRdsForSqlServerTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonRdsForSqlServerTableDataset: %+v", err) + } + + decoded["type"] = "AmazonRdsForSqlServerTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonRdsForSqlServerTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonRdsForSqlServerTableDataset{} + +func (s *AmazonRdsForSqlServerTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AmazonRdsForSqlServerTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRdsForSqlServerTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AmazonRdsForSqlServerTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlservertabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlservertabledatasettypeproperties.go new file mode 100644 index 00000000000..0ff2e072c65 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforsqlservertabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonRdsForSqlServerTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshiftlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshiftlinkedservice.go new file mode 100644 index 00000000000..1837d9be32f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshiftlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AmazonRedshiftLinkedService{} + +type AmazonRedshiftLinkedService struct { + TypeProperties AmazonRedshiftLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AmazonRedshiftLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AmazonRedshiftLinkedService{} + +func (s AmazonRedshiftLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AmazonRedshiftLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonRedshiftLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonRedshiftLinkedService: %+v", err) + } + + decoded["type"] = "AmazonRedshift" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonRedshiftLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonRedshiftLinkedService{} + +func (s *AmazonRedshiftLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AmazonRedshiftLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRedshiftLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AmazonRedshiftLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshiftlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshiftlinkedservicetypeproperties.go new file mode 100644 index 00000000000..8ef541dba7b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshiftlinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonRedshiftLinkedServiceTypeProperties struct { + Database string `json:"database"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + Server string `json:"server"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &AmazonRedshiftLinkedServiceTypeProperties{} + +func (s *AmazonRedshiftLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Database string `json:"database"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Port *int64 `json:"port,omitempty"` + Server string `json:"server"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Database = decoded.Database + s.EncryptedCredential = decoded.EncryptedCredential + s.Port = decoded.Port + s.Server = decoded.Server + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRedshiftLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'AmazonRedshiftLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshifttabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshifttabledataset.go new file mode 100644 index 00000000000..2719e522f99 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshifttabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AmazonRedshiftTableDataset{} + +type AmazonRedshiftTableDataset struct { + TypeProperties *AmazonRedshiftTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AmazonRedshiftTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AmazonRedshiftTableDataset{} + +func (s AmazonRedshiftTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AmazonRedshiftTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonRedshiftTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonRedshiftTableDataset: %+v", err) + } + + decoded["type"] = "AmazonRedshiftTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonRedshiftTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonRedshiftTableDataset{} + +func (s *AmazonRedshiftTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AmazonRedshiftTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonRedshiftTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AmazonRedshiftTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshifttabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshifttabledatasettypeproperties.go new file mode 100644 index 00000000000..6993a5ab4ca --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonredshifttabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonRedshiftTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelinkedservice.go new file mode 100644 index 00000000000..dbdc604fdca --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AmazonS3CompatibleLinkedService{} + +type AmazonS3CompatibleLinkedService struct { + TypeProperties AmazonS3CompatibleLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AmazonS3CompatibleLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AmazonS3CompatibleLinkedService{} + +func (s AmazonS3CompatibleLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AmazonS3CompatibleLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonS3CompatibleLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonS3CompatibleLinkedService: %+v", err) + } + + decoded["type"] = "AmazonS3Compatible" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonS3CompatibleLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonS3CompatibleLinkedService{} + +func (s *AmazonS3CompatibleLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AmazonS3CompatibleLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonS3CompatibleLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AmazonS3CompatibleLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelinkedservicetypeproperties.go new file mode 100644 index 00000000000..fdd4822937a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelinkedservicetypeproperties.go @@ -0,0 +1,51 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonS3CompatibleLinkedServiceTypeProperties struct { + AccessKeyId *string `json:"accessKeyId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ForcePathStyle *bool `json:"forcePathStyle,omitempty"` + SecretAccessKey SecretBase `json:"secretAccessKey"` + ServiceURL *string `json:"serviceUrl,omitempty"` +} + +var _ json.Unmarshaler = &AmazonS3CompatibleLinkedServiceTypeProperties{} + +func (s *AmazonS3CompatibleLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccessKeyId *string `json:"accessKeyId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ForcePathStyle *bool `json:"forcePathStyle,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccessKeyId = decoded.AccessKeyId + s.EncryptedCredential = decoded.EncryptedCredential + s.ForcePathStyle = decoded.ForcePathStyle + s.ServiceURL = decoded.ServiceURL + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonS3CompatibleLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["secretAccessKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SecretAccessKey' for 'AmazonS3CompatibleLinkedServiceTypeProperties': %+v", err) + } + s.SecretAccessKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelocation.go new file mode 100644 index 00000000000..8ccc8ae9885 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3compatiblelocation.go @@ -0,0 +1,55 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = AmazonS3CompatibleLocation{} + +type AmazonS3CompatibleLocation struct { + BucketName *string `json:"bucketName,omitempty"` + Version *string `json:"version,omitempty"` + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s AmazonS3CompatibleLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = AmazonS3CompatibleLocation{} + +func (s AmazonS3CompatibleLocation) MarshalJSON() ([]byte, error) { + type wrapper AmazonS3CompatibleLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonS3CompatibleLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonS3CompatibleLocation: %+v", err) + } + + decoded["type"] = "AmazonS3CompatibleLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonS3CompatibleLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3dataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3dataset.go new file mode 100644 index 00000000000..3ce6aac0ade --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3dataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AmazonS3Dataset{} + +type AmazonS3Dataset struct { + TypeProperties AmazonS3DatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AmazonS3Dataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AmazonS3Dataset{} + +func (s AmazonS3Dataset) MarshalJSON() ([]byte, error) { + type wrapper AmazonS3Dataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonS3Dataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonS3Dataset: %+v", err) + } + + decoded["type"] = "AmazonS3Object" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonS3Dataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonS3Dataset{} + +func (s *AmazonS3Dataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AmazonS3DatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonS3Dataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AmazonS3Dataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3datasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3datasettypeproperties.go new file mode 100644 index 00000000000..24ccbe7dc20 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3datasettypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonS3DatasetTypeProperties struct { + BucketName string `json:"bucketName"` + Compression *DatasetCompression `json:"compression,omitempty"` + Format DatasetStorageFormat `json:"format"` + Key *string `json:"key,omitempty"` + ModifiedDatetimeEnd *string `json:"modifiedDatetimeEnd,omitempty"` + ModifiedDatetimeStart *string `json:"modifiedDatetimeStart,omitempty"` + Prefix *string `json:"prefix,omitempty"` + Version *string `json:"version,omitempty"` +} + +var _ json.Unmarshaler = &AmazonS3DatasetTypeProperties{} + +func (s *AmazonS3DatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BucketName string `json:"bucketName"` + Compression *DatasetCompression `json:"compression,omitempty"` + Key *string `json:"key,omitempty"` + ModifiedDatetimeEnd *string `json:"modifiedDatetimeEnd,omitempty"` + ModifiedDatetimeStart *string `json:"modifiedDatetimeStart,omitempty"` + Prefix *string `json:"prefix,omitempty"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BucketName = decoded.BucketName + s.Compression = decoded.Compression + s.Key = decoded.Key + s.ModifiedDatetimeEnd = decoded.ModifiedDatetimeEnd + s.ModifiedDatetimeStart = decoded.ModifiedDatetimeStart + s.Prefix = decoded.Prefix + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonS3DatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["format"]; ok { + impl, err := UnmarshalDatasetStorageFormatImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Format' for 'AmazonS3DatasetTypeProperties': %+v", err) + } + s.Format = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3linkedservice.go new file mode 100644 index 00000000000..274fc7f3351 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AmazonS3LinkedService{} + +type AmazonS3LinkedService struct { + TypeProperties AmazonS3LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AmazonS3LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AmazonS3LinkedService{} + +func (s AmazonS3LinkedService) MarshalJSON() ([]byte, error) { + type wrapper AmazonS3LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonS3LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonS3LinkedService: %+v", err) + } + + decoded["type"] = "AmazonS3" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonS3LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AmazonS3LinkedService{} + +func (s *AmazonS3LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AmazonS3LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonS3LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AmazonS3LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3linkedservicetypeproperties.go new file mode 100644 index 00000000000..c82416a9557 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3linkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmazonS3LinkedServiceTypeProperties struct { + AccessKeyId *string `json:"accessKeyId,omitempty"` + AuthenticationType *string `json:"authenticationType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SecretAccessKey SecretBase `json:"secretAccessKey"` + ServiceURL *string `json:"serviceUrl,omitempty"` + SessionToken SecretBase `json:"sessionToken"` +} + +var _ json.Unmarshaler = &AmazonS3LinkedServiceTypeProperties{} + +func (s *AmazonS3LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccessKeyId *string `json:"accessKeyId,omitempty"` + AuthenticationType *string `json:"authenticationType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccessKeyId = decoded.AccessKeyId + s.AuthenticationType = decoded.AuthenticationType + s.EncryptedCredential = decoded.EncryptedCredential + s.ServiceURL = decoded.ServiceURL + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AmazonS3LinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["secretAccessKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SecretAccessKey' for 'AmazonS3LinkedServiceTypeProperties': %+v", err) + } + s.SecretAccessKey = impl + } + + if v, ok := temp["sessionToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SessionToken' for 'AmazonS3LinkedServiceTypeProperties': %+v", err) + } + s.SessionToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3location.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3location.go new file mode 100644 index 00000000000..8ee8e7687a8 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazons3location.go @@ -0,0 +1,55 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = AmazonS3Location{} + +type AmazonS3Location struct { + BucketName *string `json:"bucketName,omitempty"` + Version *string `json:"version,omitempty"` + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s AmazonS3Location) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = AmazonS3Location{} + +func (s AmazonS3Location) MarshalJSON() ([]byte, error) { + type wrapper AmazonS3Location + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmazonS3Location: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmazonS3Location: %+v", err) + } + + decoded["type"] = "AmazonS3Location" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmazonS3Location: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_appfigureslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_appfigureslinkedservice.go new file mode 100644 index 00000000000..fa6cab94c89 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_appfigureslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AppFiguresLinkedService{} + +type AppFiguresLinkedService struct { + TypeProperties AppFiguresLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AppFiguresLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AppFiguresLinkedService{} + +func (s AppFiguresLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AppFiguresLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AppFiguresLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AppFiguresLinkedService: %+v", err) + } + + decoded["type"] = "AppFigures" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AppFiguresLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AppFiguresLinkedService{} + +func (s *AppFiguresLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AppFiguresLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AppFiguresLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AppFiguresLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_appfigureslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_appfigureslinkedservicetypeproperties.go new file mode 100644 index 00000000000..d1918415a95 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_appfigureslinkedservicetypeproperties.go @@ -0,0 +1,51 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AppFiguresLinkedServiceTypeProperties struct { + ClientKey SecretBase `json:"clientKey"` + Password SecretBase `json:"password"` + UserName string `json:"userName"` +} + +var _ json.Unmarshaler = &AppFiguresLinkedServiceTypeProperties{} + +func (s *AppFiguresLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + UserName string `json:"userName"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AppFiguresLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientKey' for 'AppFiguresLinkedServiceTypeProperties': %+v", err) + } + s.ClientKey = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'AppFiguresLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_asanalinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_asanalinkedservice.go new file mode 100644 index 00000000000..27a4eff2f5d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_asanalinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AsanaLinkedService{} + +type AsanaLinkedService struct { + TypeProperties AsanaLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AsanaLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AsanaLinkedService{} + +func (s AsanaLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AsanaLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AsanaLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AsanaLinkedService: %+v", err) + } + + decoded["type"] = "Asana" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AsanaLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AsanaLinkedService{} + +func (s *AsanaLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AsanaLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AsanaLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AsanaLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_asanalinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_asanalinkedservicetypeproperties.go new file mode 100644 index 00000000000..cbc204c81ab --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_asanalinkedservicetypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AsanaLinkedServiceTypeProperties struct { + ApiToken SecretBase `json:"apiToken"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` +} + +var _ json.Unmarshaler = &AsanaLinkedServiceTypeProperties{} + +func (s *AsanaLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AsanaLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["apiToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ApiToken' for 'AsanaLinkedServiceTypeProperties': %+v", err) + } + s.ApiToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avrodataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avrodataset.go new file mode 100644 index 00000000000..b7dedda6860 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avrodataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AvroDataset{} + +type AvroDataset struct { + TypeProperties *AvroDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AvroDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AvroDataset{} + +func (s AvroDataset) MarshalJSON() ([]byte, error) { + type wrapper AvroDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AvroDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AvroDataset: %+v", err) + } + + decoded["type"] = "Avro" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AvroDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AvroDataset{} + +func (s *AvroDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AvroDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AvroDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AvroDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avrodatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avrodatasettypeproperties.go new file mode 100644 index 00000000000..85813dbceeb --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avrodatasettypeproperties.go @@ -0,0 +1,45 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvroDatasetTypeProperties struct { + AvroCompressionCodec *string `json:"avroCompressionCodec,omitempty"` + AvroCompressionLevel *int64 `json:"avroCompressionLevel,omitempty"` + Location DatasetLocation `json:"location"` +} + +var _ json.Unmarshaler = &AvroDatasetTypeProperties{} + +func (s *AvroDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AvroCompressionCodec *string `json:"avroCompressionCodec,omitempty"` + AvroCompressionLevel *int64 `json:"avroCompressionLevel,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AvroCompressionCodec = decoded.AvroCompressionCodec + s.AvroCompressionLevel = decoded.AvroCompressionLevel + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AvroDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'AvroDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avroformat.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avroformat.go new file mode 100644 index 00000000000..78d66c1fe42 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_avroformat.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetStorageFormat = AvroFormat{} + +type AvroFormat struct { + + // Fields inherited from DatasetStorageFormat + + Deserializer *string `json:"deserializer,omitempty"` + Serializer *string `json:"serializer,omitempty"` + Type string `json:"type"` +} + +func (s AvroFormat) DatasetStorageFormat() BaseDatasetStorageFormatImpl { + return BaseDatasetStorageFormatImpl{ + Deserializer: s.Deserializer, + Serializer: s.Serializer, + Type: s.Type, + } +} + +var _ json.Marshaler = AvroFormat{} + +func (s AvroFormat) MarshalJSON() ([]byte, error) { + type wrapper AvroFormat + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AvroFormat: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AvroFormat: %+v", err) + } + + decoded["type"] = "AvroFormat" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AvroFormat: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azpowershellsetup.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azpowershellsetup.go new file mode 100644 index 00000000000..1c567a0262e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azpowershellsetup.go @@ -0,0 +1,50 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CustomSetupBase = AzPowerShellSetup{} + +type AzPowerShellSetup struct { + TypeProperties AzPowerShellSetupTypeProperties `json:"typeProperties"` + + // Fields inherited from CustomSetupBase + + Type string `json:"type"` +} + +func (s AzPowerShellSetup) CustomSetupBase() BaseCustomSetupBaseImpl { + return BaseCustomSetupBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = AzPowerShellSetup{} + +func (s AzPowerShellSetup) MarshalJSON() ([]byte, error) { + type wrapper AzPowerShellSetup + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzPowerShellSetup: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzPowerShellSetup: %+v", err) + } + + decoded["type"] = "AzPowerShellSetup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzPowerShellSetup: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azpowershellsetuptypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azpowershellsetuptypeproperties.go new file mode 100644 index 00000000000..0b87b647788 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azpowershellsetuptypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzPowerShellSetupTypeProperties struct { + Version string `json:"version"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurebatchlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurebatchlinkedservice.go new file mode 100644 index 00000000000..420525de911 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurebatchlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureBatchLinkedService{} + +type AzureBatchLinkedService struct { + TypeProperties AzureBatchLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureBatchLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureBatchLinkedService{} + +func (s AzureBatchLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureBatchLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureBatchLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureBatchLinkedService: %+v", err) + } + + decoded["type"] = "AzureBatch" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureBatchLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureBatchLinkedService{} + +func (s *AzureBatchLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureBatchLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBatchLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureBatchLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurebatchlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurebatchlinkedservicetypeproperties.go new file mode 100644 index 00000000000..275dc9569ea --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurebatchlinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureBatchLinkedServiceTypeProperties struct { + AccessKey SecretBase `json:"accessKey"` + AccountName string `json:"accountName"` + BatchUri string `json:"batchUri"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + LinkedServiceName LinkedServiceReference `json:"linkedServiceName"` + PoolName string `json:"poolName"` +} + +var _ json.Unmarshaler = &AzureBatchLinkedServiceTypeProperties{} + +func (s *AzureBatchLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccountName string `json:"accountName"` + BatchUri string `json:"batchUri"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + LinkedServiceName LinkedServiceReference `json:"linkedServiceName"` + PoolName string `json:"poolName"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccountName = decoded.AccountName + s.BatchUri = decoded.BatchUri + s.Credential = decoded.Credential + s.EncryptedCredential = decoded.EncryptedCredential + s.LinkedServiceName = decoded.LinkedServiceName + s.PoolName = decoded.PoolName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBatchLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accessKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessKey' for 'AzureBatchLinkedServiceTypeProperties': %+v", err) + } + s.AccessKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobdataset.go new file mode 100644 index 00000000000..19a6fffba90 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureBlobDataset{} + +type AzureBlobDataset struct { + TypeProperties *AzureBlobDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureBlobDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureBlobDataset{} + +func (s AzureBlobDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureBlobDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureBlobDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureBlobDataset: %+v", err) + } + + decoded["type"] = "AzureBlob" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureBlobDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureBlobDataset{} + +func (s *AzureBlobDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AzureBlobDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBlobDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureBlobDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobdatasettypeproperties.go new file mode 100644 index 00000000000..11da24e83bc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobdatasettypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureBlobDatasetTypeProperties struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Format DatasetStorageFormat `json:"format"` + ModifiedDatetimeEnd *string `json:"modifiedDatetimeEnd,omitempty"` + ModifiedDatetimeStart *string `json:"modifiedDatetimeStart,omitempty"` + TableRootLocation *string `json:"tableRootLocation,omitempty"` +} + +var _ json.Unmarshaler = &AzureBlobDatasetTypeProperties{} + +func (s *AzureBlobDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + ModifiedDatetimeEnd *string `json:"modifiedDatetimeEnd,omitempty"` + ModifiedDatetimeStart *string `json:"modifiedDatetimeStart,omitempty"` + TableRootLocation *string `json:"tableRootLocation,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Compression = decoded.Compression + s.FileName = decoded.FileName + s.FolderPath = decoded.FolderPath + s.ModifiedDatetimeEnd = decoded.ModifiedDatetimeEnd + s.ModifiedDatetimeStart = decoded.ModifiedDatetimeStart + s.TableRootLocation = decoded.TableRootLocation + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBlobDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["format"]; ok { + impl, err := UnmarshalDatasetStorageFormatImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Format' for 'AzureBlobDatasetTypeProperties': %+v", err) + } + s.Format = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfsdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfsdataset.go new file mode 100644 index 00000000000..c7aba538d42 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfsdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureBlobFSDataset{} + +type AzureBlobFSDataset struct { + TypeProperties *AzureBlobFSDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureBlobFSDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureBlobFSDataset{} + +func (s AzureBlobFSDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureBlobFSDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureBlobFSDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureBlobFSDataset: %+v", err) + } + + decoded["type"] = "AzureBlobFSFile" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureBlobFSDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureBlobFSDataset{} + +func (s *AzureBlobFSDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AzureBlobFSDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBlobFSDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureBlobFSDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfsdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfsdatasettypeproperties.go new file mode 100644 index 00000000000..04fc1577080 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfsdatasettypeproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureBlobFSDatasetTypeProperties struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Format DatasetStorageFormat `json:"format"` +} + +var _ json.Unmarshaler = &AzureBlobFSDatasetTypeProperties{} + +func (s *AzureBlobFSDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Compression = decoded.Compression + s.FileName = decoded.FileName + s.FolderPath = decoded.FolderPath + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBlobFSDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["format"]; ok { + impl, err := UnmarshalDatasetStorageFormatImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Format' for 'AzureBlobFSDatasetTypeProperties': %+v", err) + } + s.Format = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslinkedservice.go new file mode 100644 index 00000000000..f7570677bdd --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureBlobFSLinkedService{} + +type AzureBlobFSLinkedService struct { + TypeProperties AzureBlobFSLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureBlobFSLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureBlobFSLinkedService{} + +func (s AzureBlobFSLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureBlobFSLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureBlobFSLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureBlobFSLinkedService: %+v", err) + } + + decoded["type"] = "AzureBlobFS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureBlobFSLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureBlobFSLinkedService{} + +func (s *AzureBlobFSLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureBlobFSLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBlobFSLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureBlobFSLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslinkedservicetypeproperties.go new file mode 100644 index 00000000000..537a2c8b31e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslinkedservicetypeproperties.go @@ -0,0 +1,84 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureBlobFSLinkedServiceTypeProperties struct { + AccountKey *string `json:"accountKey,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SasToken SecretBase `json:"sasToken"` + SasUri *string `json:"sasUri,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + Url *string `json:"url,omitempty"` +} + +var _ json.Unmarshaler = &AzureBlobFSLinkedServiceTypeProperties{} + +func (s *AzureBlobFSLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccountKey *string `json:"accountKey,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SasUri *string `json:"sasUri,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + Url *string `json:"url,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccountKey = decoded.AccountKey + s.AzureCloudType = decoded.AzureCloudType + s.Credential = decoded.Credential + s.EncryptedCredential = decoded.EncryptedCredential + s.SasUri = decoded.SasUri + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.Url = decoded.Url + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBlobFSLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sasToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SasToken' for 'AzureBlobFSLinkedServiceTypeProperties': %+v", err) + } + s.SasToken = impl + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'AzureBlobFSLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureBlobFSLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslocation.go new file mode 100644 index 00000000000..5bae00b4141 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobfslocation.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = AzureBlobFSLocation{} + +type AzureBlobFSLocation struct { + FileSystem *string `json:"fileSystem,omitempty"` + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s AzureBlobFSLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureBlobFSLocation{} + +func (s AzureBlobFSLocation) MarshalJSON() ([]byte, error) { + type wrapper AzureBlobFSLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureBlobFSLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureBlobFSLocation: %+v", err) + } + + decoded["type"] = "AzureBlobFSLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureBlobFSLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelinkedservice.go new file mode 100644 index 00000000000..3e29a436206 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureBlobStorageLinkedService{} + +type AzureBlobStorageLinkedService struct { + TypeProperties AzureBlobStorageLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureBlobStorageLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureBlobStorageLinkedService{} + +func (s AzureBlobStorageLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureBlobStorageLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureBlobStorageLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureBlobStorageLinkedService: %+v", err) + } + + decoded["type"] = "AzureBlobStorage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureBlobStorageLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureBlobStorageLinkedService{} + +func (s *AzureBlobStorageLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureBlobStorageLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBlobStorageLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureBlobStorageLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelinkedservicetypeproperties.go new file mode 100644 index 00000000000..b75cf503366 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelinkedservicetypeproperties.go @@ -0,0 +1,78 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureBlobStorageLinkedServiceTypeProperties struct { + AccountKey *AzureKeyVaultSecretReference `json:"accountKey,omitempty"` + AccountKind *string `json:"accountKind,omitempty"` + AuthenticationType *AzureStorageAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + ContainerUri *string `json:"containerUri,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SasToken *AzureKeyVaultSecretReference `json:"sasToken,omitempty"` + SasUri *string `json:"sasUri,omitempty"` + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` +} + +var _ json.Unmarshaler = &AzureBlobStorageLinkedServiceTypeProperties{} + +func (s *AzureBlobStorageLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccountKey *AzureKeyVaultSecretReference `json:"accountKey,omitempty"` + AccountKind *string `json:"accountKind,omitempty"` + AuthenticationType *AzureStorageAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + ContainerUri *string `json:"containerUri,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SasToken *AzureKeyVaultSecretReference `json:"sasToken,omitempty"` + SasUri *string `json:"sasUri,omitempty"` + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccountKey = decoded.AccountKey + s.AccountKind = decoded.AccountKind + s.AuthenticationType = decoded.AuthenticationType + s.AzureCloudType = decoded.AzureCloudType + s.ConnectionString = decoded.ConnectionString + s.ContainerUri = decoded.ContainerUri + s.Credential = decoded.Credential + s.EncryptedCredential = decoded.EncryptedCredential + s.SasToken = decoded.SasToken + s.SasUri = decoded.SasUri + s.ServiceEndpoint = decoded.ServiceEndpoint + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureBlobStorageLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureBlobStorageLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelocation.go new file mode 100644 index 00000000000..1f1ec9dd85a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azureblobstoragelocation.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = AzureBlobStorageLocation{} + +type AzureBlobStorageLocation struct { + Container *string `json:"container,omitempty"` + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s AzureBlobStorageLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureBlobStorageLocation{} + +func (s AzureBlobStorageLocation) MarshalJSON() ([]byte, error) { + type wrapper AzureBlobStorageLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureBlobStorageLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureBlobStorageLocation: %+v", err) + } + + decoded["type"] = "AzureBlobStorageLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureBlobStorageLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakedataset.go new file mode 100644 index 00000000000..e6699fc2eae --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureDatabricksDeltaLakeDataset{} + +type AzureDatabricksDeltaLakeDataset struct { + TypeProperties *AzureDatabricksDeltaLakeDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureDatabricksDeltaLakeDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureDatabricksDeltaLakeDataset{} + +func (s AzureDatabricksDeltaLakeDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureDatabricksDeltaLakeDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDatabricksDeltaLakeDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDatabricksDeltaLakeDataset: %+v", err) + } + + decoded["type"] = "AzureDatabricksDeltaLakeDataset" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDatabricksDeltaLakeDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureDatabricksDeltaLakeDataset{} + +func (s *AzureDatabricksDeltaLakeDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AzureDatabricksDeltaLakeDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDatabricksDeltaLakeDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureDatabricksDeltaLakeDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakedatasettypeproperties.go new file mode 100644 index 00000000000..8b41b1b5b20 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakedatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDatabricksDeltaLakeDatasetTypeProperties struct { + Database *string `json:"database,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakelinkedservice.go new file mode 100644 index 00000000000..18672229a8d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdeltalakelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureDatabricksDeltaLakeLinkedService{} + +type AzureDatabricksDeltaLakeLinkedService struct { + TypeProperties AzureDatabricksDetltaLakeLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureDatabricksDeltaLakeLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureDatabricksDeltaLakeLinkedService{} + +func (s AzureDatabricksDeltaLakeLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureDatabricksDeltaLakeLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDatabricksDeltaLakeLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDatabricksDeltaLakeLinkedService: %+v", err) + } + + decoded["type"] = "AzureDatabricksDeltaLake" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDatabricksDeltaLakeLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureDatabricksDeltaLakeLinkedService{} + +func (s *AzureDatabricksDeltaLakeLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureDatabricksDetltaLakeLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDatabricksDeltaLakeLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureDatabricksDeltaLakeLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdetltalakelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdetltalakelinkedservicetypeproperties.go new file mode 100644 index 00000000000..89210f2c0b1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabricksdetltalakelinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDatabricksDetltaLakeLinkedServiceTypeProperties struct { + AccessToken SecretBase `json:"accessToken"` + ClusterId *string `json:"clusterId,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Domain string `json:"domain"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` +} + +var _ json.Unmarshaler = &AzureDatabricksDetltaLakeLinkedServiceTypeProperties{} + +func (s *AzureDatabricksDetltaLakeLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClusterId *string `json:"clusterId,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Domain string `json:"domain"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClusterId = decoded.ClusterId + s.Credential = decoded.Credential + s.Domain = decoded.Domain + s.EncryptedCredential = decoded.EncryptedCredential + s.WorkspaceResourceId = decoded.WorkspaceResourceId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDatabricksDetltaLakeLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accessToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessToken' for 'AzureDatabricksDetltaLakeLinkedServiceTypeProperties': %+v", err) + } + s.AccessToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservice.go new file mode 100644 index 00000000000..13ab7c76a67 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureDatabricksLinkedService{} + +type AzureDatabricksLinkedService struct { + TypeProperties AzureDatabricksLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureDatabricksLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureDatabricksLinkedService{} + +func (s AzureDatabricksLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureDatabricksLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDatabricksLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDatabricksLinkedService: %+v", err) + } + + decoded["type"] = "AzureDatabricks" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDatabricksLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureDatabricksLinkedService{} + +func (s *AzureDatabricksLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureDatabricksLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDatabricksLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureDatabricksLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservicetypeproperties.go new file mode 100644 index 00000000000..b308bba8e31 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservicetypeproperties.go @@ -0,0 +1,93 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDatabricksLinkedServiceTypeProperties struct { + AccessToken SecretBase `json:"accessToken"` + Authentication *string `json:"authentication,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Domain string `json:"domain"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ExistingClusterId *string `json:"existingClusterId,omitempty"` + InstancePoolId *string `json:"instancePoolId,omitempty"` + NewClusterCustomTags *map[string]string `json:"newClusterCustomTags,omitempty"` + NewClusterDriverNodeType *string `json:"newClusterDriverNodeType,omitempty"` + NewClusterEnableElasticDisk *bool `json:"newClusterEnableElasticDisk,omitempty"` + NewClusterInitScripts *[]string `json:"newClusterInitScripts,omitempty"` + NewClusterLogDestination *string `json:"newClusterLogDestination,omitempty"` + NewClusterNodeType *string `json:"newClusterNodeType,omitempty"` + NewClusterNumOfWorker *string `json:"newClusterNumOfWorker,omitempty"` + NewClusterSparkConf *map[string]string `json:"newClusterSparkConf,omitempty"` + NewClusterSparkEnvVars *map[string]string `json:"newClusterSparkEnvVars,omitempty"` + NewClusterVersion *string `json:"newClusterVersion,omitempty"` + PolicyId *string `json:"policyId,omitempty"` + WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` +} + +var _ json.Unmarshaler = &AzureDatabricksLinkedServiceTypeProperties{} + +func (s *AzureDatabricksLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Authentication *string `json:"authentication,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Domain string `json:"domain"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ExistingClusterId *string `json:"existingClusterId,omitempty"` + InstancePoolId *string `json:"instancePoolId,omitempty"` + NewClusterCustomTags *map[string]string `json:"newClusterCustomTags,omitempty"` + NewClusterDriverNodeType *string `json:"newClusterDriverNodeType,omitempty"` + NewClusterEnableElasticDisk *bool `json:"newClusterEnableElasticDisk,omitempty"` + NewClusterInitScripts *[]string `json:"newClusterInitScripts,omitempty"` + NewClusterLogDestination *string `json:"newClusterLogDestination,omitempty"` + NewClusterNodeType *string `json:"newClusterNodeType,omitempty"` + NewClusterNumOfWorker *string `json:"newClusterNumOfWorker,omitempty"` + NewClusterSparkConf *map[string]string `json:"newClusterSparkConf,omitempty"` + NewClusterSparkEnvVars *map[string]string `json:"newClusterSparkEnvVars,omitempty"` + NewClusterVersion *string `json:"newClusterVersion,omitempty"` + PolicyId *string `json:"policyId,omitempty"` + WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Authentication = decoded.Authentication + s.Credential = decoded.Credential + s.Domain = decoded.Domain + s.EncryptedCredential = decoded.EncryptedCredential + s.ExistingClusterId = decoded.ExistingClusterId + s.InstancePoolId = decoded.InstancePoolId + s.NewClusterCustomTags = decoded.NewClusterCustomTags + s.NewClusterDriverNodeType = decoded.NewClusterDriverNodeType + s.NewClusterEnableElasticDisk = decoded.NewClusterEnableElasticDisk + s.NewClusterInitScripts = decoded.NewClusterInitScripts + s.NewClusterLogDestination = decoded.NewClusterLogDestination + s.NewClusterNodeType = decoded.NewClusterNodeType + s.NewClusterNumOfWorker = decoded.NewClusterNumOfWorker + s.NewClusterSparkConf = decoded.NewClusterSparkConf + s.NewClusterSparkEnvVars = decoded.NewClusterSparkEnvVars + s.NewClusterVersion = decoded.NewClusterVersion + s.PolicyId = decoded.PolicyId + s.WorkspaceResourceId = decoded.WorkspaceResourceId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDatabricksLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accessToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessToken' for 'AzureDatabricksLinkedServiceTypeProperties': %+v", err) + } + s.AccessToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerdatasettypeproperties.go new file mode 100644 index 00000000000..6d69f6f0146 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerdatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDataExplorerDatasetTypeProperties struct { + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerlinkedservice.go new file mode 100644 index 00000000000..1cd119e03bc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureDataExplorerLinkedService{} + +type AzureDataExplorerLinkedService struct { + TypeProperties AzureDataExplorerLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureDataExplorerLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureDataExplorerLinkedService{} + +func (s AzureDataExplorerLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureDataExplorerLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDataExplorerLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDataExplorerLinkedService: %+v", err) + } + + decoded["type"] = "AzureDataExplorer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDataExplorerLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureDataExplorerLinkedService{} + +func (s *AzureDataExplorerLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureDataExplorerLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataExplorerLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureDataExplorerLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerlinkedservicetypeproperties.go new file mode 100644 index 00000000000..601a2016bd3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorerlinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDataExplorerLinkedServiceTypeProperties struct { + Credential *CredentialReference `json:"credential,omitempty"` + Database string `json:"database"` + Endpoint string `json:"endpoint"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` +} + +var _ json.Unmarshaler = &AzureDataExplorerLinkedServiceTypeProperties{} + +func (s *AzureDataExplorerLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Credential *CredentialReference `json:"credential,omitempty"` + Database string `json:"database"` + Endpoint string `json:"endpoint"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Credential = decoded.Credential + s.Database = decoded.Database + s.Endpoint = decoded.Endpoint + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataExplorerLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureDataExplorerLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorertabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorertabledataset.go new file mode 100644 index 00000000000..3dc48b5a1f3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredataexplorertabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureDataExplorerTableDataset{} + +type AzureDataExplorerTableDataset struct { + TypeProperties AzureDataExplorerDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureDataExplorerTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureDataExplorerTableDataset{} + +func (s AzureDataExplorerTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureDataExplorerTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDataExplorerTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDataExplorerTableDataset: %+v", err) + } + + decoded["type"] = "AzureDataExplorerTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDataExplorerTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureDataExplorerTableDataset{} + +func (s *AzureDataExplorerTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureDataExplorerDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataExplorerTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureDataExplorerTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakeanalyticslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakeanalyticslinkedservice.go new file mode 100644 index 00000000000..69dcc97502d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakeanalyticslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureDataLakeAnalyticsLinkedService{} + +type AzureDataLakeAnalyticsLinkedService struct { + TypeProperties AzureDataLakeAnalyticsLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureDataLakeAnalyticsLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureDataLakeAnalyticsLinkedService{} + +func (s AzureDataLakeAnalyticsLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureDataLakeAnalyticsLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDataLakeAnalyticsLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDataLakeAnalyticsLinkedService: %+v", err) + } + + decoded["type"] = "AzureDataLakeAnalytics" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDataLakeAnalyticsLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureDataLakeAnalyticsLinkedService{} + +func (s *AzureDataLakeAnalyticsLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureDataLakeAnalyticsLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataLakeAnalyticsLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureDataLakeAnalyticsLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakeanalyticslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakeanalyticslinkedservicetypeproperties.go new file mode 100644 index 00000000000..f655e5120ec --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakeanalyticslinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDataLakeAnalyticsLinkedServiceTypeProperties struct { + AccountName string `json:"accountName"` + DataLakeAnalyticsUri *string `json:"dataLakeAnalyticsUri,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + SubscriptionId *string `json:"subscriptionId,omitempty"` + Tenant string `json:"tenant"` +} + +var _ json.Unmarshaler = &AzureDataLakeAnalyticsLinkedServiceTypeProperties{} + +func (s *AzureDataLakeAnalyticsLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccountName string `json:"accountName"` + DataLakeAnalyticsUri *string `json:"dataLakeAnalyticsUri,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` + Tenant string `json:"tenant"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccountName = decoded.AccountName + s.DataLakeAnalyticsUri = decoded.DataLakeAnalyticsUri + s.EncryptedCredential = decoded.EncryptedCredential + s.ResourceGroupName = decoded.ResourceGroupName + s.ServicePrincipalId = decoded.ServicePrincipalId + s.SubscriptionId = decoded.SubscriptionId + s.Tenant = decoded.Tenant + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataLakeAnalyticsLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureDataLakeAnalyticsLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestoredataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestoredataset.go new file mode 100644 index 00000000000..7b0a2247dbb --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestoredataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureDataLakeStoreDataset{} + +type AzureDataLakeStoreDataset struct { + TypeProperties *AzureDataLakeStoreDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureDataLakeStoreDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureDataLakeStoreDataset{} + +func (s AzureDataLakeStoreDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureDataLakeStoreDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDataLakeStoreDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDataLakeStoreDataset: %+v", err) + } + + decoded["type"] = "AzureDataLakeStoreFile" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDataLakeStoreDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureDataLakeStoreDataset{} + +func (s *AzureDataLakeStoreDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AzureDataLakeStoreDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataLakeStoreDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureDataLakeStoreDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestoredatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestoredatasettypeproperties.go new file mode 100644 index 00000000000..d0d79372f1c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestoredatasettypeproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDataLakeStoreDatasetTypeProperties struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Format DatasetStorageFormat `json:"format"` +} + +var _ json.Unmarshaler = &AzureDataLakeStoreDatasetTypeProperties{} + +func (s *AzureDataLakeStoreDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Compression = decoded.Compression + s.FileName = decoded.FileName + s.FolderPath = decoded.FolderPath + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataLakeStoreDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["format"]; ok { + impl, err := UnmarshalDatasetStorageFormatImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Format' for 'AzureDataLakeStoreDatasetTypeProperties': %+v", err) + } + s.Format = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelinkedservice.go new file mode 100644 index 00000000000..31ec96f25d5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureDataLakeStoreLinkedService{} + +type AzureDataLakeStoreLinkedService struct { + TypeProperties AzureDataLakeStoreLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureDataLakeStoreLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureDataLakeStoreLinkedService{} + +func (s AzureDataLakeStoreLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureDataLakeStoreLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDataLakeStoreLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDataLakeStoreLinkedService: %+v", err) + } + + decoded["type"] = "AzureDataLakeStore" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDataLakeStoreLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureDataLakeStoreLinkedService{} + +func (s *AzureDataLakeStoreLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureDataLakeStoreLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataLakeStoreLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureDataLakeStoreLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelinkedservicetypeproperties.go new file mode 100644 index 00000000000..899af865b60 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelinkedservicetypeproperties.go @@ -0,0 +1,66 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureDataLakeStoreLinkedServiceTypeProperties struct { + AccountName *string `json:"accountName,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + DataLakeStoreUri string `json:"dataLakeStoreUri"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + SubscriptionId *string `json:"subscriptionId,omitempty"` + Tenant *string `json:"tenant,omitempty"` +} + +var _ json.Unmarshaler = &AzureDataLakeStoreLinkedServiceTypeProperties{} + +func (s *AzureDataLakeStoreLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccountName *string `json:"accountName,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + DataLakeStoreUri string `json:"dataLakeStoreUri"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccountName = decoded.AccountName + s.AzureCloudType = decoded.AzureCloudType + s.Credential = decoded.Credential + s.DataLakeStoreUri = decoded.DataLakeStoreUri + s.EncryptedCredential = decoded.EncryptedCredential + s.ResourceGroupName = decoded.ResourceGroupName + s.ServicePrincipalId = decoded.ServicePrincipalId + s.SubscriptionId = decoded.SubscriptionId + s.Tenant = decoded.Tenant + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureDataLakeStoreLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureDataLakeStoreLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelocation.go new file mode 100644 index 00000000000..9985a9b6bda --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatalakestorelocation.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = AzureDataLakeStoreLocation{} + +type AzureDataLakeStoreLocation struct { + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s AzureDataLakeStoreLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureDataLakeStoreLocation{} + +func (s AzureDataLakeStoreLocation) MarshalJSON() ([]byte, error) { + type wrapper AzureDataLakeStoreLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureDataLakeStoreLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureDataLakeStoreLocation: %+v", err) + } + + decoded["type"] = "AzureDataLakeStoreLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureDataLakeStoreLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelinkedservice.go new file mode 100644 index 00000000000..5260d859b9b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureFileStorageLinkedService{} + +type AzureFileStorageLinkedService struct { + TypeProperties AzureFileStorageLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureFileStorageLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureFileStorageLinkedService{} + +func (s AzureFileStorageLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureFileStorageLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureFileStorageLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureFileStorageLinkedService: %+v", err) + } + + decoded["type"] = "AzureFileStorage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureFileStorageLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureFileStorageLinkedService{} + +func (s *AzureFileStorageLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureFileStorageLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureFileStorageLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureFileStorageLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelinkedservicetypeproperties.go new file mode 100644 index 00000000000..9cdbdaa8797 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelinkedservicetypeproperties.go @@ -0,0 +1,72 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureFileStorageLinkedServiceTypeProperties struct { + AccountKey *AzureKeyVaultSecretReference `json:"accountKey,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FileShare *string `json:"fileShare,omitempty"` + Host *string `json:"host,omitempty"` + Password SecretBase `json:"password"` + SasToken *AzureKeyVaultSecretReference `json:"sasToken,omitempty"` + SasUri *string `json:"sasUri,omitempty"` + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + UserId *string `json:"userId,omitempty"` +} + +var _ json.Unmarshaler = &AzureFileStorageLinkedServiceTypeProperties{} + +func (s *AzureFileStorageLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccountKey *AzureKeyVaultSecretReference `json:"accountKey,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FileShare *string `json:"fileShare,omitempty"` + Host *string `json:"host,omitempty"` + SasToken *AzureKeyVaultSecretReference `json:"sasToken,omitempty"` + SasUri *string `json:"sasUri,omitempty"` + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + UserId *string `json:"userId,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccountKey = decoded.AccountKey + s.ConnectionString = decoded.ConnectionString + s.Credential = decoded.Credential + s.EncryptedCredential = decoded.EncryptedCredential + s.FileShare = decoded.FileShare + s.Host = decoded.Host + s.SasToken = decoded.SasToken + s.SasUri = decoded.SasUri + s.ServiceEndpoint = decoded.ServiceEndpoint + s.Snapshot = decoded.Snapshot + s.UserId = decoded.UserId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureFileStorageLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'AzureFileStorageLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelocation.go new file mode 100644 index 00000000000..1a098366a58 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefilestoragelocation.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = AzureFileStorageLocation{} + +type AzureFileStorageLocation struct { + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s AzureFileStorageLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureFileStorageLocation{} + +func (s AzureFileStorageLocation) MarshalJSON() ([]byte, error) { + type wrapper AzureFileStorageLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureFileStorageLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureFileStorageLocation: %+v", err) + } + + decoded["type"] = "AzureFileStorageLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureFileStorageLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefunctionlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefunctionlinkedservice.go new file mode 100644 index 00000000000..1cb94a12f06 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefunctionlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureFunctionLinkedService{} + +type AzureFunctionLinkedService struct { + TypeProperties AzureFunctionLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureFunctionLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureFunctionLinkedService{} + +func (s AzureFunctionLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureFunctionLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureFunctionLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureFunctionLinkedService: %+v", err) + } + + decoded["type"] = "AzureFunction" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureFunctionLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureFunctionLinkedService{} + +func (s *AzureFunctionLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureFunctionLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureFunctionLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureFunctionLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefunctionlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefunctionlinkedservicetypeproperties.go new file mode 100644 index 00000000000..22d7372d6a6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurefunctionlinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureFunctionLinkedServiceTypeProperties struct { + Authentication *string `json:"authentication,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FunctionAppURL string `json:"functionAppUrl"` + FunctionKey SecretBase `json:"functionKey"` + ResourceId *string `json:"resourceId,omitempty"` +} + +var _ json.Unmarshaler = &AzureFunctionLinkedServiceTypeProperties{} + +func (s *AzureFunctionLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Authentication *string `json:"authentication,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FunctionAppURL string `json:"functionAppUrl"` + ResourceId *string `json:"resourceId,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Authentication = decoded.Authentication + s.Credential = decoded.Credential + s.EncryptedCredential = decoded.EncryptedCredential + s.FunctionAppURL = decoded.FunctionAppURL + s.ResourceId = decoded.ResourceId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureFunctionLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["functionKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'FunctionKey' for 'AzureFunctionLinkedServiceTypeProperties': %+v", err) + } + s.FunctionKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultlinkedservice.go new file mode 100644 index 00000000000..7b5f8c16598 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureKeyVaultLinkedService{} + +type AzureKeyVaultLinkedService struct { + TypeProperties AzureKeyVaultLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureKeyVaultLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureKeyVaultLinkedService{} + +func (s AzureKeyVaultLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureKeyVaultLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureKeyVaultLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureKeyVaultLinkedService: %+v", err) + } + + decoded["type"] = "AzureKeyVault" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureKeyVaultLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureKeyVaultLinkedService{} + +func (s *AzureKeyVaultLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureKeyVaultLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureKeyVaultLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureKeyVaultLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultlinkedservicetypeproperties.go new file mode 100644 index 00000000000..5de67f36a96 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultlinkedservicetypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureKeyVaultLinkedServiceTypeProperties struct { + BaseURL string `json:"baseUrl"` + Credential *CredentialReference `json:"credential,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultsecretreference.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultsecretreference.go new file mode 100644 index 00000000000..7fbd3bef0ef --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurekeyvaultsecretreference.go @@ -0,0 +1,52 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ SecretBase = AzureKeyVaultSecretReference{} + +type AzureKeyVaultSecretReference struct { + SecretName string `json:"secretName"` + SecretVersion *string `json:"secretVersion,omitempty"` + Store LinkedServiceReference `json:"store"` + + // Fields inherited from SecretBase + + Type string `json:"type"` +} + +func (s AzureKeyVaultSecretReference) SecretBase() BaseSecretBaseImpl { + return BaseSecretBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = AzureKeyVaultSecretReference{} + +func (s AzureKeyVaultSecretReference) MarshalJSON() ([]byte, error) { + type wrapper AzureKeyVaultSecretReference + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureKeyVaultSecretReference: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureKeyVaultSecretReference: %+v", err) + } + + decoded["type"] = "AzureKeyVaultSecret" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureKeyVaultSecretReference: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadblinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadblinkedservice.go new file mode 100644 index 00000000000..21208f7e987 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadblinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureMariaDBLinkedService{} + +type AzureMariaDBLinkedService struct { + TypeProperties AzureMariaDBLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureMariaDBLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureMariaDBLinkedService{} + +func (s AzureMariaDBLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureMariaDBLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureMariaDBLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureMariaDBLinkedService: %+v", err) + } + + decoded["type"] = "AzureMariaDB" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureMariaDBLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureMariaDBLinkedService{} + +func (s *AzureMariaDBLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureMariaDBLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureMariaDBLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureMariaDBLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadblinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadblinkedservicetypeproperties.go new file mode 100644 index 00000000000..40bd21331e9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadblinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureMariaDBLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Pwd *AzureKeyVaultSecretReference `json:"pwd,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadbtabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadbtabledataset.go new file mode 100644 index 00000000000..cf3039abc66 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremariadbtabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureMariaDBTableDataset{} + +type AzureMariaDBTableDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureMariaDBTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureMariaDBTableDataset{} + +func (s AzureMariaDBTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureMariaDBTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureMariaDBTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureMariaDBTableDataset: %+v", err) + } + + decoded["type"] = "AzureMariaDBTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureMariaDBTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureMariaDBTableDataset{} + +func (s *AzureMariaDBTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureMariaDBTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureMariaDBTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremllinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremllinkedservice.go new file mode 100644 index 00000000000..0db11206add --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremllinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureMLLinkedService{} + +type AzureMLLinkedService struct { + TypeProperties AzureMLLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureMLLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureMLLinkedService{} + +func (s AzureMLLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureMLLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureMLLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureMLLinkedService: %+v", err) + } + + decoded["type"] = "AzureML" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureMLLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureMLLinkedService{} + +func (s *AzureMLLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureMLLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureMLLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureMLLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremllinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremllinkedservicetypeproperties.go new file mode 100644 index 00000000000..62fde1e27e6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremllinkedservicetypeproperties.go @@ -0,0 +1,66 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureMLLinkedServiceTypeProperties struct { + ApiKey SecretBase `json:"apiKey"` + Authentication *string `json:"authentication,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + MlEndpoint string `json:"mlEndpoint"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + UpdateResourceEndpoint *string `json:"updateResourceEndpoint,omitempty"` +} + +var _ json.Unmarshaler = &AzureMLLinkedServiceTypeProperties{} + +func (s *AzureMLLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Authentication *string `json:"authentication,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + MlEndpoint string `json:"mlEndpoint"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + UpdateResourceEndpoint *string `json:"updateResourceEndpoint,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Authentication = decoded.Authentication + s.EncryptedCredential = decoded.EncryptedCredential + s.MlEndpoint = decoded.MlEndpoint + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.UpdateResourceEndpoint = decoded.UpdateResourceEndpoint + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureMLLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["apiKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ApiKey' for 'AzureMLLinkedServiceTypeProperties': %+v", err) + } + s.ApiKey = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureMLLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremlservicelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremlservicelinkedservice.go new file mode 100644 index 00000000000..dc0b8264d48 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremlservicelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureMLServiceLinkedService{} + +type AzureMLServiceLinkedService struct { + TypeProperties AzureMLServiceLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureMLServiceLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureMLServiceLinkedService{} + +func (s AzureMLServiceLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureMLServiceLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureMLServiceLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureMLServiceLinkedService: %+v", err) + } + + decoded["type"] = "AzureMLService" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureMLServiceLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureMLServiceLinkedService{} + +func (s *AzureMLServiceLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureMLServiceLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureMLServiceLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureMLServiceLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremlservicelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremlservicelinkedservicetypeproperties.go new file mode 100644 index 00000000000..f541103c034 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremlservicelinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureMLServiceLinkedServiceTypeProperties struct { + Authentication *string `json:"authentication,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + MlWorkspaceName string `json:"mlWorkspaceName"` + ResourceGroupName string `json:"resourceGroupName"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + SubscriptionId string `json:"subscriptionId"` + Tenant *string `json:"tenant,omitempty"` +} + +var _ json.Unmarshaler = &AzureMLServiceLinkedServiceTypeProperties{} + +func (s *AzureMLServiceLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Authentication *string `json:"authentication,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + MlWorkspaceName string `json:"mlWorkspaceName"` + ResourceGroupName string `json:"resourceGroupName"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + SubscriptionId string `json:"subscriptionId"` + Tenant *string `json:"tenant,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Authentication = decoded.Authentication + s.EncryptedCredential = decoded.EncryptedCredential + s.MlWorkspaceName = decoded.MlWorkspaceName + s.ResourceGroupName = decoded.ResourceGroupName + s.ServicePrincipalId = decoded.ServicePrincipalId + s.SubscriptionId = decoded.SubscriptionId + s.Tenant = decoded.Tenant + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureMLServiceLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureMLServiceLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqllinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqllinkedservice.go new file mode 100644 index 00000000000..ea1800c8113 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqllinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureMySqlLinkedService{} + +type AzureMySqlLinkedService struct { + TypeProperties AzureMySqlLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureMySqlLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureMySqlLinkedService{} + +func (s AzureMySqlLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureMySqlLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureMySqlLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureMySqlLinkedService: %+v", err) + } + + decoded["type"] = "AzureMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureMySqlLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureMySqlLinkedService{} + +func (s *AzureMySqlLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureMySqlLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureMySqlLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureMySqlLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqllinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqllinkedservicetypeproperties.go new file mode 100644 index 00000000000..937495483cf --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqllinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureMySqlLinkedServiceTypeProperties struct { + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqltabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqltabledataset.go new file mode 100644 index 00000000000..8c7405103c1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqltabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureMySqlTableDataset{} + +type AzureMySqlTableDataset struct { + TypeProperties AzureMySqlTableDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureMySqlTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureMySqlTableDataset{} + +func (s AzureMySqlTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureMySqlTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureMySqlTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureMySqlTableDataset: %+v", err) + } + + decoded["type"] = "AzureMySqlTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureMySqlTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureMySqlTableDataset{} + +func (s *AzureMySqlTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureMySqlTableDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureMySqlTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureMySqlTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqltabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqltabledatasettypeproperties.go new file mode 100644 index 00000000000..519e66d4138 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuremysqltabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureMySqlTableDatasetTypeProperties struct { + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqllinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqllinkedservice.go new file mode 100644 index 00000000000..f3fae86bb38 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqllinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzurePostgreSqlLinkedService{} + +type AzurePostgreSqlLinkedService struct { + TypeProperties AzurePostgreSqlLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzurePostgreSqlLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzurePostgreSqlLinkedService{} + +func (s AzurePostgreSqlLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzurePostgreSqlLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzurePostgreSqlLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzurePostgreSqlLinkedService: %+v", err) + } + + decoded["type"] = "AzurePostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzurePostgreSqlLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzurePostgreSqlLinkedService{} + +func (s *AzurePostgreSqlLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzurePostgreSqlLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzurePostgreSqlLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzurePostgreSqlLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqllinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqllinkedservicetypeproperties.go new file mode 100644 index 00000000000..dcf9c0d964a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqllinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzurePostgreSqlLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqltabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqltabledataset.go new file mode 100644 index 00000000000..4231b28db04 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqltabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzurePostgreSqlTableDataset{} + +type AzurePostgreSqlTableDataset struct { + TypeProperties *AzurePostgreSqlTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzurePostgreSqlTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzurePostgreSqlTableDataset{} + +func (s AzurePostgreSqlTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AzurePostgreSqlTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzurePostgreSqlTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzurePostgreSqlTableDataset: %+v", err) + } + + decoded["type"] = "AzurePostgreSqlTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzurePostgreSqlTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzurePostgreSqlTableDataset{} + +func (s *AzurePostgreSqlTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AzurePostgreSqlTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzurePostgreSqlTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzurePostgreSqlTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqltabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqltabledatasettypeproperties.go new file mode 100644 index 00000000000..8cb96459b96 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurepostgresqltabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzurePostgreSqlTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchindexdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchindexdataset.go new file mode 100644 index 00000000000..f0edd212ff3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchindexdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureSearchIndexDataset{} + +type AzureSearchIndexDataset struct { + TypeProperties AzureSearchIndexDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureSearchIndexDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureSearchIndexDataset{} + +func (s AzureSearchIndexDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureSearchIndexDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSearchIndexDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSearchIndexDataset: %+v", err) + } + + decoded["type"] = "AzureSearchIndex" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSearchIndexDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSearchIndexDataset{} + +func (s *AzureSearchIndexDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureSearchIndexDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSearchIndexDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureSearchIndexDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchindexdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchindexdatasettypeproperties.go new file mode 100644 index 00000000000..d3bb3ecfcf3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchindexdatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSearchIndexDatasetTypeProperties struct { + IndexName string `json:"indexName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchlinkedservice.go new file mode 100644 index 00000000000..37fc51004e1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureSearchLinkedService{} + +type AzureSearchLinkedService struct { + TypeProperties AzureSearchLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureSearchLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureSearchLinkedService{} + +func (s AzureSearchLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureSearchLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSearchLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSearchLinkedService: %+v", err) + } + + decoded["type"] = "AzureSearch" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSearchLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSearchLinkedService{} + +func (s *AzureSearchLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureSearchLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSearchLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureSearchLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchlinkedservicetypeproperties.go new file mode 100644 index 00000000000..bafd2088352 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresearchlinkedservicetypeproperties.go @@ -0,0 +1,45 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSearchLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Key SecretBase `json:"key"` + Url string `json:"url"` +} + +var _ json.Unmarshaler = &AzureSearchLinkedServiceTypeProperties{} + +func (s *AzureSearchLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Url = decoded.Url + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSearchLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["key"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Key' for 'AzureSearchLinkedServiceTypeProperties': %+v", err) + } + s.Key = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldatabaselinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldatabaselinkedservice.go new file mode 100644 index 00000000000..e89bfec24b8 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldatabaselinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureSqlDatabaseLinkedService{} + +type AzureSqlDatabaseLinkedService struct { + TypeProperties AzureSqlDatabaseLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureSqlDatabaseLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureSqlDatabaseLinkedService{} + +func (s AzureSqlDatabaseLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureSqlDatabaseLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSqlDatabaseLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSqlDatabaseLinkedService: %+v", err) + } + + decoded["type"] = "AzureSqlDatabase" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSqlDatabaseLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSqlDatabaseLinkedService{} + +func (s *AzureSqlDatabaseLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureSqlDatabaseLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlDatabaseLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureSqlDatabaseLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldatabaselinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldatabaselinkedservicetypeproperties.go new file mode 100644 index 00000000000..4c6a918eca2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldatabaselinkedservicetypeproperties.go @@ -0,0 +1,138 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSqlDatabaseLinkedServiceTypeProperties struct { + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlDatabaseAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &AzureSqlDatabaseLinkedServiceTypeProperties{} + +func (s *AzureSqlDatabaseLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlDatabaseAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AlwaysEncryptedSettings = decoded.AlwaysEncryptedSettings + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType + s.AzureCloudType = decoded.AzureCloudType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout + s.ConnectionString = decoded.ConnectionString + s.Credential = decoded.Credential + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt + s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize + s.Password = decoded.Password + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.TrustServerCertificate = decoded.TrustServerCertificate + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlDatabaseLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'AzureSqlDatabaseLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureSqlDatabaseLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwlinkedservice.go new file mode 100644 index 00000000000..4864760c077 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureSqlDWLinkedService{} + +type AzureSqlDWLinkedService struct { + TypeProperties AzureSqlDWLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureSqlDWLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureSqlDWLinkedService{} + +func (s AzureSqlDWLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureSqlDWLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSqlDWLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSqlDWLinkedService: %+v", err) + } + + decoded["type"] = "AzureSqlDW" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSqlDWLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSqlDWLinkedService{} + +func (s *AzureSqlDWLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureSqlDWLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlDWLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureSqlDWLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwlinkedservicetypeproperties.go new file mode 100644 index 00000000000..adf9f201409 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwlinkedservicetypeproperties.go @@ -0,0 +1,135 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSqlDWLinkedServiceTypeProperties struct { + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlDWAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &AzureSqlDWLinkedServiceTypeProperties{} + +func (s *AzureSqlDWLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlDWAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType + s.AzureCloudType = decoded.AzureCloudType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout + s.ConnectionString = decoded.ConnectionString + s.Credential = decoded.Credential + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt + s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize + s.Password = decoded.Password + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.TrustServerCertificate = decoded.TrustServerCertificate + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlDWLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'AzureSqlDWLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureSqlDWLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwtabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwtabledataset.go new file mode 100644 index 00000000000..de6285e252a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwtabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureSqlDWTableDataset{} + +type AzureSqlDWTableDataset struct { + TypeProperties *AzureSqlDWTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureSqlDWTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureSqlDWTableDataset{} + +func (s AzureSqlDWTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureSqlDWTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSqlDWTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSqlDWTableDataset: %+v", err) + } + + decoded["type"] = "AzureSqlDWTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSqlDWTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSqlDWTableDataset{} + +func (s *AzureSqlDWTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AzureSqlDWTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlDWTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureSqlDWTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwtabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwtabledatasettypeproperties.go new file mode 100644 index 00000000000..b2e68440c9b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqldwtabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSqlDWTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmilinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmilinkedservice.go new file mode 100644 index 00000000000..0e895172979 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmilinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureSqlMILinkedService{} + +type AzureSqlMILinkedService struct { + TypeProperties AzureSqlMILinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureSqlMILinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureSqlMILinkedService{} + +func (s AzureSqlMILinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureSqlMILinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSqlMILinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSqlMILinkedService: %+v", err) + } + + decoded["type"] = "AzureSqlMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSqlMILinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSqlMILinkedService{} + +func (s *AzureSqlMILinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureSqlMILinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlMILinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureSqlMILinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmilinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmilinkedservicetypeproperties.go new file mode 100644 index 00000000000..b6fdccf9bd3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmilinkedservicetypeproperties.go @@ -0,0 +1,138 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSqlMILinkedServiceTypeProperties struct { + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlMIAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &AzureSqlMILinkedServiceTypeProperties{} + +func (s *AzureSqlMILinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlMIAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AlwaysEncryptedSettings = decoded.AlwaysEncryptedSettings + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType + s.AzureCloudType = decoded.AzureCloudType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout + s.ConnectionString = decoded.ConnectionString + s.Credential = decoded.Credential + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt + s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize + s.Password = decoded.Password + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.TrustServerCertificate = decoded.TrustServerCertificate + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlMILinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'AzureSqlMILinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'AzureSqlMILinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmitabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmitabledataset.go new file mode 100644 index 00000000000..e18b3a67a31 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmitabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureSqlMITableDataset{} + +type AzureSqlMITableDataset struct { + TypeProperties *AzureSqlMITableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureSqlMITableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureSqlMITableDataset{} + +func (s AzureSqlMITableDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureSqlMITableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSqlMITableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSqlMITableDataset: %+v", err) + } + + decoded["type"] = "AzureSqlMITable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSqlMITableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSqlMITableDataset{} + +func (s *AzureSqlMITableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AzureSqlMITableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlMITableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureSqlMITableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmitabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmitabledatasettypeproperties.go new file mode 100644 index 00000000000..ae0608887ba --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqlmitabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSqlMITableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqltabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqltabledataset.go new file mode 100644 index 00000000000..dea340af0fd --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqltabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureSqlTableDataset{} + +type AzureSqlTableDataset struct { + TypeProperties *AzureSqlTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureSqlTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureSqlTableDataset{} + +func (s AzureSqlTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureSqlTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSqlTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSqlTableDataset: %+v", err) + } + + decoded["type"] = "AzureSqlTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSqlTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSqlTableDataset{} + +func (s *AzureSqlTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *AzureSqlTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSqlTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureSqlTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqltabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqltabledatasettypeproperties.go new file mode 100644 index 00000000000..3504b06c1ff --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresqltabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSqlTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurestoragelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurestoragelinkedservice.go new file mode 100644 index 00000000000..997756bf216 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurestoragelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureStorageLinkedService{} + +type AzureStorageLinkedService struct { + TypeProperties AzureStorageLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureStorageLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureStorageLinkedService{} + +func (s AzureStorageLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureStorageLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureStorageLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureStorageLinkedService: %+v", err) + } + + decoded["type"] = "AzureStorage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureStorageLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureStorageLinkedService{} + +func (s *AzureStorageLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureStorageLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureStorageLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureStorageLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurestoragelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurestoragelinkedservicetypeproperties.go new file mode 100644 index 00000000000..08830686905 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azurestoragelinkedservicetypeproperties.go @@ -0,0 +1,12 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureStorageLinkedServiceTypeProperties struct { + AccountKey *AzureKeyVaultSecretReference `json:"accountKey,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SasToken *AzureKeyVaultSecretReference `json:"sasToken,omitempty"` + SasUri *string `json:"sasUri,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresynapseartifactslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresynapseartifactslinkedservice.go new file mode 100644 index 00000000000..79a99c31d3b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresynapseartifactslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureSynapseArtifactsLinkedService{} + +type AzureSynapseArtifactsLinkedService struct { + TypeProperties AzureSynapseArtifactsLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureSynapseArtifactsLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureSynapseArtifactsLinkedService{} + +func (s AzureSynapseArtifactsLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureSynapseArtifactsLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureSynapseArtifactsLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureSynapseArtifactsLinkedService: %+v", err) + } + + decoded["type"] = "AzureSynapseArtifacts" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureSynapseArtifactsLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureSynapseArtifactsLinkedService{} + +func (s *AzureSynapseArtifactsLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureSynapseArtifactsLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureSynapseArtifactsLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureSynapseArtifactsLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresynapseartifactslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresynapseartifactslinkedservicetypeproperties.go new file mode 100644 index 00000000000..96478d3d390 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuresynapseartifactslinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSynapseArtifactsLinkedServiceTypeProperties struct { + Authentication *string `json:"authentication,omitempty"` + Endpoint string `json:"endpoint"` + WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretabledataset.go new file mode 100644 index 00000000000..4365200ee30 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = AzureTableDataset{} + +type AzureTableDataset struct { + TypeProperties AzureTableDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s AzureTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureTableDataset{} + +func (s AzureTableDataset) MarshalJSON() ([]byte, error) { + type wrapper AzureTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureTableDataset: %+v", err) + } + + decoded["type"] = "AzureTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureTableDataset{} + +func (s *AzureTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureTableDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'AzureTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretabledatasettypeproperties.go new file mode 100644 index 00000000000..5ff22a0e8aa --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretabledatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureTableDatasetTypeProperties struct { + TableName string `json:"tableName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretablestoragelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretablestoragelinkedservice.go new file mode 100644 index 00000000000..f29e8210ebf --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretablestoragelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = AzureTableStorageLinkedService{} + +type AzureTableStorageLinkedService struct { + TypeProperties AzureTableStorageLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s AzureTableStorageLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = AzureTableStorageLinkedService{} + +func (s AzureTableStorageLinkedService) MarshalJSON() ([]byte, error) { + type wrapper AzureTableStorageLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureTableStorageLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureTableStorageLinkedService: %+v", err) + } + + decoded["type"] = "AzureTableStorage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureTableStorageLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &AzureTableStorageLinkedService{} + +func (s *AzureTableStorageLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties AzureTableStorageLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AzureTableStorageLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'AzureTableStorageLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretablestoragelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretablestoragelinkedservicetypeproperties.go new file mode 100644 index 00000000000..1cb8560846c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuretablestoragelinkedservicetypeproperties.go @@ -0,0 +1,14 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureTableStorageLinkedServiceTypeProperties struct { + AccountKey *AzureKeyVaultSecretReference `json:"accountKey,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SasToken *AzureKeyVaultSecretReference `json:"sasToken,omitempty"` + SasUri *string `json:"sasUri,omitempty"` + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_binarydataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_binarydataset.go new file mode 100644 index 00000000000..953e216cf2a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_binarydataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = BinaryDataset{} + +type BinaryDataset struct { + TypeProperties *BinaryDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s BinaryDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = BinaryDataset{} + +func (s BinaryDataset) MarshalJSON() ([]byte, error) { + type wrapper BinaryDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling BinaryDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling BinaryDataset: %+v", err) + } + + decoded["type"] = "Binary" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling BinaryDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &BinaryDataset{} + +func (s *BinaryDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *BinaryDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BinaryDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'BinaryDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_binarydatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_binarydatasettypeproperties.go new file mode 100644 index 00000000000..856c254daef --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_binarydatasettypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BinaryDatasetTypeProperties struct { + Compression *DatasetCompression `json:"compression,omitempty"` + Location DatasetLocation `json:"location"` +} + +var _ json.Unmarshaler = &BinaryDatasetTypeProperties{} + +func (s *BinaryDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Compression *DatasetCompression `json:"compression,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Compression = decoded.Compression + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BinaryDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'BinaryDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandralinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandralinkedservice.go new file mode 100644 index 00000000000..2d2c75b617b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandralinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = CassandraLinkedService{} + +type CassandraLinkedService struct { + TypeProperties CassandraLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s CassandraLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = CassandraLinkedService{} + +func (s CassandraLinkedService) MarshalJSON() ([]byte, error) { + type wrapper CassandraLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CassandraLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CassandraLinkedService: %+v", err) + } + + decoded["type"] = "Cassandra" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CassandraLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CassandraLinkedService{} + +func (s *CassandraLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties CassandraLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CassandraLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'CassandraLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandralinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandralinkedservicetypeproperties.go new file mode 100644 index 00000000000..affaf316a29 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandralinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraLinkedServiceTypeProperties struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &CassandraLinkedServiceTypeProperties{} + +func (s *CassandraLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.Port = decoded.Port + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CassandraLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'CassandraLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandratabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandratabledataset.go new file mode 100644 index 00000000000..4d5803be14f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandratabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = CassandraTableDataset{} + +type CassandraTableDataset struct { + TypeProperties *CassandraTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s CassandraTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = CassandraTableDataset{} + +func (s CassandraTableDataset) MarshalJSON() ([]byte, error) { + type wrapper CassandraTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CassandraTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CassandraTableDataset: %+v", err) + } + + decoded["type"] = "CassandraTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CassandraTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CassandraTableDataset{} + +func (s *CassandraTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *CassandraTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CassandraTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'CassandraTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandratabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandratabledatasettypeproperties.go new file mode 100644 index 00000000000..ed13d6e92d9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cassandratabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CassandraTableDatasetTypeProperties struct { + Keyspace *string `json:"keyspace,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cmdkeysetup.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cmdkeysetup.go new file mode 100644 index 00000000000..26ded9ce5fa --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cmdkeysetup.go @@ -0,0 +1,50 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CustomSetupBase = CmdkeySetup{} + +type CmdkeySetup struct { + TypeProperties CmdkeySetupTypeProperties `json:"typeProperties"` + + // Fields inherited from CustomSetupBase + + Type string `json:"type"` +} + +func (s CmdkeySetup) CustomSetupBase() BaseCustomSetupBaseImpl { + return BaseCustomSetupBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = CmdkeySetup{} + +func (s CmdkeySetup) MarshalJSON() ([]byte, error) { + type wrapper CmdkeySetup + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CmdkeySetup: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CmdkeySetup: %+v", err) + } + + decoded["type"] = "CmdkeySetup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CmdkeySetup: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cmdkeysetuptypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cmdkeysetuptypeproperties.go new file mode 100644 index 00000000000..36838b2c650 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cmdkeysetuptypeproperties.go @@ -0,0 +1,45 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CmdkeySetupTypeProperties struct { + Password SecretBase `json:"password"` + TargetName string `json:"targetName"` + UserName string `json:"userName"` +} + +var _ json.Unmarshaler = &CmdkeySetupTypeProperties{} + +func (s *CmdkeySetupTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TargetName string `json:"targetName"` + UserName string `json:"userName"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TargetName = decoded.TargetName + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CmdkeySetupTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'CmdkeySetupTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappsentitydataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappsentitydataset.go new file mode 100644 index 00000000000..fdd916a0833 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappsentitydataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = CommonDataServiceForAppsEntityDataset{} + +type CommonDataServiceForAppsEntityDataset struct { + TypeProperties *CommonDataServiceForAppsEntityDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s CommonDataServiceForAppsEntityDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = CommonDataServiceForAppsEntityDataset{} + +func (s CommonDataServiceForAppsEntityDataset) MarshalJSON() ([]byte, error) { + type wrapper CommonDataServiceForAppsEntityDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CommonDataServiceForAppsEntityDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CommonDataServiceForAppsEntityDataset: %+v", err) + } + + decoded["type"] = "CommonDataServiceForAppsEntity" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CommonDataServiceForAppsEntityDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CommonDataServiceForAppsEntityDataset{} + +func (s *CommonDataServiceForAppsEntityDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *CommonDataServiceForAppsEntityDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CommonDataServiceForAppsEntityDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'CommonDataServiceForAppsEntityDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappsentitydatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappsentitydatasettypeproperties.go new file mode 100644 index 00000000000..0e665e46be4 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappsentitydatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CommonDataServiceForAppsEntityDatasetTypeProperties struct { + EntityName *string `json:"entityName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappslinkedservice.go new file mode 100644 index 00000000000..35a3e1a8aa7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = CommonDataServiceForAppsLinkedService{} + +type CommonDataServiceForAppsLinkedService struct { + TypeProperties CommonDataServiceForAppsLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s CommonDataServiceForAppsLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = CommonDataServiceForAppsLinkedService{} + +func (s CommonDataServiceForAppsLinkedService) MarshalJSON() ([]byte, error) { + type wrapper CommonDataServiceForAppsLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CommonDataServiceForAppsLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CommonDataServiceForAppsLinkedService: %+v", err) + } + + decoded["type"] = "CommonDataServiceForApps" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CommonDataServiceForAppsLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CommonDataServiceForAppsLinkedService{} + +func (s *CommonDataServiceForAppsLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties CommonDataServiceForAppsLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CommonDataServiceForAppsLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'CommonDataServiceForAppsLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappslinkedservicetypeproperties.go new file mode 100644 index 00000000000..a70d09cc19f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_commondataserviceforappslinkedservicetypeproperties.go @@ -0,0 +1,81 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CommonDataServiceForAppsLinkedServiceTypeProperties struct { + AuthenticationType string `json:"authenticationType"` + DeploymentType string `json:"deploymentType"` + Domain *string `json:"domain,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HostName *string `json:"hostName,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServiceUri *string `json:"serviceUri,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &CommonDataServiceForAppsLinkedServiceTypeProperties{} + +func (s *CommonDataServiceForAppsLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType string `json:"authenticationType"` + DeploymentType string `json:"deploymentType"` + Domain *string `json:"domain,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HostName *string `json:"hostName,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + Port *int64 `json:"port,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServiceUri *string `json:"serviceUri,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.DeploymentType = decoded.DeploymentType + s.Domain = decoded.Domain + s.EncryptedCredential = decoded.EncryptedCredential + s.HostName = decoded.HostName + s.OrganizationName = decoded.OrganizationName + s.Port = decoded.Port + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.ServiceUri = decoded.ServiceUri + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CommonDataServiceForAppsLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'CommonDataServiceForAppsLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'CommonDataServiceForAppsLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_componentsetup.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_componentsetup.go new file mode 100644 index 00000000000..122a08933a3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_componentsetup.go @@ -0,0 +1,50 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CustomSetupBase = ComponentSetup{} + +type ComponentSetup struct { + TypeProperties LicensedComponentSetupTypeProperties `json:"typeProperties"` + + // Fields inherited from CustomSetupBase + + Type string `json:"type"` +} + +func (s ComponentSetup) CustomSetupBase() BaseCustomSetupBaseImpl { + return BaseCustomSetupBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = ComponentSetup{} + +func (s ComponentSetup) MarshalJSON() ([]byte, error) { + type wrapper ComponentSetup + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ComponentSetup: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ComponentSetup: %+v", err) + } + + decoded["type"] = "ComponentSetup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ComponentSetup: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurlinkedservice.go new file mode 100644 index 00000000000..6433506d3a3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ConcurLinkedService{} + +type ConcurLinkedService struct { + TypeProperties ConcurLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ConcurLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ConcurLinkedService{} + +func (s ConcurLinkedService) MarshalJSON() ([]byte, error) { + type wrapper ConcurLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConcurLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConcurLinkedService: %+v", err) + } + + decoded["type"] = "Concur" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConcurLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConcurLinkedService{} + +func (s *ConcurLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ConcurLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConcurLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ConcurLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurlinkedservicetypeproperties.go new file mode 100644 index 00000000000..2b17317ba9a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurlinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConcurLinkedServiceTypeProperties struct { + ClientId string `json:"clientId"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username string `json:"username"` +} + +var _ json.Unmarshaler = &ConcurLinkedServiceTypeProperties{} + +func (s *ConcurLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId string `json:"clientId"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username string `json:"username"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.ConnectionProperties = decoded.ConnectionProperties + s.EncryptedCredential = decoded.EncryptedCredential + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConcurLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'ConcurLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurobjectdataset.go new file mode 100644 index 00000000000..fc87e45a583 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_concurobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ConcurObjectDataset{} + +type ConcurObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ConcurObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ConcurObjectDataset{} + +func (s ConcurObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper ConcurObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConcurObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConcurObjectDataset: %+v", err) + } + + decoded["type"] = "ConcurObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConcurObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConcurObjectDataset{} + +func (s *ConcurObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConcurObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ConcurObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_copycomputescaleproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_copycomputescaleproperties.go new file mode 100644 index 00000000000..9170e2d9695 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_copycomputescaleproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CopyComputeScaleProperties struct { + DataIntegrationUnit *int64 `json:"dataIntegrationUnit,omitempty"` + TimeToLive *int64 `json:"timeToLive,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdblinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdblinkedservice.go new file mode 100644 index 00000000000..3cd09354067 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdblinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = CosmosDbLinkedService{} + +type CosmosDbLinkedService struct { + TypeProperties CosmosDbLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s CosmosDbLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = CosmosDbLinkedService{} + +func (s CosmosDbLinkedService) MarshalJSON() ([]byte, error) { + type wrapper CosmosDbLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CosmosDbLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CosmosDbLinkedService: %+v", err) + } + + decoded["type"] = "CosmosDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CosmosDbLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CosmosDbLinkedService{} + +func (s *CosmosDbLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties CosmosDbLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CosmosDbLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'CosmosDbLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdblinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdblinkedservicetypeproperties.go new file mode 100644 index 00000000000..3a78b9c6b18 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdblinkedservicetypeproperties.go @@ -0,0 +1,78 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CosmosDbLinkedServiceTypeProperties struct { + AccountEndpoint *string `json:"accountEndpoint,omitempty"` + AccountKey SecretBase `json:"accountKey"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + ConnectionMode *CosmosDbConnectionMode `json:"connectionMode,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` +} + +var _ json.Unmarshaler = &CosmosDbLinkedServiceTypeProperties{} + +func (s *CosmosDbLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccountEndpoint *string `json:"accountEndpoint,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + ConnectionMode *CosmosDbConnectionMode `json:"connectionMode,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccountEndpoint = decoded.AccountEndpoint + s.AzureCloudType = decoded.AzureCloudType + s.ConnectionMode = decoded.ConnectionMode + s.ConnectionString = decoded.ConnectionString + s.Credential = decoded.Credential + s.Database = decoded.Database + s.EncryptedCredential = decoded.EncryptedCredential + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CosmosDbLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accountKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccountKey' for 'CosmosDbLinkedServiceTypeProperties': %+v", err) + } + s.AccountKey = impl + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'CosmosDbLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapicollectiondataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapicollectiondataset.go new file mode 100644 index 00000000000..5ca302884b2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapicollectiondataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = CosmosDbMongoDbApiCollectionDataset{} + +type CosmosDbMongoDbApiCollectionDataset struct { + TypeProperties CosmosDbMongoDbApiCollectionDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s CosmosDbMongoDbApiCollectionDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = CosmosDbMongoDbApiCollectionDataset{} + +func (s CosmosDbMongoDbApiCollectionDataset) MarshalJSON() ([]byte, error) { + type wrapper CosmosDbMongoDbApiCollectionDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CosmosDbMongoDbApiCollectionDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CosmosDbMongoDbApiCollectionDataset: %+v", err) + } + + decoded["type"] = "CosmosDbMongoDbApiCollection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CosmosDbMongoDbApiCollectionDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CosmosDbMongoDbApiCollectionDataset{} + +func (s *CosmosDbMongoDbApiCollectionDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties CosmosDbMongoDbApiCollectionDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CosmosDbMongoDbApiCollectionDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'CosmosDbMongoDbApiCollectionDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapicollectiondatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapicollectiondatasettypeproperties.go new file mode 100644 index 00000000000..947c5e1c6ef --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapicollectiondatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CosmosDbMongoDbApiCollectionDatasetTypeProperties struct { + Collection string `json:"collection"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapilinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapilinkedservice.go new file mode 100644 index 00000000000..8839d382fec --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapilinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = CosmosDbMongoDbApiLinkedService{} + +type CosmosDbMongoDbApiLinkedService struct { + TypeProperties CosmosDbMongoDbApiLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s CosmosDbMongoDbApiLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = CosmosDbMongoDbApiLinkedService{} + +func (s CosmosDbMongoDbApiLinkedService) MarshalJSON() ([]byte, error) { + type wrapper CosmosDbMongoDbApiLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CosmosDbMongoDbApiLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CosmosDbMongoDbApiLinkedService: %+v", err) + } + + decoded["type"] = "CosmosDbMongoDbApi" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CosmosDbMongoDbApiLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CosmosDbMongoDbApiLinkedService{} + +func (s *CosmosDbMongoDbApiLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties CosmosDbMongoDbApiLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CosmosDbMongoDbApiLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'CosmosDbMongoDbApiLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapilinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapilinkedservicetypeproperties.go new file mode 100644 index 00000000000..49d749fa69d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbmongodbapilinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CosmosDbMongoDbApiLinkedServiceTypeProperties struct { + ConnectionString string `json:"connectionString"` + Database string `json:"database"` + IsServerVersionAbove32 *bool `json:"isServerVersionAbove32,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbsqlapicollectiondataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbsqlapicollectiondataset.go new file mode 100644 index 00000000000..1d31cd6d43e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbsqlapicollectiondataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = CosmosDbSqlApiCollectionDataset{} + +type CosmosDbSqlApiCollectionDataset struct { + TypeProperties CosmosDbSqlApiCollectionDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s CosmosDbSqlApiCollectionDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = CosmosDbSqlApiCollectionDataset{} + +func (s CosmosDbSqlApiCollectionDataset) MarshalJSON() ([]byte, error) { + type wrapper CosmosDbSqlApiCollectionDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CosmosDbSqlApiCollectionDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CosmosDbSqlApiCollectionDataset: %+v", err) + } + + decoded["type"] = "CosmosDbSqlApiCollection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CosmosDbSqlApiCollectionDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CosmosDbSqlApiCollectionDataset{} + +func (s *CosmosDbSqlApiCollectionDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties CosmosDbSqlApiCollectionDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CosmosDbSqlApiCollectionDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'CosmosDbSqlApiCollectionDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbsqlapicollectiondatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbsqlapicollectiondatasettypeproperties.go new file mode 100644 index 00000000000..af7325da81b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_cosmosdbsqlapicollectiondatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CosmosDbSqlApiCollectionDatasetTypeProperties struct { + CollectionName string `json:"collectionName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbaselinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbaselinkedservice.go new file mode 100644 index 00000000000..a8bc1bc5b51 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbaselinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = CouchbaseLinkedService{} + +type CouchbaseLinkedService struct { + TypeProperties CouchbaseLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s CouchbaseLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = CouchbaseLinkedService{} + +func (s CouchbaseLinkedService) MarshalJSON() ([]byte, error) { + type wrapper CouchbaseLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CouchbaseLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CouchbaseLinkedService: %+v", err) + } + + decoded["type"] = "Couchbase" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CouchbaseLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CouchbaseLinkedService{} + +func (s *CouchbaseLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties CouchbaseLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CouchbaseLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'CouchbaseLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbaselinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbaselinkedservicetypeproperties.go new file mode 100644 index 00000000000..541f02a4d23 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbaselinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CouchbaseLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + CredString *AzureKeyVaultSecretReference `json:"credString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbasetabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbasetabledataset.go new file mode 100644 index 00000000000..3b81db9314a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_couchbasetabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = CouchbaseTableDataset{} + +type CouchbaseTableDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s CouchbaseTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = CouchbaseTableDataset{} + +func (s CouchbaseTableDataset) MarshalJSON() ([]byte, error) { + type wrapper CouchbaseTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CouchbaseTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CouchbaseTableDataset: %+v", err) + } + + decoded["type"] = "CouchbaseTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CouchbaseTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CouchbaseTableDataset{} + +func (s *CouchbaseTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CouchbaseTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'CouchbaseTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_credentialreference.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_credentialreference.go new file mode 100644 index 00000000000..ab48e86622f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_credentialreference.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CredentialReference struct { + ReferenceName string `json:"referenceName"` + Type CredentialReferenceType `json:"type"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customdataset.go new file mode 100644 index 00000000000..d5a4633103c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = CustomDataset{} + +type CustomDataset struct { + TypeProperties *interface{} `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s CustomDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = CustomDataset{} + +func (s CustomDataset) MarshalJSON() ([]byte, error) { + type wrapper CustomDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CustomDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CustomDataset: %+v", err) + } + + decoded["type"] = "CustomDataset" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CustomDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CustomDataset{} + +func (s *CustomDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *interface{} `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CustomDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'CustomDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customdatasourcelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customdatasourcelinkedservice.go new file mode 100644 index 00000000000..d2dc75aba0d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customdatasourcelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = CustomDataSourceLinkedService{} + +type CustomDataSourceLinkedService struct { + TypeProperties interface{} `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s CustomDataSourceLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = CustomDataSourceLinkedService{} + +func (s CustomDataSourceLinkedService) MarshalJSON() ([]byte, error) { + type wrapper CustomDataSourceLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CustomDataSourceLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CustomDataSourceLinkedService: %+v", err) + } + + decoded["type"] = "CustomDataSource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CustomDataSourceLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &CustomDataSourceLinkedService{} + +func (s *CustomDataSourceLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties interface{} `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CustomDataSourceLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'CustomDataSourceLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customsetupbase.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customsetupbase.go new file mode 100644 index 00000000000..d5fc2689cfc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_customsetupbase.go @@ -0,0 +1,99 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CustomSetupBase interface { + CustomSetupBase() BaseCustomSetupBaseImpl +} + +var _ CustomSetupBase = BaseCustomSetupBaseImpl{} + +type BaseCustomSetupBaseImpl struct { + Type string `json:"type"` +} + +func (s BaseCustomSetupBaseImpl) CustomSetupBase() BaseCustomSetupBaseImpl { + return s +} + +var _ CustomSetupBase = RawCustomSetupBaseImpl{} + +// RawCustomSetupBaseImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCustomSetupBaseImpl struct { + customSetupBase BaseCustomSetupBaseImpl + Type string + Values map[string]interface{} +} + +func (s RawCustomSetupBaseImpl) CustomSetupBase() BaseCustomSetupBaseImpl { + return s.customSetupBase +} + +func UnmarshalCustomSetupBaseImplementation(input []byte) (CustomSetupBase, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CustomSetupBase into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AzPowerShellSetup") { + var out AzPowerShellSetup + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzPowerShellSetup: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CmdkeySetup") { + var out CmdkeySetup + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CmdkeySetup: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ComponentSetup") { + var out ComponentSetup + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ComponentSetup: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "EnvironmentVariableSetup") { + var out EnvironmentVariableSetup + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into EnvironmentVariableSetup: %+v", err) + } + return out, nil + } + + var parent BaseCustomSetupBaseImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCustomSetupBaseImpl: %+v", err) + } + + return RawCustomSetupBaseImpl{ + customSetupBase: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflow.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflow.go index 896d04ee5a9..655cac9c4c4 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflow.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflow.go @@ -1,11 +1,94 @@ package dataflowdebugsession +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DataFlow struct { +type DataFlow interface { + DataFlow() BaseDataFlowImpl +} + +var _ DataFlow = BaseDataFlowImpl{} + +type BaseDataFlowImpl struct { Annotations *[]interface{} `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` Folder *DataFlowFolder `json:"folder,omitempty"` Type string `json:"type"` } + +func (s BaseDataFlowImpl) DataFlow() BaseDataFlowImpl { + return s +} + +var _ DataFlow = RawDataFlowImpl{} + +// RawDataFlowImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawDataFlowImpl struct { + dataFlow BaseDataFlowImpl + Type string + Values map[string]interface{} +} + +func (s RawDataFlowImpl) DataFlow() BaseDataFlowImpl { + return s.dataFlow +} + +func UnmarshalDataFlowImplementation(input []byte) (DataFlow, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling DataFlow into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Flowlet") { + var out Flowlet + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into Flowlet: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MappingDataFlow") { + var out MappingDataFlow + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MappingDataFlow: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "WranglingDataFlow") { + var out WranglingDataFlow + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into WranglingDataFlow: %+v", err) + } + return out, nil + } + + var parent BaseDataFlowImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseDataFlowImpl: %+v", err) + } + + return RawDataFlowImpl{ + dataFlow: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowdebugresource.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowdebugresource.go index ba3238f8128..052ee687def 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowdebugresource.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowdebugresource.go @@ -1,5 +1,10 @@ package dataflowdebugsession +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -7,3 +12,31 @@ type DataFlowDebugResource struct { Name *string `json:"name,omitempty"` Properties DataFlow `json:"properties"` } + +var _ json.Unmarshaler = &DataFlowDebugResource{} + +func (s *DataFlowDebugResource) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Name *string `json:"name,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Name = decoded.Name + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DataFlowDebugResource into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalDataFlowImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'DataFlowDebugResource': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowreference.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowreference.go new file mode 100644 index 00000000000..e180712d7f2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowreference.go @@ -0,0 +1,11 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataFlowReference struct { + DatasetParameters *interface{} `json:"datasetParameters,omitempty"` + Parameters *map[string]interface{} `json:"parameters,omitempty"` + ReferenceName string `json:"referenceName"` + Type DataFlowReferenceType `json:"type"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowsink.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowsink.go new file mode 100644 index 00000000000..e515c3a87b7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowsink.go @@ -0,0 +1,14 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataFlowSink struct { + Dataset *DatasetReference `json:"dataset,omitempty"` + Description *string `json:"description,omitempty"` + Flowlet *DataFlowReference `json:"flowlet,omitempty"` + LinkedService *LinkedServiceReference `json:"linkedService,omitempty"` + Name string `json:"name"` + RejectedDataLinkedService *LinkedServiceReference `json:"rejectedDataLinkedService,omitempty"` + SchemaLinkedService *LinkedServiceReference `json:"schemaLinkedService,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowsource.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowsource.go new file mode 100644 index 00000000000..9fc69eacdef --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataflowsource.go @@ -0,0 +1,13 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataFlowSource struct { + Dataset *DatasetReference `json:"dataset,omitempty"` + Description *string `json:"description,omitempty"` + Flowlet *DataFlowReference `json:"flowlet,omitempty"` + LinkedService *LinkedServiceReference `json:"linkedService,omitempty"` + Name string `json:"name"` + SchemaLinkedService *LinkedServiceReference `json:"schemaLinkedService,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataset.go index 70432c536ad..6a662edc00f 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataset.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataset.go @@ -3,12 +3,19 @@ package dataflowdebugsession import ( "encoding/json" "fmt" + "strings" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type Dataset struct { +type Dataset interface { + Dataset() BaseDatasetImpl +} + +var _ Dataset = BaseDatasetImpl{} + +type BaseDatasetImpl struct { Annotations *[]interface{} `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` Folder *DatasetFolder `json:"folder,omitempty"` @@ -19,9 +26,28 @@ type Dataset struct { Type string `json:"type"` } -var _ json.Unmarshaler = &Dataset{} +func (s BaseDatasetImpl) Dataset() BaseDatasetImpl { + return s +} + +var _ Dataset = RawDatasetImpl{} -func (s *Dataset) UnmarshalJSON(bytes []byte) error { +// RawDatasetImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawDatasetImpl struct { + dataset BaseDatasetImpl + Type string + Values map[string]interface{} +} + +func (s RawDatasetImpl) Dataset() BaseDatasetImpl { + return s.dataset +} + +var _ json.Unmarshaler = &BaseDatasetImpl{} + +func (s *BaseDatasetImpl) UnmarshalJSON(bytes []byte) error { var decoded struct { Annotations *[]interface{} `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` @@ -45,16 +71,884 @@ func (s *Dataset) UnmarshalJSON(bytes []byte) error { var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling Dataset into map[string]json.RawMessage: %+v", err) + return fmt.Errorf("unmarshaling BaseDatasetImpl into map[string]json.RawMessage: %+v", err) } if v, ok := temp["linkedServiceName"]; ok { impl, err := UnmarshalReferenceImplementation(v) if err != nil { - return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'Dataset': %+v", err) + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'BaseDatasetImpl': %+v", err) } s.LinkedServiceName = impl } return nil } + +func UnmarshalDatasetImplementation(input []byte) (Dataset, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling Dataset into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AmazonMWSObject") { + var out AmazonMWSObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonMWSObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonRdsForOracleTable") { + var out AmazonRdsForOracleTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonRdsForOracleTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonRdsForSqlServerTable") { + var out AmazonRdsForSqlServerTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonRdsForSqlServerTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonRedshiftTable") { + var out AmazonRedshiftTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonRedshiftTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonS3Object") { + var out AmazonS3Dataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonS3Dataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Avro") { + var out AvroDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AvroDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureBlob") { + var out AzureBlobDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureBlobDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureBlobFSFile") { + var out AzureBlobFSDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureBlobFSDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDataExplorerTable") { + var out AzureDataExplorerTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDataExplorerTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDataLakeStoreFile") { + var out AzureDataLakeStoreDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDataLakeStoreDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDatabricksDeltaLakeDataset") { + var out AzureDatabricksDeltaLakeDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDatabricksDeltaLakeDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureMariaDBTable") { + var out AzureMariaDBTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureMariaDBTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureMySqlTable") { + var out AzureMySqlTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureMySqlTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzurePostgreSqlTable") { + var out AzurePostgreSqlTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzurePostgreSqlTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSearchIndex") { + var out AzureSearchIndexDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSearchIndexDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSqlDWTable") { + var out AzureSqlDWTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSqlDWTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSqlMITable") { + var out AzureSqlMITableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSqlMITableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSqlTable") { + var out AzureSqlTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSqlTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureTable") { + var out AzureTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Binary") { + var out BinaryDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into BinaryDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CassandraTable") { + var out CassandraTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CassandraTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CommonDataServiceForAppsEntity") { + var out CommonDataServiceForAppsEntityDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CommonDataServiceForAppsEntityDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConcurObject") { + var out ConcurObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConcurObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CosmosDbMongoDbApiCollection") { + var out CosmosDbMongoDbApiCollectionDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CosmosDbMongoDbApiCollectionDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CosmosDbSqlApiCollection") { + var out CosmosDbSqlApiCollectionDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CosmosDbSqlApiCollectionDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CouchbaseTable") { + var out CouchbaseTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CouchbaseTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CustomDataset") { + var out CustomDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CustomDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Db2Table") { + var out Db2TableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into Db2TableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DelimitedText") { + var out DelimitedTextDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DelimitedTextDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DocumentDbCollection") { + var out DocumentDbCollectionDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DocumentDbCollectionDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DrillTable") { + var out DrillTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DrillTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DynamicsAXResource") { + var out DynamicsAXResourceDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DynamicsAXResourceDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DynamicsCrmEntity") { + var out DynamicsCrmEntityDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DynamicsCrmEntityDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DynamicsEntity") { + var out DynamicsEntityDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DynamicsEntityDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "EloquaObject") { + var out EloquaObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into EloquaObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Excel") { + var out ExcelDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ExcelDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileShare") { + var out FileShareDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileShareDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleAdWordsObject") { + var out GoogleAdWordsObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleAdWordsObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleBigQueryObject") { + var out GoogleBigQueryObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleBigQueryObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleBigQueryV2Object") { + var out GoogleBigQueryV2ObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleBigQueryV2ObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GreenplumTable") { + var out GreenplumTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GreenplumTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HBaseObject") { + var out HBaseObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HBaseObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HttpFile") { + var out HTTPDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HTTPDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HiveObject") { + var out HiveObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HiveObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HubspotObject") { + var out HubspotObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HubspotObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Iceberg") { + var out IcebergDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IcebergDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ImpalaObject") { + var out ImpalaObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ImpalaObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "InformixTable") { + var out InformixTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into InformixTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "JiraObject") { + var out JiraObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into JiraObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Json") { + var out JsonDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into JsonDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LakeHouseTable") { + var out LakeHouseTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into LakeHouseTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MagentoObject") { + var out MagentoObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MagentoObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MariaDBTable") { + var out MariaDBTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MariaDBTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MarketoObject") { + var out MarketoObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MarketoObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MicrosoftAccessTable") { + var out MicrosoftAccessTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MicrosoftAccessTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbAtlasCollection") { + var out MongoDbAtlasCollectionDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbAtlasCollectionDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbCollection") { + var out MongoDbCollectionDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbV2Collection") { + var out MongoDbV2CollectionDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbV2CollectionDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlTable") { + var out MySqlTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "NetezzaTable") { + var out NetezzaTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into NetezzaTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ODataResource") { + var out ODataResourceDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ODataResourceDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OdbcTable") { + var out OdbcTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OdbcTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Office365Table") { + var out Office365Dataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into Office365Dataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleServiceCloudObject") { + var out OracleServiceCloudObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleServiceCloudObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleTable") { + var out OracleTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Orc") { + var out OrcDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OrcDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Parquet") { + var out ParquetDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ParquetDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PaypalObject") { + var out PaypalObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PaypalObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PhoenixObject") { + var out PhoenixObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PhoenixObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlTable") { + var out PostgreSqlTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlV2Table") { + var out PostgreSqlV2TableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlV2TableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PrestoObject") { + var out PrestoObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PrestoObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "QuickBooksObject") { + var out QuickBooksObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into QuickBooksObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RelationalTable") { + var out RelationalTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RelationalTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ResponsysObject") { + var out ResponsysObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ResponsysObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RestResource") { + var out RestResourceDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RestResourceDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceMarketingCloudObject") { + var out SalesforceMarketingCloudObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceMarketingCloudObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceObject") { + var out SalesforceObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceServiceCloudObject") { + var out SalesforceServiceCloudObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceServiceCloudObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceServiceCloudV2Object") { + var out SalesforceServiceCloudV2ObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceServiceCloudV2ObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceV2Object") { + var out SalesforceV2ObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceV2ObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapBwCube") { + var out SapBwCubeDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapBwCubeDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapCloudForCustomerResource") { + var out SapCloudForCustomerResourceDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapCloudForCustomerResourceDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapEccResource") { + var out SapEccResourceDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapEccResourceDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapHanaTable") { + var out SapHanaTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapHanaTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapOdpResource") { + var out SapOdpResourceDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapOdpResourceDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapOpenHubTable") { + var out SapOpenHubTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapOpenHubTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapTableResource") { + var out SapTableResourceDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapTableResourceDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ServiceNowObject") { + var out ServiceNowObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ServiceNowObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ServiceNowV2Object") { + var out ServiceNowV2ObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ServiceNowV2ObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SharePointOnlineListResource") { + var out SharePointOnlineListResourceDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SharePointOnlineListResourceDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ShopifyObject") { + var out ShopifyObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ShopifyObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SnowflakeTable") { + var out SnowflakeDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SnowflakeDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SnowflakeV2Table") { + var out SnowflakeV2Dataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SnowflakeV2Dataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SparkObject") { + var out SparkObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SparkObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlServerTable") { + var out SqlServerTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlServerTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SquareObject") { + var out SquareObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SquareObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SybaseTable") { + var out SybaseTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SybaseTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TeradataTable") { + var out TeradataTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into TeradataTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VerticaTable") { + var out VerticaTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VerticaTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "WarehouseTable") { + var out WarehouseTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into WarehouseTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "WebTable") { + var out WebTableDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into WebTableDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "XeroObject") { + var out XeroObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into XeroObjectDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Xml") { + var out XmlDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into XmlDataset: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ZohoObject") { + var out ZohoObjectDataset + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ZohoObjectDataset: %+v", err) + } + return out, nil + } + + var parent BaseDatasetImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseDatasetImpl: %+v", err) + } + + return RawDatasetImpl{ + dataset: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetcompression.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetcompression.go new file mode 100644 index 00000000000..614d6bbe532 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetcompression.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatasetCompression struct { + Level *string `json:"level,omitempty"` + Type string `json:"type"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetdebugresource.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetdebugresource.go index c50e9958741..d7a9f474f3d 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetdebugresource.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetdebugresource.go @@ -1,5 +1,10 @@ package dataflowdebugsession +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -7,3 +12,31 @@ type DatasetDebugResource struct { Name *string `json:"name,omitempty"` Properties Dataset `json:"properties"` } + +var _ json.Unmarshaler = &DatasetDebugResource{} + +func (s *DatasetDebugResource) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Name *string `json:"name,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Name = decoded.Name + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DatasetDebugResource into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalDatasetImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'DatasetDebugResource': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetlocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetlocation.go new file mode 100644 index 00000000000..6a4e229ba77 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetlocation.go @@ -0,0 +1,181 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatasetLocation interface { + DatasetLocation() BaseDatasetLocationImpl +} + +var _ DatasetLocation = BaseDatasetLocationImpl{} + +type BaseDatasetLocationImpl struct { + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s BaseDatasetLocationImpl) DatasetLocation() BaseDatasetLocationImpl { + return s +} + +var _ DatasetLocation = RawDatasetLocationImpl{} + +// RawDatasetLocationImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawDatasetLocationImpl struct { + datasetLocation BaseDatasetLocationImpl + Type string + Values map[string]interface{} +} + +func (s RawDatasetLocationImpl) DatasetLocation() BaseDatasetLocationImpl { + return s.datasetLocation +} + +func UnmarshalDatasetLocationImplementation(input []byte) (DatasetLocation, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling DatasetLocation into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AmazonS3CompatibleLocation") { + var out AmazonS3CompatibleLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonS3CompatibleLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonS3Location") { + var out AmazonS3Location + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonS3Location: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureBlobFSLocation") { + var out AzureBlobFSLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureBlobFSLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureBlobStorageLocation") { + var out AzureBlobStorageLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureBlobStorageLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDataLakeStoreLocation") { + var out AzureDataLakeStoreLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDataLakeStoreLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureFileStorageLocation") { + var out AzureFileStorageLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureFileStorageLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileServerLocation") { + var out FileServerLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileServerLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FtpServerLocation") { + var out FtpServerLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FtpServerLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleCloudStorageLocation") { + var out GoogleCloudStorageLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleCloudStorageLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HttpServerLocation") { + var out HTTPServerLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HTTPServerLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HdfsLocation") { + var out HdfsLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HdfsLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LakeHouseLocation") { + var out LakeHouseLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into LakeHouseLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleCloudStorageLocation") { + var out OracleCloudStorageLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleCloudStorageLocation: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SftpLocation") { + var out SftpLocation + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SftpLocation: %+v", err) + } + return out, nil + } + + var parent BaseDatasetLocationImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseDatasetLocationImpl: %+v", err) + } + + return RawDatasetLocationImpl{ + datasetLocation: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetreference.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetreference.go new file mode 100644 index 00000000000..185398c9450 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetreference.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatasetReference struct { + Parameters *map[string]interface{} `json:"parameters,omitempty"` + ReferenceName string `json:"referenceName"` + Type DatasetReferenceType `json:"type"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetstorageformat.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetstorageformat.go new file mode 100644 index 00000000000..98feec289b0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_datasetstorageformat.go @@ -0,0 +1,109 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatasetStorageFormat interface { + DatasetStorageFormat() BaseDatasetStorageFormatImpl +} + +var _ DatasetStorageFormat = BaseDatasetStorageFormatImpl{} + +type BaseDatasetStorageFormatImpl struct { + Deserializer *string `json:"deserializer,omitempty"` + Serializer *string `json:"serializer,omitempty"` + Type string `json:"type"` +} + +func (s BaseDatasetStorageFormatImpl) DatasetStorageFormat() BaseDatasetStorageFormatImpl { + return s +} + +var _ DatasetStorageFormat = RawDatasetStorageFormatImpl{} + +// RawDatasetStorageFormatImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawDatasetStorageFormatImpl struct { + datasetStorageFormat BaseDatasetStorageFormatImpl + Type string + Values map[string]interface{} +} + +func (s RawDatasetStorageFormatImpl) DatasetStorageFormat() BaseDatasetStorageFormatImpl { + return s.datasetStorageFormat +} + +func UnmarshalDatasetStorageFormatImplementation(input []byte) (DatasetStorageFormat, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling DatasetStorageFormat into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AvroFormat") { + var out AvroFormat + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AvroFormat: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "JsonFormat") { + var out JsonFormat + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into JsonFormat: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OrcFormat") { + var out OrcFormat + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OrcFormat: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ParquetFormat") { + var out ParquetFormat + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ParquetFormat: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TextFormat") { + var out TextFormat + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into TextFormat: %+v", err) + } + return out, nil + } + + var parent BaseDatasetStorageFormatImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseDatasetStorageFormatImpl: %+v", err) + } + + return RawDatasetStorageFormatImpl{ + datasetStorageFormat: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataworldlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataworldlinkedservice.go new file mode 100644 index 00000000000..21bd79677c8 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataworldlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = DataworldLinkedService{} + +type DataworldLinkedService struct { + TypeProperties DataworldLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s DataworldLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = DataworldLinkedService{} + +func (s DataworldLinkedService) MarshalJSON() ([]byte, error) { + type wrapper DataworldLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DataworldLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DataworldLinkedService: %+v", err) + } + + decoded["type"] = "Dataworld" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DataworldLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DataworldLinkedService{} + +func (s *DataworldLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties DataworldLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DataworldLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'DataworldLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataworldlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataworldlinkedservicetypeproperties.go new file mode 100644 index 00000000000..c490eba6f0f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dataworldlinkedservicetypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataworldLinkedServiceTypeProperties struct { + ApiToken SecretBase `json:"apiToken"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` +} + +var _ json.Unmarshaler = &DataworldLinkedServiceTypeProperties{} + +func (s *DataworldLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DataworldLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["apiToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ApiToken' for 'DataworldLinkedServiceTypeProperties': %+v", err) + } + s.ApiToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2linkedservice.go new file mode 100644 index 00000000000..dd35dba70fa --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = Db2LinkedService{} + +type Db2LinkedService struct { + TypeProperties Db2LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s Db2LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = Db2LinkedService{} + +func (s Db2LinkedService) MarshalJSON() ([]byte, error) { + type wrapper Db2LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling Db2LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling Db2LinkedService: %+v", err) + } + + decoded["type"] = "Db2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling Db2LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &Db2LinkedService{} + +func (s *Db2LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties Db2LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling Db2LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'Db2LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2linkedservicetypeproperties.go new file mode 100644 index 00000000000..ba15fd7b050 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2linkedservicetypeproperties.go @@ -0,0 +1,63 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Db2LinkedServiceTypeProperties struct { + AuthenticationType *Db2AuthenticationType `json:"authenticationType,omitempty"` + CertificateCommonName *string `json:"certificateCommonName,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Database *string `json:"database,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + PackageCollection *string `json:"packageCollection,omitempty"` + Password SecretBase `json:"password"` + Server *string `json:"server,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &Db2LinkedServiceTypeProperties{} + +func (s *Db2LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *Db2AuthenticationType `json:"authenticationType,omitempty"` + CertificateCommonName *string `json:"certificateCommonName,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Database *string `json:"database,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + PackageCollection *string `json:"packageCollection,omitempty"` + Server *string `json:"server,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.CertificateCommonName = decoded.CertificateCommonName + s.ConnectionString = decoded.ConnectionString + s.Database = decoded.Database + s.EncryptedCredential = decoded.EncryptedCredential + s.PackageCollection = decoded.PackageCollection + s.Server = decoded.Server + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling Db2LinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'Db2LinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2tabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2tabledataset.go new file mode 100644 index 00000000000..66909d628ca --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2tabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = Db2TableDataset{} + +type Db2TableDataset struct { + TypeProperties *Db2TableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s Db2TableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = Db2TableDataset{} + +func (s Db2TableDataset) MarshalJSON() ([]byte, error) { + type wrapper Db2TableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling Db2TableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling Db2TableDataset: %+v", err) + } + + decoded["type"] = "Db2Table" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling Db2TableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &Db2TableDataset{} + +func (s *Db2TableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *Db2TableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling Db2TableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'Db2TableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2tabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2tabledatasettypeproperties.go new file mode 100644 index 00000000000..0c8ab8eba0a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_db2tabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Db2TableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_delimitedtextdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_delimitedtextdataset.go new file mode 100644 index 00000000000..eb231bb3508 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_delimitedtextdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = DelimitedTextDataset{} + +type DelimitedTextDataset struct { + TypeProperties *DelimitedTextDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s DelimitedTextDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = DelimitedTextDataset{} + +func (s DelimitedTextDataset) MarshalJSON() ([]byte, error) { + type wrapper DelimitedTextDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DelimitedTextDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DelimitedTextDataset: %+v", err) + } + + decoded["type"] = "DelimitedText" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DelimitedTextDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DelimitedTextDataset{} + +func (s *DelimitedTextDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *DelimitedTextDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DelimitedTextDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'DelimitedTextDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_delimitedtextdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_delimitedtextdatasettypeproperties.go new file mode 100644 index 00000000000..b121591b2e9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_delimitedtextdatasettypeproperties.go @@ -0,0 +1,66 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DelimitedTextDatasetTypeProperties struct { + ColumnDelimiter *string `json:"columnDelimiter,omitempty"` + CompressionCodec *string `json:"compressionCodec,omitempty"` + CompressionLevel *string `json:"compressionLevel,omitempty"` + EncodingName *string `json:"encodingName,omitempty"` + EscapeChar *string `json:"escapeChar,omitempty"` + FirstRowAsHeader *bool `json:"firstRowAsHeader,omitempty"` + Location DatasetLocation `json:"location"` + NullValue *string `json:"nullValue,omitempty"` + QuoteChar *string `json:"quoteChar,omitempty"` + RowDelimiter *string `json:"rowDelimiter,omitempty"` +} + +var _ json.Unmarshaler = &DelimitedTextDatasetTypeProperties{} + +func (s *DelimitedTextDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ColumnDelimiter *string `json:"columnDelimiter,omitempty"` + CompressionCodec *string `json:"compressionCodec,omitempty"` + CompressionLevel *string `json:"compressionLevel,omitempty"` + EncodingName *string `json:"encodingName,omitempty"` + EscapeChar *string `json:"escapeChar,omitempty"` + FirstRowAsHeader *bool `json:"firstRowAsHeader,omitempty"` + NullValue *string `json:"nullValue,omitempty"` + QuoteChar *string `json:"quoteChar,omitempty"` + RowDelimiter *string `json:"rowDelimiter,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ColumnDelimiter = decoded.ColumnDelimiter + s.CompressionCodec = decoded.CompressionCodec + s.CompressionLevel = decoded.CompressionLevel + s.EncodingName = decoded.EncodingName + s.EscapeChar = decoded.EscapeChar + s.FirstRowAsHeader = decoded.FirstRowAsHeader + s.NullValue = decoded.NullValue + s.QuoteChar = decoded.QuoteChar + s.RowDelimiter = decoded.RowDelimiter + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DelimitedTextDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'DelimitedTextDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_documentdbcollectiondataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_documentdbcollectiondataset.go new file mode 100644 index 00000000000..e788faf5046 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_documentdbcollectiondataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = DocumentDbCollectionDataset{} + +type DocumentDbCollectionDataset struct { + TypeProperties DocumentDbCollectionDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s DocumentDbCollectionDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = DocumentDbCollectionDataset{} + +func (s DocumentDbCollectionDataset) MarshalJSON() ([]byte, error) { + type wrapper DocumentDbCollectionDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DocumentDbCollectionDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DocumentDbCollectionDataset: %+v", err) + } + + decoded["type"] = "DocumentDbCollection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DocumentDbCollectionDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DocumentDbCollectionDataset{} + +func (s *DocumentDbCollectionDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties DocumentDbCollectionDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DocumentDbCollectionDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'DocumentDbCollectionDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_documentdbcollectiondatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_documentdbcollectiondatasettypeproperties.go new file mode 100644 index 00000000000..771b3018665 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_documentdbcollectiondatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DocumentDbCollectionDatasetTypeProperties struct { + CollectionName string `json:"collectionName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilldatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilldatasettypeproperties.go new file mode 100644 index 00000000000..4d1a458dfa8 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilldatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DrillDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilllinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilllinkedservice.go new file mode 100644 index 00000000000..98ed1ce182e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilllinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = DrillLinkedService{} + +type DrillLinkedService struct { + TypeProperties DrillLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s DrillLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = DrillLinkedService{} + +func (s DrillLinkedService) MarshalJSON() ([]byte, error) { + type wrapper DrillLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DrillLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DrillLinkedService: %+v", err) + } + + decoded["type"] = "Drill" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DrillLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DrillLinkedService{} + +func (s *DrillLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties DrillLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DrillLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'DrillLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilllinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilllinkedservicetypeproperties.go new file mode 100644 index 00000000000..1b4e74258e6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilllinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DrillLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Pwd *AzureKeyVaultSecretReference `json:"pwd,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilltabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilltabledataset.go new file mode 100644 index 00000000000..ef81b9841a5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_drilltabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = DrillTableDataset{} + +type DrillTableDataset struct { + TypeProperties *DrillDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s DrillTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = DrillTableDataset{} + +func (s DrillTableDataset) MarshalJSON() ([]byte, error) { + type wrapper DrillTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DrillTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DrillTableDataset: %+v", err) + } + + decoded["type"] = "DrillTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DrillTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DrillTableDataset{} + +func (s *DrillTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *DrillDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DrillTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'DrillTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxlinkedservice.go new file mode 100644 index 00000000000..7bd072b1da1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = DynamicsAXLinkedService{} + +type DynamicsAXLinkedService struct { + TypeProperties DynamicsAXLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s DynamicsAXLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = DynamicsAXLinkedService{} + +func (s DynamicsAXLinkedService) MarshalJSON() ([]byte, error) { + type wrapper DynamicsAXLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DynamicsAXLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DynamicsAXLinkedService: %+v", err) + } + + decoded["type"] = "DynamicsAX" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DynamicsAXLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DynamicsAXLinkedService{} + +func (s *DynamicsAXLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties DynamicsAXLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsAXLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'DynamicsAXLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxlinkedservicetypeproperties.go new file mode 100644 index 00000000000..56116348f50 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxlinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DynamicsAXLinkedServiceTypeProperties struct { + AadResourceId string `json:"aadResourceId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalId string `json:"servicePrincipalId"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant string `json:"tenant"` + Url string `json:"url"` +} + +var _ json.Unmarshaler = &DynamicsAXLinkedServiceTypeProperties{} + +func (s *DynamicsAXLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AadResourceId string `json:"aadResourceId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalId string `json:"servicePrincipalId"` + Tenant string `json:"tenant"` + Url string `json:"url"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AadResourceId = decoded.AadResourceId + s.EncryptedCredential = decoded.EncryptedCredential + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.Url = decoded.Url + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsAXLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'DynamicsAXLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxresourcedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxresourcedataset.go new file mode 100644 index 00000000000..aa1b516acd8 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxresourcedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = DynamicsAXResourceDataset{} + +type DynamicsAXResourceDataset struct { + TypeProperties DynamicsAXResourceDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s DynamicsAXResourceDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = DynamicsAXResourceDataset{} + +func (s DynamicsAXResourceDataset) MarshalJSON() ([]byte, error) { + type wrapper DynamicsAXResourceDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DynamicsAXResourceDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DynamicsAXResourceDataset: %+v", err) + } + + decoded["type"] = "DynamicsAXResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DynamicsAXResourceDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DynamicsAXResourceDataset{} + +func (s *DynamicsAXResourceDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties DynamicsAXResourceDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsAXResourceDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'DynamicsAXResourceDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxresourcedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxresourcedatasettypeproperties.go new file mode 100644 index 00000000000..f85d225339a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsaxresourcedatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DynamicsAXResourceDatasetTypeProperties struct { + Path string `json:"path"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmentitydataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmentitydataset.go new file mode 100644 index 00000000000..d67f486420e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmentitydataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = DynamicsCrmEntityDataset{} + +type DynamicsCrmEntityDataset struct { + TypeProperties *DynamicsCrmEntityDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s DynamicsCrmEntityDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = DynamicsCrmEntityDataset{} + +func (s DynamicsCrmEntityDataset) MarshalJSON() ([]byte, error) { + type wrapper DynamicsCrmEntityDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DynamicsCrmEntityDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DynamicsCrmEntityDataset: %+v", err) + } + + decoded["type"] = "DynamicsCrmEntity" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DynamicsCrmEntityDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DynamicsCrmEntityDataset{} + +func (s *DynamicsCrmEntityDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *DynamicsCrmEntityDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsCrmEntityDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'DynamicsCrmEntityDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmentitydatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmentitydatasettypeproperties.go new file mode 100644 index 00000000000..6c08a4aae34 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmentitydatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DynamicsCrmEntityDatasetTypeProperties struct { + EntityName *string `json:"entityName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmlinkedservice.go new file mode 100644 index 00000000000..a7cf963acdc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = DynamicsCrmLinkedService{} + +type DynamicsCrmLinkedService struct { + TypeProperties DynamicsCrmLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s DynamicsCrmLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = DynamicsCrmLinkedService{} + +func (s DynamicsCrmLinkedService) MarshalJSON() ([]byte, error) { + type wrapper DynamicsCrmLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DynamicsCrmLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DynamicsCrmLinkedService: %+v", err) + } + + decoded["type"] = "DynamicsCrm" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DynamicsCrmLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DynamicsCrmLinkedService{} + +func (s *DynamicsCrmLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties DynamicsCrmLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsCrmLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'DynamicsCrmLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmlinkedservicetypeproperties.go new file mode 100644 index 00000000000..6b4d4270395 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicscrmlinkedservicetypeproperties.go @@ -0,0 +1,84 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DynamicsCrmLinkedServiceTypeProperties struct { + AuthenticationType string `json:"authenticationType"` + Credential *CredentialReference `json:"credential,omitempty"` + DeploymentType string `json:"deploymentType"` + Domain *string `json:"domain,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HostName *string `json:"hostName,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServiceUri *string `json:"serviceUri,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &DynamicsCrmLinkedServiceTypeProperties{} + +func (s *DynamicsCrmLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType string `json:"authenticationType"` + Credential *CredentialReference `json:"credential,omitempty"` + DeploymentType string `json:"deploymentType"` + Domain *string `json:"domain,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HostName *string `json:"hostName,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + Port *int64 `json:"port,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServiceUri *string `json:"serviceUri,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.Credential = decoded.Credential + s.DeploymentType = decoded.DeploymentType + s.Domain = decoded.Domain + s.EncryptedCredential = decoded.EncryptedCredential + s.HostName = decoded.HostName + s.OrganizationName = decoded.OrganizationName + s.Port = decoded.Port + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.ServiceUri = decoded.ServiceUri + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsCrmLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'DynamicsCrmLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'DynamicsCrmLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsentitydataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsentitydataset.go new file mode 100644 index 00000000000..cdff5643c06 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsentitydataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = DynamicsEntityDataset{} + +type DynamicsEntityDataset struct { + TypeProperties *DynamicsEntityDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s DynamicsEntityDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = DynamicsEntityDataset{} + +func (s DynamicsEntityDataset) MarshalJSON() ([]byte, error) { + type wrapper DynamicsEntityDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DynamicsEntityDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DynamicsEntityDataset: %+v", err) + } + + decoded["type"] = "DynamicsEntity" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DynamicsEntityDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DynamicsEntityDataset{} + +func (s *DynamicsEntityDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *DynamicsEntityDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsEntityDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'DynamicsEntityDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsentitydatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsentitydatasettypeproperties.go new file mode 100644 index 00000000000..6e55a34c103 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicsentitydatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DynamicsEntityDatasetTypeProperties struct { + EntityName *string `json:"entityName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicslinkedservice.go new file mode 100644 index 00000000000..268e7c7bcaf --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = DynamicsLinkedService{} + +type DynamicsLinkedService struct { + TypeProperties DynamicsLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s DynamicsLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = DynamicsLinkedService{} + +func (s DynamicsLinkedService) MarshalJSON() ([]byte, error) { + type wrapper DynamicsLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DynamicsLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DynamicsLinkedService: %+v", err) + } + + decoded["type"] = "Dynamics" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DynamicsLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &DynamicsLinkedService{} + +func (s *DynamicsLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties DynamicsLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'DynamicsLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicslinkedservicetypeproperties.go new file mode 100644 index 00000000000..dbf9d70af37 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_dynamicslinkedservicetypeproperties.go @@ -0,0 +1,84 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DynamicsLinkedServiceTypeProperties struct { + AuthenticationType string `json:"authenticationType"` + Credential *CredentialReference `json:"credential,omitempty"` + DeploymentType string `json:"deploymentType"` + Domain *string `json:"domain,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HostName *string `json:"hostName,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServiceUri *string `json:"serviceUri,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &DynamicsLinkedServiceTypeProperties{} + +func (s *DynamicsLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType string `json:"authenticationType"` + Credential *CredentialReference `json:"credential,omitempty"` + DeploymentType string `json:"deploymentType"` + Domain *string `json:"domain,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HostName *string `json:"hostName,omitempty"` + OrganizationName *string `json:"organizationName,omitempty"` + Port *int64 `json:"port,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServiceUri *string `json:"serviceUri,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.Credential = decoded.Credential + s.DeploymentType = decoded.DeploymentType + s.Domain = decoded.Domain + s.EncryptedCredential = decoded.EncryptedCredential + s.HostName = decoded.HostName + s.OrganizationName = decoded.OrganizationName + s.Port = decoded.Port + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.ServiceUri = decoded.ServiceUri + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling DynamicsLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'DynamicsLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'DynamicsLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloqualinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloqualinkedservice.go new file mode 100644 index 00000000000..0e5287ecc49 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloqualinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = EloquaLinkedService{} + +type EloquaLinkedService struct { + TypeProperties EloquaLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s EloquaLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = EloquaLinkedService{} + +func (s EloquaLinkedService) MarshalJSON() ([]byte, error) { + type wrapper EloquaLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling EloquaLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling EloquaLinkedService: %+v", err) + } + + decoded["type"] = "Eloqua" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling EloquaLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &EloquaLinkedService{} + +func (s *EloquaLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties EloquaLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling EloquaLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'EloquaLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloqualinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloqualinkedservicetypeproperties.go new file mode 100644 index 00000000000..5197b33a846 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloqualinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EloquaLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + Password SecretBase `json:"password"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username string `json:"username"` +} + +var _ json.Unmarshaler = &EloquaLinkedServiceTypeProperties{} + +func (s *EloquaLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username string `json:"username"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling EloquaLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'EloquaLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloquaobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloquaobjectdataset.go new file mode 100644 index 00000000000..91d9695ac6c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_eloquaobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = EloquaObjectDataset{} + +type EloquaObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s EloquaObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = EloquaObjectDataset{} + +func (s EloquaObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper EloquaObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling EloquaObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling EloquaObjectDataset: %+v", err) + } + + decoded["type"] = "EloquaObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling EloquaObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &EloquaObjectDataset{} + +func (s *EloquaObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling EloquaObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'EloquaObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_entityreference.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_entityreference.go new file mode 100644 index 00000000000..85b02c220d3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_entityreference.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EntityReference struct { + ReferenceName *string `json:"referenceName,omitempty"` + Type *IntegrationRuntimeEntityReferenceType `json:"type,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_environmentvariablesetup.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_environmentvariablesetup.go new file mode 100644 index 00000000000..e43724d8a57 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_environmentvariablesetup.go @@ -0,0 +1,50 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CustomSetupBase = EnvironmentVariableSetup{} + +type EnvironmentVariableSetup struct { + TypeProperties EnvironmentVariableSetupTypeProperties `json:"typeProperties"` + + // Fields inherited from CustomSetupBase + + Type string `json:"type"` +} + +func (s EnvironmentVariableSetup) CustomSetupBase() BaseCustomSetupBaseImpl { + return BaseCustomSetupBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = EnvironmentVariableSetup{} + +func (s EnvironmentVariableSetup) MarshalJSON() ([]byte, error) { + type wrapper EnvironmentVariableSetup + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling EnvironmentVariableSetup: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling EnvironmentVariableSetup: %+v", err) + } + + decoded["type"] = "EnvironmentVariableSetup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling EnvironmentVariableSetup: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_environmentvariablesetuptypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_environmentvariablesetuptypeproperties.go new file mode 100644 index 00000000000..9adc126ec7a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_environmentvariablesetuptypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EnvironmentVariableSetupTypeProperties struct { + VariableName string `json:"variableName"` + VariableValue string `json:"variableValue"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_exceldataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_exceldataset.go new file mode 100644 index 00000000000..40c9adb6c1f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_exceldataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ExcelDataset{} + +type ExcelDataset struct { + TypeProperties *ExcelDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ExcelDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ExcelDataset{} + +func (s ExcelDataset) MarshalJSON() ([]byte, error) { + type wrapper ExcelDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ExcelDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ExcelDataset: %+v", err) + } + + decoded["type"] = "Excel" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ExcelDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ExcelDataset{} + +func (s *ExcelDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *ExcelDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ExcelDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ExcelDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_exceldatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_exceldatasettypeproperties.go new file mode 100644 index 00000000000..0feaf930e86 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_exceldatasettypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExcelDatasetTypeProperties struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FirstRowAsHeader *bool `json:"firstRowAsHeader,omitempty"` + Location DatasetLocation `json:"location"` + NullValue *string `json:"nullValue,omitempty"` + Range *string `json:"range,omitempty"` + SheetIndex *int64 `json:"sheetIndex,omitempty"` + SheetName *string `json:"sheetName,omitempty"` +} + +var _ json.Unmarshaler = &ExcelDatasetTypeProperties{} + +func (s *ExcelDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FirstRowAsHeader *bool `json:"firstRowAsHeader,omitempty"` + NullValue *string `json:"nullValue,omitempty"` + Range *string `json:"range,omitempty"` + SheetIndex *int64 `json:"sheetIndex,omitempty"` + SheetName *string `json:"sheetName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Compression = decoded.Compression + s.FirstRowAsHeader = decoded.FirstRowAsHeader + s.NullValue = decoded.NullValue + s.Range = decoded.Range + s.SheetIndex = decoded.SheetIndex + s.SheetName = decoded.SheetName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ExcelDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'ExcelDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlinkedservice.go new file mode 100644 index 00000000000..59bb498fb66 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = FileServerLinkedService{} + +type FileServerLinkedService struct { + TypeProperties FileServerLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s FileServerLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = FileServerLinkedService{} + +func (s FileServerLinkedService) MarshalJSON() ([]byte, error) { + type wrapper FileServerLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileServerLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileServerLinkedService: %+v", err) + } + + decoded["type"] = "FileServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileServerLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &FileServerLinkedService{} + +func (s *FileServerLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties FileServerLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling FileServerLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'FileServerLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlinkedservicetypeproperties.go new file mode 100644 index 00000000000..da0d9c8baf9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlinkedservicetypeproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileServerLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + UserId *string `json:"userId,omitempty"` +} + +var _ json.Unmarshaler = &FileServerLinkedServiceTypeProperties{} + +func (s *FileServerLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + UserId *string `json:"userId,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.UserId = decoded.UserId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling FileServerLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'FileServerLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlocation.go new file mode 100644 index 00000000000..ccff225226c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_fileserverlocation.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = FileServerLocation{} + +type FileServerLocation struct { + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s FileServerLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = FileServerLocation{} + +func (s FileServerLocation) MarshalJSON() ([]byte, error) { + type wrapper FileServerLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileServerLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileServerLocation: %+v", err) + } + + decoded["type"] = "FileServerLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileServerLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_filesharedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_filesharedataset.go new file mode 100644 index 00000000000..6c07214cd87 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_filesharedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = FileShareDataset{} + +type FileShareDataset struct { + TypeProperties *FileShareDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s FileShareDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = FileShareDataset{} + +func (s FileShareDataset) MarshalJSON() ([]byte, error) { + type wrapper FileShareDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileShareDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileShareDataset: %+v", err) + } + + decoded["type"] = "FileShare" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileShareDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &FileShareDataset{} + +func (s *FileShareDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *FileShareDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling FileShareDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'FileShareDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_filesharedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_filesharedatasettypeproperties.go new file mode 100644 index 00000000000..f7e14800794 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_filesharedatasettypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShareDatasetTypeProperties struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FileFilter *string `json:"fileFilter,omitempty"` + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Format DatasetStorageFormat `json:"format"` + ModifiedDatetimeEnd *string `json:"modifiedDatetimeEnd,omitempty"` + ModifiedDatetimeStart *string `json:"modifiedDatetimeStart,omitempty"` +} + +var _ json.Unmarshaler = &FileShareDatasetTypeProperties{} + +func (s *FileShareDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Compression *DatasetCompression `json:"compression,omitempty"` + FileFilter *string `json:"fileFilter,omitempty"` + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + ModifiedDatetimeEnd *string `json:"modifiedDatetimeEnd,omitempty"` + ModifiedDatetimeStart *string `json:"modifiedDatetimeStart,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Compression = decoded.Compression + s.FileFilter = decoded.FileFilter + s.FileName = decoded.FileName + s.FolderPath = decoded.FolderPath + s.ModifiedDatetimeEnd = decoded.ModifiedDatetimeEnd + s.ModifiedDatetimeStart = decoded.ModifiedDatetimeStart + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling FileShareDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["format"]; ok { + impl, err := UnmarshalDatasetStorageFormatImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Format' for 'FileShareDatasetTypeProperties': %+v", err) + } + s.Format = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_flowlet.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_flowlet.go new file mode 100644 index 00000000000..596f7df9612 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_flowlet.go @@ -0,0 +1,56 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataFlow = Flowlet{} + +type Flowlet struct { + TypeProperties *FlowletTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from DataFlow + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DataFlowFolder `json:"folder,omitempty"` + Type string `json:"type"` +} + +func (s Flowlet) DataFlow() BaseDataFlowImpl { + return BaseDataFlowImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + Type: s.Type, + } +} + +var _ json.Marshaler = Flowlet{} + +func (s Flowlet) MarshalJSON() ([]byte, error) { + type wrapper Flowlet + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling Flowlet: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling Flowlet: %+v", err) + } + + decoded["type"] = "Flowlet" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling Flowlet: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_flowlettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_flowlettypeproperties.go new file mode 100644 index 00000000000..cc7f01b1581 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_flowlettypeproperties.go @@ -0,0 +1,12 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FlowletTypeProperties struct { + Script *string `json:"script,omitempty"` + ScriptLines *[]string `json:"scriptLines,omitempty"` + Sinks *[]DataFlowSink `json:"sinks,omitempty"` + Sources *[]DataFlowSource `json:"sources,omitempty"` + Transformations *[]Transformation `json:"transformations,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlinkedservice.go new file mode 100644 index 00000000000..7cc933bef75 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = FtpServerLinkedService{} + +type FtpServerLinkedService struct { + TypeProperties FtpServerLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s FtpServerLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = FtpServerLinkedService{} + +func (s FtpServerLinkedService) MarshalJSON() ([]byte, error) { + type wrapper FtpServerLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FtpServerLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FtpServerLinkedService: %+v", err) + } + + decoded["type"] = "FtpServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FtpServerLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &FtpServerLinkedService{} + +func (s *FtpServerLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties FtpServerLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling FtpServerLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'FtpServerLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlinkedservicetypeproperties.go new file mode 100644 index 00000000000..7b6a2f743ac --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FtpServerLinkedServiceTypeProperties struct { + AuthenticationType *FtpAuthenticationType `json:"authenticationType,omitempty"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &FtpServerLinkedServiceTypeProperties{} + +func (s *FtpServerLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *FtpAuthenticationType `json:"authenticationType,omitempty"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.EnableServerCertificateValidation = decoded.EnableServerCertificateValidation + s.EnableSsl = decoded.EnableSsl + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.Port = decoded.Port + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling FtpServerLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'FtpServerLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlocation.go new file mode 100644 index 00000000000..9819ade5cee --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_ftpserverlocation.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = FtpServerLocation{} + +type FtpServerLocation struct { + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s FtpServerLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = FtpServerLocation{} + +func (s FtpServerLocation) MarshalJSON() ([]byte, error) { + type wrapper FtpServerLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FtpServerLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FtpServerLocation: %+v", err) + } + + decoded["type"] = "FtpServerLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FtpServerLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_genericdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_genericdatasettypeproperties.go new file mode 100644 index 00000000000..5dcc8aa6637 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_genericdatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GenericDatasetTypeProperties struct { + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordslinkedservice.go new file mode 100644 index 00000000000..7d30103e4b9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = GoogleAdWordsLinkedService{} + +type GoogleAdWordsLinkedService struct { + TypeProperties GoogleAdWordsLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s GoogleAdWordsLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = GoogleAdWordsLinkedService{} + +func (s GoogleAdWordsLinkedService) MarshalJSON() ([]byte, error) { + type wrapper GoogleAdWordsLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleAdWordsLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleAdWordsLinkedService: %+v", err) + } + + decoded["type"] = "GoogleAdWords" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleAdWordsLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GoogleAdWordsLinkedService{} + +func (s *GoogleAdWordsLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties GoogleAdWordsLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleAdWordsLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'GoogleAdWordsLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordslinkedservicetypeproperties.go new file mode 100644 index 00000000000..dd9d478fc85 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordslinkedservicetypeproperties.go @@ -0,0 +1,102 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GoogleAdWordsLinkedServiceTypeProperties struct { + AuthenticationType *GoogleAdWordsAuthenticationType `json:"authenticationType,omitempty"` + ClientCustomerID *string `json:"clientCustomerID,omitempty"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + DeveloperToken SecretBase `json:"developerToken"` + Email *string `json:"email,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + GoogleAdsApiVersion *string `json:"googleAdsApiVersion,omitempty"` + KeyFilePath *string `json:"keyFilePath,omitempty"` + LoginCustomerID *string `json:"loginCustomerID,omitempty"` + PrivateKey SecretBase `json:"privateKey"` + RefreshToken SecretBase `json:"refreshToken"` + SupportLegacyDataTypes *bool `json:"supportLegacyDataTypes,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` +} + +var _ json.Unmarshaler = &GoogleAdWordsLinkedServiceTypeProperties{} + +func (s *GoogleAdWordsLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *GoogleAdWordsAuthenticationType `json:"authenticationType,omitempty"` + ClientCustomerID *string `json:"clientCustomerID,omitempty"` + ClientId *string `json:"clientId,omitempty"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + Email *string `json:"email,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + GoogleAdsApiVersion *string `json:"googleAdsApiVersion,omitempty"` + KeyFilePath *string `json:"keyFilePath,omitempty"` + LoginCustomerID *string `json:"loginCustomerID,omitempty"` + SupportLegacyDataTypes *bool `json:"supportLegacyDataTypes,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ClientCustomerID = decoded.ClientCustomerID + s.ClientId = decoded.ClientId + s.ConnectionProperties = decoded.ConnectionProperties + s.Email = decoded.Email + s.EncryptedCredential = decoded.EncryptedCredential + s.GoogleAdsApiVersion = decoded.GoogleAdsApiVersion + s.KeyFilePath = decoded.KeyFilePath + s.LoginCustomerID = decoded.LoginCustomerID + s.SupportLegacyDataTypes = decoded.SupportLegacyDataTypes + s.TrustedCertPath = decoded.TrustedCertPath + s.UseSystemTrustStore = decoded.UseSystemTrustStore + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleAdWordsLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'GoogleAdWordsLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + if v, ok := temp["developerToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'DeveloperToken' for 'GoogleAdWordsLinkedServiceTypeProperties': %+v", err) + } + s.DeveloperToken = impl + } + + if v, ok := temp["privateKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'PrivateKey' for 'GoogleAdWordsLinkedServiceTypeProperties': %+v", err) + } + s.PrivateKey = impl + } + + if v, ok := temp["refreshToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'RefreshToken' for 'GoogleAdWordsLinkedServiceTypeProperties': %+v", err) + } + s.RefreshToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordsobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordsobjectdataset.go new file mode 100644 index 00000000000..bb5e6cbf080 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googleadwordsobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = GoogleAdWordsObjectDataset{} + +type GoogleAdWordsObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s GoogleAdWordsObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = GoogleAdWordsObjectDataset{} + +func (s GoogleAdWordsObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper GoogleAdWordsObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleAdWordsObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleAdWordsObjectDataset: %+v", err) + } + + decoded["type"] = "GoogleAdWordsObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleAdWordsObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GoogleAdWordsObjectDataset{} + +func (s *GoogleAdWordsObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleAdWordsObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'GoogleAdWordsObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerydatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerydatasettypeproperties.go new file mode 100644 index 00000000000..904b799e618 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerydatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GoogleBigQueryDatasetTypeProperties struct { + Dataset *string `json:"dataset,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerylinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerylinkedservice.go new file mode 100644 index 00000000000..98bb04a4f48 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerylinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = GoogleBigQueryLinkedService{} + +type GoogleBigQueryLinkedService struct { + TypeProperties GoogleBigQueryLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s GoogleBigQueryLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = GoogleBigQueryLinkedService{} + +func (s GoogleBigQueryLinkedService) MarshalJSON() ([]byte, error) { + type wrapper GoogleBigQueryLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleBigQueryLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleBigQueryLinkedService: %+v", err) + } + + decoded["type"] = "GoogleBigQuery" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleBigQueryLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GoogleBigQueryLinkedService{} + +func (s *GoogleBigQueryLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties GoogleBigQueryLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleBigQueryLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'GoogleBigQueryLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerylinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerylinkedservicetypeproperties.go new file mode 100644 index 00000000000..f63debf463b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigquerylinkedservicetypeproperties.go @@ -0,0 +1,78 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GoogleBigQueryLinkedServiceTypeProperties struct { + AdditionalProjects *string `json:"additionalProjects,omitempty"` + AuthenticationType GoogleBigQueryAuthenticationType `json:"authenticationType"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + Email *string `json:"email,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + KeyFilePath *string `json:"keyFilePath,omitempty"` + Project string `json:"project"` + RefreshToken SecretBase `json:"refreshToken"` + RequestGoogleDriveScope *bool `json:"requestGoogleDriveScope,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` +} + +var _ json.Unmarshaler = &GoogleBigQueryLinkedServiceTypeProperties{} + +func (s *GoogleBigQueryLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AdditionalProjects *string `json:"additionalProjects,omitempty"` + AuthenticationType GoogleBigQueryAuthenticationType `json:"authenticationType"` + ClientId *string `json:"clientId,omitempty"` + Email *string `json:"email,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + KeyFilePath *string `json:"keyFilePath,omitempty"` + Project string `json:"project"` + RequestGoogleDriveScope *bool `json:"requestGoogleDriveScope,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AdditionalProjects = decoded.AdditionalProjects + s.AuthenticationType = decoded.AuthenticationType + s.ClientId = decoded.ClientId + s.Email = decoded.Email + s.EncryptedCredential = decoded.EncryptedCredential + s.KeyFilePath = decoded.KeyFilePath + s.Project = decoded.Project + s.RequestGoogleDriveScope = decoded.RequestGoogleDriveScope + s.TrustedCertPath = decoded.TrustedCertPath + s.UseSystemTrustStore = decoded.UseSystemTrustStore + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleBigQueryLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'GoogleBigQueryLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + if v, ok := temp["refreshToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'RefreshToken' for 'GoogleBigQueryLinkedServiceTypeProperties': %+v", err) + } + s.RefreshToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryobjectdataset.go new file mode 100644 index 00000000000..a76658fce7d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = GoogleBigQueryObjectDataset{} + +type GoogleBigQueryObjectDataset struct { + TypeProperties *GoogleBigQueryDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s GoogleBigQueryObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = GoogleBigQueryObjectDataset{} + +func (s GoogleBigQueryObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper GoogleBigQueryObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleBigQueryObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleBigQueryObjectDataset: %+v", err) + } + + decoded["type"] = "GoogleBigQueryObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleBigQueryObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GoogleBigQueryObjectDataset{} + +func (s *GoogleBigQueryObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GoogleBigQueryDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleBigQueryObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'GoogleBigQueryObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2datasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2datasettypeproperties.go new file mode 100644 index 00000000000..61c1c9169cb --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2datasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GoogleBigQueryV2DatasetTypeProperties struct { + Dataset *string `json:"dataset,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2linkedservice.go new file mode 100644 index 00000000000..f181fc1a7b1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = GoogleBigQueryV2LinkedService{} + +type GoogleBigQueryV2LinkedService struct { + TypeProperties GoogleBigQueryV2LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s GoogleBigQueryV2LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = GoogleBigQueryV2LinkedService{} + +func (s GoogleBigQueryV2LinkedService) MarshalJSON() ([]byte, error) { + type wrapper GoogleBigQueryV2LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleBigQueryV2LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleBigQueryV2LinkedService: %+v", err) + } + + decoded["type"] = "GoogleBigQueryV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleBigQueryV2LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GoogleBigQueryV2LinkedService{} + +func (s *GoogleBigQueryV2LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties GoogleBigQueryV2LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleBigQueryV2LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'GoogleBigQueryV2LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2linkedservicetypeproperties.go new file mode 100644 index 00000000000..a77001f25a3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2linkedservicetypeproperties.go @@ -0,0 +1,69 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GoogleBigQueryV2LinkedServiceTypeProperties struct { + AuthenticationType GoogleBigQueryV2AuthenticationType `json:"authenticationType"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + KeyFileContent SecretBase `json:"keyFileContent"` + ProjectId string `json:"projectId"` + RefreshToken SecretBase `json:"refreshToken"` +} + +var _ json.Unmarshaler = &GoogleBigQueryV2LinkedServiceTypeProperties{} + +func (s *GoogleBigQueryV2LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType GoogleBigQueryV2AuthenticationType `json:"authenticationType"` + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ProjectId string `json:"projectId"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.ProjectId = decoded.ProjectId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleBigQueryV2LinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'GoogleBigQueryV2LinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + if v, ok := temp["keyFileContent"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'KeyFileContent' for 'GoogleBigQueryV2LinkedServiceTypeProperties': %+v", err) + } + s.KeyFileContent = impl + } + + if v, ok := temp["refreshToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'RefreshToken' for 'GoogleBigQueryV2LinkedServiceTypeProperties': %+v", err) + } + s.RefreshToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2objectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2objectdataset.go new file mode 100644 index 00000000000..747be430671 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlebigqueryv2objectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = GoogleBigQueryV2ObjectDataset{} + +type GoogleBigQueryV2ObjectDataset struct { + TypeProperties *GoogleBigQueryV2DatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s GoogleBigQueryV2ObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = GoogleBigQueryV2ObjectDataset{} + +func (s GoogleBigQueryV2ObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper GoogleBigQueryV2ObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleBigQueryV2ObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleBigQueryV2ObjectDataset: %+v", err) + } + + decoded["type"] = "GoogleBigQueryV2Object" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleBigQueryV2ObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GoogleBigQueryV2ObjectDataset{} + +func (s *GoogleBigQueryV2ObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GoogleBigQueryV2DatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleBigQueryV2ObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'GoogleBigQueryV2ObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelinkedservice.go new file mode 100644 index 00000000000..ab0c1f53e5d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = GoogleCloudStorageLinkedService{} + +type GoogleCloudStorageLinkedService struct { + TypeProperties GoogleCloudStorageLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s GoogleCloudStorageLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = GoogleCloudStorageLinkedService{} + +func (s GoogleCloudStorageLinkedService) MarshalJSON() ([]byte, error) { + type wrapper GoogleCloudStorageLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleCloudStorageLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleCloudStorageLinkedService: %+v", err) + } + + decoded["type"] = "GoogleCloudStorage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleCloudStorageLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GoogleCloudStorageLinkedService{} + +func (s *GoogleCloudStorageLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties GoogleCloudStorageLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleCloudStorageLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'GoogleCloudStorageLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelinkedservicetypeproperties.go new file mode 100644 index 00000000000..a46c55c1a0a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelinkedservicetypeproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GoogleCloudStorageLinkedServiceTypeProperties struct { + AccessKeyId *string `json:"accessKeyId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SecretAccessKey SecretBase `json:"secretAccessKey"` + ServiceURL *string `json:"serviceUrl,omitempty"` +} + +var _ json.Unmarshaler = &GoogleCloudStorageLinkedServiceTypeProperties{} + +func (s *GoogleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccessKeyId *string `json:"accessKeyId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccessKeyId = decoded.AccessKeyId + s.EncryptedCredential = decoded.EncryptedCredential + s.ServiceURL = decoded.ServiceURL + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleCloudStorageLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["secretAccessKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SecretAccessKey' for 'GoogleCloudStorageLinkedServiceTypeProperties': %+v", err) + } + s.SecretAccessKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelocation.go new file mode 100644 index 00000000000..00258a28665 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlecloudstoragelocation.go @@ -0,0 +1,55 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = GoogleCloudStorageLocation{} + +type GoogleCloudStorageLocation struct { + BucketName *string `json:"bucketName,omitempty"` + Version *string `json:"version,omitempty"` + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s GoogleCloudStorageLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = GoogleCloudStorageLocation{} + +func (s GoogleCloudStorageLocation) MarshalJSON() ([]byte, error) { + type wrapper GoogleCloudStorageLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleCloudStorageLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleCloudStorageLocation: %+v", err) + } + + decoded["type"] = "GoogleCloudStorageLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleCloudStorageLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlesheetslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlesheetslinkedservice.go new file mode 100644 index 00000000000..dc1d3615129 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlesheetslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = GoogleSheetsLinkedService{} + +type GoogleSheetsLinkedService struct { + TypeProperties GoogleSheetsLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s GoogleSheetsLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = GoogleSheetsLinkedService{} + +func (s GoogleSheetsLinkedService) MarshalJSON() ([]byte, error) { + type wrapper GoogleSheetsLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GoogleSheetsLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GoogleSheetsLinkedService: %+v", err) + } + + decoded["type"] = "GoogleSheets" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GoogleSheetsLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GoogleSheetsLinkedService{} + +func (s *GoogleSheetsLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties GoogleSheetsLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleSheetsLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'GoogleSheetsLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlesheetslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlesheetslinkedservicetypeproperties.go new file mode 100644 index 00000000000..00e688cf29d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_googlesheetslinkedservicetypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GoogleSheetsLinkedServiceTypeProperties struct { + ApiToken SecretBase `json:"apiToken"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` +} + +var _ json.Unmarshaler = &GoogleSheetsLinkedServiceTypeProperties{} + +func (s *GoogleSheetsLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GoogleSheetsLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["apiToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ApiToken' for 'GoogleSheetsLinkedServiceTypeProperties': %+v", err) + } + s.ApiToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumdatasettypeproperties.go new file mode 100644 index 00000000000..21a92f597c9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumdatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GreenplumDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumlinkedservice.go new file mode 100644 index 00000000000..9a362c2c4d6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = GreenplumLinkedService{} + +type GreenplumLinkedService struct { + TypeProperties GreenplumLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s GreenplumLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = GreenplumLinkedService{} + +func (s GreenplumLinkedService) MarshalJSON() ([]byte, error) { + type wrapper GreenplumLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GreenplumLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GreenplumLinkedService: %+v", err) + } + + decoded["type"] = "Greenplum" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GreenplumLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GreenplumLinkedService{} + +func (s *GreenplumLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties GreenplumLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GreenplumLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'GreenplumLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumlinkedservicetypeproperties.go new file mode 100644 index 00000000000..17cd6745d33 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumlinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GreenplumLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Pwd *AzureKeyVaultSecretReference `json:"pwd,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumtabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumtabledataset.go new file mode 100644 index 00000000000..79b7e6868c0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_greenplumtabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = GreenplumTableDataset{} + +type GreenplumTableDataset struct { + TypeProperties *GreenplumDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s GreenplumTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = GreenplumTableDataset{} + +func (s GreenplumTableDataset) MarshalJSON() ([]byte, error) { + type wrapper GreenplumTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GreenplumTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GreenplumTableDataset: %+v", err) + } + + decoded["type"] = "GreenplumTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GreenplumTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GreenplumTableDataset{} + +func (s *GreenplumTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GreenplumDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GreenplumTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'GreenplumTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaselinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaselinkedservice.go new file mode 100644 index 00000000000..ef56332bee4 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaselinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = HBaseLinkedService{} + +type HBaseLinkedService struct { + TypeProperties HBaseLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s HBaseLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = HBaseLinkedService{} + +func (s HBaseLinkedService) MarshalJSON() ([]byte, error) { + type wrapper HBaseLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HBaseLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HBaseLinkedService: %+v", err) + } + + decoded["type"] = "HBase" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HBaseLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HBaseLinkedService{} + +func (s *HBaseLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties HBaseLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HBaseLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'HBaseLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaselinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaselinkedservicetypeproperties.go new file mode 100644 index 00000000000..61b7055e823 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaselinkedservicetypeproperties.go @@ -0,0 +1,69 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HBaseLinkedServiceTypeProperties struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType HBaseAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HTTPPath *string `json:"httpPath,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &HBaseLinkedServiceTypeProperties{} + +func (s *HBaseLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType HBaseAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HTTPPath *string `json:"httpPath,omitempty"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AllowHostNameCNMismatch = decoded.AllowHostNameCNMismatch + s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert + s.AuthenticationType = decoded.AuthenticationType + s.EnableSsl = decoded.EnableSsl + s.EncryptedCredential = decoded.EncryptedCredential + s.HTTPPath = decoded.HTTPPath + s.Host = decoded.Host + s.Port = decoded.Port + s.TrustedCertPath = decoded.TrustedCertPath + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HBaseLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'HBaseLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaseobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaseobjectdataset.go new file mode 100644 index 00000000000..ebbfe6de777 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hbaseobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = HBaseObjectDataset{} + +type HBaseObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s HBaseObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = HBaseObjectDataset{} + +func (s HBaseObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper HBaseObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HBaseObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HBaseObjectDataset: %+v", err) + } + + decoded["type"] = "HBaseObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HBaseObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HBaseObjectDataset{} + +func (s *HBaseObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HBaseObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'HBaseObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslinkedservice.go new file mode 100644 index 00000000000..6f85df00a6f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = HdfsLinkedService{} + +type HdfsLinkedService struct { + TypeProperties HdfsLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s HdfsLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = HdfsLinkedService{} + +func (s HdfsLinkedService) MarshalJSON() ([]byte, error) { + type wrapper HdfsLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HdfsLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HdfsLinkedService: %+v", err) + } + + decoded["type"] = "Hdfs" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HdfsLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HdfsLinkedService{} + +func (s *HdfsLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties HdfsLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HdfsLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'HdfsLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslinkedservicetypeproperties.go new file mode 100644 index 00000000000..c2532ea6ad4 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslinkedservicetypeproperties.go @@ -0,0 +1,51 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HdfsLinkedServiceTypeProperties struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &HdfsLinkedServiceTypeProperties{} + +func (s *HdfsLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.EncryptedCredential = decoded.EncryptedCredential + s.Url = decoded.Url + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HdfsLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'HdfsLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslocation.go new file mode 100644 index 00000000000..bc2ff4ad241 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdfslocation.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = HdfsLocation{} + +type HdfsLocation struct { + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s HdfsLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = HdfsLocation{} + +func (s HdfsLocation) MarshalJSON() ([]byte, error) { + type wrapper HdfsLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HdfsLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HdfsLocation: %+v", err) + } + + decoded["type"] = "HdfsLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HdfsLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightlinkedservice.go new file mode 100644 index 00000000000..e01dd2d0a00 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = HDInsightLinkedService{} + +type HDInsightLinkedService struct { + TypeProperties HDInsightLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s HDInsightLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = HDInsightLinkedService{} + +func (s HDInsightLinkedService) MarshalJSON() ([]byte, error) { + type wrapper HDInsightLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HDInsightLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HDInsightLinkedService: %+v", err) + } + + decoded["type"] = "HDInsight" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HDInsightLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HDInsightLinkedService{} + +func (s *HDInsightLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties HDInsightLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HDInsightLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'HDInsightLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightlinkedservicetypeproperties.go new file mode 100644 index 00000000000..2f3db03f4e0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightlinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HDInsightLinkedServiceTypeProperties struct { + ClusterUri string `json:"clusterUri"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FileSystem *string `json:"fileSystem,omitempty"` + HcatalogLinkedServiceName *LinkedServiceReference `json:"hcatalogLinkedServiceName,omitempty"` + IsEspEnabled *bool `json:"isEspEnabled,omitempty"` + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + Password SecretBase `json:"password"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &HDInsightLinkedServiceTypeProperties{} + +func (s *HDInsightLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClusterUri string `json:"clusterUri"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FileSystem *string `json:"fileSystem,omitempty"` + HcatalogLinkedServiceName *LinkedServiceReference `json:"hcatalogLinkedServiceName,omitempty"` + IsEspEnabled *bool `json:"isEspEnabled,omitempty"` + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClusterUri = decoded.ClusterUri + s.EncryptedCredential = decoded.EncryptedCredential + s.FileSystem = decoded.FileSystem + s.HcatalogLinkedServiceName = decoded.HcatalogLinkedServiceName + s.IsEspEnabled = decoded.IsEspEnabled + s.LinkedServiceName = decoded.LinkedServiceName + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HDInsightLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'HDInsightLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightondemandlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightondemandlinkedservice.go new file mode 100644 index 00000000000..2170e4f7608 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightondemandlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = HDInsightOnDemandLinkedService{} + +type HDInsightOnDemandLinkedService struct { + TypeProperties HDInsightOnDemandLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s HDInsightOnDemandLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = HDInsightOnDemandLinkedService{} + +func (s HDInsightOnDemandLinkedService) MarshalJSON() ([]byte, error) { + type wrapper HDInsightOnDemandLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HDInsightOnDemandLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HDInsightOnDemandLinkedService: %+v", err) + } + + decoded["type"] = "HDInsightOnDemand" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HDInsightOnDemandLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HDInsightOnDemandLinkedService{} + +func (s *HDInsightOnDemandLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties HDInsightOnDemandLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HDInsightOnDemandLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'HDInsightOnDemandLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightondemandlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightondemandlinkedservicetypeproperties.go new file mode 100644 index 00000000000..a6d46588211 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hdinsightondemandlinkedservicetypeproperties.go @@ -0,0 +1,150 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HDInsightOnDemandLinkedServiceTypeProperties struct { + AdditionalLinkedServiceNames *[]LinkedServiceReference `json:"additionalLinkedServiceNames,omitempty"` + ClusterNamePrefix *string `json:"clusterNamePrefix,omitempty"` + ClusterPassword SecretBase `json:"clusterPassword"` + ClusterResourceGroup string `json:"clusterResourceGroup"` + ClusterSize int64 `json:"clusterSize"` + ClusterSshPassword SecretBase `json:"clusterSshPassword"` + ClusterSshUserName *string `json:"clusterSshUserName,omitempty"` + ClusterType *string `json:"clusterType,omitempty"` + ClusterUserName *string `json:"clusterUserName,omitempty"` + CoreConfiguration *interface{} `json:"coreConfiguration,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + DataNodeSize *interface{} `json:"dataNodeSize,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HBaseConfiguration *interface{} `json:"hBaseConfiguration,omitempty"` + HcatalogLinkedServiceName *LinkedServiceReference `json:"hcatalogLinkedServiceName,omitempty"` + HdfsConfiguration *interface{} `json:"hdfsConfiguration,omitempty"` + HeadNodeSize *interface{} `json:"headNodeSize,omitempty"` + HiveConfiguration *interface{} `json:"hiveConfiguration,omitempty"` + HostSubscriptionId string `json:"hostSubscriptionId"` + LinkedServiceName LinkedServiceReference `json:"linkedServiceName"` + MapReduceConfiguration *interface{} `json:"mapReduceConfiguration,omitempty"` + OozieConfiguration *interface{} `json:"oozieConfiguration,omitempty"` + ScriptActions *[]ScriptAction `json:"scriptActions,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + SparkVersion *string `json:"sparkVersion,omitempty"` + StormConfiguration *interface{} `json:"stormConfiguration,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + Tenant string `json:"tenant"` + TimeToLive string `json:"timeToLive"` + Version string `json:"version"` + VirtualNetworkId *string `json:"virtualNetworkId,omitempty"` + YarnConfiguration *interface{} `json:"yarnConfiguration,omitempty"` + ZookeeperNodeSize *interface{} `json:"zookeeperNodeSize,omitempty"` +} + +var _ json.Unmarshaler = &HDInsightOnDemandLinkedServiceTypeProperties{} + +func (s *HDInsightOnDemandLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AdditionalLinkedServiceNames *[]LinkedServiceReference `json:"additionalLinkedServiceNames,omitempty"` + ClusterNamePrefix *string `json:"clusterNamePrefix,omitempty"` + ClusterResourceGroup string `json:"clusterResourceGroup"` + ClusterSize int64 `json:"clusterSize"` + ClusterSshUserName *string `json:"clusterSshUserName,omitempty"` + ClusterType *string `json:"clusterType,omitempty"` + ClusterUserName *string `json:"clusterUserName,omitempty"` + CoreConfiguration *interface{} `json:"coreConfiguration,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + DataNodeSize *interface{} `json:"dataNodeSize,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HBaseConfiguration *interface{} `json:"hBaseConfiguration,omitempty"` + HcatalogLinkedServiceName *LinkedServiceReference `json:"hcatalogLinkedServiceName,omitempty"` + HdfsConfiguration *interface{} `json:"hdfsConfiguration,omitempty"` + HeadNodeSize *interface{} `json:"headNodeSize,omitempty"` + HiveConfiguration *interface{} `json:"hiveConfiguration,omitempty"` + HostSubscriptionId string `json:"hostSubscriptionId"` + LinkedServiceName LinkedServiceReference `json:"linkedServiceName"` + MapReduceConfiguration *interface{} `json:"mapReduceConfiguration,omitempty"` + OozieConfiguration *interface{} `json:"oozieConfiguration,omitempty"` + ScriptActions *[]ScriptAction `json:"scriptActions,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + SparkVersion *string `json:"sparkVersion,omitempty"` + StormConfiguration *interface{} `json:"stormConfiguration,omitempty"` + SubnetName *string `json:"subnetName,omitempty"` + Tenant string `json:"tenant"` + TimeToLive string `json:"timeToLive"` + Version string `json:"version"` + VirtualNetworkId *string `json:"virtualNetworkId,omitempty"` + YarnConfiguration *interface{} `json:"yarnConfiguration,omitempty"` + ZookeeperNodeSize *interface{} `json:"zookeeperNodeSize,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AdditionalLinkedServiceNames = decoded.AdditionalLinkedServiceNames + s.ClusterNamePrefix = decoded.ClusterNamePrefix + s.ClusterResourceGroup = decoded.ClusterResourceGroup + s.ClusterSize = decoded.ClusterSize + s.ClusterSshUserName = decoded.ClusterSshUserName + s.ClusterType = decoded.ClusterType + s.ClusterUserName = decoded.ClusterUserName + s.CoreConfiguration = decoded.CoreConfiguration + s.Credential = decoded.Credential + s.DataNodeSize = decoded.DataNodeSize + s.EncryptedCredential = decoded.EncryptedCredential + s.HBaseConfiguration = decoded.HBaseConfiguration + s.HcatalogLinkedServiceName = decoded.HcatalogLinkedServiceName + s.HdfsConfiguration = decoded.HdfsConfiguration + s.HeadNodeSize = decoded.HeadNodeSize + s.HiveConfiguration = decoded.HiveConfiguration + s.HostSubscriptionId = decoded.HostSubscriptionId + s.LinkedServiceName = decoded.LinkedServiceName + s.MapReduceConfiguration = decoded.MapReduceConfiguration + s.OozieConfiguration = decoded.OozieConfiguration + s.ScriptActions = decoded.ScriptActions + s.ServicePrincipalId = decoded.ServicePrincipalId + s.SparkVersion = decoded.SparkVersion + s.StormConfiguration = decoded.StormConfiguration + s.SubnetName = decoded.SubnetName + s.Tenant = decoded.Tenant + s.TimeToLive = decoded.TimeToLive + s.Version = decoded.Version + s.VirtualNetworkId = decoded.VirtualNetworkId + s.YarnConfiguration = decoded.YarnConfiguration + s.ZookeeperNodeSize = decoded.ZookeeperNodeSize + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HDInsightOnDemandLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clusterPassword"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClusterPassword' for 'HDInsightOnDemandLinkedServiceTypeProperties': %+v", err) + } + s.ClusterPassword = impl + } + + if v, ok := temp["clusterSshPassword"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClusterSshPassword' for 'HDInsightOnDemandLinkedServiceTypeProperties': %+v", err) + } + s.ClusterSshPassword = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'HDInsightOnDemandLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivedatasettypeproperties.go new file mode 100644 index 00000000000..a4f532b67c8 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivedatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HiveDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivelinkedservice.go new file mode 100644 index 00000000000..c2feda3293f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = HiveLinkedService{} + +type HiveLinkedService struct { + TypeProperties HiveLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s HiveLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = HiveLinkedService{} + +func (s HiveLinkedService) MarshalJSON() ([]byte, error) { + type wrapper HiveLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HiveLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HiveLinkedService: %+v", err) + } + + decoded["type"] = "Hive" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HiveLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HiveLinkedService{} + +func (s *HiveLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties HiveLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HiveLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'HiveLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivelinkedservicetypeproperties.go new file mode 100644 index 00000000000..0ebcaecebc7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hivelinkedservicetypeproperties.go @@ -0,0 +1,87 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HiveLinkedServiceTypeProperties struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType HiveAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HTTPPath *string `json:"httpPath,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + ServerType *HiveServerType `json:"serverType,omitempty"` + ServiceDiscoveryMode *bool `json:"serviceDiscoveryMode,omitempty"` + ThriftTransportProtocol *HiveThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseNativeQuery *bool `json:"useNativeQuery,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` + ZooKeeperNameSpace *string `json:"zooKeeperNameSpace,omitempty"` +} + +var _ json.Unmarshaler = &HiveLinkedServiceTypeProperties{} + +func (s *HiveLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType HiveAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HTTPPath *string `json:"httpPath,omitempty"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + ServerType *HiveServerType `json:"serverType,omitempty"` + ServiceDiscoveryMode *bool `json:"serviceDiscoveryMode,omitempty"` + ThriftTransportProtocol *HiveThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseNativeQuery *bool `json:"useNativeQuery,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` + ZooKeeperNameSpace *string `json:"zooKeeperNameSpace,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AllowHostNameCNMismatch = decoded.AllowHostNameCNMismatch + s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert + s.AuthenticationType = decoded.AuthenticationType + s.EnableSsl = decoded.EnableSsl + s.EncryptedCredential = decoded.EncryptedCredential + s.HTTPPath = decoded.HTTPPath + s.Host = decoded.Host + s.Port = decoded.Port + s.ServerType = decoded.ServerType + s.ServiceDiscoveryMode = decoded.ServiceDiscoveryMode + s.ThriftTransportProtocol = decoded.ThriftTransportProtocol + s.TrustedCertPath = decoded.TrustedCertPath + s.UseNativeQuery = decoded.UseNativeQuery + s.UseSystemTrustStore = decoded.UseSystemTrustStore + s.Username = decoded.Username + s.ZooKeeperNameSpace = decoded.ZooKeeperNameSpace + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HiveLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'HiveLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hiveobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hiveobjectdataset.go new file mode 100644 index 00000000000..3a8ad7b0c12 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hiveobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = HiveObjectDataset{} + +type HiveObjectDataset struct { + TypeProperties *HiveDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s HiveObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = HiveObjectDataset{} + +func (s HiveObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper HiveObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HiveObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HiveObjectDataset: %+v", err) + } + + decoded["type"] = "HiveObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HiveObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HiveObjectDataset{} + +func (s *HiveObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *HiveDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HiveObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'HiveObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpdataset.go new file mode 100644 index 00000000000..b55efde8ede --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = HTTPDataset{} + +type HTTPDataset struct { + TypeProperties *HTTPDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s HTTPDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = HTTPDataset{} + +func (s HTTPDataset) MarshalJSON() ([]byte, error) { + type wrapper HTTPDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HTTPDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HTTPDataset: %+v", err) + } + + decoded["type"] = "HttpFile" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HTTPDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HTTPDataset{} + +func (s *HTTPDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *HTTPDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HTTPDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'HTTPDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpdatasettypeproperties.go new file mode 100644 index 00000000000..e83c1728a4e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpdatasettypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HTTPDatasetTypeProperties struct { + AdditionalHeaders *string `json:"additionalHeaders,omitempty"` + Compression *DatasetCompression `json:"compression,omitempty"` + Format DatasetStorageFormat `json:"format"` + RelativeURL *string `json:"relativeUrl,omitempty"` + RequestBody *string `json:"requestBody,omitempty"` + RequestMethod *string `json:"requestMethod,omitempty"` +} + +var _ json.Unmarshaler = &HTTPDatasetTypeProperties{} + +func (s *HTTPDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AdditionalHeaders *string `json:"additionalHeaders,omitempty"` + Compression *DatasetCompression `json:"compression,omitempty"` + RelativeURL *string `json:"relativeUrl,omitempty"` + RequestBody *string `json:"requestBody,omitempty"` + RequestMethod *string `json:"requestMethod,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AdditionalHeaders = decoded.AdditionalHeaders + s.Compression = decoded.Compression + s.RelativeURL = decoded.RelativeURL + s.RequestBody = decoded.RequestBody + s.RequestMethod = decoded.RequestMethod + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HTTPDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["format"]; ok { + impl, err := UnmarshalDatasetStorageFormatImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Format' for 'HTTPDatasetTypeProperties': %+v", err) + } + s.Format = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httplinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httplinkedservice.go new file mode 100644 index 00000000000..87d8807f0f1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httplinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = HTTPLinkedService{} + +type HTTPLinkedService struct { + TypeProperties HTTPLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s HTTPLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = HTTPLinkedService{} + +func (s HTTPLinkedService) MarshalJSON() ([]byte, error) { + type wrapper HTTPLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HTTPLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HTTPLinkedService: %+v", err) + } + + decoded["type"] = "HttpServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HTTPLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HTTPLinkedService{} + +func (s *HTTPLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties HTTPLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HTTPLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'HTTPLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httplinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httplinkedservicetypeproperties.go new file mode 100644 index 00000000000..4eac61879b9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httplinkedservicetypeproperties.go @@ -0,0 +1,63 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HTTPLinkedServiceTypeProperties struct { + AuthHeaders *map[string]string `json:"authHeaders,omitempty"` + AuthenticationType *HTTPAuthenticationType `json:"authenticationType,omitempty"` + CertThumbprint *string `json:"certThumbprint,omitempty"` + EmbeddedCertData *string `json:"embeddedCertData,omitempty"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &HTTPLinkedServiceTypeProperties{} + +func (s *HTTPLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthHeaders *map[string]string `json:"authHeaders,omitempty"` + AuthenticationType *HTTPAuthenticationType `json:"authenticationType,omitempty"` + CertThumbprint *string `json:"certThumbprint,omitempty"` + EmbeddedCertData *string `json:"embeddedCertData,omitempty"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthHeaders = decoded.AuthHeaders + s.AuthenticationType = decoded.AuthenticationType + s.CertThumbprint = decoded.CertThumbprint + s.EmbeddedCertData = decoded.EmbeddedCertData + s.EnableServerCertificateValidation = decoded.EnableServerCertificateValidation + s.EncryptedCredential = decoded.EncryptedCredential + s.Url = decoded.Url + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HTTPLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'HTTPLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpserverlocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpserverlocation.go new file mode 100644 index 00000000000..6e1fbf4d849 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_httpserverlocation.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = HTTPServerLocation{} + +type HTTPServerLocation struct { + RelativeURL *string `json:"relativeUrl,omitempty"` + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s HTTPServerLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = HTTPServerLocation{} + +func (s HTTPServerLocation) MarshalJSON() ([]byte, error) { + type wrapper HTTPServerLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HTTPServerLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HTTPServerLocation: %+v", err) + } + + decoded["type"] = "HttpServerLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HTTPServerLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotlinkedservice.go new file mode 100644 index 00000000000..08d419c41e9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = HubspotLinkedService{} + +type HubspotLinkedService struct { + TypeProperties HubspotLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s HubspotLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = HubspotLinkedService{} + +func (s HubspotLinkedService) MarshalJSON() ([]byte, error) { + type wrapper HubspotLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HubspotLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HubspotLinkedService: %+v", err) + } + + decoded["type"] = "Hubspot" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HubspotLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HubspotLinkedService{} + +func (s *HubspotLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties HubspotLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HubspotLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'HubspotLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotlinkedservicetypeproperties.go new file mode 100644 index 00000000000..6de37231b6a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotlinkedservicetypeproperties.go @@ -0,0 +1,72 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HubspotLinkedServiceTypeProperties struct { + AccessToken SecretBase `json:"accessToken"` + ClientId string `json:"clientId"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + RefreshToken SecretBase `json:"refreshToken"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &HubspotLinkedServiceTypeProperties{} + +func (s *HubspotLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId string `json:"clientId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HubspotLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accessToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessToken' for 'HubspotLinkedServiceTypeProperties': %+v", err) + } + s.AccessToken = impl + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'HubspotLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + if v, ok := temp["refreshToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'RefreshToken' for 'HubspotLinkedServiceTypeProperties': %+v", err) + } + s.RefreshToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotobjectdataset.go new file mode 100644 index 00000000000..428a3484c0d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_hubspotobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = HubspotObjectDataset{} + +type HubspotObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s HubspotObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = HubspotObjectDataset{} + +func (s HubspotObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper HubspotObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HubspotObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HubspotObjectDataset: %+v", err) + } + + decoded["type"] = "HubspotObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HubspotObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &HubspotObjectDataset{} + +func (s *HubspotObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling HubspotObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'HubspotObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_icebergdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_icebergdataset.go new file mode 100644 index 00000000000..f00cc9ce64e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_icebergdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = IcebergDataset{} + +type IcebergDataset struct { + TypeProperties *IcebergDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s IcebergDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = IcebergDataset{} + +func (s IcebergDataset) MarshalJSON() ([]byte, error) { + type wrapper IcebergDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IcebergDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IcebergDataset: %+v", err) + } + + decoded["type"] = "Iceberg" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IcebergDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &IcebergDataset{} + +func (s *IcebergDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *IcebergDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling IcebergDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'IcebergDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_icebergdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_icebergdatasettypeproperties.go new file mode 100644 index 00000000000..abcc594febe --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_icebergdatasettypeproperties.go @@ -0,0 +1,33 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IcebergDatasetTypeProperties struct { + Location DatasetLocation `json:"location"` +} + +var _ json.Unmarshaler = &IcebergDatasetTypeProperties{} + +func (s *IcebergDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling IcebergDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'IcebergDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impaladatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impaladatasettypeproperties.go new file mode 100644 index 00000000000..3428b94d098 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impaladatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ImpalaDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservice.go new file mode 100644 index 00000000000..45d152b842c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ImpalaLinkedService{} + +type ImpalaLinkedService struct { + TypeProperties ImpalaLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ImpalaLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ImpalaLinkedService{} + +func (s ImpalaLinkedService) MarshalJSON() ([]byte, error) { + type wrapper ImpalaLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ImpalaLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ImpalaLinkedService: %+v", err) + } + + decoded["type"] = "Impala" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ImpalaLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ImpalaLinkedService{} + +func (s *ImpalaLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ImpalaLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ImpalaLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ImpalaLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservicetypeproperties.go new file mode 100644 index 00000000000..46b1e5cbc9e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservicetypeproperties.go @@ -0,0 +1,69 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ImpalaLinkedServiceTypeProperties struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &ImpalaLinkedServiceTypeProperties{} + +func (s *ImpalaLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AllowHostNameCNMismatch = decoded.AllowHostNameCNMismatch + s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert + s.AuthenticationType = decoded.AuthenticationType + s.EnableSsl = decoded.EnableSsl + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.Port = decoded.Port + s.TrustedCertPath = decoded.TrustedCertPath + s.UseSystemTrustStore = decoded.UseSystemTrustStore + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ImpalaLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'ImpalaLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalaobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalaobjectdataset.go new file mode 100644 index 00000000000..345c3befee7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalaobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ImpalaObjectDataset{} + +type ImpalaObjectDataset struct { + TypeProperties *ImpalaDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ImpalaObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ImpalaObjectDataset{} + +func (s ImpalaObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper ImpalaObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ImpalaObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ImpalaObjectDataset: %+v", err) + } + + decoded["type"] = "ImpalaObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ImpalaObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ImpalaObjectDataset{} + +func (s *ImpalaObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *ImpalaDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ImpalaObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ImpalaObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixlinkedservice.go new file mode 100644 index 00000000000..ef69afc935f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = InformixLinkedService{} + +type InformixLinkedService struct { + TypeProperties InformixLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s InformixLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = InformixLinkedService{} + +func (s InformixLinkedService) MarshalJSON() ([]byte, error) { + type wrapper InformixLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling InformixLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling InformixLinkedService: %+v", err) + } + + decoded["type"] = "Informix" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling InformixLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &InformixLinkedService{} + +func (s *InformixLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties InformixLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling InformixLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'InformixLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixlinkedservicetypeproperties.go new file mode 100644 index 00000000000..bc9480de5ce --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixlinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InformixLinkedServiceTypeProperties struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + ConnectionString string `json:"connectionString"` + Credential SecretBase `json:"credential"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &InformixLinkedServiceTypeProperties{} + +func (s *InformixLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ConnectionString = decoded.ConnectionString + s.EncryptedCredential = decoded.EncryptedCredential + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling InformixLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["credential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Credential' for 'InformixLinkedServiceTypeProperties': %+v", err) + } + s.Credential = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'InformixLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixtabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixtabledataset.go new file mode 100644 index 00000000000..14782037aa9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixtabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = InformixTableDataset{} + +type InformixTableDataset struct { + TypeProperties *InformixTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s InformixTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = InformixTableDataset{} + +func (s InformixTableDataset) MarshalJSON() ([]byte, error) { + type wrapper InformixTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling InformixTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling InformixTableDataset: %+v", err) + } + + decoded["type"] = "InformixTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling InformixTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &InformixTableDataset{} + +func (s *InformixTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *InformixTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling InformixTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'InformixTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixtabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixtabledatasettypeproperties.go new file mode 100644 index 00000000000..72253c2b58a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_informixtabledatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InformixTableDatasetTypeProperties struct { + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntime.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntime.go index 576b53726f4..896fb04c6b6 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntime.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntime.go @@ -1,9 +1,84 @@ package dataflowdebugsession +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type IntegrationRuntime struct { +type IntegrationRuntime interface { + IntegrationRuntime() BaseIntegrationRuntimeImpl +} + +var _ IntegrationRuntime = BaseIntegrationRuntimeImpl{} + +type BaseIntegrationRuntimeImpl struct { Description *string `json:"description,omitempty"` Type IntegrationRuntimeType `json:"type"` } + +func (s BaseIntegrationRuntimeImpl) IntegrationRuntime() BaseIntegrationRuntimeImpl { + return s +} + +var _ IntegrationRuntime = RawIntegrationRuntimeImpl{} + +// RawIntegrationRuntimeImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawIntegrationRuntimeImpl struct { + integrationRuntime BaseIntegrationRuntimeImpl + Type string + Values map[string]interface{} +} + +func (s RawIntegrationRuntimeImpl) IntegrationRuntime() BaseIntegrationRuntimeImpl { + return s.integrationRuntime +} + +func UnmarshalIntegrationRuntimeImplementation(input []byte) (IntegrationRuntime, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling IntegrationRuntime into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Managed") { + var out ManagedIntegrationRuntime + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ManagedIntegrationRuntime: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SelfHosted") { + var out SelfHostedIntegrationRuntime + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SelfHostedIntegrationRuntime: %+v", err) + } + return out, nil + } + + var parent BaseIntegrationRuntimeImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseIntegrationRuntimeImpl: %+v", err) + } + + return RawIntegrationRuntimeImpl{ + integrationRuntime: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecomputeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecomputeproperties.go new file mode 100644 index 00000000000..a84fb2a6bc1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecomputeproperties.go @@ -0,0 +1,15 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeComputeProperties struct { + CopyComputeScaleProperties *CopyComputeScaleProperties `json:"copyComputeScaleProperties,omitempty"` + DataFlowProperties *IntegrationRuntimeDataFlowProperties `json:"dataFlowProperties,omitempty"` + Location *string `json:"location,omitempty"` + MaxParallelExecutionsPerNode *int64 `json:"maxParallelExecutionsPerNode,omitempty"` + NodeSize *string `json:"nodeSize,omitempty"` + NumberOfNodes *int64 `json:"numberOfNodes,omitempty"` + PipelineExternalComputeScaleProperties *PipelineExternalComputeScaleProperties `json:"pipelineExternalComputeScaleProperties,omitempty"` + VNetProperties *IntegrationRuntimeVNetProperties `json:"vNetProperties,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecustomervirtualnetwork.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecustomervirtualnetwork.go new file mode 100644 index 00000000000..4be9c3024b1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecustomervirtualnetwork.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeCustomerVirtualNetwork struct { + SubnetId *string `json:"subnetId,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecustomsetupscriptproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecustomsetupscriptproperties.go new file mode 100644 index 00000000000..9efa6ec03cf --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimecustomsetupscriptproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeCustomSetupScriptProperties struct { + BlobContainerUri *string `json:"blobContainerUri,omitempty"` + SasToken *SecureString `json:"sasToken,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataflowproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataflowproperties.go new file mode 100644 index 00000000000..f8c22abbd2b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataflowproperties.go @@ -0,0 +1,12 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeDataFlowProperties struct { + Cleanup *bool `json:"cleanup,omitempty"` + ComputeType *DataFlowComputeType `json:"computeType,omitempty"` + CoreCount *int64 `json:"coreCount,omitempty"` + CustomProperties *[]IntegrationRuntimeDataFlowPropertiesCustomPropertiesInlined `json:"customProperties,omitempty"` + TimeToLive *int64 `json:"timeToLive,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataflowpropertiescustompropertiesinlined.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataflowpropertiescustompropertiesinlined.go new file mode 100644 index 00000000000..8201b4548e7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataflowpropertiescustompropertiesinlined.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeDataFlowPropertiesCustomPropertiesInlined struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataproxyproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataproxyproperties.go new file mode 100644 index 00000000000..e97d25cbba2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedataproxyproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeDataProxyProperties struct { + ConnectVia *EntityReference `json:"connectVia,omitempty"` + Path *string `json:"path,omitempty"` + StagingLinkedService *EntityReference `json:"stagingLinkedService,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedebugresource.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedebugresource.go index f96aefa73b1..80492cb665d 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedebugresource.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimedebugresource.go @@ -1,5 +1,10 @@ package dataflowdebugsession +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -7,3 +12,31 @@ type IntegrationRuntimeDebugResource struct { Name *string `json:"name,omitempty"` Properties IntegrationRuntime `json:"properties"` } + +var _ json.Unmarshaler = &IntegrationRuntimeDebugResource{} + +func (s *IntegrationRuntimeDebugResource) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Name *string `json:"name,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Name = decoded.Name + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling IntegrationRuntimeDebugResource into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalIntegrationRuntimeImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'IntegrationRuntimeDebugResource': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimessiscataloginfo.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimessiscataloginfo.go new file mode 100644 index 00000000000..4d9f55c8908 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimessiscataloginfo.go @@ -0,0 +1,12 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeSsisCatalogInfo struct { + CatalogAdminPassword *SecureString `json:"catalogAdminPassword,omitempty"` + CatalogAdminUserName *string `json:"catalogAdminUserName,omitempty"` + CatalogPricingTier *IntegrationRuntimeSsisCatalogPricingTier `json:"catalogPricingTier,omitempty"` + CatalogServerEndpoint *string `json:"catalogServerEndpoint,omitempty"` + DualStandbyPairName *string `json:"dualStandbyPairName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimessisproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimessisproperties.go new file mode 100644 index 00000000000..916cc900f41 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimessisproperties.go @@ -0,0 +1,69 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeSsisProperties struct { + CatalogInfo *IntegrationRuntimeSsisCatalogInfo `json:"catalogInfo,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + CustomSetupScriptProperties *IntegrationRuntimeCustomSetupScriptProperties `json:"customSetupScriptProperties,omitempty"` + DataProxyProperties *IntegrationRuntimeDataProxyProperties `json:"dataProxyProperties,omitempty"` + Edition *IntegrationRuntimeEdition `json:"edition,omitempty"` + ExpressCustomSetupProperties *[]CustomSetupBase `json:"expressCustomSetupProperties,omitempty"` + LicenseType *IntegrationRuntimeLicenseType `json:"licenseType,omitempty"` + PackageStores *[]PackageStore `json:"packageStores,omitempty"` +} + +var _ json.Unmarshaler = &IntegrationRuntimeSsisProperties{} + +func (s *IntegrationRuntimeSsisProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CatalogInfo *IntegrationRuntimeSsisCatalogInfo `json:"catalogInfo,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + CustomSetupScriptProperties *IntegrationRuntimeCustomSetupScriptProperties `json:"customSetupScriptProperties,omitempty"` + DataProxyProperties *IntegrationRuntimeDataProxyProperties `json:"dataProxyProperties,omitempty"` + Edition *IntegrationRuntimeEdition `json:"edition,omitempty"` + LicenseType *IntegrationRuntimeLicenseType `json:"licenseType,omitempty"` + PackageStores *[]PackageStore `json:"packageStores,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CatalogInfo = decoded.CatalogInfo + s.Credential = decoded.Credential + s.CustomSetupScriptProperties = decoded.CustomSetupScriptProperties + s.DataProxyProperties = decoded.DataProxyProperties + s.Edition = decoded.Edition + s.LicenseType = decoded.LicenseType + s.PackageStores = decoded.PackageStores + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling IntegrationRuntimeSsisProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["expressCustomSetupProperties"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling ExpressCustomSetupProperties into list []json.RawMessage: %+v", err) + } + + output := make([]CustomSetupBase, 0) + for i, val := range listTemp { + impl, err := UnmarshalCustomSetupBaseImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'ExpressCustomSetupProperties' for 'IntegrationRuntimeSsisProperties': %+v", i, err) + } + output = append(output, impl) + } + s.ExpressCustomSetupProperties = &output + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimevnetproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimevnetproperties.go new file mode 100644 index 00000000000..c0f106a329d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_integrationruntimevnetproperties.go @@ -0,0 +1,11 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IntegrationRuntimeVNetProperties struct { + PublicIPs *[]string `json:"publicIPs,omitempty"` + Subnet *string `json:"subnet,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` + VNetId *string `json:"vNetId,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiralinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiralinkedservice.go new file mode 100644 index 00000000000..948eb80e0df --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiralinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = JiraLinkedService{} + +type JiraLinkedService struct { + TypeProperties JiraLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s JiraLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = JiraLinkedService{} + +func (s JiraLinkedService) MarshalJSON() ([]byte, error) { + type wrapper JiraLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling JiraLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling JiraLinkedService: %+v", err) + } + + decoded["type"] = "Jira" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling JiraLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &JiraLinkedService{} + +func (s *JiraLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties JiraLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling JiraLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'JiraLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiralinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiralinkedservicetypeproperties.go new file mode 100644 index 00000000000..e1f5a3f0b1e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiralinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JiraLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username string `json:"username"` +} + +var _ json.Unmarshaler = &JiraLinkedServiceTypeProperties{} + +func (s *JiraLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username string `json:"username"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.Port = decoded.Port + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling JiraLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'JiraLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiraobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiraobjectdataset.go new file mode 100644 index 00000000000..1b03c399c0f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jiraobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = JiraObjectDataset{} + +type JiraObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s JiraObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = JiraObjectDataset{} + +func (s JiraObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper JiraObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling JiraObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling JiraObjectDataset: %+v", err) + } + + decoded["type"] = "JiraObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling JiraObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &JiraObjectDataset{} + +func (s *JiraObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling JiraObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'JiraObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsondataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsondataset.go new file mode 100644 index 00000000000..02ef0cd0c5d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsondataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = JsonDataset{} + +type JsonDataset struct { + TypeProperties *JsonDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s JsonDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = JsonDataset{} + +func (s JsonDataset) MarshalJSON() ([]byte, error) { + type wrapper JsonDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling JsonDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling JsonDataset: %+v", err) + } + + decoded["type"] = "Json" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling JsonDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &JsonDataset{} + +func (s *JsonDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *JsonDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling JsonDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'JsonDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsondatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsondatasettypeproperties.go new file mode 100644 index 00000000000..0d56d6c22c3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsondatasettypeproperties.go @@ -0,0 +1,45 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type JsonDatasetTypeProperties struct { + Compression *DatasetCompression `json:"compression,omitempty"` + EncodingName *string `json:"encodingName,omitempty"` + Location DatasetLocation `json:"location"` +} + +var _ json.Unmarshaler = &JsonDatasetTypeProperties{} + +func (s *JsonDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Compression *DatasetCompression `json:"compression,omitempty"` + EncodingName *string `json:"encodingName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Compression = decoded.Compression + s.EncodingName = decoded.EncodingName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling JsonDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'JsonDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsonformat.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsonformat.go new file mode 100644 index 00000000000..bba4235b496 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_jsonformat.go @@ -0,0 +1,58 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetStorageFormat = JsonFormat{} + +type JsonFormat struct { + EncodingName *string `json:"encodingName,omitempty"` + FilePattern *interface{} `json:"filePattern,omitempty"` + JsonNodeReference *string `json:"jsonNodeReference,omitempty"` + JsonPathDefinition *interface{} `json:"jsonPathDefinition,omitempty"` + NestingSeparator *string `json:"nestingSeparator,omitempty"` + + // Fields inherited from DatasetStorageFormat + + Deserializer *string `json:"deserializer,omitempty"` + Serializer *string `json:"serializer,omitempty"` + Type string `json:"type"` +} + +func (s JsonFormat) DatasetStorageFormat() BaseDatasetStorageFormatImpl { + return BaseDatasetStorageFormatImpl{ + Deserializer: s.Deserializer, + Serializer: s.Serializer, + Type: s.Type, + } +} + +var _ json.Marshaler = JsonFormat{} + +func (s JsonFormat) MarshalJSON() ([]byte, error) { + type wrapper JsonFormat + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling JsonFormat: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling JsonFormat: %+v", err) + } + + decoded["type"] = "JsonFormat" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling JsonFormat: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselinkedservice.go new file mode 100644 index 00000000000..8c062383701 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = LakeHouseLinkedService{} + +type LakeHouseLinkedService struct { + TypeProperties LakeHouseLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s LakeHouseLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = LakeHouseLinkedService{} + +func (s LakeHouseLinkedService) MarshalJSON() ([]byte, error) { + type wrapper LakeHouseLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling LakeHouseLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling LakeHouseLinkedService: %+v", err) + } + + decoded["type"] = "LakeHouse" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling LakeHouseLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &LakeHouseLinkedService{} + +func (s *LakeHouseLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties LakeHouseLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling LakeHouseLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'LakeHouseLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselinkedservicetypeproperties.go new file mode 100644 index 00000000000..5ff7dd88219 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselinkedservicetypeproperties.go @@ -0,0 +1,66 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LakeHouseLinkedServiceTypeProperties struct { + ArtifactId *string `json:"artifactId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + WorkspaceId *string `json:"workspaceId,omitempty"` +} + +var _ json.Unmarshaler = &LakeHouseLinkedServiceTypeProperties{} + +func (s *LakeHouseLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ArtifactId *string `json:"artifactId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + WorkspaceId *string `json:"workspaceId,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ArtifactId = decoded.ArtifactId + s.EncryptedCredential = decoded.EncryptedCredential + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.WorkspaceId = decoded.WorkspaceId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling LakeHouseLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'LakeHouseLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'LakeHouseLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselocation.go new file mode 100644 index 00000000000..32e37ae8509 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehouselocation.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = LakeHouseLocation{} + +type LakeHouseLocation struct { + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s LakeHouseLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = LakeHouseLocation{} + +func (s LakeHouseLocation) MarshalJSON() ([]byte, error) { + type wrapper LakeHouseLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling LakeHouseLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling LakeHouseLocation: %+v", err) + } + + decoded["type"] = "LakeHouseLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling LakeHouseLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehousetabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehousetabledataset.go new file mode 100644 index 00000000000..d26d01e7fbd --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehousetabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = LakeHouseTableDataset{} + +type LakeHouseTableDataset struct { + TypeProperties *LakeHouseTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s LakeHouseTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = LakeHouseTableDataset{} + +func (s LakeHouseTableDataset) MarshalJSON() ([]byte, error) { + type wrapper LakeHouseTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling LakeHouseTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling LakeHouseTableDataset: %+v", err) + } + + decoded["type"] = "LakeHouseTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling LakeHouseTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &LakeHouseTableDataset{} + +func (s *LakeHouseTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *LakeHouseTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling LakeHouseTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'LakeHouseTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehousetabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehousetabledatasettypeproperties.go new file mode 100644 index 00000000000..78a7cca709e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_lakehousetabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LakeHouseTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_licensedcomponentsetuptypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_licensedcomponentsetuptypeproperties.go new file mode 100644 index 00000000000..81fb81cd50f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_licensedcomponentsetuptypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LicensedComponentSetupTypeProperties struct { + ComponentName string `json:"componentName"` + LicenseKey SecretBase `json:"licenseKey"` +} + +var _ json.Unmarshaler = &LicensedComponentSetupTypeProperties{} + +func (s *LicensedComponentSetupTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ComponentName string `json:"componentName"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ComponentName = decoded.ComponentName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling LicensedComponentSetupTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["licenseKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LicenseKey' for 'LicensedComponentSetupTypeProperties': %+v", err) + } + s.LicenseKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimekeyauthorization.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimekeyauthorization.go new file mode 100644 index 00000000000..57fa7582129 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimekeyauthorization.go @@ -0,0 +1,50 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedIntegrationRuntimeType = LinkedIntegrationRuntimeKeyAuthorization{} + +type LinkedIntegrationRuntimeKeyAuthorization struct { + Key SecureString `json:"key"` + + // Fields inherited from LinkedIntegrationRuntimeType + + AuthorizationType string `json:"authorizationType"` +} + +func (s LinkedIntegrationRuntimeKeyAuthorization) LinkedIntegrationRuntimeType() BaseLinkedIntegrationRuntimeTypeImpl { + return BaseLinkedIntegrationRuntimeTypeImpl{ + AuthorizationType: s.AuthorizationType, + } +} + +var _ json.Marshaler = LinkedIntegrationRuntimeKeyAuthorization{} + +func (s LinkedIntegrationRuntimeKeyAuthorization) MarshalJSON() ([]byte, error) { + type wrapper LinkedIntegrationRuntimeKeyAuthorization + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling LinkedIntegrationRuntimeKeyAuthorization: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling LinkedIntegrationRuntimeKeyAuthorization: %+v", err) + } + + decoded["authorizationType"] = "Key" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling LinkedIntegrationRuntimeKeyAuthorization: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimerbacauthorization.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimerbacauthorization.go new file mode 100644 index 00000000000..a6faa8296e2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimerbacauthorization.go @@ -0,0 +1,51 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedIntegrationRuntimeType = LinkedIntegrationRuntimeRbacAuthorization{} + +type LinkedIntegrationRuntimeRbacAuthorization struct { + Credential *CredentialReference `json:"credential,omitempty"` + ResourceId string `json:"resourceId"` + + // Fields inherited from LinkedIntegrationRuntimeType + + AuthorizationType string `json:"authorizationType"` +} + +func (s LinkedIntegrationRuntimeRbacAuthorization) LinkedIntegrationRuntimeType() BaseLinkedIntegrationRuntimeTypeImpl { + return BaseLinkedIntegrationRuntimeTypeImpl{ + AuthorizationType: s.AuthorizationType, + } +} + +var _ json.Marshaler = LinkedIntegrationRuntimeRbacAuthorization{} + +func (s LinkedIntegrationRuntimeRbacAuthorization) MarshalJSON() ([]byte, error) { + type wrapper LinkedIntegrationRuntimeRbacAuthorization + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling LinkedIntegrationRuntimeRbacAuthorization: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling LinkedIntegrationRuntimeRbacAuthorization: %+v", err) + } + + decoded["authorizationType"] = "RBAC" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling LinkedIntegrationRuntimeRbacAuthorization: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimetype.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimetype.go new file mode 100644 index 00000000000..908b9b5a445 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedintegrationruntimetype.go @@ -0,0 +1,83 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinkedIntegrationRuntimeType interface { + LinkedIntegrationRuntimeType() BaseLinkedIntegrationRuntimeTypeImpl +} + +var _ LinkedIntegrationRuntimeType = BaseLinkedIntegrationRuntimeTypeImpl{} + +type BaseLinkedIntegrationRuntimeTypeImpl struct { + AuthorizationType string `json:"authorizationType"` +} + +func (s BaseLinkedIntegrationRuntimeTypeImpl) LinkedIntegrationRuntimeType() BaseLinkedIntegrationRuntimeTypeImpl { + return s +} + +var _ LinkedIntegrationRuntimeType = RawLinkedIntegrationRuntimeTypeImpl{} + +// RawLinkedIntegrationRuntimeTypeImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawLinkedIntegrationRuntimeTypeImpl struct { + linkedIntegrationRuntimeType BaseLinkedIntegrationRuntimeTypeImpl + Type string + Values map[string]interface{} +} + +func (s RawLinkedIntegrationRuntimeTypeImpl) LinkedIntegrationRuntimeType() BaseLinkedIntegrationRuntimeTypeImpl { + return s.linkedIntegrationRuntimeType +} + +func UnmarshalLinkedIntegrationRuntimeTypeImplementation(input []byte) (LinkedIntegrationRuntimeType, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling LinkedIntegrationRuntimeType into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["authorizationType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Key") { + var out LinkedIntegrationRuntimeKeyAuthorization + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into LinkedIntegrationRuntimeKeyAuthorization: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RBAC") { + var out LinkedIntegrationRuntimeRbacAuthorization + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into LinkedIntegrationRuntimeRbacAuthorization: %+v", err) + } + return out, nil + } + + var parent BaseLinkedIntegrationRuntimeTypeImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseLinkedIntegrationRuntimeTypeImpl: %+v", err) + } + + return RawLinkedIntegrationRuntimeTypeImpl{ + linkedIntegrationRuntimeType: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedservice.go index c23496266ef..a14782c1f66 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedservice.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedservice.go @@ -3,12 +3,19 @@ package dataflowdebugsession import ( "encoding/json" "fmt" + "strings" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type LinkedService struct { +type LinkedService interface { + LinkedService() BaseLinkedServiceImpl +} + +var _ LinkedService = BaseLinkedServiceImpl{} + +type BaseLinkedServiceImpl struct { Annotations *[]interface{} `json:"annotations,omitempty"` ConnectVia Reference `json:"connectVia"` Description *string `json:"description,omitempty"` @@ -17,9 +24,28 @@ type LinkedService struct { Version *string `json:"version,omitempty"` } -var _ json.Unmarshaler = &LinkedService{} +func (s BaseLinkedServiceImpl) LinkedService() BaseLinkedServiceImpl { + return s +} + +var _ LinkedService = RawLinkedServiceImpl{} + +// RawLinkedServiceImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawLinkedServiceImpl struct { + linkedService BaseLinkedServiceImpl + Type string + Values map[string]interface{} +} + +func (s RawLinkedServiceImpl) LinkedService() BaseLinkedServiceImpl { + return s.linkedService +} + +var _ json.Unmarshaler = &BaseLinkedServiceImpl{} -func (s *LinkedService) UnmarshalJSON(bytes []byte) error { +func (s *BaseLinkedServiceImpl) UnmarshalJSON(bytes []byte) error { var decoded struct { Annotations *[]interface{} `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` @@ -39,16 +65,1012 @@ func (s *LinkedService) UnmarshalJSON(bytes []byte) error { var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling LinkedService into map[string]json.RawMessage: %+v", err) + return fmt.Errorf("unmarshaling BaseLinkedServiceImpl into map[string]json.RawMessage: %+v", err) } if v, ok := temp["connectVia"]; ok { impl, err := UnmarshalReferenceImplementation(v) if err != nil { - return fmt.Errorf("unmarshaling field 'ConnectVia' for 'LinkedService': %+v", err) + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'BaseLinkedServiceImpl': %+v", err) } s.ConnectVia = impl } return nil } + +func UnmarshalLinkedServiceImplementation(input []byte) (LinkedService, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling LinkedService into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AmazonMWS") { + var out AmazonMWSLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonMWSLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonRdsForOracle") { + var out AmazonRdsForOracleLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonRdsForOracleLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonRdsForSqlServer") { + var out AmazonRdsForSqlServerLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonRdsForSqlServerLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonRedshift") { + var out AmazonRedshiftLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonRedshiftLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonS3Compatible") { + var out AmazonS3CompatibleLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonS3CompatibleLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmazonS3") { + var out AmazonS3LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmazonS3LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AppFigures") { + var out AppFiguresLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AppFiguresLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Asana") { + var out AsanaLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AsanaLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureBatch") { + var out AzureBatchLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureBatchLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureBlobFS") { + var out AzureBlobFSLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureBlobFSLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureBlobStorage") { + var out AzureBlobStorageLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureBlobStorageLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDataExplorer") { + var out AzureDataExplorerLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDataExplorerLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDataLakeAnalytics") { + var out AzureDataLakeAnalyticsLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDataLakeAnalyticsLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDataLakeStore") { + var out AzureDataLakeStoreLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDataLakeStoreLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDatabricksDeltaLake") { + var out AzureDatabricksDeltaLakeLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDatabricksDeltaLakeLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureDatabricks") { + var out AzureDatabricksLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureDatabricksLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureFileStorage") { + var out AzureFileStorageLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureFileStorageLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureFunction") { + var out AzureFunctionLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureFunctionLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureKeyVault") { + var out AzureKeyVaultLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureKeyVaultLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureML") { + var out AzureMLLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureMLLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureMLService") { + var out AzureMLServiceLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureMLServiceLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureMariaDB") { + var out AzureMariaDBLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureMariaDBLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureMySql") { + var out AzureMySqlLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureMySqlLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzurePostgreSql") { + var out AzurePostgreSqlLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzurePostgreSqlLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSearch") { + var out AzureSearchLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSearchLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSqlDW") { + var out AzureSqlDWLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSqlDWLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSqlDatabase") { + var out AzureSqlDatabaseLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSqlDatabaseLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSqlMI") { + var out AzureSqlMILinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSqlMILinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureStorage") { + var out AzureStorageLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureStorageLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureSynapseArtifacts") { + var out AzureSynapseArtifactsLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureSynapseArtifactsLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureTableStorage") { + var out AzureTableStorageLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureTableStorageLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Cassandra") { + var out CassandraLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CassandraLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CommonDataServiceForApps") { + var out CommonDataServiceForAppsLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CommonDataServiceForAppsLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Concur") { + var out ConcurLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConcurLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CosmosDb") { + var out CosmosDbLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CosmosDbLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CosmosDbMongoDbApi") { + var out CosmosDbMongoDbApiLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CosmosDbMongoDbApiLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Couchbase") { + var out CouchbaseLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CouchbaseLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CustomDataSource") { + var out CustomDataSourceLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CustomDataSourceLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Dataworld") { + var out DataworldLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DataworldLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Db2") { + var out Db2LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into Db2LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Drill") { + var out DrillLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DrillLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DynamicsAX") { + var out DynamicsAXLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DynamicsAXLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DynamicsCrm") { + var out DynamicsCrmLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DynamicsCrmLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Dynamics") { + var out DynamicsLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DynamicsLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Eloqua") { + var out EloquaLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into EloquaLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileServer") { + var out FileServerLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileServerLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FtpServer") { + var out FtpServerLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FtpServerLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleAdWords") { + var out GoogleAdWordsLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleAdWordsLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleBigQuery") { + var out GoogleBigQueryLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleBigQueryLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleBigQueryV2") { + var out GoogleBigQueryV2LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleBigQueryV2LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleCloudStorage") { + var out GoogleCloudStorageLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleCloudStorageLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GoogleSheets") { + var out GoogleSheetsLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GoogleSheetsLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Greenplum") { + var out GreenplumLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GreenplumLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HBase") { + var out HBaseLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HBaseLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HDInsight") { + var out HDInsightLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HDInsightLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HDInsightOnDemand") { + var out HDInsightOnDemandLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HDInsightOnDemandLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HttpServer") { + var out HTTPLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HTTPLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Hdfs") { + var out HdfsLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HdfsLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Hive") { + var out HiveLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HiveLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Hubspot") { + var out HubspotLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HubspotLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Impala") { + var out ImpalaLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ImpalaLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Informix") { + var out InformixLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into InformixLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Jira") { + var out JiraLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into JiraLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LakeHouse") { + var out LakeHouseLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into LakeHouseLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Magento") { + var out MagentoLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MagentoLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MariaDB") { + var out MariaDBLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MariaDBLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Marketo") { + var out MarketoLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MarketoLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MicrosoftAccess") { + var out MicrosoftAccessLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MicrosoftAccessLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbAtlas") { + var out MongoDbAtlasLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbAtlasLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDb") { + var out MongoDbLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbV2") { + var out MongoDbV2LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbV2LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySql") { + var out MySqlLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Netezza") { + var out NetezzaLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into NetezzaLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OData") { + var out ODataLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ODataLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Odbc") { + var out OdbcLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OdbcLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Office365") { + var out Office365LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into Office365LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleCloudStorage") { + var out OracleCloudStorageLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleCloudStorageLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Oracle") { + var out OracleLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleServiceCloud") { + var out OracleServiceCloudLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleServiceCloudLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Paypal") { + var out PaypalLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PaypalLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Phoenix") { + var out PhoenixLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PhoenixLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSql") { + var out PostgreSqlLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlV2") { + var out PostgreSqlV2LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlV2LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Presto") { + var out PrestoLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PrestoLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "QuickBooks") { + var out QuickBooksLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into QuickBooksLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Quickbase") { + var out QuickbaseLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into QuickbaseLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Responsys") { + var out ResponsysLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ResponsysLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RestService") { + var out RestServiceLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RestServiceLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Salesforce") { + var out SalesforceLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceMarketingCloud") { + var out SalesforceMarketingCloudLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceMarketingCloudLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceServiceCloud") { + var out SalesforceServiceCloudLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceServiceCloudLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceServiceCloudV2") { + var out SalesforceServiceCloudV2LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceServiceCloudV2LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SalesforceV2") { + var out SalesforceV2LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SalesforceV2LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapBW") { + var out SapBWLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapBWLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapCloudForCustomer") { + var out SapCloudForCustomerLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapCloudForCustomerLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapEcc") { + var out SapEccLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapEccLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapHana") { + var out SapHanaLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapHanaLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapOdp") { + var out SapOdpLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapOdpLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapOpenHub") { + var out SapOpenHubLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapOpenHubLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SapTable") { + var out SapTableLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SapTableLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ServiceNow") { + var out ServiceNowLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ServiceNowLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ServiceNowV2") { + var out ServiceNowV2LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ServiceNowV2LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Sftp") { + var out SftpServerLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SftpServerLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SharePointOnlineList") { + var out SharePointOnlineListLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SharePointOnlineListLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Shopify") { + var out ShopifyLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ShopifyLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Smartsheet") { + var out SmartsheetLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SmartsheetLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Snowflake") { + var out SnowflakeLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SnowflakeLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SnowflakeV2") { + var out SnowflakeV2LinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SnowflakeV2LinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Spark") { + var out SparkLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SparkLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlServer") { + var out SqlServerLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlServerLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Square") { + var out SquareLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SquareLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Sybase") { + var out SybaseLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SybaseLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TeamDesk") { + var out TeamDeskLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into TeamDeskLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Teradata") { + var out TeradataLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into TeradataLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Twilio") { + var out TwilioLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into TwilioLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Vertica") { + var out VerticaLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VerticaLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Warehouse") { + var out WarehouseLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into WarehouseLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Web") { + var out WebLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into WebLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Xero") { + var out XeroLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into XeroLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Zendesk") { + var out ZendeskLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ZendeskLinkedService: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Zoho") { + var out ZohoLinkedService + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ZohoLinkedService: %+v", err) + } + return out, nil + } + + var parent BaseLinkedServiceImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseLinkedServiceImpl: %+v", err) + } + + return RawLinkedServiceImpl{ + linkedService: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedservicedebugresource.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedservicedebugresource.go index f28e53f145c..f1906d0e720 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedservicedebugresource.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_linkedservicedebugresource.go @@ -1,5 +1,10 @@ package dataflowdebugsession +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -7,3 +12,31 @@ type LinkedServiceDebugResource struct { Name *string `json:"name,omitempty"` Properties LinkedService `json:"properties"` } + +var _ json.Unmarshaler = &LinkedServiceDebugResource{} + +func (s *LinkedServiceDebugResource) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Name *string `json:"name,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Name = decoded.Name + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling LinkedServiceDebugResource into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalLinkedServiceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'LinkedServiceDebugResource': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentolinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentolinkedservice.go new file mode 100644 index 00000000000..470820a0f13 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentolinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = MagentoLinkedService{} + +type MagentoLinkedService struct { + TypeProperties MagentoLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s MagentoLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = MagentoLinkedService{} + +func (s MagentoLinkedService) MarshalJSON() ([]byte, error) { + type wrapper MagentoLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MagentoLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MagentoLinkedService: %+v", err) + } + + decoded["type"] = "Magento" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MagentoLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MagentoLinkedService{} + +func (s *MagentoLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MagentoLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MagentoLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'MagentoLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentolinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentolinkedservicetypeproperties.go new file mode 100644 index 00000000000..3099dd22b60 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentolinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MagentoLinkedServiceTypeProperties struct { + AccessToken SecretBase `json:"accessToken"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &MagentoLinkedServiceTypeProperties{} + +func (s *MagentoLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MagentoLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accessToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessToken' for 'MagentoLinkedServiceTypeProperties': %+v", err) + } + s.AccessToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentoobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentoobjectdataset.go new file mode 100644 index 00000000000..a9028979ab5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_magentoobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = MagentoObjectDataset{} + +type MagentoObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s MagentoObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = MagentoObjectDataset{} + +func (s MagentoObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper MagentoObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MagentoObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MagentoObjectDataset: %+v", err) + } + + decoded["type"] = "MagentoObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MagentoObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MagentoObjectDataset{} + +func (s *MagentoObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MagentoObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'MagentoObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedintegrationruntime.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedintegrationruntime.go new file mode 100644 index 00000000000..a6722f46df5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedintegrationruntime.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ IntegrationRuntime = ManagedIntegrationRuntime{} + +type ManagedIntegrationRuntime struct { + ManagedVirtualNetwork *ManagedVirtualNetworkReference `json:"managedVirtualNetwork,omitempty"` + State *IntegrationRuntimeState `json:"state,omitempty"` + TypeProperties ManagedIntegrationRuntimeTypeProperties `json:"typeProperties"` + + // Fields inherited from IntegrationRuntime + + Description *string `json:"description,omitempty"` + Type IntegrationRuntimeType `json:"type"` +} + +func (s ManagedIntegrationRuntime) IntegrationRuntime() BaseIntegrationRuntimeImpl { + return BaseIntegrationRuntimeImpl{ + Description: s.Description, + Type: s.Type, + } +} + +var _ json.Marshaler = ManagedIntegrationRuntime{} + +func (s ManagedIntegrationRuntime) MarshalJSON() ([]byte, error) { + type wrapper ManagedIntegrationRuntime + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ManagedIntegrationRuntime: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ManagedIntegrationRuntime: %+v", err) + } + + decoded["type"] = "Managed" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ManagedIntegrationRuntime: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedintegrationruntimetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedintegrationruntimetypeproperties.go new file mode 100644 index 00000000000..0e48e97708b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedintegrationruntimetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedIntegrationRuntimeTypeProperties struct { + ComputeProperties *IntegrationRuntimeComputeProperties `json:"computeProperties,omitempty"` + CustomerVirtualNetwork *IntegrationRuntimeCustomerVirtualNetwork `json:"customerVirtualNetwork,omitempty"` + SsisProperties *IntegrationRuntimeSsisProperties `json:"ssisProperties,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedvirtualnetworkreference.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedvirtualnetworkreference.go new file mode 100644 index 00000000000..1d3c3632d59 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_managedvirtualnetworkreference.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedVirtualNetworkReference struct { + ReferenceName string `json:"referenceName"` + Type ManagedVirtualNetworkReferenceType `json:"type"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mappingdataflow.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mappingdataflow.go new file mode 100644 index 00000000000..76540f43b3d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mappingdataflow.go @@ -0,0 +1,56 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataFlow = MappingDataFlow{} + +type MappingDataFlow struct { + TypeProperties *MappingDataFlowTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from DataFlow + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DataFlowFolder `json:"folder,omitempty"` + Type string `json:"type"` +} + +func (s MappingDataFlow) DataFlow() BaseDataFlowImpl { + return BaseDataFlowImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + Type: s.Type, + } +} + +var _ json.Marshaler = MappingDataFlow{} + +func (s MappingDataFlow) MarshalJSON() ([]byte, error) { + type wrapper MappingDataFlow + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MappingDataFlow: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MappingDataFlow: %+v", err) + } + + decoded["type"] = "MappingDataFlow" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MappingDataFlow: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mappingdataflowtypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mappingdataflowtypeproperties.go new file mode 100644 index 00000000000..3c435ebd5b0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mappingdataflowtypeproperties.go @@ -0,0 +1,12 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MappingDataFlowTypeProperties struct { + Script *string `json:"script,omitempty"` + ScriptLines *[]string `json:"scriptLines,omitempty"` + Sinks *[]DataFlowSink `json:"sinks,omitempty"` + Sources *[]DataFlowSource `json:"sources,omitempty"` + Transformations *[]Transformation `json:"transformations,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadblinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadblinkedservice.go new file mode 100644 index 00000000000..33a05f1368e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadblinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = MariaDBLinkedService{} + +type MariaDBLinkedService struct { + TypeProperties MariaDBLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s MariaDBLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = MariaDBLinkedService{} + +func (s MariaDBLinkedService) MarshalJSON() ([]byte, error) { + type wrapper MariaDBLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MariaDBLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MariaDBLinkedService: %+v", err) + } + + decoded["type"] = "MariaDB" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MariaDBLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MariaDBLinkedService{} + +func (s *MariaDBLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MariaDBLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MariaDBLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'MariaDBLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadblinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadblinkedservicetypeproperties.go new file mode 100644 index 00000000000..db939cb28bc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadblinkedservicetypeproperties.go @@ -0,0 +1,17 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MariaDBLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + Database *string `json:"database,omitempty"` + DriverVersion *string `json:"driverVersion,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Port *int64 `json:"port,omitempty"` + Server *string `json:"server,omitempty"` + SslMode *int64 `json:"sslMode,omitempty"` + UseSystemTrustStore *int64 `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadbtabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadbtabledataset.go new file mode 100644 index 00000000000..8cb3eb429e1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mariadbtabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = MariaDBTableDataset{} + +type MariaDBTableDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s MariaDBTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = MariaDBTableDataset{} + +func (s MariaDBTableDataset) MarshalJSON() ([]byte, error) { + type wrapper MariaDBTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MariaDBTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MariaDBTableDataset: %+v", err) + } + + decoded["type"] = "MariaDBTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MariaDBTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MariaDBTableDataset{} + +func (s *MariaDBTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MariaDBTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'MariaDBTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketolinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketolinkedservice.go new file mode 100644 index 00000000000..e701e5eae49 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketolinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = MarketoLinkedService{} + +type MarketoLinkedService struct { + TypeProperties MarketoLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s MarketoLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = MarketoLinkedService{} + +func (s MarketoLinkedService) MarshalJSON() ([]byte, error) { + type wrapper MarketoLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MarketoLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MarketoLinkedService: %+v", err) + } + + decoded["type"] = "Marketo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MarketoLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MarketoLinkedService{} + +func (s *MarketoLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MarketoLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MarketoLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'MarketoLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketolinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketolinkedservicetypeproperties.go new file mode 100644 index 00000000000..2839ab5c6b6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketolinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MarketoLinkedServiceTypeProperties struct { + ClientId string `json:"clientId"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &MarketoLinkedServiceTypeProperties{} + +func (s *MarketoLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId string `json:"clientId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MarketoLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'MarketoLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketoobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketoobjectdataset.go new file mode 100644 index 00000000000..8fab02c9a79 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_marketoobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = MarketoObjectDataset{} + +type MarketoObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s MarketoObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = MarketoObjectDataset{} + +func (s MarketoObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper MarketoObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MarketoObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MarketoObjectDataset: %+v", err) + } + + decoded["type"] = "MarketoObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MarketoObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MarketoObjectDataset{} + +func (s *MarketoObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MarketoObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'MarketoObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesslinkedservice.go new file mode 100644 index 00000000000..da45d9a3ddc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = MicrosoftAccessLinkedService{} + +type MicrosoftAccessLinkedService struct { + TypeProperties MicrosoftAccessLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s MicrosoftAccessLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = MicrosoftAccessLinkedService{} + +func (s MicrosoftAccessLinkedService) MarshalJSON() ([]byte, error) { + type wrapper MicrosoftAccessLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MicrosoftAccessLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MicrosoftAccessLinkedService: %+v", err) + } + + decoded["type"] = "MicrosoftAccess" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MicrosoftAccessLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MicrosoftAccessLinkedService{} + +func (s *MicrosoftAccessLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MicrosoftAccessLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MicrosoftAccessLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'MicrosoftAccessLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesslinkedservicetypeproperties.go new file mode 100644 index 00000000000..af27e89a4e9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesslinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MicrosoftAccessLinkedServiceTypeProperties struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + ConnectionString string `json:"connectionString"` + Credential SecretBase `json:"credential"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &MicrosoftAccessLinkedServiceTypeProperties{} + +func (s *MicrosoftAccessLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ConnectionString = decoded.ConnectionString + s.EncryptedCredential = decoded.EncryptedCredential + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MicrosoftAccessLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["credential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Credential' for 'MicrosoftAccessLinkedServiceTypeProperties': %+v", err) + } + s.Credential = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'MicrosoftAccessLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesstabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesstabledataset.go new file mode 100644 index 00000000000..69feb4dac90 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesstabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = MicrosoftAccessTableDataset{} + +type MicrosoftAccessTableDataset struct { + TypeProperties *MicrosoftAccessTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s MicrosoftAccessTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = MicrosoftAccessTableDataset{} + +func (s MicrosoftAccessTableDataset) MarshalJSON() ([]byte, error) { + type wrapper MicrosoftAccessTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MicrosoftAccessTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MicrosoftAccessTableDataset: %+v", err) + } + + decoded["type"] = "MicrosoftAccessTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MicrosoftAccessTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MicrosoftAccessTableDataset{} + +func (s *MicrosoftAccessTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *MicrosoftAccessTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MicrosoftAccessTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'MicrosoftAccessTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesstabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesstabledatasettypeproperties.go new file mode 100644 index 00000000000..fef4fa3c3a9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_microsoftaccesstabledatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MicrosoftAccessTableDatasetTypeProperties struct { + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlascollectiondataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlascollectiondataset.go new file mode 100644 index 00000000000..7088ce0e014 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlascollectiondataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = MongoDbAtlasCollectionDataset{} + +type MongoDbAtlasCollectionDataset struct { + TypeProperties MongoDbAtlasCollectionDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s MongoDbAtlasCollectionDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = MongoDbAtlasCollectionDataset{} + +func (s MongoDbAtlasCollectionDataset) MarshalJSON() ([]byte, error) { + type wrapper MongoDbAtlasCollectionDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbAtlasCollectionDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbAtlasCollectionDataset: %+v", err) + } + + decoded["type"] = "MongoDbAtlasCollection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbAtlasCollectionDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbAtlasCollectionDataset{} + +func (s *MongoDbAtlasCollectionDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MongoDbAtlasCollectionDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbAtlasCollectionDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'MongoDbAtlasCollectionDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlascollectiondatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlascollectiondatasettypeproperties.go new file mode 100644 index 00000000000..fe07a60311b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlascollectiondatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbAtlasCollectionDatasetTypeProperties struct { + Collection string `json:"collection"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlaslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlaslinkedservice.go new file mode 100644 index 00000000000..381e74d477b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlaslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = MongoDbAtlasLinkedService{} + +type MongoDbAtlasLinkedService struct { + TypeProperties MongoDbAtlasLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s MongoDbAtlasLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = MongoDbAtlasLinkedService{} + +func (s MongoDbAtlasLinkedService) MarshalJSON() ([]byte, error) { + type wrapper MongoDbAtlasLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbAtlasLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbAtlasLinkedService: %+v", err) + } + + decoded["type"] = "MongoDbAtlas" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbAtlasLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbAtlasLinkedService{} + +func (s *MongoDbAtlasLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MongoDbAtlasLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbAtlasLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'MongoDbAtlasLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlaslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlaslinkedservicetypeproperties.go new file mode 100644 index 00000000000..ca7211cd441 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbatlaslinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbAtlasLinkedServiceTypeProperties struct { + ConnectionString string `json:"connectionString"` + Database string `json:"database"` + DriverVersion *string `json:"driverVersion,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbcollectiondataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbcollectiondataset.go new file mode 100644 index 00000000000..22f7ef9adcc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbcollectiondataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = MongoDbCollectionDataset{} + +type MongoDbCollectionDataset struct { + TypeProperties MongoDbCollectionDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s MongoDbCollectionDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = MongoDbCollectionDataset{} + +func (s MongoDbCollectionDataset) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionDataset: %+v", err) + } + + decoded["type"] = "MongoDbCollection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbCollectionDataset{} + +func (s *MongoDbCollectionDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MongoDbCollectionDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbCollectionDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'MongoDbCollectionDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbcollectiondatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbcollectiondatasettypeproperties.go new file mode 100644 index 00000000000..1e77a8002ef --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbcollectiondatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionDatasetTypeProperties struct { + CollectionName string `json:"collectionName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodblinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodblinkedservice.go new file mode 100644 index 00000000000..ebb79ed3963 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodblinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = MongoDbLinkedService{} + +type MongoDbLinkedService struct { + TypeProperties MongoDbLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s MongoDbLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = MongoDbLinkedService{} + +func (s MongoDbLinkedService) MarshalJSON() ([]byte, error) { + type wrapper MongoDbLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbLinkedService: %+v", err) + } + + decoded["type"] = "MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbLinkedService{} + +func (s *MongoDbLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MongoDbLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'MongoDbLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodblinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodblinkedservicetypeproperties.go new file mode 100644 index 00000000000..eefd9f1d721 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodblinkedservicetypeproperties.go @@ -0,0 +1,66 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbLinkedServiceTypeProperties struct { + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthSource *string `json:"authSource,omitempty"` + AuthenticationType *MongoDbAuthenticationType `json:"authenticationType,omitempty"` + DatabaseName string `json:"databaseName"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + Server string `json:"server"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &MongoDbLinkedServiceTypeProperties{} + +func (s *MongoDbLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthSource *string `json:"authSource,omitempty"` + AuthenticationType *MongoDbAuthenticationType `json:"authenticationType,omitempty"` + DatabaseName string `json:"databaseName"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Port *int64 `json:"port,omitempty"` + Server string `json:"server"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert + s.AuthSource = decoded.AuthSource + s.AuthenticationType = decoded.AuthenticationType + s.DatabaseName = decoded.DatabaseName + s.EnableSsl = decoded.EnableSsl + s.EncryptedCredential = decoded.EncryptedCredential + s.Port = decoded.Port + s.Server = decoded.Server + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'MongoDbLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2collectiondataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2collectiondataset.go new file mode 100644 index 00000000000..1f452bb38ce --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2collectiondataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = MongoDbV2CollectionDataset{} + +type MongoDbV2CollectionDataset struct { + TypeProperties MongoDbV2CollectionDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s MongoDbV2CollectionDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = MongoDbV2CollectionDataset{} + +func (s MongoDbV2CollectionDataset) MarshalJSON() ([]byte, error) { + type wrapper MongoDbV2CollectionDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbV2CollectionDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbV2CollectionDataset: %+v", err) + } + + decoded["type"] = "MongoDbV2Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbV2CollectionDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbV2CollectionDataset{} + +func (s *MongoDbV2CollectionDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MongoDbV2CollectionDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbV2CollectionDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'MongoDbV2CollectionDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2collectiondatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2collectiondatasettypeproperties.go new file mode 100644 index 00000000000..54ba7a04393 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2collectiondatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbV2CollectionDatasetTypeProperties struct { + Collection string `json:"collection"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2linkedservice.go new file mode 100644 index 00000000000..37130c204bf --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = MongoDbV2LinkedService{} + +type MongoDbV2LinkedService struct { + TypeProperties MongoDbV2LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s MongoDbV2LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = MongoDbV2LinkedService{} + +func (s MongoDbV2LinkedService) MarshalJSON() ([]byte, error) { + type wrapper MongoDbV2LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbV2LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbV2LinkedService: %+v", err) + } + + decoded["type"] = "MongoDbV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbV2LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbV2LinkedService{} + +func (s *MongoDbV2LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MongoDbV2LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbV2LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'MongoDbV2LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2linkedservicetypeproperties.go new file mode 100644 index 00000000000..0eb61c3eb3e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mongodbv2linkedservicetypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbV2LinkedServiceTypeProperties struct { + ConnectionString string `json:"connectionString"` + Database string `json:"database"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqllinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqllinkedservice.go new file mode 100644 index 00000000000..865e680fd53 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqllinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = MySqlLinkedService{} + +type MySqlLinkedService struct { + TypeProperties MySqlLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s MySqlLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = MySqlLinkedService{} + +func (s MySqlLinkedService) MarshalJSON() ([]byte, error) { + type wrapper MySqlLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlLinkedService: %+v", err) + } + + decoded["type"] = "MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MySqlLinkedService{} + +func (s *MySqlLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties MySqlLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MySqlLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'MySqlLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqllinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqllinkedservicetypeproperties.go new file mode 100644 index 00000000000..fcedf4c6c1e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqllinkedservicetypeproperties.go @@ -0,0 +1,17 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MySqlLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + Database *string `json:"database,omitempty"` + DriverVersion *string `json:"driverVersion,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Port *int64 `json:"port,omitempty"` + Server *string `json:"server,omitempty"` + SslMode *int64 `json:"sslMode,omitempty"` + UseSystemTrustStore *int64 `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqltabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqltabledataset.go new file mode 100644 index 00000000000..2fe32d320ac --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqltabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = MySqlTableDataset{} + +type MySqlTableDataset struct { + TypeProperties *MySqlTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s MySqlTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = MySqlTableDataset{} + +func (s MySqlTableDataset) MarshalJSON() ([]byte, error) { + type wrapper MySqlTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlTableDataset: %+v", err) + } + + decoded["type"] = "MySqlTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MySqlTableDataset{} + +func (s *MySqlTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *MySqlTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MySqlTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'MySqlTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqltabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqltabledatasettypeproperties.go new file mode 100644 index 00000000000..dd8dc71356b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_mysqltabledatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MySqlTableDatasetTypeProperties struct { + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzalinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzalinkedservice.go new file mode 100644 index 00000000000..88d2b0178ee --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzalinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = NetezzaLinkedService{} + +type NetezzaLinkedService struct { + TypeProperties NetezzaLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s NetezzaLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = NetezzaLinkedService{} + +func (s NetezzaLinkedService) MarshalJSON() ([]byte, error) { + type wrapper NetezzaLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling NetezzaLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling NetezzaLinkedService: %+v", err) + } + + decoded["type"] = "Netezza" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling NetezzaLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &NetezzaLinkedService{} + +func (s *NetezzaLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties NetezzaLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling NetezzaLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'NetezzaLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzalinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzalinkedservicetypeproperties.go new file mode 100644 index 00000000000..2ddc1072500 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzalinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetezzaLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Pwd *AzureKeyVaultSecretReference `json:"pwd,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzatabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzatabledataset.go new file mode 100644 index 00000000000..26f45f40c7c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzatabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = NetezzaTableDataset{} + +type NetezzaTableDataset struct { + TypeProperties *NetezzaTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s NetezzaTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = NetezzaTableDataset{} + +func (s NetezzaTableDataset) MarshalJSON() ([]byte, error) { + type wrapper NetezzaTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling NetezzaTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling NetezzaTableDataset: %+v", err) + } + + decoded["type"] = "NetezzaTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling NetezzaTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &NetezzaTableDataset{} + +func (s *NetezzaTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *NetezzaTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling NetezzaTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'NetezzaTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzatabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzatabledatasettypeproperties.go new file mode 100644 index 00000000000..6873e889cf9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_netezzatabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetezzaTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odatalinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odatalinkedservice.go new file mode 100644 index 00000000000..70ed623d64e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odatalinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ODataLinkedService{} + +type ODataLinkedService struct { + TypeProperties ODataLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ODataLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ODataLinkedService{} + +func (s ODataLinkedService) MarshalJSON() ([]byte, error) { + type wrapper ODataLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ODataLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ODataLinkedService: %+v", err) + } + + decoded["type"] = "OData" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ODataLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ODataLinkedService{} + +func (s *ODataLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ODataLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ODataLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ODataLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odatalinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odatalinkedservicetypeproperties.go new file mode 100644 index 00000000000..6f7ae3bc550 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odatalinkedservicetypeproperties.go @@ -0,0 +1,96 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ODataLinkedServiceTypeProperties struct { + AadResourceId *string `json:"aadResourceId,omitempty"` + AadServicePrincipalCredentialType *ODataAadServicePrincipalCredentialType `json:"aadServicePrincipalCredentialType,omitempty"` + AuthHeaders *map[string]string `json:"authHeaders,omitempty"` + AuthenticationType *ODataAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + ServicePrincipalEmbeddedCert SecretBase `json:"servicePrincipalEmbeddedCert"` + ServicePrincipalEmbeddedCertPassword SecretBase `json:"servicePrincipalEmbeddedCertPassword"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &ODataLinkedServiceTypeProperties{} + +func (s *ODataLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AadResourceId *string `json:"aadResourceId,omitempty"` + AadServicePrincipalCredentialType *ODataAadServicePrincipalCredentialType `json:"aadServicePrincipalCredentialType,omitempty"` + AuthHeaders *map[string]string `json:"authHeaders,omitempty"` + AuthenticationType *ODataAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AadResourceId = decoded.AadResourceId + s.AadServicePrincipalCredentialType = decoded.AadServicePrincipalCredentialType + s.AuthHeaders = decoded.AuthHeaders + s.AuthenticationType = decoded.AuthenticationType + s.AzureCloudType = decoded.AzureCloudType + s.EncryptedCredential = decoded.EncryptedCredential + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.Url = decoded.Url + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ODataLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'ODataLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["servicePrincipalEmbeddedCert"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalEmbeddedCert' for 'ODataLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalEmbeddedCert = impl + } + + if v, ok := temp["servicePrincipalEmbeddedCertPassword"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalEmbeddedCertPassword' for 'ODataLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalEmbeddedCertPassword = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'ODataLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odataresourcedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odataresourcedataset.go new file mode 100644 index 00000000000..39b37f68f7d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odataresourcedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ODataResourceDataset{} + +type ODataResourceDataset struct { + TypeProperties *ODataResourceDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ODataResourceDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ODataResourceDataset{} + +func (s ODataResourceDataset) MarshalJSON() ([]byte, error) { + type wrapper ODataResourceDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ODataResourceDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ODataResourceDataset: %+v", err) + } + + decoded["type"] = "ODataResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ODataResourceDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ODataResourceDataset{} + +func (s *ODataResourceDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *ODataResourceDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ODataResourceDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ODataResourceDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odataresourcedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odataresourcedatasettypeproperties.go new file mode 100644 index 00000000000..7cb0c50128a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odataresourcedatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ODataResourceDatasetTypeProperties struct { + Path *string `json:"path,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbclinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbclinkedservice.go new file mode 100644 index 00000000000..c4d295b00b3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbclinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = OdbcLinkedService{} + +type OdbcLinkedService struct { + TypeProperties OdbcLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s OdbcLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = OdbcLinkedService{} + +func (s OdbcLinkedService) MarshalJSON() ([]byte, error) { + type wrapper OdbcLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OdbcLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OdbcLinkedService: %+v", err) + } + + decoded["type"] = "Odbc" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OdbcLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &OdbcLinkedService{} + +func (s *OdbcLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties OdbcLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OdbcLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'OdbcLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbclinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbclinkedservicetypeproperties.go new file mode 100644 index 00000000000..c6858870079 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbclinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OdbcLinkedServiceTypeProperties struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + ConnectionString string `json:"connectionString"` + Credential SecretBase `json:"credential"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &OdbcLinkedServiceTypeProperties{} + +func (s *OdbcLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *string `json:"authenticationType,omitempty"` + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ConnectionString = decoded.ConnectionString + s.EncryptedCredential = decoded.EncryptedCredential + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OdbcLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["credential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Credential' for 'OdbcLinkedServiceTypeProperties': %+v", err) + } + s.Credential = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'OdbcLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbctabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbctabledataset.go new file mode 100644 index 00000000000..88af7574838 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbctabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = OdbcTableDataset{} + +type OdbcTableDataset struct { + TypeProperties *OdbcTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s OdbcTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = OdbcTableDataset{} + +func (s OdbcTableDataset) MarshalJSON() ([]byte, error) { + type wrapper OdbcTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OdbcTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OdbcTableDataset: %+v", err) + } + + decoded["type"] = "OdbcTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OdbcTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &OdbcTableDataset{} + +func (s *OdbcTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *OdbcTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OdbcTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'OdbcTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbctabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbctabledatasettypeproperties.go new file mode 100644 index 00000000000..fd498278e39 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_odbctabledatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OdbcTableDatasetTypeProperties struct { + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365dataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365dataset.go new file mode 100644 index 00000000000..bb06dfbca4a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365dataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = Office365Dataset{} + +type Office365Dataset struct { + TypeProperties Office365DatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s Office365Dataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = Office365Dataset{} + +func (s Office365Dataset) MarshalJSON() ([]byte, error) { + type wrapper Office365Dataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling Office365Dataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling Office365Dataset: %+v", err) + } + + decoded["type"] = "Office365Table" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling Office365Dataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &Office365Dataset{} + +func (s *Office365Dataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties Office365DatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling Office365Dataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'Office365Dataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365datasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365datasettypeproperties.go new file mode 100644 index 00000000000..5703e3d371c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365datasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Office365DatasetTypeProperties struct { + Predicate *string `json:"predicate,omitempty"` + TableName string `json:"tableName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365linkedservice.go new file mode 100644 index 00000000000..d43fa22d761 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = Office365LinkedService{} + +type Office365LinkedService struct { + TypeProperties Office365LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s Office365LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = Office365LinkedService{} + +func (s Office365LinkedService) MarshalJSON() ([]byte, error) { + type wrapper Office365LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling Office365LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling Office365LinkedService: %+v", err) + } + + decoded["type"] = "Office365" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling Office365LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &Office365LinkedService{} + +func (s *Office365LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties Office365LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling Office365LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'Office365LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365linkedservicetypeproperties.go new file mode 100644 index 00000000000..d7f1eac53fc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_office365linkedservicetypeproperties.go @@ -0,0 +1,51 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Office365LinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Office365TenantId string `json:"office365TenantId"` + ServicePrincipalId string `json:"servicePrincipalId"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + ServicePrincipalTenantId string `json:"servicePrincipalTenantId"` +} + +var _ json.Unmarshaler = &Office365LinkedServiceTypeProperties{} + +func (s *Office365LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Office365TenantId string `json:"office365TenantId"` + ServicePrincipalId string `json:"servicePrincipalId"` + ServicePrincipalTenantId string `json:"servicePrincipalTenantId"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Office365TenantId = decoded.Office365TenantId + s.ServicePrincipalId = decoded.ServicePrincipalId + s.ServicePrincipalTenantId = decoded.ServicePrincipalTenantId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling Office365LinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'Office365LinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelinkedservice.go new file mode 100644 index 00000000000..cc01a0bcd4d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = OracleCloudStorageLinkedService{} + +type OracleCloudStorageLinkedService struct { + TypeProperties OracleCloudStorageLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s OracleCloudStorageLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = OracleCloudStorageLinkedService{} + +func (s OracleCloudStorageLinkedService) MarshalJSON() ([]byte, error) { + type wrapper OracleCloudStorageLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleCloudStorageLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleCloudStorageLinkedService: %+v", err) + } + + decoded["type"] = "OracleCloudStorage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleCloudStorageLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &OracleCloudStorageLinkedService{} + +func (s *OracleCloudStorageLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties OracleCloudStorageLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OracleCloudStorageLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'OracleCloudStorageLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelinkedservicetypeproperties.go new file mode 100644 index 00000000000..83e56a6146b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelinkedservicetypeproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleCloudStorageLinkedServiceTypeProperties struct { + AccessKeyId *string `json:"accessKeyId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + SecretAccessKey SecretBase `json:"secretAccessKey"` + ServiceURL *string `json:"serviceUrl,omitempty"` +} + +var _ json.Unmarshaler = &OracleCloudStorageLinkedServiceTypeProperties{} + +func (s *OracleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccessKeyId *string `json:"accessKeyId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccessKeyId = decoded.AccessKeyId + s.EncryptedCredential = decoded.EncryptedCredential + s.ServiceURL = decoded.ServiceURL + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OracleCloudStorageLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["secretAccessKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SecretAccessKey' for 'OracleCloudStorageLinkedServiceTypeProperties': %+v", err) + } + s.SecretAccessKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelocation.go new file mode 100644 index 00000000000..85ddce93fe1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclecloudstoragelocation.go @@ -0,0 +1,55 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = OracleCloudStorageLocation{} + +type OracleCloudStorageLocation struct { + BucketName *string `json:"bucketName,omitempty"` + Version *string `json:"version,omitempty"` + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s OracleCloudStorageLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = OracleCloudStorageLocation{} + +func (s OracleCloudStorageLocation) MarshalJSON() ([]byte, error) { + type wrapper OracleCloudStorageLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleCloudStorageLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleCloudStorageLocation: %+v", err) + } + + decoded["type"] = "OracleCloudStorageLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleCloudStorageLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclelinkedservice.go new file mode 100644 index 00000000000..21a22c127cc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = OracleLinkedService{} + +type OracleLinkedService struct { + TypeProperties OracleLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s OracleLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = OracleLinkedService{} + +func (s OracleLinkedService) MarshalJSON() ([]byte, error) { + type wrapper OracleLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleLinkedService: %+v", err) + } + + decoded["type"] = "Oracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &OracleLinkedService{} + +func (s *OracleLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties OracleLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OracleLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'OracleLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclelinkedservicetypeproperties.go new file mode 100644 index 00000000000..3447e50770a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oraclelinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleLinkedServiceTypeProperties struct { + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudlinkedservice.go new file mode 100644 index 00000000000..6ffe916b6e3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = OracleServiceCloudLinkedService{} + +type OracleServiceCloudLinkedService struct { + TypeProperties OracleServiceCloudLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s OracleServiceCloudLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = OracleServiceCloudLinkedService{} + +func (s OracleServiceCloudLinkedService) MarshalJSON() ([]byte, error) { + type wrapper OracleServiceCloudLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleServiceCloudLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleServiceCloudLinkedService: %+v", err) + } + + decoded["type"] = "OracleServiceCloud" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleServiceCloudLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &OracleServiceCloudLinkedService{} + +func (s *OracleServiceCloudLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties OracleServiceCloudLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OracleServiceCloudLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'OracleServiceCloudLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudlinkedservicetypeproperties.go new file mode 100644 index 00000000000..3b8d3503015 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudlinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleServiceCloudLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username string `json:"username"` +} + +var _ json.Unmarshaler = &OracleServiceCloudLinkedServiceTypeProperties{} + +func (s *OracleServiceCloudLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username string `json:"username"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OracleServiceCloudLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'OracleServiceCloudLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudobjectdataset.go new file mode 100644 index 00000000000..677ce6331f7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracleservicecloudobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = OracleServiceCloudObjectDataset{} + +type OracleServiceCloudObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s OracleServiceCloudObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = OracleServiceCloudObjectDataset{} + +func (s OracleServiceCloudObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper OracleServiceCloudObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleServiceCloudObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleServiceCloudObjectDataset: %+v", err) + } + + decoded["type"] = "OracleServiceCloudObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleServiceCloudObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &OracleServiceCloudObjectDataset{} + +func (s *OracleServiceCloudObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OracleServiceCloudObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'OracleServiceCloudObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracletabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracletabledataset.go new file mode 100644 index 00000000000..99a40335c19 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracletabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = OracleTableDataset{} + +type OracleTableDataset struct { + TypeProperties *OracleTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s OracleTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = OracleTableDataset{} + +func (s OracleTableDataset) MarshalJSON() ([]byte, error) { + type wrapper OracleTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleTableDataset: %+v", err) + } + + decoded["type"] = "OracleTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &OracleTableDataset{} + +func (s *OracleTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *OracleTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OracleTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'OracleTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracletabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracletabledatasettypeproperties.go new file mode 100644 index 00000000000..2c7e6431bfa --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_oracletabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcdataset.go new file mode 100644 index 00000000000..4e1cbf912d0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = OrcDataset{} + +type OrcDataset struct { + TypeProperties *OrcDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s OrcDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = OrcDataset{} + +func (s OrcDataset) MarshalJSON() ([]byte, error) { + type wrapper OrcDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OrcDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OrcDataset: %+v", err) + } + + decoded["type"] = "Orc" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OrcDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &OrcDataset{} + +func (s *OrcDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *OrcDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OrcDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'OrcDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcdatasettypeproperties.go new file mode 100644 index 00000000000..26994cb9389 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcdatasettypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrcDatasetTypeProperties struct { + Location DatasetLocation `json:"location"` + OrcCompressionCodec *string `json:"orcCompressionCodec,omitempty"` +} + +var _ json.Unmarshaler = &OrcDatasetTypeProperties{} + +func (s *OrcDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + OrcCompressionCodec *string `json:"orcCompressionCodec,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.OrcCompressionCodec = decoded.OrcCompressionCodec + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OrcDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'OrcDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcformat.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcformat.go new file mode 100644 index 00000000000..b5d6a9f11d0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_orcformat.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetStorageFormat = OrcFormat{} + +type OrcFormat struct { + + // Fields inherited from DatasetStorageFormat + + Deserializer *string `json:"deserializer,omitempty"` + Serializer *string `json:"serializer,omitempty"` + Type string `json:"type"` +} + +func (s OrcFormat) DatasetStorageFormat() BaseDatasetStorageFormatImpl { + return BaseDatasetStorageFormatImpl{ + Deserializer: s.Deserializer, + Serializer: s.Serializer, + Type: s.Type, + } +} + +var _ json.Marshaler = OrcFormat{} + +func (s OrcFormat) MarshalJSON() ([]byte, error) { + type wrapper OrcFormat + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OrcFormat: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OrcFormat: %+v", err) + } + + decoded["type"] = "OrcFormat" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OrcFormat: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_packagestore.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_packagestore.go new file mode 100644 index 00000000000..20431a038da --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_packagestore.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PackageStore struct { + Name string `json:"name"` + PackageStoreLinkedService EntityReference `json:"packageStoreLinkedService"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetdataset.go new file mode 100644 index 00000000000..96d9f5c58ae --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ParquetDataset{} + +type ParquetDataset struct { + TypeProperties *ParquetDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ParquetDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ParquetDataset{} + +func (s ParquetDataset) MarshalJSON() ([]byte, error) { + type wrapper ParquetDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ParquetDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ParquetDataset: %+v", err) + } + + decoded["type"] = "Parquet" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ParquetDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ParquetDataset{} + +func (s *ParquetDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *ParquetDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ParquetDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ParquetDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetdatasettypeproperties.go new file mode 100644 index 00000000000..40723df5822 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetdatasettypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ParquetDatasetTypeProperties struct { + CompressionCodec *string `json:"compressionCodec,omitempty"` + Location DatasetLocation `json:"location"` +} + +var _ json.Unmarshaler = &ParquetDatasetTypeProperties{} + +func (s *ParquetDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CompressionCodec *string `json:"compressionCodec,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CompressionCodec = decoded.CompressionCodec + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ParquetDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'ParquetDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetformat.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetformat.go new file mode 100644 index 00000000000..ce224659731 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_parquetformat.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetStorageFormat = ParquetFormat{} + +type ParquetFormat struct { + + // Fields inherited from DatasetStorageFormat + + Deserializer *string `json:"deserializer,omitempty"` + Serializer *string `json:"serializer,omitempty"` + Type string `json:"type"` +} + +func (s ParquetFormat) DatasetStorageFormat() BaseDatasetStorageFormatImpl { + return BaseDatasetStorageFormatImpl{ + Deserializer: s.Deserializer, + Serializer: s.Serializer, + Type: s.Type, + } +} + +var _ json.Marshaler = ParquetFormat{} + +func (s ParquetFormat) MarshalJSON() ([]byte, error) { + type wrapper ParquetFormat + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ParquetFormat: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ParquetFormat: %+v", err) + } + + decoded["type"] = "ParquetFormat" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ParquetFormat: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypallinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypallinkedservice.go new file mode 100644 index 00000000000..39492a12b4c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypallinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = PaypalLinkedService{} + +type PaypalLinkedService struct { + TypeProperties PaypalLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s PaypalLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = PaypalLinkedService{} + +func (s PaypalLinkedService) MarshalJSON() ([]byte, error) { + type wrapper PaypalLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PaypalLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PaypalLinkedService: %+v", err) + } + + decoded["type"] = "Paypal" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PaypalLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PaypalLinkedService{} + +func (s *PaypalLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties PaypalLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PaypalLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'PaypalLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypallinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypallinkedservicetypeproperties.go new file mode 100644 index 00000000000..f5de7441aa0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypallinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PaypalLinkedServiceTypeProperties struct { + ClientId string `json:"clientId"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &PaypalLinkedServiceTypeProperties{} + +func (s *PaypalLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId string `json:"clientId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PaypalLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'PaypalLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypalobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypalobjectdataset.go new file mode 100644 index 00000000000..417c913f7ce --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_paypalobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = PaypalObjectDataset{} + +type PaypalObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s PaypalObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = PaypalObjectDataset{} + +func (s PaypalObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper PaypalObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PaypalObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PaypalObjectDataset: %+v", err) + } + + decoded["type"] = "PaypalObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PaypalObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PaypalObjectDataset{} + +func (s *PaypalObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PaypalObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'PaypalObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixdatasettypeproperties.go new file mode 100644 index 00000000000..b2ab6fa3b29 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixdatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PhoenixDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixlinkedservice.go new file mode 100644 index 00000000000..f74c73435dd --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = PhoenixLinkedService{} + +type PhoenixLinkedService struct { + TypeProperties PhoenixLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s PhoenixLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = PhoenixLinkedService{} + +func (s PhoenixLinkedService) MarshalJSON() ([]byte, error) { + type wrapper PhoenixLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PhoenixLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PhoenixLinkedService: %+v", err) + } + + decoded["type"] = "Phoenix" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PhoenixLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PhoenixLinkedService{} + +func (s *PhoenixLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties PhoenixLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PhoenixLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'PhoenixLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixlinkedservicetypeproperties.go new file mode 100644 index 00000000000..dfe6cc1ecfa --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixlinkedservicetypeproperties.go @@ -0,0 +1,72 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PhoenixLinkedServiceTypeProperties struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType PhoenixAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HTTPPath *string `json:"httpPath,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &PhoenixLinkedServiceTypeProperties{} + +func (s *PhoenixLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType PhoenixAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HTTPPath *string `json:"httpPath,omitempty"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AllowHostNameCNMismatch = decoded.AllowHostNameCNMismatch + s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert + s.AuthenticationType = decoded.AuthenticationType + s.EnableSsl = decoded.EnableSsl + s.EncryptedCredential = decoded.EncryptedCredential + s.HTTPPath = decoded.HTTPPath + s.Host = decoded.Host + s.Port = decoded.Port + s.TrustedCertPath = decoded.TrustedCertPath + s.UseSystemTrustStore = decoded.UseSystemTrustStore + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PhoenixLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'PhoenixLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixobjectdataset.go new file mode 100644 index 00000000000..1ec1ea9019c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_phoenixobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = PhoenixObjectDataset{} + +type PhoenixObjectDataset struct { + TypeProperties *PhoenixDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s PhoenixObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = PhoenixObjectDataset{} + +func (s PhoenixObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper PhoenixObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PhoenixObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PhoenixObjectDataset: %+v", err) + } + + decoded["type"] = "PhoenixObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PhoenixObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PhoenixObjectDataset{} + +func (s *PhoenixObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *PhoenixDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PhoenixObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'PhoenixObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_pipelineexternalcomputescaleproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_pipelineexternalcomputescaleproperties.go new file mode 100644 index 00000000000..fed69f1a537 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_pipelineexternalcomputescaleproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PipelineExternalComputeScaleProperties struct { + NumberOfExternalNodes *int64 `json:"numberOfExternalNodes,omitempty"` + NumberOfPipelineNodes *int64 `json:"numberOfPipelineNodes,omitempty"` + TimeToLive *int64 `json:"timeToLive,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqllinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqllinkedservice.go new file mode 100644 index 00000000000..edcf8d11398 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqllinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = PostgreSqlLinkedService{} + +type PostgreSqlLinkedService struct { + TypeProperties PostgreSqlLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s PostgreSqlLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = PostgreSqlLinkedService{} + +func (s PostgreSqlLinkedService) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlLinkedService: %+v", err) + } + + decoded["type"] = "PostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PostgreSqlLinkedService{} + +func (s *PostgreSqlLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties PostgreSqlLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PostgreSqlLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'PostgreSqlLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqllinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqllinkedservicetypeproperties.go new file mode 100644 index 00000000000..19d03154ac4 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqllinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PostgreSqlLinkedServiceTypeProperties struct { + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqltabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqltabledataset.go new file mode 100644 index 00000000000..c4895afaf17 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqltabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = PostgreSqlTableDataset{} + +type PostgreSqlTableDataset struct { + TypeProperties *PostgreSqlTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s PostgreSqlTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = PostgreSqlTableDataset{} + +func (s PostgreSqlTableDataset) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlTableDataset: %+v", err) + } + + decoded["type"] = "PostgreSqlTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PostgreSqlTableDataset{} + +func (s *PostgreSqlTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *PostgreSqlTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PostgreSqlTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'PostgreSqlTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqltabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqltabledatasettypeproperties.go new file mode 100644 index 00000000000..8c3157fa2c1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqltabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PostgreSqlTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2linkedservice.go new file mode 100644 index 00000000000..36a972bbe7a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = PostgreSqlV2LinkedService{} + +type PostgreSqlV2LinkedService struct { + TypeProperties PostgreSqlV2LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s PostgreSqlV2LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = PostgreSqlV2LinkedService{} + +func (s PostgreSqlV2LinkedService) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlV2LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlV2LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlV2LinkedService: %+v", err) + } + + decoded["type"] = "PostgreSqlV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlV2LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PostgreSqlV2LinkedService{} + +func (s *PostgreSqlV2LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties PostgreSqlV2LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PostgreSqlV2LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'PostgreSqlV2LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2linkedservicetypeproperties.go new file mode 100644 index 00000000000..b0a6f866bbf --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2linkedservicetypeproperties.go @@ -0,0 +1,26 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PostgreSqlV2LinkedServiceTypeProperties struct { + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectionTimeout *int64 `json:"connectionTimeout,omitempty"` + Database string `json:"database"` + Encoding *string `json:"encoding,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + LogParameters *bool `json:"logParameters,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Port *int64 `json:"port,omitempty"` + ReadBufferSize *int64 `json:"readBufferSize,omitempty"` + Schema *string `json:"schema,omitempty"` + Server string `json:"server"` + SslCertificate *string `json:"sslCertificate,omitempty"` + SslKey *string `json:"sslKey,omitempty"` + SslMode int64 `json:"sslMode"` + SslPassword *string `json:"sslPassword,omitempty"` + Timezone *string `json:"timezone,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + Username string `json:"username"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2tabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2tabledataset.go new file mode 100644 index 00000000000..8942cb4a89f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2tabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = PostgreSqlV2TableDataset{} + +type PostgreSqlV2TableDataset struct { + TypeProperties *PostgreSqlV2TableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s PostgreSqlV2TableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = PostgreSqlV2TableDataset{} + +func (s PostgreSqlV2TableDataset) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlV2TableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlV2TableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlV2TableDataset: %+v", err) + } + + decoded["type"] = "PostgreSqlV2Table" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlV2TableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PostgreSqlV2TableDataset{} + +func (s *PostgreSqlV2TableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *PostgreSqlV2TableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PostgreSqlV2TableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'PostgreSqlV2TableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2tabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2tabledatasettypeproperties.go new file mode 100644 index 00000000000..361b10fbe3a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_postgresqlv2tabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PostgreSqlV2TableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_powerquerysource.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_powerquerysource.go new file mode 100644 index 00000000000..030b92cca74 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_powerquerysource.go @@ -0,0 +1,14 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PowerQuerySource struct { + Dataset *DatasetReference `json:"dataset,omitempty"` + Description *string `json:"description,omitempty"` + Flowlet *DataFlowReference `json:"flowlet,omitempty"` + LinkedService *LinkedServiceReference `json:"linkedService,omitempty"` + Name string `json:"name"` + SchemaLinkedService *LinkedServiceReference `json:"schemaLinkedService,omitempty"` + Script *string `json:"script,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_powerquerytypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_powerquerytypeproperties.go new file mode 100644 index 00000000000..6136eb33d03 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_powerquerytypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PowerQueryTypeProperties struct { + DocumentLocale *string `json:"documentLocale,omitempty"` + Script *string `json:"script,omitempty"` + Sources *[]PowerQuerySource `json:"sources,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestodatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestodatasettypeproperties.go new file mode 100644 index 00000000000..2c65102ccbe --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestodatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrestoDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestolinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestolinkedservice.go new file mode 100644 index 00000000000..7ac3ec83e5d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestolinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = PrestoLinkedService{} + +type PrestoLinkedService struct { + TypeProperties PrestoLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s PrestoLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = PrestoLinkedService{} + +func (s PrestoLinkedService) MarshalJSON() ([]byte, error) { + type wrapper PrestoLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PrestoLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PrestoLinkedService: %+v", err) + } + + decoded["type"] = "Presto" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PrestoLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PrestoLinkedService{} + +func (s *PrestoLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties PrestoLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PrestoLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'PrestoLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestolinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestolinkedservicetypeproperties.go new file mode 100644 index 00000000000..d0768504911 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestolinkedservicetypeproperties.go @@ -0,0 +1,78 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrestoLinkedServiceTypeProperties struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType PrestoAuthenticationType `json:"authenticationType"` + Catalog string `json:"catalog"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + ServerVersion string `json:"serverVersion"` + TimeZoneID *string `json:"timeZoneID,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &PrestoLinkedServiceTypeProperties{} + +func (s *PrestoLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType PrestoAuthenticationType `json:"authenticationType"` + Catalog string `json:"catalog"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + Port *int64 `json:"port,omitempty"` + ServerVersion string `json:"serverVersion"` + TimeZoneID *string `json:"timeZoneID,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AllowHostNameCNMismatch = decoded.AllowHostNameCNMismatch + s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert + s.AuthenticationType = decoded.AuthenticationType + s.Catalog = decoded.Catalog + s.EnableSsl = decoded.EnableSsl + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.Port = decoded.Port + s.ServerVersion = decoded.ServerVersion + s.TimeZoneID = decoded.TimeZoneID + s.TrustedCertPath = decoded.TrustedCertPath + s.UseSystemTrustStore = decoded.UseSystemTrustStore + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PrestoLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'PrestoLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestoobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestoobjectdataset.go new file mode 100644 index 00000000000..ca1c6652200 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_prestoobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = PrestoObjectDataset{} + +type PrestoObjectDataset struct { + TypeProperties *PrestoDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s PrestoObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = PrestoObjectDataset{} + +func (s PrestoObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper PrestoObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PrestoObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PrestoObjectDataset: %+v", err) + } + + decoded["type"] = "PrestoObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PrestoObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &PrestoObjectDataset{} + +func (s *PrestoObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *PrestoDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling PrestoObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'PrestoObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbaselinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbaselinkedservice.go new file mode 100644 index 00000000000..6d49f3b8a4e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbaselinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = QuickbaseLinkedService{} + +type QuickbaseLinkedService struct { + TypeProperties QuickbaseLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s QuickbaseLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = QuickbaseLinkedService{} + +func (s QuickbaseLinkedService) MarshalJSON() ([]byte, error) { + type wrapper QuickbaseLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling QuickbaseLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling QuickbaseLinkedService: %+v", err) + } + + decoded["type"] = "Quickbase" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling QuickbaseLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &QuickbaseLinkedService{} + +func (s *QuickbaseLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties QuickbaseLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling QuickbaseLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'QuickbaseLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbaselinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbaselinkedservicetypeproperties.go new file mode 100644 index 00000000000..ac5deee84bd --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbaselinkedservicetypeproperties.go @@ -0,0 +1,45 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QuickbaseLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + UserToken SecretBase `json:"userToken"` +} + +var _ json.Unmarshaler = &QuickbaseLinkedServiceTypeProperties{} + +func (s *QuickbaseLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Url = decoded.Url + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling QuickbaseLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["userToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'UserToken' for 'QuickbaseLinkedServiceTypeProperties': %+v", err) + } + s.UserToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbookslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbookslinkedservice.go new file mode 100644 index 00000000000..14930f0ee83 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbookslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = QuickBooksLinkedService{} + +type QuickBooksLinkedService struct { + TypeProperties QuickBooksLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s QuickBooksLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = QuickBooksLinkedService{} + +func (s QuickBooksLinkedService) MarshalJSON() ([]byte, error) { + type wrapper QuickBooksLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling QuickBooksLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling QuickBooksLinkedService: %+v", err) + } + + decoded["type"] = "QuickBooks" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling QuickBooksLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &QuickBooksLinkedService{} + +func (s *QuickBooksLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties QuickBooksLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling QuickBooksLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'QuickBooksLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbookslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbookslinkedservicetypeproperties.go new file mode 100644 index 00000000000..8256c0783a5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbookslinkedservicetypeproperties.go @@ -0,0 +1,75 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QuickBooksLinkedServiceTypeProperties struct { + AccessToken SecretBase `json:"accessToken"` + AccessTokenSecret SecretBase `json:"accessTokenSecret"` + CompanyId *string `json:"companyId,omitempty"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + ConsumerKey *string `json:"consumerKey,omitempty"` + ConsumerSecret SecretBase `json:"consumerSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` +} + +var _ json.Unmarshaler = &QuickBooksLinkedServiceTypeProperties{} + +func (s *QuickBooksLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CompanyId *string `json:"companyId,omitempty"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + ConsumerKey *string `json:"consumerKey,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CompanyId = decoded.CompanyId + s.ConnectionProperties = decoded.ConnectionProperties + s.ConsumerKey = decoded.ConsumerKey + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling QuickBooksLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accessToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessToken' for 'QuickBooksLinkedServiceTypeProperties': %+v", err) + } + s.AccessToken = impl + } + + if v, ok := temp["accessTokenSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessTokenSecret' for 'QuickBooksLinkedServiceTypeProperties': %+v", err) + } + s.AccessTokenSecret = impl + } + + if v, ok := temp["consumerSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConsumerSecret' for 'QuickBooksLinkedServiceTypeProperties': %+v", err) + } + s.ConsumerSecret = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbooksobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbooksobjectdataset.go new file mode 100644 index 00000000000..b607b905e12 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_quickbooksobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = QuickBooksObjectDataset{} + +type QuickBooksObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s QuickBooksObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = QuickBooksObjectDataset{} + +func (s QuickBooksObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper QuickBooksObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling QuickBooksObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling QuickBooksObjectDataset: %+v", err) + } + + decoded["type"] = "QuickBooksObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling QuickBooksObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &QuickBooksObjectDataset{} + +func (s *QuickBooksObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling QuickBooksObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'QuickBooksObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_relationaltabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_relationaltabledataset.go new file mode 100644 index 00000000000..766645e8146 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_relationaltabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = RelationalTableDataset{} + +type RelationalTableDataset struct { + TypeProperties *RelationalTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s RelationalTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = RelationalTableDataset{} + +func (s RelationalTableDataset) MarshalJSON() ([]byte, error) { + type wrapper RelationalTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RelationalTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RelationalTableDataset: %+v", err) + } + + decoded["type"] = "RelationalTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RelationalTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &RelationalTableDataset{} + +func (s *RelationalTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *RelationalTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling RelationalTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'RelationalTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_relationaltabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_relationaltabledatasettypeproperties.go new file mode 100644 index 00000000000..2fe50a02eb1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_relationaltabledatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RelationalTableDatasetTypeProperties struct { + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsyslinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsyslinkedservice.go new file mode 100644 index 00000000000..6c19b96aff5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsyslinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ResponsysLinkedService{} + +type ResponsysLinkedService struct { + TypeProperties ResponsysLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ResponsysLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ResponsysLinkedService{} + +func (s ResponsysLinkedService) MarshalJSON() ([]byte, error) { + type wrapper ResponsysLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ResponsysLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ResponsysLinkedService: %+v", err) + } + + decoded["type"] = "Responsys" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ResponsysLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ResponsysLinkedService{} + +func (s *ResponsysLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ResponsysLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ResponsysLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ResponsysLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsyslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsyslinkedservicetypeproperties.go new file mode 100644 index 00000000000..d883991c16a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsyslinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResponsysLinkedServiceTypeProperties struct { + ClientId string `json:"clientId"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &ResponsysLinkedServiceTypeProperties{} + +func (s *ResponsysLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId string `json:"clientId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ResponsysLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'ResponsysLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsysobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsysobjectdataset.go new file mode 100644 index 00000000000..5b9e528a179 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_responsysobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ResponsysObjectDataset{} + +type ResponsysObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ResponsysObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ResponsysObjectDataset{} + +func (s ResponsysObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper ResponsysObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ResponsysObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ResponsysObjectDataset: %+v", err) + } + + decoded["type"] = "ResponsysObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ResponsysObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ResponsysObjectDataset{} + +func (s *ResponsysObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ResponsysObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ResponsysObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restresourcedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restresourcedataset.go new file mode 100644 index 00000000000..c5e3e7b4e63 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restresourcedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = RestResourceDataset{} + +type RestResourceDataset struct { + TypeProperties *RestResourceDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s RestResourceDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = RestResourceDataset{} + +func (s RestResourceDataset) MarshalJSON() ([]byte, error) { + type wrapper RestResourceDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RestResourceDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RestResourceDataset: %+v", err) + } + + decoded["type"] = "RestResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RestResourceDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &RestResourceDataset{} + +func (s *RestResourceDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *RestResourceDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling RestResourceDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'RestResourceDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restresourcedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restresourcedatasettypeproperties.go new file mode 100644 index 00000000000..1483ad5f5dc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restresourcedatasettypeproperties.go @@ -0,0 +1,12 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestResourceDatasetTypeProperties struct { + AdditionalHeaders *map[string]string `json:"additionalHeaders,omitempty"` + PaginationRules *map[string]string `json:"paginationRules,omitempty"` + RelativeURL *string `json:"relativeUrl,omitempty"` + RequestBody *string `json:"requestBody,omitempty"` + RequestMethod *string `json:"requestMethod,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restservicelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restservicelinkedservice.go new file mode 100644 index 00000000000..4402b424cd6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restservicelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = RestServiceLinkedService{} + +type RestServiceLinkedService struct { + TypeProperties RestServiceLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s RestServiceLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = RestServiceLinkedService{} + +func (s RestServiceLinkedService) MarshalJSON() ([]byte, error) { + type wrapper RestServiceLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RestServiceLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RestServiceLinkedService: %+v", err) + } + + decoded["type"] = "RestService" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RestServiceLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &RestServiceLinkedService{} + +func (s *RestServiceLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties RestServiceLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling RestServiceLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'RestServiceLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restservicelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restservicelinkedservicetypeproperties.go new file mode 100644 index 00000000000..72ea20bc3b8 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_restservicelinkedservicetypeproperties.go @@ -0,0 +1,123 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestServiceLinkedServiceTypeProperties struct { + AadResourceId *string `json:"aadResourceId,omitempty"` + AuthHeaders *interface{} `json:"authHeaders,omitempty"` + AuthenticationType RestServiceAuthenticationType `json:"authenticationType"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + Credential *CredentialReference `json:"credential,omitempty"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Resource *string `json:"resource,omitempty"` + Scope *string `json:"scope,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalEmbeddedCert SecretBase `json:"servicePrincipalEmbeddedCert"` + ServicePrincipalEmbeddedCertPassword SecretBase `json:"servicePrincipalEmbeddedCertPassword"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &RestServiceLinkedServiceTypeProperties{} + +func (s *RestServiceLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AadResourceId *string `json:"aadResourceId,omitempty"` + AuthHeaders *interface{} `json:"authHeaders,omitempty"` + AuthenticationType RestServiceAuthenticationType `json:"authenticationType"` + AzureCloudType *string `json:"azureCloudType,omitempty"` + ClientId *string `json:"clientId,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Resource *string `json:"resource,omitempty"` + Scope *string `json:"scope,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AadResourceId = decoded.AadResourceId + s.AuthHeaders = decoded.AuthHeaders + s.AuthenticationType = decoded.AuthenticationType + s.AzureCloudType = decoded.AzureCloudType + s.ClientId = decoded.ClientId + s.Credential = decoded.Credential + s.EnableServerCertificateValidation = decoded.EnableServerCertificateValidation + s.EncryptedCredential = decoded.EncryptedCredential + s.Resource = decoded.Resource + s.Scope = decoded.Scope + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.TokenEndpoint = decoded.TokenEndpoint + s.Url = decoded.Url + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling RestServiceLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'RestServiceLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'RestServiceLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["servicePrincipalEmbeddedCert"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalEmbeddedCert' for 'RestServiceLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalEmbeddedCert = impl + } + + if v, ok := temp["servicePrincipalEmbeddedCertPassword"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalEmbeddedCertPassword' for 'RestServiceLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalEmbeddedCertPassword = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'RestServiceLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcelinkedservice.go new file mode 100644 index 00000000000..d635c00a0d6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SalesforceLinkedService{} + +type SalesforceLinkedService struct { + TypeProperties SalesforceLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SalesforceLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SalesforceLinkedService{} + +func (s SalesforceLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SalesforceLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceLinkedService: %+v", err) + } + + decoded["type"] = "Salesforce" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceLinkedService{} + +func (s *SalesforceLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SalesforceLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SalesforceLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcelinkedservicetypeproperties.go new file mode 100644 index 00000000000..8e0dd11a5b5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcelinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceLinkedServiceTypeProperties struct { + ApiVersion *string `json:"apiVersion,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` + Password SecretBase `json:"password"` + SecurityToken SecretBase `json:"securityToken"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &SalesforceLinkedServiceTypeProperties{} + +func (s *SalesforceLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ApiVersion *string `json:"apiVersion,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ApiVersion = decoded.ApiVersion + s.EncryptedCredential = decoded.EncryptedCredential + s.EnvironmentURL = decoded.EnvironmentURL + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SalesforceLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["securityToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SecurityToken' for 'SalesforceLinkedServiceTypeProperties': %+v", err) + } + s.SecurityToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudlinkedservice.go new file mode 100644 index 00000000000..98a93d69613 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SalesforceMarketingCloudLinkedService{} + +type SalesforceMarketingCloudLinkedService struct { + TypeProperties SalesforceMarketingCloudLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SalesforceMarketingCloudLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SalesforceMarketingCloudLinkedService{} + +func (s SalesforceMarketingCloudLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SalesforceMarketingCloudLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceMarketingCloudLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceMarketingCloudLinkedService: %+v", err) + } + + decoded["type"] = "SalesforceMarketingCloud" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceMarketingCloudLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceMarketingCloudLinkedService{} + +func (s *SalesforceMarketingCloudLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SalesforceMarketingCloudLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceMarketingCloudLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SalesforceMarketingCloudLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudlinkedservicetypeproperties.go new file mode 100644 index 00000000000..c93a766713e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudlinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceMarketingCloudLinkedServiceTypeProperties struct { + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &SalesforceMarketingCloudLinkedServiceTypeProperties{} + +func (s *SalesforceMarketingCloudLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId *string `json:"clientId,omitempty"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.ConnectionProperties = decoded.ConnectionProperties + s.EncryptedCredential = decoded.EncryptedCredential + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceMarketingCloudLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'SalesforceMarketingCloudLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudobjectdataset.go new file mode 100644 index 00000000000..deb19360850 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcemarketingcloudobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SalesforceMarketingCloudObjectDataset{} + +type SalesforceMarketingCloudObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SalesforceMarketingCloudObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SalesforceMarketingCloudObjectDataset{} + +func (s SalesforceMarketingCloudObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper SalesforceMarketingCloudObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceMarketingCloudObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceMarketingCloudObjectDataset: %+v", err) + } + + decoded["type"] = "SalesforceMarketingCloudObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceMarketingCloudObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceMarketingCloudObjectDataset{} + +func (s *SalesforceMarketingCloudObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceMarketingCloudObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SalesforceMarketingCloudObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceobjectdataset.go new file mode 100644 index 00000000000..739d22b8456 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SalesforceObjectDataset{} + +type SalesforceObjectDataset struct { + TypeProperties *SalesforceObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SalesforceObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SalesforceObjectDataset{} + +func (s SalesforceObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper SalesforceObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceObjectDataset: %+v", err) + } + + decoded["type"] = "SalesforceObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceObjectDataset{} + +func (s *SalesforceObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SalesforceObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SalesforceObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceobjectdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceobjectdatasettypeproperties.go new file mode 100644 index 00000000000..cb68652ef30 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceobjectdatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceObjectDatasetTypeProperties struct { + ObjectApiName *string `json:"objectApiName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudlinkedservice.go new file mode 100644 index 00000000000..318532c3461 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SalesforceServiceCloudLinkedService{} + +type SalesforceServiceCloudLinkedService struct { + TypeProperties SalesforceServiceCloudLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SalesforceServiceCloudLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SalesforceServiceCloudLinkedService{} + +func (s SalesforceServiceCloudLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SalesforceServiceCloudLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceServiceCloudLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceServiceCloudLinkedService: %+v", err) + } + + decoded["type"] = "SalesforceServiceCloud" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceServiceCloudLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceServiceCloudLinkedService{} + +func (s *SalesforceServiceCloudLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SalesforceServiceCloudLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceServiceCloudLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SalesforceServiceCloudLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudlinkedservicetypeproperties.go new file mode 100644 index 00000000000..03220f668c0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudlinkedservicetypeproperties.go @@ -0,0 +1,63 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceServiceCloudLinkedServiceTypeProperties struct { + ApiVersion *string `json:"apiVersion,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` + ExtendedProperties *string `json:"extendedProperties,omitempty"` + Password SecretBase `json:"password"` + SecurityToken SecretBase `json:"securityToken"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &SalesforceServiceCloudLinkedServiceTypeProperties{} + +func (s *SalesforceServiceCloudLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ApiVersion *string `json:"apiVersion,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` + ExtendedProperties *string `json:"extendedProperties,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ApiVersion = decoded.ApiVersion + s.EncryptedCredential = decoded.EncryptedCredential + s.EnvironmentURL = decoded.EnvironmentURL + s.ExtendedProperties = decoded.ExtendedProperties + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceServiceCloudLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SalesforceServiceCloudLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["securityToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SecurityToken' for 'SalesforceServiceCloudLinkedServiceTypeProperties': %+v", err) + } + s.SecurityToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudobjectdataset.go new file mode 100644 index 00000000000..071b0693455 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SalesforceServiceCloudObjectDataset{} + +type SalesforceServiceCloudObjectDataset struct { + TypeProperties *SalesforceServiceCloudObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SalesforceServiceCloudObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SalesforceServiceCloudObjectDataset{} + +func (s SalesforceServiceCloudObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper SalesforceServiceCloudObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceServiceCloudObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceServiceCloudObjectDataset: %+v", err) + } + + decoded["type"] = "SalesforceServiceCloudObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceServiceCloudObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceServiceCloudObjectDataset{} + +func (s *SalesforceServiceCloudObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SalesforceServiceCloudObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceServiceCloudObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SalesforceServiceCloudObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudobjectdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudobjectdatasettypeproperties.go new file mode 100644 index 00000000000..e5e77c9feb0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudobjectdatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceServiceCloudObjectDatasetTypeProperties struct { + ObjectApiName *string `json:"objectApiName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2linkedservice.go new file mode 100644 index 00000000000..7c28a800b41 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SalesforceServiceCloudV2LinkedService{} + +type SalesforceServiceCloudV2LinkedService struct { + TypeProperties SalesforceServiceCloudV2LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SalesforceServiceCloudV2LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SalesforceServiceCloudV2LinkedService{} + +func (s SalesforceServiceCloudV2LinkedService) MarshalJSON() ([]byte, error) { + type wrapper SalesforceServiceCloudV2LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceServiceCloudV2LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceServiceCloudV2LinkedService: %+v", err) + } + + decoded["type"] = "SalesforceServiceCloudV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceServiceCloudV2LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceServiceCloudV2LinkedService{} + +func (s *SalesforceServiceCloudV2LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SalesforceServiceCloudV2LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceServiceCloudV2LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SalesforceServiceCloudV2LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2linkedservicetypeproperties.go new file mode 100644 index 00000000000..b943f34a5b7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2linkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceServiceCloudV2LinkedServiceTypeProperties struct { + ApiVersion *string `json:"apiVersion,omitempty"` + AuthenticationType *string `json:"authenticationType,omitempty"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` +} + +var _ json.Unmarshaler = &SalesforceServiceCloudV2LinkedServiceTypeProperties{} + +func (s *SalesforceServiceCloudV2LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ApiVersion *string `json:"apiVersion,omitempty"` + AuthenticationType *string `json:"authenticationType,omitempty"` + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ApiVersion = decoded.ApiVersion + s.AuthenticationType = decoded.AuthenticationType + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.EnvironmentURL = decoded.EnvironmentURL + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceServiceCloudV2LinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'SalesforceServiceCloudV2LinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2objectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2objectdataset.go new file mode 100644 index 00000000000..3fcece38419 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2objectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SalesforceServiceCloudV2ObjectDataset{} + +type SalesforceServiceCloudV2ObjectDataset struct { + TypeProperties *SalesforceServiceCloudV2ObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SalesforceServiceCloudV2ObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SalesforceServiceCloudV2ObjectDataset{} + +func (s SalesforceServiceCloudV2ObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper SalesforceServiceCloudV2ObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceServiceCloudV2ObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceServiceCloudV2ObjectDataset: %+v", err) + } + + decoded["type"] = "SalesforceServiceCloudV2Object" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceServiceCloudV2ObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceServiceCloudV2ObjectDataset{} + +func (s *SalesforceServiceCloudV2ObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SalesforceServiceCloudV2ObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceServiceCloudV2ObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SalesforceServiceCloudV2ObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2objectdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2objectdatasettypeproperties.go new file mode 100644 index 00000000000..9809c664d93 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforceservicecloudv2objectdatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceServiceCloudV2ObjectDatasetTypeProperties struct { + ObjectApiName *string `json:"objectApiName,omitempty"` + ReportId *string `json:"reportId,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2linkedservice.go new file mode 100644 index 00000000000..98d5c62f859 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SalesforceV2LinkedService{} + +type SalesforceV2LinkedService struct { + TypeProperties SalesforceV2LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SalesforceV2LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SalesforceV2LinkedService{} + +func (s SalesforceV2LinkedService) MarshalJSON() ([]byte, error) { + type wrapper SalesforceV2LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceV2LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceV2LinkedService: %+v", err) + } + + decoded["type"] = "SalesforceV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceV2LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceV2LinkedService{} + +func (s *SalesforceV2LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SalesforceV2LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceV2LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SalesforceV2LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2linkedservicetypeproperties.go new file mode 100644 index 00000000000..a69cc40f091 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2linkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceV2LinkedServiceTypeProperties struct { + ApiVersion *string `json:"apiVersion,omitempty"` + AuthenticationType *string `json:"authenticationType,omitempty"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` +} + +var _ json.Unmarshaler = &SalesforceV2LinkedServiceTypeProperties{} + +func (s *SalesforceV2LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ApiVersion *string `json:"apiVersion,omitempty"` + AuthenticationType *string `json:"authenticationType,omitempty"` + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ApiVersion = decoded.ApiVersion + s.AuthenticationType = decoded.AuthenticationType + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.EnvironmentURL = decoded.EnvironmentURL + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceV2LinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'SalesforceV2LinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2objectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2objectdataset.go new file mode 100644 index 00000000000..2733052927a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2objectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SalesforceV2ObjectDataset{} + +type SalesforceV2ObjectDataset struct { + TypeProperties *SalesforceV2ObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SalesforceV2ObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SalesforceV2ObjectDataset{} + +func (s SalesforceV2ObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper SalesforceV2ObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SalesforceV2ObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SalesforceV2ObjectDataset: %+v", err) + } + + decoded["type"] = "SalesforceV2Object" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SalesforceV2ObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SalesforceV2ObjectDataset{} + +func (s *SalesforceV2ObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SalesforceV2ObjectDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SalesforceV2ObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SalesforceV2ObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2objectdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2objectdatasettypeproperties.go new file mode 100644 index 00000000000..9ae89a2d910 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_salesforcev2objectdatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SalesforceV2ObjectDatasetTypeProperties struct { + ObjectApiName *string `json:"objectApiName,omitempty"` + ReportId *string `json:"reportId,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwcubedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwcubedataset.go new file mode 100644 index 00000000000..ede71aec12f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwcubedataset.go @@ -0,0 +1,103 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SapBwCubeDataset{} + +type SapBwCubeDataset struct { + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SapBwCubeDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SapBwCubeDataset{} + +func (s SapBwCubeDataset) MarshalJSON() ([]byte, error) { + type wrapper SapBwCubeDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapBwCubeDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapBwCubeDataset: %+v", err) + } + + decoded["type"] = "SapBwCube" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapBwCubeDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapBwCubeDataset{} + +func (s *SapBwCubeDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapBwCubeDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SapBwCubeDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwlinkedservice.go new file mode 100644 index 00000000000..7129b58041e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SapBWLinkedService{} + +type SapBWLinkedService struct { + TypeProperties SapBWLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SapBWLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SapBWLinkedService{} + +func (s SapBWLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SapBWLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapBWLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapBWLinkedService: %+v", err) + } + + decoded["type"] = "SapBW" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapBWLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapBWLinkedService{} + +func (s *SapBWLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapBWLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapBWLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SapBWLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwlinkedservicetypeproperties.go new file mode 100644 index 00000000000..a8efa67f3ca --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapbwlinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapBWLinkedServiceTypeProperties struct { + ClientId string `json:"clientId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Server string `json:"server"` + SystemNumber string `json:"systemNumber"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &SapBWLinkedServiceTypeProperties{} + +func (s *SapBWLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId string `json:"clientId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Server string `json:"server"` + SystemNumber string `json:"systemNumber"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Server = decoded.Server + s.SystemNumber = decoded.SystemNumber + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapBWLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SapBWLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerlinkedservice.go new file mode 100644 index 00000000000..d0ad7337a70 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SapCloudForCustomerLinkedService{} + +type SapCloudForCustomerLinkedService struct { + TypeProperties SapCloudForCustomerLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SapCloudForCustomerLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SapCloudForCustomerLinkedService{} + +func (s SapCloudForCustomerLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SapCloudForCustomerLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapCloudForCustomerLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapCloudForCustomerLinkedService: %+v", err) + } + + decoded["type"] = "SapCloudForCustomer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapCloudForCustomerLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapCloudForCustomerLinkedService{} + +func (s *SapCloudForCustomerLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapCloudForCustomerLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapCloudForCustomerLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SapCloudForCustomerLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerlinkedservicetypeproperties.go new file mode 100644 index 00000000000..c939e0dccec --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerlinkedservicetypeproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapCloudForCustomerLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Url string `json:"url"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &SapCloudForCustomerLinkedServiceTypeProperties{} + +func (s *SapCloudForCustomerLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Url = decoded.Url + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapCloudForCustomerLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SapCloudForCustomerLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerresourcedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerresourcedataset.go new file mode 100644 index 00000000000..5ef14a801eb --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerresourcedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SapCloudForCustomerResourceDataset{} + +type SapCloudForCustomerResourceDataset struct { + TypeProperties SapCloudForCustomerResourceDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SapCloudForCustomerResourceDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SapCloudForCustomerResourceDataset{} + +func (s SapCloudForCustomerResourceDataset) MarshalJSON() ([]byte, error) { + type wrapper SapCloudForCustomerResourceDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapCloudForCustomerResourceDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapCloudForCustomerResourceDataset: %+v", err) + } + + decoded["type"] = "SapCloudForCustomerResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapCloudForCustomerResourceDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapCloudForCustomerResourceDataset{} + +func (s *SapCloudForCustomerResourceDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapCloudForCustomerResourceDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapCloudForCustomerResourceDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SapCloudForCustomerResourceDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerresourcedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerresourcedatasettypeproperties.go new file mode 100644 index 00000000000..4687d97a678 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapcloudforcustomerresourcedatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapCloudForCustomerResourceDatasetTypeProperties struct { + Path string `json:"path"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapecclinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapecclinkedservice.go new file mode 100644 index 00000000000..5afc25c5d77 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapecclinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SapEccLinkedService{} + +type SapEccLinkedService struct { + TypeProperties SapEccLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SapEccLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SapEccLinkedService{} + +func (s SapEccLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SapEccLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapEccLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapEccLinkedService: %+v", err) + } + + decoded["type"] = "SapEcc" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapEccLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapEccLinkedService{} + +func (s *SapEccLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapEccLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapEccLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SapEccLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapecclinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapecclinkedservicetypeproperties.go new file mode 100644 index 00000000000..f5da24ce64d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapecclinkedservicetypeproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapEccLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Url string `json:"url"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &SapEccLinkedServiceTypeProperties{} + +func (s *SapEccLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Url = decoded.Url + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapEccLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SapEccLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapeccresourcedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapeccresourcedataset.go new file mode 100644 index 00000000000..7ba45e6d3c0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapeccresourcedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SapEccResourceDataset{} + +type SapEccResourceDataset struct { + TypeProperties SapEccResourceDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SapEccResourceDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SapEccResourceDataset{} + +func (s SapEccResourceDataset) MarshalJSON() ([]byte, error) { + type wrapper SapEccResourceDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapEccResourceDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapEccResourceDataset: %+v", err) + } + + decoded["type"] = "SapEccResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapEccResourceDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapEccResourceDataset{} + +func (s *SapEccResourceDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapEccResourceDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapEccResourceDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SapEccResourceDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapeccresourcedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapeccresourcedatasettypeproperties.go new file mode 100644 index 00000000000..d282a199be1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapeccresourcedatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapEccResourceDatasetTypeProperties struct { + Path string `json:"path"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanalinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanalinkedservice.go new file mode 100644 index 00000000000..3a78dcb1975 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanalinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SapHanaLinkedService{} + +type SapHanaLinkedService struct { + TypeProperties SapHanaLinkedServiceProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SapHanaLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SapHanaLinkedService{} + +func (s SapHanaLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SapHanaLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapHanaLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapHanaLinkedService: %+v", err) + } + + decoded["type"] = "SapHana" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapHanaLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapHanaLinkedService{} + +func (s *SapHanaLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapHanaLinkedServiceProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapHanaLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SapHanaLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanalinkedserviceproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanalinkedserviceproperties.go new file mode 100644 index 00000000000..d35f216ba59 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanalinkedserviceproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapHanaLinkedServiceProperties struct { + AuthenticationType *SapHanaAuthenticationType `json:"authenticationType,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Server *string `json:"server,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &SapHanaLinkedServiceProperties{} + +func (s *SapHanaLinkedServiceProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *SapHanaAuthenticationType `json:"authenticationType,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Server *string `json:"server,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ConnectionString = decoded.ConnectionString + s.EncryptedCredential = decoded.EncryptedCredential + s.Server = decoded.Server + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapHanaLinkedServiceProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SapHanaLinkedServiceProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanatabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanatabledataset.go new file mode 100644 index 00000000000..962497d9d19 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanatabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SapHanaTableDataset{} + +type SapHanaTableDataset struct { + TypeProperties *SapHanaTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SapHanaTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SapHanaTableDataset{} + +func (s SapHanaTableDataset) MarshalJSON() ([]byte, error) { + type wrapper SapHanaTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapHanaTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapHanaTableDataset: %+v", err) + } + + decoded["type"] = "SapHanaTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapHanaTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapHanaTableDataset{} + +func (s *SapHanaTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SapHanaTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapHanaTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SapHanaTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanatabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanatabledatasettypeproperties.go new file mode 100644 index 00000000000..6c9746298f0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saphanatabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapHanaTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodplinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodplinkedservice.go new file mode 100644 index 00000000000..b74fe3d2ac2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodplinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SapOdpLinkedService{} + +type SapOdpLinkedService struct { + TypeProperties SapOdpLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SapOdpLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SapOdpLinkedService{} + +func (s SapOdpLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SapOdpLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapOdpLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapOdpLinkedService: %+v", err) + } + + decoded["type"] = "SapOdp" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapOdpLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapOdpLinkedService{} + +func (s *SapOdpLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapOdpLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapOdpLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SapOdpLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodplinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodplinkedservicetypeproperties.go new file mode 100644 index 00000000000..5be9d837145 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodplinkedservicetypeproperties.go @@ -0,0 +1,90 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapOdpLinkedServiceTypeProperties struct { + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Language *string `json:"language,omitempty"` + LogonGroup *string `json:"logonGroup,omitempty"` + MessageServer *string `json:"messageServer,omitempty"` + MessageServerService *string `json:"messageServerService,omitempty"` + Password SecretBase `json:"password"` + Server *string `json:"server,omitempty"` + SncLibraryPath *string `json:"sncLibraryPath,omitempty"` + SncMode *string `json:"sncMode,omitempty"` + SncMyName *string `json:"sncMyName,omitempty"` + SncPartnerName *string `json:"sncPartnerName,omitempty"` + SncQop *string `json:"sncQop,omitempty"` + SubscriberName *string `json:"subscriberName,omitempty"` + SystemId *string `json:"systemId,omitempty"` + SystemNumber *string `json:"systemNumber,omitempty"` + UserName *string `json:"userName,omitempty"` + X509CertificatePath *string `json:"x509CertificatePath,omitempty"` +} + +var _ json.Unmarshaler = &SapOdpLinkedServiceTypeProperties{} + +func (s *SapOdpLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Language *string `json:"language,omitempty"` + LogonGroup *string `json:"logonGroup,omitempty"` + MessageServer *string `json:"messageServer,omitempty"` + MessageServerService *string `json:"messageServerService,omitempty"` + Server *string `json:"server,omitempty"` + SncLibraryPath *string `json:"sncLibraryPath,omitempty"` + SncMode *string `json:"sncMode,omitempty"` + SncMyName *string `json:"sncMyName,omitempty"` + SncPartnerName *string `json:"sncPartnerName,omitempty"` + SncQop *string `json:"sncQop,omitempty"` + SubscriberName *string `json:"subscriberName,omitempty"` + SystemId *string `json:"systemId,omitempty"` + SystemNumber *string `json:"systemNumber,omitempty"` + UserName *string `json:"userName,omitempty"` + X509CertificatePath *string `json:"x509CertificatePath,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Language = decoded.Language + s.LogonGroup = decoded.LogonGroup + s.MessageServer = decoded.MessageServer + s.MessageServerService = decoded.MessageServerService + s.Server = decoded.Server + s.SncLibraryPath = decoded.SncLibraryPath + s.SncMode = decoded.SncMode + s.SncMyName = decoded.SncMyName + s.SncPartnerName = decoded.SncPartnerName + s.SncQop = decoded.SncQop + s.SubscriberName = decoded.SubscriberName + s.SystemId = decoded.SystemId + s.SystemNumber = decoded.SystemNumber + s.UserName = decoded.UserName + s.X509CertificatePath = decoded.X509CertificatePath + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapOdpLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SapOdpLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodpresourcedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodpresourcedataset.go new file mode 100644 index 00000000000..630aa271382 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodpresourcedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SapOdpResourceDataset{} + +type SapOdpResourceDataset struct { + TypeProperties SapOdpResourceDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SapOdpResourceDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SapOdpResourceDataset{} + +func (s SapOdpResourceDataset) MarshalJSON() ([]byte, error) { + type wrapper SapOdpResourceDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapOdpResourceDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapOdpResourceDataset: %+v", err) + } + + decoded["type"] = "SapOdpResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapOdpResourceDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapOdpResourceDataset{} + +func (s *SapOdpResourceDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapOdpResourceDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapOdpResourceDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SapOdpResourceDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodpresourcedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodpresourcedatasettypeproperties.go new file mode 100644 index 00000000000..e995254c6ff --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapodpresourcedatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapOdpResourceDatasetTypeProperties struct { + Context string `json:"context"` + ObjectName string `json:"objectName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhublinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhublinkedservice.go new file mode 100644 index 00000000000..2bd2cfb639c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhublinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SapOpenHubLinkedService{} + +type SapOpenHubLinkedService struct { + TypeProperties SapOpenHubLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SapOpenHubLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SapOpenHubLinkedService{} + +func (s SapOpenHubLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SapOpenHubLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapOpenHubLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapOpenHubLinkedService: %+v", err) + } + + decoded["type"] = "SapOpenHub" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapOpenHubLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapOpenHubLinkedService{} + +func (s *SapOpenHubLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapOpenHubLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapOpenHubLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SapOpenHubLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhublinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhublinkedservicetypeproperties.go new file mode 100644 index 00000000000..d1cfe651e2c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhublinkedservicetypeproperties.go @@ -0,0 +1,69 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapOpenHubLinkedServiceTypeProperties struct { + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Language *string `json:"language,omitempty"` + LogonGroup *string `json:"logonGroup,omitempty"` + MessageServer *string `json:"messageServer,omitempty"` + MessageServerService *string `json:"messageServerService,omitempty"` + Password SecretBase `json:"password"` + Server *string `json:"server,omitempty"` + SystemId *string `json:"systemId,omitempty"` + SystemNumber *string `json:"systemNumber,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &SapOpenHubLinkedServiceTypeProperties{} + +func (s *SapOpenHubLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Language *string `json:"language,omitempty"` + LogonGroup *string `json:"logonGroup,omitempty"` + MessageServer *string `json:"messageServer,omitempty"` + MessageServerService *string `json:"messageServerService,omitempty"` + Server *string `json:"server,omitempty"` + SystemId *string `json:"systemId,omitempty"` + SystemNumber *string `json:"systemNumber,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Language = decoded.Language + s.LogonGroup = decoded.LogonGroup + s.MessageServer = decoded.MessageServer + s.MessageServerService = decoded.MessageServerService + s.Server = decoded.Server + s.SystemId = decoded.SystemId + s.SystemNumber = decoded.SystemNumber + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapOpenHubLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SapOpenHubLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhubtabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhubtabledataset.go new file mode 100644 index 00000000000..ff08a6b28b6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhubtabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SapOpenHubTableDataset{} + +type SapOpenHubTableDataset struct { + TypeProperties SapOpenHubTableDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SapOpenHubTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SapOpenHubTableDataset{} + +func (s SapOpenHubTableDataset) MarshalJSON() ([]byte, error) { + type wrapper SapOpenHubTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapOpenHubTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapOpenHubTableDataset: %+v", err) + } + + decoded["type"] = "SapOpenHubTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapOpenHubTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapOpenHubTableDataset{} + +func (s *SapOpenHubTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapOpenHubTableDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapOpenHubTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SapOpenHubTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhubtabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhubtabledatasettypeproperties.go new file mode 100644 index 00000000000..16d69090f1d --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sapopenhubtabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapOpenHubTableDatasetTypeProperties struct { + BaseRequestId *int64 `json:"baseRequestId,omitempty"` + ExcludeLastRequest *bool `json:"excludeLastRequest,omitempty"` + OpenHubDestinationName string `json:"openHubDestinationName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptablelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptablelinkedservice.go new file mode 100644 index 00000000000..30398eef542 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptablelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SapTableLinkedService{} + +type SapTableLinkedService struct { + TypeProperties SapTableLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SapTableLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SapTableLinkedService{} + +func (s SapTableLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SapTableLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapTableLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapTableLinkedService: %+v", err) + } + + decoded["type"] = "SapTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapTableLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapTableLinkedService{} + +func (s *SapTableLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapTableLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapTableLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SapTableLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptablelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptablelinkedservicetypeproperties.go new file mode 100644 index 00000000000..15c5eb9d256 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptablelinkedservicetypeproperties.go @@ -0,0 +1,84 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapTableLinkedServiceTypeProperties struct { + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Language *string `json:"language,omitempty"` + LogonGroup *string `json:"logonGroup,omitempty"` + MessageServer *string `json:"messageServer,omitempty"` + MessageServerService *string `json:"messageServerService,omitempty"` + Password SecretBase `json:"password"` + Server *string `json:"server,omitempty"` + SncLibraryPath *string `json:"sncLibraryPath,omitempty"` + SncMode *string `json:"sncMode,omitempty"` + SncMyName *string `json:"sncMyName,omitempty"` + SncPartnerName *string `json:"sncPartnerName,omitempty"` + SncQop *string `json:"sncQop,omitempty"` + SystemId *string `json:"systemId,omitempty"` + SystemNumber *string `json:"systemNumber,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &SapTableLinkedServiceTypeProperties{} + +func (s *SapTableLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Language *string `json:"language,omitempty"` + LogonGroup *string `json:"logonGroup,omitempty"` + MessageServer *string `json:"messageServer,omitempty"` + MessageServerService *string `json:"messageServerService,omitempty"` + Server *string `json:"server,omitempty"` + SncLibraryPath *string `json:"sncLibraryPath,omitempty"` + SncMode *string `json:"sncMode,omitempty"` + SncMyName *string `json:"sncMyName,omitempty"` + SncPartnerName *string `json:"sncPartnerName,omitempty"` + SncQop *string `json:"sncQop,omitempty"` + SystemId *string `json:"systemId,omitempty"` + SystemNumber *string `json:"systemNumber,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Language = decoded.Language + s.LogonGroup = decoded.LogonGroup + s.MessageServer = decoded.MessageServer + s.MessageServerService = decoded.MessageServerService + s.Server = decoded.Server + s.SncLibraryPath = decoded.SncLibraryPath + s.SncMode = decoded.SncMode + s.SncMyName = decoded.SncMyName + s.SncPartnerName = decoded.SncPartnerName + s.SncQop = decoded.SncQop + s.SystemId = decoded.SystemId + s.SystemNumber = decoded.SystemNumber + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapTableLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SapTableLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptableresourcedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptableresourcedataset.go new file mode 100644 index 00000000000..5c1f4106429 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptableresourcedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SapTableResourceDataset{} + +type SapTableResourceDataset struct { + TypeProperties SapTableResourceDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SapTableResourceDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SapTableResourceDataset{} + +func (s SapTableResourceDataset) MarshalJSON() ([]byte, error) { + type wrapper SapTableResourceDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SapTableResourceDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SapTableResourceDataset: %+v", err) + } + + decoded["type"] = "SapTableResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SapTableResourceDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SapTableResourceDataset{} + +func (s *SapTableResourceDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SapTableResourceDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SapTableResourceDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SapTableResourceDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptableresourcedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptableresourcedatasettypeproperties.go new file mode 100644 index 00000000000..247e45f0dbb --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_saptableresourcedatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SapTableResourceDatasetTypeProperties struct { + TableName string `json:"tableName"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_scriptaction.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_scriptaction.go new file mode 100644 index 00000000000..02c7476b6ac --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_scriptaction.go @@ -0,0 +1,11 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScriptAction struct { + Name string `json:"name"` + Parameters *string `json:"parameters,omitempty"` + Roles interface{} `json:"roles"` + Uri string `json:"uri"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_secretbase.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_secretbase.go new file mode 100644 index 00000000000..a7e21a4230c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_secretbase.go @@ -0,0 +1,83 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecretBase interface { + SecretBase() BaseSecretBaseImpl +} + +var _ SecretBase = BaseSecretBaseImpl{} + +type BaseSecretBaseImpl struct { + Type string `json:"type"` +} + +func (s BaseSecretBaseImpl) SecretBase() BaseSecretBaseImpl { + return s +} + +var _ SecretBase = RawSecretBaseImpl{} + +// RawSecretBaseImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawSecretBaseImpl struct { + secretBase BaseSecretBaseImpl + Type string + Values map[string]interface{} +} + +func (s RawSecretBaseImpl) SecretBase() BaseSecretBaseImpl { + return s.secretBase +} + +func UnmarshalSecretBaseImplementation(input []byte) (SecretBase, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling SecretBase into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AzureKeyVaultSecret") { + var out AzureKeyVaultSecretReference + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureKeyVaultSecretReference: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SecureString") { + var out SecureString + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecureString: %+v", err) + } + return out, nil + } + + var parent BaseSecretBaseImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseSecretBaseImpl: %+v", err) + } + + return RawSecretBaseImpl{ + secretBase: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_securestring.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_securestring.go new file mode 100644 index 00000000000..698c559dd42 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_securestring.go @@ -0,0 +1,50 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ SecretBase = SecureString{} + +type SecureString struct { + Value string `json:"value"` + + // Fields inherited from SecretBase + + Type string `json:"type"` +} + +func (s SecureString) SecretBase() BaseSecretBaseImpl { + return BaseSecretBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = SecureString{} + +func (s SecureString) MarshalJSON() ([]byte, error) { + type wrapper SecureString + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecureString: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecureString: %+v", err) + } + + decoded["type"] = "SecureString" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecureString: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_selfhostedintegrationruntime.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_selfhostedintegrationruntime.go new file mode 100644 index 00000000000..78f8bf54c57 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_selfhostedintegrationruntime.go @@ -0,0 +1,52 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ IntegrationRuntime = SelfHostedIntegrationRuntime{} + +type SelfHostedIntegrationRuntime struct { + TypeProperties *SelfHostedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from IntegrationRuntime + + Description *string `json:"description,omitempty"` + Type IntegrationRuntimeType `json:"type"` +} + +func (s SelfHostedIntegrationRuntime) IntegrationRuntime() BaseIntegrationRuntimeImpl { + return BaseIntegrationRuntimeImpl{ + Description: s.Description, + Type: s.Type, + } +} + +var _ json.Marshaler = SelfHostedIntegrationRuntime{} + +func (s SelfHostedIntegrationRuntime) MarshalJSON() ([]byte, error) { + type wrapper SelfHostedIntegrationRuntime + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SelfHostedIntegrationRuntime: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SelfHostedIntegrationRuntime: %+v", err) + } + + decoded["type"] = "SelfHosted" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SelfHostedIntegrationRuntime: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_selfhostedintegrationruntimetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_selfhostedintegrationruntimetypeproperties.go new file mode 100644 index 00000000000..be10f2e7104 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_selfhostedintegrationruntimetypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelfHostedIntegrationRuntimeTypeProperties struct { + LinkedInfo LinkedIntegrationRuntimeType `json:"linkedInfo"` + SelfContainedInteractiveAuthoringEnabled *bool `json:"selfContainedInteractiveAuthoringEnabled,omitempty"` +} + +var _ json.Unmarshaler = &SelfHostedIntegrationRuntimeTypeProperties{} + +func (s *SelfHostedIntegrationRuntimeTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + SelfContainedInteractiveAuthoringEnabled *bool `json:"selfContainedInteractiveAuthoringEnabled,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.SelfContainedInteractiveAuthoringEnabled = decoded.SelfContainedInteractiveAuthoringEnabled + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SelfHostedIntegrationRuntimeTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedInfo"]; ok { + impl, err := UnmarshalLinkedIntegrationRuntimeTypeImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedInfo' for 'SelfHostedIntegrationRuntimeTypeProperties': %+v", err) + } + s.LinkedInfo = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowlinkedservice.go new file mode 100644 index 00000000000..d322de7fb04 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ServiceNowLinkedService{} + +type ServiceNowLinkedService struct { + TypeProperties ServiceNowLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ServiceNowLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ServiceNowLinkedService{} + +func (s ServiceNowLinkedService) MarshalJSON() ([]byte, error) { + type wrapper ServiceNowLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ServiceNowLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ServiceNowLinkedService: %+v", err) + } + + decoded["type"] = "ServiceNow" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ServiceNowLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ServiceNowLinkedService{} + +func (s *ServiceNowLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ServiceNowLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ServiceNowLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ServiceNowLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowlinkedservicetypeproperties.go new file mode 100644 index 00000000000..490b863e89b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowlinkedservicetypeproperties.go @@ -0,0 +1,72 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServiceNowLinkedServiceTypeProperties struct { + AuthenticationType ServiceNowAuthenticationType `json:"authenticationType"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + Password SecretBase `json:"password"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &ServiceNowLinkedServiceTypeProperties{} + +func (s *ServiceNowLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType ServiceNowAuthenticationType `json:"authenticationType"` + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ServiceNowLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'ServiceNowLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'ServiceNowLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowobjectdataset.go new file mode 100644 index 00000000000..a0421aa211b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ServiceNowObjectDataset{} + +type ServiceNowObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ServiceNowObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ServiceNowObjectDataset{} + +func (s ServiceNowObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper ServiceNowObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ServiceNowObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ServiceNowObjectDataset: %+v", err) + } + + decoded["type"] = "ServiceNowObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ServiceNowObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ServiceNowObjectDataset{} + +func (s *ServiceNowObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ServiceNowObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ServiceNowObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2linkedservice.go new file mode 100644 index 00000000000..b7ed02846c4 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ServiceNowV2LinkedService{} + +type ServiceNowV2LinkedService struct { + TypeProperties ServiceNowV2LinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ServiceNowV2LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ServiceNowV2LinkedService{} + +func (s ServiceNowV2LinkedService) MarshalJSON() ([]byte, error) { + type wrapper ServiceNowV2LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ServiceNowV2LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ServiceNowV2LinkedService: %+v", err) + } + + decoded["type"] = "ServiceNowV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ServiceNowV2LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ServiceNowV2LinkedService{} + +func (s *ServiceNowV2LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ServiceNowV2LinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ServiceNowV2LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ServiceNowV2LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2linkedservicetypeproperties.go new file mode 100644 index 00000000000..e2961330db9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2linkedservicetypeproperties.go @@ -0,0 +1,66 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServiceNowV2LinkedServiceTypeProperties struct { + AuthenticationType ServiceNowV2AuthenticationType `json:"authenticationType"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + GrantType *string `json:"grantType,omitempty"` + Password SecretBase `json:"password"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &ServiceNowV2LinkedServiceTypeProperties{} + +func (s *ServiceNowV2LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType ServiceNowV2AuthenticationType `json:"authenticationType"` + ClientId *string `json:"clientId,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + GrantType *string `json:"grantType,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ClientId = decoded.ClientId + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.GrantType = decoded.GrantType + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ServiceNowV2LinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'ServiceNowV2LinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'ServiceNowV2LinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2objectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2objectdataset.go new file mode 100644 index 00000000000..a9b580e5cd5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_servicenowv2objectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ServiceNowV2ObjectDataset{} + +type ServiceNowV2ObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ServiceNowV2ObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ServiceNowV2ObjectDataset{} + +func (s ServiceNowV2ObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper ServiceNowV2ObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ServiceNowV2ObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ServiceNowV2ObjectDataset: %+v", err) + } + + decoded["type"] = "ServiceNowV2Object" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ServiceNowV2ObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ServiceNowV2ObjectDataset{} + +func (s *ServiceNowV2ObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ServiceNowV2ObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ServiceNowV2ObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftplocation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftplocation.go new file mode 100644 index 00000000000..a2d880ffcd5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftplocation.go @@ -0,0 +1,53 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetLocation = SftpLocation{} + +type SftpLocation struct { + + // Fields inherited from DatasetLocation + + FileName *string `json:"fileName,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Type string `json:"type"` +} + +func (s SftpLocation) DatasetLocation() BaseDatasetLocationImpl { + return BaseDatasetLocationImpl{ + FileName: s.FileName, + FolderPath: s.FolderPath, + Type: s.Type, + } +} + +var _ json.Marshaler = SftpLocation{} + +func (s SftpLocation) MarshalJSON() ([]byte, error) { + type wrapper SftpLocation + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SftpLocation: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SftpLocation: %+v", err) + } + + decoded["type"] = "SftpLocation" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SftpLocation: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftpserverlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftpserverlinkedservice.go new file mode 100644 index 00000000000..36c7ebebe01 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftpserverlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SftpServerLinkedService{} + +type SftpServerLinkedService struct { + TypeProperties SftpServerLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SftpServerLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SftpServerLinkedService{} + +func (s SftpServerLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SftpServerLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SftpServerLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SftpServerLinkedService: %+v", err) + } + + decoded["type"] = "Sftp" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SftpServerLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SftpServerLinkedService{} + +func (s *SftpServerLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SftpServerLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SftpServerLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SftpServerLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftpserverlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftpserverlinkedservicetypeproperties.go new file mode 100644 index 00000000000..70375526ed6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sftpserverlinkedservicetypeproperties.go @@ -0,0 +1,81 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SftpServerLinkedServiceTypeProperties struct { + AuthenticationType *SftpAuthenticationType `json:"authenticationType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + HostKeyFingerprint *string `json:"hostKeyFingerprint,omitempty"` + PassPhrase SecretBase `json:"passPhrase"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + PrivateKeyContent SecretBase `json:"privateKeyContent"` + PrivateKeyPath *string `json:"privateKeyPath,omitempty"` + SkipHostKeyValidation *bool `json:"skipHostKeyValidation,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &SftpServerLinkedServiceTypeProperties{} + +func (s *SftpServerLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *SftpAuthenticationType `json:"authenticationType,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + HostKeyFingerprint *string `json:"hostKeyFingerprint,omitempty"` + Port *int64 `json:"port,omitempty"` + PrivateKeyPath *string `json:"privateKeyPath,omitempty"` + SkipHostKeyValidation *bool `json:"skipHostKeyValidation,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.HostKeyFingerprint = decoded.HostKeyFingerprint + s.Port = decoded.Port + s.PrivateKeyPath = decoded.PrivateKeyPath + s.SkipHostKeyValidation = decoded.SkipHostKeyValidation + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SftpServerLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["passPhrase"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'PassPhrase' for 'SftpServerLinkedServiceTypeProperties': %+v", err) + } + s.PassPhrase = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SftpServerLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["privateKeyContent"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'PrivateKeyContent' for 'SftpServerLinkedServiceTypeProperties': %+v", err) + } + s.PrivateKeyContent = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistdatasettypeproperties.go new file mode 100644 index 00000000000..1e783118269 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistdatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SharePointOnlineListDatasetTypeProperties struct { + ListName *string `json:"listName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistlinkedservice.go new file mode 100644 index 00000000000..31cccc37982 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SharePointOnlineListLinkedService{} + +type SharePointOnlineListLinkedService struct { + TypeProperties SharePointOnlineListLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SharePointOnlineListLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SharePointOnlineListLinkedService{} + +func (s SharePointOnlineListLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SharePointOnlineListLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SharePointOnlineListLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SharePointOnlineListLinkedService: %+v", err) + } + + decoded["type"] = "SharePointOnlineList" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SharePointOnlineListLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SharePointOnlineListLinkedService{} + +func (s *SharePointOnlineListLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SharePointOnlineListLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SharePointOnlineListLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SharePointOnlineListLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistlinkedservicetypeproperties.go new file mode 100644 index 00000000000..c51bffd70ba --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistlinkedservicetypeproperties.go @@ -0,0 +1,72 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SharePointOnlineListLinkedServiceTypeProperties struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalEmbeddedCert SecretBase `json:"servicePrincipalEmbeddedCert"` + ServicePrincipalEmbeddedCertPassword SecretBase `json:"servicePrincipalEmbeddedCertPassword"` + ServicePrincipalId string `json:"servicePrincipalId"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + SiteURL string `json:"siteUrl"` + TenantId string `json:"tenantId"` +} + +var _ json.Unmarshaler = &SharePointOnlineListLinkedServiceTypeProperties{} + +func (s *SharePointOnlineListLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId string `json:"servicePrincipalId"` + SiteURL string `json:"siteUrl"` + TenantId string `json:"tenantId"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.SiteURL = decoded.SiteURL + s.TenantId = decoded.TenantId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SharePointOnlineListLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalEmbeddedCert"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalEmbeddedCert' for 'SharePointOnlineListLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalEmbeddedCert = impl + } + + if v, ok := temp["servicePrincipalEmbeddedCertPassword"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalEmbeddedCertPassword' for 'SharePointOnlineListLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalEmbeddedCertPassword = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'SharePointOnlineListLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistresourcedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistresourcedataset.go new file mode 100644 index 00000000000..7d54a0c6a38 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sharepointonlinelistresourcedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SharePointOnlineListResourceDataset{} + +type SharePointOnlineListResourceDataset struct { + TypeProperties *SharePointOnlineListDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SharePointOnlineListResourceDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SharePointOnlineListResourceDataset{} + +func (s SharePointOnlineListResourceDataset) MarshalJSON() ([]byte, error) { + type wrapper SharePointOnlineListResourceDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SharePointOnlineListResourceDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SharePointOnlineListResourceDataset: %+v", err) + } + + decoded["type"] = "SharePointOnlineListResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SharePointOnlineListResourceDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SharePointOnlineListResourceDataset{} + +func (s *SharePointOnlineListResourceDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SharePointOnlineListDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SharePointOnlineListResourceDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SharePointOnlineListResourceDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifylinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifylinkedservice.go new file mode 100644 index 00000000000..b07cefe11cf --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifylinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ShopifyLinkedService{} + +type ShopifyLinkedService struct { + TypeProperties ShopifyLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ShopifyLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ShopifyLinkedService{} + +func (s ShopifyLinkedService) MarshalJSON() ([]byte, error) { + type wrapper ShopifyLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ShopifyLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ShopifyLinkedService: %+v", err) + } + + decoded["type"] = "Shopify" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ShopifyLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ShopifyLinkedService{} + +func (s *ShopifyLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ShopifyLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ShopifyLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ShopifyLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifylinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifylinkedservicetypeproperties.go new file mode 100644 index 00000000000..096118a3a92 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifylinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ShopifyLinkedServiceTypeProperties struct { + AccessToken SecretBase `json:"accessToken"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &ShopifyLinkedServiceTypeProperties{} + +func (s *ShopifyLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host string `json:"host"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ShopifyLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accessToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessToken' for 'ShopifyLinkedServiceTypeProperties': %+v", err) + } + s.AccessToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifyobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifyobjectdataset.go new file mode 100644 index 00000000000..04af8528f3a --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_shopifyobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ShopifyObjectDataset{} + +type ShopifyObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ShopifyObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ShopifyObjectDataset{} + +func (s ShopifyObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper ShopifyObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ShopifyObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ShopifyObjectDataset: %+v", err) + } + + decoded["type"] = "ShopifyObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ShopifyObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ShopifyObjectDataset{} + +func (s *ShopifyObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ShopifyObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ShopifyObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_smartsheetlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_smartsheetlinkedservice.go new file mode 100644 index 00000000000..cf808168a33 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_smartsheetlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SmartsheetLinkedService{} + +type SmartsheetLinkedService struct { + TypeProperties SmartsheetLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SmartsheetLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SmartsheetLinkedService{} + +func (s SmartsheetLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SmartsheetLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SmartsheetLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SmartsheetLinkedService: %+v", err) + } + + decoded["type"] = "Smartsheet" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SmartsheetLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SmartsheetLinkedService{} + +func (s *SmartsheetLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SmartsheetLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SmartsheetLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SmartsheetLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_smartsheetlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_smartsheetlinkedservicetypeproperties.go new file mode 100644 index 00000000000..096e1bfeeb3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_smartsheetlinkedservicetypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SmartsheetLinkedServiceTypeProperties struct { + ApiToken SecretBase `json:"apiToken"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` +} + +var _ json.Unmarshaler = &SmartsheetLinkedServiceTypeProperties{} + +func (s *SmartsheetLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EncryptedCredential = decoded.EncryptedCredential + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SmartsheetLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["apiToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ApiToken' for 'SmartsheetLinkedServiceTypeProperties': %+v", err) + } + s.ApiToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakedataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakedataset.go new file mode 100644 index 00000000000..aebd26f74f5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakedataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SnowflakeDataset{} + +type SnowflakeDataset struct { + TypeProperties SnowflakeDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SnowflakeDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SnowflakeDataset{} + +func (s SnowflakeDataset) MarshalJSON() ([]byte, error) { + type wrapper SnowflakeDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SnowflakeDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SnowflakeDataset: %+v", err) + } + + decoded["type"] = "SnowflakeTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SnowflakeDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SnowflakeDataset{} + +func (s *SnowflakeDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SnowflakeDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SnowflakeDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SnowflakeDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakedatasettypeproperties.go new file mode 100644 index 00000000000..dad9ae5202c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakedatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnowflakeDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedservice.go new file mode 100644 index 00000000000..7523611f606 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SnowflakeLinkedService{} + +type SnowflakeLinkedService struct { + TypeProperties SnowflakeLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SnowflakeLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SnowflakeLinkedService{} + +func (s SnowflakeLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SnowflakeLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SnowflakeLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SnowflakeLinkedService: %+v", err) + } + + decoded["type"] = "Snowflake" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SnowflakeLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SnowflakeLinkedService{} + +func (s *SnowflakeLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SnowflakeLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SnowflakeLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SnowflakeLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedservicetypeproperties.go new file mode 100644 index 00000000000..0c7bdff8613 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedservicetypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnowflakeLinkedServiceTypeProperties struct { + ConnectionString string `json:"connectionString"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedv2servicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedv2servicetypeproperties.go new file mode 100644 index 00000000000..2f7976d6f56 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakelinkedv2servicetypeproperties.go @@ -0,0 +1,93 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnowflakeLinkedV2ServiceTypeProperties struct { + AccountIdentifier string `json:"accountIdentifier"` + AuthenticationType *SnowflakeAuthenticationType `json:"authenticationType,omitempty"` + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + Database string `json:"database"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + PrivateKey SecretBase `json:"privateKey"` + PrivateKeyPassphrase SecretBase `json:"privateKeyPassphrase"` + Scope *string `json:"scope,omitempty"` + TenantId *string `json:"tenantId,omitempty"` + User *string `json:"user,omitempty"` + Warehouse string `json:"warehouse"` +} + +var _ json.Unmarshaler = &SnowflakeLinkedV2ServiceTypeProperties{} + +func (s *SnowflakeLinkedV2ServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AccountIdentifier string `json:"accountIdentifier"` + AuthenticationType *SnowflakeAuthenticationType `json:"authenticationType,omitempty"` + ClientId *string `json:"clientId,omitempty"` + Database string `json:"database"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Scope *string `json:"scope,omitempty"` + TenantId *string `json:"tenantId,omitempty"` + User *string `json:"user,omitempty"` + Warehouse string `json:"warehouse"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AccountIdentifier = decoded.AccountIdentifier + s.AuthenticationType = decoded.AuthenticationType + s.ClientId = decoded.ClientId + s.Database = decoded.Database + s.EncryptedCredential = decoded.EncryptedCredential + s.Scope = decoded.Scope + s.TenantId = decoded.TenantId + s.User = decoded.User + s.Warehouse = decoded.Warehouse + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SnowflakeLinkedV2ServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'SnowflakeLinkedV2ServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SnowflakeLinkedV2ServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["privateKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'PrivateKey' for 'SnowflakeLinkedV2ServiceTypeProperties': %+v", err) + } + s.PrivateKey = impl + } + + if v, ok := temp["privateKeyPassphrase"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'PrivateKeyPassphrase' for 'SnowflakeLinkedV2ServiceTypeProperties': %+v", err) + } + s.PrivateKeyPassphrase = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakev2dataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakev2dataset.go new file mode 100644 index 00000000000..1101d07e726 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakev2dataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SnowflakeV2Dataset{} + +type SnowflakeV2Dataset struct { + TypeProperties SnowflakeDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SnowflakeV2Dataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SnowflakeV2Dataset{} + +func (s SnowflakeV2Dataset) MarshalJSON() ([]byte, error) { + type wrapper SnowflakeV2Dataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SnowflakeV2Dataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SnowflakeV2Dataset: %+v", err) + } + + decoded["type"] = "SnowflakeV2Table" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SnowflakeV2Dataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SnowflakeV2Dataset{} + +func (s *SnowflakeV2Dataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SnowflakeDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SnowflakeV2Dataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SnowflakeV2Dataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakev2linkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakev2linkedservice.go new file mode 100644 index 00000000000..59a3f227741 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_snowflakev2linkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SnowflakeV2LinkedService{} + +type SnowflakeV2LinkedService struct { + TypeProperties SnowflakeLinkedV2ServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SnowflakeV2LinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SnowflakeV2LinkedService{} + +func (s SnowflakeV2LinkedService) MarshalJSON() ([]byte, error) { + type wrapper SnowflakeV2LinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SnowflakeV2LinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SnowflakeV2LinkedService: %+v", err) + } + + decoded["type"] = "SnowflakeV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SnowflakeV2LinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SnowflakeV2LinkedService{} + +func (s *SnowflakeV2LinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SnowflakeLinkedV2ServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SnowflakeV2LinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SnowflakeV2LinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparkdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparkdatasettypeproperties.go new file mode 100644 index 00000000000..479272be871 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparkdatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SparkDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparklinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparklinkedservice.go new file mode 100644 index 00000000000..1b0da5e993b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparklinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SparkLinkedService{} + +type SparkLinkedService struct { + TypeProperties SparkLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SparkLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SparkLinkedService{} + +func (s SparkLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SparkLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SparkLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SparkLinkedService: %+v", err) + } + + decoded["type"] = "Spark" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SparkLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SparkLinkedService{} + +func (s *SparkLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SparkLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SparkLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SparkLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparklinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparklinkedservicetypeproperties.go new file mode 100644 index 00000000000..fe47b06165f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparklinkedservicetypeproperties.go @@ -0,0 +1,78 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SparkLinkedServiceTypeProperties struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType SparkAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HTTPPath *string `json:"httpPath,omitempty"` + Host string `json:"host"` + Password SecretBase `json:"password"` + Port int64 `json:"port"` + ServerType *SparkServerType `json:"serverType,omitempty"` + ThriftTransportProtocol *SparkThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &SparkLinkedServiceTypeProperties{} + +func (s *SparkLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType SparkAuthenticationType `json:"authenticationType"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + HTTPPath *string `json:"httpPath,omitempty"` + Host string `json:"host"` + Port int64 `json:"port"` + ServerType *SparkServerType `json:"serverType,omitempty"` + ThriftTransportProtocol *SparkThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + TrustedCertPath *string `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AllowHostNameCNMismatch = decoded.AllowHostNameCNMismatch + s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert + s.AuthenticationType = decoded.AuthenticationType + s.EnableSsl = decoded.EnableSsl + s.EncryptedCredential = decoded.EncryptedCredential + s.HTTPPath = decoded.HTTPPath + s.Host = decoded.Host + s.Port = decoded.Port + s.ServerType = decoded.ServerType + s.ThriftTransportProtocol = decoded.ThriftTransportProtocol + s.TrustedCertPath = decoded.TrustedCertPath + s.UseSystemTrustStore = decoded.UseSystemTrustStore + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SparkLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SparkLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparkobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparkobjectdataset.go new file mode 100644 index 00000000000..718a8139416 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sparkobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SparkObjectDataset{} + +type SparkObjectDataset struct { + TypeProperties *SparkDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SparkObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SparkObjectDataset{} + +func (s SparkObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper SparkObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SparkObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SparkObjectDataset: %+v", err) + } + + decoded["type"] = "SparkObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SparkObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SparkObjectDataset{} + +func (s *SparkObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SparkDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SparkObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SparkObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlalwaysencryptedproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlalwaysencryptedproperties.go new file mode 100644 index 00000000000..a049ac1f957 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlalwaysencryptedproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlAlwaysEncryptedProperties struct { + AlwaysEncryptedAkvAuthType SqlAlwaysEncryptedAkvAuthType `json:"alwaysEncryptedAkvAuthType"` + Credential *CredentialReference `json:"credential,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` +} + +var _ json.Unmarshaler = &SqlAlwaysEncryptedProperties{} + +func (s *SqlAlwaysEncryptedProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AlwaysEncryptedAkvAuthType SqlAlwaysEncryptedAkvAuthType `json:"alwaysEncryptedAkvAuthType"` + Credential *CredentialReference `json:"credential,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AlwaysEncryptedAkvAuthType = decoded.AlwaysEncryptedAkvAuthType + s.Credential = decoded.Credential + s.ServicePrincipalId = decoded.ServicePrincipalId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SqlAlwaysEncryptedProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'SqlAlwaysEncryptedProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlserverlinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlserverlinkedservice.go new file mode 100644 index 00000000000..8f7de808b48 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlserverlinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SqlServerLinkedService{} + +type SqlServerLinkedService struct { + TypeProperties SqlServerLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SqlServerLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SqlServerLinkedService{} + +func (s SqlServerLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SqlServerLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlServerLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlServerLinkedService: %+v", err) + } + + decoded["type"] = "SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlServerLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SqlServerLinkedService{} + +func (s *SqlServerLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SqlServerLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SqlServerLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SqlServerLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlserverlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlserverlinkedservicetypeproperties.go new file mode 100644 index 00000000000..d3bbbec8e67 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlserverlinkedservicetypeproperties.go @@ -0,0 +1,114 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerLinkedServiceTypeProperties struct { + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *SqlServerAuthenticationType `json:"authenticationType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Password SecretBase `json:"password"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &SqlServerLinkedServiceTypeProperties{} + +func (s *SqlServerLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *string `json:"applicationIntent,omitempty"` + AuthenticationType *SqlServerAuthenticationType `json:"authenticationType,omitempty"` + CommandTimeout *int64 `json:"commandTimeout,omitempty"` + ConnectRetryCount *int64 `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *int64 `json:"connectRetryInterval,omitempty"` + ConnectTimeout *int64 `json:"connectTimeout,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *string `json:"database,omitempty"` + Encrypt *string `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *string `json:"failoverPartner,omitempty"` + HostNameInCertificate *string `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *bool `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *int64 `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *int64 `json:"maxPoolSize,omitempty"` + MinPoolSize *int64 `json:"minPoolSize,omitempty"` + MultiSubnetFailover *bool `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *bool `json:"multipleActiveResultSets,omitempty"` + PacketSize *int64 `json:"packetSize,omitempty"` + Pooling *bool `json:"pooling,omitempty"` + Server *string `json:"server,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AlwaysEncryptedSettings = decoded.AlwaysEncryptedSettings + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout + s.ConnectionString = decoded.ConnectionString + s.Credential = decoded.Credential + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt + s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.TrustServerCertificate = decoded.TrustServerCertificate + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SqlServerLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SqlServerLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlservertabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlservertabledataset.go new file mode 100644 index 00000000000..5358d9f55ad --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlservertabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SqlServerTableDataset{} + +type SqlServerTableDataset struct { + TypeProperties *SqlServerTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SqlServerTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SqlServerTableDataset{} + +func (s SqlServerTableDataset) MarshalJSON() ([]byte, error) { + type wrapper SqlServerTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlServerTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlServerTableDataset: %+v", err) + } + + decoded["type"] = "SqlServerTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlServerTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SqlServerTableDataset{} + +func (s *SqlServerTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SqlServerTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SqlServerTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SqlServerTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlservertabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlservertabledatasettypeproperties.go new file mode 100644 index 00000000000..68350b7d743 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sqlservertabledatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squarelinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squarelinkedservice.go new file mode 100644 index 00000000000..84c22e78a7e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squarelinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SquareLinkedService{} + +type SquareLinkedService struct { + TypeProperties SquareLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SquareLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SquareLinkedService{} + +func (s SquareLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SquareLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SquareLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SquareLinkedService: %+v", err) + } + + decoded["type"] = "Square" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SquareLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SquareLinkedService{} + +func (s *SquareLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SquareLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SquareLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SquareLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squarelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squarelinkedservicetypeproperties.go new file mode 100644 index 00000000000..e04173d5689 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squarelinkedservicetypeproperties.go @@ -0,0 +1,63 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SquareLinkedServiceTypeProperties struct { + ClientId *string `json:"clientId,omitempty"` + ClientSecret SecretBase `json:"clientSecret"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host *string `json:"host,omitempty"` + RedirectUri *string `json:"redirectUri,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &SquareLinkedServiceTypeProperties{} + +func (s *SquareLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientId *string `json:"clientId,omitempty"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host *string `json:"host,omitempty"` + RedirectUri *string `json:"redirectUri,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientId = decoded.ClientId + s.ConnectionProperties = decoded.ConnectionProperties + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.RedirectUri = decoded.RedirectUri + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SquareLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["clientSecret"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ClientSecret' for 'SquareLinkedServiceTypeProperties': %+v", err) + } + s.ClientSecret = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squareobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squareobjectdataset.go new file mode 100644 index 00000000000..ad2d6200082 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_squareobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SquareObjectDataset{} + +type SquareObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SquareObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SquareObjectDataset{} + +func (s SquareObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper SquareObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SquareObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SquareObjectDataset: %+v", err) + } + + decoded["type"] = "SquareObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SquareObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SquareObjectDataset{} + +func (s *SquareObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SquareObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SquareObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybaselinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybaselinkedservice.go new file mode 100644 index 00000000000..06aa400f137 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybaselinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = SybaseLinkedService{} + +type SybaseLinkedService struct { + TypeProperties SybaseLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s SybaseLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = SybaseLinkedService{} + +func (s SybaseLinkedService) MarshalJSON() ([]byte, error) { + type wrapper SybaseLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SybaseLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SybaseLinkedService: %+v", err) + } + + decoded["type"] = "Sybase" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SybaseLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SybaseLinkedService{} + +func (s *SybaseLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties SybaseLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SybaseLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'SybaseLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybaselinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybaselinkedservicetypeproperties.go new file mode 100644 index 00000000000..ddd93aa1106 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybaselinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SybaseLinkedServiceTypeProperties struct { + AuthenticationType *SybaseAuthenticationType `json:"authenticationType,omitempty"` + Database string `json:"database"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Schema *string `json:"schema,omitempty"` + Server string `json:"server"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &SybaseLinkedServiceTypeProperties{} + +func (s *SybaseLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *SybaseAuthenticationType `json:"authenticationType,omitempty"` + Database string `json:"database"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Schema *string `json:"schema,omitempty"` + Server string `json:"server"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.Database = decoded.Database + s.EncryptedCredential = decoded.EncryptedCredential + s.Schema = decoded.Schema + s.Server = decoded.Server + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SybaseLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'SybaseLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybasetabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybasetabledataset.go new file mode 100644 index 00000000000..8fd47c2dce0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybasetabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = SybaseTableDataset{} + +type SybaseTableDataset struct { + TypeProperties *SybaseTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s SybaseTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = SybaseTableDataset{} + +func (s SybaseTableDataset) MarshalJSON() ([]byte, error) { + type wrapper SybaseTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SybaseTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SybaseTableDataset: %+v", err) + } + + decoded["type"] = "SybaseTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SybaseTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &SybaseTableDataset{} + +func (s *SybaseTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *SybaseTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SybaseTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'SybaseTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybasetabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybasetabledatasettypeproperties.go new file mode 100644 index 00000000000..0f0443b09ce --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_sybasetabledatasettypeproperties.go @@ -0,0 +1,8 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SybaseTableDatasetTypeProperties struct { + TableName *string `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teamdesklinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teamdesklinkedservice.go new file mode 100644 index 00000000000..898ccc988f3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teamdesklinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = TeamDeskLinkedService{} + +type TeamDeskLinkedService struct { + TypeProperties TeamDeskLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s TeamDeskLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = TeamDeskLinkedService{} + +func (s TeamDeskLinkedService) MarshalJSON() ([]byte, error) { + type wrapper TeamDeskLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling TeamDeskLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling TeamDeskLinkedService: %+v", err) + } + + decoded["type"] = "TeamDesk" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling TeamDeskLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &TeamDeskLinkedService{} + +func (s *TeamDeskLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties TeamDeskLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TeamDeskLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'TeamDeskLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teamdesklinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teamdesklinkedservicetypeproperties.go new file mode 100644 index 00000000000..3408cdeed5b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teamdesklinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TeamDeskLinkedServiceTypeProperties struct { + ApiToken SecretBase `json:"apiToken"` + AuthenticationType TeamDeskAuthenticationType `json:"authenticationType"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &TeamDeskLinkedServiceTypeProperties{} + +func (s *TeamDeskLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType TeamDeskAuthenticationType `json:"authenticationType"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.EncryptedCredential = decoded.EncryptedCredential + s.Url = decoded.Url + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TeamDeskLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["apiToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ApiToken' for 'TeamDeskLinkedServiceTypeProperties': %+v", err) + } + s.ApiToken = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'TeamDeskLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatalinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatalinkedservice.go new file mode 100644 index 00000000000..49c1c9a78d6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatalinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = TeradataLinkedService{} + +type TeradataLinkedService struct { + TypeProperties TeradataLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s TeradataLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = TeradataLinkedService{} + +func (s TeradataLinkedService) MarshalJSON() ([]byte, error) { + type wrapper TeradataLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling TeradataLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling TeradataLinkedService: %+v", err) + } + + decoded["type"] = "Teradata" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling TeradataLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &TeradataLinkedService{} + +func (s *TeradataLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties TeradataLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TeradataLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'TeradataLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatalinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatalinkedservicetypeproperties.go new file mode 100644 index 00000000000..9276d981b6f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatalinkedservicetypeproperties.go @@ -0,0 +1,54 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TeradataLinkedServiceTypeProperties struct { + AuthenticationType *TeradataAuthenticationType `json:"authenticationType,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Server *string `json:"server,omitempty"` + Username *string `json:"username,omitempty"` +} + +var _ json.Unmarshaler = &TeradataLinkedServiceTypeProperties{} + +func (s *TeradataLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType *TeradataAuthenticationType `json:"authenticationType,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Server *string `json:"server,omitempty"` + Username *string `json:"username,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.ConnectionString = decoded.ConnectionString + s.EncryptedCredential = decoded.EncryptedCredential + s.Server = decoded.Server + s.Username = decoded.Username + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TeradataLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'TeradataLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatatabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatatabledataset.go new file mode 100644 index 00000000000..05ded8d2f74 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatatabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = TeradataTableDataset{} + +type TeradataTableDataset struct { + TypeProperties *TeradataTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s TeradataTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = TeradataTableDataset{} + +func (s TeradataTableDataset) MarshalJSON() ([]byte, error) { + type wrapper TeradataTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling TeradataTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling TeradataTableDataset: %+v", err) + } + + decoded["type"] = "TeradataTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling TeradataTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &TeradataTableDataset{} + +func (s *TeradataTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *TeradataTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TeradataTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'TeradataTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatatabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatatabledatasettypeproperties.go new file mode 100644 index 00000000000..7262b88a677 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_teradatatabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TeradataTableDatasetTypeProperties struct { + Database *string `json:"database,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_textformat.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_textformat.go new file mode 100644 index 00000000000..d9ecddc8b4b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_textformat.go @@ -0,0 +1,62 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DatasetStorageFormat = TextFormat{} + +type TextFormat struct { + ColumnDelimiter *string `json:"columnDelimiter,omitempty"` + EncodingName *string `json:"encodingName,omitempty"` + EscapeChar *string `json:"escapeChar,omitempty"` + FirstRowAsHeader *bool `json:"firstRowAsHeader,omitempty"` + NullValue *string `json:"nullValue,omitempty"` + QuoteChar *string `json:"quoteChar,omitempty"` + RowDelimiter *string `json:"rowDelimiter,omitempty"` + SkipLineCount *int64 `json:"skipLineCount,omitempty"` + TreatEmptyAsNull *bool `json:"treatEmptyAsNull,omitempty"` + + // Fields inherited from DatasetStorageFormat + + Deserializer *string `json:"deserializer,omitempty"` + Serializer *string `json:"serializer,omitempty"` + Type string `json:"type"` +} + +func (s TextFormat) DatasetStorageFormat() BaseDatasetStorageFormatImpl { + return BaseDatasetStorageFormatImpl{ + Deserializer: s.Deserializer, + Serializer: s.Serializer, + Type: s.Type, + } +} + +var _ json.Marshaler = TextFormat{} + +func (s TextFormat) MarshalJSON() ([]byte, error) { + type wrapper TextFormat + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling TextFormat: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling TextFormat: %+v", err) + } + + decoded["type"] = "TextFormat" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling TextFormat: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_transformation.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_transformation.go new file mode 100644 index 00000000000..7cf910ff7e3 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_transformation.go @@ -0,0 +1,12 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Transformation struct { + Dataset *DatasetReference `json:"dataset,omitempty"` + Description *string `json:"description,omitempty"` + Flowlet *DataFlowReference `json:"flowlet,omitempty"` + LinkedService *LinkedServiceReference `json:"linkedService,omitempty"` + Name string `json:"name"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_twiliolinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_twiliolinkedservice.go new file mode 100644 index 00000000000..9734d2f7964 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_twiliolinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = TwilioLinkedService{} + +type TwilioLinkedService struct { + TypeProperties TwilioLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s TwilioLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = TwilioLinkedService{} + +func (s TwilioLinkedService) MarshalJSON() ([]byte, error) { + type wrapper TwilioLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling TwilioLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling TwilioLinkedService: %+v", err) + } + + decoded["type"] = "Twilio" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling TwilioLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &TwilioLinkedService{} + +func (s *TwilioLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties TwilioLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TwilioLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'TwilioLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_twiliolinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_twiliolinkedservicetypeproperties.go new file mode 100644 index 00000000000..7b5fc9604da --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_twiliolinkedservicetypeproperties.go @@ -0,0 +1,42 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TwilioLinkedServiceTypeProperties struct { + Password SecretBase `json:"password"` + UserName string `json:"userName"` +} + +var _ json.Unmarshaler = &TwilioLinkedServiceTypeProperties{} + +func (s *TwilioLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + UserName string `json:"userName"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TwilioLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'TwilioLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticadatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticadatasettypeproperties.go new file mode 100644 index 00000000000..3960e03266f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticadatasettypeproperties.go @@ -0,0 +1,10 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VerticaDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` + TableName *interface{} `json:"tableName,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticalinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticalinkedservice.go new file mode 100644 index 00000000000..cf48fa945f7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticalinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = VerticaLinkedService{} + +type VerticaLinkedService struct { + TypeProperties VerticaLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s VerticaLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = VerticaLinkedService{} + +func (s VerticaLinkedService) MarshalJSON() ([]byte, error) { + type wrapper VerticaLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VerticaLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VerticaLinkedService: %+v", err) + } + + decoded["type"] = "Vertica" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VerticaLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &VerticaLinkedService{} + +func (s *VerticaLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties VerticaLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling VerticaLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'VerticaLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticalinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticalinkedservicetypeproperties.go new file mode 100644 index 00000000000..37cb6fec34e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticalinkedservicetypeproperties.go @@ -0,0 +1,14 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VerticaLinkedServiceTypeProperties struct { + ConnectionString *string `json:"connectionString,omitempty"` + Database *string `json:"database,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Port *int64 `json:"port,omitempty"` + Pwd *AzureKeyVaultSecretReference `json:"pwd,omitempty"` + Server *string `json:"server,omitempty"` + Uid *string `json:"uid,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticatabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticatabledataset.go new file mode 100644 index 00000000000..3b25cd95919 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_verticatabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = VerticaTableDataset{} + +type VerticaTableDataset struct { + TypeProperties *VerticaDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s VerticaTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = VerticaTableDataset{} + +func (s VerticaTableDataset) MarshalJSON() ([]byte, error) { + type wrapper VerticaTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VerticaTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VerticaTableDataset: %+v", err) + } + + decoded["type"] = "VerticaTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VerticaTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &VerticaTableDataset{} + +func (s *VerticaTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *VerticaDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling VerticaTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'VerticaTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehouselinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehouselinkedservice.go new file mode 100644 index 00000000000..8b4f7c2b6e2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehouselinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = WarehouseLinkedService{} + +type WarehouseLinkedService struct { + TypeProperties WarehouseLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s WarehouseLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = WarehouseLinkedService{} + +func (s WarehouseLinkedService) MarshalJSON() ([]byte, error) { + type wrapper WarehouseLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling WarehouseLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling WarehouseLinkedService: %+v", err) + } + + decoded["type"] = "Warehouse" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling WarehouseLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &WarehouseLinkedService{} + +func (s *WarehouseLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties WarehouseLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling WarehouseLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'WarehouseLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehouselinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehouselinkedservicetypeproperties.go new file mode 100644 index 00000000000..871e6f09e79 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehouselinkedservicetypeproperties.go @@ -0,0 +1,69 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WarehouseLinkedServiceTypeProperties struct { + ArtifactId string `json:"artifactId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *string `json:"tenant,omitempty"` + WorkspaceId *string `json:"workspaceId,omitempty"` +} + +var _ json.Unmarshaler = &WarehouseLinkedServiceTypeProperties{} + +func (s *WarehouseLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ArtifactId string `json:"artifactId"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint string `json:"endpoint"` + ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *string `json:"servicePrincipalId,omitempty"` + Tenant *string `json:"tenant,omitempty"` + WorkspaceId *string `json:"workspaceId,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ArtifactId = decoded.ArtifactId + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType + s.ServicePrincipalId = decoded.ServicePrincipalId + s.Tenant = decoded.Tenant + s.WorkspaceId = decoded.WorkspaceId + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling WarehouseLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'WarehouseLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + + if v, ok := temp["servicePrincipalKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalKey' for 'WarehouseLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehousetabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehousetabledataset.go new file mode 100644 index 00000000000..3639a4023d6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehousetabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = WarehouseTableDataset{} + +type WarehouseTableDataset struct { + TypeProperties *WarehouseTableDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s WarehouseTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = WarehouseTableDataset{} + +func (s WarehouseTableDataset) MarshalJSON() ([]byte, error) { + type wrapper WarehouseTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling WarehouseTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling WarehouseTableDataset: %+v", err) + } + + decoded["type"] = "WarehouseTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling WarehouseTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &WarehouseTableDataset{} + +func (s *WarehouseTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *WarehouseTableDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling WarehouseTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'WarehouseTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehousetabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehousetabledatasettypeproperties.go new file mode 100644 index 00000000000..8122ffa6bad --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_warehousetabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WarehouseTableDatasetTypeProperties struct { + Schema *string `json:"schema,omitempty"` + Table *string `json:"table,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webanonymousauthentication.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webanonymousauthentication.go new file mode 100644 index 00000000000..18076f92e9c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webanonymousauthentication.go @@ -0,0 +1,51 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ WebLinkedServiceTypeProperties = WebAnonymousAuthentication{} + +type WebAnonymousAuthentication struct { + + // Fields inherited from WebLinkedServiceTypeProperties + + AuthenticationType WebAuthenticationType `json:"authenticationType"` + Url string `json:"url"` +} + +func (s WebAnonymousAuthentication) WebLinkedServiceTypeProperties() BaseWebLinkedServiceTypePropertiesImpl { + return BaseWebLinkedServiceTypePropertiesImpl{ + AuthenticationType: s.AuthenticationType, + Url: s.Url, + } +} + +var _ json.Marshaler = WebAnonymousAuthentication{} + +func (s WebAnonymousAuthentication) MarshalJSON() ([]byte, error) { + type wrapper WebAnonymousAuthentication + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling WebAnonymousAuthentication: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling WebAnonymousAuthentication: %+v", err) + } + + decoded["authenticationType"] = "Anonymous" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling WebAnonymousAuthentication: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webbasicauthentication.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webbasicauthentication.go new file mode 100644 index 00000000000..280215491a2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webbasicauthentication.go @@ -0,0 +1,85 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ WebLinkedServiceTypeProperties = WebBasicAuthentication{} + +type WebBasicAuthentication struct { + Password SecretBase `json:"password"` + Username string `json:"username"` + + // Fields inherited from WebLinkedServiceTypeProperties + + AuthenticationType WebAuthenticationType `json:"authenticationType"` + Url string `json:"url"` +} + +func (s WebBasicAuthentication) WebLinkedServiceTypeProperties() BaseWebLinkedServiceTypePropertiesImpl { + return BaseWebLinkedServiceTypePropertiesImpl{ + AuthenticationType: s.AuthenticationType, + Url: s.Url, + } +} + +var _ json.Marshaler = WebBasicAuthentication{} + +func (s WebBasicAuthentication) MarshalJSON() ([]byte, error) { + type wrapper WebBasicAuthentication + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling WebBasicAuthentication: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling WebBasicAuthentication: %+v", err) + } + + decoded["authenticationType"] = "Basic" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling WebBasicAuthentication: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &WebBasicAuthentication{} + +func (s *WebBasicAuthentication) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Username string `json:"username"` + AuthenticationType WebAuthenticationType `json:"authenticationType"` + Url string `json:"url"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Username = decoded.Username + s.AuthenticationType = decoded.AuthenticationType + s.Url = decoded.Url + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling WebBasicAuthentication into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'WebBasicAuthentication': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webclientcertificateauthentication.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webclientcertificateauthentication.go new file mode 100644 index 00000000000..ebc64d2ecd2 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webclientcertificateauthentication.go @@ -0,0 +1,91 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ WebLinkedServiceTypeProperties = WebClientCertificateAuthentication{} + +type WebClientCertificateAuthentication struct { + Password SecretBase `json:"password"` + Pfx SecretBase `json:"pfx"` + + // Fields inherited from WebLinkedServiceTypeProperties + + AuthenticationType WebAuthenticationType `json:"authenticationType"` + Url string `json:"url"` +} + +func (s WebClientCertificateAuthentication) WebLinkedServiceTypeProperties() BaseWebLinkedServiceTypePropertiesImpl { + return BaseWebLinkedServiceTypePropertiesImpl{ + AuthenticationType: s.AuthenticationType, + Url: s.Url, + } +} + +var _ json.Marshaler = WebClientCertificateAuthentication{} + +func (s WebClientCertificateAuthentication) MarshalJSON() ([]byte, error) { + type wrapper WebClientCertificateAuthentication + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling WebClientCertificateAuthentication: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling WebClientCertificateAuthentication: %+v", err) + } + + decoded["authenticationType"] = "ClientCertificate" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling WebClientCertificateAuthentication: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &WebClientCertificateAuthentication{} + +func (s *WebClientCertificateAuthentication) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType WebAuthenticationType `json:"authenticationType"` + Url string `json:"url"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.Url = decoded.Url + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling WebClientCertificateAuthentication into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'WebClientCertificateAuthentication': %+v", err) + } + s.Password = impl + } + + if v, ok := temp["pfx"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Pfx' for 'WebClientCertificateAuthentication': %+v", err) + } + s.Pfx = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_weblinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_weblinkedservice.go new file mode 100644 index 00000000000..527a96d8b6f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_weblinkedservice.go @@ -0,0 +1,104 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = WebLinkedService{} + +type WebLinkedService struct { + TypeProperties WebLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s WebLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = WebLinkedService{} + +func (s WebLinkedService) MarshalJSON() ([]byte, error) { + type wrapper WebLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling WebLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling WebLinkedService: %+v", err) + } + + decoded["type"] = "Web" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling WebLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &WebLinkedService{} + +func (s *WebLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling WebLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'WebLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + if v, ok := temp["typeProperties"]; ok { + impl, err := UnmarshalWebLinkedServiceTypePropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TypeProperties' for 'WebLinkedService': %+v", err) + } + s.TypeProperties = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_weblinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_weblinkedservicetypeproperties.go new file mode 100644 index 00000000000..aaf7ba6b40c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_weblinkedservicetypeproperties.go @@ -0,0 +1,92 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebLinkedServiceTypeProperties interface { + WebLinkedServiceTypeProperties() BaseWebLinkedServiceTypePropertiesImpl +} + +var _ WebLinkedServiceTypeProperties = BaseWebLinkedServiceTypePropertiesImpl{} + +type BaseWebLinkedServiceTypePropertiesImpl struct { + AuthenticationType WebAuthenticationType `json:"authenticationType"` + Url string `json:"url"` +} + +func (s BaseWebLinkedServiceTypePropertiesImpl) WebLinkedServiceTypeProperties() BaseWebLinkedServiceTypePropertiesImpl { + return s +} + +var _ WebLinkedServiceTypeProperties = RawWebLinkedServiceTypePropertiesImpl{} + +// RawWebLinkedServiceTypePropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawWebLinkedServiceTypePropertiesImpl struct { + webLinkedServiceTypeProperties BaseWebLinkedServiceTypePropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawWebLinkedServiceTypePropertiesImpl) WebLinkedServiceTypeProperties() BaseWebLinkedServiceTypePropertiesImpl { + return s.webLinkedServiceTypeProperties +} + +func UnmarshalWebLinkedServiceTypePropertiesImplementation(input []byte) (WebLinkedServiceTypeProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling WebLinkedServiceTypeProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["authenticationType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Anonymous") { + var out WebAnonymousAuthentication + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into WebAnonymousAuthentication: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Basic") { + var out WebBasicAuthentication + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into WebBasicAuthentication: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ClientCertificate") { + var out WebClientCertificateAuthentication + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into WebClientCertificateAuthentication: %+v", err) + } + return out, nil + } + + var parent BaseWebLinkedServiceTypePropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseWebLinkedServiceTypePropertiesImpl: %+v", err) + } + + return RawWebLinkedServiceTypePropertiesImpl{ + webLinkedServiceTypeProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webtabledataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webtabledataset.go new file mode 100644 index 00000000000..9106f37571e --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webtabledataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = WebTableDataset{} + +type WebTableDataset struct { + TypeProperties WebTableDatasetTypeProperties `json:"typeProperties"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s WebTableDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = WebTableDataset{} + +func (s WebTableDataset) MarshalJSON() ([]byte, error) { + type wrapper WebTableDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling WebTableDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling WebTableDataset: %+v", err) + } + + decoded["type"] = "WebTable" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling WebTableDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &WebTableDataset{} + +func (s *WebTableDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties WebTableDatasetTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling WebTableDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'WebTableDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webtabledatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webtabledatasettypeproperties.go new file mode 100644 index 00000000000..766afaa8fe7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_webtabledatasettypeproperties.go @@ -0,0 +1,9 @@ +package dataflowdebugsession + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebTableDatasetTypeProperties struct { + Index int64 `json:"index"` + Path *string `json:"path,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_wranglingdataflow.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_wranglingdataflow.go new file mode 100644 index 00000000000..1c386a7641b --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_wranglingdataflow.go @@ -0,0 +1,56 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DataFlow = WranglingDataFlow{} + +type WranglingDataFlow struct { + TypeProperties *PowerQueryTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from DataFlow + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DataFlowFolder `json:"folder,omitempty"` + Type string `json:"type"` +} + +func (s WranglingDataFlow) DataFlow() BaseDataFlowImpl { + return BaseDataFlowImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + Type: s.Type, + } +} + +var _ json.Marshaler = WranglingDataFlow{} + +func (s WranglingDataFlow) MarshalJSON() ([]byte, error) { + type wrapper WranglingDataFlow + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling WranglingDataFlow: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling WranglingDataFlow: %+v", err) + } + + decoded["type"] = "WranglingDataFlow" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling WranglingDataFlow: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xerolinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xerolinkedservice.go new file mode 100644 index 00000000000..caee0f7e064 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xerolinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = XeroLinkedService{} + +type XeroLinkedService struct { + TypeProperties XeroLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s XeroLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = XeroLinkedService{} + +func (s XeroLinkedService) MarshalJSON() ([]byte, error) { + type wrapper XeroLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling XeroLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling XeroLinkedService: %+v", err) + } + + decoded["type"] = "Xero" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling XeroLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &XeroLinkedService{} + +func (s *XeroLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties XeroLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling XeroLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'XeroLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xerolinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xerolinkedservicetypeproperties.go new file mode 100644 index 00000000000..bd26e739bb9 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xerolinkedservicetypeproperties.go @@ -0,0 +1,66 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type XeroLinkedServiceTypeProperties struct { + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + ConsumerKey SecretBase `json:"consumerKey"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host *string `json:"host,omitempty"` + PrivateKey SecretBase `json:"privateKey"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &XeroLinkedServiceTypeProperties{} + +func (s *XeroLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host *string `json:"host,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ConnectionProperties = decoded.ConnectionProperties + s.EncryptedCredential = decoded.EncryptedCredential + s.Host = decoded.Host + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling XeroLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["consumerKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConsumerKey' for 'XeroLinkedServiceTypeProperties': %+v", err) + } + s.ConsumerKey = impl + } + + if v, ok := temp["privateKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'PrivateKey' for 'XeroLinkedServiceTypeProperties': %+v", err) + } + s.PrivateKey = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xeroobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xeroobjectdataset.go new file mode 100644 index 00000000000..a63d6cd63be --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xeroobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = XeroObjectDataset{} + +type XeroObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s XeroObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = XeroObjectDataset{} + +func (s XeroObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper XeroObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling XeroObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling XeroObjectDataset: %+v", err) + } + + decoded["type"] = "XeroObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling XeroObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &XeroObjectDataset{} + +func (s *XeroObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling XeroObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'XeroObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xmldataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xmldataset.go new file mode 100644 index 00000000000..4de1f224fbc --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xmldataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = XmlDataset{} + +type XmlDataset struct { + TypeProperties *XmlDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s XmlDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = XmlDataset{} + +func (s XmlDataset) MarshalJSON() ([]byte, error) { + type wrapper XmlDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling XmlDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling XmlDataset: %+v", err) + } + + decoded["type"] = "Xml" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling XmlDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &XmlDataset{} + +func (s *XmlDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *XmlDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling XmlDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'XmlDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xmldatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xmldatasettypeproperties.go new file mode 100644 index 00000000000..ef7846d36f0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_xmldatasettypeproperties.go @@ -0,0 +1,48 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type XmlDatasetTypeProperties struct { + Compression *DatasetCompression `json:"compression,omitempty"` + EncodingName *string `json:"encodingName,omitempty"` + Location DatasetLocation `json:"location"` + NullValue *string `json:"nullValue,omitempty"` +} + +var _ json.Unmarshaler = &XmlDatasetTypeProperties{} + +func (s *XmlDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Compression *DatasetCompression `json:"compression,omitempty"` + EncodingName *string `json:"encodingName,omitempty"` + NullValue *string `json:"nullValue,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Compression = decoded.Compression + s.EncodingName = decoded.EncodingName + s.NullValue = decoded.NullValue + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling XmlDatasetTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["location"]; ok { + impl, err := UnmarshalDatasetLocationImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Location' for 'XmlDatasetTypeProperties': %+v", err) + } + s.Location = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zendesklinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zendesklinkedservice.go new file mode 100644 index 00000000000..95a2476dad7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zendesklinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ZendeskLinkedService{} + +type ZendeskLinkedService struct { + TypeProperties ZendeskLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ZendeskLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ZendeskLinkedService{} + +func (s ZendeskLinkedService) MarshalJSON() ([]byte, error) { + type wrapper ZendeskLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ZendeskLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ZendeskLinkedService: %+v", err) + } + + decoded["type"] = "Zendesk" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ZendeskLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ZendeskLinkedService{} + +func (s *ZendeskLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ZendeskLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ZendeskLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ZendeskLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zendesklinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zendesklinkedservicetypeproperties.go new file mode 100644 index 00000000000..611d5cd7220 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zendesklinkedservicetypeproperties.go @@ -0,0 +1,60 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ZendeskLinkedServiceTypeProperties struct { + ApiToken SecretBase `json:"apiToken"` + AuthenticationType ZendeskAuthenticationType `json:"authenticationType"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Password SecretBase `json:"password"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` +} + +var _ json.Unmarshaler = &ZendeskLinkedServiceTypeProperties{} + +func (s *ZendeskLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AuthenticationType ZendeskAuthenticationType `json:"authenticationType"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Url string `json:"url"` + UserName *string `json:"userName,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AuthenticationType = decoded.AuthenticationType + s.EncryptedCredential = decoded.EncryptedCredential + s.Url = decoded.Url + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ZendeskLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["apiToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ApiToken' for 'ZendeskLinkedServiceTypeProperties': %+v", err) + } + s.ApiToken = impl + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'ZendeskLinkedServiceTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zoholinkedservice.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zoholinkedservice.go new file mode 100644 index 00000000000..81d9ac2c500 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zoholinkedservice.go @@ -0,0 +1,98 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ LinkedService = ZohoLinkedService{} + +type ZohoLinkedService struct { + TypeProperties ZohoLinkedServiceTypeProperties `json:"typeProperties"` + + // Fields inherited from LinkedService + + Annotations *[]interface{} `json:"annotations,omitempty"` + ConnectVia Reference `json:"connectVia"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` +} + +func (s ZohoLinkedService) LinkedService() BaseLinkedServiceImpl { + return BaseLinkedServiceImpl{ + Annotations: s.Annotations, + ConnectVia: s.ConnectVia, + Description: s.Description, + Parameters: s.Parameters, + Type: s.Type, + Version: s.Version, + } +} + +var _ json.Marshaler = ZohoLinkedService{} + +func (s ZohoLinkedService) MarshalJSON() ([]byte, error) { + type wrapper ZohoLinkedService + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ZohoLinkedService: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ZohoLinkedService: %+v", err) + } + + decoded["type"] = "Zoho" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ZohoLinkedService: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ZohoLinkedService{} + +func (s *ZohoLinkedService) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties ZohoLinkedServiceTypeProperties `json:"typeProperties"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Type string `json:"type"` + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Parameters = decoded.Parameters + s.Type = decoded.Type + s.Version = decoded.Version + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ZohoLinkedService into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["connectVia"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ConnectVia' for 'ZohoLinkedService': %+v", err) + } + s.ConnectVia = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zoholinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zoholinkedservicetypeproperties.go new file mode 100644 index 00000000000..202f7f86df0 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zoholinkedservicetypeproperties.go @@ -0,0 +1,57 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ZohoLinkedServiceTypeProperties struct { + AccessToken SecretBase `json:"accessToken"` + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` +} + +var _ json.Unmarshaler = &ZohoLinkedServiceTypeProperties{} + +func (s *ZohoLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ConnectionProperties *interface{} `json:"connectionProperties,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + UseEncryptedEndpoints *bool `json:"useEncryptedEndpoints,omitempty"` + UseHostVerification *bool `json:"useHostVerification,omitempty"` + UsePeerVerification *bool `json:"usePeerVerification,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ConnectionProperties = decoded.ConnectionProperties + s.EncryptedCredential = decoded.EncryptedCredential + s.Endpoint = decoded.Endpoint + s.UseEncryptedEndpoints = decoded.UseEncryptedEndpoints + s.UseHostVerification = decoded.UseHostVerification + s.UsePeerVerification = decoded.UsePeerVerification + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ZohoLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["accessToken"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'AccessToken' for 'ZohoLinkedServiceTypeProperties': %+v", err) + } + s.AccessToken = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zohoobjectdataset.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zohoobjectdataset.go new file mode 100644 index 00000000000..362bd92db20 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_zohoobjectdataset.go @@ -0,0 +1,106 @@ +package dataflowdebugsession + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Dataset = ZohoObjectDataset{} + +type ZohoObjectDataset struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + + // Fields inherited from Dataset + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + LinkedServiceName Reference `json:"linkedServiceName"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` +} + +func (s ZohoObjectDataset) Dataset() BaseDatasetImpl { + return BaseDatasetImpl{ + Annotations: s.Annotations, + Description: s.Description, + Folder: s.Folder, + LinkedServiceName: s.LinkedServiceName, + Parameters: s.Parameters, + Schema: s.Schema, + Structure: s.Structure, + Type: s.Type, + } +} + +var _ json.Marshaler = ZohoObjectDataset{} + +func (s ZohoObjectDataset) MarshalJSON() ([]byte, error) { + type wrapper ZohoObjectDataset + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ZohoObjectDataset: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ZohoObjectDataset: %+v", err) + } + + decoded["type"] = "ZohoObject" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ZohoObjectDataset: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ZohoObjectDataset{} + +func (s *ZohoObjectDataset) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TypeProperties *GenericDatasetTypeProperties `json:"typeProperties,omitempty"` + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + Folder *DatasetFolder `json:"folder,omitempty"` + Parameters *map[string]ParameterSpecification `json:"parameters,omitempty"` + Schema *interface{} `json:"schema,omitempty"` + Structure *interface{} `json:"structure,omitempty"` + Type string `json:"type"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TypeProperties = decoded.TypeProperties + s.Annotations = decoded.Annotations + s.Description = decoded.Description + s.Folder = decoded.Folder + s.Parameters = decoded.Parameters + s.Schema = decoded.Schema + s.Structure = decoded.Structure + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ZohoObjectDataset into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["linkedServiceName"]; ok { + impl, err := UnmarshalReferenceImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LinkedServiceName' for 'ZohoObjectDataset': %+v", err) + } + s.LinkedServiceName = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/dataflows/README.md b/resource-manager/datafactory/2018-06-01/dataflows/README.md index 112c0b2a3d8..c753c2b0eb8 100644 --- a/resource-manager/datafactory/2018-06-01/dataflows/README.md +++ b/resource-manager/datafactory/2018-06-01/dataflows/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dataflows.NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataFlowName") +id := dataflows.NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataflowName") payload := dataflows.DataFlowResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dataflows.NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataFlowName") +id := dataflows.NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataflowName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dataflows.NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataFlowName") +id := dataflows.NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataflowName") read, err := client.Get(ctx, id, dataflows.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/datafactory/2018-06-01/dataflows/id_dataflow.go b/resource-manager/datafactory/2018-06-01/dataflows/id_dataflow.go index 50ddcb0edde..30becd8e04c 100644 --- a/resource-manager/datafactory/2018-06-01/dataflows/id_dataflow.go +++ b/resource-manager/datafactory/2018-06-01/dataflows/id_dataflow.go @@ -123,7 +123,7 @@ func (id DataflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticFactories", "factories", "factories"), resourceids.UserSpecifiedSegment("factoryName", "factoryName"), resourceids.StaticSegment("staticDataflows", "dataflows", "dataflows"), - resourceids.UserSpecifiedSegment("dataflowName", "dataFlowName"), + resourceids.UserSpecifiedSegment("dataflowName", "dataflowName"), } } diff --git a/resource-manager/datafactory/2018-06-01/dataflows/id_dataflow_test.go b/resource-manager/datafactory/2018-06-01/dataflows/id_dataflow_test.go index ff2cb330678..40e5f4a7402 100644 --- a/resource-manager/datafactory/2018-06-01/dataflows/id_dataflow_test.go +++ b/resource-manager/datafactory/2018-06-01/dataflows/id_dataflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataflowId{} func TestNewDataflowID(t *testing.T) { - id := NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataFlowName") + id := NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDataflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'FactoryName'", id.FactoryName, "factoryName") } - if id.DataflowName != "dataFlowName" { - t.Fatalf("Expected %q but got %q for Segment 'DataflowName'", id.DataflowName, "dataFlowName") + if id.DataflowName != "dataflowName" { + t.Fatalf("Expected %q but got %q for Segment 'DataflowName'", id.DataflowName, "dataflowName") } } func TestFormatDataflowID(t *testing.T) { - actual := NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataFlowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataFlowName" + actual := NewDataflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "factoryName", "dataflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDataflowID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataFlowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataflowName", Expected: &DataflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", FactoryName: "factoryName", - DataflowName: "dataFlowName", + DataflowName: "dataflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataFlowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataflowName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseDataflowIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataFlowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataflowName", Expected: &DataflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", FactoryName: "factoryName", - DataflowName: "dataFlowName", + DataflowName: "dataflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataFlowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataFactory/factories/factoryName/dataflows/dataflowName/extra", Error: true, }, { diff --git a/resource-manager/datafactory/2018-06-01/datasets/model_httpdatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/datasets/model_httpdatasettypeproperties.go index f5ad9c8d3e9..4c498ca5b5a 100644 --- a/resource-manager/datafactory/2018-06-01/datasets/model_httpdatasettypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/datasets/model_httpdatasettypeproperties.go @@ -12,7 +12,7 @@ type HTTPDatasetTypeProperties struct { AdditionalHeaders *string `json:"additionalHeaders,omitempty"` Compression *DatasetCompression `json:"compression,omitempty"` Format DatasetStorageFormat `json:"format"` - RelativeUrl *string `json:"relativeUrl,omitempty"` + RelativeURL *string `json:"relativeUrl,omitempty"` RequestBody *string `json:"requestBody,omitempty"` RequestMethod *string `json:"requestMethod,omitempty"` } @@ -23,7 +23,7 @@ func (s *HTTPDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { var decoded struct { AdditionalHeaders *string `json:"additionalHeaders,omitempty"` Compression *DatasetCompression `json:"compression,omitempty"` - RelativeUrl *string `json:"relativeUrl,omitempty"` + RelativeURL *string `json:"relativeUrl,omitempty"` RequestBody *string `json:"requestBody,omitempty"` RequestMethod *string `json:"requestMethod,omitempty"` } @@ -33,7 +33,7 @@ func (s *HTTPDatasetTypeProperties) UnmarshalJSON(bytes []byte) error { s.AdditionalHeaders = decoded.AdditionalHeaders s.Compression = decoded.Compression - s.RelativeUrl = decoded.RelativeUrl + s.RelativeURL = decoded.RelativeURL s.RequestBody = decoded.RequestBody s.RequestMethod = decoded.RequestMethod diff --git a/resource-manager/datafactory/2018-06-01/datasets/model_httpserverlocation.go b/resource-manager/datafactory/2018-06-01/datasets/model_httpserverlocation.go index c94d72aa3be..f5d387d5a31 100644 --- a/resource-manager/datafactory/2018-06-01/datasets/model_httpserverlocation.go +++ b/resource-manager/datafactory/2018-06-01/datasets/model_httpserverlocation.go @@ -11,7 +11,7 @@ import ( var _ DatasetLocation = HTTPServerLocation{} type HTTPServerLocation struct { - RelativeUrl *string `json:"relativeUrl,omitempty"` + RelativeURL *string `json:"relativeUrl,omitempty"` // Fields inherited from DatasetLocation diff --git a/resource-manager/datafactory/2018-06-01/datasets/model_restresourcedatasettypeproperties.go b/resource-manager/datafactory/2018-06-01/datasets/model_restresourcedatasettypeproperties.go index df53dd0fe8d..292ce7a1142 100644 --- a/resource-manager/datafactory/2018-06-01/datasets/model_restresourcedatasettypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/datasets/model_restresourcedatasettypeproperties.go @@ -6,7 +6,7 @@ package datasets type RestResourceDatasetTypeProperties struct { AdditionalHeaders *map[string]string `json:"additionalHeaders,omitempty"` PaginationRules *map[string]string `json:"paginationRules,omitempty"` - RelativeUrl *string `json:"relativeUrl,omitempty"` + RelativeURL *string `json:"relativeUrl,omitempty"` RequestBody *string `json:"requestBody,omitempty"` RequestMethod *string `json:"requestMethod,omitempty"` } diff --git a/resource-manager/datafactory/2018-06-01/factories/model_accesspolicyresponse.go b/resource-manager/datafactory/2018-06-01/factories/model_accesspolicyresponse.go index 008f04e853b..dad0e71df1e 100644 --- a/resource-manager/datafactory/2018-06-01/factories/model_accesspolicyresponse.go +++ b/resource-manager/datafactory/2018-06-01/factories/model_accesspolicyresponse.go @@ -5,6 +5,6 @@ package factories type AccessPolicyResponse struct { AccessToken *string `json:"accessToken,omitempty"` - DataPlaneUrl *string `json:"dataPlaneUrl,omitempty"` + DataPlaneURL *string `json:"dataPlaneUrl,omitempty"` Policy *UserAccessPolicy `json:"policy,omitempty"` } diff --git a/resource-manager/datafactory/2018-06-01/factories/model_encryptionconfiguration.go b/resource-manager/datafactory/2018-06-01/factories/model_encryptionconfiguration.go index f041e6f984b..ed00ccffc95 100644 --- a/resource-manager/datafactory/2018-06-01/factories/model_encryptionconfiguration.go +++ b/resource-manager/datafactory/2018-06-01/factories/model_encryptionconfiguration.go @@ -7,5 +7,5 @@ type EncryptionConfiguration struct { Identity *CMKIdentityDefinition `json:"identity,omitempty"` KeyName string `json:"keyName"` KeyVersion *string `json:"keyVersion,omitempty"` - VaultBaseUrl string `json:"vaultBaseUrl"` + VaultBaseURL string `json:"vaultBaseUrl"` } diff --git a/resource-manager/datafactory/2018-06-01/factories/model_githubaccesstokenrequest.go b/resource-manager/datafactory/2018-06-01/factories/model_githubaccesstokenrequest.go index 4113cb90565..1d04df1a1aa 100644 --- a/resource-manager/datafactory/2018-06-01/factories/model_githubaccesstokenrequest.go +++ b/resource-manager/datafactory/2018-06-01/factories/model_githubaccesstokenrequest.go @@ -5,7 +5,7 @@ package factories type GitHubAccessTokenRequest struct { GitHubAccessCode string `json:"gitHubAccessCode"` - GitHubAccessTokenBaseUrl string `json:"gitHubAccessTokenBaseUrl"` + GitHubAccessTokenBaseURL string `json:"gitHubAccessTokenBaseUrl"` GitHubClientId *string `json:"gitHubClientId,omitempty"` GitHubClientSecret *GitHubClientSecret `json:"gitHubClientSecret,omitempty"` } diff --git a/resource-manager/datafactory/2018-06-01/factories/model_githubclientsecret.go b/resource-manager/datafactory/2018-06-01/factories/model_githubclientsecret.go index 42684c2ff04..a7417245371 100644 --- a/resource-manager/datafactory/2018-06-01/factories/model_githubclientsecret.go +++ b/resource-manager/datafactory/2018-06-01/factories/model_githubclientsecret.go @@ -4,6 +4,6 @@ package factories // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type GitHubClientSecret struct { - ByoaSecretAkvUrl *string `json:"byoaSecretAkvUrl,omitempty"` + ByoaSecretAkvURL *string `json:"byoaSecretAkvUrl,omitempty"` ByoaSecretName *string `json:"byoaSecretName,omitempty"` } diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/method_get.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/method_get.go index ac63a1a1d97..2ce59b2356f 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/method_get.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/method_get.go @@ -2,6 +2,7 @@ package integrationruntimeobjectmetadata import ( "context" + "encoding/json" "fmt" "net/http" @@ -63,13 +64,24 @@ func (c IntegrationRuntimeObjectMetadataClient) Get(ctx context.Context, id Inte } var values struct { - Values *[]SsisObjectMetadata `json:"value"` + Values *[]json.RawMessage `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return } - result.Model = values.Values + temp := make([]SsisObjectMetadata, 0) + if values.Values != nil { + for i, v := range *values.Values { + val, err := UnmarshalSsisObjectMetadataImplementation(v) + if err != nil { + err = fmt.Errorf("unmarshalling item %d for SsisObjectMetadata (%q): %+v", i, v, err) + return result, err + } + temp = append(temp, val) + } + } + result.Model = &temp return } diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisenvironment.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisenvironment.go similarity index 97% rename from resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisenvironment.go rename to resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisenvironment.go index 0a2a2c0a1b4..b15faf5b1b8 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisenvironment.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisenvironment.go @@ -1,4 +1,4 @@ -package integrationruntimes +package integrationruntimeobjectmetadata import ( "encoding/json" diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisenvironmentreference.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisenvironmentreference.go similarity index 91% rename from resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisenvironmentreference.go rename to resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisenvironmentreference.go index 76d0c323dc0..993f726d051 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisenvironmentreference.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisenvironmentreference.go @@ -1,4 +1,4 @@ -package integrationruntimes +package integrationruntimeobjectmetadata // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisfolder.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisfolder.go similarity index 97% rename from resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisfolder.go rename to resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisfolder.go index a35f954e4e1..26e6faab395 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisfolder.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisfolder.go @@ -1,4 +1,4 @@ -package integrationruntimes +package integrationruntimeobjectmetadata import ( "encoding/json" diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisobjectmetadata.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisobjectmetadata.go index 0be017958ba..c4125d6b1b7 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisobjectmetadata.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisobjectmetadata.go @@ -1,11 +1,102 @@ package integrationruntimeobjectmetadata +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type SsisObjectMetadata struct { +type SsisObjectMetadata interface { + SsisObjectMetadata() BaseSsisObjectMetadataImpl +} + +var _ SsisObjectMetadata = BaseSsisObjectMetadataImpl{} + +type BaseSsisObjectMetadataImpl struct { Description *string `json:"description,omitempty"` Id *int64 `json:"id,omitempty"` Name *string `json:"name,omitempty"` Type SsisObjectMetadataType `json:"type"` } + +func (s BaseSsisObjectMetadataImpl) SsisObjectMetadata() BaseSsisObjectMetadataImpl { + return s +} + +var _ SsisObjectMetadata = RawSsisObjectMetadataImpl{} + +// RawSsisObjectMetadataImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawSsisObjectMetadataImpl struct { + ssisObjectMetadata BaseSsisObjectMetadataImpl + Type string + Values map[string]interface{} +} + +func (s RawSsisObjectMetadataImpl) SsisObjectMetadata() BaseSsisObjectMetadataImpl { + return s.ssisObjectMetadata +} + +func UnmarshalSsisObjectMetadataImplementation(input []byte) (SsisObjectMetadata, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling SsisObjectMetadata into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Environment") { + var out SsisEnvironment + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SsisEnvironment: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Folder") { + var out SsisFolder + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SsisFolder: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Package") { + var out SsisPackage + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SsisPackage: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Project") { + var out SsisProject + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SsisProject: %+v", err) + } + return out, nil + } + + var parent BaseSsisObjectMetadataImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseSsisObjectMetadataImpl: %+v", err) + } + + return RawSsisObjectMetadataImpl{ + ssisObjectMetadata: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssispackage.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssispackage.go similarity index 97% rename from resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssispackage.go rename to resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssispackage.go index 0cf8807bcbe..8a9bd4a3f5e 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssispackage.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssispackage.go @@ -1,4 +1,4 @@ -package integrationruntimes +package integrationruntimeobjectmetadata import ( "encoding/json" diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisparameter.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisparameter.go similarity index 95% rename from resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisparameter.go rename to resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisparameter.go index 9b0b75a488b..259eabb3ae7 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisparameter.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisparameter.go @@ -1,4 +1,4 @@ -package integrationruntimes +package integrationruntimeobjectmetadata // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisproject.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisproject.go similarity index 97% rename from resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisproject.go rename to resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisproject.go index 5d8f86bde78..af85901e256 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisproject.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisproject.go @@ -1,4 +1,4 @@ -package integrationruntimes +package integrationruntimeobjectmetadata import ( "encoding/json" diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisvariable.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisvariable.go similarity index 93% rename from resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisvariable.go rename to resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisvariable.go index 1c073bd2c21..8a21113afe6 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisvariable.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/model_ssisvariable.go @@ -1,4 +1,4 @@ -package integrationruntimes +package integrationruntimeobjectmetadata // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/predicates.go b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/predicates.go index 460be444c09..1d978272f18 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/predicates.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimeobjectmetadata/predicates.go @@ -4,24 +4,9 @@ package integrationruntimeobjectmetadata // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type SsisObjectMetadataOperationPredicate struct { - Description *string - Id *int64 - Name *string } func (p SsisObjectMetadataOperationPredicate) Matches(input SsisObjectMetadata) bool { - if p.Description != nil && (input.Description == nil || *p.Description != *input.Description) { - return false - } - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - return true } diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/constants.go b/resource-manager/datafactory/2018-06-01/integrationruntimes/constants.go index 61c2d1d11f7..4d3935807b2 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/constants.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimes/constants.go @@ -678,30 +678,24 @@ func parseSelfHostedIntegrationRuntimeNodeStatus(input string) (*SelfHostedInteg return &out, nil } -type SsisObjectMetadataType string +type Type string const ( - SsisObjectMetadataTypeEnvironment SsisObjectMetadataType = "Environment" - SsisObjectMetadataTypeFolder SsisObjectMetadataType = "Folder" - SsisObjectMetadataTypePackage SsisObjectMetadataType = "Package" - SsisObjectMetadataTypeProject SsisObjectMetadataType = "Project" + TypeLinkedServiceReference Type = "LinkedServiceReference" ) -func PossibleValuesForSsisObjectMetadataType() []string { +func PossibleValuesForType() []string { return []string{ - string(SsisObjectMetadataTypeEnvironment), - string(SsisObjectMetadataTypeFolder), - string(SsisObjectMetadataTypePackage), - string(SsisObjectMetadataTypeProject), + string(TypeLinkedServiceReference), } } -func (s *SsisObjectMetadataType) UnmarshalJSON(bytes []byte) error { +func (s *Type) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseSsisObjectMetadataType(decoded) + out, err := parseType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -709,18 +703,15 @@ func (s *SsisObjectMetadataType) UnmarshalJSON(bytes []byte) error { return nil } -func parseSsisObjectMetadataType(input string) (*SsisObjectMetadataType, error) { - vals := map[string]SsisObjectMetadataType{ - "environment": SsisObjectMetadataTypeEnvironment, - "folder": SsisObjectMetadataTypeFolder, - "package": SsisObjectMetadataTypePackage, - "project": SsisObjectMetadataTypeProject, +func parseType(input string) (*Type, error) { + vals := map[string]Type{ + "linkedservicereference": TypeLinkedServiceReference, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := SsisObjectMetadataType(input) + out := Type(input) return &out, nil } diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_azurekeyvaultsecretreference.go b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_azurekeyvaultsecretreference.go new file mode 100644 index 00000000000..c238221b634 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_azurekeyvaultsecretreference.go @@ -0,0 +1,52 @@ +package integrationruntimes + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ SecretBase = AzureKeyVaultSecretReference{} + +type AzureKeyVaultSecretReference struct { + SecretName string `json:"secretName"` + SecretVersion *string `json:"secretVersion,omitempty"` + Store LinkedServiceReference `json:"store"` + + // Fields inherited from SecretBase + + Type string `json:"type"` +} + +func (s AzureKeyVaultSecretReference) SecretBase() BaseSecretBaseImpl { + return BaseSecretBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = AzureKeyVaultSecretReference{} + +func (s AzureKeyVaultSecretReference) MarshalJSON() ([]byte, error) { + type wrapper AzureKeyVaultSecretReference + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureKeyVaultSecretReference: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureKeyVaultSecretReference: %+v", err) + } + + decoded["type"] = "AzureKeyVaultSecret" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureKeyVaultSecretReference: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_linkedservicereference.go b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_linkedservicereference.go new file mode 100644 index 00000000000..0883e2c62a7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_linkedservicereference.go @@ -0,0 +1,10 @@ +package integrationruntimes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinkedServiceReference struct { + Parameters *map[string]interface{} `json:"parameters,omitempty"` + ReferenceName string `json:"referenceName"` + Type Type `json:"type"` +} diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_secretbase.go b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_secretbase.go index 8896a64e13d..0add962d4d3 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_secretbase.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_secretbase.go @@ -53,6 +53,14 @@ func UnmarshalSecretBaseImplementation(input []byte) (SecretBase, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "AzureKeyVaultSecret") { + var out AzureKeyVaultSecretReference + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureKeyVaultSecretReference: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecureString") { var out SecureString if err := json.Unmarshal(input, &out); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_selfhostedintegrationruntimestatustypeproperties.go b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_selfhostedintegrationruntimestatustypeproperties.go index 9f283319226..42ac2eac8ef 100644 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_selfhostedintegrationruntimestatustypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_selfhostedintegrationruntimestatustypeproperties.go @@ -22,7 +22,7 @@ type SelfHostedIntegrationRuntimeStatusTypeProperties struct { PushedVersion *string `json:"pushedVersion,omitempty"` ScheduledUpdateDate *string `json:"scheduledUpdateDate,omitempty"` SelfContainedInteractiveAuthoringEnabled *bool `json:"selfContainedInteractiveAuthoringEnabled,omitempty"` - ServiceUrls *[]string `json:"serviceUrls,omitempty"` + ServiceURLs *[]string `json:"serviceUrls,omitempty"` TaskQueueId *string `json:"taskQueueId,omitempty"` UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"` Version *string `json:"version,omitempty"` diff --git a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisobjectmetadata.go b/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisobjectmetadata.go deleted file mode 100644 index ce527eef27d..00000000000 --- a/resource-manager/datafactory/2018-06-01/integrationruntimes/model_ssisobjectmetadata.go +++ /dev/null @@ -1,102 +0,0 @@ -package integrationruntimes - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SsisObjectMetadata interface { - SsisObjectMetadata() BaseSsisObjectMetadataImpl -} - -var _ SsisObjectMetadata = BaseSsisObjectMetadataImpl{} - -type BaseSsisObjectMetadataImpl struct { - Description *string `json:"description,omitempty"` - Id *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type SsisObjectMetadataType `json:"type"` -} - -func (s BaseSsisObjectMetadataImpl) SsisObjectMetadata() BaseSsisObjectMetadataImpl { - return s -} - -var _ SsisObjectMetadata = RawSsisObjectMetadataImpl{} - -// RawSsisObjectMetadataImpl is returned when the Discriminated Value doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawSsisObjectMetadataImpl struct { - ssisObjectMetadata BaseSsisObjectMetadataImpl - Type string - Values map[string]interface{} -} - -func (s RawSsisObjectMetadataImpl) SsisObjectMetadata() BaseSsisObjectMetadataImpl { - return s.ssisObjectMetadata -} - -func UnmarshalSsisObjectMetadataImplementation(input []byte) (SsisObjectMetadata, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling SsisObjectMetadata into map[string]interface: %+v", err) - } - - var value string - if v, ok := temp["type"]; ok { - value = fmt.Sprintf("%v", v) - } - - if strings.EqualFold(value, "Environment") { - var out SsisEnvironment - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SsisEnvironment: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Folder") { - var out SsisFolder - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SsisFolder: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Package") { - var out SsisPackage - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SsisPackage: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Project") { - var out SsisProject - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SsisProject: %+v", err) - } - return out, nil - } - - var parent BaseSsisObjectMetadataImpl - if err := json.Unmarshal(input, &parent); err != nil { - return nil, fmt.Errorf("unmarshaling into BaseSsisObjectMetadataImpl: %+v", err) - } - - return RawSsisObjectMetadataImpl{ - ssisObjectMetadata: parent, - Type: value, - Values: temp, - }, nil - -} diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_amazons3compatiblelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_amazons3compatiblelinkedservicetypeproperties.go index 3a5db5c1f6e..380748dd99e 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_amazons3compatiblelinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_amazons3compatiblelinkedservicetypeproperties.go @@ -13,7 +13,7 @@ type AmazonS3CompatibleLinkedServiceTypeProperties struct { EncryptedCredential *string `json:"encryptedCredential,omitempty"` ForcePathStyle *bool `json:"forcePathStyle,omitempty"` SecretAccessKey SecretBase `json:"secretAccessKey"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } var _ json.Unmarshaler = &AmazonS3CompatibleLinkedServiceTypeProperties{} @@ -23,7 +23,7 @@ func (s *AmazonS3CompatibleLinkedServiceTypeProperties) UnmarshalJSON(bytes []by AccessKeyId *string `json:"accessKeyId,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` ForcePathStyle *bool `json:"forcePathStyle,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -32,7 +32,7 @@ func (s *AmazonS3CompatibleLinkedServiceTypeProperties) UnmarshalJSON(bytes []by s.AccessKeyId = decoded.AccessKeyId s.EncryptedCredential = decoded.EncryptedCredential s.ForcePathStyle = decoded.ForcePathStyle - s.ServiceUrl = decoded.ServiceUrl + s.ServiceURL = decoded.ServiceURL var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_amazons3linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_amazons3linkedservicetypeproperties.go index 9aafb0a4840..ad61413f8f8 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_amazons3linkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_amazons3linkedservicetypeproperties.go @@ -13,7 +13,7 @@ type AmazonS3LinkedServiceTypeProperties struct { AuthenticationType *string `json:"authenticationType,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` SecretAccessKey SecretBase `json:"secretAccessKey"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` SessionToken SecretBase `json:"sessionToken"` } @@ -24,7 +24,7 @@ func (s *AmazonS3LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error AccessKeyId *string `json:"accessKeyId,omitempty"` AuthenticationType *string `json:"authenticationType,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -33,7 +33,7 @@ func (s *AmazonS3LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error s.AccessKeyId = decoded.AccessKeyId s.AuthenticationType = decoded.AuthenticationType s.EncryptedCredential = decoded.EncryptedCredential - s.ServiceUrl = decoded.ServiceUrl + s.ServiceURL = decoded.ServiceURL var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_azurefunctionlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_azurefunctionlinkedservicetypeproperties.go index 11f7805095d..f40f829e46c 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_azurefunctionlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_azurefunctionlinkedservicetypeproperties.go @@ -12,7 +12,7 @@ type AzureFunctionLinkedServiceTypeProperties struct { Authentication *string `json:"authentication,omitempty"` Credential *CredentialReference `json:"credential,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - FunctionAppUrl string `json:"functionAppUrl"` + FunctionAppURL string `json:"functionAppUrl"` FunctionKey SecretBase `json:"functionKey"` ResourceId *string `json:"resourceId,omitempty"` } @@ -24,7 +24,7 @@ func (s *AzureFunctionLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) e Authentication *string `json:"authentication,omitempty"` Credential *CredentialReference `json:"credential,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - FunctionAppUrl string `json:"functionAppUrl"` + FunctionAppURL string `json:"functionAppUrl"` ResourceId *string `json:"resourceId,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { @@ -34,7 +34,7 @@ func (s *AzureFunctionLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) e s.Authentication = decoded.Authentication s.Credential = decoded.Credential s.EncryptedCredential = decoded.EncryptedCredential - s.FunctionAppUrl = decoded.FunctionAppUrl + s.FunctionAppURL = decoded.FunctionAppURL s.ResourceId = decoded.ResourceId var temp map[string]json.RawMessage diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_azurekeyvaultlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_azurekeyvaultlinkedservicetypeproperties.go index 651a47bcd18..d5cffa1b617 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_azurekeyvaultlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_azurekeyvaultlinkedservicetypeproperties.go @@ -4,6 +4,6 @@ package linkedservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AzureKeyVaultLinkedServiceTypeProperties struct { - BaseUrl string `json:"baseUrl"` + BaseURL string `json:"baseUrl"` Credential *CredentialReference `json:"credential,omitempty"` } diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_googlecloudstoragelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_googlecloudstoragelinkedservicetypeproperties.go index 1faaca59c44..4388f551f38 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_googlecloudstoragelinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_googlecloudstoragelinkedservicetypeproperties.go @@ -12,7 +12,7 @@ type GoogleCloudStorageLinkedServiceTypeProperties struct { AccessKeyId *string `json:"accessKeyId,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` SecretAccessKey SecretBase `json:"secretAccessKey"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } var _ json.Unmarshaler = &GoogleCloudStorageLinkedServiceTypeProperties{} @@ -21,7 +21,7 @@ func (s *GoogleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(bytes []by var decoded struct { AccessKeyId *string `json:"accessKeyId,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -29,7 +29,7 @@ func (s *GoogleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(bytes []by s.AccessKeyId = decoded.AccessKeyId s.EncryptedCredential = decoded.EncryptedCredential - s.ServiceUrl = decoded.ServiceUrl + s.ServiceURL = decoded.ServiceURL var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_oraclecloudstoragelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_oraclecloudstoragelinkedservicetypeproperties.go index 71fd4189df8..71a22a02b08 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_oraclecloudstoragelinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_oraclecloudstoragelinkedservicetypeproperties.go @@ -12,7 +12,7 @@ type OracleCloudStorageLinkedServiceTypeProperties struct { AccessKeyId *string `json:"accessKeyId,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` SecretAccessKey SecretBase `json:"secretAccessKey"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } var _ json.Unmarshaler = &OracleCloudStorageLinkedServiceTypeProperties{} @@ -21,7 +21,7 @@ func (s *OracleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(bytes []by var decoded struct { AccessKeyId *string `json:"accessKeyId,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -29,7 +29,7 @@ func (s *OracleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(bytes []by s.AccessKeyId = decoded.AccessKeyId s.EncryptedCredential = decoded.EncryptedCredential - s.ServiceUrl = decoded.ServiceUrl + s.ServiceURL = decoded.ServiceURL var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforcelinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforcelinkedservicetypeproperties.go index d85ba7a5df4..5752142b7cc 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforcelinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforcelinkedservicetypeproperties.go @@ -11,7 +11,7 @@ import ( type SalesforceLinkedServiceTypeProperties struct { ApiVersion *string `json:"apiVersion,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - EnvironmentUrl *string `json:"environmentUrl,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` Password SecretBase `json:"password"` SecurityToken SecretBase `json:"securityToken"` Username *string `json:"username,omitempty"` @@ -23,7 +23,7 @@ func (s *SalesforceLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) erro var decoded struct { ApiVersion *string `json:"apiVersion,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - EnvironmentUrl *string `json:"environmentUrl,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` Username *string `json:"username,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { @@ -32,7 +32,7 @@ func (s *SalesforceLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) erro s.ApiVersion = decoded.ApiVersion s.EncryptedCredential = decoded.EncryptedCredential - s.EnvironmentUrl = decoded.EnvironmentUrl + s.EnvironmentURL = decoded.EnvironmentURL s.Username = decoded.Username var temp map[string]json.RawMessage diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforceservicecloudlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforceservicecloudlinkedservicetypeproperties.go index 266f7ca616d..9022eda37a1 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforceservicecloudlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforceservicecloudlinkedservicetypeproperties.go @@ -11,7 +11,7 @@ import ( type SalesforceServiceCloudLinkedServiceTypeProperties struct { ApiVersion *string `json:"apiVersion,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - EnvironmentUrl *string `json:"environmentUrl,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` ExtendedProperties *string `json:"extendedProperties,omitempty"` Password SecretBase `json:"password"` SecurityToken SecretBase `json:"securityToken"` @@ -24,7 +24,7 @@ func (s *SalesforceServiceCloudLinkedServiceTypeProperties) UnmarshalJSON(bytes var decoded struct { ApiVersion *string `json:"apiVersion,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - EnvironmentUrl *string `json:"environmentUrl,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` ExtendedProperties *string `json:"extendedProperties,omitempty"` Username *string `json:"username,omitempty"` } @@ -34,7 +34,7 @@ func (s *SalesforceServiceCloudLinkedServiceTypeProperties) UnmarshalJSON(bytes s.ApiVersion = decoded.ApiVersion s.EncryptedCredential = decoded.EncryptedCredential - s.EnvironmentUrl = decoded.EnvironmentUrl + s.EnvironmentURL = decoded.EnvironmentURL s.ExtendedProperties = decoded.ExtendedProperties s.Username = decoded.Username diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforceservicecloudv2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforceservicecloudv2linkedservicetypeproperties.go index 9001a80b969..b8321cc2a78 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforceservicecloudv2linkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforceservicecloudv2linkedservicetypeproperties.go @@ -14,7 +14,7 @@ type SalesforceServiceCloudV2LinkedServiceTypeProperties struct { ClientId *string `json:"clientId,omitempty"` ClientSecret SecretBase `json:"clientSecret"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - EnvironmentUrl *string `json:"environmentUrl,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` } var _ json.Unmarshaler = &SalesforceServiceCloudV2LinkedServiceTypeProperties{} @@ -25,7 +25,7 @@ func (s *SalesforceServiceCloudV2LinkedServiceTypeProperties) UnmarshalJSON(byte AuthenticationType *string `json:"authenticationType,omitempty"` ClientId *string `json:"clientId,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - EnvironmentUrl *string `json:"environmentUrl,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -35,7 +35,7 @@ func (s *SalesforceServiceCloudV2LinkedServiceTypeProperties) UnmarshalJSON(byte s.AuthenticationType = decoded.AuthenticationType s.ClientId = decoded.ClientId s.EncryptedCredential = decoded.EncryptedCredential - s.EnvironmentUrl = decoded.EnvironmentUrl + s.EnvironmentURL = decoded.EnvironmentURL var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforcev2linkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforcev2linkedservicetypeproperties.go index 83e1fb69688..b57d9b29f7e 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforcev2linkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_salesforcev2linkedservicetypeproperties.go @@ -14,7 +14,7 @@ type SalesforceV2LinkedServiceTypeProperties struct { ClientId *string `json:"clientId,omitempty"` ClientSecret SecretBase `json:"clientSecret"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - EnvironmentUrl *string `json:"environmentUrl,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` } var _ json.Unmarshaler = &SalesforceV2LinkedServiceTypeProperties{} @@ -25,7 +25,7 @@ func (s *SalesforceV2LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) er AuthenticationType *string `json:"authenticationType,omitempty"` ClientId *string `json:"clientId,omitempty"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` - EnvironmentUrl *string `json:"environmentUrl,omitempty"` + EnvironmentURL *string `json:"environmentUrl,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -35,7 +35,7 @@ func (s *SalesforceV2LinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) er s.AuthenticationType = decoded.AuthenticationType s.ClientId = decoded.ClientId s.EncryptedCredential = decoded.EncryptedCredential - s.EnvironmentUrl = decoded.EnvironmentUrl + s.EnvironmentURL = decoded.EnvironmentURL var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_secretbase.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_secretbase.go index 60d335cb488..1f879fbe2b9 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_secretbase.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_secretbase.go @@ -61,6 +61,14 @@ func UnmarshalSecretBaseImplementation(input []byte) (SecretBase, error) { return out, nil } + if strings.EqualFold(value, "SecureString") { + var out SecureString + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecureString: %+v", err) + } + return out, nil + } + var parent BaseSecretBaseImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseSecretBaseImpl: %+v", err) diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_securestring.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_securestring.go new file mode 100644 index 00000000000..4cfe02859a7 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_securestring.go @@ -0,0 +1,50 @@ +package linkedservices + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ SecretBase = SecureString{} + +type SecureString struct { + Value string `json:"value"` + + // Fields inherited from SecretBase + + Type string `json:"type"` +} + +func (s SecureString) SecretBase() BaseSecretBaseImpl { + return BaseSecretBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = SecureString{} + +func (s SecureString) MarshalJSON() ([]byte, error) { + type wrapper SecureString + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecureString: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecureString: %+v", err) + } + + decoded["type"] = "SecureString" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecureString: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_sharepointonlinelistlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_sharepointonlinelistlinkedservicetypeproperties.go index 685ec93da66..66a8d5093bf 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_sharepointonlinelistlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_sharepointonlinelistlinkedservicetypeproperties.go @@ -15,7 +15,7 @@ type SharePointOnlineListLinkedServiceTypeProperties struct { ServicePrincipalEmbeddedCertPassword SecretBase `json:"servicePrincipalEmbeddedCertPassword"` ServicePrincipalId string `json:"servicePrincipalId"` ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` - SiteUrl string `json:"siteUrl"` + SiteURL string `json:"siteUrl"` TenantId string `json:"tenantId"` } @@ -26,7 +26,7 @@ func (s *SharePointOnlineListLinkedServiceTypeProperties) UnmarshalJSON(bytes [] EncryptedCredential *string `json:"encryptedCredential,omitempty"` ServicePrincipalCredentialType *string `json:"servicePrincipalCredentialType,omitempty"` ServicePrincipalId string `json:"servicePrincipalId"` - SiteUrl string `json:"siteUrl"` + SiteURL string `json:"siteUrl"` TenantId string `json:"tenantId"` } if err := json.Unmarshal(bytes, &decoded); err != nil { @@ -36,7 +36,7 @@ func (s *SharePointOnlineListLinkedServiceTypeProperties) UnmarshalJSON(bytes [] s.EncryptedCredential = decoded.EncryptedCredential s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType s.ServicePrincipalId = decoded.ServicePrincipalId - s.SiteUrl = decoded.SiteUrl + s.SiteURL = decoded.SiteURL s.TenantId = decoded.TenantId var temp map[string]json.RawMessage diff --git a/resource-manager/datafactory/2018-06-01/pipelines/model_azurekeyvaultsecretreference.go b/resource-manager/datafactory/2018-06-01/pipelines/model_azurekeyvaultsecretreference.go new file mode 100644 index 00000000000..1f912610f5f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/pipelines/model_azurekeyvaultsecretreference.go @@ -0,0 +1,52 @@ +package pipelines + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ SecretBase = AzureKeyVaultSecretReference{} + +type AzureKeyVaultSecretReference struct { + SecretName string `json:"secretName"` + SecretVersion *string `json:"secretVersion,omitempty"` + Store LinkedServiceReference `json:"store"` + + // Fields inherited from SecretBase + + Type string `json:"type"` +} + +func (s AzureKeyVaultSecretReference) SecretBase() BaseSecretBaseImpl { + return BaseSecretBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = AzureKeyVaultSecretReference{} + +func (s AzureKeyVaultSecretReference) MarshalJSON() ([]byte, error) { + type wrapper AzureKeyVaultSecretReference + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureKeyVaultSecretReference: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureKeyVaultSecretReference: %+v", err) + } + + decoded["type"] = "AzureKeyVaultSecret" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureKeyVaultSecretReference: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/pipelines/model_copytranslator.go b/resource-manager/datafactory/2018-06-01/pipelines/model_copytranslator.go deleted file mode 100644 index 1c90163abea..00000000000 --- a/resource-manager/datafactory/2018-06-01/pipelines/model_copytranslator.go +++ /dev/null @@ -1,75 +0,0 @@ -package pipelines - -import ( - "encoding/json" - "fmt" - "strings" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CopyTranslator interface { - CopyTranslator() BaseCopyTranslatorImpl -} - -var _ CopyTranslator = BaseCopyTranslatorImpl{} - -type BaseCopyTranslatorImpl struct { - Type string `json:"type"` -} - -func (s BaseCopyTranslatorImpl) CopyTranslator() BaseCopyTranslatorImpl { - return s -} - -var _ CopyTranslator = RawCopyTranslatorImpl{} - -// RawCopyTranslatorImpl is returned when the Discriminated Value doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawCopyTranslatorImpl struct { - copyTranslator BaseCopyTranslatorImpl - Type string - Values map[string]interface{} -} - -func (s RawCopyTranslatorImpl) CopyTranslator() BaseCopyTranslatorImpl { - return s.copyTranslator -} - -func UnmarshalCopyTranslatorImplementation(input []byte) (CopyTranslator, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling CopyTranslator into map[string]interface: %+v", err) - } - - var value string - if v, ok := temp["type"]; ok { - value = fmt.Sprintf("%v", v) - } - - if strings.EqualFold(value, "TabularTranslator") { - var out TabularTranslator - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TabularTranslator: %+v", err) - } - return out, nil - } - - var parent BaseCopyTranslatorImpl - if err := json.Unmarshal(input, &parent); err != nil { - return nil, fmt.Errorf("unmarshaling into BaseCopyTranslatorImpl: %+v", err) - } - - return RawCopyTranslatorImpl{ - copyTranslator: parent, - Type: value, - Values: temp, - }, nil - -} diff --git a/resource-manager/datafactory/2018-06-01/pipelines/model_secretbase.go b/resource-manager/datafactory/2018-06-01/pipelines/model_secretbase.go index b904edd59e4..b05e45940be 100644 --- a/resource-manager/datafactory/2018-06-01/pipelines/model_secretbase.go +++ b/resource-manager/datafactory/2018-06-01/pipelines/model_secretbase.go @@ -53,6 +53,14 @@ func UnmarshalSecretBaseImplementation(input []byte) (SecretBase, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "AzureKeyVaultSecret") { + var out AzureKeyVaultSecretReference + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureKeyVaultSecretReference: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecureString") { var out SecureString if err := json.Unmarshal(input, &out); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/pipelines/model_tabulartranslator.go b/resource-manager/datafactory/2018-06-01/pipelines/model_tabulartranslator.go deleted file mode 100644 index 765a7484271..00000000000 --- a/resource-manager/datafactory/2018-06-01/pipelines/model_tabulartranslator.go +++ /dev/null @@ -1,56 +0,0 @@ -package pipelines - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ CopyTranslator = TabularTranslator{} - -type TabularTranslator struct { - CollectionReference *interface{} `json:"collectionReference,omitempty"` - ColumnMappings *string `json:"columnMappings,omitempty"` - MapComplexValuesToString *bool `json:"mapComplexValuesToString,omitempty"` - Mappings *interface{} `json:"mappings,omitempty"` - SchemaMapping *interface{} `json:"schemaMapping,omitempty"` - TypeConversion *bool `json:"typeConversion,omitempty"` - TypeConversionSettings *TypeConversionSettings `json:"typeConversionSettings,omitempty"` - - // Fields inherited from CopyTranslator - - Type string `json:"type"` -} - -func (s TabularTranslator) CopyTranslator() BaseCopyTranslatorImpl { - return BaseCopyTranslatorImpl{ - Type: s.Type, - } -} - -var _ json.Marshaler = TabularTranslator{} - -func (s TabularTranslator) MarshalJSON() ([]byte, error) { - type wrapper TabularTranslator - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TabularTranslator: %+v", err) - } - - var decoded map[string]interface{} - if err = json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TabularTranslator: %+v", err) - } - - decoded["type"] = "TabularTranslator" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TabularTranslator: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/datafactory/2018-06-01/pipelines/model_typeconversionsettings.go b/resource-manager/datafactory/2018-06-01/pipelines/model_typeconversionsettings.go deleted file mode 100644 index dbc3a7fcda1..00000000000 --- a/resource-manager/datafactory/2018-06-01/pipelines/model_typeconversionsettings.go +++ /dev/null @@ -1,13 +0,0 @@ -package pipelines - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TypeConversionSettings struct { - AllowDataTruncation *bool `json:"allowDataTruncation,omitempty"` - Culture *string `json:"culture,omitempty"` - DateTimeFormat *string `json:"dateTimeFormat,omitempty"` - DateTimeOffsetFormat *string `json:"dateTimeOffsetFormat,omitempty"` - TimeSpanFormat *string `json:"timeSpanFormat,omitempty"` - TreatBooleanAsNumber *bool `json:"treatBooleanAsNumber,omitempty"` -} diff --git a/resource-manager/datafactory/2018-06-01/trigger/constants.go b/resource-manager/datafactory/2018-06-01/trigger/constants.go index 1430104acbc..95e0d4f9eca 100644 --- a/resource-manager/datafactory/2018-06-01/trigger/constants.go +++ b/resource-manager/datafactory/2018-06-01/trigger/constants.go @@ -9,6 +9,82 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type PipelineReferenceType string + +const ( + PipelineReferenceTypePipelineReference PipelineReferenceType = "PipelineReference" +) + +func PossibleValuesForPipelineReferenceType() []string { + return []string{ + string(PipelineReferenceTypePipelineReference), + } +} + +func (s *PipelineReferenceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePipelineReferenceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePipelineReferenceType(input string) (*PipelineReferenceType, error) { + vals := map[string]PipelineReferenceType{ + "pipelinereference": PipelineReferenceTypePipelineReference, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PipelineReferenceType(input) + return &out, nil +} + +type TriggerReferenceType string + +const ( + TriggerReferenceTypeTriggerReference TriggerReferenceType = "TriggerReference" +) + +func PossibleValuesForTriggerReferenceType() []string { + return []string{ + string(TriggerReferenceTypeTriggerReference), + } +} + +func (s *TriggerReferenceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTriggerReferenceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTriggerReferenceType(input string) (*TriggerReferenceType, error) { + vals := map[string]TriggerReferenceType{ + "triggerreference": TriggerReferenceTypeTriggerReference, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TriggerReferenceType(input) + return &out, nil +} + type TriggerRuntimeState string const ( @@ -52,3 +128,47 @@ func parseTriggerRuntimeState(input string) (*TriggerRuntimeState, error) { out := TriggerRuntimeState(input) return &out, nil } + +type TumblingWindowFrequency string + +const ( + TumblingWindowFrequencyHour TumblingWindowFrequency = "Hour" + TumblingWindowFrequencyMinute TumblingWindowFrequency = "Minute" + TumblingWindowFrequencyMonth TumblingWindowFrequency = "Month" +) + +func PossibleValuesForTumblingWindowFrequency() []string { + return []string{ + string(TumblingWindowFrequencyHour), + string(TumblingWindowFrequencyMinute), + string(TumblingWindowFrequencyMonth), + } +} + +func (s *TumblingWindowFrequency) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTumblingWindowFrequency(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTumblingWindowFrequency(input string) (*TumblingWindowFrequency, error) { + vals := map[string]TumblingWindowFrequency{ + "hour": TumblingWindowFrequencyHour, + "minute": TumblingWindowFrequencyMinute, + "month": TumblingWindowFrequencyMonth, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TumblingWindowFrequency(input) + return &out, nil +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_chainingtrigger.go b/resource-manager/datafactory/2018-06-01/trigger/model_chainingtrigger.go new file mode 100644 index 00000000000..8e8752c9d78 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_chainingtrigger.go @@ -0,0 +1,57 @@ +package trigger + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Trigger = ChainingTrigger{} + +type ChainingTrigger struct { + Pipeline TriggerPipelineReference `json:"pipeline"` + TypeProperties ChainingTriggerTypeProperties `json:"typeProperties"` + + // Fields inherited from Trigger + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + RuntimeState *TriggerRuntimeState `json:"runtimeState,omitempty"` + Type string `json:"type"` +} + +func (s ChainingTrigger) Trigger() BaseTriggerImpl { + return BaseTriggerImpl{ + Annotations: s.Annotations, + Description: s.Description, + RuntimeState: s.RuntimeState, + Type: s.Type, + } +} + +var _ json.Marshaler = ChainingTrigger{} + +func (s ChainingTrigger) MarshalJSON() ([]byte, error) { + type wrapper ChainingTrigger + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ChainingTrigger: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ChainingTrigger: %+v", err) + } + + decoded["type"] = "ChainingTrigger" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ChainingTrigger: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_chainingtriggertypeproperties.go b/resource-manager/datafactory/2018-06-01/trigger/model_chainingtriggertypeproperties.go new file mode 100644 index 00000000000..d77c62cdaf4 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_chainingtriggertypeproperties.go @@ -0,0 +1,9 @@ +package trigger + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ChainingTriggerTypeProperties struct { + DependsOn []PipelineReference `json:"dependsOn"` + RunDimension string `json:"runDimension"` +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_dependencyreference.go b/resource-manager/datafactory/2018-06-01/trigger/model_dependencyreference.go new file mode 100644 index 00000000000..e213584b73c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_dependencyreference.go @@ -0,0 +1,83 @@ +package trigger + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DependencyReference interface { + DependencyReference() BaseDependencyReferenceImpl +} + +var _ DependencyReference = BaseDependencyReferenceImpl{} + +type BaseDependencyReferenceImpl struct { + Type string `json:"type"` +} + +func (s BaseDependencyReferenceImpl) DependencyReference() BaseDependencyReferenceImpl { + return s +} + +var _ DependencyReference = RawDependencyReferenceImpl{} + +// RawDependencyReferenceImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawDependencyReferenceImpl struct { + dependencyReference BaseDependencyReferenceImpl + Type string + Values map[string]interface{} +} + +func (s RawDependencyReferenceImpl) DependencyReference() BaseDependencyReferenceImpl { + return s.dependencyReference +} + +func UnmarshalDependencyReferenceImplementation(input []byte) (DependencyReference, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling DependencyReference into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "SelfDependencyTumblingWindowTriggerReference") { + var out SelfDependencyTumblingWindowTriggerReference + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SelfDependencyTumblingWindowTriggerReference: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TriggerDependencyReference") { + var out TriggerDependencyReference + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into TriggerDependencyReference: %+v", err) + } + return out, nil + } + + var parent BaseDependencyReferenceImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseDependencyReferenceImpl: %+v", err) + } + + return RawDependencyReferenceImpl{ + dependencyReference: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_multiplepipelinetrigger.go b/resource-manager/datafactory/2018-06-01/trigger/model_multiplepipelinetrigger.go new file mode 100644 index 00000000000..87d2a7d2aeb --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_multiplepipelinetrigger.go @@ -0,0 +1,56 @@ +package trigger + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Trigger = MultiplePipelineTrigger{} + +type MultiplePipelineTrigger struct { + Pipelines *[]TriggerPipelineReference `json:"pipelines,omitempty"` + + // Fields inherited from Trigger + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + RuntimeState *TriggerRuntimeState `json:"runtimeState,omitempty"` + Type string `json:"type"` +} + +func (s MultiplePipelineTrigger) Trigger() BaseTriggerImpl { + return BaseTriggerImpl{ + Annotations: s.Annotations, + Description: s.Description, + RuntimeState: s.RuntimeState, + Type: s.Type, + } +} + +var _ json.Marshaler = MultiplePipelineTrigger{} + +func (s MultiplePipelineTrigger) MarshalJSON() ([]byte, error) { + type wrapper MultiplePipelineTrigger + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MultiplePipelineTrigger: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MultiplePipelineTrigger: %+v", err) + } + + decoded["type"] = "MultiplePipelineTrigger" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MultiplePipelineTrigger: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_pipelinereference.go b/resource-manager/datafactory/2018-06-01/trigger/model_pipelinereference.go new file mode 100644 index 00000000000..18e3d1bac7c --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_pipelinereference.go @@ -0,0 +1,10 @@ +package trigger + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PipelineReference struct { + Name *string `json:"name,omitempty"` + ReferenceName string `json:"referenceName"` + Type PipelineReferenceType `json:"type"` +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_reruntumblingwindowtrigger.go b/resource-manager/datafactory/2018-06-01/trigger/model_reruntumblingwindowtrigger.go new file mode 100644 index 00000000000..22ae7d13bc5 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_reruntumblingwindowtrigger.go @@ -0,0 +1,56 @@ +package trigger + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Trigger = RerunTumblingWindowTrigger{} + +type RerunTumblingWindowTrigger struct { + TypeProperties RerunTumblingWindowTriggerTypeProperties `json:"typeProperties"` + + // Fields inherited from Trigger + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + RuntimeState *TriggerRuntimeState `json:"runtimeState,omitempty"` + Type string `json:"type"` +} + +func (s RerunTumblingWindowTrigger) Trigger() BaseTriggerImpl { + return BaseTriggerImpl{ + Annotations: s.Annotations, + Description: s.Description, + RuntimeState: s.RuntimeState, + Type: s.Type, + } +} + +var _ json.Marshaler = RerunTumblingWindowTrigger{} + +func (s RerunTumblingWindowTrigger) MarshalJSON() ([]byte, error) { + type wrapper RerunTumblingWindowTrigger + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RerunTumblingWindowTrigger: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RerunTumblingWindowTrigger: %+v", err) + } + + decoded["type"] = "RerunTumblingWindowTrigger" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RerunTumblingWindowTrigger: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_reruntumblingwindowtriggertypeproperties.go b/resource-manager/datafactory/2018-06-01/trigger/model_reruntumblingwindowtriggertypeproperties.go new file mode 100644 index 00000000000..0be8fa4eb54 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_reruntumblingwindowtriggertypeproperties.go @@ -0,0 +1,35 @@ +package trigger + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RerunTumblingWindowTriggerTypeProperties struct { + ParentTrigger interface{} `json:"parentTrigger"` + RequestedEndTime string `json:"requestedEndTime"` + RequestedStartTime string `json:"requestedStartTime"` + RerunConcurrency int64 `json:"rerunConcurrency"` +} + +func (o *RerunTumblingWindowTriggerTypeProperties) GetRequestedEndTimeAsTime() (*time.Time, error) { + return dates.ParseAsFormat(&o.RequestedEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *RerunTumblingWindowTriggerTypeProperties) SetRequestedEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.RequestedEndTime = formatted +} + +func (o *RerunTumblingWindowTriggerTypeProperties) GetRequestedStartTimeAsTime() (*time.Time, error) { + return dates.ParseAsFormat(&o.RequestedStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *RerunTumblingWindowTriggerTypeProperties) SetRequestedStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.RequestedStartTime = formatted +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_retrypolicy.go b/resource-manager/datafactory/2018-06-01/trigger/model_retrypolicy.go new file mode 100644 index 00000000000..6dcf07a1fc6 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_retrypolicy.go @@ -0,0 +1,9 @@ +package trigger + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RetryPolicy struct { + Count *int64 `json:"count,omitempty"` + IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_selfdependencytumblingwindowtriggerreference.go b/resource-manager/datafactory/2018-06-01/trigger/model_selfdependencytumblingwindowtriggerreference.go new file mode 100644 index 00000000000..09a1a7944cb --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_selfdependencytumblingwindowtriggerreference.go @@ -0,0 +1,51 @@ +package trigger + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DependencyReference = SelfDependencyTumblingWindowTriggerReference{} + +type SelfDependencyTumblingWindowTriggerReference struct { + Offset string `json:"offset"` + Size *string `json:"size,omitempty"` + + // Fields inherited from DependencyReference + + Type string `json:"type"` +} + +func (s SelfDependencyTumblingWindowTriggerReference) DependencyReference() BaseDependencyReferenceImpl { + return BaseDependencyReferenceImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = SelfDependencyTumblingWindowTriggerReference{} + +func (s SelfDependencyTumblingWindowTriggerReference) MarshalJSON() ([]byte, error) { + type wrapper SelfDependencyTumblingWindowTriggerReference + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SelfDependencyTumblingWindowTriggerReference: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SelfDependencyTumblingWindowTriggerReference: %+v", err) + } + + decoded["type"] = "SelfDependencyTumblingWindowTriggerReference" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SelfDependencyTumblingWindowTriggerReference: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_trigger.go b/resource-manager/datafactory/2018-06-01/trigger/model_trigger.go index e8a6928f00e..fb5bacf7dab 100644 --- a/resource-manager/datafactory/2018-06-01/trigger/model_trigger.go +++ b/resource-manager/datafactory/2018-06-01/trigger/model_trigger.go @@ -1,11 +1,102 @@ package trigger +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type Trigger struct { +type Trigger interface { + Trigger() BaseTriggerImpl +} + +var _ Trigger = BaseTriggerImpl{} + +type BaseTriggerImpl struct { Annotations *[]interface{} `json:"annotations,omitempty"` Description *string `json:"description,omitempty"` RuntimeState *TriggerRuntimeState `json:"runtimeState,omitempty"` Type string `json:"type"` } + +func (s BaseTriggerImpl) Trigger() BaseTriggerImpl { + return s +} + +var _ Trigger = RawTriggerImpl{} + +// RawTriggerImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawTriggerImpl struct { + trigger BaseTriggerImpl + Type string + Values map[string]interface{} +} + +func (s RawTriggerImpl) Trigger() BaseTriggerImpl { + return s.trigger +} + +func UnmarshalTriggerImplementation(input []byte) (Trigger, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling Trigger into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ChainingTrigger") { + var out ChainingTrigger + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ChainingTrigger: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MultiplePipelineTrigger") { + var out MultiplePipelineTrigger + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MultiplePipelineTrigger: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RerunTumblingWindowTrigger") { + var out RerunTumblingWindowTrigger + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RerunTumblingWindowTrigger: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TumblingWindowTrigger") { + var out TumblingWindowTrigger + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into TumblingWindowTrigger: %+v", err) + } + return out, nil + } + + var parent BaseTriggerImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseTriggerImpl: %+v", err) + } + + return RawTriggerImpl{ + trigger: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_triggerdependencyreference.go b/resource-manager/datafactory/2018-06-01/trigger/model_triggerdependencyreference.go new file mode 100644 index 00000000000..14a8180077f --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_triggerdependencyreference.go @@ -0,0 +1,50 @@ +package trigger + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ DependencyReference = TriggerDependencyReference{} + +type TriggerDependencyReference struct { + ReferenceTrigger TriggerReference `json:"referenceTrigger"` + + // Fields inherited from DependencyReference + + Type string `json:"type"` +} + +func (s TriggerDependencyReference) DependencyReference() BaseDependencyReferenceImpl { + return BaseDependencyReferenceImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = TriggerDependencyReference{} + +func (s TriggerDependencyReference) MarshalJSON() ([]byte, error) { + type wrapper TriggerDependencyReference + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling TriggerDependencyReference: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling TriggerDependencyReference: %+v", err) + } + + decoded["type"] = "TriggerDependencyReference" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling TriggerDependencyReference: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_triggerpipelinereference.go b/resource-manager/datafactory/2018-06-01/trigger/model_triggerpipelinereference.go new file mode 100644 index 00000000000..0187a6a3011 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_triggerpipelinereference.go @@ -0,0 +1,9 @@ +package trigger + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TriggerPipelineReference struct { + Parameters *map[string]interface{} `json:"parameters,omitempty"` + PipelineReference *PipelineReference `json:"pipelineReference,omitempty"` +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_triggerreference.go b/resource-manager/datafactory/2018-06-01/trigger/model_triggerreference.go new file mode 100644 index 00000000000..59dbbb24369 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_triggerreference.go @@ -0,0 +1,9 @@ +package trigger + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TriggerReference struct { + ReferenceName string `json:"referenceName"` + Type TriggerReferenceType `json:"type"` +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_triggerresource.go b/resource-manager/datafactory/2018-06-01/trigger/model_triggerresource.go index 795b120859c..548cd029570 100644 --- a/resource-manager/datafactory/2018-06-01/trigger/model_triggerresource.go +++ b/resource-manager/datafactory/2018-06-01/trigger/model_triggerresource.go @@ -1,5 +1,10 @@ package trigger +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -10,3 +15,37 @@ type TriggerResource struct { Properties Trigger `json:"properties"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &TriggerResource{} + +func (s *TriggerResource) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TriggerResource into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalTriggerImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'TriggerResource': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_tumblingwindowtrigger.go b/resource-manager/datafactory/2018-06-01/trigger/model_tumblingwindowtrigger.go new file mode 100644 index 00000000000..c39a8755fe1 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_tumblingwindowtrigger.go @@ -0,0 +1,57 @@ +package trigger + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Trigger = TumblingWindowTrigger{} + +type TumblingWindowTrigger struct { + Pipeline TriggerPipelineReference `json:"pipeline"` + TypeProperties TumblingWindowTriggerTypeProperties `json:"typeProperties"` + + // Fields inherited from Trigger + + Annotations *[]interface{} `json:"annotations,omitempty"` + Description *string `json:"description,omitempty"` + RuntimeState *TriggerRuntimeState `json:"runtimeState,omitempty"` + Type string `json:"type"` +} + +func (s TumblingWindowTrigger) Trigger() BaseTriggerImpl { + return BaseTriggerImpl{ + Annotations: s.Annotations, + Description: s.Description, + RuntimeState: s.RuntimeState, + Type: s.Type, + } +} + +var _ json.Marshaler = TumblingWindowTrigger{} + +func (s TumblingWindowTrigger) MarshalJSON() ([]byte, error) { + type wrapper TumblingWindowTrigger + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling TumblingWindowTrigger: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling TumblingWindowTrigger: %+v", err) + } + + decoded["type"] = "TumblingWindowTrigger" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling TumblingWindowTrigger: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datafactory/2018-06-01/trigger/model_tumblingwindowtriggertypeproperties.go b/resource-manager/datafactory/2018-06-01/trigger/model_tumblingwindowtriggertypeproperties.go new file mode 100644 index 00000000000..73e1201e110 --- /dev/null +++ b/resource-manager/datafactory/2018-06-01/trigger/model_tumblingwindowtriggertypeproperties.go @@ -0,0 +1,93 @@ +package trigger + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TumblingWindowTriggerTypeProperties struct { + Delay *string `json:"delay,omitempty"` + DependsOn *[]DependencyReference `json:"dependsOn,omitempty"` + EndTime *string `json:"endTime,omitempty"` + Frequency TumblingWindowFrequency `json:"frequency"` + Interval int64 `json:"interval"` + MaxConcurrency int64 `json:"maxConcurrency"` + RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"` + StartTime string `json:"startTime"` +} + +func (o *TumblingWindowTriggerTypeProperties) GetEndTimeAsTime() (*time.Time, error) { + if o.EndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TumblingWindowTriggerTypeProperties) SetEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTime = &formatted +} + +func (o *TumblingWindowTriggerTypeProperties) GetStartTimeAsTime() (*time.Time, error) { + return dates.ParseAsFormat(&o.StartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *TumblingWindowTriggerTypeProperties) SetStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTime = formatted +} + +var _ json.Unmarshaler = &TumblingWindowTriggerTypeProperties{} + +func (s *TumblingWindowTriggerTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Delay *string `json:"delay,omitempty"` + EndTime *string `json:"endTime,omitempty"` + Frequency TumblingWindowFrequency `json:"frequency"` + Interval int64 `json:"interval"` + MaxConcurrency int64 `json:"maxConcurrency"` + RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"` + StartTime string `json:"startTime"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Delay = decoded.Delay + s.EndTime = decoded.EndTime + s.Frequency = decoded.Frequency + s.Interval = decoded.Interval + s.MaxConcurrency = decoded.MaxConcurrency + s.RetryPolicy = decoded.RetryPolicy + s.StartTime = decoded.StartTime + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling TumblingWindowTriggerTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["dependsOn"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling DependsOn into list []json.RawMessage: %+v", err) + } + + output := make([]DependencyReference, 0) + for i, val := range listTemp { + impl, err := UnmarshalDependencyReferenceImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'DependsOn' for 'TumblingWindowTriggerTypeProperties': %+v", i, err) + } + output = append(output, impl) + } + s.DependsOn = &output + } + + return nil +} diff --git a/resource-manager/datalakeanalytics/2016-11-01/accounts/README.md b/resource-manager/datalakeanalytics/2016-11-01/accounts/README.md index ee4ccd745fa..dea30dc271c 100644 --- a/resource-manager/datalakeanalytics/2016-11-01/accounts/README.md +++ b/resource-manager/datalakeanalytics/2016-11-01/accounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := accounts.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := accounts.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := accounts.CheckNameAvailabilityParameters{ // ... diff --git a/resource-manager/datalakeanalytics/2016-11-01/accounts/id_location.go b/resource-manager/datalakeanalytics/2016-11-01/accounts/id_location.go index e382bd3cd0f..c42eb06d270 100644 --- a/resource-manager/datalakeanalytics/2016-11-01/accounts/id_location.go +++ b/resource-manager/datalakeanalytics/2016-11-01/accounts/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataLakeAnalytics", "Microsoft.DataLakeAnalytics", "Microsoft.DataLakeAnalytics"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datalakeanalytics/2016-11-01/accounts/id_location_test.go b/resource-manager/datalakeanalytics/2016-11-01/accounts/id_location_test.go index f983e3a3b95..dad2e44d78c 100644 --- a/resource-manager/datalakeanalytics/2016-11-01/accounts/id_location_test.go +++ b/resource-manager/datalakeanalytics/2016-11-01/accounts/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEaNaLyTiCs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEaNaLyTiCs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEaNaLyTiCs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEaNaLyTiCs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datalakeanalytics/2016-11-01/locations/README.md b/resource-manager/datalakeanalytics/2016-11-01/locations/README.md index 7fa7f971e31..42ad940d81d 100644 --- a/resource-manager/datalakeanalytics/2016-11-01/locations/README.md +++ b/resource-manager/datalakeanalytics/2016-11-01/locations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.GetCapability(ctx, id) if err != nil { diff --git a/resource-manager/datalakeanalytics/2016-11-01/locations/id_location.go b/resource-manager/datalakeanalytics/2016-11-01/locations/id_location.go index 919e28eaa2f..1b650893546 100644 --- a/resource-manager/datalakeanalytics/2016-11-01/locations/id_location.go +++ b/resource-manager/datalakeanalytics/2016-11-01/locations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataLakeAnalytics", "Microsoft.DataLakeAnalytics", "Microsoft.DataLakeAnalytics"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datalakeanalytics/2016-11-01/locations/id_location_test.go b/resource-manager/datalakeanalytics/2016-11-01/locations/id_location_test.go index de771b7b338..83e12aed1a9 100644 --- a/resource-manager/datalakeanalytics/2016-11-01/locations/id_location_test.go +++ b/resource-manager/datalakeanalytics/2016-11-01/locations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeAnalytics/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEaNaLyTiCs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEaNaLyTiCs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEaNaLyTiCs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEaNaLyTiCs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datalakestore/2016-11-01/accounts/README.md b/resource-manager/datalakestore/2016-11-01/accounts/README.md index 1c835e8f760..6508f52f7cd 100644 --- a/resource-manager/datalakestore/2016-11-01/accounts/README.md +++ b/resource-manager/datalakestore/2016-11-01/accounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := accounts.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := accounts.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := accounts.CheckNameAvailabilityParameters{ // ... diff --git a/resource-manager/datalakestore/2016-11-01/accounts/id_location.go b/resource-manager/datalakestore/2016-11-01/accounts/id_location.go index 48f6fb16c0d..22d7b66c143 100644 --- a/resource-manager/datalakestore/2016-11-01/accounts/id_location.go +++ b/resource-manager/datalakestore/2016-11-01/accounts/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataLakeStore", "Microsoft.DataLakeStore", "Microsoft.DataLakeStore"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datalakestore/2016-11-01/accounts/id_location_test.go b/resource-manager/datalakestore/2016-11-01/accounts/id_location_test.go index f1c3264a59c..6192ee98bf4 100644 --- a/resource-manager/datalakestore/2016-11-01/accounts/id_location_test.go +++ b/resource-manager/datalakestore/2016-11-01/accounts/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEsToRe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEsToRe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEsToRe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEsToRe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datalakestore/2016-11-01/locations/README.md b/resource-manager/datalakestore/2016-11-01/locations/README.md index 04fcaa7d160..55e3c104854 100644 --- a/resource-manager/datalakestore/2016-11-01/locations/README.md +++ b/resource-manager/datalakestore/2016-11-01/locations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.GetCapability(ctx, id) if err != nil { diff --git a/resource-manager/datalakestore/2016-11-01/locations/id_location.go b/resource-manager/datalakestore/2016-11-01/locations/id_location.go index 0c1380228e0..264e74226d2 100644 --- a/resource-manager/datalakestore/2016-11-01/locations/id_location.go +++ b/resource-manager/datalakestore/2016-11-01/locations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataLakeStore", "Microsoft.DataLakeStore", "Microsoft.DataLakeStore"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datalakestore/2016-11-01/locations/id_location_test.go b/resource-manager/datalakestore/2016-11-01/locations/id_location_test.go index 81a5537f16e..3b5a320602a 100644 --- a/resource-manager/datalakestore/2016-11-01/locations/id_location_test.go +++ b/resource-manager/datalakestore/2016-11-01/locations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataLakeStore/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEsToRe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEsToRe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEsToRe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAlAkEsToRe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/customoperation/README.md b/resource-manager/datamigration/2018-04-19/customoperation/README.md index 0a7e2b8195f..63a06f13996 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/README.md +++ b/resource-manager/datamigration/2018-04-19/customoperation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesCheckStatus(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := customoperation.NameAvailabilityRequest{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStartThenPoll(ctx, id); err != nil { // handle the error @@ -73,7 +73,7 @@ if err := client.ServicesStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStopThenPoll(ctx, id); err != nil { // handle the error @@ -85,7 +85,7 @@ if err := client.ServicesStopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := customoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksCancel(ctx, id) if err != nil { diff --git a/resource-manager/datamigration/2018-04-19/customoperation/constants.go b/resource-manager/datamigration/2018-04-19/customoperation/constants.go index 567d6dde3e2..259662eab5c 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/constants.go +++ b/resource-manager/datamigration/2018-04-19/customoperation/constants.go @@ -9,32 +9,755 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForMigrationStatus() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseMigrationStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +765,25 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := MigrationStatus(input) return &out, nil } @@ -100,6 +828,306 @@ func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) return &out, nil } +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + type TaskState string const ( @@ -158,3 +1186,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/id_service.go b/resource-manager/datamigration/2018-04-19/customoperation/id_service.go index 5789d7ff4b1..cb1fbd94832 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/id_service.go +++ b/resource-manager/datamigration/2018-04-19/customoperation/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/customoperation/id_service_test.go b/resource-manager/datamigration/2018-04-19/customoperation/id_service_test.go index e27752a03c9..e9db6b476c4 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/customoperation/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/customoperation/id_task.go b/resource-manager/datamigration/2018-04-19/customoperation/id_task.go index de0027cb77a..d95d276a9d8 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/id_task.go +++ b/resource-manager/datamigration/2018-04-19/customoperation/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/customoperation/id_task_test.go b/resource-manager/datamigration/2018-04-19/customoperation/id_task_test.go index 2e8a26fbf4a..fe497f84497 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/id_task_test.go +++ b/resource-manager/datamigration/2018-04-19/customoperation/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2018-04-19/customoperation/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..0324e830609 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_backupfileinfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_backupfileinfo.go new file mode 100644 index 00000000000..23ce82e40c7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_backupsetinfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_backupsetinfo.go new file mode 100644 index 00000000000..8c975bc61dd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_blobshare.go b/resource-manager/datamigration/2018-04-19/customoperation/model_blobshare.go new file mode 100644 index 00000000000..4139d522fb6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_blobshare.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_commandproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_commandproperties.go index c4448ca12ac..790ae4502a7 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/model_commandproperties.go +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_commandproperties.go @@ -1,10 +1,85 @@ package customoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connectioninfo.go new file mode 100644 index 00000000000..4e78c6f049d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connectioninfo.go @@ -0,0 +1,101 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..b09344d38a8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..bf76dd8acd7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..3897a15dfc6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..2beeb0da593 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..f850cb4c16e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..ac87ef0e5a1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..018d234b303 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,57 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..2dace278b19 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..2760eb441b2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..cf4e1c72443 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,57 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..2f0ff46b00b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..6b44f680c8a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..d590f457e2b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..933c5aec363 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..eff973fddc3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..974637512a8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..7c0a400d137 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..ec4f2e7f1fb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..13704f159a5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..a26dc322b9e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..8be5e98ab02 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..f2af71f1ba7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..60979bbc710 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..f19accb19e2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..62a477e7194 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..682bf34e1c2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..70fc3459cf6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..5bf58325a31 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_databasebackupinfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_databasebackupinfo.go new file mode 100644 index 00000000000..435f581a232 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_databasefileinfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_databasefileinfo.go new file mode 100644 index 00000000000..fad6a22a9d7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_databasesummaryresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_databasesummaryresult.go new file mode 100644 index 00000000000..ec9a05dd159 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_databasetable.go b/resource-manager/datamigration/2018-04-19/customoperation/model_databasetable.go new file mode 100644 index 00000000000..d197e51de64 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_databasetable.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..317cd596af1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..c0dc75ca00d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_executionstatistics.go b/resource-manager/datamigration/2018-04-19/customoperation/model_executionstatistics.go new file mode 100644 index 00000000000..cabaf9d20f9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_executionstatistics.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_fileshare.go b/resource-manager/datamigration/2018-04-19/customoperation/model_fileshare.go new file mode 100644 index 00000000000..8fa6d624f18 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_fileshare.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..44c83e7c60f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..61917899ec6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..e4396fa3648 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..2b090e555d4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..09cfdf8c6b9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..786371abc89 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..1e5bc8f8aea --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..6998d59bbc1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..3e7905b3d9b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_getusertablessqltaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..a2a1373b2c3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..6352a70332a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..348ecc8b6ca --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..b6a3bf7d67c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..974cde64937 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..041dcbfc0c2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..6fbc94db8e6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..27c9873f4a5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..29a61ac4e9a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..a0aa44006cd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..d5d96cb6a95 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..88508e206e9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..5d02a16bd0d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..cc7d9c70daf --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..dc72ece563d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..f982c44804a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..a1c23bbc4d4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..c6fe1dee317 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..aa08c3b266d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..11d98fa784a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..2c68b57a551 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..f5955035a35 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..5332c5e851d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..dbd8ef520a5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..747296c17eb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..ce85e3532d1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..3306a34e151 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..ad0ba47b50b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..9dc0ac3d49e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..0b20d3081e6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..d7491e85379 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..c3d3ae1a1dd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..b4194039baa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..e5c65363dd0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..0b15f82c375 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..c8889d13f41 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..32356908de4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,65 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReport *MigrationReportResult `json:"migrationReport,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..08d70aa58f3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..3aff147d09d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..ecfe07c0741 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..db7dda0c80b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..e5fd5322462 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..19403c0188b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..8c0768974ca --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..5cc1e974df2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..03dc9cc3890 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..4d9c947b189 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,15 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..11d51303caf --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..5e966b00d8c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..0e6a6178d4f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..d0f11755f31 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..a0a522c0b51 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..1ea6d8fe421 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..203118e91c1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..b559284aa32 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..f8ad7c32c57 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..77e6be76514 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..df4245588be --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migrationreportresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migrationreportresult.go new file mode 100644 index 00000000000..ae2df73d161 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..127c8bf6d99 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_migrationvalidationoptions.go b/resource-manager/datamigration/2018-04-19/customoperation/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..a94144318ea --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..756f47b192a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..bbb88c304ee --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_orphaneduserinfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_orphaneduserinfo.go new file mode 100644 index 00000000000..4a5b29638d4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..1827f640922 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_projecttask.go b/resource-manager/datamigration/2018-04-19/customoperation/model_projecttask.go index 72336ba92fc..e6b3b8d11ce 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/model_projecttask.go +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_projecttask.go @@ -1,12 +1,51 @@ package customoperation +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ProjectTask struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProjectTaskProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil } diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_projecttaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_projecttaskproperties.go index a469e21fd17..085f6c51b8c 100644 --- a/resource-manager/datamigration/2018-04-19/customoperation/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_projecttaskproperties.go @@ -1,11 +1,279 @@ package customoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.Sync") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..3a9975c5bc1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_queryexecutionresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_queryexecutionresult.go new file mode 100644 index 00000000000..bb4ef05ce25 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_reportableexception.go b/resource-manager/datamigration/2018-04-19/customoperation/model_reportableexception.go new file mode 100644 index 00000000000..14a405e6e6e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_reportableexception.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..9bdee9bd818 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2018-04-19/customoperation/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..d08acd5afd1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_selectedcertificateinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_selectedcertificateinput.go new file mode 100644 index 00000000000..d5742b271fd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/customoperation/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..601b3c4b747 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..e6837b57e1a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2018-04-19/customoperation/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..ba0af741bba --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2018-04-19/customoperation/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..ed07058797b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..9fdfa8ffaeb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..36150608c1a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..cb4956d26db --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..e6c621ebba3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..a9133981eee --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..ff519d32a58 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..4b6a378e9f2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..b927fd7cb07 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_validationerror.go b/resource-manager/datamigration/2018-04-19/customoperation/model_validationerror.go new file mode 100644 index 00000000000..d70b8c464f2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_validationerror.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/customoperation/model_waitstatistics.go b/resource-manager/datamigration/2018-04-19/customoperation/model_waitstatistics.go new file mode 100644 index 00000000000..3ccd65e945a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/customoperation/model_waitstatistics.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/delete/id_project.go b/resource-manager/datamigration/2018-04-19/delete/id_project.go index 8d2d7a52266..c843bcfe4cd 100644 --- a/resource-manager/datamigration/2018-04-19/delete/id_project.go +++ b/resource-manager/datamigration/2018-04-19/delete/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/delete/id_project_test.go b/resource-manager/datamigration/2018-04-19/delete/id_project_test.go index ffb63989bf8..2ee87f3faec 100644 --- a/resource-manager/datamigration/2018-04-19/delete/id_project_test.go +++ b/resource-manager/datamigration/2018-04-19/delete/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/delete/id_service.go b/resource-manager/datamigration/2018-04-19/delete/id_service.go index 27efb7d0c26..fe66bd222fd 100644 --- a/resource-manager/datamigration/2018-04-19/delete/id_service.go +++ b/resource-manager/datamigration/2018-04-19/delete/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/delete/id_service_test.go b/resource-manager/datamigration/2018-04-19/delete/id_service_test.go index 06cebaf7c16..88203a1e41b 100644 --- a/resource-manager/datamigration/2018-04-19/delete/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/delete/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/delete/id_task.go b/resource-manager/datamigration/2018-04-19/delete/id_task.go index 4e35246d37a..0a5e80021d7 100644 --- a/resource-manager/datamigration/2018-04-19/delete/id_task.go +++ b/resource-manager/datamigration/2018-04-19/delete/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/delete/id_task_test.go b/resource-manager/datamigration/2018-04-19/delete/id_task_test.go index abea991e722..356ed78b311 100644 --- a/resource-manager/datamigration/2018-04-19/delete/id_task_test.go +++ b/resource-manager/datamigration/2018-04-19/delete/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/get/README.md b/resource-manager/datamigration/2018-04-19/get/README.md index 4ab2256ac64..c94f61bb141 100644 --- a/resource-manager/datamigration/2018-04-19/get/README.md +++ b/resource-manager/datamigration/2018-04-19/get/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsGet(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ProjectsListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ProjectsListByResourceGroupComplete(ctx, id) @@ -75,7 +75,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") +id := get.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") // alternatively `client.ServicesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ServicesListByResourceGroupComplete(ctx, id) @@ -125,7 +125,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServicesListSkus(ctx, id)` can be used to do batched pagination items, err := client.ServicesListSkusComplete(ctx, id) @@ -142,7 +142,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := get.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksGet(ctx, id, get.DefaultTasksGetOperationOptions()) if err != nil { @@ -158,7 +158,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.TasksList(ctx, id, get.DefaultTasksListOperationOptions())` can be used to do batched pagination items, err := client.TasksListComplete(ctx, id, get.DefaultTasksListOperationOptions()) @@ -175,7 +175,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := get.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.UsagesList(ctx, id)` can be used to do batched pagination items, err := client.UsagesListComplete(ctx, id) diff --git a/resource-manager/datamigration/2018-04-19/get/constants.go b/resource-manager/datamigration/2018-04-19/get/constants.go index 43162d27067..b7bc72f0643 100644 --- a/resource-manager/datamigration/2018-04-19/get/constants.go +++ b/resource-manager/datamigration/2018-04-19/get/constants.go @@ -9,32 +9,755 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForMigrationStatus() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseMigrationStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +765,75 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := MigrationStatus(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) return &out, nil } @@ -305,6 +1083,53 @@ func parseResourceSkuRestrictionsType(input string) (*ResourceSkuRestrictionsTyp return &out, nil } +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + type ServiceProvisioningState string const ( @@ -414,6 +1239,209 @@ func parseServiceScalability(input string) (*ServiceScalability, error) { return &out, nil } +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + type TaskState string const ( @@ -472,3 +1500,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/id_location.go b/resource-manager/datamigration/2018-04-19/get/id_location.go index ddb540ba64b..ab70e2e0fa9 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_location.go +++ b/resource-manager/datamigration/2018-04-19/get/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datamigration/2018-04-19/get/id_location_test.go b/resource-manager/datamigration/2018-04-19/get/id_location_test.go index 10403bfa52b..b7f8e4c25dc 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_location_test.go +++ b/resource-manager/datamigration/2018-04-19/get/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/get/id_project.go b/resource-manager/datamigration/2018-04-19/get/id_project.go index 939e8067942..878ba8e4c36 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_project.go +++ b/resource-manager/datamigration/2018-04-19/get/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/get/id_project_test.go b/resource-manager/datamigration/2018-04-19/get/id_project_test.go index 0d8499595e7..4c8ac6f6a0b 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_project_test.go +++ b/resource-manager/datamigration/2018-04-19/get/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/get/id_resourcegroup.go b/resource-manager/datamigration/2018-04-19/get/id_resourcegroup.go index 238bff15a0c..0fcb21412aa 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_resourcegroup.go +++ b/resource-manager/datamigration/2018-04-19/get/id_resourcegroup.go @@ -105,7 +105,7 @@ func (id ResourceGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), } } diff --git a/resource-manager/datamigration/2018-04-19/get/id_resourcegroup_test.go b/resource-manager/datamigration/2018-04-19/get/id_resourcegroup_test.go index b489f393916..acb009febd3 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_resourcegroup_test.go +++ b/resource-manager/datamigration/2018-04-19/get/id_resourcegroup_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ResourceGroupId{} func TestNewResourceGroupID(t *testing.T) { - id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") + id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } } func TestFormatResourceGroupID(t *testing.T) { - actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName" + actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseResourceGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/get/id_service.go b/resource-manager/datamigration/2018-04-19/get/id_service.go index fb22ad8968f..8c6bf2fcad1 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_service.go +++ b/resource-manager/datamigration/2018-04-19/get/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/get/id_service_test.go b/resource-manager/datamigration/2018-04-19/get/id_service_test.go index befcb2ddd47..3efb76b7aec 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/get/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/get/id_task.go b/resource-manager/datamigration/2018-04-19/get/id_task.go index 09a236b2ad4..fee837d3d29 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_task.go +++ b/resource-manager/datamigration/2018-04-19/get/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/get/id_task_test.go b/resource-manager/datamigration/2018-04-19/get/id_task_test.go index 9952316e9ce..8e28ca4487a 100644 --- a/resource-manager/datamigration/2018-04-19/get/id_task_test.go +++ b/resource-manager/datamigration/2018-04-19/get/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/get/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2018-04-19/get/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..61b2bb36595 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_backupfileinfo.go b/resource-manager/datamigration/2018-04-19/get/model_backupfileinfo.go new file mode 100644 index 00000000000..3df26127c30 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_backupsetinfo.go b/resource-manager/datamigration/2018-04-19/get/model_backupsetinfo.go new file mode 100644 index 00000000000..bd399c22a81 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_blobshare.go b/resource-manager/datamigration/2018-04-19/get/model_blobshare.go new file mode 100644 index 00000000000..f0fbafad2d9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_blobshare.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_commandproperties.go b/resource-manager/datamigration/2018-04-19/get/model_commandproperties.go index 11a89f8ea71..628d6122d6c 100644 --- a/resource-manager/datamigration/2018-04-19/get/model_commandproperties.go +++ b/resource-manager/datamigration/2018-04-19/get/model_commandproperties.go @@ -1,10 +1,85 @@ package get +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/get/model_connectioninfo.go index fb79fd4b89e..7951d178510 100644 --- a/resource-manager/datamigration/2018-04-19/get/model_connectioninfo.go +++ b/resource-manager/datamigration/2018-04-19/get/model_connectioninfo.go @@ -1,10 +1,101 @@ package get +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..1fc0ca23f09 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..56d507f1aaa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..520539ca2df --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..841907f25c4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,117 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..09da6d7346c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..dd441654587 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..d9e5e867713 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,57 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..bf8bf0f5edd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..8473b27cbb2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..5432a1a3970 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,57 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..37d71b5222c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,117 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..8ca1a7bebc2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..a4cde62d720 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..5329db6643d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..2967272813a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..f3c9a5f9289 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..bc746403273 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..360376306f2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..d233f43ed77 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..908c4451935 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..d74b8fd9a6b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..9def55861c1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..a694f6ca2ee --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..9691cfa4e1e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..11208b2136d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..d62b2c54b62 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..8c67c1fb8c7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..8ddcbefd7b9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_databasebackupinfo.go b/resource-manager/datamigration/2018-04-19/get/model_databasebackupinfo.go new file mode 100644 index 00000000000..2523bdeadf6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_databasefileinfo.go b/resource-manager/datamigration/2018-04-19/get/model_databasefileinfo.go new file mode 100644 index 00000000000..dbb87c80ae8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_databasesummaryresult.go b/resource-manager/datamigration/2018-04-19/get/model_databasesummaryresult.go new file mode 100644 index 00000000000..2e3e1b08d11 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_databasetable.go b/resource-manager/datamigration/2018-04-19/get/model_databasetable.go new file mode 100644 index 00000000000..7646d8cf0cd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_databasetable.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2018-04-19/get/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..ab39c33b81b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2018-04-19/get/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..942e2720261 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_executionstatistics.go b/resource-manager/datamigration/2018-04-19/get/model_executionstatistics.go new file mode 100644 index 00000000000..7432b2ffe30 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_executionstatistics.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_fileshare.go b/resource-manager/datamigration/2018-04-19/get/model_fileshare.go new file mode 100644 index 00000000000..2a845f18148 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_fileshare.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..c08db1e2c4d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..8a67e4d5258 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..192e9c6a784 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..207067221f8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..31599103639 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..2ab62b0f668 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..a3c14438187 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..661031b0495 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..5769a87990a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_getusertablessqltaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..83668ff35a5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..5a60db3772f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..d2c157a41fa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..e1d2f4d1c97 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..1ad912aa20b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..d7049824105 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..6338ac77d50 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..43bb1bceadb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..fc71948bc7e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..774794784f5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..548b0d8b7e1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..4ad6c98be64 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..bc1763ce0e7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..9d0d7fb1b8c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..c49e959f211 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..7e96691c72b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..a9964a05842 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..5166882d528 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..9237ed9979e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..9e28b821c72 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..c4d5eb6a560 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..7397dc057d4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..ac140fbc3ee --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..c845d0c09a6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..d3490e250fe --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..1454848361e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..815ad9dd9a7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..7d5df5b6420 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..0c4ff83b2e1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..c5534d06abc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..34ece3be0b9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,117 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..2a8c7627ec3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..75c2d31f454 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..058d7711172 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..9c6a4b3cbf1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..fd85e5ab407 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..b2a0862ef3f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,65 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReport *MigrationReportResult `json:"migrationReport,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..450ab2e4aff --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..457a99f022e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..b720603b30d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,117 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..b4e119554f0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..95fc4b51ddb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ab5c10b7ab0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..7156baa25aa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..a8850074138 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..b848f193872 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,117 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..e99dde5734b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,15 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..a6f440e8573 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..413ab34d894 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..3a45232be4e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..3514f73618b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..43f054b87c7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..fe1ce3651b6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..5855b0fd1fc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,117 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..166810ce0e7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..4439f70e1ba --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..75a1d98e322 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2018-04-19/get/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..713478d9be8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migrationreportresult.go b/resource-manager/datamigration/2018-04-19/get/model_migrationreportresult.go new file mode 100644 index 00000000000..d32635884d6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2018-04-19/get/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..fff75667d6c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_migrationvalidationoptions.go b/resource-manager/datamigration/2018-04-19/get/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..cc5ee41ace8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/get/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..967feb30344 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/get/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..31a5020fa13 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_orphaneduserinfo.go b/resource-manager/datamigration/2018-04-19/get/model_orphaneduserinfo.go new file mode 100644 index 00000000000..20cac083d19 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/get/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..7151e413c19 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_projectproperties.go b/resource-manager/datamigration/2018-04-19/get/model_projectproperties.go index 531a0d0a0c9..b66fbbab0c9 100644 --- a/resource-manager/datamigration/2018-04-19/get/model_projectproperties.go +++ b/resource-manager/datamigration/2018-04-19/get/model_projectproperties.go @@ -1,6 +1,8 @@ package get import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_projecttask.go b/resource-manager/datamigration/2018-04-19/get/model_projecttask.go index d9457f27ddc..7683dfb499d 100644 --- a/resource-manager/datamigration/2018-04-19/get/model_projecttask.go +++ b/resource-manager/datamigration/2018-04-19/get/model_projecttask.go @@ -1,12 +1,51 @@ package get +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ProjectTask struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProjectTaskProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil } diff --git a/resource-manager/datamigration/2018-04-19/get/model_projecttaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_projecttaskproperties.go index 15df30c9def..e5fe98d9c0c 100644 --- a/resource-manager/datamigration/2018-04-19/get/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2018-04-19/get/model_projecttaskproperties.go @@ -1,11 +1,279 @@ package get +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.Sync") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2018-04-19/get/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..6d3e0732de2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_queryexecutionresult.go b/resource-manager/datamigration/2018-04-19/get/model_queryexecutionresult.go new file mode 100644 index 00000000000..7d508040231 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_reportableexception.go b/resource-manager/datamigration/2018-04-19/get/model_reportableexception.go new file mode 100644 index 00000000000..9897733972f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_reportableexception.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2018-04-19/get/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..450e14e555c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2018-04-19/get/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..a6eb932d29d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_selectedcertificateinput.go b/resource-manager/datamigration/2018-04-19/get/model_selectedcertificateinput.go new file mode 100644 index 00000000000..e4f03a1ac93 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/get/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..53509644d33 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..b863e4700e8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2018-04-19/get/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..5cc7df5b00d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2018-04-19/get/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..4dfc9866b8f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..7fbfe6edf0d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..681cb6c7b3e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..94a8004438a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..9a1f0533131 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..86db7f747d2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..4279c986f79 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/get/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..22a3f3b4b20 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/get/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..4b1dbf58c38 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_validationerror.go b/resource-manager/datamigration/2018-04-19/get/model_validationerror.go new file mode 100644 index 00000000000..c3eb5dec554 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_validationerror.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/get/model_waitstatistics.go b/resource-manager/datamigration/2018-04-19/get/model_waitstatistics.go new file mode 100644 index 00000000000..d4f100bf792 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/get/model_waitstatistics.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/README.md b/resource-manager/datamigration/2018-04-19/patch/README.md index cd6727745e8..d9d8178d3ab 100644 --- a/resource-manager/datamigration/2018-04-19/patch/README.md +++ b/resource-manager/datamigration/2018-04-19/patch/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := patch.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := patch.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := patch.Project{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patch.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := patch.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := patch.DataMigrationService{ // ... @@ -62,7 +62,7 @@ if err := client.ServicesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := patch.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := patch.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := patch.ProjectTask{ // ... diff --git a/resource-manager/datamigration/2018-04-19/patch/constants.go b/resource-manager/datamigration/2018-04-19/patch/constants.go index 8d1a49a0d4a..c01f74383e2 100644 --- a/resource-manager/datamigration/2018-04-19/patch/constants.go +++ b/resource-manager/datamigration/2018-04-19/patch/constants.go @@ -9,32 +9,755 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForMigrationStatus() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseMigrationStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +765,75 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := MigrationStatus(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) return &out, nil } @@ -182,6 +960,53 @@ func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { return &out, nil } +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + type ServiceProvisioningState string const ( @@ -247,6 +1072,209 @@ func parseServiceProvisioningState(input string) (*ServiceProvisioningState, err return &out, nil } +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + type TaskState string const ( @@ -305,3 +1333,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/id_project.go b/resource-manager/datamigration/2018-04-19/patch/id_project.go index 65ed4da575c..4455c74fa01 100644 --- a/resource-manager/datamigration/2018-04-19/patch/id_project.go +++ b/resource-manager/datamigration/2018-04-19/patch/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/patch/id_project_test.go b/resource-manager/datamigration/2018-04-19/patch/id_project_test.go index cfa4b5e5685..4241cec2b9a 100644 --- a/resource-manager/datamigration/2018-04-19/patch/id_project_test.go +++ b/resource-manager/datamigration/2018-04-19/patch/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/patch/id_service.go b/resource-manager/datamigration/2018-04-19/patch/id_service.go index 15b661e406c..66242c253dc 100644 --- a/resource-manager/datamigration/2018-04-19/patch/id_service.go +++ b/resource-manager/datamigration/2018-04-19/patch/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/patch/id_service_test.go b/resource-manager/datamigration/2018-04-19/patch/id_service_test.go index d67235874cc..3f6a5707ccc 100644 --- a/resource-manager/datamigration/2018-04-19/patch/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/patch/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/patch/id_task.go b/resource-manager/datamigration/2018-04-19/patch/id_task.go index 446002dc681..a81568fe08b 100644 --- a/resource-manager/datamigration/2018-04-19/patch/id_task.go +++ b/resource-manager/datamigration/2018-04-19/patch/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/patch/id_task_test.go b/resource-manager/datamigration/2018-04-19/patch/id_task_test.go index fb5f11690fe..61fd69b670e 100644 --- a/resource-manager/datamigration/2018-04-19/patch/id_task_test.go +++ b/resource-manager/datamigration/2018-04-19/patch/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/patch/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2018-04-19/patch/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..2d37eb08b9a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_backupfileinfo.go b/resource-manager/datamigration/2018-04-19/patch/model_backupfileinfo.go new file mode 100644 index 00000000000..f5bf749f505 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_backupsetinfo.go b/resource-manager/datamigration/2018-04-19/patch/model_backupsetinfo.go new file mode 100644 index 00000000000..6655253565c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_blobshare.go b/resource-manager/datamigration/2018-04-19/patch/model_blobshare.go new file mode 100644 index 00000000000..5bba1ad02fb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_blobshare.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_commandproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_commandproperties.go index 06dfc9a901e..f51ecf4c5ad 100644 --- a/resource-manager/datamigration/2018-04-19/patch/model_commandproperties.go +++ b/resource-manager/datamigration/2018-04-19/patch/model_commandproperties.go @@ -1,10 +1,85 @@ package patch +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/patch/model_connectioninfo.go index fd06d1f73ec..f9b9a3d5c95 100644 --- a/resource-manager/datamigration/2018-04-19/patch/model_connectioninfo.go +++ b/resource-manager/datamigration/2018-04-19/patch/model_connectioninfo.go @@ -1,10 +1,101 @@ package patch +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..9c7d12150db --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..df74ab62822 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..14be1ae7ee3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..ccd49405d31 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,117 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..253a92831d6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..61ba507d45b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..077ed69abc9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,57 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..a91c7d2caea --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..fca3fd1cf80 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..40c2f18dcd8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,57 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..b6cce7e81c6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,117 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..2d351bdf790 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..82e572b1c98 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..1c6cdc731ef --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..a5d29cc24fe --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..0ea128c57be --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..f557f5e9fad --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..42d361d27d3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..73a20b4b216 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..7e2ec919566 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..935c8eca669 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..47c76961a21 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..726d3801bfc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..c314bc6f9c1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..8c5b394ce73 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..d3b4d7a8644 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..42dea35933b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..24d519fe3cb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_databasebackupinfo.go b/resource-manager/datamigration/2018-04-19/patch/model_databasebackupinfo.go new file mode 100644 index 00000000000..5de0fd030c0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_databasefileinfo.go b/resource-manager/datamigration/2018-04-19/patch/model_databasefileinfo.go new file mode 100644 index 00000000000..bf0623074d1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_databasesummaryresult.go b/resource-manager/datamigration/2018-04-19/patch/model_databasesummaryresult.go new file mode 100644 index 00000000000..70a6dd64f17 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_databasetable.go b/resource-manager/datamigration/2018-04-19/patch/model_databasetable.go new file mode 100644 index 00000000000..d754b773cb9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_databasetable.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2018-04-19/patch/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..cbe32cb2111 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2018-04-19/patch/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..907ca3a11c4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_executionstatistics.go b/resource-manager/datamigration/2018-04-19/patch/model_executionstatistics.go new file mode 100644 index 00000000000..c2d847f8e6e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_executionstatistics.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_fileshare.go b/resource-manager/datamigration/2018-04-19/patch/model_fileshare.go new file mode 100644 index 00000000000..7e9b7c9c627 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_fileshare.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..175d6996297 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..07ec58d7944 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..7a5efbdf149 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..e34f5b9037f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..7ff5a4c44f7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..938ac6028ce --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..898da8c1e69 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..1442e0c82d1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..f058d39aa61 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_getusertablessqltaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..2f5c14fb0eb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..b22ecf4c445 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..b4f09e2cac7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..c959f5d340d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..bff82ecbbfc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..9887d95c209 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..792c4cc7598 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..d6348c2b92c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..dc3335c3234 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..61fe27420a0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..b861353abf4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..72a0e46192c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..ac5c7206ecf --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..db28acbf742 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..b6af658fc9a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..3c9245b9314 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..bc76b56a43b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..21009e0f9a6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..c13e7cb062d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..cd48ccdb449 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..a5cec21af43 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..1c0ae5daf52 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..dfbfd5901b5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..686c0275947 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..03aa093d35c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..45b52406085 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..51ec65b3d3b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..0f1c65ce85c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..0f3762616c1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..a24948e5254 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..1737bab7b13 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,117 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..d2c6e735a70 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..90c6c8fef12 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..0705e3579f0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..296dd13a722 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..401499dcfc9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..8d0dbb1f547 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,65 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReport *MigrationReportResult `json:"migrationReport,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..c2dcea08999 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..64382afe9c7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..ac19aadc099 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,117 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..25fb705eb96 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..82ba4deae56 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..1a37bf3f6d0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..97eaecb7700 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..b4c52381fc8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..217ee3764ec --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,117 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..d5616c4cce3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,15 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..94fd7c9e348 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..4e1bc59d299 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..c4b4f06006a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..24f2ae68578 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..98c5f573632 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..1f956c3a2b5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..a103b343d2c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,117 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..5f73e610da6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..829b416a987 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..89275772024 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2018-04-19/patch/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..1869914d266 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migrationreportresult.go b/resource-manager/datamigration/2018-04-19/patch/model_migrationreportresult.go new file mode 100644 index 00000000000..cc182833fe6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2018-04-19/patch/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..2b58c1a48b6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_migrationvalidationoptions.go b/resource-manager/datamigration/2018-04-19/patch/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..e48f3bac167 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/patch/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..56beb094859 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/patch/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..b09a66b4a20 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_orphaneduserinfo.go b/resource-manager/datamigration/2018-04-19/patch/model_orphaneduserinfo.go new file mode 100644 index 00000000000..1c2344dd8d0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/patch/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..fc16cd6475f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_projectproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_projectproperties.go index 6b049a4245e..7242883c882 100644 --- a/resource-manager/datamigration/2018-04-19/patch/model_projectproperties.go +++ b/resource-manager/datamigration/2018-04-19/patch/model_projectproperties.go @@ -1,6 +1,8 @@ package patch import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_projecttask.go b/resource-manager/datamigration/2018-04-19/patch/model_projecttask.go index 9936c5e1990..261b93b7f9a 100644 --- a/resource-manager/datamigration/2018-04-19/patch/model_projecttask.go +++ b/resource-manager/datamigration/2018-04-19/patch/model_projecttask.go @@ -1,12 +1,51 @@ package patch +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ProjectTask struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProjectTaskProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil } diff --git a/resource-manager/datamigration/2018-04-19/patch/model_projecttaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_projecttaskproperties.go index 185f868347c..ccf63ef385a 100644 --- a/resource-manager/datamigration/2018-04-19/patch/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2018-04-19/patch/model_projecttaskproperties.go @@ -1,11 +1,279 @@ package patch +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.Sync") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2018-04-19/patch/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..9493a80b133 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_queryexecutionresult.go b/resource-manager/datamigration/2018-04-19/patch/model_queryexecutionresult.go new file mode 100644 index 00000000000..b2c4e3744c0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_reportableexception.go b/resource-manager/datamigration/2018-04-19/patch/model_reportableexception.go new file mode 100644 index 00000000000..0e85c66fc31 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_reportableexception.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2018-04-19/patch/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..2914e9a856d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2018-04-19/patch/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..f3d0658d5f8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_selectedcertificateinput.go b/resource-manager/datamigration/2018-04-19/patch/model_selectedcertificateinput.go new file mode 100644 index 00000000000..8dc8044408c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/patch/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..91d65c5c041 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..dd525c7d368 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2018-04-19/patch/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..8650fb9d1f2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2018-04-19/patch/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..0a253f62538 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..fdf4dd56ae6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..89205aa0b4d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..d29cfdc83a8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..4e6ad01cb0f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..52c88c73506 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..6b3008a8acd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/patch/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..e6f56c812c2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/patch/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..430440d2afe --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_validationerror.go b/resource-manager/datamigration/2018-04-19/patch/model_validationerror.go new file mode 100644 index 00000000000..a60d21b10b6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_validationerror.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/patch/model_waitstatistics.go b/resource-manager/datamigration/2018-04-19/patch/model_waitstatistics.go new file mode 100644 index 00000000000..7e91f123f6d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/patch/model_waitstatistics.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/README.md b/resource-manager/datamigration/2018-04-19/post/README.md index d3f730692c7..c72ecc1cc01 100644 --- a/resource-manager/datamigration/2018-04-19/post/README.md +++ b/resource-manager/datamigration/2018-04-19/post/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := post.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := post.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := post.NameAvailabilityRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesCheckStatus(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := post.NameAvailabilityRequest{ // ... @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStartThenPoll(ctx, id); err != nil { // handle the error @@ -94,7 +94,7 @@ if err := client.ServicesStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStopThenPoll(ctx, id); err != nil { // handle the error @@ -106,7 +106,7 @@ if err := client.ServicesStopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := post.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := post.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksCancel(ctx, id) if err != nil { diff --git a/resource-manager/datamigration/2018-04-19/post/constants.go b/resource-manager/datamigration/2018-04-19/post/constants.go index 0f7e7fcbe0d..73fd441a17c 100644 --- a/resource-manager/datamigration/2018-04-19/post/constants.go +++ b/resource-manager/datamigration/2018-04-19/post/constants.go @@ -9,32 +9,755 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForMigrationStatus() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseMigrationStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +765,25 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := MigrationStatus(input) return &out, nil } @@ -100,6 +828,306 @@ func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) return &out, nil } +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + type TaskState string const ( @@ -158,3 +1186,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/id_location.go b/resource-manager/datamigration/2018-04-19/post/id_location.go index 8c08969bd6e..4df2f624f22 100644 --- a/resource-manager/datamigration/2018-04-19/post/id_location.go +++ b/resource-manager/datamigration/2018-04-19/post/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datamigration/2018-04-19/post/id_location_test.go b/resource-manager/datamigration/2018-04-19/post/id_location_test.go index 7b6e2ff1e37..e22dda8e247 100644 --- a/resource-manager/datamigration/2018-04-19/post/id_location_test.go +++ b/resource-manager/datamigration/2018-04-19/post/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/post/id_service.go b/resource-manager/datamigration/2018-04-19/post/id_service.go index 5aa1b1b4402..0bce91c9fd5 100644 --- a/resource-manager/datamigration/2018-04-19/post/id_service.go +++ b/resource-manager/datamigration/2018-04-19/post/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/post/id_service_test.go b/resource-manager/datamigration/2018-04-19/post/id_service_test.go index 382e114dbbe..bc8ef3953bb 100644 --- a/resource-manager/datamigration/2018-04-19/post/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/post/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/post/id_task.go b/resource-manager/datamigration/2018-04-19/post/id_task.go index 11221535b39..fd9ef4542ab 100644 --- a/resource-manager/datamigration/2018-04-19/post/id_task.go +++ b/resource-manager/datamigration/2018-04-19/post/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/post/id_task_test.go b/resource-manager/datamigration/2018-04-19/post/id_task_test.go index 1f0e9d97df6..6a7551d16b8 100644 --- a/resource-manager/datamigration/2018-04-19/post/id_task_test.go +++ b/resource-manager/datamigration/2018-04-19/post/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/post/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2018-04-19/post/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..edc03ee93fa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_backupfileinfo.go b/resource-manager/datamigration/2018-04-19/post/model_backupfileinfo.go new file mode 100644 index 00000000000..8a3d7a5a1ff --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_backupsetinfo.go b/resource-manager/datamigration/2018-04-19/post/model_backupsetinfo.go new file mode 100644 index 00000000000..cab42ab8799 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_blobshare.go b/resource-manager/datamigration/2018-04-19/post/model_blobshare.go new file mode 100644 index 00000000000..43022734151 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_blobshare.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_commandproperties.go b/resource-manager/datamigration/2018-04-19/post/model_commandproperties.go index 0716ee0be6f..161697fec25 100644 --- a/resource-manager/datamigration/2018-04-19/post/model_commandproperties.go +++ b/resource-manager/datamigration/2018-04-19/post/model_commandproperties.go @@ -1,10 +1,85 @@ package post +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/post/model_connectioninfo.go new file mode 100644 index 00000000000..b93ae5b1bdf --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connectioninfo.go @@ -0,0 +1,101 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..7de22cd2a10 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..6127f59fe7f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..d3ddedd9f07 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..b9220d491b0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..d63cc1a936e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..73959673667 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..c462c176be5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,57 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..77e15308763 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..d680d3ff733 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..b74f244fb88 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,57 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..2e3c24cb6b0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..16b7f819fb8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..078fe8840fe --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..a4134926e13 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..3426f880f5d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..4f373b1417b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..bda3c1aef6a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..bd3daca1db7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..eecd138e26d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..ad77f6fda2e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..1d1606687d9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..0884b58aad7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..3edf96123d2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..90cea060426 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..bc32be736c5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..c64a62beabb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..103b6764f76 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..572443798b8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_databasebackupinfo.go b/resource-manager/datamigration/2018-04-19/post/model_databasebackupinfo.go new file mode 100644 index 00000000000..13b3a8069d4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_databasefileinfo.go b/resource-manager/datamigration/2018-04-19/post/model_databasefileinfo.go new file mode 100644 index 00000000000..9b97071588b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_databasesummaryresult.go b/resource-manager/datamigration/2018-04-19/post/model_databasesummaryresult.go new file mode 100644 index 00000000000..9845e4b14d6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_databasetable.go b/resource-manager/datamigration/2018-04-19/post/model_databasetable.go new file mode 100644 index 00000000000..7b6fcf0d2cc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_databasetable.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2018-04-19/post/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..508d1bb1767 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2018-04-19/post/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..05366915a29 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_executionstatistics.go b/resource-manager/datamigration/2018-04-19/post/model_executionstatistics.go new file mode 100644 index 00000000000..9f01d0d7bf6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_executionstatistics.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_fileshare.go b/resource-manager/datamigration/2018-04-19/post/model_fileshare.go new file mode 100644 index 00000000000..ef974b61862 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_fileshare.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..c4e9e8c8d62 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..df0821f5ef8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..6b5bcb1a238 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..10830a59cb2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..5451bb93a80 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..51cba684ac9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..33e85ae56a7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..06b4321b13c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..0a8ff6cf53c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_getusertablessqltaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..d570aa2fe96 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..5f6869161d3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..208e3c5454a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..427dc76b1b4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..7363548a55a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..e26463b7884 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..c1c0c9198ef --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..02c69e7b786 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..b8ea1202a9f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..fa454bf5c76 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..be07052c227 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..484a16d9c66 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..c5174d540ce --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..17ef8b17435 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..4da9ece5a39 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..2705cdcbe66 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..2c0c7b2040c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..9696a2f13bb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..3ca8cfc9ef6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..287faf7ab36 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..ce8aedd47fb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..5be7549b318 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..b5031be5cb4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..7b694b09106 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..41597d2bf94 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..3bd03993c1a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..c552834e005 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..d0164f2d95f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e1d893d627e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..602e9d32b37 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..790a193f068 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..e89a0390cf1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..deb1a8ffc9b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..8c19410807b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..45d1434cabb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..f6daf907c39 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..3f5c8a822ef --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,65 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReport *MigrationReportResult `json:"migrationReport,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..36ff532f148 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..f96fbae75fe --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..c1c578f9dbc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..e2aeb7594d9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..5acb744382b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..f21199ee044 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..fffed061f40 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..ba2a5ca864c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..5b96aefa0b8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..b57c051d79e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,15 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..91b6307acd0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..bbdb0e7256a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..7a133fd181f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..117146ef3e6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..ec8efc8606f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..f8d4538fd07 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..12ceaff2f12 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..2b156b144e4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..169748d6fa7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..410574d2c90 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2018-04-19/post/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..dfe26ee06ac --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migrationreportresult.go b/resource-manager/datamigration/2018-04-19/post/model_migrationreportresult.go new file mode 100644 index 00000000000..a7237f4ca1c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2018-04-19/post/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..3f459a704af --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_migrationvalidationoptions.go b/resource-manager/datamigration/2018-04-19/post/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..01cefc0624d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/post/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..e299612d26f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/post/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..88b352af620 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_orphaneduserinfo.go b/resource-manager/datamigration/2018-04-19/post/model_orphaneduserinfo.go new file mode 100644 index 00000000000..456b860ac73 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/post/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..fe95b20cf5e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_projecttask.go b/resource-manager/datamigration/2018-04-19/post/model_projecttask.go index 0c51906583f..97aae158510 100644 --- a/resource-manager/datamigration/2018-04-19/post/model_projecttask.go +++ b/resource-manager/datamigration/2018-04-19/post/model_projecttask.go @@ -1,12 +1,51 @@ package post +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ProjectTask struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProjectTaskProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil } diff --git a/resource-manager/datamigration/2018-04-19/post/model_projecttaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_projecttaskproperties.go index 1414bb01ff5..96878aaa2b7 100644 --- a/resource-manager/datamigration/2018-04-19/post/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2018-04-19/post/model_projecttaskproperties.go @@ -1,11 +1,279 @@ package post +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.Sync") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2018-04-19/post/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..f59fa2e975d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_queryexecutionresult.go b/resource-manager/datamigration/2018-04-19/post/model_queryexecutionresult.go new file mode 100644 index 00000000000..99458e53e8d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_reportableexception.go b/resource-manager/datamigration/2018-04-19/post/model_reportableexception.go new file mode 100644 index 00000000000..96cb08aecce --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_reportableexception.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2018-04-19/post/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..ac94f24270d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2018-04-19/post/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..667a05006d5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_selectedcertificateinput.go b/resource-manager/datamigration/2018-04-19/post/model_selectedcertificateinput.go new file mode 100644 index 00000000000..e5670d0910b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/post/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..2c795ac21ea --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..2a462a6a620 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2018-04-19/post/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..c473e42e761 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2018-04-19/post/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..a04df7d1556 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..729cf6d60d0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..5c05c6fb9b4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..5671ea3bde4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..3891899551e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..354f0c1625f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..bd64da35678 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/post/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..e640725798b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/post/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..69db3adfdfb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_validationerror.go b/resource-manager/datamigration/2018-04-19/post/model_validationerror.go new file mode 100644 index 00000000000..ead8edecd34 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_validationerror.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/post/model_waitstatistics.go b/resource-manager/datamigration/2018-04-19/post/model_waitstatistics.go new file mode 100644 index 00000000000..e74d55dc8ad --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/post/model_waitstatistics.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/projectresource/README.md b/resource-manager/datamigration/2018-04-19/projectresource/README.md index 2480008e703..3088412ea70 100644 --- a/resource-manager/datamigration/2018-04-19/projectresource/README.md +++ b/resource-manager/datamigration/2018-04-19/projectresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := projectresource.Project{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsDelete(ctx, id, projectresource.DefaultProjectsDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := projectresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := projectresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ProjectsListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ProjectsListByResourceGroupComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := projectresource.Project{ // ... diff --git a/resource-manager/datamigration/2018-04-19/projectresource/constants.go b/resource-manager/datamigration/2018-04-19/projectresource/constants.go index 8d6a352d128..57ce0620b3d 100644 --- a/resource-manager/datamigration/2018-04-19/projectresource/constants.go +++ b/resource-manager/datamigration/2018-04-19/projectresource/constants.go @@ -9,6 +9,56 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + type ProjectProvisioningState string const ( @@ -131,3 +181,41 @@ func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { out := ProjectTargetPlatform(input) return &out, nil } + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/projectresource/id_project.go b/resource-manager/datamigration/2018-04-19/projectresource/id_project.go index eeef2ee59f6..09cc4be079c 100644 --- a/resource-manager/datamigration/2018-04-19/projectresource/id_project.go +++ b/resource-manager/datamigration/2018-04-19/projectresource/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/projectresource/id_project_test.go b/resource-manager/datamigration/2018-04-19/projectresource/id_project_test.go index 922ac4f7f5b..c961c1d4e0d 100644 --- a/resource-manager/datamigration/2018-04-19/projectresource/id_project_test.go +++ b/resource-manager/datamigration/2018-04-19/projectresource/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/projectresource/id_service.go b/resource-manager/datamigration/2018-04-19/projectresource/id_service.go index 71d997f3dfe..049198dddc6 100644 --- a/resource-manager/datamigration/2018-04-19/projectresource/id_service.go +++ b/resource-manager/datamigration/2018-04-19/projectresource/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/projectresource/id_service_test.go b/resource-manager/datamigration/2018-04-19/projectresource/id_service_test.go index a6dd5070905..76e86ac841c 100644 --- a/resource-manager/datamigration/2018-04-19/projectresource/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/projectresource/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/projectresource/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/projectresource/model_connectioninfo.go index 63f80a0c09a..656ad6a2de1 100644 --- a/resource-manager/datamigration/2018-04-19/projectresource/model_connectioninfo.go +++ b/resource-manager/datamigration/2018-04-19/projectresource/model_connectioninfo.go @@ -1,10 +1,101 @@ package projectresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/projectresource/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/projectresource/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..9cb8f6683f0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/projectresource/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/projectresource/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/projectresource/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..6a28b19fe17 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/projectresource/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/projectresource/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/projectresource/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..4f92e90f096 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/projectresource/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/projectresource/model_projectproperties.go b/resource-manager/datamigration/2018-04-19/projectresource/model_projectproperties.go index 6a63778da1a..9d9ff2a4627 100644 --- a/resource-manager/datamigration/2018-04-19/projectresource/model_projectproperties.go +++ b/resource-manager/datamigration/2018-04-19/projectresource/model_projectproperties.go @@ -1,6 +1,8 @@ package projectresource import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/projectresource/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/projectresource/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..be794f1053b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/projectresource/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/README.md b/resource-manager/datamigration/2018-04-19/put/README.md index dca5b4e06c6..0c08c72b34f 100644 --- a/resource-manager/datamigration/2018-04-19/put/README.md +++ b/resource-manager/datamigration/2018-04-19/put/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := put.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := put.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := put.Project{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := put.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := put.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := put.DataMigrationService{ // ... @@ -62,7 +62,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := put.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := put.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := put.ProjectTask{ // ... diff --git a/resource-manager/datamigration/2018-04-19/put/constants.go b/resource-manager/datamigration/2018-04-19/put/constants.go index 8104a6bdd25..f2f6aca21f0 100644 --- a/resource-manager/datamigration/2018-04-19/put/constants.go +++ b/resource-manager/datamigration/2018-04-19/put/constants.go @@ -9,32 +9,755 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForMigrationStatus() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseMigrationStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +765,75 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := MigrationStatus(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) return &out, nil } @@ -182,6 +960,53 @@ func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { return &out, nil } +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + type ServiceProvisioningState string const ( @@ -247,6 +1072,209 @@ func parseServiceProvisioningState(input string) (*ServiceProvisioningState, err return &out, nil } +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + type TaskState string const ( @@ -305,3 +1333,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/id_project.go b/resource-manager/datamigration/2018-04-19/put/id_project.go index 3b89497f674..36270603bda 100644 --- a/resource-manager/datamigration/2018-04-19/put/id_project.go +++ b/resource-manager/datamigration/2018-04-19/put/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/put/id_project_test.go b/resource-manager/datamigration/2018-04-19/put/id_project_test.go index 27756770ec6..9aba04de4ce 100644 --- a/resource-manager/datamigration/2018-04-19/put/id_project_test.go +++ b/resource-manager/datamigration/2018-04-19/put/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/put/id_service.go b/resource-manager/datamigration/2018-04-19/put/id_service.go index cd63e0cec80..d6c75873c69 100644 --- a/resource-manager/datamigration/2018-04-19/put/id_service.go +++ b/resource-manager/datamigration/2018-04-19/put/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/put/id_service_test.go b/resource-manager/datamigration/2018-04-19/put/id_service_test.go index c7238e518d4..0f9f94e2065 100644 --- a/resource-manager/datamigration/2018-04-19/put/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/put/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/put/id_task.go b/resource-manager/datamigration/2018-04-19/put/id_task.go index ff869d0639f..eec418bf518 100644 --- a/resource-manager/datamigration/2018-04-19/put/id_task.go +++ b/resource-manager/datamigration/2018-04-19/put/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/put/id_task_test.go b/resource-manager/datamigration/2018-04-19/put/id_task_test.go index 36cf842c6e1..7964500a4f4 100644 --- a/resource-manager/datamigration/2018-04-19/put/id_task_test.go +++ b/resource-manager/datamigration/2018-04-19/put/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/put/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2018-04-19/put/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..8fe3f5c20ca --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_backupfileinfo.go b/resource-manager/datamigration/2018-04-19/put/model_backupfileinfo.go new file mode 100644 index 00000000000..ad636d453a7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_backupsetinfo.go b/resource-manager/datamigration/2018-04-19/put/model_backupsetinfo.go new file mode 100644 index 00000000000..7e66848b305 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_blobshare.go b/resource-manager/datamigration/2018-04-19/put/model_blobshare.go new file mode 100644 index 00000000000..5c4242b0edd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_blobshare.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_commandproperties.go b/resource-manager/datamigration/2018-04-19/put/model_commandproperties.go index 6f1097e7cf7..b74c20293c0 100644 --- a/resource-manager/datamigration/2018-04-19/put/model_commandproperties.go +++ b/resource-manager/datamigration/2018-04-19/put/model_commandproperties.go @@ -1,10 +1,85 @@ package put +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/put/model_connectioninfo.go index 97b0ba3f9fb..bc27e64cb4d 100644 --- a/resource-manager/datamigration/2018-04-19/put/model_connectioninfo.go +++ b/resource-manager/datamigration/2018-04-19/put/model_connectioninfo.go @@ -1,10 +1,101 @@ package put +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..3dacd3d28c3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..ee2cb0d06b8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..fe0e89f7f22 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..a950e4a7ac1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,117 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..71b70f4d52e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..84fa27d6dfd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..16b857518f9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,57 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..4da9519ffb4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..9ce662dcb2c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..900afc7fb61 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,57 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..cdfe3622c19 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,117 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..0c3f902b90f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..e40010292cc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..c3fa6651537 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..7033195274b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..0fd0163d703 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..4d8c31fcb32 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..6df73c7b5d0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..381442ea0f3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..bfecfe739f3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..5e163ab3917 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..7ee371e0674 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..313687fd660 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..eff8fed5b7e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..9019e80e9f9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..30d490d81e5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..ca69a55e5a2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..c8001b714c4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_databasebackupinfo.go b/resource-manager/datamigration/2018-04-19/put/model_databasebackupinfo.go new file mode 100644 index 00000000000..f5697e18c83 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_databasefileinfo.go b/resource-manager/datamigration/2018-04-19/put/model_databasefileinfo.go new file mode 100644 index 00000000000..b687e3a128a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_databasesummaryresult.go b/resource-manager/datamigration/2018-04-19/put/model_databasesummaryresult.go new file mode 100644 index 00000000000..6bddb9cd545 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_databasetable.go b/resource-manager/datamigration/2018-04-19/put/model_databasetable.go new file mode 100644 index 00000000000..b2adfefbe17 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_databasetable.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2018-04-19/put/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..2d04cc1c86a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2018-04-19/put/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..605754e1c06 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_executionstatistics.go b/resource-manager/datamigration/2018-04-19/put/model_executionstatistics.go new file mode 100644 index 00000000000..27890588ef5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_executionstatistics.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_fileshare.go b/resource-manager/datamigration/2018-04-19/put/model_fileshare.go new file mode 100644 index 00000000000..2b8a69826c7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_fileshare.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..828c7ad2ba3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..3fc3e7234e3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..f12be76ee97 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..54843559d77 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..3e7b8b43ffc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..1c9005b1bd2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..978d48ea7f1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..d80b4225b6e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..3c4b7c0e5f5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_getusertablessqltaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..795d9cdc4b4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..eaf2ffe9864 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..e28a76e3140 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..7a34169733e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..abd00a56294 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..b1b4e6ecdfd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..6670e74c185 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..8885e0bc4c6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..19cdb930570 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e07c540192f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..b943256fdde --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..9777401f038 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..99b6bcf9033 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..3338b1a0f09 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..5cd2fa8db1e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..0ee9910465c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..14b9956988e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..32e0558316e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..82553b7e72d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..4f74413d660 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..9a0d1f21ce8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..3cafbd5560c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..0660f637f99 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..5caa8fb3df5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..2197ac1dc87 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..074db8480e5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..e4ff4968b2e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..f0e51789826 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..216a8ca3d7d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..9bd3df2ca65 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..d422f06d922 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,117 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..ef1a0907609 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..3eb22f8b724 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..f015b1a7ae4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..b3ca5704a01 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..8ddc3e3906f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..9151a15b829 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,65 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReport *MigrationReportResult `json:"migrationReport,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..3762a38e686 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..8ab4b337948 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..b00cf60225f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,117 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..97e97b796ae --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..68a788511cb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..9a4bb2c62fb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..bff105ab8b9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..0c9a9bde7c4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..9bea300e0bb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,117 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..9b6549e827a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,15 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..a489ea09198 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..32d00a061a2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..6aa2fd299e0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..fb23a40911a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..bea57ba4e0b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..2a96c489322 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..c9d00c14ef8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,117 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..0e4d5c22a84 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..50804a72895 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..7dfcb392cc9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2018-04-19/put/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..c5f9486d716 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migrationreportresult.go b/resource-manager/datamigration/2018-04-19/put/model_migrationreportresult.go new file mode 100644 index 00000000000..1c56c7cd64b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2018-04-19/put/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..c0ee9201725 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_migrationvalidationoptions.go b/resource-manager/datamigration/2018-04-19/put/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..5f6118cae5d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/put/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..66426a78d94 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/put/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..ad9dfa325c6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_orphaneduserinfo.go b/resource-manager/datamigration/2018-04-19/put/model_orphaneduserinfo.go new file mode 100644 index 00000000000..3b94f23b0cc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/put/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..c8f844672dc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_projectproperties.go b/resource-manager/datamigration/2018-04-19/put/model_projectproperties.go index 2ada2b876ef..6f47fde1382 100644 --- a/resource-manager/datamigration/2018-04-19/put/model_projectproperties.go +++ b/resource-manager/datamigration/2018-04-19/put/model_projectproperties.go @@ -1,6 +1,8 @@ package put import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_projecttask.go b/resource-manager/datamigration/2018-04-19/put/model_projecttask.go index 978c2310fb7..12f96299282 100644 --- a/resource-manager/datamigration/2018-04-19/put/model_projecttask.go +++ b/resource-manager/datamigration/2018-04-19/put/model_projecttask.go @@ -1,12 +1,51 @@ package put +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ProjectTask struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProjectTaskProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil } diff --git a/resource-manager/datamigration/2018-04-19/put/model_projecttaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_projecttaskproperties.go index e46c6a6c554..c1dcf349ab3 100644 --- a/resource-manager/datamigration/2018-04-19/put/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2018-04-19/put/model_projecttaskproperties.go @@ -1,11 +1,279 @@ package put +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.Sync") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2018-04-19/put/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..e790f5275ff --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_queryexecutionresult.go b/resource-manager/datamigration/2018-04-19/put/model_queryexecutionresult.go new file mode 100644 index 00000000000..b0c55507b7b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_reportableexception.go b/resource-manager/datamigration/2018-04-19/put/model_reportableexception.go new file mode 100644 index 00000000000..2cc0a1a6803 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_reportableexception.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2018-04-19/put/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..fcfd67b4c59 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2018-04-19/put/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..8a6b1a50429 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_selectedcertificateinput.go b/resource-manager/datamigration/2018-04-19/put/model_selectedcertificateinput.go new file mode 100644 index 00000000000..0820bd3e747 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/put/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..00d9d3562fd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..577d1831074 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2018-04-19/put/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..2c14c1419ef --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2018-04-19/put/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..558ff258402 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..2c85b342b6a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..8a67c402b88 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..b51da8bf20d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..b3e7d238bef --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..176982f4800 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..26f0f1b935e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/put/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..90fa1959f95 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/put/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..221405ce846 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_validationerror.go b/resource-manager/datamigration/2018-04-19/put/model_validationerror.go new file mode 100644 index 00000000000..488b77203ac --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_validationerror.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/put/model_waitstatistics.go b/resource-manager/datamigration/2018-04-19/put/model_waitstatistics.go new file mode 100644 index 00000000000..18c38d1797a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/put/model_waitstatistics.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/README.md b/resource-manager/datamigration/2018-04-19/serviceresource/README.md index 37b95fbfca4..3524fc636b2 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/README.md +++ b/resource-manager/datamigration/2018-04-19/serviceresource/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesCheckStatus(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := serviceresource.DataMigrationService{ // ... @@ -58,7 +58,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id, serviceresource.DefaultServicesDeleteOperationOptions()); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id, serviceresource.DefaultServices ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := serviceresource.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") +id := serviceresource.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") // alternatively `client.ServicesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ServicesListByResourceGroupComplete(ctx, id) @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServicesListSkus(ctx, id)` can be used to do batched pagination items, err := client.ServicesListSkusComplete(ctx, id) @@ -137,7 +137,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStartThenPoll(ctx, id); err != nil { // handle the error @@ -149,7 +149,7 @@ if err := client.ServicesStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStopThenPoll(ctx, id); err != nil { // handle the error @@ -161,7 +161,7 @@ if err := client.ServicesStopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := serviceresource.DataMigrationService{ // ... @@ -178,7 +178,7 @@ if err := client.ServicesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := serviceresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := serviceresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.TasksList(ctx, id, serviceresource.DefaultTasksListOperationOptions())` can be used to do batched pagination items, err := client.TasksListComplete(ctx, id, serviceresource.DefaultTasksListOperationOptions()) diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/constants.go b/resource-manager/datamigration/2018-04-19/serviceresource/constants.go index 2ea5df00e30..265916f7af9 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/constants.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/constants.go @@ -9,32 +9,755 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForMigrationStatus() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseMigrationStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +765,122 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := MigrationStatus(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) return &out, nil } @@ -168,6 +993,209 @@ func parseServiceScalability(input string) (*ServiceScalability, error) { return &out, nil } +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + type TaskState string const ( @@ -226,3 +1254,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/id_project.go b/resource-manager/datamigration/2018-04-19/serviceresource/id_project.go index 8ab9dc82e50..e4d20637d8d 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/id_project.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/id_project_test.go b/resource-manager/datamigration/2018-04-19/serviceresource/id_project_test.go index 841c04b5363..fe7c85f1c55 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/id_project_test.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/id_resourcegroup.go b/resource-manager/datamigration/2018-04-19/serviceresource/id_resourcegroup.go index 5074170e967..28fbeb3ab8b 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/id_resourcegroup.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/id_resourcegroup.go @@ -105,7 +105,7 @@ func (id ResourceGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), } } diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/id_resourcegroup_test.go b/resource-manager/datamigration/2018-04-19/serviceresource/id_resourcegroup_test.go index 007a7f9b2b2..ecc8f83c059 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/id_resourcegroup_test.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/id_resourcegroup_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ResourceGroupId{} func TestNewResourceGroupID(t *testing.T) { - id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") + id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } } func TestFormatResourceGroupID(t *testing.T) { - actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName" + actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseResourceGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/id_service.go b/resource-manager/datamigration/2018-04-19/serviceresource/id_service.go index 5b9a869072d..fbd1e64a55c 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/id_service.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/id_service_test.go b/resource-manager/datamigration/2018-04-19/serviceresource/id_service_test.go index 2ac3dc83a0e..e603b45396a 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..7d5faff6f88 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_backupfileinfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_backupfileinfo.go new file mode 100644 index 00000000000..f84cee9b6aa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_backupsetinfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_backupsetinfo.go new file mode 100644 index 00000000000..a7b98966641 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_blobshare.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_blobshare.go new file mode 100644 index 00000000000..e5f754d0f5f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_blobshare.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_commandproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_commandproperties.go index 7285e39656f..eb2e46f7153 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/model_commandproperties.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_commandproperties.go @@ -1,10 +1,85 @@ package serviceresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connectioninfo.go new file mode 100644 index 00000000000..18fb90f487d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connectioninfo.go @@ -0,0 +1,101 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..cba73eeb397 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..aab806bfe26 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..b68f2288026 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..f92c9bc3dd1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..3f885cc4d5e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..a6311bb3b7f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..368b5c4a6aa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,57 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ef849eede7e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..e2fdb8f6457 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..478d24da0a0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,57 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..2d529cba2ee --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..ef18b8f9dda --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..6df3bcfd815 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..a72032b70be --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..9dfa5d6bf74 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..eea1f392637 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..10f1499a76d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..c7d7d89ac41 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..e029b2b4398 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..ee34bcba261 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..e7028d76d73 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..e44dd125bc6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..42058a64efa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..cd80da6e4e9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..575405e870e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..3b042752f9e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..d0722818c00 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..eb8c89f6360 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_databasebackupinfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_databasebackupinfo.go new file mode 100644 index 00000000000..0ae14cc0724 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_databasefileinfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_databasefileinfo.go new file mode 100644 index 00000000000..356fbadeac2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_databasesummaryresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_databasesummaryresult.go new file mode 100644 index 00000000000..0c37373d905 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_databasetable.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_databasetable.go new file mode 100644 index 00000000000..31479df4f85 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_databasetable.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..e0c30e97b54 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..e8e51116317 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_executionstatistics.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_executionstatistics.go new file mode 100644 index 00000000000..f7efbaeae20 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_executionstatistics.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_fileshare.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_fileshare.go new file mode 100644 index 00000000000..7b81618d1b5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_fileshare.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..2f9f3c6a8bc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..46b93a57dda --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..c6a73ce30aa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..ec0886b891b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..39bc3e4fe88 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..fe3f5971f6c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..38e32df60e9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..08d53705517 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..bd0561300d2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_getusertablessqltaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..735b2fc909b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..4116c2922e8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..21bc7540b98 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..1ae45b8ba70 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..ab13fdfe61d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..3a214a989c0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..c3d89b63bae --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..c6669d22ceb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..89ae2b4728b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..ffeb75f384a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..9794ba7f20c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..26bcec86330 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..832c88c83f7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..7a8e9295841 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..c501e26c82b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..55e8fd97011 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ecd8542345e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..feec40ad496 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..924ce1c585c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..b36329e2cae --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..089c6598a89 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..0a13aa38cd8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..07803d6ac20 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..6eacddab69a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..92c430b9931 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..a84c6b0c95f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..4eafe25964f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..8b0b0d9067e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..81b3baf1bae --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..6e14eb7aa17 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..e377825c21f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..e50c78260ac --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..fd15219ef2e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..f682e5ae9b1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..1f6a5242ea3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..13ebf0ab390 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..57faca8b6c3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,65 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReport *MigrationReportResult `json:"migrationReport,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..dd04d560bdd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..a4a211e9297 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..c4e0cc7fff1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..8b845c0dd26 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..42645108bce --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..fe8041783d6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..596b868fdd1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e39cc948a16 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..53f50ae1063 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..2aa1e931e89 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,15 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..5024e3d5d12 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..5144167ef63 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..29f7909b68b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..b11e9948815 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..8be37fbf615 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..3a2a38a157e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..f08158a0e09 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..50e5e2d8513 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..3641462f295 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..a3a66aa8c75 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..740ce1fb64f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationreportresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationreportresult.go new file mode 100644 index 00000000000..b160d64635e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..da7281862b8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationvalidationoptions.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..6c4dff54366 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..ff68cfa6218 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..75fc8bdecbc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_orphaneduserinfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_orphaneduserinfo.go new file mode 100644 index 00000000000..2435c6b6c83 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..84d4caf6073 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_projecttask.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_projecttask.go index 5bfe05144a3..e20c1b4020e 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/model_projecttask.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_projecttask.go @@ -1,12 +1,51 @@ package serviceresource +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ProjectTask struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProjectTaskProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil } diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_projecttaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_projecttaskproperties.go index ee9af00dfc1..c6076f40eb4 100644 --- a/resource-manager/datamigration/2018-04-19/serviceresource/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_projecttaskproperties.go @@ -1,11 +1,279 @@ package serviceresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.Sync") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..881b11caf97 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_queryexecutionresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_queryexecutionresult.go new file mode 100644 index 00000000000..37c8bcb8a83 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_reportableexception.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_reportableexception.go new file mode 100644 index 00000000000..6796e828608 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_reportableexception.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..713b1d2631c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..24cb5a6a5a4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_selectedcertificateinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_selectedcertificateinput.go new file mode 100644 index 00000000000..4fefe71eaeb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..150eb887095 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..e6580645769 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..4313773209d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..0fbd57e83e1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..acd181a5eab --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..4ece32d35fb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..6da7e873e13 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..86d13d45dfd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..0518188760a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..ef6f7bfc547 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..da2f5e4704d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..d6e6b8e2780 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_validationerror.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_validationerror.go new file mode 100644 index 00000000000..478e5e29376 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_validationerror.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/serviceresource/model_waitstatistics.go b/resource-manager/datamigration/2018-04-19/serviceresource/model_waitstatistics.go new file mode 100644 index 00000000000..2320ba49148 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/serviceresource/model_waitstatistics.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/README.md b/resource-manager/datamigration/2018-04-19/standardoperation/README.md index 434a7642259..ab771a59107 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/README.md +++ b/resource-manager/datamigration/2018-04-19/standardoperation/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := standardoperation.Project{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsDelete(ctx, id, standardoperation.DefaultProjectsDeleteOperationOptions()) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ProjectsListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ProjectsListByResourceGroupComplete(ctx, id) @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := standardoperation.Project{ // ... @@ -133,7 +133,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := standardoperation.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := standardoperation.NameAvailabilityRequest{ // ... @@ -154,7 +154,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := standardoperation.DataMigrationService{ // ... @@ -171,7 +171,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id, standardoperation.DefaultServicesDeleteOperationOptions()); err != nil { // handle the error @@ -183,7 +183,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id, standardoperation.DefaultServic ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -216,7 +216,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") +id := standardoperation.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") // alternatively `client.ServicesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ServicesListByResourceGroupComplete(ctx, id) @@ -233,7 +233,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServicesListSkus(ctx, id)` can be used to do batched pagination items, err := client.ServicesListSkusComplete(ctx, id) @@ -250,7 +250,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := standardoperation.DataMigrationService{ // ... @@ -267,7 +267,7 @@ if err := client.ServicesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := standardoperation.ProjectTask{ // ... @@ -288,7 +288,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksDelete(ctx, id, standardoperation.DefaultTasksDeleteOperationOptions()) if err != nil { @@ -304,7 +304,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksGet(ctx, id, standardoperation.DefaultTasksGetOperationOptions()) if err != nil { @@ -320,7 +320,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.TasksList(ctx, id, standardoperation.DefaultTasksListOperationOptions())` can be used to do batched pagination items, err := client.TasksListComplete(ctx, id, standardoperation.DefaultTasksListOperationOptions()) @@ -337,7 +337,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := standardoperation.ProjectTask{ // ... @@ -358,7 +358,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := standardoperation.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.UsagesList(ctx, id)` can be used to do batched pagination items, err := client.UsagesListComplete(ctx, id) diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/constants.go b/resource-manager/datamigration/2018-04-19/standardoperation/constants.go index f82ac6cc53b..a49bc1e4df4 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/constants.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/constants.go @@ -9,32 +9,755 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForMigrationStatus() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseMigrationStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +765,25 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := MigrationStatus(input) return &out, nil } @@ -100,6 +828,56 @@ func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) return &out, nil } +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + type ProjectProvisioningState string const ( @@ -346,6 +1124,53 @@ func parseResourceSkuRestrictionsType(input string) (*ResourceSkuRestrictionsTyp return &out, nil } +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + type ServiceProvisioningState string const ( @@ -455,6 +1280,209 @@ func parseServiceScalability(input string) (*ServiceScalability, error) { return &out, nil } +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + type TaskState string const ( @@ -513,3 +1541,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_location.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_location.go index d0a0092517b..2ab4d2bae9d 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_location.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_location_test.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_location_test.go index c323d21bc2a..7772869feab 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_location_test.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_project.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_project.go index 04bfb08ae23..1dd919dc933 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_project.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_project_test.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_project_test.go index ae2ef2d185b..076fcc9395d 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_project_test.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_resourcegroup.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_resourcegroup.go index 5e91cd3b2af..c4b53b2944c 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_resourcegroup.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_resourcegroup.go @@ -105,7 +105,7 @@ func (id ResourceGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), } } diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_resourcegroup_test.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_resourcegroup_test.go index e61c5b87602..5ee11092426 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_resourcegroup_test.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_resourcegroup_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ResourceGroupId{} func TestNewResourceGroupID(t *testing.T) { - id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") + id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } } func TestFormatResourceGroupID(t *testing.T) { - actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName" + actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseResourceGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_service.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_service.go index 95844f3b7ab..dadc95540e3 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_service.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_service_test.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_service_test.go index 97521f713d8..77ad8489e7f 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_service_test.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_task.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_task.go index 1238cf9eb3d..7d8b593e186 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_task.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/id_task_test.go b/resource-manager/datamigration/2018-04-19/standardoperation/id_task_test.go index 1924c76e412..81ff8432eb0 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/id_task_test.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..3b64e6f440b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_backupfileinfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_backupfileinfo.go new file mode 100644 index 00000000000..518c2f93101 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_backupsetinfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_backupsetinfo.go new file mode 100644 index 00000000000..33e7144bb5c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_blobshare.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_blobshare.go new file mode 100644 index 00000000000..fd94cff95ff --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_blobshare.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_commandproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_commandproperties.go index 5e78256c7a9..bafec93e24d 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/model_commandproperties.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_commandproperties.go @@ -1,10 +1,85 @@ package standardoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connectioninfo.go index 263aa03f0b3..cf328bbf48c 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/model_connectioninfo.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connectioninfo.go @@ -1,10 +1,101 @@ package standardoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..476a6f01951 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..83b0fe4065a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..3c729ccf052 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..546586ef831 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,117 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..054482de593 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..e2ae1c203ae --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..08353ce51df --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,57 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..2b055019588 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..78b9b9875d0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..6aa924be336 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,57 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..c214a578809 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,117 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..452cbb4c0eb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..89b29e3317e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..07518e23fd9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..85a5461635c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..b497d1e196b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..d217bc17972 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..a987a6eaba0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..04d0da5f903 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..535efe4e97d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..a23f3362a3f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..420fd2fa103 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..ac544a1178c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..c4b61788bd5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..4b1cd928983 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..2de945f7289 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..373008bae1a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..f9773db76f6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_databasebackupinfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_databasebackupinfo.go new file mode 100644 index 00000000000..74d6e69c67f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_databasefileinfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_databasefileinfo.go new file mode 100644 index 00000000000..1962a790a06 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_databasesummaryresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_databasesummaryresult.go new file mode 100644 index 00000000000..88262ee7a3c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_databasetable.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_databasetable.go new file mode 100644 index 00000000000..e7e5af5c618 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_databasetable.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..c02765b9a1c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..c52e2bac8a4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_executionstatistics.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_executionstatistics.go new file mode 100644 index 00000000000..7f4c6916f00 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_executionstatistics.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_fileshare.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_fileshare.go new file mode 100644 index 00000000000..b8843a2af5a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_fileshare.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..061c2440476 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..0f1e7ead922 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..efaca2a8bff --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..987e63ff3a8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..bd9ab2763e7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..0e6f4f25baf --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..2af4b0d0a4c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..2b93a6c1d77 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..33b71b3587c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_getusertablessqltaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..f03114ed088 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..297b62ca860 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..b949339b85d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..0e43a27aa3f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..04d7d9d06f6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..17c2672495b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..9fa0cf3a14b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ae8848a3fc6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..f4d6c28fd5c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..4e59e405613 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..8f6ac4c7be5 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..b61e041bf4d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..2995616affd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..beed056a636 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..d22b5788b0c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..ba80cfe12cf --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..49d6746905a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..8a5de40858d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..64b5c1642fb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..f58eb6a9993 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..fdc0228944f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..052df84d541 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..94797970740 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..0418d7a838c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..b2a36f2d64b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..45ea6fa39f1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..c89a2e3550f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..1a210e1bad8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..395c640b9f4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..c5ee53958bf --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..7ab700ca3f1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,117 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..7d056d00296 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..cdfb0028704 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..42db2b80a36 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..53eb35d35dd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..76c07cc532e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..f47f2e76f4e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,65 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReport *MigrationReportResult `json:"migrationReport,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..e3d145f485c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..408dd58ff72 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..b0741bd3003 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,117 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..7d2c10e1ee3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..ac93a9f16ec --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..dccf319b8c9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..698a0e27069 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..10fb0360e9f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..e344bacdcb1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,117 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..f5d70dad0db --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,15 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..6cefd07a2c6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..2b78f88eb95 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..6ed3e6a6e2e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..64a134b3253 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..a72e46d4b8a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..720052e2383 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..b5f18328909 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,117 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..42a48ac77be --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..ea32e5edc5e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..87a1619261b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..b3de2426c3c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationreportresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationreportresult.go new file mode 100644 index 00000000000..98300b226f7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..404bdf9be50 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationvalidationoptions.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..b125e7c847d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..8f85520417e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..a86a2a01248 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_orphaneduserinfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_orphaneduserinfo.go new file mode 100644 index 00000000000..48606cab2cd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..d3d9954a186 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_projectproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_projectproperties.go index ada5570436d..3da48419dc7 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/model_projectproperties.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_projectproperties.go @@ -1,6 +1,8 @@ package standardoperation import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_projecttask.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_projecttask.go index 781005b884c..da2ee17e9e7 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/model_projecttask.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_projecttask.go @@ -1,12 +1,51 @@ package standardoperation +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ProjectTask struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProjectTaskProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil } diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_projecttaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_projecttaskproperties.go index 9c8fabf882c..4c6e24105f3 100644 --- a/resource-manager/datamigration/2018-04-19/standardoperation/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_projecttaskproperties.go @@ -1,11 +1,279 @@ package standardoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.Sync") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..3abd2b09405 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_queryexecutionresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_queryexecutionresult.go new file mode 100644 index 00000000000..dc73c5d4c79 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_reportableexception.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_reportableexception.go new file mode 100644 index 00000000000..eb016d5302f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_reportableexception.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..6014e8145d9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..e37d06e5bd9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_selectedcertificateinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_selectedcertificateinput.go new file mode 100644 index 00000000000..f90ab97ec64 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..34bcc8f5247 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..5d913e91c33 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..b3b1cf8f6b0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..5fe9e3ada53 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..6e139c2d7d2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..b940cc2b66b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..7a060621d32 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..ac451018e63 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..b53647f19b4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..6293bf8833e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..6b177cc0d5b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..b32d25bf77e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_validationerror.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_validationerror.go new file mode 100644 index 00000000000..416bdafc455 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_validationerror.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/standardoperation/model_waitstatistics.go b/resource-manager/datamigration/2018-04-19/standardoperation/model_waitstatistics.go new file mode 100644 index 00000000000..764f04979d4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/standardoperation/model_waitstatistics.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/README.md b/resource-manager/datamigration/2018-04-19/taskresource/README.md index 969730d12e0..73b43217868 100644 --- a/resource-manager/datamigration/2018-04-19/taskresource/README.md +++ b/resource-manager/datamigration/2018-04-19/taskresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksCancel(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := taskresource.ProjectTask{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksDelete(ctx, id, taskresource.DefaultTasksDeleteOperationOptions()) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksGet(ctx, id, taskresource.DefaultTasksGetOperationOptions()) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := taskresource.ProjectTask{ // ... diff --git a/resource-manager/datamigration/2018-04-19/taskresource/constants.go b/resource-manager/datamigration/2018-04-19/taskresource/constants.go index 79213946643..160bb0d4def 100644 --- a/resource-manager/datamigration/2018-04-19/taskresource/constants.go +++ b/resource-manager/datamigration/2018-04-19/taskresource/constants.go @@ -9,32 +9,755 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForMigrationStatus() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseMigrationStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +765,325 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := MigrationStatus(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) return &out, nil } @@ -117,3 +1145,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/id_task.go b/resource-manager/datamigration/2018-04-19/taskresource/id_task.go index 6321390155f..6fb1e1fb21d 100644 --- a/resource-manager/datamigration/2018-04-19/taskresource/id_task.go +++ b/resource-manager/datamigration/2018-04-19/taskresource/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2018-04-19/taskresource/id_task_test.go b/resource-manager/datamigration/2018-04-19/taskresource/id_task_test.go index 76b4234484f..f174a9f0a71 100644 --- a/resource-manager/datamigration/2018-04-19/taskresource/id_task_test.go +++ b/resource-manager/datamigration/2018-04-19/taskresource/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2018-04-19/taskresource/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..80dd0973dc8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_backupfileinfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_backupfileinfo.go new file mode 100644 index 00000000000..dd2961a166a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_backupsetinfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_backupsetinfo.go new file mode 100644 index 00000000000..769d00712d6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_blobshare.go b/resource-manager/datamigration/2018-04-19/taskresource/model_blobshare.go new file mode 100644 index 00000000000..ae5f87adfb8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_blobshare.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_commandproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_commandproperties.go index 5bb1185f9de..5c8eecba369 100644 --- a/resource-manager/datamigration/2018-04-19/taskresource/model_commandproperties.go +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_commandproperties.go @@ -1,10 +1,85 @@ package taskresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connectioninfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connectioninfo.go new file mode 100644 index 00000000000..1b426b59ec0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connectioninfo.go @@ -0,0 +1,101 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..c7dacb8c34e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..f9b74bf26b1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..dbf9fc9740c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..b9176a0ad72 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..20b5b09cd2e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..7d0e5b767a9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..76909c13e11 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,57 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..229dc2c28b8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..bc84d82533b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..2d2b9aec877 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,57 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..2ad9ccc1135 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..6631ffb1e3b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..89c026eaed0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..2beac364df8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..5cf86899c3a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..e9da7d7d83f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..9097911a029 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..35bd813f635 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..e020cbc4e0e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..c89acafb89b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..20851a5ebbf --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..9d6041e0dd6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..b6ff665fc7e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..cd02bf9b82f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..140caa16e24 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..96d4e629bfe --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..230653df71a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..4e86826ba1e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_databasebackupinfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_databasebackupinfo.go new file mode 100644 index 00000000000..3f35fc9b760 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_databasefileinfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_databasefileinfo.go new file mode 100644 index 00000000000..b985e511a0d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_databasesummaryresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_databasesummaryresult.go new file mode 100644 index 00000000000..d5e2bf5eda0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_databasetable.go b/resource-manager/datamigration/2018-04-19/taskresource/model_databasetable.go new file mode 100644 index 00000000000..259781e85a2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_databasetable.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..3a6ec62068b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..59f61665ce0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_executionstatistics.go b/resource-manager/datamigration/2018-04-19/taskresource/model_executionstatistics.go new file mode 100644 index 00000000000..3cba1907533 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_executionstatistics.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_fileshare.go b/resource-manager/datamigration/2018-04-19/taskresource/model_fileshare.go new file mode 100644 index 00000000000..60e2ee8d55e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_fileshare.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..eeb90ec4fd2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..f73d40720a7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..6a4e844545e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..9770c7268d0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..652b046beed --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..407fefb2342 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..ec856944030 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..d36a8077b19 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..aa926d8a826 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_getusertablessqltaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..fe3bfa24c91 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..fc9f0f1102e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..b1318837812 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..5775d55a12b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..a3111b43fe3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..4f2ec41152b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..943fa70f9a8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..f79ea87a8a2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..71dc72f7782 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..013f9fa532d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..cb95d67242f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..a6d2a75a35e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..d0dc202919e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..baf439b0603 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..8466fd841c0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..a820987b390 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..4b584fc530d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..29a3c91dec9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..02fd561d0c0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..6ca2c372c41 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..96353c70d52 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..995f7216e8d --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..8e64d5310e2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..591a42c028f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..f66306e63bd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..ac87b0fc6d0 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..6a69d2521ab --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..0faed7290c4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..6723d538587 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..a9fcd7d9c16 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..70697136d02 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..0041f8d99b9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..4efbc1bea0b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..27797a34504 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..8efa791fc51 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..14c189addbd --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e76488acc9b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,65 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReport *MigrationReportResult `json:"migrationReport,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..f539775aa39 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..87ca3e60cdc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..443d07f47f4 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..71e80b4ee87 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..af93f7e0033 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..96c224766ff --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..bb8074980b3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..357b6b5d5cb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..4d65db6f1b7 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..18d73748b28 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,15 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..84e98d469d6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..1325a65918c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..573f74ace8c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..c73a305be17 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..ee6148fdc2c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..694354276eb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType *string `json:"resultType,omitempty"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..e1856c646e6 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..281d8564318 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..a1a9245d90e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..c1db71c50dc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..2c95a8d88fa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migrationreportresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migrationreportresult.go new file mode 100644 index 00000000000..21617dd3dfc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..7d4d8b8eb6e --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_migrationvalidationoptions.go b/resource-manager/datamigration/2018-04-19/taskresource/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..d463dfa9216 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_misqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..14cfe28c18f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..a305d5ce2fa --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_mysqlconnectioninfo.go @@ -0,0 +1,55 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_orphaneduserinfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_orphaneduserinfo.go new file mode 100644 index 00000000000..8127e8f1fe2 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..c961b0f0c17 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_postgresqlconnectioninfo.go @@ -0,0 +1,56 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_projecttask.go b/resource-manager/datamigration/2018-04-19/taskresource/model_projecttask.go index 911fb032a58..fac635b4eb5 100644 --- a/resource-manager/datamigration/2018-04-19/taskresource/model_projecttask.go +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_projecttask.go @@ -1,12 +1,51 @@ package taskresource +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ProjectTask struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ProjectTaskProperties `json:"properties"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil } diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_projecttaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_projecttaskproperties.go index f25b6b10f9c..809af8ef64a 100644 --- a/resource-manager/datamigration/2018-04-19/taskresource/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_projecttaskproperties.go @@ -1,11 +1,279 @@ package taskresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.Sync") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..64a1ea12448 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_queryexecutionresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_queryexecutionresult.go new file mode 100644 index 00000000000..e69c3d41f3f --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_reportableexception.go b/resource-manager/datamigration/2018-04-19/taskresource/model_reportableexception.go new file mode 100644 index 00000000000..b62013daca3 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_reportableexception.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..ff3ab81fa15 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2018-04-19/taskresource/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..43a4b30c4e8 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_selectedcertificateinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_selectedcertificateinput.go new file mode 100644 index 00000000000..7196e68b89a --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_sqlconnectioninfo.go b/resource-manager/datamigration/2018-04-19/taskresource/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..3a4b3b00f9c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..c0a52130e67 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2018-04-19/taskresource/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..d77a89b3a07 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2018-04-19/taskresource/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..c67bec7e070 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..df331341781 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..4ace5ea7dbc --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..1b24fc3f775 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..3679ddf26eb --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..3ce9bbb8d9b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..b905138e57c --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..58f491be4c1 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..32bb29910ee --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_validationerror.go b/resource-manager/datamigration/2018-04-19/taskresource/model_validationerror.go new file mode 100644 index 00000000000..3ed9aa47b1b --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_validationerror.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2018-04-19/taskresource/model_waitstatistics.go b/resource-manager/datamigration/2018-04-19/taskresource/model_waitstatistics.go new file mode 100644 index 00000000000..e3a8eaec0f9 --- /dev/null +++ b/resource-manager/datamigration/2018-04-19/taskresource/model_waitstatistics.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/README.md b/resource-manager/datamigration/2021-06-30/customoperation/README.md index 27194c0a3eb..f4dee921ff1 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/README.md +++ b/resource-manager/datamigration/2021-06-30/customoperation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := customoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") read, err := client.ServiceTasksCancel(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := customoperation.NameAvailabilityRequest{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesCheckStatus(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStartThenPoll(ctx, id); err != nil { // handle the error @@ -89,7 +89,7 @@ if err := client.ServicesStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := customoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStopThenPoll(ctx, id); err != nil { // handle the error @@ -101,7 +101,7 @@ if err := client.ServicesStopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := customoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksCancel(ctx, id) if err != nil { @@ -117,7 +117,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := customoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := customoperation.CommandProperties{ // ... diff --git a/resource-manager/datamigration/2021-06-30/customoperation/constants.go b/resource-manager/datamigration/2021-06-30/customoperation/constants.go index 567d6dde3e2..82d326a07a5 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/constants.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/constants.go @@ -9,32 +9,1450 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type NameCheckFailureReason string + +const ( + NameCheckFailureReasonAlreadyExists NameCheckFailureReason = "AlreadyExists" + NameCheckFailureReasonInvalid NameCheckFailureReason = "Invalid" +) + +func PossibleValuesForNameCheckFailureReason() []string { + return []string{ + string(NameCheckFailureReasonAlreadyExists), + string(NameCheckFailureReasonInvalid), + } +} + +func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNameCheckFailureReason(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) { + vals := map[string]NameCheckFailureReason{ + "alreadyexists": NameCheckFailureReasonAlreadyExists, + "invalid": NameCheckFailureReasonInvalid, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NameCheckFailureReason(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForSeverity() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *Severity) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseSeverity(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,43 +1460,39 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := Severity(input) return &out, nil } -type NameCheckFailureReason string +type SqlSourcePlatform string const ( - NameCheckFailureReasonAlreadyExists NameCheckFailureReason = "AlreadyExists" - NameCheckFailureReasonInvalid NameCheckFailureReason = "Invalid" + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" ) -func PossibleValuesForNameCheckFailureReason() []string { +func PossibleValuesForSqlSourcePlatform() []string { return []string{ - string(NameCheckFailureReasonAlreadyExists), - string(NameCheckFailureReasonInvalid), + string(SqlSourcePlatformSqlOnPrem), } } -func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseNameCheckFailureReason(decoded) + out, err := parseSqlSourcePlatform(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -86,17 +1500,284 @@ func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { return nil } -func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) { - vals := map[string]NameCheckFailureReason{ - "alreadyexists": NameCheckFailureReasonAlreadyExists, - "invalid": NameCheckFailureReasonInvalid, +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := NameCheckFailureReason(input) + out := SqlSourcePlatform(input) + return &out, nil +} + +type SsisMigrationOverwriteOption string + +const ( + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" +) + +func PossibleValuesForSsisMigrationOverwriteOption() []string { + return []string{ + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), + } +} + +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationOverwriteOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationOverwriteOption(input) + return &out, nil +} + +type SsisMigrationStage string + +const ( + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" +) + +func PossibleValuesForSsisMigrationStage() []string { + return []string{ + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), + } +} + +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationStage(input) + return &out, nil +} + +type SsisStoreType string + +const ( + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" +) + +func PossibleValuesForSsisStoreType() []string { + return []string{ + string(SsisStoreTypeSsisCatalog), + } +} + +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisStoreType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisStoreType(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) return &out, nil } @@ -158,3 +1839,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/id_service.go b/resource-manager/datamigration/2021-06-30/customoperation/id_service.go index 5789d7ff4b1..cb1fbd94832 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/id_service.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/customoperation/id_service_test.go b/resource-manager/datamigration/2021-06-30/customoperation/id_service_test.go index e27752a03c9..e9db6b476c4 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/customoperation/id_servicetask.go b/resource-manager/datamigration/2021-06-30/customoperation/id_servicetask.go index 04ffebf040d..e21ff7d7161 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/id_servicetask.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/id_servicetask.go @@ -117,13 +117,13 @@ func (id ServiceTaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticServiceTasks", "serviceTasks", "serviceTasks"), - resourceids.UserSpecifiedSegment("serviceTaskName", "taskName"), + resourceids.UserSpecifiedSegment("serviceTaskName", "serviceTaskName"), } } diff --git a/resource-manager/datamigration/2021-06-30/customoperation/id_servicetask_test.go b/resource-manager/datamigration/2021-06-30/customoperation/id_servicetask_test.go index 3f8fdbfcaf4..0cc6f0465be 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/id_servicetask_test.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/id_servicetask_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ServiceTaskId{} func TestNewServiceTaskID(t *testing.T) { - id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") + id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.ServiceTaskName != "taskName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "taskName") + if id.ServiceTaskName != "serviceTaskName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "serviceTaskName") } } func TestFormatServiceTaskID(t *testing.T) { - actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName" + actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseServiceTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseServiceTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", - ServiceTaskName: "tAsKnAmE", + ServiceTaskName: "sErViCeTaSkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/customoperation/id_task.go b/resource-manager/datamigration/2021-06-30/customoperation/id_task.go index de0027cb77a..d95d276a9d8 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/id_task.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/customoperation/id_task_test.go b/resource-manager/datamigration/2021-06-30/customoperation/id_task_test.go index 2e8a26fbf4a..fe497f84497 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/id_task_test.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/customoperation/method_taskscommand.go b/resource-manager/datamigration/2021-06-30/customoperation/method_taskscommand.go index 72226f6f47b..5dad19081f7 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/method_taskscommand.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/method_taskscommand.go @@ -2,6 +2,7 @@ package customoperation import ( "context" + "encoding/json" "fmt" "net/http" @@ -15,7 +16,7 @@ import ( type TasksCommandOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *CommandProperties + Model CommandProperties } // TasksCommand ... @@ -48,11 +49,15 @@ func (c CustomOperationClient) TasksCommand(ctx context.Context, id TaskId, inpu return } - var model CommandProperties - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { + var respObj json.RawMessage + if err = resp.Unmarshal(&respObj); err != nil { return } + model, err := UnmarshalCommandPropertiesImplementation(respObj) + if err != nil { + return + } + result.Model = model return } diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/customoperation/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..0324e830609 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_backupfileinfo.go new file mode 100644 index 00000000000..23ce82e40c7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_backupsetinfo.go new file mode 100644 index 00000000000..8c975bc61dd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_blobshare.go b/resource-manager/datamigration/2021-06-30/customoperation/model_blobshare.go new file mode 100644 index 00000000000..4139d522fb6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_blobshare.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_commandproperties.go index c4448ca12ac..790ae4502a7 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_commandproperties.go @@ -1,10 +1,85 @@ package customoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connectioninfo.go new file mode 100644 index 00000000000..b900b18932b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connectioninfo.go @@ -0,0 +1,117 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "mongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..2fbc1998a06 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..940c6010616 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..02db83cf954 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..e25b7500a93 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..216b7d0c713 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..b74745c7cc7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..6326018868a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..b09344d38a8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..bf76dd8acd7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..72251a94f1a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..206db9db63a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..d8d203f408d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..ac87ef0e5a1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..1dbebad60ef --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..2dace278b19 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..2760eb441b2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..488b2f54ac6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..860982ba7a6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..b1a5740c98f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..d590f457e2b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..dcda7e0f67b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..eff973fddc3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..974637512a8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..e6f1d6e9f4c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..c2704c435f7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..e8ba6335874 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..416c1981237 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..44d595a33a3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..ec4f2e7f1fb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..13704f159a5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..e23bd189a78 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..8be5e98ab02 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..f2af71f1ba7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..dc7fa629b8d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..1eca7ae9dcb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..62a477e7194 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..e763e09935f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..70fc3459cf6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..ccfb9211b9b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_databasebackupinfo.go new file mode 100644 index 00000000000..435f581a232 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_databasefileinfo.go new file mode 100644 index 00000000000..fad6a22a9d7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_databasesummaryresult.go new file mode 100644 index 00000000000..ec9a05dd159 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_databasetable.go b/resource-manager/datamigration/2021-06-30/customoperation/model_databasetable.go new file mode 100644 index 00000000000..d197e51de64 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_databasetable.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..317cd596af1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..c0dc75ca00d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/customoperation/model_executionstatistics.go new file mode 100644 index 00000000000..cabaf9d20f9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_executionstatistics.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_fileshare.go b/resource-manager/datamigration/2021-06-30/customoperation/model_fileshare.go new file mode 100644 index 00000000000..8fa6d624f18 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_fileshare.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..44c83e7c60f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..61917899ec6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..bc5d399a023 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..c6a1ab00878 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..d77f995f128 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..16437f24b2c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..32debca660f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..9c02acb2a27 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..028137977e6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..2605236c3ea --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..81a97eb5b8f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..3273ae0739b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..2b090e555d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..09cfdf8c6b9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..7faa3b69614 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..1e5bc8f8aea --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..6998d59bbc1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..6c988dba44a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..a2a1373b2c3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..6352a70332a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..348ecc8b6ca --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..dea762ca278 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..9bbcdf2b023 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..22d6455326e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..924017aaf44 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..883a82d3fa3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..6e4eb8bb832 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..f66a29ab8e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..2e5518abab1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..8d1fd1d5b93 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..c8811c3eb31 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..974cde64937 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..d7346685189 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..903c652abf5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..e3461ba50de --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..b19fdc6d0af --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..20c3e6c4f6f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..5bcffba46c3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..7e32fea1ae9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..206e67f84d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..0e705b094cf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..59cd6a3041c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..a5d397592b9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..808a3304302 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..bac1ac398eb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..9c5d6b54ec3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..27ed75db263 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..6b7c5adc457 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..4def1d89f97 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..6fcae0bbb2c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..cc7d9c70daf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..e39f7e9c3a0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..3b45a7f72e2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ff2c98f73bf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..f777ecd7adf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..213caebe8b2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..57b87beb271 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..74ee5ac2acd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..f5955035a35 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..5332c5e851d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..dbd8ef520a5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..79b9f364a9f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..7c4fc965308 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..c424294b7e5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..ff5e3e40bce --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..ccb2b869ac1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..1df03e4a8b5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..8d98e80cd35 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..c3d3ae1a1dd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..b4194039baa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..e5c65363dd0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..0b15f82c375 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..c8889d13f41 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..ee4fa98fa26 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..08d70aa58f3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..3aff147d09d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..192eeb4b03e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..db7dda0c80b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..bc05d624e7a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..2ae6a2775ba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..cdf65791f4d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..77a7cf3fd7e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..251adbe98b7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..b75df74265e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..c4eff672cd4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..76200e4ff3c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..11e7ef2f16f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..c7ec7523b0b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..c2a3c98936e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..103c0b7f764 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..f7d5c960482 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskinput.go new file mode 100644 index 00000000000..b8932cd1be6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutput.go new file mode 100644 index 00000000000..b4a941401c8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e5631fd6fd3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..20edc6eccae --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskproperties.go new file mode 100644 index 00000000000..d69655df17d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..b559284aa32 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..f8ad7c32c57 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..77e6be76514 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..df4245588be --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationreportresult.go new file mode 100644 index 00000000000..ae2df73d161 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..127c8bf6d99 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package customoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..a94144318ea --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationresult.go new file mode 100644 index 00000000000..4ce3a2753d9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..756f47b192a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..0be815af2ce --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..199a6afd823 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..29b8e6960f7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..9a62fdc96b3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..c0afdd8d08a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "mongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..d2f1c366974 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..35abb846849 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..40d31d6e142 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodberror.go new file mode 100644 index 00000000000..38a221bf547 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodberror.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..7a567a8451c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..f9d785be1f1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbprogress.go new file mode 100644 index 00000000000..3ac1603f8a4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package customoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..8bb41d45aaf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..c95302169c0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..f5762244e5a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..3339bf94595 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..cdc6dd71a1d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..c7f0f4def79 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_orphaneduserinfo.go new file mode 100644 index 00000000000..4a5b29638d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..526f8382940 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_projecttask.go b/resource-manager/datamigration/2021-06-30/customoperation/model_projecttask.go index c28c6ad5b37..3d5006b9f13 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_projecttask.go @@ -1,6 +1,9 @@ package customoperation import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_projecttaskproperties.go index ee9012375d0..f4d3f21e1f8 100644 --- a/resource-manager/datamigration/2021-06-30/customoperation/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package customoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..3a9975c5bc1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_queryexecutionresult.go new file mode 100644 index 00000000000..bb4ef05ce25 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/customoperation/model_reportableexception.go new file mode 100644 index 00000000000..14a405e6e6e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_reportableexception.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..9bdee9bd818 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/customoperation/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..d08acd5afd1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_selectedcertificateinput.go new file mode 100644 index 00000000000..d5742b271fd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_serverproperties.go new file mode 100644 index 00000000000..738da9707d3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_serverproperties.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..601b3c4b747 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..e6837b57e1a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/customoperation/model_ssismigrationinfo.go new file mode 100644 index 00000000000..01665bbf440 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/customoperation/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..ba0af741bba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/customoperation/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..ed07058797b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..aecbdf08b7a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..36150608c1a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..495a96a7981 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..e6c621ebba3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..a9133981eee --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..05a8d288fbc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..10f1527eb37 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..dee0bbfe110 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package customoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..ef768a6e11a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..4b6a378e9f2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..b927fd7cb07 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_validationerror.go b/resource-manager/datamigration/2021-06-30/customoperation/model_validationerror.go new file mode 100644 index 00000000000..d70b8c464f2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_validationerror.go @@ -0,0 +1,9 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/customoperation/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/customoperation/model_waitstatistics.go new file mode 100644 index 00000000000..3ccd65e945a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/customoperation/model_waitstatistics.go @@ -0,0 +1,10 @@ +package customoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/delete/id_file.go b/resource-manager/datamigration/2021-06-30/delete/id_file.go index 6d842df0b26..55985ef3f00 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_file.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_file.go @@ -123,7 +123,7 @@ func (id FileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/delete/id_file_test.go b/resource-manager/datamigration/2021-06-30/delete/id_file_test.go index f08cf0fcdf6..4505477977f 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_file_test.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_file_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FileId{} func TestNewFileID(t *testing.T) { - id := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") + id := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewFileID(t *testing.T) { } func TestFormatFileID(t *testing.T) { - actual := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" + actual := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseFileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -122,7 +122,7 @@ func TestParseFileID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -298,15 +298,15 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", FileName: "fIlEnAmE", @@ -314,7 +314,7 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/delete/id_project.go b/resource-manager/datamigration/2021-06-30/delete/id_project.go index 8d2d7a52266..c843bcfe4cd 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_project.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/delete/id_project_test.go b/resource-manager/datamigration/2021-06-30/delete/id_project_test.go index ffb63989bf8..2ee87f3faec 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_project_test.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/delete/id_service.go b/resource-manager/datamigration/2021-06-30/delete/id_service.go index 27efb7d0c26..fe66bd222fd 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_service.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/delete/id_service_test.go b/resource-manager/datamigration/2021-06-30/delete/id_service_test.go index 06cebaf7c16..88203a1e41b 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/delete/id_servicetask.go b/resource-manager/datamigration/2021-06-30/delete/id_servicetask.go index 3d667b66048..e1cc85bd9dd 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_servicetask.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_servicetask.go @@ -117,13 +117,13 @@ func (id ServiceTaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticServiceTasks", "serviceTasks", "serviceTasks"), - resourceids.UserSpecifiedSegment("serviceTaskName", "taskName"), + resourceids.UserSpecifiedSegment("serviceTaskName", "serviceTaskName"), } } diff --git a/resource-manager/datamigration/2021-06-30/delete/id_servicetask_test.go b/resource-manager/datamigration/2021-06-30/delete/id_servicetask_test.go index 19074ccf599..ff9dedcc6a6 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_servicetask_test.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_servicetask_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ServiceTaskId{} func TestNewServiceTaskID(t *testing.T) { - id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") + id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.ServiceTaskName != "taskName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "taskName") + if id.ServiceTaskName != "serviceTaskName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "serviceTaskName") } } func TestFormatServiceTaskID(t *testing.T) { - actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName" + actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseServiceTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseServiceTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", - ServiceTaskName: "tAsKnAmE", + ServiceTaskName: "sErViCeTaSkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/delete/id_task.go b/resource-manager/datamigration/2021-06-30/delete/id_task.go index 4e35246d37a..0a5e80021d7 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_task.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/delete/id_task_test.go b/resource-manager/datamigration/2021-06-30/delete/id_task_test.go index abea991e722..356ed78b311 100644 --- a/resource-manager/datamigration/2021-06-30/delete/id_task_test.go +++ b/resource-manager/datamigration/2021-06-30/delete/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/fieresource/README.md b/resource-manager/datamigration/2021-06-30/fieresource/README.md index 27fa1cd1c87..63b8e6a95b0 100644 --- a/resource-manager/datamigration/2021-06-30/fieresource/README.md +++ b/resource-manager/datamigration/2021-06-30/fieresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fieresource.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := fieresource.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") payload := fieresource.ProjectFile{ // ... diff --git a/resource-manager/datamigration/2021-06-30/fieresource/id_file.go b/resource-manager/datamigration/2021-06-30/fieresource/id_file.go index 68a4eaadb80..d06ecb57be5 100644 --- a/resource-manager/datamigration/2021-06-30/fieresource/id_file.go +++ b/resource-manager/datamigration/2021-06-30/fieresource/id_file.go @@ -123,7 +123,7 @@ func (id FileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/fieresource/id_file_test.go b/resource-manager/datamigration/2021-06-30/fieresource/id_file_test.go index 928e5c100d0..d73431e5cef 100644 --- a/resource-manager/datamigration/2021-06-30/fieresource/id_file_test.go +++ b/resource-manager/datamigration/2021-06-30/fieresource/id_file_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FileId{} func TestNewFileID(t *testing.T) { - id := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") + id := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewFileID(t *testing.T) { } func TestFormatFileID(t *testing.T) { - actual := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" + actual := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseFileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -122,7 +122,7 @@ func TestParseFileID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -298,15 +298,15 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", FileName: "fIlEnAmE", @@ -314,7 +314,7 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/fileresource/README.md b/resource-manager/datamigration/2021-06-30/fileresource/README.md index 11ccb3736da..30c425b596a 100644 --- a/resource-manager/datamigration/2021-06-30/fileresource/README.md +++ b/resource-manager/datamigration/2021-06-30/fileresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesDelete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesGet(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := fileresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.FilesList(ctx, id)` can be used to do batched pagination items, err := client.FilesListComplete(ctx, id) @@ -73,7 +73,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesRead(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesReadWrite(ctx, id) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := fileresource.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") payload := fileresource.ProjectFile{ // ... diff --git a/resource-manager/datamigration/2021-06-30/fileresource/id_file.go b/resource-manager/datamigration/2021-06-30/fileresource/id_file.go index 5ecda9b9c79..0fae6c87717 100644 --- a/resource-manager/datamigration/2021-06-30/fileresource/id_file.go +++ b/resource-manager/datamigration/2021-06-30/fileresource/id_file.go @@ -123,7 +123,7 @@ func (id FileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/fileresource/id_file_test.go b/resource-manager/datamigration/2021-06-30/fileresource/id_file_test.go index 30bc6b7da44..f13b7e99adc 100644 --- a/resource-manager/datamigration/2021-06-30/fileresource/id_file_test.go +++ b/resource-manager/datamigration/2021-06-30/fileresource/id_file_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FileId{} func TestNewFileID(t *testing.T) { - id := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") + id := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewFileID(t *testing.T) { } func TestFormatFileID(t *testing.T) { - actual := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" + actual := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseFileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -122,7 +122,7 @@ func TestParseFileID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -298,15 +298,15 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", FileName: "fIlEnAmE", @@ -314,7 +314,7 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/fileresource/id_project.go b/resource-manager/datamigration/2021-06-30/fileresource/id_project.go index 3161493eee7..c9d99858f9d 100644 --- a/resource-manager/datamigration/2021-06-30/fileresource/id_project.go +++ b/resource-manager/datamigration/2021-06-30/fileresource/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/fileresource/id_project_test.go b/resource-manager/datamigration/2021-06-30/fileresource/id_project_test.go index 2a8fc2846c6..21a120e14af 100644 --- a/resource-manager/datamigration/2021-06-30/fileresource/id_project_test.go +++ b/resource-manager/datamigration/2021-06-30/fileresource/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/get/README.md b/resource-manager/datamigration/2021-06-30/get/README.md index b90025f34b1..8d5fd88d435 100644 --- a/resource-manager/datamigration/2021-06-30/get/README.md +++ b/resource-manager/datamigration/2021-06-30/get/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := get.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := get.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesGet(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.FilesList(ctx, id)` can be used to do batched pagination items, err := client.FilesListComplete(ctx, id) @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsGet(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ProjectsList(ctx, id)` can be used to do batched pagination items, err := client.ProjectsListComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := get.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") read, err := client.ServiceTasksGet(ctx, id, get.DefaultServiceTasksGetOperationOptions()) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServiceTasksList(ctx, id, get.DefaultServiceTasksListOperationOptions())` can be used to do batched pagination items, err := client.ServiceTasksListComplete(ctx, id, get.DefaultServiceTasksListOperationOptions()) @@ -141,7 +141,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -174,7 +174,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") +id := get.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") // alternatively `client.ServicesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ServicesListByResourceGroupComplete(ctx, id) @@ -191,7 +191,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := get.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServicesListSkus(ctx, id)` can be used to do batched pagination items, err := client.ServicesListSkusComplete(ctx, id) @@ -208,7 +208,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := get.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksGet(ctx, id, get.DefaultTasksGetOperationOptions()) if err != nil { @@ -224,7 +224,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := get.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.TasksList(ctx, id, get.DefaultTasksListOperationOptions())` can be used to do batched pagination items, err := client.TasksListComplete(ctx, id, get.DefaultTasksListOperationOptions()) @@ -241,7 +241,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := get.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := get.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.UsagesList(ctx, id)` can be used to do batched pagination items, err := client.UsagesListComplete(ctx, id) diff --git a/resource-manager/datamigration/2021-06-30/get/constants.go b/resource-manager/datamigration/2021-06-30/get/constants.go index 5b727fb5af3..c735de4c6de 100644 --- a/resource-manager/datamigration/2021-06-30/get/constants.go +++ b/resource-manager/datamigration/2021-06-30/get/constants.go @@ -9,6 +9,209 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( @@ -29,12 +232,1467 @@ func PossibleValuesForCommandState() []string { } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ProjectProvisioningState string + +const ( + ProjectProvisioningStateDeleting ProjectProvisioningState = "Deleting" + ProjectProvisioningStateSucceeded ProjectProvisioningState = "Succeeded" +) + +func PossibleValuesForProjectProvisioningState() []string { + return []string{ + string(ProjectProvisioningStateDeleting), + string(ProjectProvisioningStateSucceeded), + } +} + +func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectProvisioningState(input string) (*ProjectProvisioningState, error) { + vals := map[string]ProjectProvisioningState{ + "deleting": ProjectProvisioningStateDeleting, + "succeeded": ProjectProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectProvisioningState(input) + return &out, nil +} + +type ProjectSourcePlatform string + +const ( + ProjectSourcePlatformMongoDb ProjectSourcePlatform = "MongoDb" + ProjectSourcePlatformMySQL ProjectSourcePlatform = "MySQL" + ProjectSourcePlatformPostgreSql ProjectSourcePlatform = "PostgreSql" + ProjectSourcePlatformSQL ProjectSourcePlatform = "SQL" + ProjectSourcePlatformUnknown ProjectSourcePlatform = "Unknown" +) + +func PossibleValuesForProjectSourcePlatform() []string { + return []string{ + string(ProjectSourcePlatformMongoDb), + string(ProjectSourcePlatformMySQL), + string(ProjectSourcePlatformPostgreSql), + string(ProjectSourcePlatformSQL), + string(ProjectSourcePlatformUnknown), + } +} + +func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectSourcePlatform(input string) (*ProjectSourcePlatform, error) { + vals := map[string]ProjectSourcePlatform{ + "mongodb": ProjectSourcePlatformMongoDb, + "mysql": ProjectSourcePlatformMySQL, + "postgresql": ProjectSourcePlatformPostgreSql, + "sql": ProjectSourcePlatformSQL, + "unknown": ProjectSourcePlatformUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectSourcePlatform(input) + return &out, nil +} + +type ProjectTargetPlatform string + +const ( + ProjectTargetPlatformAzureDbForMySql ProjectTargetPlatform = "AzureDbForMySql" + ProjectTargetPlatformAzureDbForPostgreSql ProjectTargetPlatform = "AzureDbForPostgreSql" + ProjectTargetPlatformMongoDb ProjectTargetPlatform = "MongoDb" + ProjectTargetPlatformSQLDB ProjectTargetPlatform = "SQLDB" + ProjectTargetPlatformSQLMI ProjectTargetPlatform = "SQLMI" + ProjectTargetPlatformUnknown ProjectTargetPlatform = "Unknown" +) + +func PossibleValuesForProjectTargetPlatform() []string { + return []string{ + string(ProjectTargetPlatformAzureDbForMySql), + string(ProjectTargetPlatformAzureDbForPostgreSql), + string(ProjectTargetPlatformMongoDb), + string(ProjectTargetPlatformSQLDB), + string(ProjectTargetPlatformSQLMI), + string(ProjectTargetPlatformUnknown), + } +} + +func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectTargetPlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { + vals := map[string]ProjectTargetPlatform{ + "azuredbformysql": ProjectTargetPlatformAzureDbForMySql, + "azuredbforpostgresql": ProjectTargetPlatformAzureDbForPostgreSql, + "mongodb": ProjectTargetPlatformMongoDb, + "sqldb": ProjectTargetPlatformSQLDB, + "sqlmi": ProjectTargetPlatformSQLMI, + "unknown": ProjectTargetPlatformUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectTargetPlatform(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResourceSkuCapacityScaleType string + +const ( + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" +) + +func PossibleValuesForResourceSkuCapacityScaleType() []string { + return []string{ + string(ResourceSkuCapacityScaleTypeAutomatic), + string(ResourceSkuCapacityScaleTypeManual), + string(ResourceSkuCapacityScaleTypeNone), + } +} + +func (s *ResourceSkuCapacityScaleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceSkuCapacityScaleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceSkuCapacityScaleType(input string) (*ResourceSkuCapacityScaleType, error) { + vals := map[string]ResourceSkuCapacityScaleType{ + "automatic": ResourceSkuCapacityScaleTypeAutomatic, + "manual": ResourceSkuCapacityScaleTypeManual, + "none": ResourceSkuCapacityScaleTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuCapacityScaleType(input) + return &out, nil +} + +type ResourceSkuRestrictionsReasonCode string + +const ( + ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + ResourceSkuRestrictionsReasonCodeQuotaId ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +func PossibleValuesForResourceSkuRestrictionsReasonCode() []string { + return []string{ + string(ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription), + string(ResourceSkuRestrictionsReasonCodeQuotaId), + } +} + +func (s *ResourceSkuRestrictionsReasonCode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceSkuRestrictionsReasonCode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceSkuRestrictionsReasonCode(input string) (*ResourceSkuRestrictionsReasonCode, error) { + vals := map[string]ResourceSkuRestrictionsReasonCode{ + "notavailableforsubscription": ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription, + "quotaid": ResourceSkuRestrictionsReasonCodeQuotaId, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuRestrictionsReasonCode(input) + return &out, nil +} + +type ResourceSkuRestrictionsType string + +const ( + ResourceSkuRestrictionsTypeLocation ResourceSkuRestrictionsType = "location" +) + +func PossibleValuesForResourceSkuRestrictionsType() []string { + return []string{ + string(ResourceSkuRestrictionsTypeLocation), + } +} + +func (s *ResourceSkuRestrictionsType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceSkuRestrictionsType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceSkuRestrictionsType(input string) (*ResourceSkuRestrictionsType, error) { + vals := map[string]ResourceSkuRestrictionsType{ + "location": ResourceSkuRestrictionsTypeLocation, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuRestrictionsType(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type ServiceProvisioningState string + +const ( + ServiceProvisioningStateAccepted ServiceProvisioningState = "Accepted" + ServiceProvisioningStateDeleting ServiceProvisioningState = "Deleting" + ServiceProvisioningStateDeploying ServiceProvisioningState = "Deploying" + ServiceProvisioningStateFailed ServiceProvisioningState = "Failed" + ServiceProvisioningStateFailedToStart ServiceProvisioningState = "FailedToStart" + ServiceProvisioningStateFailedToStop ServiceProvisioningState = "FailedToStop" + ServiceProvisioningStateStarting ServiceProvisioningState = "Starting" + ServiceProvisioningStateStopped ServiceProvisioningState = "Stopped" + ServiceProvisioningStateStopping ServiceProvisioningState = "Stopping" + ServiceProvisioningStateSucceeded ServiceProvisioningState = "Succeeded" +) + +func PossibleValuesForServiceProvisioningState() []string { + return []string{ + string(ServiceProvisioningStateAccepted), + string(ServiceProvisioningStateDeleting), + string(ServiceProvisioningStateDeploying), + string(ServiceProvisioningStateFailed), + string(ServiceProvisioningStateFailedToStart), + string(ServiceProvisioningStateFailedToStop), + string(ServiceProvisioningStateStarting), + string(ServiceProvisioningStateStopped), + string(ServiceProvisioningStateStopping), + string(ServiceProvisioningStateSucceeded), + } +} + +func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseServiceProvisioningState(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,43 +1700,50 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseServiceProvisioningState(input string) (*ServiceProvisioningState, error) { + vals := map[string]ServiceProvisioningState{ + "accepted": ServiceProvisioningStateAccepted, + "deleting": ServiceProvisioningStateDeleting, + "deploying": ServiceProvisioningStateDeploying, + "failed": ServiceProvisioningStateFailed, + "failedtostart": ServiceProvisioningStateFailedToStart, + "failedtostop": ServiceProvisioningStateFailedToStop, + "starting": ServiceProvisioningStateStarting, + "stopped": ServiceProvisioningStateStopped, + "stopping": ServiceProvisioningStateStopping, + "succeeded": ServiceProvisioningStateSucceeded, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := ServiceProvisioningState(input) return &out, nil } -type ProjectProvisioningState string +type ServiceScalability string const ( - ProjectProvisioningStateDeleting ProjectProvisioningState = "Deleting" - ProjectProvisioningStateSucceeded ProjectProvisioningState = "Succeeded" + ServiceScalabilityAutomatic ServiceScalability = "automatic" + ServiceScalabilityManual ServiceScalability = "manual" + ServiceScalabilityNone ServiceScalability = "none" ) -func PossibleValuesForProjectProvisioningState() []string { +func PossibleValuesForServiceScalability() []string { return []string{ - string(ProjectProvisioningStateDeleting), - string(ProjectProvisioningStateSucceeded), + string(ServiceScalabilityAutomatic), + string(ServiceScalabilityManual), + string(ServiceScalabilityNone), } } -func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { +func (s *ServiceScalability) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectProvisioningState(decoded) + out, err := parseServiceScalability(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -86,46 +1751,43 @@ func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectProvisioningState(input string) (*ProjectProvisioningState, error) { - vals := map[string]ProjectProvisioningState{ - "deleting": ProjectProvisioningStateDeleting, - "succeeded": ProjectProvisioningStateSucceeded, +func parseServiceScalability(input string) (*ServiceScalability, error) { + vals := map[string]ServiceScalability{ + "automatic": ServiceScalabilityAutomatic, + "manual": ServiceScalabilityManual, + "none": ServiceScalabilityNone, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectProvisioningState(input) + out := ServiceScalability(input) return &out, nil } -type ProjectSourcePlatform string +type Severity string const ( - ProjectSourcePlatformMongoDb ProjectSourcePlatform = "MongoDb" - ProjectSourcePlatformMySQL ProjectSourcePlatform = "MySQL" - ProjectSourcePlatformPostgreSql ProjectSourcePlatform = "PostgreSql" - ProjectSourcePlatformSQL ProjectSourcePlatform = "SQL" - ProjectSourcePlatformUnknown ProjectSourcePlatform = "Unknown" + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" ) -func PossibleValuesForProjectSourcePlatform() []string { +func PossibleValuesForSeverity() []string { return []string{ - string(ProjectSourcePlatformMongoDb), - string(ProjectSourcePlatformMySQL), - string(ProjectSourcePlatformPostgreSql), - string(ProjectSourcePlatformSQL), - string(ProjectSourcePlatformUnknown), + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), } } -func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { +func (s *Severity) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectSourcePlatform(decoded) + out, err := parseSeverity(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -133,51 +1795,39 @@ func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectSourcePlatform(input string) (*ProjectSourcePlatform, error) { - vals := map[string]ProjectSourcePlatform{ - "mongodb": ProjectSourcePlatformMongoDb, - "mysql": ProjectSourcePlatformMySQL, - "postgresql": ProjectSourcePlatformPostgreSql, - "sql": ProjectSourcePlatformSQL, - "unknown": ProjectSourcePlatformUnknown, +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectSourcePlatform(input) + out := Severity(input) return &out, nil } -type ProjectTargetPlatform string +type SqlSourcePlatform string const ( - ProjectTargetPlatformAzureDbForMySql ProjectTargetPlatform = "AzureDbForMySql" - ProjectTargetPlatformAzureDbForPostgreSql ProjectTargetPlatform = "AzureDbForPostgreSql" - ProjectTargetPlatformMongoDb ProjectTargetPlatform = "MongoDb" - ProjectTargetPlatformSQLDB ProjectTargetPlatform = "SQLDB" - ProjectTargetPlatformSQLMI ProjectTargetPlatform = "SQLMI" - ProjectTargetPlatformUnknown ProjectTargetPlatform = "Unknown" + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" ) -func PossibleValuesForProjectTargetPlatform() []string { +func PossibleValuesForSqlSourcePlatform() []string { return []string{ - string(ProjectTargetPlatformAzureDbForMySql), - string(ProjectTargetPlatformAzureDbForPostgreSql), - string(ProjectTargetPlatformMongoDb), - string(ProjectTargetPlatformSQLDB), - string(ProjectTargetPlatformSQLMI), - string(ProjectTargetPlatformUnknown), + string(SqlSourcePlatformSqlOnPrem), } } -func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectTargetPlatform(decoded) + out, err := parseSqlSourcePlatform(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -185,46 +1835,39 @@ func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { - vals := map[string]ProjectTargetPlatform{ - "azuredbformysql": ProjectTargetPlatformAzureDbForMySql, - "azuredbforpostgresql": ProjectTargetPlatformAzureDbForPostgreSql, - "mongodb": ProjectTargetPlatformMongoDb, - "sqldb": ProjectTargetPlatformSQLDB, - "sqlmi": ProjectTargetPlatformSQLMI, - "unknown": ProjectTargetPlatformUnknown, +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectTargetPlatform(input) + out := SqlSourcePlatform(input) return &out, nil } -type ResourceSkuCapacityScaleType string +type SsisMigrationOverwriteOption string const ( - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" ) -func PossibleValuesForResourceSkuCapacityScaleType() []string { +func PossibleValuesForSsisMigrationOverwriteOption() []string { return []string{ - string(ResourceSkuCapacityScaleTypeAutomatic), - string(ResourceSkuCapacityScaleTypeManual), - string(ResourceSkuCapacityScaleTypeNone), + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), } } -func (s *ResourceSkuCapacityScaleType) UnmarshalJSON(bytes []byte) error { +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseResourceSkuCapacityScaleType(decoded) + out, err := parseSsisMigrationOverwriteOption(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -232,41 +1875,44 @@ func (s *ResourceSkuCapacityScaleType) UnmarshalJSON(bytes []byte) error { return nil } -func parseResourceSkuCapacityScaleType(input string) (*ResourceSkuCapacityScaleType, error) { - vals := map[string]ResourceSkuCapacityScaleType{ - "automatic": ResourceSkuCapacityScaleTypeAutomatic, - "manual": ResourceSkuCapacityScaleTypeManual, - "none": ResourceSkuCapacityScaleTypeNone, +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ResourceSkuCapacityScaleType(input) + out := SsisMigrationOverwriteOption(input) return &out, nil } -type ResourceSkuRestrictionsReasonCode string +type SsisMigrationStage string const ( - ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - ResourceSkuRestrictionsReasonCodeQuotaId ResourceSkuRestrictionsReasonCode = "QuotaId" + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" ) -func PossibleValuesForResourceSkuRestrictionsReasonCode() []string { +func PossibleValuesForSsisMigrationStage() []string { return []string{ - string(ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription), - string(ResourceSkuRestrictionsReasonCodeQuotaId), + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), } } -func (s *ResourceSkuRestrictionsReasonCode) UnmarshalJSON(bytes []byte) error { +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseResourceSkuRestrictionsReasonCode(decoded) + out, err := parseSsisMigrationStage(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -274,38 +1920,40 @@ func (s *ResourceSkuRestrictionsReasonCode) UnmarshalJSON(bytes []byte) error { return nil } -func parseResourceSkuRestrictionsReasonCode(input string) (*ResourceSkuRestrictionsReasonCode, error) { - vals := map[string]ResourceSkuRestrictionsReasonCode{ - "notavailableforsubscription": ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription, - "quotaid": ResourceSkuRestrictionsReasonCodeQuotaId, +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ResourceSkuRestrictionsReasonCode(input) + out := SsisMigrationStage(input) return &out, nil } -type ResourceSkuRestrictionsType string +type SsisStoreType string const ( - ResourceSkuRestrictionsTypeLocation ResourceSkuRestrictionsType = "location" + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" ) -func PossibleValuesForResourceSkuRestrictionsType() []string { +func PossibleValuesForSsisStoreType() []string { return []string{ - string(ResourceSkuRestrictionsTypeLocation), + string(SsisStoreTypeSsisCatalog), } } -func (s *ResourceSkuRestrictionsType) UnmarshalJSON(bytes []byte) error { +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseResourceSkuRestrictionsType(decoded) + out, err := parseSsisStoreType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -313,55 +1961,71 @@ func (s *ResourceSkuRestrictionsType) UnmarshalJSON(bytes []byte) error { return nil } -func parseResourceSkuRestrictionsType(input string) (*ResourceSkuRestrictionsType, error) { - vals := map[string]ResourceSkuRestrictionsType{ - "location": ResourceSkuRestrictionsTypeLocation, +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ResourceSkuRestrictionsType(input) + out := SsisStoreType(input) return &out, nil } -type ServiceProvisioningState string +type SyncDatabaseMigrationReportingState string const ( - ServiceProvisioningStateAccepted ServiceProvisioningState = "Accepted" - ServiceProvisioningStateDeleting ServiceProvisioningState = "Deleting" - ServiceProvisioningStateDeploying ServiceProvisioningState = "Deploying" - ServiceProvisioningStateFailed ServiceProvisioningState = "Failed" - ServiceProvisioningStateFailedToStart ServiceProvisioningState = "FailedToStart" - ServiceProvisioningStateFailedToStop ServiceProvisioningState = "FailedToStop" - ServiceProvisioningStateStarting ServiceProvisioningState = "Starting" - ServiceProvisioningStateStopped ServiceProvisioningState = "Stopped" - ServiceProvisioningStateStopping ServiceProvisioningState = "Stopping" - ServiceProvisioningStateSucceeded ServiceProvisioningState = "Succeeded" + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" ) -func PossibleValuesForServiceProvisioningState() []string { +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { return []string{ - string(ServiceProvisioningStateAccepted), - string(ServiceProvisioningStateDeleting), - string(ServiceProvisioningStateDeploying), - string(ServiceProvisioningStateFailed), - string(ServiceProvisioningStateFailedToStart), - string(ServiceProvisioningStateFailedToStop), - string(ServiceProvisioningStateStarting), - string(ServiceProvisioningStateStopped), - string(ServiceProvisioningStateStopping), - string(ServiceProvisioningStateSucceeded), + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), } } -func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseServiceProvisioningState(decoded) + out, err := parseSyncDatabaseMigrationReportingState(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -369,50 +2033,64 @@ func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { return nil } -func parseServiceProvisioningState(input string) (*ServiceProvisioningState, error) { - vals := map[string]ServiceProvisioningState{ - "accepted": ServiceProvisioningStateAccepted, - "deleting": ServiceProvisioningStateDeleting, - "deploying": ServiceProvisioningStateDeploying, - "failed": ServiceProvisioningStateFailed, - "failedtostart": ServiceProvisioningStateFailedToStart, - "failedtostop": ServiceProvisioningStateFailedToStop, - "starting": ServiceProvisioningStateStarting, - "stopped": ServiceProvisioningStateStopped, - "stopping": ServiceProvisioningStateStopping, - "succeeded": ServiceProvisioningStateSucceeded, +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ServiceProvisioningState(input) + out := SyncDatabaseMigrationReportingState(input) return &out, nil } -type ServiceScalability string +type SyncTableMigrationState string const ( - ServiceScalabilityAutomatic ServiceScalability = "automatic" - ServiceScalabilityManual ServiceScalability = "manual" - ServiceScalabilityNone ServiceScalability = "none" + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" ) -func PossibleValuesForServiceScalability() []string { +func PossibleValuesForSyncTableMigrationState() []string { return []string{ - string(ServiceScalabilityAutomatic), - string(ServiceScalabilityManual), - string(ServiceScalabilityNone), + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), } } -func (s *ServiceScalability) UnmarshalJSON(bytes []byte) error { +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseServiceScalability(decoded) + out, err := parseSyncTableMigrationState(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -420,18 +2098,21 @@ func (s *ServiceScalability) UnmarshalJSON(bytes []byte) error { return nil } -func parseServiceScalability(input string) (*ServiceScalability, error) { - vals := map[string]ServiceScalability{ - "automatic": ServiceScalabilityAutomatic, - "manual": ServiceScalabilityManual, - "none": ServiceScalabilityNone, +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ServiceScalability(input) + out := SyncTableMigrationState(input) return &out, nil } @@ -493,3 +2174,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/id_file.go b/resource-manager/datamigration/2021-06-30/get/id_file.go index 0b1f8365d63..2452146b04e 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_file.go +++ b/resource-manager/datamigration/2021-06-30/get/id_file.go @@ -123,7 +123,7 @@ func (id FileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/get/id_file_test.go b/resource-manager/datamigration/2021-06-30/get/id_file_test.go index d159a562eb7..4770c4fed7d 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_file_test.go +++ b/resource-manager/datamigration/2021-06-30/get/id_file_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FileId{} func TestNewFileID(t *testing.T) { - id := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") + id := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewFileID(t *testing.T) { } func TestFormatFileID(t *testing.T) { - actual := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" + actual := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseFileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -122,7 +122,7 @@ func TestParseFileID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -298,15 +298,15 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", FileName: "fIlEnAmE", @@ -314,7 +314,7 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/get/id_location.go b/resource-manager/datamigration/2021-06-30/get/id_location.go index ddb540ba64b..ab70e2e0fa9 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_location.go +++ b/resource-manager/datamigration/2021-06-30/get/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datamigration/2021-06-30/get/id_location_test.go b/resource-manager/datamigration/2021-06-30/get/id_location_test.go index 10403bfa52b..b7f8e4c25dc 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_location_test.go +++ b/resource-manager/datamigration/2021-06-30/get/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/get/id_project.go b/resource-manager/datamigration/2021-06-30/get/id_project.go index 939e8067942..878ba8e4c36 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_project.go +++ b/resource-manager/datamigration/2021-06-30/get/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/get/id_project_test.go b/resource-manager/datamigration/2021-06-30/get/id_project_test.go index 0d8499595e7..4c8ac6f6a0b 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_project_test.go +++ b/resource-manager/datamigration/2021-06-30/get/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/get/id_resourcegroup.go b/resource-manager/datamigration/2021-06-30/get/id_resourcegroup.go index 238bff15a0c..0fcb21412aa 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_resourcegroup.go +++ b/resource-manager/datamigration/2021-06-30/get/id_resourcegroup.go @@ -105,7 +105,7 @@ func (id ResourceGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), } } diff --git a/resource-manager/datamigration/2021-06-30/get/id_resourcegroup_test.go b/resource-manager/datamigration/2021-06-30/get/id_resourcegroup_test.go index b489f393916..acb009febd3 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_resourcegroup_test.go +++ b/resource-manager/datamigration/2021-06-30/get/id_resourcegroup_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ResourceGroupId{} func TestNewResourceGroupID(t *testing.T) { - id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") + id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } } func TestFormatResourceGroupID(t *testing.T) { - actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName" + actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseResourceGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/get/id_service.go b/resource-manager/datamigration/2021-06-30/get/id_service.go index fb22ad8968f..8c6bf2fcad1 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_service.go +++ b/resource-manager/datamigration/2021-06-30/get/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/get/id_service_test.go b/resource-manager/datamigration/2021-06-30/get/id_service_test.go index befcb2ddd47..3efb76b7aec 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/get/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/get/id_servicetask.go b/resource-manager/datamigration/2021-06-30/get/id_servicetask.go index 3ad4c0dd58e..0a837a71c78 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_servicetask.go +++ b/resource-manager/datamigration/2021-06-30/get/id_servicetask.go @@ -117,13 +117,13 @@ func (id ServiceTaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticServiceTasks", "serviceTasks", "serviceTasks"), - resourceids.UserSpecifiedSegment("serviceTaskName", "taskName"), + resourceids.UserSpecifiedSegment("serviceTaskName", "serviceTaskName"), } } diff --git a/resource-manager/datamigration/2021-06-30/get/id_servicetask_test.go b/resource-manager/datamigration/2021-06-30/get/id_servicetask_test.go index 465b11ab3c2..aa194349780 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_servicetask_test.go +++ b/resource-manager/datamigration/2021-06-30/get/id_servicetask_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ServiceTaskId{} func TestNewServiceTaskID(t *testing.T) { - id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") + id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.ServiceTaskName != "taskName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "taskName") + if id.ServiceTaskName != "serviceTaskName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "serviceTaskName") } } func TestFormatServiceTaskID(t *testing.T) { - actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName" + actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseServiceTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseServiceTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", - ServiceTaskName: "tAsKnAmE", + ServiceTaskName: "sErViCeTaSkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/get/id_task.go b/resource-manager/datamigration/2021-06-30/get/id_task.go index 09a236b2ad4..fee837d3d29 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_task.go +++ b/resource-manager/datamigration/2021-06-30/get/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/get/id_task_test.go b/resource-manager/datamigration/2021-06-30/get/id_task_test.go index 9952316e9ce..8e28ca4487a 100644 --- a/resource-manager/datamigration/2021-06-30/get/id_task_test.go +++ b/resource-manager/datamigration/2021-06-30/get/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/get/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/get/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..61b2bb36595 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/get/model_backupfileinfo.go new file mode 100644 index 00000000000..3df26127c30 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/get/model_backupsetinfo.go new file mode 100644 index 00000000000..bd399c22a81 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_blobshare.go b/resource-manager/datamigration/2021-06-30/get/model_blobshare.go new file mode 100644 index 00000000000..f0fbafad2d9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_blobshare.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/get/model_commandproperties.go index 11a89f8ea71..628d6122d6c 100644 --- a/resource-manager/datamigration/2021-06-30/get/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/get/model_commandproperties.go @@ -1,10 +1,85 @@ package get +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/get/model_connectioninfo.go index fb79fd4b89e..17449325861 100644 --- a/resource-manager/datamigration/2021-06-30/get/model_connectioninfo.go +++ b/resource-manager/datamigration/2021-06-30/get/model_connectioninfo.go @@ -1,10 +1,117 @@ package get +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "mongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..ca070cbcae8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..3b8ea048862 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..cf3037e88fc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..407cc650e74 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..ce9cd02a769 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..668067f52b4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..5c5181528dd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..1fc0ca23f09 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..56d507f1aaa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..998166a09ff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..b7abcb9bbb5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..b138358dc29 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..dd441654587 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..674e52eaf98 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..bf8bf0f5edd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..8473b27cbb2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..8c9fa2de18a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..0f01ac3ea87 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..37bda42a76e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..a4cde62d720 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..4f5934230b0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..2967272813a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..f3c9a5f9289 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..7aff6ab89b6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..170b46627f0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..08c5a85b9ac --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..b40ad698ac3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..a1a18d532c4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..360376306f2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..d233f43ed77 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..b9a51e6b954 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..d74b8fd9a6b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..9def55861c1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..d4cd2c03ba5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..1989a72d573 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..11208b2136d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..8e34137239c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..8c67c1fb8c7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..c4a7e9a2179 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/get/model_databasebackupinfo.go new file mode 100644 index 00000000000..2523bdeadf6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/get/model_databasefileinfo.go new file mode 100644 index 00000000000..dbb87c80ae8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/get/model_databasesummaryresult.go new file mode 100644 index 00000000000..2e3e1b08d11 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_databasetable.go b/resource-manager/datamigration/2021-06-30/get/model_databasetable.go new file mode 100644 index 00000000000..7646d8cf0cd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_databasetable.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/get/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..ab39c33b81b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/get/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..942e2720261 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/get/model_executionstatistics.go new file mode 100644 index 00000000000..7432b2ffe30 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_executionstatistics.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_fileshare.go b/resource-manager/datamigration/2021-06-30/get/model_fileshare.go new file mode 100644 index 00000000000..2a845f18148 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_fileshare.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..c08db1e2c4d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..8a67e4d5258 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..13b1ce8cd18 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..8cf5b80a1ab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..44fd5d3f57d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..2abe0160350 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..6923cb52c7c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..78812a83a6a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..c12d0469532 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..f9358e54f49 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..6db36f946a4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..a511d31bd9e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..207067221f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..31599103639 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..64a1fbd8a1e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..a3c14438187 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..661031b0495 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..d246f1dad44 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..83668ff35a5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..5a60db3772f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..d2c157a41fa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..d124e5fe0e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..ab4492bde80 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..8654b644a38 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..ba292099fff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..6984499371c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..6a978aa60cb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..4810207bdcc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..9d452e13e55 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..851e2746a4c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..f03aaee9574 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..1ad912aa20b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..0fe3e3439e1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..50ebb3dcf93 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..da389f30818 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..a426b4c92de --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..2eec293906f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..311b9ac373a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..c3788c9c7c4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..00cfd3d021d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..cf6a1070f53 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..b97c45a8558 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..de5304a4547 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..f94c48d9305 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..76de557c2f6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..9ed3cfcc11f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..d9082448f5b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..28187263a97 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..96679093054 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..51c9727d5b9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..9d0d7fb1b8c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..f5a3b75c8c1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..e4b7025f5be --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..483d35473b4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..952ada81bd6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e62f6e8d061 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..349b4c39b1e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..58a652db79d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..7397dc057d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..ac140fbc3ee --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..c845d0c09a6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..7691aa52be3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..b92ba4e1f11 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..df6ac039aa4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..800fb4830a3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..fddc9e7cd28 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..0869f964bb3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..10b9c5a8f86 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..2a8c7627ec3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..75c2d31f454 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..058d7711172 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..9c6a4b3cbf1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..fd85e5ab407 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..bc36474d7b3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..450ab2e4aff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..457a99f022e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..6792eeba206 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..b4e119554f0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..662ae804b14 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..99fa121b786 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..82c70ad4cb3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..dfd5409d0f6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..774c6e91e86 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..bc68d80deea --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..31b3413894d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..bf71184a7d0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..bd2eb517dd6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..1b8e358009a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..f37e84ab5c2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..40bd359b70a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..6d5390b0926 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskinput.go new file mode 100644 index 00000000000..d5c8079a0cf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutput.go new file mode 100644 index 00000000000..8be79def961 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..ca526cd649e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..1b0fc08442d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskproperties.go new file mode 100644 index 00000000000..945d9172744 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..166810ce0e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..4439f70e1ba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..75a1d98e322 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/get/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..713478d9be8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/get/model_migrationreportresult.go new file mode 100644 index 00000000000..d32635884d6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..fff75667d6c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package get + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..cc5ee41ace8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationresult.go new file mode 100644 index 00000000000..029880e610f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/get/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..967feb30344 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..94cbca8aa8e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..b9c35fdcf96 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..822da2e8f56 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package get + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..b601e165605 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..e186e5fe8d9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "mongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..8c7429fb8ca --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..a2dd1e538d8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package get + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..105d54ea31a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/get/model_mongodberror.go new file mode 100644 index 00000000000..b20d9656133 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodberror.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..daa41f8144f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package get + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..45425b1f8a7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbprogress.go new file mode 100644 index 00000000000..47da0cc7646 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package get + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..35831b82363 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..f9b93ab1e76 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..5afb4d003e1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/get/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..46197ed83cf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/get/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..5aa04838fb5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/get/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..faa991b638f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/get/model_orphaneduserinfo.go new file mode 100644 index 00000000000..20cac083d19 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/get/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..40ef16ae60d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_projectproperties.go b/resource-manager/datamigration/2021-06-30/get/model_projectproperties.go index 531a0d0a0c9..b66fbbab0c9 100644 --- a/resource-manager/datamigration/2021-06-30/get/model_projectproperties.go +++ b/resource-manager/datamigration/2021-06-30/get/model_projectproperties.go @@ -1,6 +1,8 @@ package get import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_projecttask.go b/resource-manager/datamigration/2021-06-30/get/model_projecttask.go index 3759c6ecd4e..ce137fa8d6a 100644 --- a/resource-manager/datamigration/2021-06-30/get/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/get/model_projecttask.go @@ -1,6 +1,9 @@ package get import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_projecttaskproperties.go index 97dda4222e1..f540dedfc5b 100644 --- a/resource-manager/datamigration/2021-06-30/get/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/get/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package get +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/get/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..6d3e0732de2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/get/model_queryexecutionresult.go new file mode 100644 index 00000000000..7d508040231 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/get/model_reportableexception.go new file mode 100644 index 00000000000..9897733972f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_reportableexception.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/get/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..450e14e555c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/get/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..a6eb932d29d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/get/model_selectedcertificateinput.go new file mode 100644 index 00000000000..e4f03a1ac93 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/get/model_serverproperties.go new file mode 100644 index 00000000000..098c5abad12 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_serverproperties.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/get/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..53509644d33 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..b863e4700e8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/get/model_ssismigrationinfo.go new file mode 100644 index 00000000000..236005a2f9d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/get/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..5cc7df5b00d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/get/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..4dfc9866b8f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..5262ba007e8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..681cb6c7b3e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..0c9567c2d19 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..9a1f0533131 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..86db7f747d2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..3bdfbb7f30f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..e8d1901daaf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/get/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..95507a6d609 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package get + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..cb3125fe455 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/get/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..22a3f3b4b20 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/get/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..4b1dbf58c38 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_validationerror.go b/resource-manager/datamigration/2021-06-30/get/model_validationerror.go new file mode 100644 index 00000000000..c3eb5dec554 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_validationerror.go @@ -0,0 +1,9 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/get/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/get/model_waitstatistics.go new file mode 100644 index 00000000000..d4f100bf792 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/get/model_waitstatistics.go @@ -0,0 +1,10 @@ +package get + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/README.md b/resource-manager/datamigration/2021-06-30/patch/README.md index 03c2e4c5a3b..63061f012ea 100644 --- a/resource-manager/datamigration/2021-06-30/patch/README.md +++ b/resource-manager/datamigration/2021-06-30/patch/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := patch.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := patch.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") payload := patch.ProjectFile{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patch.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := patch.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := patch.Project{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patch.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := patch.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") payload := patch.ProjectTask{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patch.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := patch.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := patch.DataMigrationService{ // ... @@ -104,7 +104,7 @@ if err := client.ServicesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := patch.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := patch.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := patch.ProjectTask{ // ... diff --git a/resource-manager/datamigration/2021-06-30/patch/constants.go b/resource-manager/datamigration/2021-06-30/patch/constants.go index 7c3a8822a47..9e1dcafb84e 100644 --- a/resource-manager/datamigration/2021-06-30/patch/constants.go +++ b/resource-manager/datamigration/2021-06-30/patch/constants.go @@ -9,32 +9,1618 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ProjectProvisioningState string + +const ( + ProjectProvisioningStateDeleting ProjectProvisioningState = "Deleting" + ProjectProvisioningStateSucceeded ProjectProvisioningState = "Succeeded" +) + +func PossibleValuesForProjectProvisioningState() []string { + return []string{ + string(ProjectProvisioningStateDeleting), + string(ProjectProvisioningStateSucceeded), + } +} + +func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectProvisioningState(input string) (*ProjectProvisioningState, error) { + vals := map[string]ProjectProvisioningState{ + "deleting": ProjectProvisioningStateDeleting, + "succeeded": ProjectProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectProvisioningState(input) + return &out, nil +} + +type ProjectSourcePlatform string + +const ( + ProjectSourcePlatformMongoDb ProjectSourcePlatform = "MongoDb" + ProjectSourcePlatformMySQL ProjectSourcePlatform = "MySQL" + ProjectSourcePlatformPostgreSql ProjectSourcePlatform = "PostgreSql" + ProjectSourcePlatformSQL ProjectSourcePlatform = "SQL" + ProjectSourcePlatformUnknown ProjectSourcePlatform = "Unknown" +) + +func PossibleValuesForProjectSourcePlatform() []string { + return []string{ + string(ProjectSourcePlatformMongoDb), + string(ProjectSourcePlatformMySQL), + string(ProjectSourcePlatformPostgreSql), + string(ProjectSourcePlatformSQL), + string(ProjectSourcePlatformUnknown), + } +} + +func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectSourcePlatform(input string) (*ProjectSourcePlatform, error) { + vals := map[string]ProjectSourcePlatform{ + "mongodb": ProjectSourcePlatformMongoDb, + "mysql": ProjectSourcePlatformMySQL, + "postgresql": ProjectSourcePlatformPostgreSql, + "sql": ProjectSourcePlatformSQL, + "unknown": ProjectSourcePlatformUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectSourcePlatform(input) + return &out, nil +} + +type ProjectTargetPlatform string + +const ( + ProjectTargetPlatformAzureDbForMySql ProjectTargetPlatform = "AzureDbForMySql" + ProjectTargetPlatformAzureDbForPostgreSql ProjectTargetPlatform = "AzureDbForPostgreSql" + ProjectTargetPlatformMongoDb ProjectTargetPlatform = "MongoDb" + ProjectTargetPlatformSQLDB ProjectTargetPlatform = "SQLDB" + ProjectTargetPlatformSQLMI ProjectTargetPlatform = "SQLMI" + ProjectTargetPlatformUnknown ProjectTargetPlatform = "Unknown" +) + +func PossibleValuesForProjectTargetPlatform() []string { + return []string{ + string(ProjectTargetPlatformAzureDbForMySql), + string(ProjectTargetPlatformAzureDbForPostgreSql), + string(ProjectTargetPlatformMongoDb), + string(ProjectTargetPlatformSQLDB), + string(ProjectTargetPlatformSQLMI), + string(ProjectTargetPlatformUnknown), + } +} + +func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectTargetPlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { + vals := map[string]ProjectTargetPlatform{ + "azuredbformysql": ProjectTargetPlatformAzureDbForMySql, + "azuredbforpostgresql": ProjectTargetPlatformAzureDbForPostgreSql, + "mongodb": ProjectTargetPlatformMongoDb, + "sqldb": ProjectTargetPlatformSQLDB, + "sqlmi": ProjectTargetPlatformSQLMI, + "unknown": ProjectTargetPlatformUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectTargetPlatform(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type ServiceProvisioningState string + +const ( + ServiceProvisioningStateAccepted ServiceProvisioningState = "Accepted" + ServiceProvisioningStateDeleting ServiceProvisioningState = "Deleting" + ServiceProvisioningStateDeploying ServiceProvisioningState = "Deploying" + ServiceProvisioningStateFailed ServiceProvisioningState = "Failed" + ServiceProvisioningStateFailedToStart ServiceProvisioningState = "FailedToStart" + ServiceProvisioningStateFailedToStop ServiceProvisioningState = "FailedToStop" + ServiceProvisioningStateStarting ServiceProvisioningState = "Starting" + ServiceProvisioningStateStopped ServiceProvisioningState = "Stopped" + ServiceProvisioningStateStopping ServiceProvisioningState = "Stopping" + ServiceProvisioningStateSucceeded ServiceProvisioningState = "Succeeded" +) + +func PossibleValuesForServiceProvisioningState() []string { + return []string{ + string(ServiceProvisioningStateAccepted), + string(ServiceProvisioningStateDeleting), + string(ServiceProvisioningStateDeploying), + string(ServiceProvisioningStateFailed), + string(ServiceProvisioningStateFailedToStart), + string(ServiceProvisioningStateFailedToStop), + string(ServiceProvisioningStateStarting), + string(ServiceProvisioningStateStopped), + string(ServiceProvisioningStateStopping), + string(ServiceProvisioningStateSucceeded), + } +} + +func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceProvisioningState(input string) (*ServiceProvisioningState, error) { + vals := map[string]ServiceProvisioningState{ + "accepted": ServiceProvisioningStateAccepted, + "deleting": ServiceProvisioningStateDeleting, + "deploying": ServiceProvisioningStateDeploying, + "failed": ServiceProvisioningStateFailed, + "failedtostart": ServiceProvisioningStateFailedToStart, + "failedtostop": ServiceProvisioningStateFailedToStop, + "starting": ServiceProvisioningStateStarting, + "stopped": ServiceProvisioningStateStopped, + "stopping": ServiceProvisioningStateStopping, + "succeeded": ServiceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceProvisioningState(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForSeverity() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *Severity) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseSeverity(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,43 +1628,39 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := Severity(input) return &out, nil } -type ProjectProvisioningState string +type SqlSourcePlatform string const ( - ProjectProvisioningStateDeleting ProjectProvisioningState = "Deleting" - ProjectProvisioningStateSucceeded ProjectProvisioningState = "Succeeded" + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" ) -func PossibleValuesForProjectProvisioningState() []string { +func PossibleValuesForSqlSourcePlatform() []string { return []string{ - string(ProjectProvisioningStateDeleting), - string(ProjectProvisioningStateSucceeded), + string(SqlSourcePlatformSqlOnPrem), } } -func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectProvisioningState(decoded) + out, err := parseSqlSourcePlatform(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -86,46 +1668,39 @@ func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectProvisioningState(input string) (*ProjectProvisioningState, error) { - vals := map[string]ProjectProvisioningState{ - "deleting": ProjectProvisioningStateDeleting, - "succeeded": ProjectProvisioningStateSucceeded, +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectProvisioningState(input) + out := SqlSourcePlatform(input) return &out, nil } -type ProjectSourcePlatform string +type SsisMigrationOverwriteOption string const ( - ProjectSourcePlatformMongoDb ProjectSourcePlatform = "MongoDb" - ProjectSourcePlatformMySQL ProjectSourcePlatform = "MySQL" - ProjectSourcePlatformPostgreSql ProjectSourcePlatform = "PostgreSql" - ProjectSourcePlatformSQL ProjectSourcePlatform = "SQL" - ProjectSourcePlatformUnknown ProjectSourcePlatform = "Unknown" + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" ) -func PossibleValuesForProjectSourcePlatform() []string { +func PossibleValuesForSsisMigrationOverwriteOption() []string { return []string{ - string(ProjectSourcePlatformMongoDb), - string(ProjectSourcePlatformMySQL), - string(ProjectSourcePlatformPostgreSql), - string(ProjectSourcePlatformSQL), - string(ProjectSourcePlatformUnknown), + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), } } -func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectSourcePlatform(decoded) + out, err := parseSsisMigrationOverwriteOption(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -133,51 +1708,44 @@ func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectSourcePlatform(input string) (*ProjectSourcePlatform, error) { - vals := map[string]ProjectSourcePlatform{ - "mongodb": ProjectSourcePlatformMongoDb, - "mysql": ProjectSourcePlatformMySQL, - "postgresql": ProjectSourcePlatformPostgreSql, - "sql": ProjectSourcePlatformSQL, - "unknown": ProjectSourcePlatformUnknown, +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectSourcePlatform(input) + out := SsisMigrationOverwriteOption(input) return &out, nil } -type ProjectTargetPlatform string +type SsisMigrationStage string const ( - ProjectTargetPlatformAzureDbForMySql ProjectTargetPlatform = "AzureDbForMySql" - ProjectTargetPlatformAzureDbForPostgreSql ProjectTargetPlatform = "AzureDbForPostgreSql" - ProjectTargetPlatformMongoDb ProjectTargetPlatform = "MongoDb" - ProjectTargetPlatformSQLDB ProjectTargetPlatform = "SQLDB" - ProjectTargetPlatformSQLMI ProjectTargetPlatform = "SQLMI" - ProjectTargetPlatformUnknown ProjectTargetPlatform = "Unknown" + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" ) -func PossibleValuesForProjectTargetPlatform() []string { +func PossibleValuesForSsisMigrationStage() []string { return []string{ - string(ProjectTargetPlatformAzureDbForMySql), - string(ProjectTargetPlatformAzureDbForPostgreSql), - string(ProjectTargetPlatformMongoDb), - string(ProjectTargetPlatformSQLDB), - string(ProjectTargetPlatformSQLMI), - string(ProjectTargetPlatformUnknown), + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), } } -func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectTargetPlatform(decoded) + out, err := parseSsisMigrationStage(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -185,60 +1753,40 @@ func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { - vals := map[string]ProjectTargetPlatform{ - "azuredbformysql": ProjectTargetPlatformAzureDbForMySql, - "azuredbforpostgresql": ProjectTargetPlatformAzureDbForPostgreSql, - "mongodb": ProjectTargetPlatformMongoDb, - "sqldb": ProjectTargetPlatformSQLDB, - "sqlmi": ProjectTargetPlatformSQLMI, - "unknown": ProjectTargetPlatformUnknown, +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectTargetPlatform(input) + out := SsisMigrationStage(input) return &out, nil } -type ServiceProvisioningState string +type SsisStoreType string const ( - ServiceProvisioningStateAccepted ServiceProvisioningState = "Accepted" - ServiceProvisioningStateDeleting ServiceProvisioningState = "Deleting" - ServiceProvisioningStateDeploying ServiceProvisioningState = "Deploying" - ServiceProvisioningStateFailed ServiceProvisioningState = "Failed" - ServiceProvisioningStateFailedToStart ServiceProvisioningState = "FailedToStart" - ServiceProvisioningStateFailedToStop ServiceProvisioningState = "FailedToStop" - ServiceProvisioningStateStarting ServiceProvisioningState = "Starting" - ServiceProvisioningStateStopped ServiceProvisioningState = "Stopped" - ServiceProvisioningStateStopping ServiceProvisioningState = "Stopping" - ServiceProvisioningStateSucceeded ServiceProvisioningState = "Succeeded" + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" ) -func PossibleValuesForServiceProvisioningState() []string { +func PossibleValuesForSsisStoreType() []string { return []string{ - string(ServiceProvisioningStateAccepted), - string(ServiceProvisioningStateDeleting), - string(ServiceProvisioningStateDeploying), - string(ServiceProvisioningStateFailed), - string(ServiceProvisioningStateFailedToStart), - string(ServiceProvisioningStateFailedToStop), - string(ServiceProvisioningStateStarting), - string(ServiceProvisioningStateStopped), - string(ServiceProvisioningStateStopping), - string(ServiceProvisioningStateSucceeded), + string(SsisStoreTypeSsisCatalog), } } -func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseServiceProvisioningState(decoded) + out, err := parseSsisStoreType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -246,25 +1794,158 @@ func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { return nil } -func parseServiceProvisioningState(input string) (*ServiceProvisioningState, error) { - vals := map[string]ServiceProvisioningState{ - "accepted": ServiceProvisioningStateAccepted, - "deleting": ServiceProvisioningStateDeleting, - "deploying": ServiceProvisioningStateDeploying, - "failed": ServiceProvisioningStateFailed, - "failedtostart": ServiceProvisioningStateFailedToStart, - "failedtostop": ServiceProvisioningStateFailedToStop, - "starting": ServiceProvisioningStateStarting, - "stopped": ServiceProvisioningStateStopped, - "stopping": ServiceProvisioningStateStopping, - "succeeded": ServiceProvisioningStateSucceeded, +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ServiceProvisioningState(input) + out := SsisStoreType(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) return &out, nil } @@ -326,3 +2007,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/id_file.go b/resource-manager/datamigration/2021-06-30/patch/id_file.go index 4060e325420..a679d5d46c3 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_file.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_file.go @@ -123,7 +123,7 @@ func (id FileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/patch/id_file_test.go b/resource-manager/datamigration/2021-06-30/patch/id_file_test.go index 5fe4bd73515..675641dd7e0 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_file_test.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_file_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FileId{} func TestNewFileID(t *testing.T) { - id := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") + id := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewFileID(t *testing.T) { } func TestFormatFileID(t *testing.T) { - actual := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" + actual := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseFileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -122,7 +122,7 @@ func TestParseFileID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -298,15 +298,15 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", FileName: "fIlEnAmE", @@ -314,7 +314,7 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/patch/id_project.go b/resource-manager/datamigration/2021-06-30/patch/id_project.go index 65ed4da575c..4455c74fa01 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_project.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/patch/id_project_test.go b/resource-manager/datamigration/2021-06-30/patch/id_project_test.go index cfa4b5e5685..4241cec2b9a 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_project_test.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/patch/id_service.go b/resource-manager/datamigration/2021-06-30/patch/id_service.go index 15b661e406c..66242c253dc 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_service.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/patch/id_service_test.go b/resource-manager/datamigration/2021-06-30/patch/id_service_test.go index d67235874cc..3f6a5707ccc 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/patch/id_servicetask.go b/resource-manager/datamigration/2021-06-30/patch/id_servicetask.go index 31d8c7fd51a..67c3bfd19a2 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_servicetask.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_servicetask.go @@ -117,13 +117,13 @@ func (id ServiceTaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticServiceTasks", "serviceTasks", "serviceTasks"), - resourceids.UserSpecifiedSegment("serviceTaskName", "taskName"), + resourceids.UserSpecifiedSegment("serviceTaskName", "serviceTaskName"), } } diff --git a/resource-manager/datamigration/2021-06-30/patch/id_servicetask_test.go b/resource-manager/datamigration/2021-06-30/patch/id_servicetask_test.go index c57e445a37b..963e198d9cd 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_servicetask_test.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_servicetask_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ServiceTaskId{} func TestNewServiceTaskID(t *testing.T) { - id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") + id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.ServiceTaskName != "taskName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "taskName") + if id.ServiceTaskName != "serviceTaskName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "serviceTaskName") } } func TestFormatServiceTaskID(t *testing.T) { - actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName" + actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseServiceTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseServiceTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", - ServiceTaskName: "tAsKnAmE", + ServiceTaskName: "sErViCeTaSkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/patch/id_task.go b/resource-manager/datamigration/2021-06-30/patch/id_task.go index 446002dc681..a81568fe08b 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_task.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/patch/id_task_test.go b/resource-manager/datamigration/2021-06-30/patch/id_task_test.go index fb5f11690fe..61fd69b670e 100644 --- a/resource-manager/datamigration/2021-06-30/patch/id_task_test.go +++ b/resource-manager/datamigration/2021-06-30/patch/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/patch/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/patch/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..2d37eb08b9a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_backupfileinfo.go new file mode 100644 index 00000000000..f5bf749f505 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_backupsetinfo.go new file mode 100644 index 00000000000..6655253565c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_blobshare.go b/resource-manager/datamigration/2021-06-30/patch/model_blobshare.go new file mode 100644 index 00000000000..5bba1ad02fb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_blobshare.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_commandproperties.go index 06dfc9a901e..f51ecf4c5ad 100644 --- a/resource-manager/datamigration/2021-06-30/patch/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/patch/model_commandproperties.go @@ -1,10 +1,85 @@ package patch +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/patch/model_connectioninfo.go index fd06d1f73ec..d4e2552112f 100644 --- a/resource-manager/datamigration/2021-06-30/patch/model_connectioninfo.go +++ b/resource-manager/datamigration/2021-06-30/patch/model_connectioninfo.go @@ -1,10 +1,117 @@ package patch +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..8e4db027bf1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..f4b59f832f4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..0860a8848f4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..3b5962116c4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..63b54e061e5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..1fec89576e0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..c82456c09e5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..9c7d12150db --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..df74ab62822 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..aac9f821ccf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..085cb53832d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..b47da62d875 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..61ba507d45b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..b8a8ec58de1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..a91c7d2caea --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..fca3fd1cf80 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..1ea849d43c4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..a413264c507 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..352800cb5ce --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..82e572b1c98 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..277f788cc83 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..a5d29cc24fe --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..0ea128c57be --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..3282fc49e4c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..5b96f7c8851 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..621f3e3f2f7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..8e6b56931d2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..aea707a08bd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..42d361d27d3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..73a20b4b216 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..5c5d908e437 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..935c8eca669 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..47c76961a21 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..b84accb0214 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..5abee038046 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..8c5b394ce73 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..ae4d8e3e407 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..42dea35933b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..520050ee4ff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_databasebackupinfo.go new file mode 100644 index 00000000000..5de0fd030c0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_databasefileinfo.go new file mode 100644 index 00000000000..bf0623074d1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/patch/model_databasesummaryresult.go new file mode 100644 index 00000000000..70a6dd64f17 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_databasetable.go b/resource-manager/datamigration/2021-06-30/patch/model_databasetable.go new file mode 100644 index 00000000000..d754b773cb9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_databasetable.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/patch/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..cbe32cb2111 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/patch/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..907ca3a11c4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/patch/model_executionstatistics.go new file mode 100644 index 00000000000..c2d847f8e6e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_executionstatistics.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_fileshare.go b/resource-manager/datamigration/2021-06-30/patch/model_fileshare.go new file mode 100644 index 00000000000..7e9b7c9c627 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_fileshare.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..175d6996297 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..07ec58d7944 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..db0120863fe --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..2ef88aa4081 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..6017e8bd322 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..dbe6987772d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..328cbac28b3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..92e29140f08 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..358d5de8701 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..3a33427e1b1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..b6fdcc83e69 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..1767586718b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..e34f5b9037f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..7ff5a4c44f7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..c99fd9812bf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..898da8c1e69 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..1442e0c82d1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..3028429a425 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..2f5c14fb0eb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..b22ecf4c445 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..b4f09e2cac7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..508f8ce831c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..00b540a3a34 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..5d4888a7669 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..6faa5a82a54 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..95310e64583 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..cc4c1ad91dd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..599567bcec0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..6c5b2780c66 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..cdc9a735cd8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..d733db80f3a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..bff82ecbbfc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..df1a83912d3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..e107673c1fb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..a18a365d861 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..976febaebde --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..f6886c779a3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..d8a27930675 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..f1da5efe0b2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..9590d5fae20 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..475853cddaa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..fe4642e5b03 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..ae6af5e77c9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..17ba866fe5e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ca8cb355bee --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..fe7649b678b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..aa89f2df2ee --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..b9d0eb15d6a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..e5b516dbbf1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..23eb7db5938 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..db28acbf742 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..34ea9da5701 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..2f241b3a09e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..388fa3138fd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..2fe3507add3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..572cd85d798 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..4c808f1d5c5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..528c85b50e0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..1c0ae5daf52 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..dfbfd5901b5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..686c0275947 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..cbbb7492724 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..f29553c0a0f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..d3dff42690a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..35ac52e5558 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..c9f132a5034 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..57c3f0e49c5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..3548855b359 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..d2c6e735a70 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..90c6c8fef12 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..0705e3579f0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..296dd13a722 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..401499dcfc9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..1a629135287 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..c2dcea08999 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..64382afe9c7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..a1052727837 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..25fb705eb96 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..2d0de681419 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..d666e7b4da1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..3e27b5e809b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..1065a9443c6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..0c4315613c8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..a48156b7769 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..8bcda7bd36d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..c6ff3e1a875 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..59ae862b2f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..728a499dd38 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..f61f7f3e445 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..05f103b6eac --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..97cc25364f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskinput.go new file mode 100644 index 00000000000..7288ed348f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutput.go new file mode 100644 index 00000000000..31a57b60b7a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..0dc5936de84 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..31433067e68 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskproperties.go new file mode 100644 index 00000000000..acdd38e7e92 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..5f73e610da6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..829b416a987 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..89275772024 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..1869914d266 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/patch/model_migrationreportresult.go new file mode 100644 index 00000000000..cc182833fe6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..2b58c1a48b6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package patch + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..e48f3bac167 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationresult.go new file mode 100644 index 00000000000..a5ca5ae7f4c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/patch/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..56beb094859 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..b352bf88412 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..4e9e72b1289 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..926327faaf3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package patch + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..b252bdef98b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..654646c171b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "MongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..21f37c6394f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..ae31a32aae3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package patch + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..27e3cea4e42 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodberror.go new file mode 100644 index 00000000000..0ec0c180922 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodberror.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..17c341ac8d7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package patch + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..7ae50968ff7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbprogress.go new file mode 100644 index 00000000000..00313435a1f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package patch + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..35f642c6316 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..0526b0999fd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..3cf7dc6ba2a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/patch/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..cc5473f2e28 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/patch/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..637acf1f45f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/patch/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..84def0589a3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_orphaneduserinfo.go new file mode 100644 index 00000000000..1c2344dd8d0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/patch/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..bef42796f13 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_projectproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_projectproperties.go index 6b049a4245e..7242883c882 100644 --- a/resource-manager/datamigration/2021-06-30/patch/model_projectproperties.go +++ b/resource-manager/datamigration/2021-06-30/patch/model_projectproperties.go @@ -1,6 +1,8 @@ package patch import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_projecttask.go b/resource-manager/datamigration/2021-06-30/patch/model_projecttask.go index 35560ac7b5a..30f61ace7c0 100644 --- a/resource-manager/datamigration/2021-06-30/patch/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/patch/model_projecttask.go @@ -1,6 +1,9 @@ package patch import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_projecttaskproperties.go index 01eb17a64f4..733b9f4b24e 100644 --- a/resource-manager/datamigration/2021-06-30/patch/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/patch/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package patch +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/patch/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..9493a80b133 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/patch/model_queryexecutionresult.go new file mode 100644 index 00000000000..b2c4e3744c0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/patch/model_reportableexception.go new file mode 100644 index 00000000000..0e85c66fc31 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_reportableexception.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/patch/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..2914e9a856d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/patch/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..f3d0658d5f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/patch/model_selectedcertificateinput.go new file mode 100644 index 00000000000..8dc8044408c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_serverproperties.go new file mode 100644 index 00000000000..29a096a2383 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_serverproperties.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/patch/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..91d65c5c041 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..dd525c7d368 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/patch/model_ssismigrationinfo.go new file mode 100644 index 00000000000..5ce84439679 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/patch/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..8650fb9d1f2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/patch/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..0a253f62538 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..d53580b436c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..89205aa0b4d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..7e37fd166ca --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..4e6ad01cb0f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..52c88c73506 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..d5532c18aca --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..e28fd4ec4c5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/patch/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..4409ce6c2c6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package patch + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..fbcbd801adc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/patch/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..e6f56c812c2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/patch/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..430440d2afe --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_validationerror.go b/resource-manager/datamigration/2021-06-30/patch/model_validationerror.go new file mode 100644 index 00000000000..a60d21b10b6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_validationerror.go @@ -0,0 +1,9 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/patch/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/patch/model_waitstatistics.go new file mode 100644 index 00000000000..7e91f123f6d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/patch/model_waitstatistics.go @@ -0,0 +1,10 @@ +package patch + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/README.md b/resource-manager/datamigration/2021-06-30/post/README.md index 02d47c8b048..95f180a4fe4 100644 --- a/resource-manager/datamigration/2021-06-30/post/README.md +++ b/resource-manager/datamigration/2021-06-30/post/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := post.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := post.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesRead(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := post.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesReadWrite(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := post.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") read, err := client.ServiceTasksCancel(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := post.NameAvailabilityRequest{ // ... @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := post.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := post.NameAvailabilityRequest{ // ... @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesCheckStatus(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStartThenPoll(ctx, id); err != nil { // handle the error @@ -142,7 +142,7 @@ if err := client.ServicesStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := post.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStopThenPoll(ctx, id); err != nil { // handle the error @@ -154,7 +154,7 @@ if err := client.ServicesStopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := post.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := post.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksCancel(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := post.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := post.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := post.CommandProperties{ // ... diff --git a/resource-manager/datamigration/2021-06-30/post/constants.go b/resource-manager/datamigration/2021-06-30/post/constants.go index 0f7e7fcbe0d..f911f8a7b59 100644 --- a/resource-manager/datamigration/2021-06-30/post/constants.go +++ b/resource-manager/datamigration/2021-06-30/post/constants.go @@ -9,32 +9,1450 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type NameCheckFailureReason string + +const ( + NameCheckFailureReasonAlreadyExists NameCheckFailureReason = "AlreadyExists" + NameCheckFailureReasonInvalid NameCheckFailureReason = "Invalid" +) + +func PossibleValuesForNameCheckFailureReason() []string { + return []string{ + string(NameCheckFailureReasonAlreadyExists), + string(NameCheckFailureReasonInvalid), + } +} + +func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNameCheckFailureReason(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) { + vals := map[string]NameCheckFailureReason{ + "alreadyexists": NameCheckFailureReasonAlreadyExists, + "invalid": NameCheckFailureReasonInvalid, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NameCheckFailureReason(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForSeverity() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *Severity) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseSeverity(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,43 +1460,39 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := Severity(input) return &out, nil } -type NameCheckFailureReason string +type SqlSourcePlatform string const ( - NameCheckFailureReasonAlreadyExists NameCheckFailureReason = "AlreadyExists" - NameCheckFailureReasonInvalid NameCheckFailureReason = "Invalid" + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" ) -func PossibleValuesForNameCheckFailureReason() []string { +func PossibleValuesForSqlSourcePlatform() []string { return []string{ - string(NameCheckFailureReasonAlreadyExists), - string(NameCheckFailureReasonInvalid), + string(SqlSourcePlatformSqlOnPrem), } } -func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseNameCheckFailureReason(decoded) + out, err := parseSqlSourcePlatform(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -86,17 +1500,284 @@ func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { return nil } -func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) { - vals := map[string]NameCheckFailureReason{ - "alreadyexists": NameCheckFailureReasonAlreadyExists, - "invalid": NameCheckFailureReasonInvalid, +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := NameCheckFailureReason(input) + out := SqlSourcePlatform(input) + return &out, nil +} + +type SsisMigrationOverwriteOption string + +const ( + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" +) + +func PossibleValuesForSsisMigrationOverwriteOption() []string { + return []string{ + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), + } +} + +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationOverwriteOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationOverwriteOption(input) + return &out, nil +} + +type SsisMigrationStage string + +const ( + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" +) + +func PossibleValuesForSsisMigrationStage() []string { + return []string{ + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), + } +} + +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationStage(input) + return &out, nil +} + +type SsisStoreType string + +const ( + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" +) + +func PossibleValuesForSsisStoreType() []string { + return []string{ + string(SsisStoreTypeSsisCatalog), + } +} + +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisStoreType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisStoreType(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) return &out, nil } @@ -158,3 +1839,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/id_file.go b/resource-manager/datamigration/2021-06-30/post/id_file.go index 70b5d2cf344..4715f5fe971 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_file.go +++ b/resource-manager/datamigration/2021-06-30/post/id_file.go @@ -123,7 +123,7 @@ func (id FileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/post/id_file_test.go b/resource-manager/datamigration/2021-06-30/post/id_file_test.go index 0de8007f554..2bb4280e7cc 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_file_test.go +++ b/resource-manager/datamigration/2021-06-30/post/id_file_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FileId{} func TestNewFileID(t *testing.T) { - id := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") + id := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewFileID(t *testing.T) { } func TestFormatFileID(t *testing.T) { - actual := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" + actual := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseFileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -122,7 +122,7 @@ func TestParseFileID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -298,15 +298,15 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", FileName: "fIlEnAmE", @@ -314,7 +314,7 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/post/id_location.go b/resource-manager/datamigration/2021-06-30/post/id_location.go index 8c08969bd6e..4df2f624f22 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_location.go +++ b/resource-manager/datamigration/2021-06-30/post/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datamigration/2021-06-30/post/id_location_test.go b/resource-manager/datamigration/2021-06-30/post/id_location_test.go index 7b6e2ff1e37..e22dda8e247 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_location_test.go +++ b/resource-manager/datamigration/2021-06-30/post/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/post/id_service.go b/resource-manager/datamigration/2021-06-30/post/id_service.go index 5aa1b1b4402..0bce91c9fd5 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_service.go +++ b/resource-manager/datamigration/2021-06-30/post/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/post/id_service_test.go b/resource-manager/datamigration/2021-06-30/post/id_service_test.go index 382e114dbbe..bc8ef3953bb 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/post/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/post/id_servicetask.go b/resource-manager/datamigration/2021-06-30/post/id_servicetask.go index 127d809167b..44e6d4cf22a 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_servicetask.go +++ b/resource-manager/datamigration/2021-06-30/post/id_servicetask.go @@ -117,13 +117,13 @@ func (id ServiceTaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticServiceTasks", "serviceTasks", "serviceTasks"), - resourceids.UserSpecifiedSegment("serviceTaskName", "taskName"), + resourceids.UserSpecifiedSegment("serviceTaskName", "serviceTaskName"), } } diff --git a/resource-manager/datamigration/2021-06-30/post/id_servicetask_test.go b/resource-manager/datamigration/2021-06-30/post/id_servicetask_test.go index e290f74b7a1..fe8a3fcba22 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_servicetask_test.go +++ b/resource-manager/datamigration/2021-06-30/post/id_servicetask_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ServiceTaskId{} func TestNewServiceTaskID(t *testing.T) { - id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") + id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.ServiceTaskName != "taskName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "taskName") + if id.ServiceTaskName != "serviceTaskName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "serviceTaskName") } } func TestFormatServiceTaskID(t *testing.T) { - actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName" + actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseServiceTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseServiceTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", - ServiceTaskName: "tAsKnAmE", + ServiceTaskName: "sErViCeTaSkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/post/id_task.go b/resource-manager/datamigration/2021-06-30/post/id_task.go index 11221535b39..fd9ef4542ab 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_task.go +++ b/resource-manager/datamigration/2021-06-30/post/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/post/id_task_test.go b/resource-manager/datamigration/2021-06-30/post/id_task_test.go index 1f0e9d97df6..6a7551d16b8 100644 --- a/resource-manager/datamigration/2021-06-30/post/id_task_test.go +++ b/resource-manager/datamigration/2021-06-30/post/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/post/method_taskscommand.go b/resource-manager/datamigration/2021-06-30/post/method_taskscommand.go index 4f416f94e81..7d03184a39a 100644 --- a/resource-manager/datamigration/2021-06-30/post/method_taskscommand.go +++ b/resource-manager/datamigration/2021-06-30/post/method_taskscommand.go @@ -2,6 +2,7 @@ package post import ( "context" + "encoding/json" "fmt" "net/http" @@ -15,7 +16,7 @@ import ( type TasksCommandOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *CommandProperties + Model CommandProperties } // TasksCommand ... @@ -48,11 +49,15 @@ func (c POSTClient) TasksCommand(ctx context.Context, id TaskId, input CommandPr return } - var model CommandProperties - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { + var respObj json.RawMessage + if err = resp.Unmarshal(&respObj); err != nil { return } + model, err := UnmarshalCommandPropertiesImplementation(respObj) + if err != nil { + return + } + result.Model = model return } diff --git a/resource-manager/datamigration/2021-06-30/post/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/post/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..edc03ee93fa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/post/model_backupfileinfo.go new file mode 100644 index 00000000000..8a3d7a5a1ff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/post/model_backupsetinfo.go new file mode 100644 index 00000000000..cab42ab8799 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_blobshare.go b/resource-manager/datamigration/2021-06-30/post/model_blobshare.go new file mode 100644 index 00000000000..43022734151 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_blobshare.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/post/model_commandproperties.go index 0716ee0be6f..161697fec25 100644 --- a/resource-manager/datamigration/2021-06-30/post/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/post/model_commandproperties.go @@ -1,10 +1,85 @@ package post +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/post/model_connectioninfo.go new file mode 100644 index 00000000000..700e7f47af0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connectioninfo.go @@ -0,0 +1,117 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..4395f70a7ab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..d9700c17144 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..b989d57141a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..897f6b9adde --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..1cf73cb686d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..e60686ae97a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..db838f79876 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..7de22cd2a10 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..6127f59fe7f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..a02ffd4edeb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..6443fb7ec6d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..e4bdef376f5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..73959673667 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..f347c3dc244 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..77e15308763 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..d680d3ff733 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..1249faffe10 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..3842a1522b9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..d241fb678ab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..078fe8840fe --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..dd6d9a66e17 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..3426f880f5d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..4f373b1417b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..a9d6ec15764 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..9f1c4461440 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..4f91df1d35b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..6a715cda999 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..460fc43c2f5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..bd3daca1db7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..eecd138e26d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..95179e961e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..1d1606687d9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..0884b58aad7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..68d36255de8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..11c4b19ce98 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..bc32be736c5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..b6347f88d43 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..103b6764f76 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..a3e1e57e4f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/post/model_databasebackupinfo.go new file mode 100644 index 00000000000..13b3a8069d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/post/model_databasefileinfo.go new file mode 100644 index 00000000000..9b97071588b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/post/model_databasesummaryresult.go new file mode 100644 index 00000000000..9845e4b14d6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_databasetable.go b/resource-manager/datamigration/2021-06-30/post/model_databasetable.go new file mode 100644 index 00000000000..7b6fcf0d2cc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_databasetable.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/post/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..508d1bb1767 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/post/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..05366915a29 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/post/model_executionstatistics.go new file mode 100644 index 00000000000..9f01d0d7bf6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_executionstatistics.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_fileshare.go b/resource-manager/datamigration/2021-06-30/post/model_fileshare.go new file mode 100644 index 00000000000..ef974b61862 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_fileshare.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..c4e9e8c8d62 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..df0821f5ef8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..b4c0d1fc1a7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..ab34a0f9c06 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..04101025b99 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..20a6fac7bf3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..13ae64afb07 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..38da278bee3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..b13c58d95a5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..973bc8bba8a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..afcc78008d9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..0d0ab120434 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..10830a59cb2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..5451bb93a80 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..37fff84fe53 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..33e85ae56a7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..06b4321b13c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..0c84f3d9787 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..d570aa2fe96 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..5f6869161d3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..208e3c5454a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..d2179d23a29 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..f42c26e3a9f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..e360ddc18f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..4726607d35a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..9d781c2979e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..690b76772b4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..16f6ad8a7cd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..f90f8cab1e5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..e51bd2b78fb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..17926a7a3a4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..7363548a55a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..f7163c7211f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..9cd34907694 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..2d2c75af116 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..ae21f4a44df --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..3c72d2fd90e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..b393ed0bfd9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..f0f105c0191 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..9ec46f01c3f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..30fb8b7f17a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..363ec8f7339 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..b2653f50605 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..8c97caa4c13 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..75cc0b8f556 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..f274f00c664 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..4d46547bfa9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..771b82d931b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..edd85cb7cef --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..4e976f5245c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..17ef8b17435 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..89ab754fc6b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..40ad7205a29 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..16e50d5436a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..46d654adb1b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..b8a8420fa17 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..3ce6cb83710 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..b32845db790 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..5be7549b318 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..b5031be5cb4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..7b694b09106 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..9eadd0837a2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..e01056b69f4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..9e48a0f7329 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..fb285d9874e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..f7a1f5b625e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..1821ee69b19 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..c7e5188f961 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..e89a0390cf1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..deb1a8ffc9b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..8c19410807b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..45d1434cabb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..f6daf907c39 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..a0151768d37 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..36ff532f148 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..f96fbae75fe --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..b0a457dadd5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..e2aeb7594d9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..f151b315d47 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ee8a4344187 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..50b708f4f98 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..b1333f05f3c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..e1e6dae56b7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..c00892873c4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..372bca38be3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..1b66f212f68 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..450dfcf13e4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..e3e74bb6a66 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..85d4ecfe6cd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..9e76b1ee13c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..eda1212f78d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskinput.go new file mode 100644 index 00000000000..3094cc70b9f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutput.go new file mode 100644 index 00000000000..1d1e41b1132 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..1540868ab39 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..475ed339196 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskproperties.go new file mode 100644 index 00000000000..ec151893b6c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..2b156b144e4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..169748d6fa7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..410574d2c90 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/post/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..dfe26ee06ac --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/post/model_migrationreportresult.go new file mode 100644 index 00000000000..a7237f4ca1c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..3f459a704af --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package post + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..01cefc0624d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationresult.go new file mode 100644 index 00000000000..bed85490171 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/post/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..e299612d26f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..9eaf865a4ab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..3e650014440 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..c59c42025e6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package post + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..6255e09a331 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..79881c54faf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "MongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..11633990899 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..bcf67812197 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package post + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..0f8e0aa187c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/post/model_mongodberror.go new file mode 100644 index 00000000000..bedb14f6bae --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodberror.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..46c45542b12 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package post + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..d6c3e499a45 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbprogress.go new file mode 100644 index 00000000000..255619dc9e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package post + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..0594aa98dd3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..70b1509e6b9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..2c682083f77 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/post/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..c26b3d210af --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/post/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..70fd98e85b9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/post/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..d32f34db62e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/post/model_orphaneduserinfo.go new file mode 100644 index 00000000000..456b860ac73 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/post/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..68ac6ad104b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_projecttask.go b/resource-manager/datamigration/2021-06-30/post/model_projecttask.go index ad7099d0af1..45fb12a6a39 100644 --- a/resource-manager/datamigration/2021-06-30/post/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/post/model_projecttask.go @@ -1,6 +1,9 @@ package post import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_projecttaskproperties.go index 86b49813ca9..625a2dc7f85 100644 --- a/resource-manager/datamigration/2021-06-30/post/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/post/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package post +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/post/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..f59fa2e975d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/post/model_queryexecutionresult.go new file mode 100644 index 00000000000..99458e53e8d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/post/model_reportableexception.go new file mode 100644 index 00000000000..96cb08aecce --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_reportableexception.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/post/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..ac94f24270d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/post/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..667a05006d5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/post/model_selectedcertificateinput.go new file mode 100644 index 00000000000..e5670d0910b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/post/model_serverproperties.go new file mode 100644 index 00000000000..47d2c498b30 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_serverproperties.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/post/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..2c795ac21ea --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..2a462a6a620 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/post/model_ssismigrationinfo.go new file mode 100644 index 00000000000..f2fcf74a253 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/post/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..c473e42e761 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/post/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..a04df7d1556 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..7bd33ebd2d2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..5c05c6fb9b4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..f6fcd242733 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..3891899551e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..354f0c1625f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..be15b55041f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..e4710f53610 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/post/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..94e792e24a0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package post + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..649f37019a1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/post/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..e640725798b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/post/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..69db3adfdfb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_validationerror.go b/resource-manager/datamigration/2021-06-30/post/model_validationerror.go new file mode 100644 index 00000000000..ead8edecd34 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_validationerror.go @@ -0,0 +1,9 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/post/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/post/model_waitstatistics.go new file mode 100644 index 00000000000..e74d55dc8ad --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/post/model_waitstatistics.go @@ -0,0 +1,10 @@ +package post + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/README.md b/resource-manager/datamigration/2021-06-30/projectresource/README.md index 9a341733d36..1e9fbb9ac1d 100644 --- a/resource-manager/datamigration/2021-06-30/projectresource/README.md +++ b/resource-manager/datamigration/2021-06-30/projectresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := projectresource.Project{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsDelete(ctx, id, projectresource.DefaultProjectsDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := projectresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := projectresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ProjectsList(ctx, id)` can be used to do batched pagination items, err := client.ProjectsListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := projectresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := projectresource.Project{ // ... diff --git a/resource-manager/datamigration/2021-06-30/projectresource/constants.go b/resource-manager/datamigration/2021-06-30/projectresource/constants.go index e2e88c2c670..cf99d1198b3 100644 --- a/resource-manager/datamigration/2021-06-30/projectresource/constants.go +++ b/resource-manager/datamigration/2021-06-30/projectresource/constants.go @@ -9,6 +9,56 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + type ProjectProvisioningState string const ( @@ -152,3 +202,41 @@ func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { out := ProjectTargetPlatform(input) return &out, nil } + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/id_project.go b/resource-manager/datamigration/2021-06-30/projectresource/id_project.go index eeef2ee59f6..09cc4be079c 100644 --- a/resource-manager/datamigration/2021-06-30/projectresource/id_project.go +++ b/resource-manager/datamigration/2021-06-30/projectresource/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/projectresource/id_project_test.go b/resource-manager/datamigration/2021-06-30/projectresource/id_project_test.go index 922ac4f7f5b..c961c1d4e0d 100644 --- a/resource-manager/datamigration/2021-06-30/projectresource/id_project_test.go +++ b/resource-manager/datamigration/2021-06-30/projectresource/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/projectresource/id_service.go b/resource-manager/datamigration/2021-06-30/projectresource/id_service.go index 71d997f3dfe..049198dddc6 100644 --- a/resource-manager/datamigration/2021-06-30/projectresource/id_service.go +++ b/resource-manager/datamigration/2021-06-30/projectresource/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/projectresource/id_service_test.go b/resource-manager/datamigration/2021-06-30/projectresource/id_service_test.go index a6dd5070905..76e86ac841c 100644 --- a/resource-manager/datamigration/2021-06-30/projectresource/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/projectresource/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/projectresource/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/projectresource/model_connectioninfo.go index 63f80a0c09a..2c2c6b0788a 100644 --- a/resource-manager/datamigration/2021-06-30/projectresource/model_connectioninfo.go +++ b/resource-manager/datamigration/2021-06-30/projectresource/model_connectioninfo.go @@ -1,10 +1,117 @@ package projectresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/projectresource/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..9cb8f6683f0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/projectresource/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/projectresource/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..a2730140527 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/projectresource/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "MongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/projectresource/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..d53194a6b9c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/projectresource/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/projectresource/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..8678d3f827a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/projectresource/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/projectresource/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..844001bb152 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/projectresource/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/model_projectproperties.go b/resource-manager/datamigration/2021-06-30/projectresource/model_projectproperties.go index 6a63778da1a..9d9ff2a4627 100644 --- a/resource-manager/datamigration/2021-06-30/projectresource/model_projectproperties.go +++ b/resource-manager/datamigration/2021-06-30/projectresource/model_projectproperties.go @@ -1,6 +1,8 @@ package projectresource import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/projectresource/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/projectresource/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..be794f1053b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/projectresource/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package projectresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/README.md b/resource-manager/datamigration/2021-06-30/put/README.md index 8cf397c2c12..59ed14edd6a 100644 --- a/resource-manager/datamigration/2021-06-30/put/README.md +++ b/resource-manager/datamigration/2021-06-30/put/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := put.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := put.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") payload := put.ProjectFile{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := put.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := put.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := put.Project{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := put.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := put.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") payload := put.ProjectTask{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := put.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := put.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := put.DataMigrationService{ // ... @@ -104,7 +104,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := put.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := put.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := put.ProjectTask{ // ... diff --git a/resource-manager/datamigration/2021-06-30/put/constants.go b/resource-manager/datamigration/2021-06-30/put/constants.go index c0daf4fb6cf..a693dbe87be 100644 --- a/resource-manager/datamigration/2021-06-30/put/constants.go +++ b/resource-manager/datamigration/2021-06-30/put/constants.go @@ -9,32 +9,1618 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ProjectProvisioningState string + +const ( + ProjectProvisioningStateDeleting ProjectProvisioningState = "Deleting" + ProjectProvisioningStateSucceeded ProjectProvisioningState = "Succeeded" +) + +func PossibleValuesForProjectProvisioningState() []string { + return []string{ + string(ProjectProvisioningStateDeleting), + string(ProjectProvisioningStateSucceeded), + } +} + +func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectProvisioningState(input string) (*ProjectProvisioningState, error) { + vals := map[string]ProjectProvisioningState{ + "deleting": ProjectProvisioningStateDeleting, + "succeeded": ProjectProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectProvisioningState(input) + return &out, nil +} + +type ProjectSourcePlatform string + +const ( + ProjectSourcePlatformMongoDb ProjectSourcePlatform = "MongoDb" + ProjectSourcePlatformMySQL ProjectSourcePlatform = "MySQL" + ProjectSourcePlatformPostgreSql ProjectSourcePlatform = "PostgreSql" + ProjectSourcePlatformSQL ProjectSourcePlatform = "SQL" + ProjectSourcePlatformUnknown ProjectSourcePlatform = "Unknown" +) + +func PossibleValuesForProjectSourcePlatform() []string { + return []string{ + string(ProjectSourcePlatformMongoDb), + string(ProjectSourcePlatformMySQL), + string(ProjectSourcePlatformPostgreSql), + string(ProjectSourcePlatformSQL), + string(ProjectSourcePlatformUnknown), + } +} + +func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectSourcePlatform(input string) (*ProjectSourcePlatform, error) { + vals := map[string]ProjectSourcePlatform{ + "mongodb": ProjectSourcePlatformMongoDb, + "mysql": ProjectSourcePlatformMySQL, + "postgresql": ProjectSourcePlatformPostgreSql, + "sql": ProjectSourcePlatformSQL, + "unknown": ProjectSourcePlatformUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectSourcePlatform(input) + return &out, nil +} + +type ProjectTargetPlatform string + +const ( + ProjectTargetPlatformAzureDbForMySql ProjectTargetPlatform = "AzureDbForMySql" + ProjectTargetPlatformAzureDbForPostgreSql ProjectTargetPlatform = "AzureDbForPostgreSql" + ProjectTargetPlatformMongoDb ProjectTargetPlatform = "MongoDb" + ProjectTargetPlatformSQLDB ProjectTargetPlatform = "SQLDB" + ProjectTargetPlatformSQLMI ProjectTargetPlatform = "SQLMI" + ProjectTargetPlatformUnknown ProjectTargetPlatform = "Unknown" +) + +func PossibleValuesForProjectTargetPlatform() []string { + return []string{ + string(ProjectTargetPlatformAzureDbForMySql), + string(ProjectTargetPlatformAzureDbForPostgreSql), + string(ProjectTargetPlatformMongoDb), + string(ProjectTargetPlatformSQLDB), + string(ProjectTargetPlatformSQLMI), + string(ProjectTargetPlatformUnknown), + } +} + +func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectTargetPlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { + vals := map[string]ProjectTargetPlatform{ + "azuredbformysql": ProjectTargetPlatformAzureDbForMySql, + "azuredbforpostgresql": ProjectTargetPlatformAzureDbForPostgreSql, + "mongodb": ProjectTargetPlatformMongoDb, + "sqldb": ProjectTargetPlatformSQLDB, + "sqlmi": ProjectTargetPlatformSQLMI, + "unknown": ProjectTargetPlatformUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectTargetPlatform(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type ServiceProvisioningState string + +const ( + ServiceProvisioningStateAccepted ServiceProvisioningState = "Accepted" + ServiceProvisioningStateDeleting ServiceProvisioningState = "Deleting" + ServiceProvisioningStateDeploying ServiceProvisioningState = "Deploying" + ServiceProvisioningStateFailed ServiceProvisioningState = "Failed" + ServiceProvisioningStateFailedToStart ServiceProvisioningState = "FailedToStart" + ServiceProvisioningStateFailedToStop ServiceProvisioningState = "FailedToStop" + ServiceProvisioningStateStarting ServiceProvisioningState = "Starting" + ServiceProvisioningStateStopped ServiceProvisioningState = "Stopped" + ServiceProvisioningStateStopping ServiceProvisioningState = "Stopping" + ServiceProvisioningStateSucceeded ServiceProvisioningState = "Succeeded" +) + +func PossibleValuesForServiceProvisioningState() []string { + return []string{ + string(ServiceProvisioningStateAccepted), + string(ServiceProvisioningStateDeleting), + string(ServiceProvisioningStateDeploying), + string(ServiceProvisioningStateFailed), + string(ServiceProvisioningStateFailedToStart), + string(ServiceProvisioningStateFailedToStop), + string(ServiceProvisioningStateStarting), + string(ServiceProvisioningStateStopped), + string(ServiceProvisioningStateStopping), + string(ServiceProvisioningStateSucceeded), + } +} + +func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceProvisioningState(input string) (*ServiceProvisioningState, error) { + vals := map[string]ServiceProvisioningState{ + "accepted": ServiceProvisioningStateAccepted, + "deleting": ServiceProvisioningStateDeleting, + "deploying": ServiceProvisioningStateDeploying, + "failed": ServiceProvisioningStateFailed, + "failedtostart": ServiceProvisioningStateFailedToStart, + "failedtostop": ServiceProvisioningStateFailedToStop, + "starting": ServiceProvisioningStateStarting, + "stopped": ServiceProvisioningStateStopped, + "stopping": ServiceProvisioningStateStopping, + "succeeded": ServiceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceProvisioningState(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForSeverity() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *Severity) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseSeverity(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,43 +1628,39 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := Severity(input) return &out, nil } -type ProjectProvisioningState string +type SqlSourcePlatform string const ( - ProjectProvisioningStateDeleting ProjectProvisioningState = "Deleting" - ProjectProvisioningStateSucceeded ProjectProvisioningState = "Succeeded" + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" ) -func PossibleValuesForProjectProvisioningState() []string { +func PossibleValuesForSqlSourcePlatform() []string { return []string{ - string(ProjectProvisioningStateDeleting), - string(ProjectProvisioningStateSucceeded), + string(SqlSourcePlatformSqlOnPrem), } } -func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectProvisioningState(decoded) + out, err := parseSqlSourcePlatform(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -86,46 +1668,39 @@ func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectProvisioningState(input string) (*ProjectProvisioningState, error) { - vals := map[string]ProjectProvisioningState{ - "deleting": ProjectProvisioningStateDeleting, - "succeeded": ProjectProvisioningStateSucceeded, +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectProvisioningState(input) + out := SqlSourcePlatform(input) return &out, nil } -type ProjectSourcePlatform string +type SsisMigrationOverwriteOption string const ( - ProjectSourcePlatformMongoDb ProjectSourcePlatform = "MongoDb" - ProjectSourcePlatformMySQL ProjectSourcePlatform = "MySQL" - ProjectSourcePlatformPostgreSql ProjectSourcePlatform = "PostgreSql" - ProjectSourcePlatformSQL ProjectSourcePlatform = "SQL" - ProjectSourcePlatformUnknown ProjectSourcePlatform = "Unknown" + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" ) -func PossibleValuesForProjectSourcePlatform() []string { +func PossibleValuesForSsisMigrationOverwriteOption() []string { return []string{ - string(ProjectSourcePlatformMongoDb), - string(ProjectSourcePlatformMySQL), - string(ProjectSourcePlatformPostgreSql), - string(ProjectSourcePlatformSQL), - string(ProjectSourcePlatformUnknown), + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), } } -func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectSourcePlatform(decoded) + out, err := parseSsisMigrationOverwriteOption(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -133,51 +1708,44 @@ func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectSourcePlatform(input string) (*ProjectSourcePlatform, error) { - vals := map[string]ProjectSourcePlatform{ - "mongodb": ProjectSourcePlatformMongoDb, - "mysql": ProjectSourcePlatformMySQL, - "postgresql": ProjectSourcePlatformPostgreSql, - "sql": ProjectSourcePlatformSQL, - "unknown": ProjectSourcePlatformUnknown, +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectSourcePlatform(input) + out := SsisMigrationOverwriteOption(input) return &out, nil } -type ProjectTargetPlatform string +type SsisMigrationStage string const ( - ProjectTargetPlatformAzureDbForMySql ProjectTargetPlatform = "AzureDbForMySql" - ProjectTargetPlatformAzureDbForPostgreSql ProjectTargetPlatform = "AzureDbForPostgreSql" - ProjectTargetPlatformMongoDb ProjectTargetPlatform = "MongoDb" - ProjectTargetPlatformSQLDB ProjectTargetPlatform = "SQLDB" - ProjectTargetPlatformSQLMI ProjectTargetPlatform = "SQLMI" - ProjectTargetPlatformUnknown ProjectTargetPlatform = "Unknown" + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" ) -func PossibleValuesForProjectTargetPlatform() []string { +func PossibleValuesForSsisMigrationStage() []string { return []string{ - string(ProjectTargetPlatformAzureDbForMySql), - string(ProjectTargetPlatformAzureDbForPostgreSql), - string(ProjectTargetPlatformMongoDb), - string(ProjectTargetPlatformSQLDB), - string(ProjectTargetPlatformSQLMI), - string(ProjectTargetPlatformUnknown), + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), } } -func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectTargetPlatform(decoded) + out, err := parseSsisMigrationStage(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -185,60 +1753,40 @@ func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { - vals := map[string]ProjectTargetPlatform{ - "azuredbformysql": ProjectTargetPlatformAzureDbForMySql, - "azuredbforpostgresql": ProjectTargetPlatformAzureDbForPostgreSql, - "mongodb": ProjectTargetPlatformMongoDb, - "sqldb": ProjectTargetPlatformSQLDB, - "sqlmi": ProjectTargetPlatformSQLMI, - "unknown": ProjectTargetPlatformUnknown, +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectTargetPlatform(input) + out := SsisMigrationStage(input) return &out, nil } -type ServiceProvisioningState string +type SsisStoreType string const ( - ServiceProvisioningStateAccepted ServiceProvisioningState = "Accepted" - ServiceProvisioningStateDeleting ServiceProvisioningState = "Deleting" - ServiceProvisioningStateDeploying ServiceProvisioningState = "Deploying" - ServiceProvisioningStateFailed ServiceProvisioningState = "Failed" - ServiceProvisioningStateFailedToStart ServiceProvisioningState = "FailedToStart" - ServiceProvisioningStateFailedToStop ServiceProvisioningState = "FailedToStop" - ServiceProvisioningStateStarting ServiceProvisioningState = "Starting" - ServiceProvisioningStateStopped ServiceProvisioningState = "Stopped" - ServiceProvisioningStateStopping ServiceProvisioningState = "Stopping" - ServiceProvisioningStateSucceeded ServiceProvisioningState = "Succeeded" + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" ) -func PossibleValuesForServiceProvisioningState() []string { +func PossibleValuesForSsisStoreType() []string { return []string{ - string(ServiceProvisioningStateAccepted), - string(ServiceProvisioningStateDeleting), - string(ServiceProvisioningStateDeploying), - string(ServiceProvisioningStateFailed), - string(ServiceProvisioningStateFailedToStart), - string(ServiceProvisioningStateFailedToStop), - string(ServiceProvisioningStateStarting), - string(ServiceProvisioningStateStopped), - string(ServiceProvisioningStateStopping), - string(ServiceProvisioningStateSucceeded), + string(SsisStoreTypeSsisCatalog), } } -func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseServiceProvisioningState(decoded) + out, err := parseSsisStoreType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -246,25 +1794,158 @@ func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { return nil } -func parseServiceProvisioningState(input string) (*ServiceProvisioningState, error) { - vals := map[string]ServiceProvisioningState{ - "accepted": ServiceProvisioningStateAccepted, - "deleting": ServiceProvisioningStateDeleting, - "deploying": ServiceProvisioningStateDeploying, - "failed": ServiceProvisioningStateFailed, - "failedtostart": ServiceProvisioningStateFailedToStart, - "failedtostop": ServiceProvisioningStateFailedToStop, - "starting": ServiceProvisioningStateStarting, - "stopped": ServiceProvisioningStateStopped, - "stopping": ServiceProvisioningStateStopping, - "succeeded": ServiceProvisioningStateSucceeded, +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ServiceProvisioningState(input) + out := SsisStoreType(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) return &out, nil } @@ -326,3 +2007,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/id_file.go b/resource-manager/datamigration/2021-06-30/put/id_file.go index f1417e80fe2..0184b8a522b 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_file.go +++ b/resource-manager/datamigration/2021-06-30/put/id_file.go @@ -123,7 +123,7 @@ func (id FileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/put/id_file_test.go b/resource-manager/datamigration/2021-06-30/put/id_file_test.go index f4af55a2842..e3035736f4b 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_file_test.go +++ b/resource-manager/datamigration/2021-06-30/put/id_file_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FileId{} func TestNewFileID(t *testing.T) { - id := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") + id := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewFileID(t *testing.T) { } func TestFormatFileID(t *testing.T) { - actual := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" + actual := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseFileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -122,7 +122,7 @@ func TestParseFileID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -298,15 +298,15 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", FileName: "fIlEnAmE", @@ -314,7 +314,7 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/put/id_project.go b/resource-manager/datamigration/2021-06-30/put/id_project.go index 3b89497f674..36270603bda 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_project.go +++ b/resource-manager/datamigration/2021-06-30/put/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/put/id_project_test.go b/resource-manager/datamigration/2021-06-30/put/id_project_test.go index 27756770ec6..9aba04de4ce 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_project_test.go +++ b/resource-manager/datamigration/2021-06-30/put/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/put/id_service.go b/resource-manager/datamigration/2021-06-30/put/id_service.go index cd63e0cec80..d6c75873c69 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_service.go +++ b/resource-manager/datamigration/2021-06-30/put/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/put/id_service_test.go b/resource-manager/datamigration/2021-06-30/put/id_service_test.go index c7238e518d4..0f9f94e2065 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/put/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/put/id_servicetask.go b/resource-manager/datamigration/2021-06-30/put/id_servicetask.go index 2859776aea3..80ba8e2e78f 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_servicetask.go +++ b/resource-manager/datamigration/2021-06-30/put/id_servicetask.go @@ -117,13 +117,13 @@ func (id ServiceTaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticServiceTasks", "serviceTasks", "serviceTasks"), - resourceids.UserSpecifiedSegment("serviceTaskName", "taskName"), + resourceids.UserSpecifiedSegment("serviceTaskName", "serviceTaskName"), } } diff --git a/resource-manager/datamigration/2021-06-30/put/id_servicetask_test.go b/resource-manager/datamigration/2021-06-30/put/id_servicetask_test.go index 2301bbf4fb7..12d09905ede 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_servicetask_test.go +++ b/resource-manager/datamigration/2021-06-30/put/id_servicetask_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ServiceTaskId{} func TestNewServiceTaskID(t *testing.T) { - id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") + id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.ServiceTaskName != "taskName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "taskName") + if id.ServiceTaskName != "serviceTaskName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "serviceTaskName") } } func TestFormatServiceTaskID(t *testing.T) { - actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName" + actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseServiceTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseServiceTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", - ServiceTaskName: "tAsKnAmE", + ServiceTaskName: "sErViCeTaSkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/put/id_task.go b/resource-manager/datamigration/2021-06-30/put/id_task.go index ff869d0639f..eec418bf518 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_task.go +++ b/resource-manager/datamigration/2021-06-30/put/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/put/id_task_test.go b/resource-manager/datamigration/2021-06-30/put/id_task_test.go index 36cf842c6e1..7964500a4f4 100644 --- a/resource-manager/datamigration/2021-06-30/put/id_task_test.go +++ b/resource-manager/datamigration/2021-06-30/put/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/put/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/put/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..8fe3f5c20ca --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/put/model_backupfileinfo.go new file mode 100644 index 00000000000..ad636d453a7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/put/model_backupsetinfo.go new file mode 100644 index 00000000000..7e66848b305 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_blobshare.go b/resource-manager/datamigration/2021-06-30/put/model_blobshare.go new file mode 100644 index 00000000000..5c4242b0edd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_blobshare.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/put/model_commandproperties.go index 6f1097e7cf7..b74c20293c0 100644 --- a/resource-manager/datamigration/2021-06-30/put/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/put/model_commandproperties.go @@ -1,10 +1,85 @@ package put +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/put/model_connectioninfo.go index 97b0ba3f9fb..aab36e3c9aa 100644 --- a/resource-manager/datamigration/2021-06-30/put/model_connectioninfo.go +++ b/resource-manager/datamigration/2021-06-30/put/model_connectioninfo.go @@ -1,10 +1,117 @@ package put +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "mongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..c607956b472 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..afd9d187486 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..93b03386f24 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..ba19d843c0a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..dc9581c8241 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..4f5f37c9322 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..296e80c0aa1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..3dacd3d28c3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..ee2cb0d06b8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..b0c95302d34 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..0f473cebcc8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..10247f05ca6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..84fa27d6dfd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..b31966008fc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..4da9519ffb4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..9ce662dcb2c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..b6f468412e5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..8a704ad941f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..94ea3850a7e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..e40010292cc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..83d8681197d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..7033195274b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..0fd0163d703 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..46163d7919a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..37d8537b15c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..7add2a10162 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..cfe60d58b90 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..ea143823933 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..6df73c7b5d0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..381442ea0f3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..bc5bda9f3f2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..5e163ab3917 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..7ee371e0674 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..8b558b8fe6c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..c15684e6d1b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..9019e80e9f9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..6d2c3c4967e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..ca69a55e5a2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..76d7aa9dde8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/put/model_databasebackupinfo.go new file mode 100644 index 00000000000..f5697e18c83 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/put/model_databasefileinfo.go new file mode 100644 index 00000000000..b687e3a128a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/put/model_databasesummaryresult.go new file mode 100644 index 00000000000..6bddb9cd545 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_databasetable.go b/resource-manager/datamigration/2021-06-30/put/model_databasetable.go new file mode 100644 index 00000000000..b2adfefbe17 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_databasetable.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/put/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..2d04cc1c86a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/put/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..605754e1c06 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/put/model_executionstatistics.go new file mode 100644 index 00000000000..27890588ef5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_executionstatistics.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_fileshare.go b/resource-manager/datamigration/2021-06-30/put/model_fileshare.go new file mode 100644 index 00000000000..2b8a69826c7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_fileshare.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..828c7ad2ba3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..3fc3e7234e3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..52ce27c7633 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..e42ba696d58 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..1f6e679d275 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..819d2427672 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..6a966f2481f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..6f8265a8f78 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..5826d8d43c3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..afe92d1a5d1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..ad4a57cd2a9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..2f4d974a4ad --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..54843559d77 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..3e7b8b43ffc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..1143f5f6d48 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..978d48ea7f1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..d80b4225b6e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..dca3cd4a8bc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..795d9cdc4b4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..eaf2ffe9864 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..e28a76e3140 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..8af241854c1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..a51acf5c5ab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..746b5fc368f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..5097fbe3a45 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..b41d1bb6228 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..796dd1a16dd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..b125ad3165b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..7037019fe7a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..bdb504fb7a5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..122c7fd65c9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..abd00a56294 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..554cc5ec412 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..79ff8c89bc6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..3fb33911786 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..f814d4eed6f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..3dbce661525 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..3c7e12f08b1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..f72f2df4a25 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..8eb7d4a9d3d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..049136f5ede --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..8c064f32303 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..02d1219e937 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..914e350ff23 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..98179cdfcb4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..890b21fad7f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..61e83ff0408 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..9a507e0a2f1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..bedb85e15bc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..14eeba00eba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..3338b1a0f09 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..e5a4906d2fb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..7231be8418c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..b3863da8eb0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..f779084b344 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..cc4ff608742 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..ccc6b86a2e3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..af2bc03c2a9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..3cafbd5560c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..0660f637f99 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..5caa8fb3df5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..b42ca0b20c5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..26601fc63de --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..9fd2d950f1f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..ee3c5e67bfa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..07b6add4760 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..df323915e34 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..b2395a87045 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..ef1a0907609 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..3eb22f8b724 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..f015b1a7ae4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..b3ca5704a01 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..8ddc3e3906f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..5b85d41360d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..3762a38e686 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..8ab4b337948 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..0f7cda68a60 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..97e97b796ae --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..ac3bbf0d893 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ed8ca6e9a8f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..021d569d9a5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..efa133835f1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..c0d74b24043 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..9a2c77697c3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..f010c3d3af9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..cb8e244ba69 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..57663a77a99 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..3ab5071c47d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..77327143a9e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..a4db234f021 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..409687c07f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskinput.go new file mode 100644 index 00000000000..56acd813b59 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutput.go new file mode 100644 index 00000000000..7607c074ba4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..ea74f2a723f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..1888569e064 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskproperties.go new file mode 100644 index 00000000000..866d952f6ae --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..0e4d5c22a84 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..50804a72895 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..7dfcb392cc9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/put/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..c5f9486d716 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/put/model_migrationreportresult.go new file mode 100644 index 00000000000..1c56c7cd64b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..c0ee9201725 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package put + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..5f6118cae5d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationresult.go new file mode 100644 index 00000000000..25e395c207f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/put/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..66426a78d94 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..29653602397 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..f1d3413680b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..af876c82058 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package put + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..be49b06c309 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..a6bab942273 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "mongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..5911226b8c2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..2757fa8fe4e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package put + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..748c7f41bce --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/put/model_mongodberror.go new file mode 100644 index 00000000000..cf43ae1f456 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodberror.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..310f63f0163 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package put + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..053239b8266 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbprogress.go new file mode 100644 index 00000000000..cdf5a7db105 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package put + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..11a58520802 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..f1c9c454ec6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..b6ebacd31e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/put/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..0b7731ec4cc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/put/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..43e6a96bba2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/put/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..100103fece8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/put/model_orphaneduserinfo.go new file mode 100644 index 00000000000..3b94f23b0cc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/put/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..0656b038d4e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_projectproperties.go b/resource-manager/datamigration/2021-06-30/put/model_projectproperties.go index 2ada2b876ef..6f47fde1382 100644 --- a/resource-manager/datamigration/2021-06-30/put/model_projectproperties.go +++ b/resource-manager/datamigration/2021-06-30/put/model_projectproperties.go @@ -1,6 +1,8 @@ package put import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_projecttask.go b/resource-manager/datamigration/2021-06-30/put/model_projecttask.go index 1ae7d34ec99..0d753598343 100644 --- a/resource-manager/datamigration/2021-06-30/put/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/put/model_projecttask.go @@ -1,6 +1,9 @@ package put import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_projecttaskproperties.go index e5ce7a613bc..f011ddf0454 100644 --- a/resource-manager/datamigration/2021-06-30/put/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/put/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package put +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/put/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..e790f5275ff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/put/model_queryexecutionresult.go new file mode 100644 index 00000000000..b0c55507b7b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/put/model_reportableexception.go new file mode 100644 index 00000000000..2cc0a1a6803 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_reportableexception.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/put/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..fcfd67b4c59 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/put/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..8a6b1a50429 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/put/model_selectedcertificateinput.go new file mode 100644 index 00000000000..0820bd3e747 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/put/model_serverproperties.go new file mode 100644 index 00000000000..50325f36b4e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_serverproperties.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/put/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..00d9d3562fd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..577d1831074 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/put/model_ssismigrationinfo.go new file mode 100644 index 00000000000..e0407422f1b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/put/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..2c14c1419ef --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/put/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..558ff258402 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..d9c2a66fb6f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..8a67c402b88 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..108ee5b26ae --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..b3e7d238bef --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..176982f4800 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..a285e1c234a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..f2294b96555 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/put/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..28bba21e23d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package put + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..56d0c082fb9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/put/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..90fa1959f95 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/put/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..221405ce846 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_validationerror.go b/resource-manager/datamigration/2021-06-30/put/model_validationerror.go new file mode 100644 index 00000000000..488b77203ac --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_validationerror.go @@ -0,0 +1,9 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/put/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/put/model_waitstatistics.go new file mode 100644 index 00000000000..18c38d1797a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/put/model_waitstatistics.go @@ -0,0 +1,10 @@ +package put + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/README.md b/resource-manager/datamigration/2021-06-30/serviceresource/README.md index fcb5f99c8ea..f21e27c2f38 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/README.md +++ b/resource-manager/datamigration/2021-06-30/serviceresource/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServiceTasksList(ctx, id, serviceresource.DefaultServiceTasksListOperationOptions())` can be used to do batched pagination items, err := client.ServiceTasksListComplete(ctx, id, serviceresource.DefaultServiceTasksListOperationOptions()) @@ -42,7 +42,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesCheckStatus(ctx, id) if err != nil { @@ -58,7 +58,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := serviceresource.DataMigrationService{ // ... @@ -75,7 +75,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id, serviceresource.DefaultServicesDeleteOperationOptions()); err != nil { // handle the error @@ -87,7 +87,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id, serviceresource.DefaultServices ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := serviceresource.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") +id := serviceresource.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") // alternatively `client.ServicesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ServicesListByResourceGroupComplete(ctx, id) @@ -137,7 +137,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServicesListSkus(ctx, id)` can be used to do batched pagination items, err := client.ServicesListSkusComplete(ctx, id) @@ -154,7 +154,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStartThenPoll(ctx, id); err != nil { // handle the error @@ -166,7 +166,7 @@ if err := client.ServicesStartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesStopThenPoll(ctx, id); err != nil { // handle the error @@ -178,7 +178,7 @@ if err := client.ServicesStopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := serviceresource.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := serviceresource.DataMigrationService{ // ... @@ -195,7 +195,7 @@ if err := client.ServicesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := serviceresource.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := serviceresource.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.TasksList(ctx, id, serviceresource.DefaultTasksListOperationOptions())` can be used to do batched pagination items, err := client.TasksListComplete(ctx, id, serviceresource.DefaultTasksListOperationOptions()) diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/constants.go b/resource-manager/datamigration/2021-06-30/serviceresource/constants.go index 2ea5df00e30..e4626eb57f6 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/constants.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/constants.go @@ -9,6 +9,209 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( @@ -55,7 +258,1135 @@ func parseCommandState(input string) (*CommandState, error) { } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) return &out, nil } @@ -168,6 +1499,356 @@ func parseServiceScalability(input string) (*ServiceScalability, error) { return &out, nil } +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SsisMigrationOverwriteOption string + +const ( + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" +) + +func PossibleValuesForSsisMigrationOverwriteOption() []string { + return []string{ + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), + } +} + +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationOverwriteOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationOverwriteOption(input) + return &out, nil +} + +type SsisMigrationStage string + +const ( + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" +) + +func PossibleValuesForSsisMigrationStage() []string { + return []string{ + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), + } +} + +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationStage(input) + return &out, nil +} + +type SsisStoreType string + +const ( + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" +) + +func PossibleValuesForSsisStoreType() []string { + return []string{ + string(SsisStoreTypeSsisCatalog), + } +} + +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisStoreType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisStoreType(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + type TaskState string const ( @@ -226,3 +1907,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/id_project.go b/resource-manager/datamigration/2021-06-30/serviceresource/id_project.go index 8ab9dc82e50..e4d20637d8d 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/id_project.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/id_project_test.go b/resource-manager/datamigration/2021-06-30/serviceresource/id_project_test.go index 841c04b5363..fe7c85f1c55 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/id_project_test.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/id_resourcegroup.go b/resource-manager/datamigration/2021-06-30/serviceresource/id_resourcegroup.go index 5074170e967..28fbeb3ab8b 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/id_resourcegroup.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/id_resourcegroup.go @@ -105,7 +105,7 @@ func (id ResourceGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), } } diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/id_resourcegroup_test.go b/resource-manager/datamigration/2021-06-30/serviceresource/id_resourcegroup_test.go index 007a7f9b2b2..ecc8f83c059 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/id_resourcegroup_test.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/id_resourcegroup_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ResourceGroupId{} func TestNewResourceGroupID(t *testing.T) { - id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") + id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } } func TestFormatResourceGroupID(t *testing.T) { - actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName" + actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseResourceGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/id_service.go b/resource-manager/datamigration/2021-06-30/serviceresource/id_service.go index 5b9a869072d..fbd1e64a55c 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/id_service.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/id_service_test.go b/resource-manager/datamigration/2021-06-30/serviceresource/id_service_test.go index 2ac3dc83a0e..e603b45396a 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..7d5faff6f88 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_backupfileinfo.go new file mode 100644 index 00000000000..f84cee9b6aa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_backupsetinfo.go new file mode 100644 index 00000000000..a7b98966641 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_blobshare.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_blobshare.go new file mode 100644 index 00000000000..e5f754d0f5f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_blobshare.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_commandproperties.go index 7285e39656f..eb2e46f7153 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_commandproperties.go @@ -1,10 +1,85 @@ package serviceresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connectioninfo.go new file mode 100644 index 00000000000..3047b7e0a50 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connectioninfo.go @@ -0,0 +1,117 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..dedf966cefb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..05582aa01af --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..5a5f0a2c715 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..92ae3685bab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..fd7abcee46b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..8c6070529d9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..108c305b938 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..cba73eeb397 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..aab806bfe26 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..08e868423d6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..4572e72ad44 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..293646a1a7f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..a6311bb3b7f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..f906299dcce --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ef849eede7e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..e2fdb8f6457 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..823eb625641 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..f20cc4136a3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..63b725241a7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..6df3bcfd815 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..39bd37cb91b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..9dfa5d6bf74 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..eea1f392637 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..5a04d5e2c98 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..b9dae40d076 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..3e234f30816 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..bf8ddadda3e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..65082e1af0e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..c7d7d89ac41 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..e029b2b4398 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..e1faf29c46f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..e7028d76d73 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..e44dd125bc6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..2eead3addd2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..2067b0b3c0a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..575405e870e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..fea64caff43 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..d0722818c00 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..3e75409f6f8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_databasebackupinfo.go new file mode 100644 index 00000000000..0ae14cc0724 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_databasefileinfo.go new file mode 100644 index 00000000000..356fbadeac2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_databasesummaryresult.go new file mode 100644 index 00000000000..0c37373d905 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_databasetable.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_databasetable.go new file mode 100644 index 00000000000..31479df4f85 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_databasetable.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..e0c30e97b54 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..e8e51116317 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_executionstatistics.go new file mode 100644 index 00000000000..f7efbaeae20 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_executionstatistics.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_fileshare.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_fileshare.go new file mode 100644 index 00000000000..7b81618d1b5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_fileshare.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..2f9f3c6a8bc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..46b93a57dda --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..152006dc31c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..ffc898bbbbf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..125ca087942 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..359051eaf76 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..8f77833c314 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..38a09adde19 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..e1c6f85e1f4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..74997550e1e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..8c4fcdc57e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..45940e2832f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..ec0886b891b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..39bc3e4fe88 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..eedbe76de60 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..38e32df60e9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..08d53705517 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..7209e0ce31a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..735b2fc909b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..4116c2922e8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..21bc7540b98 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..19e8991155b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..23f9c78b759 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..ae59e533837 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..da42cc25936 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..7dde2d087f7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..a1d8b7eac39 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e9813e93184 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..f710ed66943 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..90dab05a7ba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..b4471b68159 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..ab13fdfe61d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..d94bab64de9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..e3be4e6b6f6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..d71394cecce --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..eb62e80dc9f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..72c4f437fc1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..9926c03eb68 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..dc45f3747ad --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..95cc6ef7b26 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..2c3e79bf4b7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..ccd2fe4fb16 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..a0baa1f50e1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..f534d3ead8f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..e9832b38918 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..8682332631f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e1d23786f10 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..2bd3277e42e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..d43bcd86d36 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..04cb6c5004a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..7a8e9295841 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..78254fdd4dc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..a2a89226448 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..dc618987a0c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..84d7b2df81f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..88657577521 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..a1aade83f11 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..ec675f3ba74 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..0a13aa38cd8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..07803d6ac20 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..6eacddab69a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..ef0b076a3de --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..8b6197a184e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..423d4094b37 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..1864f633c09 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..f9af4ab6789 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..ec5a846f24b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..f90c6b34336 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..e50c78260ac --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..fd15219ef2e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..f682e5ae9b1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..1f6a5242ea3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..13ebf0ab390 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..240d4fcb7ec --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..dd04d560bdd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..a4a211e9297 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..622e989fc73 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..8b845c0dd26 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..1951f580d93 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..36e25908abb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..73921508bfc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..504ad07dac1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..924b0d83f1a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..b83caf07854 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..0cd98305a42 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..06f17593f0d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..198a8d9856e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..205442265bb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..6555f0a59ef --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..0757ad6029f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..fdb892ca69d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskinput.go new file mode 100644 index 00000000000..723cd4eb282 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutput.go new file mode 100644 index 00000000000..8f6405b8c5d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..0610dd47de5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..d4bfffec361 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskproperties.go new file mode 100644 index 00000000000..df10b39a175 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..50e5e2d8513 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..3641462f295 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..a3a66aa8c75 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..740ce1fb64f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationreportresult.go new file mode 100644 index 00000000000..b160d64635e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..da7281862b8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package serviceresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..6c4dff54366 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationresult.go new file mode 100644 index 00000000000..459d57afcd4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..ff68cfa6218 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..43ecbab490f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..1ff798a5545 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..9e3a73cf216 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..08ac1914c18 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..d9ee0a79824 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "MongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..f1ac51cf1e8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..699ebc17291 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..e9015c6aa56 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodberror.go new file mode 100644 index 00000000000..648d454ecb1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodberror.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..64184e426c2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..69fa2bdd9b2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbprogress.go new file mode 100644 index 00000000000..2209d4fb7ba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..711877ce16f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..bec5b7b8d9b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..4731f64dddb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..fbd4539de57 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..89d51f3fe73 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..ab72db046ba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_orphaneduserinfo.go new file mode 100644 index 00000000000..2435c6b6c83 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..9976de5023c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_projecttask.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_projecttask.go index 246b90d99cc..ac713335b18 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_projecttask.go @@ -1,6 +1,9 @@ package serviceresource import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_projecttaskproperties.go index f51a01cb032..fa5f58aa663 100644 --- a/resource-manager/datamigration/2021-06-30/serviceresource/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package serviceresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..881b11caf97 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_queryexecutionresult.go new file mode 100644 index 00000000000..37c8bcb8a83 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_reportableexception.go new file mode 100644 index 00000000000..6796e828608 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_reportableexception.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..713b1d2631c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..24cb5a6a5a4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_selectedcertificateinput.go new file mode 100644 index 00000000000..4fefe71eaeb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_serverproperties.go new file mode 100644 index 00000000000..06cc6f435f4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_serverproperties.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..150eb887095 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..e6580645769 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_ssismigrationinfo.go new file mode 100644 index 00000000000..498cced4bcc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..4313773209d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..0fbd57e83e1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..e769d8dc954 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..4ece32d35fb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..f451cfc4207 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..86d13d45dfd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..0518188760a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..c9d3d77e662 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..5f43f680f3d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..1712b88dbfd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package serviceresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..f1ff6f6e9bb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..da2f5e4704d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..d6e6b8e2780 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_validationerror.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_validationerror.go new file mode 100644 index 00000000000..478e5e29376 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_validationerror.go @@ -0,0 +1,9 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/serviceresource/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/serviceresource/model_waitstatistics.go new file mode 100644 index 00000000000..2320ba49148 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/serviceresource/model_waitstatistics.go @@ -0,0 +1,10 @@ +package serviceresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/README.md b/resource-manager/datamigration/2021-06-30/servicetaskresource/README.md index ac867b3e426..312fa504536 100644 --- a/resource-manager/datamigration/2021-06-30/servicetaskresource/README.md +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") read, err := client.ServiceTasksCancel(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") payload := servicetaskresource.ProjectTask{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") read, err := client.ServiceTasksDelete(ctx, id, servicetaskresource.DefaultServiceTasksDeleteOperationOptions()) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") read, err := client.ServiceTasksGet(ctx, id, servicetaskresource.DefaultServiceTasksGetOperationOptions()) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := servicetaskresource.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") payload := servicetaskresource.ProjectTask{ // ... diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/constants.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/constants.go index d48484b8019..6f6d1cc2ae3 100644 --- a/resource-manager/datamigration/2021-06-30/servicetaskresource/constants.go +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/constants.go @@ -9,32 +9,1409 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForSeverity() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *Severity) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseSeverity(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +1419,324 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SsisMigrationOverwriteOption string + +const ( + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" +) + +func PossibleValuesForSsisMigrationOverwriteOption() []string { + return []string{ + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), + } +} + +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationOverwriteOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationOverwriteOption(input) + return &out, nil +} + +type SsisMigrationStage string + +const ( + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" +) + +func PossibleValuesForSsisMigrationStage() []string { + return []string{ + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), + } +} + +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationStage(input) + return &out, nil +} + +type SsisStoreType string + +const ( + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" +) + +func PossibleValuesForSsisStoreType() []string { + return []string{ + string(SsisStoreTypeSsisCatalog), + } +} + +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisStoreType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisStoreType(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) return &out, nil } @@ -117,3 +1798,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/id_servicetask.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/id_servicetask.go index 0acaba8346f..5e3466f84de 100644 --- a/resource-manager/datamigration/2021-06-30/servicetaskresource/id_servicetask.go +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/id_servicetask.go @@ -117,13 +117,13 @@ func (id ServiceTaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticServiceTasks", "serviceTasks", "serviceTasks"), - resourceids.UserSpecifiedSegment("serviceTaskName", "taskName"), + resourceids.UserSpecifiedSegment("serviceTaskName", "serviceTaskName"), } } diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/id_servicetask_test.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/id_servicetask_test.go index 8b10a48b946..4707016df64 100644 --- a/resource-manager/datamigration/2021-06-30/servicetaskresource/id_servicetask_test.go +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/id_servicetask_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ServiceTaskId{} func TestNewServiceTaskID(t *testing.T) { - id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") + id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.ServiceTaskName != "taskName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "taskName") + if id.ServiceTaskName != "serviceTaskName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "serviceTaskName") } } func TestFormatServiceTaskID(t *testing.T) { - actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName" + actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseServiceTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseServiceTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", - ServiceTaskName: "tAsKnAmE", + ServiceTaskName: "sErViCeTaSkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..956d10f5de3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_backupfileinfo.go new file mode 100644 index 00000000000..1fbddcbd0d8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_backupsetinfo.go new file mode 100644 index 00000000000..ecf870b9e15 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package servicetaskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_blobshare.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_blobshare.go new file mode 100644 index 00000000000..ea5b6728f74 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_blobshare.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_commandproperties.go index 0715f51c95a..a5c9abda2f7 100644 --- a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_commandproperties.go @@ -1,10 +1,85 @@ package servicetaskresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connectioninfo.go new file mode 100644 index 00000000000..ec590fac48b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connectioninfo.go @@ -0,0 +1,117 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "mongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..b2d39501e7f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..7db7e4a33e2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..91948b27ede --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..49f51bc87cc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..bb995544622 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..213a3392394 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..90dbca611e6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..71b6eeeff8c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..ed0a4b41937 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..a5065bed63e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..eccd9c55b39 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..b4f7586d104 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..62d816134d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..b523b90de83 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..9dec0a29cbd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..9ceb6f0477a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..2d2bdb51fff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..b5859584d52 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..adfffda41f5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..e829ea3d57a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..ac462690520 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..e57d9413358 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..3016f9733b8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..cfa68d64fc3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..78f81dc3697 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..7f5ebde7619 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..9939a8f8468 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..3b456116998 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..7c604d52ea9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..b9111ec7f8c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..b59b96736ec --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..8be079059fa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..ebaf018264d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..e3803db4fef --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..01843538eb3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..4e28688a8d1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..c8d52012cc3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..bde5a00a2be --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..b3274d1fd1c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasebackupinfo.go new file mode 100644 index 00000000000..6a0659b8288 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package servicetaskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasefileinfo.go new file mode 100644 index 00000000000..045b908d873 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasesummaryresult.go new file mode 100644 index 00000000000..d98e6ec7740 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package servicetaskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasetable.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasetable.go new file mode 100644 index 00000000000..34900c25a3b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_databasetable.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..cb36c432b5a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..69f12558912 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package servicetaskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_executionstatistics.go new file mode 100644 index 00000000000..19a7747214d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_executionstatistics.go @@ -0,0 +1,13 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_fileshare.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_fileshare.go new file mode 100644 index 00000000000..d8e3358879a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_fileshare.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..ef102fc92ee --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..304043c9b6e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..28ad89093b0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..86edd31a9bf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..2b4e464533a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..a6c5c69bfec --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..9d47b1a3ffb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..ddd47a242bc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..cb88918fa6a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..bc5889f2e5e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..e8dd5c1e4b1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..d89dae9893a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..29daebca847 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..80235a52ae5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..7e0a513bba3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..4af063809cf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..f508a8733ba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..b33b0e54214 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..7e6f858a463 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..49655f65fe8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..5c7c77bf5ee --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..affbf83042b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..9eb906bb39b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..6dea53bb0c6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package servicetaskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..bbb8ad7bb32 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..a3bc37afbed --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..550715cc0be --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..26c14ef05c2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..7c7dc63d526 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..e6c8e968e69 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..8b9250cbf1e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..3d1765f1793 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..9eba31ddc8d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..f41578d1e14 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..cad1bfab0a3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..da3a87f264a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..1786397d0d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..bc4208f97f4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..55dffbfaee5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..641d0aef5a3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..e3fe8c3e586 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..fbf6fdb68a4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..0c69ff58afb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..3ebd841db57 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..fcaec093c0a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..f93ca6c8909 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..14aae51ab2d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..31c81adeb8b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..9e43584e11a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..0b25735ed05 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..02261f7fc28 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..3e663aaf227 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..55e4cf6618b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..1c09ed74b39 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..f00671d509e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..58e3306e6c3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..1d05b89097c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..7580cdd261c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..f71c784afd2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..85364eee7fa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..c5dfc96ca50 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..4275d785c47 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..c03e8f9bf05 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..9d0fdf524ba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..803a205b7c2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..3a46e83f3df --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..558b01bb91a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..55595ab4882 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..de5b99b58bb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..5d90e797784 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..c7d111e96a6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..0768790b7b5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..b8d3eaab164 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..14c97bdfe5c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..e3bd3eb54a1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..f60d22f8ad6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..bb220483394 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..4d33f389d37 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..725897aa0a3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..86513905b27 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..56bb229f63d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..c57f36b4659 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..4cbc2910177 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..ab36279bfc8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..b4421244bb1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..de00dc1bb39 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..845ba56a9ca --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..3b2a9532530 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..b6471c8af3f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..2aab6654c78 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..04ca850696b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskinput.go new file mode 100644 index 00000000000..dab15b0914d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutput.go new file mode 100644 index 00000000000..dd3c63c16cf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..934b2f06513 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..59100f3194d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskproperties.go new file mode 100644 index 00000000000..5b07597295d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..b35a7db7610 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package servicetaskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..2d6e210ab3e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..5836b77ec25 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..35425ac733a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationreportresult.go new file mode 100644 index 00000000000..18b12ecef3b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..02a9ff2fb55 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package servicetaskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..a096b3846e2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationresult.go new file mode 100644 index 00000000000..5b31637b2da --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..f08403d40dd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..d7c8c8d23d0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..a26a68e1ad7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..5cbbddf6ecc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..7cbe6ca6422 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..7dc42b8a963 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "mongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..339609743c6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..2b46fc54c3a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..122f521b624 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodberror.go new file mode 100644 index 00000000000..be1ea6d925d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodberror.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..fb238279e27 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..e8aaab548c9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbprogress.go new file mode 100644 index 00000000000..65146ac0ed7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..687fdf7c6cd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..1992c409b35 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..15dd3586c26 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..042a361229b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..04a3b2d1c15 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..4251b8fafe1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_orphaneduserinfo.go new file mode 100644 index 00000000000..99a245c20bf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..f26cffb15a7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_projecttask.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_projecttask.go index 1b8540bcfcb..be5daafc363 100644 --- a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_projecttask.go @@ -1,6 +1,9 @@ package servicetaskresource import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_projecttaskproperties.go index b1321da735f..573830fb122 100644 --- a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package servicetaskresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..6e764407a23 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_queryexecutionresult.go new file mode 100644 index 00000000000..859897a1897 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_reportableexception.go new file mode 100644 index 00000000000..93ab2f4f4e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_reportableexception.go @@ -0,0 +1,13 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..b91b93ad030 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..5fd21304d9d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_selectedcertificateinput.go new file mode 100644 index 00000000000..fe624130637 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_serverproperties.go new file mode 100644 index 00000000000..936f3950d20 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_serverproperties.go @@ -0,0 +1,13 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..e2b42563b29 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..b22df2ae839 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_ssismigrationinfo.go new file mode 100644 index 00000000000..bd11e23623e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..e50e45a78b5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..a2ef705c3d7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..325a1564f01 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..c8bba6b65f0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..cff1aba4c60 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..6f679813c0b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..8af8a9623f4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..1a591d06e2d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..d3a2c543dbc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..6c80d6bc707 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package servicetaskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..a3044eed366 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..0cb737b6402 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..f2ebd2642dc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validationerror.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validationerror.go new file mode 100644 index 00000000000..7c14d611038 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_validationerror.go @@ -0,0 +1,9 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/servicetaskresource/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_waitstatistics.go new file mode 100644 index 00000000000..4beaf8108cb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/servicetaskresource/model_waitstatistics.go @@ -0,0 +1,10 @@ +package servicetaskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/README.md b/resource-manager/datamigration/2021-06-30/standardoperation/README.md index 45ce16ce3cc..ac1c5db7143 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/README.md +++ b/resource-manager/datamigration/2021-06-30/standardoperation/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") payload := standardoperation.ProjectFile{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.FilesList(ctx, id)` can be used to do batched pagination items, err := client.FilesListComplete(ctx, id) @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesRead(ctx, id) if err != nil { @@ -111,7 +111,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") read, err := client.FilesReadWrite(ctx, id) if err != nil { @@ -127,7 +127,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") +id := standardoperation.NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") payload := standardoperation.ProjectFile{ // ... @@ -148,7 +148,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := standardoperation.Project{ // ... @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsDelete(ctx, id, standardoperation.DefaultProjectsDeleteOperationOptions()) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") read, err := client.ProjectsGet(ctx, id) if err != nil { @@ -201,7 +201,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ProjectsList(ctx, id)` can be used to do batched pagination items, err := client.ProjectsListComplete(ctx, id) @@ -218,7 +218,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") payload := standardoperation.Project{ // ... @@ -256,7 +256,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := standardoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") payload := standardoperation.ProjectTask{ // ... @@ -277,7 +277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := standardoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") read, err := client.ServiceTasksDelete(ctx, id, standardoperation.DefaultServiceTasksDeleteOperationOptions()) if err != nil { @@ -293,7 +293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := standardoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") read, err := client.ServiceTasksGet(ctx, id, standardoperation.DefaultServiceTasksGetOperationOptions()) if err != nil { @@ -309,7 +309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServiceTasksList(ctx, id, standardoperation.DefaultServiceTasksListOperationOptions())` can be used to do batched pagination items, err := client.ServiceTasksListComplete(ctx, id, standardoperation.DefaultServiceTasksListOperationOptions()) @@ -326,7 +326,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") +id := standardoperation.NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") payload := standardoperation.ProjectTask{ // ... @@ -347,7 +347,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := standardoperation.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := standardoperation.NameAvailabilityRequest{ // ... @@ -368,7 +368,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := standardoperation.DataMigrationService{ // ... @@ -385,7 +385,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id, standardoperation.DefaultServicesDeleteOperationOptions()); err != nil { // handle the error @@ -397,7 +397,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id, standardoperation.DefaultServic ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -430,7 +430,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") +id := standardoperation.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") // alternatively `client.ServicesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ServicesListByResourceGroupComplete(ctx, id) @@ -447,7 +447,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") // alternatively `client.ServicesListSkus(ctx, id)` can be used to do batched pagination items, err := client.ServicesListSkusComplete(ctx, id) @@ -464,7 +464,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") +id := standardoperation.NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") payload := standardoperation.DataMigrationService{ // ... @@ -481,7 +481,7 @@ if err := client.ServicesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := standardoperation.ProjectTask{ // ... @@ -502,7 +502,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksDelete(ctx, id, standardoperation.DefaultTasksDeleteOperationOptions()) if err != nil { @@ -518,7 +518,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksGet(ctx, id, standardoperation.DefaultTasksGetOperationOptions()) if err != nil { @@ -534,7 +534,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") +id := standardoperation.NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") // alternatively `client.TasksList(ctx, id, standardoperation.DefaultTasksListOperationOptions())` can be used to do batched pagination items, err := client.TasksListComplete(ctx, id, standardoperation.DefaultTasksListOperationOptions()) @@ -551,7 +551,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := standardoperation.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := standardoperation.ProjectTask{ // ... @@ -572,7 +572,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := standardoperation.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := standardoperation.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.UsagesList(ctx, id)` can be used to do batched pagination items, err := client.UsagesListComplete(ctx, id) diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/constants.go b/resource-manager/datamigration/2021-06-30/standardoperation/constants.go index c33f1fa2bc7..71913fd1592 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/constants.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/constants.go @@ -9,32 +9,32 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandState string +type AuthenticationType string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForAuthenticationType() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseAuthenticationType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,43 +42,53 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := AuthenticationType(input) return &out, nil } -type NameCheckFailureReason string +type BackupFileStatus string const ( - NameCheckFailureReasonAlreadyExists NameCheckFailureReason = "AlreadyExists" - NameCheckFailureReasonInvalid NameCheckFailureReason = "Invalid" + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" ) -func PossibleValuesForNameCheckFailureReason() []string { +func PossibleValuesForBackupFileStatus() []string { return []string{ - string(NameCheckFailureReasonAlreadyExists), - string(NameCheckFailureReasonInvalid), + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), } } -func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseNameCheckFailureReason(decoded) + out, err := parseBackupFileStatus(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -86,40 +96,45 @@ func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { return nil } -func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) { - vals := map[string]NameCheckFailureReason{ - "alreadyexists": NameCheckFailureReasonAlreadyExists, - "invalid": NameCheckFailureReasonInvalid, +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := NameCheckFailureReason(input) + out := BackupFileStatus(input) return &out, nil } -type ProjectProvisioningState string +type BackupMode string const ( - ProjectProvisioningStateDeleting ProjectProvisioningState = "Deleting" - ProjectProvisioningStateSucceeded ProjectProvisioningState = "Succeeded" + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" ) -func PossibleValuesForProjectProvisioningState() []string { +func PossibleValuesForBackupMode() []string { return []string{ - string(ProjectProvisioningStateDeleting), - string(ProjectProvisioningStateSucceeded), + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), } } -func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectProvisioningState(decoded) + out, err := parseBackupMode(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -127,46 +142,50 @@ func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectProvisioningState(input string) (*ProjectProvisioningState, error) { - vals := map[string]ProjectProvisioningState{ - "deleting": ProjectProvisioningStateDeleting, - "succeeded": ProjectProvisioningStateSucceeded, +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectProvisioningState(input) + out := BackupMode(input) return &out, nil } -type ProjectSourcePlatform string +type BackupType string const ( - ProjectSourcePlatformMongoDb ProjectSourcePlatform = "MongoDb" - ProjectSourcePlatformMySQL ProjectSourcePlatform = "MySQL" - ProjectSourcePlatformPostgreSql ProjectSourcePlatform = "PostgreSql" - ProjectSourcePlatformSQL ProjectSourcePlatform = "SQL" - ProjectSourcePlatformUnknown ProjectSourcePlatform = "Unknown" + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" ) -func PossibleValuesForProjectSourcePlatform() []string { +func PossibleValuesForBackupType() []string { return []string{ - string(ProjectSourcePlatformMongoDb), - string(ProjectSourcePlatformMySQL), - string(ProjectSourcePlatformPostgreSql), - string(ProjectSourcePlatformSQL), - string(ProjectSourcePlatformUnknown), + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), } } -func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { +func (s *BackupType) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectSourcePlatform(decoded) + out, err := parseBackupType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -174,51 +193,51 @@ func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectSourcePlatform(input string) (*ProjectSourcePlatform, error) { - vals := map[string]ProjectSourcePlatform{ - "mongodb": ProjectSourcePlatformMongoDb, - "mysql": ProjectSourcePlatformMySQL, - "postgresql": ProjectSourcePlatformPostgreSql, - "sql": ProjectSourcePlatformSQL, - "unknown": ProjectSourcePlatformUnknown, +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectSourcePlatform(input) + out := BackupType(input) return &out, nil } -type ProjectTargetPlatform string +type CommandState string const ( - ProjectTargetPlatformAzureDbForMySql ProjectTargetPlatform = "AzureDbForMySql" - ProjectTargetPlatformAzureDbForPostgreSql ProjectTargetPlatform = "AzureDbForPostgreSql" - ProjectTargetPlatformMongoDb ProjectTargetPlatform = "MongoDb" - ProjectTargetPlatformSQLDB ProjectTargetPlatform = "SQLDB" - ProjectTargetPlatformSQLMI ProjectTargetPlatform = "SQLMI" - ProjectTargetPlatformUnknown ProjectTargetPlatform = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" ) -func PossibleValuesForProjectTargetPlatform() []string { +func PossibleValuesForCommandState() []string { return []string{ - string(ProjectTargetPlatformAzureDbForMySql), - string(ProjectTargetPlatformAzureDbForPostgreSql), - string(ProjectTargetPlatformMongoDb), - string(ProjectTargetPlatformSQLDB), - string(ProjectTargetPlatformSQLMI), - string(ProjectTargetPlatformUnknown), + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), } } -func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { +func (s *CommandState) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseProjectTargetPlatform(decoded) + out, err := parseCommandState(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -226,46 +245,53 @@ func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { return nil } -func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { - vals := map[string]ProjectTargetPlatform{ - "azuredbformysql": ProjectTargetPlatformAzureDbForMySql, - "azuredbforpostgresql": ProjectTargetPlatformAzureDbForPostgreSql, - "mongodb": ProjectTargetPlatformMongoDb, - "sqldb": ProjectTargetPlatformSQLDB, - "sqlmi": ProjectTargetPlatformSQLMI, - "unknown": ProjectTargetPlatformUnknown, +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ProjectTargetPlatform(input) + out := CommandState(input) return &out, nil } -type ResourceSkuCapacityScaleType string +type DatabaseCompatLevel string const ( - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" ) -func PossibleValuesForResourceSkuCapacityScaleType() []string { +func PossibleValuesForDatabaseCompatLevel() []string { return []string{ - string(ResourceSkuCapacityScaleTypeAutomatic), - string(ResourceSkuCapacityScaleTypeManual), - string(ResourceSkuCapacityScaleTypeNone), + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), } } -func (s *ResourceSkuCapacityScaleType) UnmarshalJSON(bytes []byte) error { +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseResourceSkuCapacityScaleType(decoded) + out, err := parseDatabaseCompatLevel(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -273,41 +299,51 @@ func (s *ResourceSkuCapacityScaleType) UnmarshalJSON(bytes []byte) error { return nil } -func parseResourceSkuCapacityScaleType(input string) (*ResourceSkuCapacityScaleType, error) { - vals := map[string]ResourceSkuCapacityScaleType{ - "automatic": ResourceSkuCapacityScaleTypeAutomatic, - "manual": ResourceSkuCapacityScaleTypeManual, - "none": ResourceSkuCapacityScaleTypeNone, +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ResourceSkuCapacityScaleType(input) + out := DatabaseCompatLevel(input) return &out, nil } -type ResourceSkuRestrictionsReasonCode string +type DatabaseFileType string const ( - ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - ResourceSkuRestrictionsReasonCodeQuotaId ResourceSkuRestrictionsReasonCode = "QuotaId" + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" ) -func PossibleValuesForResourceSkuRestrictionsReasonCode() []string { +func PossibleValuesForDatabaseFileType() []string { return []string{ - string(ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription), - string(ResourceSkuRestrictionsReasonCodeQuotaId), + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), } } -func (s *ResourceSkuRestrictionsReasonCode) UnmarshalJSON(bytes []byte) error { +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseResourceSkuRestrictionsReasonCode(decoded) + out, err := parseDatabaseFileType(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -315,38 +351,51 @@ func (s *ResourceSkuRestrictionsReasonCode) UnmarshalJSON(bytes []byte) error { return nil } -func parseResourceSkuRestrictionsReasonCode(input string) (*ResourceSkuRestrictionsReasonCode, error) { - vals := map[string]ResourceSkuRestrictionsReasonCode{ - "notavailableforsubscription": ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription, - "quotaid": ResourceSkuRestrictionsReasonCodeQuotaId, +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ResourceSkuRestrictionsReasonCode(input) + out := DatabaseFileType(input) return &out, nil } -type ResourceSkuRestrictionsType string +type DatabaseMigrationStage string const ( - ResourceSkuRestrictionsTypeLocation ResourceSkuRestrictionsType = "location" + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" ) -func PossibleValuesForResourceSkuRestrictionsType() []string { +func PossibleValuesForDatabaseMigrationStage() []string { return []string{ - string(ResourceSkuRestrictionsTypeLocation), + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), } } -func (s *ResourceSkuRestrictionsType) UnmarshalJSON(bytes []byte) error { +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseResourceSkuRestrictionsType(decoded) + out, err := parseDatabaseMigrationStage(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -354,55 +403,60 @@ func (s *ResourceSkuRestrictionsType) UnmarshalJSON(bytes []byte) error { return nil } -func parseResourceSkuRestrictionsType(input string) (*ResourceSkuRestrictionsType, error) { - vals := map[string]ResourceSkuRestrictionsType{ - "location": ResourceSkuRestrictionsTypeLocation, +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ResourceSkuRestrictionsType(input) + out := DatabaseMigrationStage(input) return &out, nil } -type ServiceProvisioningState string +type DatabaseMigrationState string const ( - ServiceProvisioningStateAccepted ServiceProvisioningState = "Accepted" - ServiceProvisioningStateDeleting ServiceProvisioningState = "Deleting" - ServiceProvisioningStateDeploying ServiceProvisioningState = "Deploying" - ServiceProvisioningStateFailed ServiceProvisioningState = "Failed" - ServiceProvisioningStateFailedToStart ServiceProvisioningState = "FailedToStart" - ServiceProvisioningStateFailedToStop ServiceProvisioningState = "FailedToStop" - ServiceProvisioningStateStarting ServiceProvisioningState = "Starting" - ServiceProvisioningStateStopped ServiceProvisioningState = "Stopped" - ServiceProvisioningStateStopping ServiceProvisioningState = "Stopping" - ServiceProvisioningStateSucceeded ServiceProvisioningState = "Succeeded" + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" ) -func PossibleValuesForServiceProvisioningState() []string { +func PossibleValuesForDatabaseMigrationState() []string { return []string{ - string(ServiceProvisioningStateAccepted), - string(ServiceProvisioningStateDeleting), - string(ServiceProvisioningStateDeploying), - string(ServiceProvisioningStateFailed), - string(ServiceProvisioningStateFailedToStart), - string(ServiceProvisioningStateFailedToStop), - string(ServiceProvisioningStateStarting), - string(ServiceProvisioningStateStopped), - string(ServiceProvisioningStateStopping), - string(ServiceProvisioningStateSucceeded), + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), } } -func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseServiceProvisioningState(decoded) + out, err := parseDatabaseMigrationState(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -410,50 +464,62 @@ func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { return nil } -func parseServiceProvisioningState(input string) (*ServiceProvisioningState, error) { - vals := map[string]ServiceProvisioningState{ - "accepted": ServiceProvisioningStateAccepted, - "deleting": ServiceProvisioningStateDeleting, - "deploying": ServiceProvisioningStateDeploying, - "failed": ServiceProvisioningStateFailed, - "failedtostart": ServiceProvisioningStateFailedToStart, - "failedtostop": ServiceProvisioningStateFailedToStop, - "starting": ServiceProvisioningStateStarting, - "stopped": ServiceProvisioningStateStopped, - "stopping": ServiceProvisioningStateStopping, - "succeeded": ServiceProvisioningStateSucceeded, +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ServiceProvisioningState(input) + out := DatabaseMigrationState(input) return &out, nil } -type ServiceScalability string +type DatabaseState string const ( - ServiceScalabilityAutomatic ServiceScalability = "automatic" - ServiceScalabilityManual ServiceScalability = "manual" - ServiceScalabilityNone ServiceScalability = "none" + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" ) -func PossibleValuesForServiceScalability() []string { +func PossibleValuesForDatabaseState() []string { return []string{ - string(ServiceScalabilityAutomatic), - string(ServiceScalabilityManual), - string(ServiceScalabilityNone), + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), } } -func (s *ServiceScalability) UnmarshalJSON(bytes []byte) error { +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseServiceScalability(decoded) + out, err := parseDatabaseState(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -461,53 +527,61 @@ func (s *ServiceScalability) UnmarshalJSON(bytes []byte) error { return nil } -func parseServiceScalability(input string) (*ServiceScalability, error) { - vals := map[string]ServiceScalability{ - "automatic": ServiceScalabilityAutomatic, - "manual": ServiceScalabilityManual, - "none": ServiceScalabilityNone, +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := ServiceScalability(input) + out := DatabaseState(input) return &out, nil } -type TaskState string +type LoginMigrationStage string const ( - TaskStateCanceled TaskState = "Canceled" - TaskStateFailed TaskState = "Failed" - TaskStateFailedInputValidation TaskState = "FailedInputValidation" - TaskStateFaulted TaskState = "Faulted" - TaskStateQueued TaskState = "Queued" - TaskStateRunning TaskState = "Running" - TaskStateSucceeded TaskState = "Succeeded" - TaskStateUnknown TaskState = "Unknown" + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" ) -func PossibleValuesForTaskState() []string { +func PossibleValuesForLoginMigrationStage() []string { return []string{ - string(TaskStateCanceled), - string(TaskStateFailed), - string(TaskStateFailedInputValidation), - string(TaskStateFaulted), - string(TaskStateQueued), - string(TaskStateRunning), - string(TaskStateSucceeded), - string(TaskStateUnknown), + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), } } -func (s *TaskState) UnmarshalJSON(bytes []byte) error { +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseTaskState(decoded) + out, err := parseLoginMigrationStage(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -515,22 +589,1732 @@ func (s *TaskState) UnmarshalJSON(bytes []byte) error { return nil } -func parseTaskState(input string) (*TaskState, error) { - vals := map[string]TaskState{ - "canceled": TaskStateCanceled, - "failed": TaskStateFailed, - "failedinputvalidation": TaskStateFailedInputValidation, - "faulted": TaskStateFaulted, - "queued": TaskStateQueued, - "running": TaskStateRunning, - "succeeded": TaskStateSucceeded, - "unknown": TaskStateUnknown, +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := TaskState(input) + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type NameCheckFailureReason string + +const ( + NameCheckFailureReasonAlreadyExists NameCheckFailureReason = "AlreadyExists" + NameCheckFailureReasonInvalid NameCheckFailureReason = "Invalid" +) + +func PossibleValuesForNameCheckFailureReason() []string { + return []string{ + string(NameCheckFailureReasonAlreadyExists), + string(NameCheckFailureReasonInvalid), + } +} + +func (s *NameCheckFailureReason) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNameCheckFailureReason(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNameCheckFailureReason(input string) (*NameCheckFailureReason, error) { + vals := map[string]NameCheckFailureReason{ + "alreadyexists": NameCheckFailureReasonAlreadyExists, + "invalid": NameCheckFailureReasonInvalid, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NameCheckFailureReason(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ProjectProvisioningState string + +const ( + ProjectProvisioningStateDeleting ProjectProvisioningState = "Deleting" + ProjectProvisioningStateSucceeded ProjectProvisioningState = "Succeeded" +) + +func PossibleValuesForProjectProvisioningState() []string { + return []string{ + string(ProjectProvisioningStateDeleting), + string(ProjectProvisioningStateSucceeded), + } +} + +func (s *ProjectProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectProvisioningState(input string) (*ProjectProvisioningState, error) { + vals := map[string]ProjectProvisioningState{ + "deleting": ProjectProvisioningStateDeleting, + "succeeded": ProjectProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectProvisioningState(input) + return &out, nil +} + +type ProjectSourcePlatform string + +const ( + ProjectSourcePlatformMongoDb ProjectSourcePlatform = "MongoDb" + ProjectSourcePlatformMySQL ProjectSourcePlatform = "MySQL" + ProjectSourcePlatformPostgreSql ProjectSourcePlatform = "PostgreSql" + ProjectSourcePlatformSQL ProjectSourcePlatform = "SQL" + ProjectSourcePlatformUnknown ProjectSourcePlatform = "Unknown" +) + +func PossibleValuesForProjectSourcePlatform() []string { + return []string{ + string(ProjectSourcePlatformMongoDb), + string(ProjectSourcePlatformMySQL), + string(ProjectSourcePlatformPostgreSql), + string(ProjectSourcePlatformSQL), + string(ProjectSourcePlatformUnknown), + } +} + +func (s *ProjectSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectSourcePlatform(input string) (*ProjectSourcePlatform, error) { + vals := map[string]ProjectSourcePlatform{ + "mongodb": ProjectSourcePlatformMongoDb, + "mysql": ProjectSourcePlatformMySQL, + "postgresql": ProjectSourcePlatformPostgreSql, + "sql": ProjectSourcePlatformSQL, + "unknown": ProjectSourcePlatformUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectSourcePlatform(input) + return &out, nil +} + +type ProjectTargetPlatform string + +const ( + ProjectTargetPlatformAzureDbForMySql ProjectTargetPlatform = "AzureDbForMySql" + ProjectTargetPlatformAzureDbForPostgreSql ProjectTargetPlatform = "AzureDbForPostgreSql" + ProjectTargetPlatformMongoDb ProjectTargetPlatform = "MongoDb" + ProjectTargetPlatformSQLDB ProjectTargetPlatform = "SQLDB" + ProjectTargetPlatformSQLMI ProjectTargetPlatform = "SQLMI" + ProjectTargetPlatformUnknown ProjectTargetPlatform = "Unknown" +) + +func PossibleValuesForProjectTargetPlatform() []string { + return []string{ + string(ProjectTargetPlatformAzureDbForMySql), + string(ProjectTargetPlatformAzureDbForPostgreSql), + string(ProjectTargetPlatformMongoDb), + string(ProjectTargetPlatformSQLDB), + string(ProjectTargetPlatformSQLMI), + string(ProjectTargetPlatformUnknown), + } +} + +func (s *ProjectTargetPlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProjectTargetPlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProjectTargetPlatform(input string) (*ProjectTargetPlatform, error) { + vals := map[string]ProjectTargetPlatform{ + "azuredbformysql": ProjectTargetPlatformAzureDbForMySql, + "azuredbforpostgresql": ProjectTargetPlatformAzureDbForPostgreSql, + "mongodb": ProjectTargetPlatformMongoDb, + "sqldb": ProjectTargetPlatformSQLDB, + "sqlmi": ProjectTargetPlatformSQLMI, + "unknown": ProjectTargetPlatformUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProjectTargetPlatform(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResourceSkuCapacityScaleType string + +const ( + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" +) + +func PossibleValuesForResourceSkuCapacityScaleType() []string { + return []string{ + string(ResourceSkuCapacityScaleTypeAutomatic), + string(ResourceSkuCapacityScaleTypeManual), + string(ResourceSkuCapacityScaleTypeNone), + } +} + +func (s *ResourceSkuCapacityScaleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceSkuCapacityScaleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceSkuCapacityScaleType(input string) (*ResourceSkuCapacityScaleType, error) { + vals := map[string]ResourceSkuCapacityScaleType{ + "automatic": ResourceSkuCapacityScaleTypeAutomatic, + "manual": ResourceSkuCapacityScaleTypeManual, + "none": ResourceSkuCapacityScaleTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuCapacityScaleType(input) + return &out, nil +} + +type ResourceSkuRestrictionsReasonCode string + +const ( + ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + ResourceSkuRestrictionsReasonCodeQuotaId ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +func PossibleValuesForResourceSkuRestrictionsReasonCode() []string { + return []string{ + string(ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription), + string(ResourceSkuRestrictionsReasonCodeQuotaId), + } +} + +func (s *ResourceSkuRestrictionsReasonCode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceSkuRestrictionsReasonCode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceSkuRestrictionsReasonCode(input string) (*ResourceSkuRestrictionsReasonCode, error) { + vals := map[string]ResourceSkuRestrictionsReasonCode{ + "notavailableforsubscription": ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription, + "quotaid": ResourceSkuRestrictionsReasonCodeQuotaId, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuRestrictionsReasonCode(input) + return &out, nil +} + +type ResourceSkuRestrictionsType string + +const ( + ResourceSkuRestrictionsTypeLocation ResourceSkuRestrictionsType = "location" +) + +func PossibleValuesForResourceSkuRestrictionsType() []string { + return []string{ + string(ResourceSkuRestrictionsTypeLocation), + } +} + +func (s *ResourceSkuRestrictionsType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceSkuRestrictionsType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceSkuRestrictionsType(input string) (*ResourceSkuRestrictionsType, error) { + vals := map[string]ResourceSkuRestrictionsType{ + "location": ResourceSkuRestrictionsTypeLocation, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceSkuRestrictionsType(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type ServiceProvisioningState string + +const ( + ServiceProvisioningStateAccepted ServiceProvisioningState = "Accepted" + ServiceProvisioningStateDeleting ServiceProvisioningState = "Deleting" + ServiceProvisioningStateDeploying ServiceProvisioningState = "Deploying" + ServiceProvisioningStateFailed ServiceProvisioningState = "Failed" + ServiceProvisioningStateFailedToStart ServiceProvisioningState = "FailedToStart" + ServiceProvisioningStateFailedToStop ServiceProvisioningState = "FailedToStop" + ServiceProvisioningStateStarting ServiceProvisioningState = "Starting" + ServiceProvisioningStateStopped ServiceProvisioningState = "Stopped" + ServiceProvisioningStateStopping ServiceProvisioningState = "Stopping" + ServiceProvisioningStateSucceeded ServiceProvisioningState = "Succeeded" +) + +func PossibleValuesForServiceProvisioningState() []string { + return []string{ + string(ServiceProvisioningStateAccepted), + string(ServiceProvisioningStateDeleting), + string(ServiceProvisioningStateDeploying), + string(ServiceProvisioningStateFailed), + string(ServiceProvisioningStateFailedToStart), + string(ServiceProvisioningStateFailedToStop), + string(ServiceProvisioningStateStarting), + string(ServiceProvisioningStateStopped), + string(ServiceProvisioningStateStopping), + string(ServiceProvisioningStateSucceeded), + } +} + +func (s *ServiceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceProvisioningState(input string) (*ServiceProvisioningState, error) { + vals := map[string]ServiceProvisioningState{ + "accepted": ServiceProvisioningStateAccepted, + "deleting": ServiceProvisioningStateDeleting, + "deploying": ServiceProvisioningStateDeploying, + "failed": ServiceProvisioningStateFailed, + "failedtostart": ServiceProvisioningStateFailedToStart, + "failedtostop": ServiceProvisioningStateFailedToStop, + "starting": ServiceProvisioningStateStarting, + "stopped": ServiceProvisioningStateStopped, + "stopping": ServiceProvisioningStateStopping, + "succeeded": ServiceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceProvisioningState(input) + return &out, nil +} + +type ServiceScalability string + +const ( + ServiceScalabilityAutomatic ServiceScalability = "automatic" + ServiceScalabilityManual ServiceScalability = "manual" + ServiceScalabilityNone ServiceScalability = "none" +) + +func PossibleValuesForServiceScalability() []string { + return []string{ + string(ServiceScalabilityAutomatic), + string(ServiceScalabilityManual), + string(ServiceScalabilityNone), + } +} + +func (s *ServiceScalability) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceScalability(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceScalability(input string) (*ServiceScalability, error) { + vals := map[string]ServiceScalability{ + "automatic": ServiceScalabilityAutomatic, + "manual": ServiceScalabilityManual, + "none": ServiceScalabilityNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceScalability(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SsisMigrationOverwriteOption string + +const ( + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" +) + +func PossibleValuesForSsisMigrationOverwriteOption() []string { + return []string{ + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), + } +} + +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationOverwriteOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationOverwriteOption(input) + return &out, nil +} + +type SsisMigrationStage string + +const ( + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" +) + +func PossibleValuesForSsisMigrationStage() []string { + return []string{ + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), + } +} + +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationStage(input) + return &out, nil +} + +type SsisStoreType string + +const ( + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" +) + +func PossibleValuesForSsisStoreType() []string { + return []string{ + string(SsisStoreTypeSsisCatalog), + } +} + +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisStoreType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisStoreType(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) + return &out, nil +} + +type TaskState string + +const ( + TaskStateCanceled TaskState = "Canceled" + TaskStateFailed TaskState = "Failed" + TaskStateFailedInputValidation TaskState = "FailedInputValidation" + TaskStateFaulted TaskState = "Faulted" + TaskStateQueued TaskState = "Queued" + TaskStateRunning TaskState = "Running" + TaskStateSucceeded TaskState = "Succeeded" + TaskStateUnknown TaskState = "Unknown" +) + +func PossibleValuesForTaskState() []string { + return []string{ + string(TaskStateCanceled), + string(TaskStateFailed), + string(TaskStateFailedInputValidation), + string(TaskStateFaulted), + string(TaskStateQueued), + string(TaskStateRunning), + string(TaskStateSucceeded), + string(TaskStateUnknown), + } +} + +func (s *TaskState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTaskState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTaskState(input string) (*TaskState, error) { + vals := map[string]TaskState{ + "canceled": TaskStateCanceled, + "failed": TaskStateFailed, + "failedinputvalidation": TaskStateFailedInputValidation, + "faulted": TaskStateFaulted, + "queued": TaskStateQueued, + "running": TaskStateRunning, + "succeeded": TaskStateSucceeded, + "unknown": TaskStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TaskState(input) + return &out, nil +} + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) return &out, nil } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_file.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_file.go index 35c308233ac..5a91c520746 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_file.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_file.go @@ -123,7 +123,7 @@ func (id FileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_file_test.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_file_test.go index 42622211c1e..edf96d895e8 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_file_test.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_file_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FileId{} func TestNewFileID(t *testing.T) { - id := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName") + id := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewFileID(t *testing.T) { } func TestFormatFileID(t *testing.T) { - actual := NewFileID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "fileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" + actual := NewFileID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "fileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseFileID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -122,7 +122,7 @@ func TestParseFileID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", FileName: "fileName", @@ -298,15 +298,15 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/files/fileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE", Expected: &FileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", FileName: "fIlEnAmE", @@ -314,7 +314,7 @@ func TestParseFileIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/fIlEs/fIlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_location.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_location.go index d0a0092517b..2ab4d2bae9d 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_location.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_location_test.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_location_test.go index c323d21bc2a..7772869feab 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_location_test.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataMigration/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_project.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_project.go index 04bfb08ae23..1dd919dc933 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_project.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_project.go @@ -117,7 +117,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_project_test.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_project_test.go index ae2ef2d185b..076fcc9395d 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_project_test.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_project_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -32,8 +32,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_resourcegroup.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_resourcegroup.go index 5e91cd3b2af..c4b53b2944c 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_resourcegroup.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_resourcegroup.go @@ -105,7 +105,7 @@ func (id ResourceGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), } } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_resourcegroup_test.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_resourcegroup_test.go index e61c5b87602..5ee11092426 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_resourcegroup_test.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_resourcegroup_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ResourceGroupId{} func TestNewResourceGroupID(t *testing.T) { - id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName") + id := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } } func TestFormatResourceGroupID(t *testing.T) { - actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName" + actual := NewResourceGroupID("12345678-1234-9876-4563-123456789012", "resourceGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseResourceGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseResourceGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Expected: &ResourceGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_service.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_service.go index 95844f3b7ab..dadc95540e3 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_service.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_service.go @@ -111,7 +111,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_service_test.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_service_test.go index 97521f713d8..77ad8489e7f 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_service_test.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_service_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -28,8 +28,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_servicetask.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_servicetask.go index 455edb85871..fe6e03174b2 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_servicetask.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_servicetask.go @@ -117,13 +117,13 @@ func (id ServiceTaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticServiceTasks", "serviceTasks", "serviceTasks"), - resourceids.UserSpecifiedSegment("serviceTaskName", "taskName"), + resourceids.UserSpecifiedSegment("serviceTaskName", "serviceTaskName"), } } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_servicetask_test.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_servicetask_test.go index 2a5dd62eee3..082bc4c0c98 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_servicetask_test.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_servicetask_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ServiceTaskId{} func TestNewServiceTaskID(t *testing.T) { - id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName") + id := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.ServiceTaskName != "taskName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "taskName") + if id.ServiceTaskName != "serviceTaskName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceTaskName'", id.ServiceTaskName, "serviceTaskName") } } func TestFormatServiceTaskID(t *testing.T) { - actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName" + actual := NewServiceTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "serviceTaskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseServiceTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseServiceTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", - ServiceTaskName: "taskName", + ServiceTaskName: "serviceTaskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/serviceTasks/serviceTaskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe", Expected: &ServiceTaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", - ServiceTaskName: "tAsKnAmE", + ServiceTaskName: "sErViCeTaSkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/sErViCeTaSkS/sErViCeTaSkNaMe/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_task.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_task.go index 1238cf9eb3d..7d8b593e186 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_task.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/id_task_test.go b/resource-manager/datamigration/2021-06-30/standardoperation/id_task_test.go index 1924c76e412..81ff8432eb0 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/id_task_test.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..3b64e6f440b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_backupfileinfo.go new file mode 100644 index 00000000000..518c2f93101 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_backupsetinfo.go new file mode 100644 index 00000000000..33e7144bb5c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_blobshare.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_blobshare.go new file mode 100644 index 00000000000..fd94cff95ff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_blobshare.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_commandproperties.go index 5e78256c7a9..bafec93e24d 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_commandproperties.go @@ -1,10 +1,85 @@ package standardoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connectioninfo.go index 263aa03f0b3..a817745d831 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/model_connectioninfo.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connectioninfo.go @@ -1,10 +1,117 @@ package standardoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionInfo struct { +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { Password *string `json:"password,omitempty"` Type string `json:"type"` UserName *string `json:"userName,omitempty"` } + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..8a4abe1f16d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..19c92ecf821 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..95768db450a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..7642d6e1dd8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..862706dd33a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..c01f20e1519 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..920a6111257 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..476a6f01951 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..83b0fe4065a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..93c8c15f7ef --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..0446e95550c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..2434aa38f6d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..e2ae1c203ae --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..77befc58090 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..2b055019588 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..78b9b9875d0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..f799468e0f7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..a5c372cb054 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..ace097e00bb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..89b29e3317e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..d39eb6bf99f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..85a5461635c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..b497d1e196b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..5da96f8346b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..da60da9dfb5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..8c77e08cf36 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..be334e4e14f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..85fa2329ea5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..a987a6eaba0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..04d0da5f903 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..46993004a47 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..a23f3362a3f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..420fd2fa103 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..c12ca204398 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..cad65277742 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..4b1cd928983 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..7ec42ef572a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..373008bae1a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..950fa0c07c0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_databasebackupinfo.go new file mode 100644 index 00000000000..74d6e69c67f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_databasefileinfo.go new file mode 100644 index 00000000000..1962a790a06 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_databasesummaryresult.go new file mode 100644 index 00000000000..88262ee7a3c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_databasetable.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_databasetable.go new file mode 100644 index 00000000000..e7e5af5c618 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_databasetable.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..c02765b9a1c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..c52e2bac8a4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_executionstatistics.go new file mode 100644 index 00000000000..7f4c6916f00 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_executionstatistics.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_fileshare.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_fileshare.go new file mode 100644 index 00000000000..b8843a2af5a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_fileshare.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..061c2440476 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..0f1e7ead922 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..e11bc5a74a0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..171350ca48f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..f279f506d9f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..8a84e68eefd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..91f7eb9ea91 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..2bb2359fd2a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..9c90821d2d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..5eeac1b25e2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..98e2b160918 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..2daa095ff3a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..987e63ff3a8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..bd9ab2763e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..76005088766 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..2af4b0d0a4c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..2b93a6c1d77 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..f5d8169a9f2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..f03114ed088 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..297b62ca860 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..b949339b85d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..6deee788ab8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..908f8fa98aa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..cfa868e2162 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..c57c28dcc05 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..a8899078ed1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..2ef815bd2cc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..2a1e2353bc3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..518ea057737 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..3efaf4981b4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..89ba9639692 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..04d7d9d06f6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..46fca83f276 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..476b4b4ee03 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..2db184f4232 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..6cb609cd686 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..1c9471161dc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..320aa2815a0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..834923be516 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..4957f913175 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..7180e76a2f1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..f1759d2f3e9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..e0aba453ca6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..5d38a774188 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..cbf1999525e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..ceb17ecda47 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..d26b704f874 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..90fedca9be2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..daa8f452a4c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..27f5595287f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..beed056a636 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..b36ce5bc91d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..ce0145c614d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..dd4305e7831 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..53d69ed4481 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..220a0f433f3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..8d525891f48 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..2b909d12fff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..052df84d541 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..94797970740 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..0418d7a838c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..f6fd5eec779 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..c10d21c2fcb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..56dca00efaf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..b8db98e2abc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..b0b8da102e6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..19db8816be5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..59bfa509f40 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..7d056d00296 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..cdfb0028704 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..42db2b80a36 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..53eb35d35dd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..76c07cc532e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..44e76acb8a0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..e3d145f485c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..408dd58ff72 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..5be6660d4d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..7d2c10e1ee3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..a362f46d57c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..a90b2b76d96 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..396df0a9bf5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..b63529be27d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..798e1c1003d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..0b1822edac5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..275cc7947e1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..f6d38bbed9c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..9cc346b1f32 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..3f421dc6a61 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..aa37a182f75 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..aade3634a05 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..c3603c18e5e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskinput.go new file mode 100644 index 00000000000..cbccefd55aa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutput.go new file mode 100644 index 00000000000..ff998744882 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..7467dbbe29d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..34f1abf1652 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskproperties.go new file mode 100644 index 00000000000..1dfcad81a25 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..42a48ac77be --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..ea32e5edc5e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..87a1619261b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..b3de2426c3c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationreportresult.go new file mode 100644 index 00000000000..98300b226f7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..404bdf9be50 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package standardoperation + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..b125e7c847d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationresult.go new file mode 100644 index 00000000000..ed478b25729 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..8f85520417e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..5e6b9830dd5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..46d8be9acb6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..f6b96b3d808 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..d605e737340 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..e8e61583e26 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "MongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..282f3c78507 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..981c255c476 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..17cdd437e92 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodberror.go new file mode 100644 index 00000000000..1842a1847dd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodberror.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..6c6ec6e7a4e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..6693a25fb28 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbprogress.go new file mode 100644 index 00000000000..efa9cd92a74 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..1dad735fa92 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..e787439e186 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..de0cabd7375 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..53eb9f20987 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..a57256fca9f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..7c6c36e0da5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_orphaneduserinfo.go new file mode 100644 index 00000000000..48606cab2cd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..5973da586cc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_projectproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_projectproperties.go index ada5570436d..3da48419dc7 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/model_projectproperties.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_projectproperties.go @@ -1,6 +1,8 @@ package standardoperation import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -13,9 +15,9 @@ type ProjectProperties struct { CreationTime *string `json:"creationTime,omitempty"` DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` - SourceConnectionInfo *ConnectionInfo `json:"sourceConnectionInfo,omitempty"` + SourceConnectionInfo ConnectionInfo `json:"sourceConnectionInfo"` SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` - TargetConnectionInfo *ConnectionInfo `json:"targetConnectionInfo,omitempty"` + TargetConnectionInfo ConnectionInfo `json:"targetConnectionInfo"` TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` } @@ -30,3 +32,47 @@ func (o *ProjectProperties) SetCreationTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.CreationTime = &formatted } + +var _ json.Unmarshaler = &ProjectProperties{} + +func (s *ProjectProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + CreationTime *string `json:"creationTime,omitempty"` + DatabasesInfo *[]DatabaseInfo `json:"databasesInfo,omitempty"` + ProvisioningState *ProjectProvisioningState `json:"provisioningState,omitempty"` + SourcePlatform ProjectSourcePlatform `json:"sourcePlatform"` + TargetPlatform ProjectTargetPlatform `json:"targetPlatform"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.CreationTime = decoded.CreationTime + s.DatabasesInfo = decoded.DatabasesInfo + s.ProvisioningState = decoded.ProvisioningState + s.SourcePlatform = decoded.SourcePlatform + s.TargetPlatform = decoded.TargetPlatform + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["sourceConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'SourceConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.SourceConnectionInfo = impl + } + + if v, ok := temp["targetConnectionInfo"]; ok { + impl, err := UnmarshalConnectionInfoImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'TargetConnectionInfo' for 'ProjectProperties': %+v", err) + } + s.TargetConnectionInfo = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_projecttask.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_projecttask.go index 648312822a8..8fee608ca0c 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_projecttask.go @@ -1,6 +1,9 @@ package standardoperation import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_projecttaskproperties.go index 000c20fceb2..7fed4a08b4e 100644 --- a/resource-manager/datamigration/2021-06-30/standardoperation/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package standardoperation +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..3abd2b09405 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_queryexecutionresult.go new file mode 100644 index 00000000000..dc73c5d4c79 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_reportableexception.go new file mode 100644 index 00000000000..eb016d5302f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_reportableexception.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..6014e8145d9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..e37d06e5bd9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_selectedcertificateinput.go new file mode 100644 index 00000000000..f90ab97ec64 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_serverproperties.go new file mode 100644 index 00000000000..d38f963efd7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_serverproperties.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..34bcc8f5247 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..5d913e91c33 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_ssismigrationinfo.go new file mode 100644 index 00000000000..83326974c1d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..b3b1cf8f6b0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..5fe9e3ada53 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..77ebf553059 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..b940cc2b66b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..808d3f521cb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..ac451018e63 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..b53647f19b4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..8bd6239d105 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..4ffdc4ac64f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..10effb9425f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package standardoperation + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..ee924fe1d56 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..6b177cc0d5b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..b32d25bf77e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_validationerror.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_validationerror.go new file mode 100644 index 00000000000..416bdafc455 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_validationerror.go @@ -0,0 +1,9 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/standardoperation/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/standardoperation/model_waitstatistics.go new file mode 100644 index 00000000000..764f04979d4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/standardoperation/model_waitstatistics.go @@ -0,0 +1,10 @@ +package standardoperation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/README.md b/resource-manager/datamigration/2021-06-30/taskresource/README.md index fb016438252..758f6cd30ae 100644 --- a/resource-manager/datamigration/2021-06-30/taskresource/README.md +++ b/resource-manager/datamigration/2021-06-30/taskresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksCancel(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := taskresource.CommandProperties{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := taskresource.ProjectTask{ // ... @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksDelete(ctx, id, taskresource.DefaultTasksDeleteOperationOptions()) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") read, err := client.TasksGet(ctx, id, taskresource.DefaultTasksGetOperationOptions()) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") +id := taskresource.NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") payload := taskresource.ProjectTask{ // ... diff --git a/resource-manager/datamigration/2021-06-30/taskresource/constants.go b/resource-manager/datamigration/2021-06-30/taskresource/constants.go index 79213946643..5bc3c57adf8 100644 --- a/resource-manager/datamigration/2021-06-30/taskresource/constants.go +++ b/resource-manager/datamigration/2021-06-30/taskresource/constants.go @@ -9,32 +9,1409 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AuthenticationType string + +const ( + AuthenticationTypeActiveDirectoryIntegrated AuthenticationType = "ActiveDirectoryIntegrated" + AuthenticationTypeActiveDirectoryPassword AuthenticationType = "ActiveDirectoryPassword" + AuthenticationTypeNone AuthenticationType = "None" + AuthenticationTypeSqlAuthentication AuthenticationType = "SqlAuthentication" + AuthenticationTypeWindowsAuthentication AuthenticationType = "WindowsAuthentication" +) + +func PossibleValuesForAuthenticationType() []string { + return []string{ + string(AuthenticationTypeActiveDirectoryIntegrated), + string(AuthenticationTypeActiveDirectoryPassword), + string(AuthenticationTypeNone), + string(AuthenticationTypeSqlAuthentication), + string(AuthenticationTypeWindowsAuthentication), + } +} + +func (s *AuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationType(input string) (*AuthenticationType, error) { + vals := map[string]AuthenticationType{ + "activedirectoryintegrated": AuthenticationTypeActiveDirectoryIntegrated, + "activedirectorypassword": AuthenticationTypeActiveDirectoryPassword, + "none": AuthenticationTypeNone, + "sqlauthentication": AuthenticationTypeSqlAuthentication, + "windowsauthentication": AuthenticationTypeWindowsAuthentication, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationType(input) + return &out, nil +} + +type BackupFileStatus string + +const ( + BackupFileStatusArrived BackupFileStatus = "Arrived" + BackupFileStatusCancelled BackupFileStatus = "Cancelled" + BackupFileStatusQueued BackupFileStatus = "Queued" + BackupFileStatusRestored BackupFileStatus = "Restored" + BackupFileStatusRestoring BackupFileStatus = "Restoring" + BackupFileStatusUploaded BackupFileStatus = "Uploaded" + BackupFileStatusUploading BackupFileStatus = "Uploading" +) + +func PossibleValuesForBackupFileStatus() []string { + return []string{ + string(BackupFileStatusArrived), + string(BackupFileStatusCancelled), + string(BackupFileStatusQueued), + string(BackupFileStatusRestored), + string(BackupFileStatusRestoring), + string(BackupFileStatusUploaded), + string(BackupFileStatusUploading), + } +} + +func (s *BackupFileStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupFileStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupFileStatus(input string) (*BackupFileStatus, error) { + vals := map[string]BackupFileStatus{ + "arrived": BackupFileStatusArrived, + "cancelled": BackupFileStatusCancelled, + "queued": BackupFileStatusQueued, + "restored": BackupFileStatusRestored, + "restoring": BackupFileStatusRestoring, + "uploaded": BackupFileStatusUploaded, + "uploading": BackupFileStatusUploading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupFileStatus(input) + return &out, nil +} + +type BackupMode string + +const ( + BackupModeCreateBackup BackupMode = "CreateBackup" + BackupModeExistingBackup BackupMode = "ExistingBackup" +) + +func PossibleValuesForBackupMode() []string { + return []string{ + string(BackupModeCreateBackup), + string(BackupModeExistingBackup), + } +} + +func (s *BackupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupMode(input string) (*BackupMode, error) { + vals := map[string]BackupMode{ + "createbackup": BackupModeCreateBackup, + "existingbackup": BackupModeExistingBackup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupMode(input) + return &out, nil +} + +type BackupType string + +const ( + BackupTypeDatabase BackupType = "Database" + BackupTypeDifferentialDatabase BackupType = "DifferentialDatabase" + BackupTypeDifferentialFile BackupType = "DifferentialFile" + BackupTypeDifferentialPartial BackupType = "DifferentialPartial" + BackupTypeFile BackupType = "File" + BackupTypePartial BackupType = "Partial" + BackupTypeTransactionLog BackupType = "TransactionLog" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeDatabase), + string(BackupTypeDifferentialDatabase), + string(BackupTypeDifferentialFile), + string(BackupTypeDifferentialPartial), + string(BackupTypeFile), + string(BackupTypePartial), + string(BackupTypeTransactionLog), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "database": BackupTypeDatabase, + "differentialdatabase": BackupTypeDifferentialDatabase, + "differentialfile": BackupTypeDifferentialFile, + "differentialpartial": BackupTypeDifferentialPartial, + "file": BackupTypeFile, + "partial": BackupTypePartial, + "transactionlog": BackupTypeTransactionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + type CommandState string const ( - CommandStateAccepted CommandState = "Accepted" - CommandStateFailed CommandState = "Failed" - CommandStateRunning CommandState = "Running" - CommandStateSucceeded CommandState = "Succeeded" - CommandStateUnknown CommandState = "Unknown" + CommandStateAccepted CommandState = "Accepted" + CommandStateFailed CommandState = "Failed" + CommandStateRunning CommandState = "Running" + CommandStateSucceeded CommandState = "Succeeded" + CommandStateUnknown CommandState = "Unknown" +) + +func PossibleValuesForCommandState() []string { + return []string{ + string(CommandStateAccepted), + string(CommandStateFailed), + string(CommandStateRunning), + string(CommandStateSucceeded), + string(CommandStateUnknown), + } +} + +func (s *CommandState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCommandState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCommandState(input string) (*CommandState, error) { + vals := map[string]CommandState{ + "accepted": CommandStateAccepted, + "failed": CommandStateFailed, + "running": CommandStateRunning, + "succeeded": CommandStateSucceeded, + "unknown": CommandStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CommandState(input) + return &out, nil +} + +type DatabaseCompatLevel string + +const ( + DatabaseCompatLevelCompatLevelEightZero DatabaseCompatLevel = "CompatLevel80" + DatabaseCompatLevelCompatLevelNineZero DatabaseCompatLevel = "CompatLevel90" + DatabaseCompatLevelCompatLevelOneFourZero DatabaseCompatLevel = "CompatLevel140" + DatabaseCompatLevelCompatLevelOneHundred DatabaseCompatLevel = "CompatLevel100" + DatabaseCompatLevelCompatLevelOneOneZero DatabaseCompatLevel = "CompatLevel110" + DatabaseCompatLevelCompatLevelOneThreeZero DatabaseCompatLevel = "CompatLevel130" + DatabaseCompatLevelCompatLevelOneTwoZero DatabaseCompatLevel = "CompatLevel120" +) + +func PossibleValuesForDatabaseCompatLevel() []string { + return []string{ + string(DatabaseCompatLevelCompatLevelEightZero), + string(DatabaseCompatLevelCompatLevelNineZero), + string(DatabaseCompatLevelCompatLevelOneFourZero), + string(DatabaseCompatLevelCompatLevelOneHundred), + string(DatabaseCompatLevelCompatLevelOneOneZero), + string(DatabaseCompatLevelCompatLevelOneThreeZero), + string(DatabaseCompatLevelCompatLevelOneTwoZero), + } +} + +func (s *DatabaseCompatLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseCompatLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseCompatLevel(input string) (*DatabaseCompatLevel, error) { + vals := map[string]DatabaseCompatLevel{ + "compatlevel80": DatabaseCompatLevelCompatLevelEightZero, + "compatlevel90": DatabaseCompatLevelCompatLevelNineZero, + "compatlevel140": DatabaseCompatLevelCompatLevelOneFourZero, + "compatlevel100": DatabaseCompatLevelCompatLevelOneHundred, + "compatlevel110": DatabaseCompatLevelCompatLevelOneOneZero, + "compatlevel130": DatabaseCompatLevelCompatLevelOneThreeZero, + "compatlevel120": DatabaseCompatLevelCompatLevelOneTwoZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseCompatLevel(input) + return &out, nil +} + +type DatabaseFileType string + +const ( + DatabaseFileTypeFilestream DatabaseFileType = "Filestream" + DatabaseFileTypeFulltext DatabaseFileType = "Fulltext" + DatabaseFileTypeLog DatabaseFileType = "Log" + DatabaseFileTypeNotSupported DatabaseFileType = "NotSupported" + DatabaseFileTypeRows DatabaseFileType = "Rows" +) + +func PossibleValuesForDatabaseFileType() []string { + return []string{ + string(DatabaseFileTypeFilestream), + string(DatabaseFileTypeFulltext), + string(DatabaseFileTypeLog), + string(DatabaseFileTypeNotSupported), + string(DatabaseFileTypeRows), + } +} + +func (s *DatabaseFileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseFileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseFileType(input string) (*DatabaseFileType, error) { + vals := map[string]DatabaseFileType{ + "filestream": DatabaseFileTypeFilestream, + "fulltext": DatabaseFileTypeFulltext, + "log": DatabaseFileTypeLog, + "notsupported": DatabaseFileTypeNotSupported, + "rows": DatabaseFileTypeRows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseFileType(input) + return &out, nil +} + +type DatabaseMigrationStage string + +const ( + DatabaseMigrationStageBackup DatabaseMigrationStage = "Backup" + DatabaseMigrationStageCompleted DatabaseMigrationStage = "Completed" + DatabaseMigrationStageFileCopy DatabaseMigrationStage = "FileCopy" + DatabaseMigrationStageInitialize DatabaseMigrationStage = "Initialize" + DatabaseMigrationStageNone DatabaseMigrationStage = "None" + DatabaseMigrationStageRestore DatabaseMigrationStage = "Restore" +) + +func PossibleValuesForDatabaseMigrationStage() []string { + return []string{ + string(DatabaseMigrationStageBackup), + string(DatabaseMigrationStageCompleted), + string(DatabaseMigrationStageFileCopy), + string(DatabaseMigrationStageInitialize), + string(DatabaseMigrationStageNone), + string(DatabaseMigrationStageRestore), + } +} + +func (s *DatabaseMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationStage(input string) (*DatabaseMigrationStage, error) { + vals := map[string]DatabaseMigrationStage{ + "backup": DatabaseMigrationStageBackup, + "completed": DatabaseMigrationStageCompleted, + "filecopy": DatabaseMigrationStageFileCopy, + "initialize": DatabaseMigrationStageInitialize, + "none": DatabaseMigrationStageNone, + "restore": DatabaseMigrationStageRestore, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationStage(input) + return &out, nil +} + +type DatabaseMigrationState string + +const ( + DatabaseMigrationStateCANCELLED DatabaseMigrationState = "CANCELLED" + DatabaseMigrationStateCOMPLETED DatabaseMigrationState = "COMPLETED" + DatabaseMigrationStateCUTOVERSTART DatabaseMigrationState = "CUTOVER_START" + DatabaseMigrationStateFAILED DatabaseMigrationState = "FAILED" + DatabaseMigrationStateFULLBACKUPUPLOADSTART DatabaseMigrationState = "FULL_BACKUP_UPLOAD_START" + DatabaseMigrationStateINITIAL DatabaseMigrationState = "INITIAL" + DatabaseMigrationStateLOGSHIPPINGSTART DatabaseMigrationState = "LOG_SHIPPING_START" + DatabaseMigrationStatePOSTCUTOVERCOMPLETE DatabaseMigrationState = "POST_CUTOVER_COMPLETE" + DatabaseMigrationStateUNDEFINED DatabaseMigrationState = "UNDEFINED" + DatabaseMigrationStateUPLOADLOGFILESSTART DatabaseMigrationState = "UPLOAD_LOG_FILES_START" +) + +func PossibleValuesForDatabaseMigrationState() []string { + return []string{ + string(DatabaseMigrationStateCANCELLED), + string(DatabaseMigrationStateCOMPLETED), + string(DatabaseMigrationStateCUTOVERSTART), + string(DatabaseMigrationStateFAILED), + string(DatabaseMigrationStateFULLBACKUPUPLOADSTART), + string(DatabaseMigrationStateINITIAL), + string(DatabaseMigrationStateLOGSHIPPINGSTART), + string(DatabaseMigrationStatePOSTCUTOVERCOMPLETE), + string(DatabaseMigrationStateUNDEFINED), + string(DatabaseMigrationStateUPLOADLOGFILESSTART), + } +} + +func (s *DatabaseMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseMigrationState(input string) (*DatabaseMigrationState, error) { + vals := map[string]DatabaseMigrationState{ + "cancelled": DatabaseMigrationStateCANCELLED, + "completed": DatabaseMigrationStateCOMPLETED, + "cutover_start": DatabaseMigrationStateCUTOVERSTART, + "failed": DatabaseMigrationStateFAILED, + "full_backup_upload_start": DatabaseMigrationStateFULLBACKUPUPLOADSTART, + "initial": DatabaseMigrationStateINITIAL, + "log_shipping_start": DatabaseMigrationStateLOGSHIPPINGSTART, + "post_cutover_complete": DatabaseMigrationStatePOSTCUTOVERCOMPLETE, + "undefined": DatabaseMigrationStateUNDEFINED, + "upload_log_files_start": DatabaseMigrationStateUPLOADLOGFILESSTART, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseMigrationState(input) + return &out, nil +} + +type DatabaseState string + +const ( + DatabaseStateCopying DatabaseState = "Copying" + DatabaseStateEmergency DatabaseState = "Emergency" + DatabaseStateOffline DatabaseState = "Offline" + DatabaseStateOfflineSecondary DatabaseState = "OfflineSecondary" + DatabaseStateOnline DatabaseState = "Online" + DatabaseStateRecovering DatabaseState = "Recovering" + DatabaseStateRecoveryPending DatabaseState = "RecoveryPending" + DatabaseStateRestoring DatabaseState = "Restoring" + DatabaseStateSuspect DatabaseState = "Suspect" +) + +func PossibleValuesForDatabaseState() []string { + return []string{ + string(DatabaseStateCopying), + string(DatabaseStateEmergency), + string(DatabaseStateOffline), + string(DatabaseStateOfflineSecondary), + string(DatabaseStateOnline), + string(DatabaseStateRecovering), + string(DatabaseStateRecoveryPending), + string(DatabaseStateRestoring), + string(DatabaseStateSuspect), + } +} + +func (s *DatabaseState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseState(input string) (*DatabaseState, error) { + vals := map[string]DatabaseState{ + "copying": DatabaseStateCopying, + "emergency": DatabaseStateEmergency, + "offline": DatabaseStateOffline, + "offlinesecondary": DatabaseStateOfflineSecondary, + "online": DatabaseStateOnline, + "recovering": DatabaseStateRecovering, + "recoverypending": DatabaseStateRecoveryPending, + "restoring": DatabaseStateRestoring, + "suspect": DatabaseStateSuspect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseState(input) + return &out, nil +} + +type LoginMigrationStage string + +const ( + LoginMigrationStageAssignRoleMembership LoginMigrationStage = "AssignRoleMembership" + LoginMigrationStageAssignRoleOwnership LoginMigrationStage = "AssignRoleOwnership" + LoginMigrationStageCompleted LoginMigrationStage = "Completed" + LoginMigrationStageEstablishObjectPermissions LoginMigrationStage = "EstablishObjectPermissions" + LoginMigrationStageEstablishServerPermissions LoginMigrationStage = "EstablishServerPermissions" + LoginMigrationStageEstablishUserMapping LoginMigrationStage = "EstablishUserMapping" + LoginMigrationStageInitialize LoginMigrationStage = "Initialize" + LoginMigrationStageLoginMigration LoginMigrationStage = "LoginMigration" + LoginMigrationStageNone LoginMigrationStage = "None" +) + +func PossibleValuesForLoginMigrationStage() []string { + return []string{ + string(LoginMigrationStageAssignRoleMembership), + string(LoginMigrationStageAssignRoleOwnership), + string(LoginMigrationStageCompleted), + string(LoginMigrationStageEstablishObjectPermissions), + string(LoginMigrationStageEstablishServerPermissions), + string(LoginMigrationStageEstablishUserMapping), + string(LoginMigrationStageInitialize), + string(LoginMigrationStageLoginMigration), + string(LoginMigrationStageNone), + } +} + +func (s *LoginMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginMigrationStage(input string) (*LoginMigrationStage, error) { + vals := map[string]LoginMigrationStage{ + "assignrolemembership": LoginMigrationStageAssignRoleMembership, + "assignroleownership": LoginMigrationStageAssignRoleOwnership, + "completed": LoginMigrationStageCompleted, + "establishobjectpermissions": LoginMigrationStageEstablishObjectPermissions, + "establishserverpermissions": LoginMigrationStageEstablishServerPermissions, + "establishusermapping": LoginMigrationStageEstablishUserMapping, + "initialize": LoginMigrationStageInitialize, + "loginmigration": LoginMigrationStageLoginMigration, + "none": LoginMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginMigrationStage(input) + return &out, nil +} + +type LoginType string + +const ( + LoginTypeAsymmetricKey LoginType = "AsymmetricKey" + LoginTypeCertificate LoginType = "Certificate" + LoginTypeExternalGroup LoginType = "ExternalGroup" + LoginTypeExternalUser LoginType = "ExternalUser" + LoginTypeSqlLogin LoginType = "SqlLogin" + LoginTypeWindowsGroup LoginType = "WindowsGroup" + LoginTypeWindowsUser LoginType = "WindowsUser" +) + +func PossibleValuesForLoginType() []string { + return []string{ + string(LoginTypeAsymmetricKey), + string(LoginTypeCertificate), + string(LoginTypeExternalGroup), + string(LoginTypeExternalUser), + string(LoginTypeSqlLogin), + string(LoginTypeWindowsGroup), + string(LoginTypeWindowsUser), + } +} + +func (s *LoginType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoginType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoginType(input string) (*LoginType, error) { + vals := map[string]LoginType{ + "asymmetrickey": LoginTypeAsymmetricKey, + "certificate": LoginTypeCertificate, + "externalgroup": LoginTypeExternalGroup, + "externaluser": LoginTypeExternalUser, + "sqllogin": LoginTypeSqlLogin, + "windowsgroup": LoginTypeWindowsGroup, + "windowsuser": LoginTypeWindowsUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoginType(input) + return &out, nil +} + +type MigrationState string + +const ( + MigrationStateCompleted MigrationState = "Completed" + MigrationStateFailed MigrationState = "Failed" + MigrationStateInProgress MigrationState = "InProgress" + MigrationStateNone MigrationState = "None" + MigrationStateSkipped MigrationState = "Skipped" + MigrationStateStopped MigrationState = "Stopped" + MigrationStateWarning MigrationState = "Warning" +) + +func PossibleValuesForMigrationState() []string { + return []string{ + string(MigrationStateCompleted), + string(MigrationStateFailed), + string(MigrationStateInProgress), + string(MigrationStateNone), + string(MigrationStateSkipped), + string(MigrationStateStopped), + string(MigrationStateWarning), + } +} + +func (s *MigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationState(input string) (*MigrationState, error) { + vals := map[string]MigrationState{ + "completed": MigrationStateCompleted, + "failed": MigrationStateFailed, + "inprogress": MigrationStateInProgress, + "none": MigrationStateNone, + "skipped": MigrationStateSkipped, + "stopped": MigrationStateStopped, + "warning": MigrationStateWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationState(input) + return &out, nil +} + +type MigrationStatus string + +const ( + MigrationStatusCompleted MigrationStatus = "Completed" + MigrationStatusCompletedWithWarnings MigrationStatus = "CompletedWithWarnings" + MigrationStatusConfigured MigrationStatus = "Configured" + MigrationStatusConnecting MigrationStatus = "Connecting" + MigrationStatusDefault MigrationStatus = "Default" + MigrationStatusError MigrationStatus = "Error" + MigrationStatusRunning MigrationStatus = "Running" + MigrationStatusSelectLogins MigrationStatus = "SelectLogins" + MigrationStatusSourceAndTargetSelected MigrationStatus = "SourceAndTargetSelected" + MigrationStatusStopped MigrationStatus = "Stopped" +) + +func PossibleValuesForMigrationStatus() []string { + return []string{ + string(MigrationStatusCompleted), + string(MigrationStatusCompletedWithWarnings), + string(MigrationStatusConfigured), + string(MigrationStatusConnecting), + string(MigrationStatusDefault), + string(MigrationStatusError), + string(MigrationStatusRunning), + string(MigrationStatusSelectLogins), + string(MigrationStatusSourceAndTargetSelected), + string(MigrationStatusStopped), + } +} + +func (s *MigrationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMigrationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMigrationStatus(input string) (*MigrationStatus, error) { + vals := map[string]MigrationStatus{ + "completed": MigrationStatusCompleted, + "completedwithwarnings": MigrationStatusCompletedWithWarnings, + "configured": MigrationStatusConfigured, + "connecting": MigrationStatusConnecting, + "default": MigrationStatusDefault, + "error": MigrationStatusError, + "running": MigrationStatusRunning, + "selectlogins": MigrationStatusSelectLogins, + "sourceandtargetselected": MigrationStatusSourceAndTargetSelected, + "stopped": MigrationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MigrationStatus(input) + return &out, nil +} + +type MongoDbClusterType string + +const ( + MongoDbClusterTypeBlobContainer MongoDbClusterType = "BlobContainer" + MongoDbClusterTypeCosmosDb MongoDbClusterType = "CosmosDb" + MongoDbClusterTypeMongoDb MongoDbClusterType = "MongoDb" +) + +func PossibleValuesForMongoDbClusterType() []string { + return []string{ + string(MongoDbClusterTypeBlobContainer), + string(MongoDbClusterTypeCosmosDb), + string(MongoDbClusterTypeMongoDb), + } +} + +func (s *MongoDbClusterType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbClusterType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbClusterType(input string) (*MongoDbClusterType, error) { + vals := map[string]MongoDbClusterType{ + "blobcontainer": MongoDbClusterTypeBlobContainer, + "cosmosdb": MongoDbClusterTypeCosmosDb, + "mongodb": MongoDbClusterTypeMongoDb, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbClusterType(input) + return &out, nil +} + +type MongoDbErrorType string + +const ( + MongoDbErrorTypeError MongoDbErrorType = "Error" + MongoDbErrorTypeValidationError MongoDbErrorType = "ValidationError" + MongoDbErrorTypeWarning MongoDbErrorType = "Warning" +) + +func PossibleValuesForMongoDbErrorType() []string { + return []string{ + string(MongoDbErrorTypeError), + string(MongoDbErrorTypeValidationError), + string(MongoDbErrorTypeWarning), + } +} + +func (s *MongoDbErrorType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbErrorType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbErrorType(input string) (*MongoDbErrorType, error) { + vals := map[string]MongoDbErrorType{ + "error": MongoDbErrorTypeError, + "validationerror": MongoDbErrorTypeValidationError, + "warning": MongoDbErrorTypeWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbErrorType(input) + return &out, nil +} + +type MongoDbMigrationState string + +const ( + MongoDbMigrationStateCanceled MongoDbMigrationState = "Canceled" + MongoDbMigrationStateComplete MongoDbMigrationState = "Complete" + MongoDbMigrationStateCopying MongoDbMigrationState = "Copying" + MongoDbMigrationStateFailed MongoDbMigrationState = "Failed" + MongoDbMigrationStateFinalizing MongoDbMigrationState = "Finalizing" + MongoDbMigrationStateInitialReplay MongoDbMigrationState = "InitialReplay" + MongoDbMigrationStateInitializing MongoDbMigrationState = "Initializing" + MongoDbMigrationStateNotStarted MongoDbMigrationState = "NotStarted" + MongoDbMigrationStateReplaying MongoDbMigrationState = "Replaying" + MongoDbMigrationStateRestarting MongoDbMigrationState = "Restarting" + MongoDbMigrationStateValidatingInput MongoDbMigrationState = "ValidatingInput" +) + +func PossibleValuesForMongoDbMigrationState() []string { + return []string{ + string(MongoDbMigrationStateCanceled), + string(MongoDbMigrationStateComplete), + string(MongoDbMigrationStateCopying), + string(MongoDbMigrationStateFailed), + string(MongoDbMigrationStateFinalizing), + string(MongoDbMigrationStateInitialReplay), + string(MongoDbMigrationStateInitializing), + string(MongoDbMigrationStateNotStarted), + string(MongoDbMigrationStateReplaying), + string(MongoDbMigrationStateRestarting), + string(MongoDbMigrationStateValidatingInput), + } +} + +func (s *MongoDbMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbMigrationState(input string) (*MongoDbMigrationState, error) { + vals := map[string]MongoDbMigrationState{ + "canceled": MongoDbMigrationStateCanceled, + "complete": MongoDbMigrationStateComplete, + "copying": MongoDbMigrationStateCopying, + "failed": MongoDbMigrationStateFailed, + "finalizing": MongoDbMigrationStateFinalizing, + "initialreplay": MongoDbMigrationStateInitialReplay, + "initializing": MongoDbMigrationStateInitializing, + "notstarted": MongoDbMigrationStateNotStarted, + "replaying": MongoDbMigrationStateReplaying, + "restarting": MongoDbMigrationStateRestarting, + "validatinginput": MongoDbMigrationStateValidatingInput, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbMigrationState(input) + return &out, nil +} + +type MongoDbReplication string + +const ( + MongoDbReplicationContinuous MongoDbReplication = "Continuous" + MongoDbReplicationDisabled MongoDbReplication = "Disabled" + MongoDbReplicationOneTime MongoDbReplication = "OneTime" +) + +func PossibleValuesForMongoDbReplication() []string { + return []string{ + string(MongoDbReplicationContinuous), + string(MongoDbReplicationDisabled), + string(MongoDbReplicationOneTime), + } +} + +func (s *MongoDbReplication) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbReplication(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbReplication(input string) (*MongoDbReplication, error) { + vals := map[string]MongoDbReplication{ + "continuous": MongoDbReplicationContinuous, + "disabled": MongoDbReplicationDisabled, + "onetime": MongoDbReplicationOneTime, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbReplication(input) + return &out, nil +} + +type MongoDbShardKeyOrder string + +const ( + MongoDbShardKeyOrderForward MongoDbShardKeyOrder = "Forward" + MongoDbShardKeyOrderHashed MongoDbShardKeyOrder = "Hashed" + MongoDbShardKeyOrderReverse MongoDbShardKeyOrder = "Reverse" +) + +func PossibleValuesForMongoDbShardKeyOrder() []string { + return []string{ + string(MongoDbShardKeyOrderForward), + string(MongoDbShardKeyOrderHashed), + string(MongoDbShardKeyOrderReverse), + } +} + +func (s *MongoDbShardKeyOrder) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMongoDbShardKeyOrder(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMongoDbShardKeyOrder(input string) (*MongoDbShardKeyOrder, error) { + vals := map[string]MongoDbShardKeyOrder{ + "forward": MongoDbShardKeyOrderForward, + "hashed": MongoDbShardKeyOrderHashed, + "reverse": MongoDbShardKeyOrderReverse, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MongoDbShardKeyOrder(input) + return &out, nil +} + +type MySqlTargetPlatformType string + +const ( + MySqlTargetPlatformTypeAzureDbForMySQL MySqlTargetPlatformType = "AzureDbForMySQL" + MySqlTargetPlatformTypeSqlServer MySqlTargetPlatformType = "SqlServer" +) + +func PossibleValuesForMySqlTargetPlatformType() []string { + return []string{ + string(MySqlTargetPlatformTypeAzureDbForMySQL), + string(MySqlTargetPlatformTypeSqlServer), + } +} + +func (s *MySqlTargetPlatformType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMySqlTargetPlatformType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMySqlTargetPlatformType(input string) (*MySqlTargetPlatformType, error) { + vals := map[string]MySqlTargetPlatformType{ + "azuredbformysql": MySqlTargetPlatformTypeAzureDbForMySQL, + "sqlserver": MySqlTargetPlatformTypeSqlServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MySqlTargetPlatformType(input) + return &out, nil +} + +type ObjectType string + +const ( + ObjectTypeFunction ObjectType = "Function" + ObjectTypeStoredProcedures ObjectType = "StoredProcedures" + ObjectTypeTable ObjectType = "Table" + ObjectTypeUser ObjectType = "User" + ObjectTypeView ObjectType = "View" +) + +func PossibleValuesForObjectType() []string { + return []string{ + string(ObjectTypeFunction), + string(ObjectTypeStoredProcedures), + string(ObjectTypeTable), + string(ObjectTypeUser), + string(ObjectTypeView), + } +} + +func (s *ObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjectType(input string) (*ObjectType, error) { + vals := map[string]ObjectType{ + "function": ObjectTypeFunction, + "storedprocedures": ObjectTypeStoredProcedures, + "table": ObjectTypeTable, + "user": ObjectTypeUser, + "view": ObjectTypeView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ObjectType(input) + return &out, nil +} + +type ReplicateMigrationState string + +const ( + ReplicateMigrationStateACTIONREQUIRED ReplicateMigrationState = "ACTION_REQUIRED" + ReplicateMigrationStateCOMPLETE ReplicateMigrationState = "COMPLETE" + ReplicateMigrationStateFAILED ReplicateMigrationState = "FAILED" + ReplicateMigrationStatePENDING ReplicateMigrationState = "PENDING" + ReplicateMigrationStateUNDEFINED ReplicateMigrationState = "UNDEFINED" + ReplicateMigrationStateVALIDATING ReplicateMigrationState = "VALIDATING" +) + +func PossibleValuesForReplicateMigrationState() []string { + return []string{ + string(ReplicateMigrationStateACTIONREQUIRED), + string(ReplicateMigrationStateCOMPLETE), + string(ReplicateMigrationStateFAILED), + string(ReplicateMigrationStatePENDING), + string(ReplicateMigrationStateUNDEFINED), + string(ReplicateMigrationStateVALIDATING), + } +} + +func (s *ReplicateMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicateMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicateMigrationState(input string) (*ReplicateMigrationState, error) { + vals := map[string]ReplicateMigrationState{ + "action_required": ReplicateMigrationStateACTIONREQUIRED, + "complete": ReplicateMigrationStateCOMPLETE, + "failed": ReplicateMigrationStateFAILED, + "pending": ReplicateMigrationStatePENDING, + "undefined": ReplicateMigrationStateUNDEFINED, + "validating": ReplicateMigrationStateVALIDATING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicateMigrationState(input) + return &out, nil +} + +type ResultType string + +const ( + ResultTypeCollection ResultType = "Collection" + ResultTypeDatabase ResultType = "Database" + ResultTypeMigration ResultType = "Migration" +) + +func PossibleValuesForResultType() []string { + return []string{ + string(ResultTypeCollection), + string(ResultTypeDatabase), + string(ResultTypeMigration), + } +} + +func (s *ResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResultType(input string) (*ResultType, error) { + vals := map[string]ResultType{ + "collection": ResultTypeCollection, + "database": ResultTypeDatabase, + "migration": ResultTypeMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResultType(input) + return &out, nil +} + +type ScenarioSource string + +const ( + ScenarioSourceAccess ScenarioSource = "Access" + ScenarioSourceDBTwo ScenarioSource = "DB2" + ScenarioSourceMongoDB ScenarioSource = "MongoDB" + ScenarioSourceMySQL ScenarioSource = "MySQL" + ScenarioSourceMySQLRDS ScenarioSource = "MySQLRDS" + ScenarioSourceOracle ScenarioSource = "Oracle" + ScenarioSourcePostgreSQL ScenarioSource = "PostgreSQL" + ScenarioSourcePostgreSQLRDS ScenarioSource = "PostgreSQLRDS" + ScenarioSourceSQL ScenarioSource = "SQL" + ScenarioSourceSQLRDS ScenarioSource = "SQLRDS" + ScenarioSourceSybase ScenarioSource = "Sybase" +) + +func PossibleValuesForScenarioSource() []string { + return []string{ + string(ScenarioSourceAccess), + string(ScenarioSourceDBTwo), + string(ScenarioSourceMongoDB), + string(ScenarioSourceMySQL), + string(ScenarioSourceMySQLRDS), + string(ScenarioSourceOracle), + string(ScenarioSourcePostgreSQL), + string(ScenarioSourcePostgreSQLRDS), + string(ScenarioSourceSQL), + string(ScenarioSourceSQLRDS), + string(ScenarioSourceSybase), + } +} + +func (s *ScenarioSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioSource(input string) (*ScenarioSource, error) { + vals := map[string]ScenarioSource{ + "access": ScenarioSourceAccess, + "db2": ScenarioSourceDBTwo, + "mongodb": ScenarioSourceMongoDB, + "mysql": ScenarioSourceMySQL, + "mysqlrds": ScenarioSourceMySQLRDS, + "oracle": ScenarioSourceOracle, + "postgresql": ScenarioSourcePostgreSQL, + "postgresqlrds": ScenarioSourcePostgreSQLRDS, + "sql": ScenarioSourceSQL, + "sqlrds": ScenarioSourceSQLRDS, + "sybase": ScenarioSourceSybase, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioSource(input) + return &out, nil +} + +type ScenarioTarget string + +const ( + ScenarioTargetAzureDBForMySql ScenarioTarget = "AzureDBForMySql" + ScenarioTargetAzureDBForPostgresSQL ScenarioTarget = "AzureDBForPostgresSQL" + ScenarioTargetMongoDB ScenarioTarget = "MongoDB" + ScenarioTargetSQLDB ScenarioTarget = "SQLDB" + ScenarioTargetSQLDW ScenarioTarget = "SQLDW" + ScenarioTargetSQLMI ScenarioTarget = "SQLMI" + ScenarioTargetSQLServer ScenarioTarget = "SQLServer" +) + +func PossibleValuesForScenarioTarget() []string { + return []string{ + string(ScenarioTargetAzureDBForMySql), + string(ScenarioTargetAzureDBForPostgresSQL), + string(ScenarioTargetMongoDB), + string(ScenarioTargetSQLDB), + string(ScenarioTargetSQLDW), + string(ScenarioTargetSQLMI), + string(ScenarioTargetSQLServer), + } +} + +func (s *ScenarioTarget) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScenarioTarget(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScenarioTarget(input string) (*ScenarioTarget, error) { + vals := map[string]ScenarioTarget{ + "azuredbformysql": ScenarioTargetAzureDBForMySql, + "azuredbforpostgressql": ScenarioTargetAzureDBForPostgresSQL, + "mongodb": ScenarioTargetMongoDB, + "sqldb": ScenarioTargetSQLDB, + "sqldw": ScenarioTargetSQLDW, + "sqlmi": ScenarioTargetSQLMI, + "sqlserver": ScenarioTargetSQLServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScenarioTarget(input) + return &out, nil +} + +type ServerLevelPermissionsGroup string + +const ( + ServerLevelPermissionsGroupDefault ServerLevelPermissionsGroup = "Default" + ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL ServerLevelPermissionsGroup = "MigrationFromMySQLToAzureDBForMySQL" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureDB" + ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI ServerLevelPermissionsGroup = "MigrationFromSqlServerToAzureMI" +) + +func PossibleValuesForServerLevelPermissionsGroup() []string { + return []string{ + string(ServerLevelPermissionsGroupDefault), + string(ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB), + string(ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI), + } +} + +func (s *ServerLevelPermissionsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServerLevelPermissionsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServerLevelPermissionsGroup(input string) (*ServerLevelPermissionsGroup, error) { + vals := map[string]ServerLevelPermissionsGroup{ + "default": ServerLevelPermissionsGroupDefault, + "migrationfrommysqltoazuredbformysql": ServerLevelPermissionsGroupMigrationFromMySQLToAzureDBForMySQL, + "migrationfromsqlservertoazuredb": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureDB, + "migrationfromsqlservertoazuremi": ServerLevelPermissionsGroupMigrationFromSqlServerToAzureMI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServerLevelPermissionsGroup(input) + return &out, nil +} + +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityMessage Severity = "Message" + SeverityWarning Severity = "Warning" ) -func PossibleValuesForCommandState() []string { +func PossibleValuesForSeverity() []string { return []string{ - string(CommandStateAccepted), - string(CommandStateFailed), - string(CommandStateRunning), - string(CommandStateSucceeded), - string(CommandStateUnknown), + string(SeverityError), + string(SeverityMessage), + string(SeverityWarning), } } -func (s *CommandState) UnmarshalJSON(bytes []byte) error { +func (s *Severity) UnmarshalJSON(bytes []byte) error { var decoded string if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - out, err := parseCommandState(decoded) + out, err := parseSeverity(decoded) if err != nil { return fmt.Errorf("parsing %q: %+v", decoded, err) } @@ -42,20 +1419,324 @@ func (s *CommandState) UnmarshalJSON(bytes []byte) error { return nil } -func parseCommandState(input string) (*CommandState, error) { - vals := map[string]CommandState{ - "accepted": CommandStateAccepted, - "failed": CommandStateFailed, - "running": CommandStateRunning, - "succeeded": CommandStateSucceeded, - "unknown": CommandStateUnknown, +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "error": SeverityError, + "message": SeverityMessage, + "warning": SeverityWarning, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil } // otherwise presume it's an undefined value and best-effort it - out := CommandState(input) + out := Severity(input) + return &out, nil +} + +type SqlSourcePlatform string + +const ( + SqlSourcePlatformSqlOnPrem SqlSourcePlatform = "SqlOnPrem" +) + +func PossibleValuesForSqlSourcePlatform() []string { + return []string{ + string(SqlSourcePlatformSqlOnPrem), + } +} + +func (s *SqlSourcePlatform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlSourcePlatform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlSourcePlatform(input string) (*SqlSourcePlatform, error) { + vals := map[string]SqlSourcePlatform{ + "sqlonprem": SqlSourcePlatformSqlOnPrem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlSourcePlatform(input) + return &out, nil +} + +type SsisMigrationOverwriteOption string + +const ( + SsisMigrationOverwriteOptionIgnore SsisMigrationOverwriteOption = "Ignore" + SsisMigrationOverwriteOptionOverwrite SsisMigrationOverwriteOption = "Overwrite" +) + +func PossibleValuesForSsisMigrationOverwriteOption() []string { + return []string{ + string(SsisMigrationOverwriteOptionIgnore), + string(SsisMigrationOverwriteOptionOverwrite), + } +} + +func (s *SsisMigrationOverwriteOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationOverwriteOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationOverwriteOption(input string) (*SsisMigrationOverwriteOption, error) { + vals := map[string]SsisMigrationOverwriteOption{ + "ignore": SsisMigrationOverwriteOptionIgnore, + "overwrite": SsisMigrationOverwriteOptionOverwrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationOverwriteOption(input) + return &out, nil +} + +type SsisMigrationStage string + +const ( + SsisMigrationStageCompleted SsisMigrationStage = "Completed" + SsisMigrationStageInProgress SsisMigrationStage = "InProgress" + SsisMigrationStageInitialize SsisMigrationStage = "Initialize" + SsisMigrationStageNone SsisMigrationStage = "None" +) + +func PossibleValuesForSsisMigrationStage() []string { + return []string{ + string(SsisMigrationStageCompleted), + string(SsisMigrationStageInProgress), + string(SsisMigrationStageInitialize), + string(SsisMigrationStageNone), + } +} + +func (s *SsisMigrationStage) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisMigrationStage(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisMigrationStage(input string) (*SsisMigrationStage, error) { + vals := map[string]SsisMigrationStage{ + "completed": SsisMigrationStageCompleted, + "inprogress": SsisMigrationStageInProgress, + "initialize": SsisMigrationStageInitialize, + "none": SsisMigrationStageNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisMigrationStage(input) + return &out, nil +} + +type SsisStoreType string + +const ( + SsisStoreTypeSsisCatalog SsisStoreType = "SsisCatalog" +) + +func PossibleValuesForSsisStoreType() []string { + return []string{ + string(SsisStoreTypeSsisCatalog), + } +} + +func (s *SsisStoreType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSsisStoreType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSsisStoreType(input string) (*SsisStoreType, error) { + vals := map[string]SsisStoreType{ + "ssiscatalog": SsisStoreTypeSsisCatalog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SsisStoreType(input) + return &out, nil +} + +type SyncDatabaseMigrationReportingState string + +const ( + SyncDatabaseMigrationReportingStateBACKUPCOMPLETED SyncDatabaseMigrationReportingState = "BACKUP_COMPLETED" + SyncDatabaseMigrationReportingStateBACKUPINPROGRESS SyncDatabaseMigrationReportingState = "BACKUP_IN_PROGRESS" + SyncDatabaseMigrationReportingStateCANCELLED SyncDatabaseMigrationReportingState = "CANCELLED" + SyncDatabaseMigrationReportingStateCANCELLING SyncDatabaseMigrationReportingState = "CANCELLING" + SyncDatabaseMigrationReportingStateCOMPLETE SyncDatabaseMigrationReportingState = "COMPLETE" + SyncDatabaseMigrationReportingStateCOMPLETING SyncDatabaseMigrationReportingState = "COMPLETING" + SyncDatabaseMigrationReportingStateCONFIGURING SyncDatabaseMigrationReportingState = "CONFIGURING" + SyncDatabaseMigrationReportingStateFAILED SyncDatabaseMigrationReportingState = "FAILED" + SyncDatabaseMigrationReportingStateINITIALIAZING SyncDatabaseMigrationReportingState = "INITIALIAZING" + SyncDatabaseMigrationReportingStateREADYTOCOMPLETE SyncDatabaseMigrationReportingState = "READY_TO_COMPLETE" + SyncDatabaseMigrationReportingStateRESTORECOMPLETED SyncDatabaseMigrationReportingState = "RESTORE_COMPLETED" + SyncDatabaseMigrationReportingStateRESTOREINPROGRESS SyncDatabaseMigrationReportingState = "RESTORE_IN_PROGRESS" + SyncDatabaseMigrationReportingStateRUNNING SyncDatabaseMigrationReportingState = "RUNNING" + SyncDatabaseMigrationReportingStateSTARTING SyncDatabaseMigrationReportingState = "STARTING" + SyncDatabaseMigrationReportingStateUNDEFINED SyncDatabaseMigrationReportingState = "UNDEFINED" + SyncDatabaseMigrationReportingStateVALIDATING SyncDatabaseMigrationReportingState = "VALIDATING" + SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE SyncDatabaseMigrationReportingState = "VALIDATION_COMPLETE" + SyncDatabaseMigrationReportingStateVALIDATIONFAILED SyncDatabaseMigrationReportingState = "VALIDATION_FAILED" +) + +func PossibleValuesForSyncDatabaseMigrationReportingState() []string { + return []string{ + string(SyncDatabaseMigrationReportingStateBACKUPCOMPLETED), + string(SyncDatabaseMigrationReportingStateBACKUPINPROGRESS), + string(SyncDatabaseMigrationReportingStateCANCELLED), + string(SyncDatabaseMigrationReportingStateCANCELLING), + string(SyncDatabaseMigrationReportingStateCOMPLETE), + string(SyncDatabaseMigrationReportingStateCOMPLETING), + string(SyncDatabaseMigrationReportingStateCONFIGURING), + string(SyncDatabaseMigrationReportingStateFAILED), + string(SyncDatabaseMigrationReportingStateINITIALIAZING), + string(SyncDatabaseMigrationReportingStateREADYTOCOMPLETE), + string(SyncDatabaseMigrationReportingStateRESTORECOMPLETED), + string(SyncDatabaseMigrationReportingStateRESTOREINPROGRESS), + string(SyncDatabaseMigrationReportingStateRUNNING), + string(SyncDatabaseMigrationReportingStateSTARTING), + string(SyncDatabaseMigrationReportingStateUNDEFINED), + string(SyncDatabaseMigrationReportingStateVALIDATING), + string(SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE), + string(SyncDatabaseMigrationReportingStateVALIDATIONFAILED), + } +} + +func (s *SyncDatabaseMigrationReportingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncDatabaseMigrationReportingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncDatabaseMigrationReportingState(input string) (*SyncDatabaseMigrationReportingState, error) { + vals := map[string]SyncDatabaseMigrationReportingState{ + "backup_completed": SyncDatabaseMigrationReportingStateBACKUPCOMPLETED, + "backup_in_progress": SyncDatabaseMigrationReportingStateBACKUPINPROGRESS, + "cancelled": SyncDatabaseMigrationReportingStateCANCELLED, + "cancelling": SyncDatabaseMigrationReportingStateCANCELLING, + "complete": SyncDatabaseMigrationReportingStateCOMPLETE, + "completing": SyncDatabaseMigrationReportingStateCOMPLETING, + "configuring": SyncDatabaseMigrationReportingStateCONFIGURING, + "failed": SyncDatabaseMigrationReportingStateFAILED, + "initialiazing": SyncDatabaseMigrationReportingStateINITIALIAZING, + "ready_to_complete": SyncDatabaseMigrationReportingStateREADYTOCOMPLETE, + "restore_completed": SyncDatabaseMigrationReportingStateRESTORECOMPLETED, + "restore_in_progress": SyncDatabaseMigrationReportingStateRESTOREINPROGRESS, + "running": SyncDatabaseMigrationReportingStateRUNNING, + "starting": SyncDatabaseMigrationReportingStateSTARTING, + "undefined": SyncDatabaseMigrationReportingStateUNDEFINED, + "validating": SyncDatabaseMigrationReportingStateVALIDATING, + "validation_complete": SyncDatabaseMigrationReportingStateVALIDATIONCOMPLETE, + "validation_failed": SyncDatabaseMigrationReportingStateVALIDATIONFAILED, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncDatabaseMigrationReportingState(input) + return &out, nil +} + +type SyncTableMigrationState string + +const ( + SyncTableMigrationStateBEFORELOAD SyncTableMigrationState = "BEFORE_LOAD" + SyncTableMigrationStateCANCELED SyncTableMigrationState = "CANCELED" + SyncTableMigrationStateCOMPLETED SyncTableMigrationState = "COMPLETED" + SyncTableMigrationStateERROR SyncTableMigrationState = "ERROR" + SyncTableMigrationStateFAILED SyncTableMigrationState = "FAILED" + SyncTableMigrationStateFULLLOAD SyncTableMigrationState = "FULL_LOAD" +) + +func PossibleValuesForSyncTableMigrationState() []string { + return []string{ + string(SyncTableMigrationStateBEFORELOAD), + string(SyncTableMigrationStateCANCELED), + string(SyncTableMigrationStateCOMPLETED), + string(SyncTableMigrationStateERROR), + string(SyncTableMigrationStateFAILED), + string(SyncTableMigrationStateFULLLOAD), + } +} + +func (s *SyncTableMigrationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyncTableMigrationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyncTableMigrationState(input string) (*SyncTableMigrationState, error) { + vals := map[string]SyncTableMigrationState{ + "before_load": SyncTableMigrationStateBEFORELOAD, + "canceled": SyncTableMigrationStateCANCELED, + "completed": SyncTableMigrationStateCOMPLETED, + "error": SyncTableMigrationStateERROR, + "failed": SyncTableMigrationStateFAILED, + "full_load": SyncTableMigrationStateFULLLOAD, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyncTableMigrationState(input) return &out, nil } @@ -117,3 +1798,106 @@ func parseTaskState(input string) (*TaskState, error) { out := TaskState(input) return &out, nil } + +type UpdateActionType string + +const ( + UpdateActionTypeAddedOnTarget UpdateActionType = "AddedOnTarget" + UpdateActionTypeChangedOnTarget UpdateActionType = "ChangedOnTarget" + UpdateActionTypeDeletedOnTarget UpdateActionType = "DeletedOnTarget" +) + +func PossibleValuesForUpdateActionType() []string { + return []string{ + string(UpdateActionTypeAddedOnTarget), + string(UpdateActionTypeChangedOnTarget), + string(UpdateActionTypeDeletedOnTarget), + } +} + +func (s *UpdateActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpdateActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpdateActionType(input string) (*UpdateActionType, error) { + vals := map[string]UpdateActionType{ + "addedontarget": UpdateActionTypeAddedOnTarget, + "changedontarget": UpdateActionTypeChangedOnTarget, + "deletedontarget": UpdateActionTypeDeletedOnTarget, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpdateActionType(input) + return &out, nil +} + +type ValidationStatus string + +const ( + ValidationStatusCompleted ValidationStatus = "Completed" + ValidationStatusCompletedWithIssues ValidationStatus = "CompletedWithIssues" + ValidationStatusDefault ValidationStatus = "Default" + ValidationStatusFailed ValidationStatus = "Failed" + ValidationStatusInProgress ValidationStatus = "InProgress" + ValidationStatusInitialized ValidationStatus = "Initialized" + ValidationStatusNotStarted ValidationStatus = "NotStarted" + ValidationStatusStopped ValidationStatus = "Stopped" +) + +func PossibleValuesForValidationStatus() []string { + return []string{ + string(ValidationStatusCompleted), + string(ValidationStatusCompletedWithIssues), + string(ValidationStatusDefault), + string(ValidationStatusFailed), + string(ValidationStatusInProgress), + string(ValidationStatusInitialized), + string(ValidationStatusNotStarted), + string(ValidationStatusStopped), + } +} + +func (s *ValidationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseValidationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseValidationStatus(input string) (*ValidationStatus, error) { + vals := map[string]ValidationStatus{ + "completed": ValidationStatusCompleted, + "completedwithissues": ValidationStatusCompletedWithIssues, + "default": ValidationStatusDefault, + "failed": ValidationStatusFailed, + "inprogress": ValidationStatusInProgress, + "initialized": ValidationStatusInitialized, + "notstarted": ValidationStatusNotStarted, + "stopped": ValidationStatusStopped, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ValidationStatus(input) + return &out, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/id_task.go b/resource-manager/datamigration/2021-06-30/taskresource/id_task.go index 6321390155f..6fb1e1fb21d 100644 --- a/resource-manager/datamigration/2021-06-30/taskresource/id_task.go +++ b/resource-manager/datamigration/2021-06-30/taskresource/id_task.go @@ -123,7 +123,7 @@ func (id TaskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataMigration", "Microsoft.DataMigration", "Microsoft.DataMigration"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/datamigration/2021-06-30/taskresource/id_task_test.go b/resource-manager/datamigration/2021-06-30/taskresource/id_task_test.go index 76b4234484f..f174a9f0a71 100644 --- a/resource-manager/datamigration/2021-06-30/taskresource/id_task_test.go +++ b/resource-manager/datamigration/2021-06-30/taskresource/id_task_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &TaskId{} func TestNewTaskID(t *testing.T) { - id := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName") + id := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.ServiceName != "serviceName" { @@ -36,8 +36,8 @@ func TestNewTaskID(t *testing.T) { } func TestFormatTaskID(t *testing.T) { - actual := NewTaskID("12345678-1234-9876-4563-123456789012", "groupName", "serviceName", "projectName", "taskName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" + actual := NewTaskID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "serviceName", "projectName", "taskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -71,50 +71,50 @@ func TestParseTaskID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -122,7 +122,7 @@ func TestParseTaskID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, } @@ -207,90 +207,90 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", ServiceName: "serviceName", ProjectName: "projectName", TaskName: "taskName", @@ -298,15 +298,15 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.DataMigration/services/serviceName/projects/projectName/tasks/taskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE", Expected: &TaskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", ServiceName: "sErViCeNaMe", ProjectName: "pRoJeCtNaMe", TaskName: "tAsKnAmE", @@ -314,7 +314,7 @@ func TestParseTaskIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.dAtAmIgRaTiOn/sErViCeS/sErViCeNaMe/pRoJeCtS/pRoJeCtNaMe/tAsKs/tAsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/datamigration/2021-06-30/taskresource/method_taskscommand.go b/resource-manager/datamigration/2021-06-30/taskresource/method_taskscommand.go index cfc3646901a..97138ce09d1 100644 --- a/resource-manager/datamigration/2021-06-30/taskresource/method_taskscommand.go +++ b/resource-manager/datamigration/2021-06-30/taskresource/method_taskscommand.go @@ -2,6 +2,7 @@ package taskresource import ( "context" + "encoding/json" "fmt" "net/http" @@ -15,7 +16,7 @@ import ( type TasksCommandOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *CommandProperties + Model CommandProperties } // TasksCommand ... @@ -48,11 +49,15 @@ func (c TaskResourceClient) TasksCommand(ctx context.Context, id TaskId, input C return } - var model CommandProperties - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { + var respObj json.RawMessage + if err = resp.Unmarshal(&respObj); err != nil { return } + model, err := UnmarshalCommandPropertiesImplementation(respObj) + if err != nil { + return + } + result.Model = model return } diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_azureactivedirectoryapp.go b/resource-manager/datamigration/2021-06-30/taskresource/model_azureactivedirectoryapp.go new file mode 100644 index 00000000000..80dd0973dc8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_azureactivedirectoryapp.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureActiveDirectoryApp struct { + AppKey string `json:"appKey"` + ApplicationId string `json:"applicationId"` + TenantId string `json:"tenantId"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_backupfileinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_backupfileinfo.go new file mode 100644 index 00000000000..dd2961a166a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_backupfileinfo.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupFileInfo struct { + FamilySequenceNumber *int64 `json:"familySequenceNumber,omitempty"` + FileLocation *string `json:"fileLocation,omitempty"` + Status *BackupFileStatus `json:"status,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_backupsetinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_backupsetinfo.go new file mode 100644 index 00000000000..769d00712d6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_backupsetinfo.go @@ -0,0 +1,59 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupSetInfo struct { + BackupFinishedDate *string `json:"backupFinishedDate,omitempty"` + BackupSetId *string `json:"backupSetId,omitempty"` + BackupStartDate *string `json:"backupStartDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FirstLsn *string `json:"firstLsn,omitempty"` + IsBackupRestored *bool `json:"isBackupRestored,omitempty"` + LastLsn *string `json:"lastLsn,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + ListOfBackupFiles *[]BackupFileInfo `json:"listOfBackupFiles,omitempty"` +} + +func (o *BackupSetInfo) GetBackupFinishedDateAsTime() (*time.Time, error) { + if o.BackupFinishedDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishedDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupFinishedDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishedDate = &formatted +} + +func (o *BackupSetInfo) GetBackupStartDateAsTime() (*time.Time, error) { + if o.BackupStartDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupStartDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetBackupStartDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupStartDate = &formatted +} + +func (o *BackupSetInfo) GetLastModifiedTimeAsTime() (*time.Time, error) { + if o.LastModifiedTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastModifiedTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupSetInfo) SetLastModifiedTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastModifiedTime = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_blobshare.go b/resource-manager/datamigration/2021-06-30/taskresource/model_blobshare.go new file mode 100644 index 00000000000..ae5f87adfb8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_blobshare.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BlobShare struct { + SasUri string `json:"sasUri"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_commandproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_commandproperties.go index 5bb1185f9de..5c8eecba369 100644 --- a/resource-manager/datamigration/2021-06-30/taskresource/model_commandproperties.go +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_commandproperties.go @@ -1,10 +1,85 @@ package taskresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CommandProperties struct { +type CommandProperties interface { + CommandProperties() BaseCommandPropertiesImpl +} + +var _ CommandProperties = BaseCommandPropertiesImpl{} + +type BaseCommandPropertiesImpl struct { CommandType string `json:"commandType"` Errors *[]ODataError `json:"errors,omitempty"` State *CommandState `json:"state,omitempty"` } + +func (s BaseCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s +} + +var _ CommandProperties = RawCommandPropertiesImpl{} + +// RawCommandPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawCommandPropertiesImpl struct { + commandProperties BaseCommandPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawCommandPropertiesImpl) CommandProperties() BaseCommandPropertiesImpl { + return s.commandProperties +} + +func UnmarshalCommandPropertiesImplementation(input []byte) (CommandProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling CommandProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["commandType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureDbSqlMi.Complete") { + var out MigrateMISyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMISyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Sync.Complete.Database") { + var out MigrateSyncCompleteCommandProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSyncCompleteCommandProperties: %+v", err) + } + return out, nil + } + + var parent BaseCommandPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseCommandPropertiesImpl: %+v", err) + } + + return RawCommandPropertiesImpl{ + commandProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connectioninfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connectioninfo.go new file mode 100644 index 00000000000..41c28de5b58 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connectioninfo.go @@ -0,0 +1,117 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionInfo interface { + ConnectionInfo() BaseConnectionInfoImpl +} + +var _ ConnectionInfo = BaseConnectionInfoImpl{} + +type BaseConnectionInfoImpl struct { + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s BaseConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s +} + +var _ ConnectionInfo = RawConnectionInfoImpl{} + +// RawConnectionInfoImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectionInfoImpl struct { + connectionInfo BaseConnectionInfoImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectionInfoImpl) ConnectionInfo() BaseConnectionInfoImpl { + return s.connectionInfo +} + +func UnmarshalConnectionInfoImplementation(input []byte) (ConnectionInfo, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectionInfo into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["type"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MiSqlConnectionInfo") { + var out MiSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MiSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "mongoDbConnectionInfo") { + var out MongoDbConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MySqlConnectionInfo") { + var out MySqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MySqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OracleConnectionInfo") { + var out OracleConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OracleConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PostgreSqlConnectionInfo") { + var out PostgreSqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PostgreSqlConnectionInfo: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SqlConnectionInfo") { + var out SqlConnectionInfo + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SqlConnectionInfo: %+v", err) + } + return out, nil + } + + var parent BaseConnectionInfoImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectionInfoImpl: %+v", err) + } + + return RawConnectionInfoImpl{ + connectionInfo: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttomongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttomongodbtaskproperties.go new file mode 100644 index 00000000000..8d09400f0b9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttomongodbtaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToMongoDbTaskProperties{} + +type ConnectToMongoDbTaskProperties struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToMongoDbTaskProperties{} + +func (s ConnectToMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Connect.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToMongoDbTaskProperties{} + +func (s *ConnectToMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbConnectionInfo `json:"input,omitempty"` + Output *[]MongoDbClusterInfo `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcemysqltaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcemysqltaskinput.go new file mode 100644 index 00000000000..aa1829dbaba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcemysqltaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceMySqlTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetPlatform *MySqlTargetPlatformType `json:"targetPlatform,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcemysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcemysqltaskproperties.go new file mode 100644 index 00000000000..9b6885bb515 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcemysqltaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceMySqlTaskProperties{} + +type ConnectToSourceMySqlTaskProperties struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceMySqlTaskProperties{} + +func (s ConnectToSourceMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.MySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceMySqlTaskProperties{} + +func (s *ConnectToSourceMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceNonSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcenonsqltaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcenonsqltaskoutput.go new file mode 100644 index 00000000000..be439667ade --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcenonsqltaskoutput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceNonSqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerProperties *ServerProperties `json:"serverProperties,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskinput.go new file mode 100644 index 00000000000..79dc708271c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskInput struct { + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskoutput.go new file mode 100644 index 00000000000..21537a2f033 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskoutput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceOracleSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskproperties.go new file mode 100644 index 00000000000..ca9d72bac69 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourceoraclesynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceOracleSyncTaskProperties{} + +type ConnectToSourceOracleSyncTaskProperties struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceOracleSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceOracleSyncTaskProperties{} + +func (s ConnectToSourceOracleSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceOracleSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.Oracle.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceOracleSyncTaskProperties{} + +func (s *ConnectToSourceOracleSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceOracleSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceOracleSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceOracleSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceOracleSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskinput.go new file mode 100644 index 00000000000..c7dacb8c34e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..f9b74bf26b1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourcePostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..2994ed0ca2c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcepostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourcePostgreSqlSyncTaskProperties{} + +type ConnectToSourcePostgreSqlSyncTaskProperties struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s ConnectToSourcePostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourcePostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.PostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourcePostgreSqlSyncTaskProperties{} + +func (s *ConnectToSourcePostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourcePostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourcePostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourcePostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourcePostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlserversynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlserversynctaskproperties.go new file mode 100644 index 00000000000..0024ffa4f12 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlserversynctaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerSyncTaskProperties{} + +type ConnectToSourceSqlServerSyncTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerSyncTaskProperties{} + +func (s ConnectToSourceSqlServerSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerSyncTaskProperties{} + +func (s *ConnectToSourceSqlServerSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskinput.go new file mode 100644 index 00000000000..17f1c991113 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskinput.go @@ -0,0 +1,14 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskInput struct { + CheckPermissionsGroup *ServerLevelPermissionsGroup `json:"checkPermissionsGroup,omitempty"` + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectDatabases *bool `json:"collectDatabases,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + CollectTdeCertificateInfo *bool `json:"collectTdeCertificateInfo,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutput.go new file mode 100644 index 00000000000..7d0e5b767a9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutput.go @@ -0,0 +1,100 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToSourceSqlServerTaskOutput interface { + ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl +} + +var _ ConnectToSourceSqlServerTaskOutput = BaseConnectToSourceSqlServerTaskOutputImpl{} + +type BaseConnectToSourceSqlServerTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s +} + +var _ ConnectToSourceSqlServerTaskOutput = RawConnectToSourceSqlServerTaskOutputImpl{} + +// RawConnectToSourceSqlServerTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawConnectToSourceSqlServerTaskOutputImpl struct { + connectToSourceSqlServerTaskOutput BaseConnectToSourceSqlServerTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawConnectToSourceSqlServerTaskOutputImpl) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return s.connectToSourceSqlServerTaskOutput +} + +func UnmarshalConnectToSourceSqlServerTaskOutputImplementation(input []byte) (ConnectToSourceSqlServerTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TaskLevelOutput") { + var out ConnectToSourceSqlServerTaskOutputTaskLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + return out, nil + } + + var parent BaseConnectToSourceSqlServerTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseConnectToSourceSqlServerTaskOutputImpl: %+v", err) + } + + return RawConnectToSourceSqlServerTaskOutputImpl{ + connectToSourceSqlServerTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go new file mode 100644 index 00000000000..f6ff5f641f5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +type ConnectToSourceSqlServerTaskOutputAgentJobLevel struct { + IsEnabled *bool `json:"isEnabled,omitempty"` + JobCategory *string `json:"jobCategory,omitempty"` + JobOwner *string `json:"jobOwner,omitempty"` + LastExecutedOn *string `json:"lastExecutedOn,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputAgentJobLevel{} + +func (s ConnectToSourceSqlServerTaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go new file mode 100644 index 00000000000..229dc2c28b8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputdatabaselevel.go @@ -0,0 +1,56 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +type ConnectToSourceSqlServerTaskOutputDatabaseLevel struct { + CompatibilityLevel *DatabaseCompatLevel `json:"compatibilityLevel,omitempty"` + DatabaseFiles *[]DatabaseFileInfo `json:"databaseFiles,omitempty"` + DatabaseState *DatabaseState `json:"databaseState,omitempty"` + Name *string `json:"name,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputDatabaseLevel{} + +func (s ConnectToSourceSqlServerTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputloginlevel.go new file mode 100644 index 00000000000..bc84d82533b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputloginlevel.go @@ -0,0 +1,56 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +type ConnectToSourceSqlServerTaskOutputLoginLevel struct { + DefaultDatabase *string `json:"defaultDatabase,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + LoginType *LoginType `json:"loginType,omitempty"` + MigrationEligibility *MigrationEligibilityInfo `json:"migrationEligibility,omitempty"` + Name *string `json:"name,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputLoginLevel{} + +func (s ConnectToSourceSqlServerTaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputtasklevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputtasklevel.go new file mode 100644 index 00000000000..302653c00f1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskoutputtasklevel.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectToSourceSqlServerTaskOutput = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +type ConnectToSourceSqlServerTaskOutputTaskLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + DatabaseTdeCertificateMapping *map[string]string `json:"databaseTdeCertificateMapping,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` + + // Fields inherited from ConnectToSourceSqlServerTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) ConnectToSourceSqlServerTaskOutput() BaseConnectToSourceSqlServerTaskOutputImpl { + return BaseConnectToSourceSqlServerTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskOutputTaskLevel{} + +func (s ConnectToSourceSqlServerTaskOutputTaskLevel) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskOutputTaskLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + decoded["resultType"] = "TaskLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskOutputTaskLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskproperties.go new file mode 100644 index 00000000000..6768c974bfa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttosourcesqlservertaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToSourceSqlServerTaskProperties{} + +type ConnectToSourceSqlServerTaskProperties struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + Output *[]ConnectToSourceSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToSourceSqlServerTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToSourceSqlServerTaskProperties{} + +func (s ConnectToSourceSqlServerTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToSourceSqlServerTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToSource.SqlServer" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToSourceSqlServerTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToSourceSqlServerTaskProperties{} + +func (s *ConnectToSourceSqlServerTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToSourceSqlServerTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToSourceSqlServerTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]ConnectToSourceSqlServerTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalConnectToSourceSqlServerTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'ConnectToSourceSqlServerTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskinput.go new file mode 100644 index 00000000000..db19af7fce4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskInput struct { + IsOfflineMigration *bool `json:"isOfflineMigration,omitempty"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskoutput.go new file mode 100644 index 00000000000..89c026eaed0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskoutput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForMySqlTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskproperties.go new file mode 100644 index 00000000000..02fea52d03c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbformysqltaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForMySqlTaskProperties{} + +type ConnectToTargetAzureDbForMySqlTaskProperties struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s ConnectToTargetAzureDbForMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForMySqlTaskProperties{} + +func (s *ConnectToTargetAzureDbForMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForMySqlTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..5cf86899c3a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskInput struct { + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..e9da7d7d83f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput struct { + Databases *[]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..51c4b70a274 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..b4ef727339d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput struct { + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..105a63bcf67 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,12 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput struct { + DatabaseSchemaMap *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined `json:"databaseSchemaMap,omitempty"` + Databases *[]string `json:"databases,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go new file mode 100644 index 00000000000..4bed5b09d17 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskoutputdatabaseschemamapinlined.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapInlined struct { + Database *string `json:"database,omitempty"` + Schemas *[]string `json:"schemas,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..ea3a52289b2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskinput.go new file mode 100644 index 00000000000..35bd813f635 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskInput struct { + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskoutput.go new file mode 100644 index 00000000000..e020cbc4e0e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskoutput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlDbTaskOutput struct { + Databases *map[string]string `json:"databases,omitempty"` + Id *string `json:"id,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskproperties.go new file mode 100644 index 00000000000..3289592b81a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqldbtaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlDbTaskProperties{} + +type ConnectToTargetSqlDbTaskProperties struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlDbTaskProperties{} + +func (s ConnectToTargetSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlDbTaskProperties{} + +func (s *ConnectToTargetSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlDbTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskinput.go new file mode 100644 index 00000000000..20851a5ebbf --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskoutput.go new file mode 100644 index 00000000000..9d6041e0dd6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMISyncTaskOutput struct { + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskproperties.go new file mode 100644 index 00000000000..54ade3a3c0d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMISyncTaskProperties{} + +type ConnectToTargetSqlMISyncTaskProperties struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMISyncTaskProperties{} + +func (s ConnectToTargetSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMISyncTaskProperties{} + +func (s *ConnectToTargetSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskinput.go new file mode 100644 index 00000000000..29534f919ab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskInput struct { + CollectAgentJobs *bool `json:"collectAgentJobs,omitempty"` + CollectLogins *bool `json:"collectLogins,omitempty"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidateSsisCatalogOnly *bool `json:"validateSsisCatalogOnly,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskoutput.go new file mode 100644 index 00000000000..140caa16e24 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskoutput.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlMITaskOutput struct { + AgentJobs *[]string `json:"agentJobs,omitempty"` + Id *string `json:"id,omitempty"` + Logins *[]string `json:"logins,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskproperties.go new file mode 100644 index 00000000000..240b997f798 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlmitaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlMITaskProperties{} + +type ConnectToTargetSqlMITaskProperties struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlMITaskProperties{} + +func (s ConnectToTargetSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlMITaskProperties{} + +func (s *ConnectToTargetSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlMITaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlsqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlsqldbsynctaskinput.go new file mode 100644 index 00000000000..230653df71a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlsqldbsynctaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectToTargetSqlSqlDbSyncTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlsqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlsqldbsynctaskproperties.go new file mode 100644 index 00000000000..11bb6f4cb63 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_connecttotargetsqlsqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +type ConnectToTargetSqlSqlDbSyncTaskProperties struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s ConnectToTargetSqlSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ConnectToTargetSqlSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ConnectToTarget.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ConnectToTargetSqlSqlDbSyncTaskProperties{} + +func (s *ConnectToTargetSqlSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ConnectToTargetSqlSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]ConnectToTargetSqlDbTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ConnectToTargetSqlSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ConnectToTargetSqlSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_databasebackupinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_databasebackupinfo.go new file mode 100644 index 00000000000..3f35fc9b760 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_databasebackupinfo.go @@ -0,0 +1,33 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseBackupInfo struct { + BackupFiles *[]string `json:"backupFiles,omitempty"` + BackupFinishDate *string `json:"backupFinishDate,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FamilyCount *int64 `json:"familyCount,omitempty"` + IsCompressed *bool `json:"isCompressed,omitempty"` + IsDamaged *bool `json:"isDamaged,omitempty"` + Position *int64 `json:"position,omitempty"` +} + +func (o *DatabaseBackupInfo) GetBackupFinishDateAsTime() (*time.Time, error) { + if o.BackupFinishDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BackupFinishDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseBackupInfo) SetBackupFinishDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BackupFinishDate = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_databasefileinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_databasefileinfo.go new file mode 100644 index 00000000000..b985e511a0d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_databasefileinfo.go @@ -0,0 +1,14 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseFileInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + FileType *DatabaseFileType `json:"fileType,omitempty"` + Id *string `json:"id,omitempty"` + LogicalName *string `json:"logicalName,omitempty"` + PhysicalFullName *string `json:"physicalFullName,omitempty"` + RestoreFullName *string `json:"restoreFullName,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_databasesummaryresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_databasesummaryresult.go new file mode 100644 index 00000000000..d5e2bf5eda0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_databasesummaryresult.go @@ -0,0 +1,47 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_databasetable.go b/resource-manager/datamigration/2021-06-30/taskresource/model_databasetable.go new file mode 100644 index 00000000000..259781e85a2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_databasetable.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseTable struct { + HasRows *bool `json:"hasRows,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_dataintegrityvalidationresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_dataintegrityvalidationresult.go new file mode 100644 index 00000000000..3a6ec62068b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_dataintegrityvalidationresult.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataIntegrityValidationResult struct { + FailedObjects *map[string]string `json:"failedObjects,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_dataitemmigrationsummaryresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_dataitemmigrationsummaryresult.go new file mode 100644 index 00000000000..59f61665ce0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_dataitemmigrationsummaryresult.go @@ -0,0 +1,46 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataItemMigrationSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + Name *string `json:"name,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` +} + +func (o *DataItemMigrationSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *DataItemMigrationSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataItemMigrationSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_executionstatistics.go b/resource-manager/datamigration/2021-06-30/taskresource/model_executionstatistics.go new file mode 100644 index 00000000000..3cba1907533 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_executionstatistics.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExecutionStatistics struct { + CpuTimeMs *float64 `json:"cpuTimeMs,omitempty"` + ElapsedTimeMs *float64 `json:"elapsedTimeMs,omitempty"` + ExecutionCount *int64 `json:"executionCount,omitempty"` + HasErrors *bool `json:"hasErrors,omitempty"` + SqlErrors *[]string `json:"sqlErrors,omitempty"` + WaitStats *map[string]WaitStatistics `json:"waitStats,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_fileshare.go b/resource-manager/datamigration/2021-06-30/taskresource/model_fileshare.go new file mode 100644 index 00000000000..60e2ee8d55e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_fileshare.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileShare struct { + Password *string `json:"password,omitempty"` + Path string `json:"path"` + UserName *string `json:"userName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskinput.go new file mode 100644 index 00000000000..eeb90ec4fd2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskInput struct { + BackupFileShare FileShare `json:"backupFileShare"` + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedCertificates []SelectedCertificateInput `json:"selectedCertificates"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskoutput.go new file mode 100644 index 00000000000..f73d40720a7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskoutput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTdeCertificatesSqlTaskOutput struct { + Base64EncodedCertificates *map[string][]string `json:"base64EncodedCertificates,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskproperties.go new file mode 100644 index 00000000000..5b5fb620792 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_gettdecertificatessqltaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetTdeCertificatesSqlTaskProperties{} + +type GetTdeCertificatesSqlTaskProperties struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetTdeCertificatesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetTdeCertificatesSqlTaskProperties{} + +func (s GetTdeCertificatesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetTdeCertificatesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetTDECertificates.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetTdeCertificatesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetTdeCertificatesSqlTaskProperties{} + +func (s *GetTdeCertificatesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetTdeCertificatesSqlTaskInput `json:"input,omitempty"` + Output *[]GetTdeCertificatesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetTdeCertificatesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetTdeCertificatesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskinput.go new file mode 100644 index 00000000000..9e69c16cdfb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskInput struct { + ConnectionInfo MySqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskoutput.go new file mode 100644 index 00000000000..398a1d3936a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesMySqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskproperties.go new file mode 100644 index 00000000000..e993675d4a0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesmysqltaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesMySqlTaskProperties{} + +type GetUserTablesMySqlTaskProperties struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesMySqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesMySqlTaskProperties{} + +func (s GetUserTablesMySqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesMySqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesMySqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesMySqlTaskProperties{} + +func (s *GetUserTablesMySqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesMySqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesMySqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesMySqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesMySqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskinput.go new file mode 100644 index 00000000000..c5bad92b148 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskInput struct { + ConnectionInfo OracleConnectionInfo `json:"connectionInfo"` + SelectedSchemas []string `json:"selectedSchemas"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskoutput.go new file mode 100644 index 00000000000..2539c1f582c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesOracleTaskOutput struct { + SchemaName *string `json:"schemaName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskproperties.go new file mode 100644 index 00000000000..aec899b279f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablesoracletaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesOracleTaskProperties{} + +type GetUserTablesOracleTaskProperties struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesOracleTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesOracleTaskProperties{} + +func (s GetUserTablesOracleTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesOracleTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesOracle" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesOracleTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesOracleTaskProperties{} + +func (s *GetUserTablesOracleTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesOracleTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesOracleTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesOracleTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesOracleTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskinput.go new file mode 100644 index 00000000000..dba8485eeb8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskInput struct { + ConnectionInfo PostgreSqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskoutput.go new file mode 100644 index 00000000000..4f04507c9e7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesPostgreSqlTaskOutput struct { + DatabaseName *string `json:"databaseName,omitempty"` + Tables *[]DatabaseTable `json:"tables,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskproperties.go new file mode 100644 index 00000000000..3c24a642487 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablespostgresqltaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesPostgreSqlTaskProperties{} + +type GetUserTablesPostgreSqlTaskProperties struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesPostgreSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesPostgreSqlTaskProperties{} + +func (s GetUserTablesPostgreSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesPostgreSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTablesPostgreSql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesPostgreSqlTaskProperties{} + +func (s *GetUserTablesPostgreSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesPostgreSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesPostgreSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesPostgreSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesPostgreSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskinput.go new file mode 100644 index 00000000000..9770c7268d0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskInput struct { + SelectedSourceDatabases []string `json:"selectedSourceDatabases"` + SelectedTargetDatabases []string `json:"selectedTargetDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskoutput.go new file mode 100644 index 00000000000..652b046beed --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskoutput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlSyncTaskOutput struct { + DatabasesToSourceTables *map[string][]DatabaseTable `json:"databasesToSourceTables,omitempty"` + DatabasesToTargetTables *map[string][]DatabaseTable `json:"databasesToTargetTables,omitempty"` + TableValidationErrors *map[string][]string `json:"tableValidationErrors,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskproperties.go new file mode 100644 index 00000000000..ec627170773 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlSyncTaskProperties{} + +type GetUserTablesSqlSyncTaskProperties struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlSyncTaskProperties{} + +func (s GetUserTablesSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlSyncTaskProperties{} + +func (s *GetUserTablesSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlSyncTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskinput.go new file mode 100644 index 00000000000..ec856944030 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskInput struct { + ConnectionInfo SqlConnectionInfo `json:"connectionInfo"` + SelectedDatabases []string `json:"selectedDatabases"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskoutput.go new file mode 100644 index 00000000000..d36a8077b19 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserTablesSqlTaskOutput struct { + DatabasesToTables *map[string][]DatabaseTable `json:"databasesToTables,omitempty"` + Id *string `json:"id,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskproperties.go new file mode 100644 index 00000000000..a8e719a53fb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_getusertablessqltaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = GetUserTablesSqlTaskProperties{} + +type GetUserTablesSqlTaskProperties struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s GetUserTablesSqlTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = GetUserTablesSqlTaskProperties{} + +func (s GetUserTablesSqlTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper GetUserTablesSqlTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + decoded["taskType"] = "GetUserTables.Sql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling GetUserTablesSqlTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &GetUserTablesSqlTaskProperties{} + +func (s *GetUserTablesSqlTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *GetUserTablesSqlTaskInput `json:"input,omitempty"` + Output *[]GetUserTablesSqlTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling GetUserTablesSqlTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'GetUserTablesSqlTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandinput.go new file mode 100644 index 00000000000..fe3bfa24c91 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandInput struct { + SourceDatabaseName string `json:"sourceDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandoutput.go new file mode 100644 index 00000000000..fc9f0f1102e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandoutput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMISyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandproperties.go new file mode 100644 index 00000000000..b1318837812 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemisynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateMISyncCompleteCommandProperties{} + +type MigrateMISyncCompleteCommandProperties struct { + Input *MigrateMISyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateMISyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateMISyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateMISyncCompleteCommandProperties{} + +func (s MigrateMISyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMISyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.SqlServer.AzureDbSqlMi.Complete" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMISyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemongodbtaskproperties.go new file mode 100644 index 00000000000..47a236a7ce4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemongodbtaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMongoDbTaskProperties{} + +type MigrateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMongoDbTaskProperties{} + +func (s MigrateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMongoDbTaskProperties{} + +func (s *MigrateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MongoDbProgress, 0) + for i, val := range listTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go new file mode 100644 index 00000000000..42db4478562 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinedatabaseinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineDatabaseInput struct { + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskinput.go new file mode 100644 index 00000000000..3703c32927e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskinput.go @@ -0,0 +1,31 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskInput struct { + MakeSourceServerReadOnly *bool `json:"makeSourceServerReadOnly,omitempty"` + OptionalAgentSettings *map[string]string `json:"optionalAgentSettings,omitempty"` + SelectedDatabases []MigrateMySqlAzureDbForMySqlOfflineDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + StartedOn *string `json:"startedOn,omitempty"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateMySqlAzureDbForMySqlOfflineTaskInput) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go new file mode 100644 index 00000000000..766193628dc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutput.go @@ -0,0 +1,100 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutput interface { + MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlOfflineTaskOutput BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlOfflineTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlOfflineTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + migrateMySqlAzureDbForMySqlOfflineTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go new file mode 100644 index 00000000000..850a7decc4a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go new file mode 100644 index 00000000000..792b56e2161 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go new file mode 100644 index 00000000000..20132b4c6b8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go new file mode 100644 index 00000000000..9660660e939 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskoutputtablelevel.go @@ -0,0 +1,61 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlOfflineTaskOutput = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + LastStorageUpdate *string `json:"lastStorageUpdate,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlOfflineTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlOfflineTaskOutput() BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlOfflineTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go new file mode 100644 index 00000000000..07885a149c2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlofflinetaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +type MigrateMySqlAzureDbForMySqlOfflineTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlOfflineTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlOfflineTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlOfflineTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlOfflineTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlOfflineTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlOfflineTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlOfflineTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlOfflineTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlOfflineTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlOfflineTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go new file mode 100644 index 00000000000..c151f7b6289 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskinput.go new file mode 100644 index 00000000000..a3111b43fe3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskInput struct { + SelectedDatabases []MigrateMySqlAzureDbForMySqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo MySqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo MySqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go new file mode 100644 index 00000000000..1377dcd66e6 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateMySqlAzureDbForMySqlSyncTaskOutput interface { + MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +type BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s +} + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{} + +// RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl struct { + migrateMySqlAzureDbForMySqlSyncTaskOutput BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return s.migrateMySqlAzureDbForMySqlSyncTaskOutput +} + +func UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(input []byte) (MigrateMySqlAzureDbForMySqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + migrateMySqlAzureDbForMySqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..799a94fd78f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..319318bd52b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go new file mode 100644 index 00000000000..561f9774d8f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputError{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..dc87b8e2103 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..9b51cf03efb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateMySqlAzureDbForMySqlSyncTaskOutput = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +type MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *string `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *string `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *string `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateMySqlAzureDbForMySqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MigrateMySqlAzureDbForMySqlSyncTaskOutput() BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl { + return BaseMigrateMySqlAzureDbForMySqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go new file mode 100644 index 00000000000..f5e2bfe3433 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratemysqlazuredbformysqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +type MigrateMySqlAzureDbForMySqlSyncTaskProperties struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateMySqlAzureDbForMySqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s MigrateMySqlAzureDbForMySqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateMySqlAzureDbForMySqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.MySql.AzureDbForMySql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateMySqlAzureDbForMySqlSyncTaskProperties{} + +func (s *MigrateMySqlAzureDbForMySqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateMySqlAzureDbForMySqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateMySqlAzureDbForMySqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateMySqlAzureDbForMySqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateMySqlAzureDbForMySqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateMySqlAzureDbForMySqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..76402214cd8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type MigrateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Oracle.AzureDbForPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigrateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateOracleAzureDbPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..0078214f52f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncDatabaseInput struct { + CaseManipulation *string `json:"caseManipulation,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..ad20a079e35 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigrateOracleAzureDbPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo OracleConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..63ebbfd06cd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutput interface { + MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +type BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{} + +// RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl struct { + migrateOracleAzureDbPostgreSqlSyncTaskOutput BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return s.migrateOracleAzureDbPostgreSqlSyncTaskOutput +} + +func UnmarshalMigrateOracleAzureDbPostgreSqlSyncTaskOutputImplementation(input []byte) (MigrateOracleAzureDbPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + migrateOracleAzureDbPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..6a0767fa7f3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ed8830c3928 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..14538d30285 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputError{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..784c9569482 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,57 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..4398264c13e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrateoracleazuredbpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateOracleAzureDbPostgreSqlSyncTaskOutput = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +type MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateOracleAzureDbPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MigrateOracleAzureDbPostgreSqlSyncTaskOutput() BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl { + return BaseMigrateOracleAzureDbPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go new file mode 100644 index 00000000000..6cf126c83fe --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabaseinput.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput struct { + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SelectedTables *[]MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput `json:"selectedTables,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go new file mode 100644 index 00000000000..cef81697291 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsyncdatabasetableinput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput struct { + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go new file mode 100644 index 00000000000..baf439b0603 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput struct { + SelectedDatabases []MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo PostgreSqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo PostgreSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..55e990fb668 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput interface { + MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +type BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s +} + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{} + +// RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl struct { + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return s.migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput +} + +func UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(input []byte) (MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl: %+v", err) + } + + return RawMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + migratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..ff0b0349ffc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..53758f4eeb5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go new file mode 100644 index 00000000000..6fed1e31fff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..e937b775d21 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputmigrationlevel.go @@ -0,0 +1,60 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerType *ScenarioSource `json:"sourceServerType,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *ReplicateMigrationState `json:"state,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerType *ScenarioTarget `json:"targetServerType,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..bd37564cdf1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput() BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl { + return BaseMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..fbb787d24ab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratepostgresqlazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +type MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbdatabaseinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbdatabaseinput.go new file mode 100644 index 00000000000..995f7216e8d --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbdatabaseinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbDatabaseInput struct { + MakeSourceDbReadOnly *bool `json:"makeSourceDbReadOnly,omitempty"` + Name *string `json:"name,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsyncdatabaseinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsyncdatabaseinput.go new file mode 100644 index 00000000000..8e64d5310e2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsyncdatabaseinput.go @@ -0,0 +1,15 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncDatabaseInput struct { + Id *string `json:"id,omitempty"` + MigrationSetting *map[string]string `json:"migrationSetting,omitempty"` + Name *string `json:"name,omitempty"` + SchemaName *string `json:"schemaName,omitempty"` + SourceSetting *map[string]string `json:"sourceSetting,omitempty"` + TableMap *map[string]string `json:"tableMap,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + TargetSetting *map[string]string `json:"targetSetting,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskinput.go new file mode 100644 index 00000000000..591a42c028f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutput.go new file mode 100644 index 00000000000..de0109fc2ad --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbSyncTaskOutput interface { + MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbSyncTaskOutput = RawMigrateSqlServerSqlDbSyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbSyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbSyncTaskOutputImpl struct { + migrateSqlServerSqlDbSyncTaskOutput BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbSyncTaskOutputImpl) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return s.migrateSqlServerSqlDbSyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbSyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbSyncTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbSyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbSyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbSyncTaskOutputImpl{ + migrateSqlServerSqlDbSyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go new file mode 100644 index 00000000000..654f3fac269 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaseerror.go @@ -0,0 +1,53 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Events *[]SyncMigrationDatabaseErrorEvent `json:"events,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..1106242db55 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputdatabaselevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel struct { + AppliedChanges *int64 `json:"appliedChanges,omitempty"` + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + FullLoadCompletedTables *int64 `json:"fullLoadCompletedTables,omitempty"` + FullLoadErroredTables *int64 `json:"fullLoadErroredTables,omitempty"` + FullLoadLoadingTables *int64 `json:"fullLoadLoadingTables,omitempty"` + FullLoadQueuedTables *int64 `json:"fullLoadQueuedTables,omitempty"` + IncomingChanges *int64 `json:"incomingChanges,omitempty"` + InitializationCompleted *bool `json:"initializationCompleted,omitempty"` + Latency *int64 `json:"latency,omitempty"` + MigrationState *SyncDatabaseMigrationReportingState `json:"migrationState,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputerror.go new file mode 100644 index 00000000000..ac5bc1957de --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputError{} + +type MigrateSqlServerSqlDbSyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputError{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..61ca4f54952 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputmigrationlevel.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServer *string `json:"sourceServer,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + TargetServer *string `json:"targetServer,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go new file mode 100644 index 00000000000..f2150dc4cd4 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskoutputtablelevel.go @@ -0,0 +1,64 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbSyncTaskOutput = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbSyncTaskOutputTableLevel struct { + CdcDeleteCounter *int64 `json:"cdcDeleteCounter,omitempty"` + CdcInsertCounter *int64 `json:"cdcInsertCounter,omitempty"` + CdcUpdateCounter *int64 `json:"cdcUpdateCounter,omitempty"` + DataErrorsCounter *int64 `json:"dataErrorsCounter,omitempty"` + DatabaseName *string `json:"databaseName,omitempty"` + FullLoadEndedOn *string `json:"fullLoadEndedOn,omitempty"` + FullLoadEstFinishTime *string `json:"fullLoadEstFinishTime,omitempty"` + FullLoadStartedOn *string `json:"fullLoadStartedOn,omitempty"` + FullLoadTotalRows *int64 `json:"fullLoadTotalRows,omitempty"` + LastModifiedTime *string `json:"lastModifiedTime,omitempty"` + State *SyncTableMigrationState `json:"state,omitempty"` + TableName *string `json:"tableName,omitempty"` + TotalChangesApplied *int64 `json:"totalChangesApplied,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbSyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MigrateSqlServerSqlDbSyncTaskOutput() BaseMigrateSqlServerSqlDbSyncTaskOutputImpl { + return BaseMigrateSqlServerSqlDbSyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbSyncTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..2c8c166c681 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbsynctaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbSyncTaskProperties{} + +type MigrateSqlServerSqlDbSyncTaskProperties struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s MigrateSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbSyncTaskProperties{} + +func (s *MigrateSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbSyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbSyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbSyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskinput.go new file mode 100644 index 00000000000..0041f8d99b9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` + ValidationOptions *MigrationValidationOptions `json:"validationOptions,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutput.go new file mode 100644 index 00000000000..4efbc1bea0b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutput.go @@ -0,0 +1,116 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlDbTaskOutput interface { + MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl +} + +var _ MigrateSqlServerSqlDbTaskOutput = BaseMigrateSqlServerSqlDbTaskOutputImpl{} + +type BaseMigrateSqlServerSqlDbTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlDbTaskOutput = RawMigrateSqlServerSqlDbTaskOutputImpl{} + +// RawMigrateSqlServerSqlDbTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlDbTaskOutputImpl struct { + migrateSqlServerSqlDbTaskOutput BaseMigrateSqlServerSqlDbTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlDbTaskOutputImpl) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return s.migrateSqlServerSqlDbTaskOutput +} + +func UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(input []byte) (MigrateSqlServerSqlDbTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationDatabaseLevelValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlDbTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "TableLevelOutput") { + var out MigrateSqlServerSqlDbTaskOutputTableLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationValidationOutput") { + var out MigrateSqlServerSqlDbTaskOutputValidationResult + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlDbTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlDbTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlDbTaskOutputImpl{ + migrateSqlServerSqlDbTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go new file mode 100644 index 00000000000..27797a34504 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevel.go @@ -0,0 +1,65 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorCount *int64 `json:"errorCount,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + NumberOfObjects *int64 `json:"numberOfObjects,omitempty"` + NumberOfObjectsCompleted *int64 `json:"numberOfObjectsCompleted,omitempty"` + ObjectSummary *map[string]DataItemMigrationSummaryResult `json:"objectSummary,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go new file mode 100644 index 00000000000..8efa791fc51 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputdatabaselevelvalidationresult.go @@ -0,0 +1,60 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult struct { + DataIntegrityValidationResult *DataIntegrityValidationResult `json:"dataIntegrityValidationResult,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + QueryAnalysisValidationResult *QueryAnalysisValidationResult `json:"queryAnalysisValidationResult,omitempty"` + SchemaValidationResult *SchemaComparisonValidationResult `json:"schemaValidationResult,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationDatabaseLevelValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputerror.go new file mode 100644 index 00000000000..14c189addbd --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputError{} + +type MigrateSqlServerSqlDbTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputError) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputError{} + +func (s MigrateSqlServerSqlDbTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go new file mode 100644 index 00000000000..a66ff2d88ff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlDbTaskOutputMigrationLevel struct { + DatabaseSummary *map[string]DatabaseSummaryResult `json:"databaseSummary,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + MigrationReportResult *MigrationReportResult `json:"migrationReportResult,omitempty"` + MigrationValidationResult *MigrationValidationResult `json:"migrationValidationResult,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputtablelevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputtablelevel.go new file mode 100644 index 00000000000..f539775aa39 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputtablelevel.go @@ -0,0 +1,60 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +type MigrateSqlServerSqlDbTaskOutputTableLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ItemsCompletedCount *int64 `json:"itemsCompletedCount,omitempty"` + ItemsCount *int64 `json:"itemsCount,omitempty"` + ObjectName *string `json:"objectName,omitempty"` + ResultPrefix *string `json:"resultPrefix,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + StatusMessage *string `json:"statusMessage,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputTableLevel{} + +func (s MigrateSqlServerSqlDbTaskOutputTableLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputTableLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + decoded["resultType"] = "TableLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputTableLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go new file mode 100644 index 00000000000..87ca3e60cdc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskoutputvalidationresult.go @@ -0,0 +1,54 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlDbTaskOutput = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +type MigrateSqlServerSqlDbTaskOutputValidationResult struct { + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` + + // Fields inherited from MigrateSqlServerSqlDbTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MigrateSqlServerSqlDbTaskOutput() BaseMigrateSqlServerSqlDbTaskOutputImpl { + return BaseMigrateSqlServerSqlDbTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskOutputValidationResult{} + +func (s MigrateSqlServerSqlDbTaskOutputValidationResult) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskOutputValidationResult + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + decoded["resultType"] = "MigrationValidationOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskOutputValidationResult: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskproperties.go new file mode 100644 index 00000000000..bc3c64b10ba --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqldbtaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlDbTaskProperties{} + +type MigrateSqlServerSqlDbTaskProperties struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlDbTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlDbTaskProperties{} + +func (s MigrateSqlServerSqlDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.SqlDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlDbTaskProperties{} + +func (s *MigrateSqlServerSqlDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlDbTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlDbTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlDbTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmidatabaseinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmidatabaseinput.go new file mode 100644 index 00000000000..71e80b4ee87 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmidatabaseinput.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMIDatabaseInput struct { + BackupFilePaths *[]string `json:"backupFilePaths,omitempty"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + Name string `json:"name"` + RestoreDatabaseName string `json:"restoreDatabaseName"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..522b6061ed5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutput.go @@ -0,0 +1,92 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMISyncTaskOutput interface { + MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = BaseMigrateSqlServerSqlMISyncTaskOutputImpl{} + +type BaseMigrateSqlServerSqlMISyncTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMISyncTaskOutput = RawMigrateSqlServerSqlMISyncTaskOutputImpl{} + +// RawMigrateSqlServerSqlMISyncTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMISyncTaskOutputImpl struct { + migrateSqlServerSqlMISyncTaskOutput BaseMigrateSqlServerSqlMISyncTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMISyncTaskOutputImpl) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return s.migrateSqlServerSqlMISyncTaskOutput +} + +func UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(input []byte) (MigrateSqlServerSqlMISyncTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMISyncTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMISyncTaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMISyncTaskOutputImpl{ + migrateSqlServerSqlMISyncTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go new file mode 100644 index 00000000000..ad81f2f672a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputdatabaselevel.go @@ -0,0 +1,62 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel struct { + ActiveBackupSets *[]BackupSetInfo `json:"activeBackupSets,omitempty"` + ContainerName *string `json:"containerName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ErrorPrefix *string `json:"errorPrefix,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FullBackupSetInfo *BackupSetInfo `json:"fullBackupSetInfo,omitempty"` + IsFullBackupRestored *bool `json:"isFullBackupRestored,omitempty"` + LastRestoredBackupSetInfo *BackupSetInfo `json:"lastRestoredBackupSetInfo,omitempty"` + MigrationState *DatabaseMigrationState `json:"migrationState,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputerror.go new file mode 100644 index 00000000000..6994f68ac59 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputError{} + +type MigrateSqlServerSqlMISyncTaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputError{} + +func (s MigrateSqlServerSqlMISyncTaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go new file mode 100644 index 00000000000..bab9e87373e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskoutputmigrationlevel.go @@ -0,0 +1,62 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMISyncTaskOutput = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMISyncTaskOutputMigrationLevel struct { + DatabaseCount *int64 `json:"databaseCount,omitempty"` + DatabaseErrorCount *int64 `json:"databaseErrorCount,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerName *string `json:"sourceServerName,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerName *string `json:"targetServerName,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMISyncTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MigrateSqlServerSqlMISyncTaskOutput() BaseMigrateSqlServerSqlMISyncTaskOutputImpl { + return BaseMigrateSqlServerSqlMISyncTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMISyncTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..a4b505ea62c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmisynctaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMISyncTaskProperties{} + +type MigrateSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMISyncTaskProperties{} + +func (s MigrateSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMISyncTaskProperties{} + +func (s *MigrateSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMISyncTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMISyncTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskinput.go new file mode 100644 index 00000000000..3e1b624330a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskinput.go @@ -0,0 +1,16 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskInput struct { + AadDomainName *string `json:"aadDomainName,omitempty"` + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedAgentJobs *[]string `json:"selectedAgentJobs,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..14658e663ac --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutput.go @@ -0,0 +1,108 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSqlServerSqlMITaskOutput interface { + MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl +} + +var _ MigrateSqlServerSqlMITaskOutput = BaseMigrateSqlServerSqlMITaskOutputImpl{} + +type BaseMigrateSqlServerSqlMITaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s +} + +var _ MigrateSqlServerSqlMITaskOutput = RawMigrateSqlServerSqlMITaskOutputImpl{} + +// RawMigrateSqlServerSqlMITaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSqlServerSqlMITaskOutputImpl struct { + migrateSqlServerSqlMITaskOutput BaseMigrateSqlServerSqlMITaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSqlServerSqlMITaskOutputImpl) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return s.migrateSqlServerSqlMITaskOutput +} + +func UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(input []byte) (MigrateSqlServerSqlMITaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "AgentJobLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputAgentJobLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DatabaseLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputDatabaseLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ErrorOutput") { + var out MigrateSqlServerSqlMITaskOutputError + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "LoginLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputLoginLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSqlServerSqlMITaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSqlServerSqlMITaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSqlServerSqlMITaskOutputImpl: %+v", err) + } + + return RawMigrateSqlServerSqlMITaskOutputImpl{ + migrateSqlServerSqlMITaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go new file mode 100644 index 00000000000..04f2d5f4733 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputagentjoblevel.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +type MigrateSqlServerSqlMITaskOutputAgentJobLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + IsEnabled *bool `json:"isEnabled,omitempty"` + Message *string `json:"message,omitempty"` + Name *string `json:"name,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputAgentJobLevel{} + +func (s MigrateSqlServerSqlMITaskOutputAgentJobLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputAgentJobLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + decoded["resultType"] = "AgentJobLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputAgentJobLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go new file mode 100644 index 00000000000..9830f68704f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputdatabaselevel.go @@ -0,0 +1,59 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +type MigrateSqlServerSqlMITaskOutputDatabaseLevel struct { + DatabaseName *string `json:"databaseName,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SizeMB *float64 `json:"sizeMB,omitempty"` + Stage *DatabaseMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputDatabaseLevel{} + +func (s MigrateSqlServerSqlMITaskOutputDatabaseLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputDatabaseLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + decoded["resultType"] = "DatabaseLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputDatabaseLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputerror.go new file mode 100644 index 00000000000..a853d356e39 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputerror.go @@ -0,0 +1,52 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputError{} + +type MigrateSqlServerSqlMITaskOutputError struct { + Error *ReportableException `json:"error,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputError) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputError{} + +func (s MigrateSqlServerSqlMITaskOutputError) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputError + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + decoded["resultType"] = "ErrorOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputError: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputloginlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputloginlevel.go new file mode 100644 index 00000000000..e3a4f03db53 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputloginlevel.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +type MigrateSqlServerSqlMITaskOutputLoginLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + LoginName *string `json:"loginName,omitempty"` + Message *string `json:"message,omitempty"` + Stage *LoginMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputLoginLevel{} + +func (s MigrateSqlServerSqlMITaskOutputLoginLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputLoginLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + decoded["resultType"] = "LoginLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputLoginLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go new file mode 100644 index 00000000000..b6a693639db --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskoutputmigrationlevel.go @@ -0,0 +1,66 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSqlServerSqlMITaskOutput = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +type MigrateSqlServerSqlMITaskOutputMigrationLevel struct { + AgentJobs *map[string]string `json:"agentJobs,omitempty"` + Databases *map[string]string `json:"databases,omitempty"` + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Logins *map[string]string `json:"logins,omitempty"` + Message *string `json:"message,omitempty"` + OrphanedUsersInfo *[]OrphanedUserInfo `json:"orphanedUsersInfo,omitempty"` + ServerRoleResults *map[string]StartMigrationScenarioServerRoleResult `json:"serverRoleResults,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSqlServerSqlMITaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MigrateSqlServerSqlMITaskOutput() BaseMigrateSqlServerSqlMITaskOutputImpl { + return BaseMigrateSqlServerSqlMITaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskOutputMigrationLevel{} + +func (s MigrateSqlServerSqlMITaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..d99e7b68f8f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesqlserversqlmitaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSqlServerSqlMITaskProperties{} + +type MigrateSqlServerSqlMITaskProperties struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]MigrateSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSqlServerSqlMITaskProperties{} + +func (s MigrateSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSqlServerSqlMITaskProperties{} + +func (s *MigrateSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSqlServerSqlMITaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSqlServerSqlMITaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSqlServerSqlMITaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskinput.go new file mode 100644 index 00000000000..21e69f0da78 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskInput struct { + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + SsisMigrationInfo SsisMigrationInfo `json:"ssisMigrationInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutput.go new file mode 100644 index 00000000000..68eab3f91ec --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutput.go @@ -0,0 +1,84 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSsisTaskOutput interface { + MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl +} + +var _ MigrateSsisTaskOutput = BaseMigrateSsisTaskOutputImpl{} + +type BaseMigrateSsisTaskOutputImpl struct { + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s BaseMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s +} + +var _ MigrateSsisTaskOutput = RawMigrateSsisTaskOutputImpl{} + +// RawMigrateSsisTaskOutputImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMigrateSsisTaskOutputImpl struct { + migrateSsisTaskOutput BaseMigrateSsisTaskOutputImpl + Type string + Values map[string]interface{} +} + +func (s RawMigrateSsisTaskOutputImpl) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return s.migrateSsisTaskOutput +} + +func UnmarshalMigrateSsisTaskOutputImplementation(input []byte) (MigrateSsisTaskOutput, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutput into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "MigrationLevelOutput") { + var out MigrateSsisTaskOutputMigrationLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SsisProjectLevelOutput") { + var out MigrateSsisTaskOutputProjectLevel + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskOutputProjectLevel: %+v", err) + } + return out, nil + } + + var parent BaseMigrateSsisTaskOutputImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMigrateSsisTaskOutputImpl: %+v", err) + } + + return RawMigrateSsisTaskOutputImpl{ + migrateSsisTaskOutput: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutputmigrationlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutputmigrationlevel.go new file mode 100644 index 00000000000..13aa99abe53 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutputmigrationlevel.go @@ -0,0 +1,61 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputMigrationLevel{} + +type MigrateSsisTaskOutputMigrationLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Message *string `json:"message,omitempty"` + SourceServerBrandVersion *string `json:"sourceServerBrandVersion,omitempty"` + SourceServerVersion *string `json:"sourceServerVersion,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *MigrationStatus `json:"status,omitempty"` + TargetServerBrandVersion *string `json:"targetServerBrandVersion,omitempty"` + TargetServerVersion *string `json:"targetServerVersion,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputMigrationLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputMigrationLevel{} + +func (s MigrateSsisTaskOutputMigrationLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputMigrationLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + decoded["resultType"] = "MigrationLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputMigrationLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutputprojectlevel.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutputprojectlevel.go new file mode 100644 index 00000000000..57107d205ff --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskoutputprojectlevel.go @@ -0,0 +1,59 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MigrateSsisTaskOutput = MigrateSsisTaskOutputProjectLevel{} + +type MigrateSsisTaskOutputProjectLevel struct { + EndedOn *string `json:"endedOn,omitempty"` + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + FolderName *string `json:"folderName,omitempty"` + Message *string `json:"message,omitempty"` + ProjectName *string `json:"projectName,omitempty"` + Stage *SsisMigrationStage `json:"stage,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + State *MigrationState `json:"state,omitempty"` + + // Fields inherited from MigrateSsisTaskOutput + + Id *string `json:"id,omitempty"` + ResultType string `json:"resultType"` +} + +func (s MigrateSsisTaskOutputProjectLevel) MigrateSsisTaskOutput() BaseMigrateSsisTaskOutputImpl { + return BaseMigrateSsisTaskOutputImpl{ + Id: s.Id, + ResultType: s.ResultType, + } +} + +var _ json.Marshaler = MigrateSsisTaskOutputProjectLevel{} + +func (s MigrateSsisTaskOutputProjectLevel) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskOutputProjectLevel + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + decoded["resultType"] = "SsisProjectLevelOutput" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskOutputProjectLevel: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskproperties.go new file mode 100644 index 00000000000..04279fa3b45 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratessistaskproperties.go @@ -0,0 +1,121 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = MigrateSsisTaskProperties{} + +type MigrateSsisTaskProperties struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + Output *[]MigrateSsisTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s MigrateSsisTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = MigrateSsisTaskProperties{} + +func (s MigrateSsisTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSsisTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSsisTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSsisTaskProperties: %+v", err) + } + + decoded["taskType"] = "Migrate.Ssis" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSsisTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MigrateSsisTaskProperties{} + +func (s *MigrateSsisTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateSsisTaskInput `json:"input,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MigrateSsisTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + if v, ok := temp["output"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Output into list []json.RawMessage: %+v", err) + } + + output := make([]MigrateSsisTaskOutput, 0) + for i, val := range listTemp { + impl, err := UnmarshalMigrateSsisTaskOutputImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Output' for 'MigrateSsisTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Output = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandinput.go new file mode 100644 index 00000000000..281d8564318 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandinput.go @@ -0,0 +1,27 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandInput struct { + CommitTimeStamp *string `json:"commitTimeStamp,omitempty"` + DatabaseName string `json:"databaseName"` +} + +func (o *MigrateSyncCompleteCommandInput) GetCommitTimeStampAsTime() (*time.Time, error) { + if o.CommitTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CommitTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrateSyncCompleteCommandInput) SetCommitTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CommitTimeStamp = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandoutput.go new file mode 100644 index 00000000000..a1a9245d90e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandoutput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrateSyncCompleteCommandOutput struct { + Errors *[]ReportableException `json:"errors,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandproperties.go new file mode 100644 index 00000000000..c1db71c50dc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migratesynccompletecommandproperties.go @@ -0,0 +1,55 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CommandProperties = MigrateSyncCompleteCommandProperties{} + +type MigrateSyncCompleteCommandProperties struct { + Input *MigrateSyncCompleteCommandInput `json:"input,omitempty"` + Output *MigrateSyncCompleteCommandOutput `json:"output,omitempty"` + + // Fields inherited from CommandProperties + + CommandType string `json:"commandType"` + Errors *[]ODataError `json:"errors,omitempty"` + State *CommandState `json:"state,omitempty"` +} + +func (s MigrateSyncCompleteCommandProperties) CommandProperties() BaseCommandPropertiesImpl { + return BaseCommandPropertiesImpl{ + CommandType: s.CommandType, + Errors: s.Errors, + State: s.State, + } +} + +var _ json.Marshaler = MigrateSyncCompleteCommandProperties{} + +func (s MigrateSyncCompleteCommandProperties) MarshalJSON() ([]byte, error) { + type wrapper MigrateSyncCompleteCommandProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + decoded["commandType"] = "Migrate.Sync.Complete.Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MigrateSyncCompleteCommandProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrationeligibilityinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationeligibilityinfo.go new file mode 100644 index 00000000000..2c95a8d88fa --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationeligibilityinfo.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationEligibilityInfo struct { + IsEligibleForMigration *bool `json:"isEligibleForMigration,omitempty"` + ValidationMessages *[]string `json:"validationMessages,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrationreportresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationreportresult.go new file mode 100644 index 00000000000..21617dd3dfc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationreportresult.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationReportResult struct { + Id *string `json:"id,omitempty"` + ReportURL *string `json:"reportUrl,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationdatabasesummaryresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationdatabasesummaryresult.go new file mode 100644 index 00000000000..7d4d8b8eb6e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationdatabasesummaryresult.go @@ -0,0 +1,44 @@ +package taskresource + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationDatabaseSummaryResult struct { + EndedOn *string `json:"endedOn,omitempty"` + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty"` + StartedOn *string `json:"startedOn,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + TargetDatabaseName *string `json:"targetDatabaseName,omitempty"` +} + +func (o *MigrationValidationDatabaseSummaryResult) GetEndedOnAsTime() (*time.Time, error) { + if o.EndedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetEndedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndedOn = &formatted +} + +func (o *MigrationValidationDatabaseSummaryResult) GetStartedOnAsTime() (*time.Time, error) { + if o.StartedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *MigrationValidationDatabaseSummaryResult) SetStartedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartedOn = &formatted +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationoptions.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationoptions.go new file mode 100644 index 00000000000..d463dfa9216 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationoptions.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationOptions struct { + EnableDataIntegrityValidation *bool `json:"enableDataIntegrityValidation,omitempty"` + EnableQueryAnalysisValidation *bool `json:"enableQueryAnalysisValidation,omitempty"` + EnableSchemaValidation *bool `json:"enableSchemaValidation,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationresult.go new file mode 100644 index 00000000000..586711d6c6b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_migrationvalidationresult.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MigrationValidationResult struct { + Id *string `json:"id,omitempty"` + MigrationId *string `json:"migrationId,omitempty"` + Status *ValidationStatus `json:"status,omitempty"` + SummaryResults *map[string]MigrationValidationDatabaseSummaryResult `json:"summaryResults,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_misqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_misqlconnectioninfo.go new file mode 100644 index 00000000000..14cfe28c18f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_misqlconnectioninfo.go @@ -0,0 +1,54 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MiSqlConnectionInfo{} + +type MiSqlConnectionInfo struct { + ManagedInstanceResourceId string `json:"managedInstanceResourceId"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MiSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MiSqlConnectionInfo{} + +func (s MiSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MiSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MiSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MiSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MiSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MiSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbclusterinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbclusterinfo.go new file mode 100644 index 00000000000..549cec8c69a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbclusterinfo.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbClusterInfo struct { + Databases []MongoDbDatabaseInfo `json:"databases"` + SupportsSharding bool `json:"supportsSharding"` + Type MongoDbClusterType `json:"type"` + Version string `json:"version"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectioninfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectioninfo.go new file mode 100644 index 00000000000..8c6e97347b8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectioninfo.go @@ -0,0 +1,19 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + DataSize int64 `json:"dataSize"` + DatabaseName string `json:"databaseName"` + DocumentCount int64 `json:"documentCount"` + IsCapped bool `json:"isCapped"` + IsSystemCollection bool `json:"isSystemCollection"` + IsView bool `json:"isView"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + ShardKey *MongoDbShardKeyInfo `json:"shardKey,omitempty"` + SupportsSharding bool `json:"supportsSharding"` + ViewOf *string `json:"viewOf,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectionprogress.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectionprogress.go new file mode 100644 index 00000000000..5e907aa6e90 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectionprogress.go @@ -0,0 +1,102 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbCollectionProgress{} + +type MongoDbCollectionProgress struct { + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbCollectionProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbCollectionProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbCollectionProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbCollectionProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbCollectionProgress{} + +func (s MongoDbCollectionProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbCollectionProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbCollectionProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbCollectionProgress: %+v", err) + } + + decoded["resultType"] = "Collection" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbCollectionProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectionsettings.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectionsettings.go new file mode 100644 index 00000000000..15a1e01270e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbcollectionsettings.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbCollectionSettings struct { + CanDelete *bool `json:"canDelete,omitempty"` + ShardKey *MongoDbShardKeySetting `json:"shardKey,omitempty"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbconnectioninfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbconnectioninfo.go new file mode 100644 index 00000000000..edc21ffacf0 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbconnectioninfo.go @@ -0,0 +1,54 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MongoDbConnectionInfo{} + +type MongoDbConnectionInfo struct { + ConnectionString string `json:"connectionString"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MongoDbConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MongoDbConnectionInfo{} + +func (s MongoDbConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MongoDbConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbConnectionInfo: %+v", err) + } + + decoded["type"] = "mongoDbConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabaseinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabaseinfo.go new file mode 100644 index 00000000000..b85b19bd486 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabaseinfo.go @@ -0,0 +1,14 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseInfo struct { + AverageDocumentSize int64 `json:"averageDocumentSize"` + Collections []MongoDbCollectionInfo `json:"collections"` + DataSize int64 `json:"dataSize"` + DocumentCount int64 `json:"documentCount"` + Name string `json:"name"` + QualifiedName string `json:"qualifiedName"` + SupportsSharding bool `json:"supportsSharding"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabaseprogress.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabaseprogress.go new file mode 100644 index 00000000000..47ee56b18bc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabaseprogress.go @@ -0,0 +1,166 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbDatabaseProgress{} + +type MongoDbDatabaseProgress struct { + Collections *map[string]MongoDbProgress `json:"collections,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbDatabaseProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbDatabaseProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbDatabaseProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbDatabaseProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbDatabaseProgress{} + +func (s MongoDbDatabaseProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbDatabaseProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbDatabaseProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbDatabaseProgress: %+v", err) + } + + decoded["resultType"] = "Database" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbDatabaseProgress: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &MongoDbDatabaseProgress{} + +func (s *MongoDbDatabaseProgress) UnmarshalJSON(bytes []byte) error { + var decoded struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.BytesCopied = decoded.BytesCopied + s.DocumentsCopied = decoded.DocumentsCopied + s.ElapsedTime = decoded.ElapsedTime + s.Errors = decoded.Errors + s.EventsPending = decoded.EventsPending + s.EventsReplayed = decoded.EventsReplayed + s.LastEventTime = decoded.LastEventTime + s.LastReplayTime = decoded.LastReplayTime + s.Name = decoded.Name + s.QualifiedName = decoded.QualifiedName + s.ResultType = decoded.ResultType + s.State = decoded.State + s.TotalBytes = decoded.TotalBytes + s.TotalDocuments = decoded.TotalDocuments + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling MongoDbDatabaseProgress into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["collections"]; ok { + var dictionaryTemp map[string]json.RawMessage + if err := json.Unmarshal(v, &dictionaryTemp); err != nil { + return fmt.Errorf("unmarshaling Collections into dictionary map[string]json.RawMessage: %+v", err) + } + + output := make(map[string]MongoDbProgress) + for key, val := range dictionaryTemp { + impl, err := UnmarshalMongoDbProgressImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling key %q field 'Collections' for 'MongoDbDatabaseProgress': %+v", key, err) + } + output[key] = impl + } + s.Collections = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabasesettings.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabasesettings.go new file mode 100644 index 00000000000..e0e5bdea319 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbdatabasesettings.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbDatabaseSettings struct { + Collections map[string]MongoDbCollectionSettings `json:"collections"` + TargetRUs *int64 `json:"targetRUs,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodberror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodberror.go new file mode 100644 index 00000000000..06fbbe5571e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodberror.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbError struct { + Code *string `json:"code,omitempty"` + Count *int64 `json:"count,omitempty"` + Message *string `json:"message,omitempty"` + Type *MongoDbErrorType `json:"type,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbmigrationprogress.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbmigrationprogress.go new file mode 100644 index 00000000000..f16cb69a297 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbmigrationprogress.go @@ -0,0 +1,103 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ MongoDbProgress = MongoDbMigrationProgress{} + +type MongoDbMigrationProgress struct { + Databases *map[string]MongoDbDatabaseProgress `json:"databases,omitempty"` + + // Fields inherited from MongoDbProgress + + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s MongoDbMigrationProgress) MongoDbProgress() BaseMongoDbProgressImpl { + return BaseMongoDbProgressImpl{ + BytesCopied: s.BytesCopied, + DocumentsCopied: s.DocumentsCopied, + ElapsedTime: s.ElapsedTime, + Errors: s.Errors, + EventsPending: s.EventsPending, + EventsReplayed: s.EventsReplayed, + LastEventTime: s.LastEventTime, + LastReplayTime: s.LastReplayTime, + Name: s.Name, + QualifiedName: s.QualifiedName, + ResultType: s.ResultType, + State: s.State, + TotalBytes: s.TotalBytes, + TotalDocuments: s.TotalDocuments, + } +} + +func (o *MongoDbMigrationProgress) GetLastEventTimeAsTime() (*time.Time, error) { + if o.LastEventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastEventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastEventTime = &formatted +} + +func (o *MongoDbMigrationProgress) GetLastReplayTimeAsTime() (*time.Time, error) { + if o.LastReplayTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastReplayTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MongoDbMigrationProgress) SetLastReplayTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastReplayTime = &formatted +} + +var _ json.Marshaler = MongoDbMigrationProgress{} + +func (s MongoDbMigrationProgress) MarshalJSON() ([]byte, error) { + type wrapper MongoDbMigrationProgress + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MongoDbMigrationProgress: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbMigrationProgress: %+v", err) + } + + decoded["resultType"] = "Migration" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MongoDbMigrationProgress: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbmigrationsettings.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbmigrationsettings.go new file mode 100644 index 00000000000..80b9d880800 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbmigrationsettings.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbMigrationSettings struct { + BoostRUs *int64 `json:"boostRUs,omitempty"` + Databases map[string]MongoDbDatabaseSettings `json:"databases"` + Replication *MongoDbReplication `json:"replication,omitempty"` + Source MongoDbConnectionInfo `json:"source"` + Target MongoDbConnectionInfo `json:"target"` + Throttling *MongoDbThrottlingSettings `json:"throttling,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbprogress.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbprogress.go new file mode 100644 index 00000000000..a08fa755b2e --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbprogress.go @@ -0,0 +1,104 @@ +package taskresource + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbProgress interface { + MongoDbProgress() BaseMongoDbProgressImpl +} + +var _ MongoDbProgress = BaseMongoDbProgressImpl{} + +type BaseMongoDbProgressImpl struct { + BytesCopied int64 `json:"bytesCopied"` + DocumentsCopied int64 `json:"documentsCopied"` + ElapsedTime string `json:"elapsedTime"` + Errors map[string]MongoDbError `json:"errors"` + EventsPending int64 `json:"eventsPending"` + EventsReplayed int64 `json:"eventsReplayed"` + LastEventTime *string `json:"lastEventTime,omitempty"` + LastReplayTime *string `json:"lastReplayTime,omitempty"` + Name *string `json:"name,omitempty"` + QualifiedName *string `json:"qualifiedName,omitempty"` + ResultType ResultType `json:"resultType"` + State MongoDbMigrationState `json:"state"` + TotalBytes int64 `json:"totalBytes"` + TotalDocuments int64 `json:"totalDocuments"` +} + +func (s BaseMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s +} + +var _ MongoDbProgress = RawMongoDbProgressImpl{} + +// RawMongoDbProgressImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawMongoDbProgressImpl struct { + mongoDbProgress BaseMongoDbProgressImpl + Type string + Values map[string]interface{} +} + +func (s RawMongoDbProgressImpl) MongoDbProgress() BaseMongoDbProgressImpl { + return s.mongoDbProgress +} + +func UnmarshalMongoDbProgressImplementation(input []byte) (MongoDbProgress, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling MongoDbProgress into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["resultType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Collection") { + var out MongoDbCollectionProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbCollectionProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Database") { + var out MongoDbDatabaseProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbDatabaseProgress: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migration") { + var out MongoDbMigrationProgress + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MongoDbMigrationProgress: %+v", err) + } + return out, nil + } + + var parent BaseMongoDbProgressImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseMongoDbProgressImpl: %+v", err) + } + + return RawMongoDbProgressImpl{ + mongoDbProgress: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeyfield.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeyfield.go new file mode 100644 index 00000000000..37b7fdc0212 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeyfield.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyField struct { + Name string `json:"name"` + Order MongoDbShardKeyOrder `json:"order"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeyinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeyinfo.go new file mode 100644 index 00000000000..d885ca84655 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeyinfo.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeyInfo struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeysetting.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeysetting.go new file mode 100644 index 00000000000..2e5620e6d64 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbshardkeysetting.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbShardKeySetting struct { + Fields []MongoDbShardKeyField `json:"fields"` + IsUnique bool `json:"isUnique"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbthrottlingsettings.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbthrottlingsettings.go new file mode 100644 index 00000000000..84c8c791408 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mongodbthrottlingsettings.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MongoDbThrottlingSettings struct { + MaxParallelism *int64 `json:"maxParallelism,omitempty"` + MinFreeCPU *int64 `json:"minFreeCpu,omitempty"` + MinFreeMemoryMb *int64 `json:"minFreeMemoryMb,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_mysqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_mysqlconnectioninfo.go new file mode 100644 index 00000000000..3abb01fa750 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_mysqlconnectioninfo.go @@ -0,0 +1,56 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = MySqlConnectionInfo{} + +type MySqlConnectionInfo struct { + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s MySqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = MySqlConnectionInfo{} + +func (s MySqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper MySqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MySqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MySqlConnectionInfo: %+v", err) + } + + decoded["type"] = "MySqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MySqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_oracleconnectioninfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_oracleconnectioninfo.go new file mode 100644 index 00000000000..cfb97e537d7 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_oracleconnectioninfo.go @@ -0,0 +1,54 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = OracleConnectionInfo{} + +type OracleConnectionInfo struct { + DataSource string `json:"dataSource"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s OracleConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = OracleConnectionInfo{} + +func (s OracleConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper OracleConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OracleConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OracleConnectionInfo: %+v", err) + } + + decoded["type"] = "OracleConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OracleConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_orphaneduserinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_orphaneduserinfo.go new file mode 100644 index 00000000000..8127e8f1fe2 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_orphaneduserinfo.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OrphanedUserInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_postgresqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_postgresqlconnectioninfo.go new file mode 100644 index 00000000000..04696fa9bc5 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_postgresqlconnectioninfo.go @@ -0,0 +1,58 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = PostgreSqlConnectionInfo{} + +type PostgreSqlConnectionInfo struct { + DatabaseName *string `json:"databaseName,omitempty"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Port int64 `json:"port"` + ServerName string `json:"serverName"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s PostgreSqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = PostgreSqlConnectionInfo{} + +func (s PostgreSqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper PostgreSqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PostgreSqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PostgreSqlConnectionInfo: %+v", err) + } + + decoded["type"] = "PostgreSqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PostgreSqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_projecttask.go b/resource-manager/datamigration/2021-06-30/taskresource/model_projecttask.go index 5b36e592413..b0fb727b15e 100644 --- a/resource-manager/datamigration/2021-06-30/taskresource/model_projecttask.go +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_projecttask.go @@ -1,6 +1,9 @@ package taskresource import ( + "encoding/json" + "fmt" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) @@ -11,7 +14,43 @@ type ProjectTask struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ProjectTaskProperties `json:"properties,omitempty"` + Properties ProjectTaskProperties `json:"properties"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +var _ json.Unmarshaler = &ProjectTask{} + +func (s *ProjectTask) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Etag = decoded.Etag + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ProjectTask into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalProjectTaskPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ProjectTask': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_projecttaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_projecttaskproperties.go index 3896c7f58e2..6be0b1fb777 100644 --- a/resource-manager/datamigration/2021-06-30/taskresource/model_projecttaskproperties.go +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_projecttaskproperties.go @@ -1,12 +1,386 @@ package taskresource +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ProjectTaskProperties struct { +type ProjectTaskProperties interface { + ProjectTaskProperties() BaseProjectTaskPropertiesImpl +} + +var _ ProjectTaskProperties = BaseProjectTaskPropertiesImpl{} + +type BaseProjectTaskPropertiesImpl struct { ClientData *map[string]string `json:"clientData,omitempty"` Commands *[]CommandProperties `json:"commands,omitempty"` Errors *[]ODataError `json:"errors,omitempty"` State *TaskState `json:"state,omitempty"` TaskType string `json:"taskType"` } + +func (s BaseProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s +} + +var _ ProjectTaskProperties = RawProjectTaskPropertiesImpl{} + +// RawProjectTaskPropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawProjectTaskPropertiesImpl struct { + projectTaskProperties BaseProjectTaskPropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawProjectTaskPropertiesImpl) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return s.projectTaskProperties +} + +var _ json.Unmarshaler = &BaseProjectTaskPropertiesImpl{} + +func (s *BaseProjectTaskPropertiesImpl) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BaseProjectTaskPropertiesImpl into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'BaseProjectTaskPropertiesImpl': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} + +func UnmarshalProjectTaskPropertiesImplementation(input []byte) (ProjectTaskProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ProjectTaskProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["taskType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Connect.MongoDb") { + var out ConnectToMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.MySql") { + var out ConnectToSourceMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.Oracle.Sync") { + var out ConnectToSourceOracleSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceOracleSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.PostgreSql.Sync") { + var out ConnectToSourcePostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourcePostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer.Sync") { + var out ConnectToSourceSqlServerSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToSource.SqlServer") { + var out ConnectToSourceSqlServerTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToSourceSqlServerTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForMySql") { + var out ConnectToTargetAzureDbForMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync") { + var out ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb") { + var out ConnectToTargetSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI.Sync.LRS") { + var out ConnectToTargetSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.AzureSqlDbMI") { + var out ConnectToTargetSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ConnectToTarget.SqlDb.Sync") { + var out ConnectToTargetSqlSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ConnectToTargetSqlSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetTDECertificates.Sql") { + var out GetTdeCertificatesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetTdeCertificatesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesMySql") { + var out GetUserTablesMySqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesMySqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesOracle") { + var out GetUserTablesOracleTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesOracleTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTablesPostgreSql") { + var out GetUserTablesPostgreSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesPostgreSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.AzureSqlDb.Sync") { + var out GetUserTablesSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "GetUserTables.Sql") { + var out GetUserTablesSqlTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into GetUserTablesSqlTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MongoDb") { + var out MigrateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql") { + var out MigrateMySqlAzureDbForMySqlOfflineTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlOfflineTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.MySql.AzureDbForMySql.Sync") { + var out MigrateMySqlAzureDbForMySqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateMySqlAzureDbForMySqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Oracle.AzureDbForPostgreSql.Sync") { + var out MigrateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2") { + var out MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDb.Sync") { + var out MigrateSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.SqlDb") { + var out MigrateSqlServerSqlDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out MigrateSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.SqlServer.AzureSqlDbMI") { + var out MigrateSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Migrate.Ssis") { + var out MigrateSsisTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MigrateSsisTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.SqlDb.Sync") { + var out ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS") { + var out ValidateMigrationInputSqlServerSqlMISyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ValidateMigrationInput.SqlServer.AzureSqlDbMI") { + var out ValidateMigrationInputSqlServerSqlMITaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.MongoDb") { + var out ValidateMongoDbTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateMongoDbTaskProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Validate.Oracle.AzureDbPostgreSql.Sync") { + var out ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + return out, nil + } + + var parent BaseProjectTaskPropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseProjectTaskPropertiesImpl: %+v", err) + } + + return RawProjectTaskPropertiesImpl{ + projectTaskProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_queryanalysisvalidationresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_queryanalysisvalidationresult.go new file mode 100644 index 00000000000..64a1ea12448 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_queryanalysisvalidationresult.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryAnalysisValidationResult struct { + QueryResults *QueryExecutionResult `json:"queryResults,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_queryexecutionresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_queryexecutionresult.go new file mode 100644 index 00000000000..e69c3d41f3f --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_queryexecutionresult.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryExecutionResult struct { + QueryText *string `json:"queryText,omitempty"` + SourceResult *ExecutionStatistics `json:"sourceResult,omitempty"` + StatementsInBatch *int64 `json:"statementsInBatch,omitempty"` + TargetResult *ExecutionStatistics `json:"targetResult,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_reportableexception.go b/resource-manager/datamigration/2021-06-30/taskresource/model_reportableexception.go new file mode 100644 index 00000000000..b62013daca3 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_reportableexception.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReportableException struct { + ActionableMessage *string `json:"actionableMessage,omitempty"` + FilePath *string `json:"filePath,omitempty"` + HResult *int64 `json:"hResult,omitempty"` + LineNumber *string `json:"lineNumber,omitempty"` + Message *string `json:"message,omitempty"` + StackTrace *string `json:"stackTrace,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_schemacomparisonvalidationresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_schemacomparisonvalidationresult.go new file mode 100644 index 00000000000..ff3ab81fa15 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_schemacomparisonvalidationresult.go @@ -0,0 +1,11 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResult struct { + SchemaDifferences *SchemaComparisonValidationResultType `json:"schemaDifferences,omitempty"` + SourceDatabaseObjectCount *map[string]int64 `json:"sourceDatabaseObjectCount,omitempty"` + TargetDatabaseObjectCount *map[string]int64 `json:"targetDatabaseObjectCount,omitempty"` + ValidationErrors *ValidationError `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_schemacomparisonvalidationresulttype.go b/resource-manager/datamigration/2021-06-30/taskresource/model_schemacomparisonvalidationresulttype.go new file mode 100644 index 00000000000..43a4b30c4e8 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_schemacomparisonvalidationresulttype.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SchemaComparisonValidationResultType struct { + ObjectName *string `json:"objectName,omitempty"` + ObjectType *ObjectType `json:"objectType,omitempty"` + UpdateAction *UpdateActionType `json:"updateAction,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_selectedcertificateinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_selectedcertificateinput.go new file mode 100644 index 00000000000..7196e68b89a --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_selectedcertificateinput.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SelectedCertificateInput struct { + CertificateName string `json:"certificateName"` + Password string `json:"password"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_serverproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_serverproperties.go new file mode 100644 index 00000000000..3b630953036 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_serverproperties.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServerProperties struct { + ServerDatabaseCount *int64 `json:"serverDatabaseCount,omitempty"` + ServerEdition *string `json:"serverEdition,omitempty"` + ServerName *string `json:"serverName,omitempty"` + ServerOperatingSystemVersion *string `json:"serverOperatingSystemVersion,omitempty"` + ServerPlatform *string `json:"serverPlatform,omitempty"` + ServerVersion *string `json:"serverVersion,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_sqlconnectioninfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_sqlconnectioninfo.go new file mode 100644 index 00000000000..3a4b3b00f9c --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_sqlconnectioninfo.go @@ -0,0 +1,59 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ConnectionInfo = SqlConnectionInfo{} + +type SqlConnectionInfo struct { + AdditionalSettings *string `json:"additionalSettings,omitempty"` + Authentication *AuthenticationType `json:"authentication,omitempty"` + DataSource string `json:"dataSource"` + EncryptConnection *bool `json:"encryptConnection,omitempty"` + Platform *SqlSourcePlatform `json:"platform,omitempty"` + TrustServerCertificate *bool `json:"trustServerCertificate,omitempty"` + + // Fields inherited from ConnectionInfo + + Password *string `json:"password,omitempty"` + Type string `json:"type"` + UserName *string `json:"userName,omitempty"` +} + +func (s SqlConnectionInfo) ConnectionInfo() BaseConnectionInfoImpl { + return BaseConnectionInfoImpl{ + Password: s.Password, + Type: s.Type, + UserName: s.UserName, + } +} + +var _ json.Marshaler = SqlConnectionInfo{} + +func (s SqlConnectionInfo) MarshalJSON() ([]byte, error) { + type wrapper SqlConnectionInfo + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SqlConnectionInfo: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SqlConnectionInfo: %+v", err) + } + + decoded["type"] = "SqlConnectionInfo" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SqlConnectionInfo: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_sqlserversqlmisynctaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_sqlserversqlmisynctaskinput.go new file mode 100644 index 00000000000..c0a52130e67 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_sqlserversqlmisynctaskinput.go @@ -0,0 +1,13 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlServerSqlMISyncTaskInput struct { + AzureApp AzureActiveDirectoryApp `json:"azureApp"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + StorageResourceId string `json:"storageResourceId"` + TargetConnectionInfo MiSqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_ssismigrationinfo.go b/resource-manager/datamigration/2021-06-30/taskresource/model_ssismigrationinfo.go new file mode 100644 index 00000000000..e6beeebec91 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_ssismigrationinfo.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SsisMigrationInfo struct { + EnvironmentOverwriteOption *SsisMigrationOverwriteOption `json:"environmentOverwriteOption,omitempty"` + ProjectOverwriteOption *SsisMigrationOverwriteOption `json:"projectOverwriteOption,omitempty"` + SsisStoreType *SsisStoreType `json:"ssisStoreType,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_startmigrationscenarioserverroleresult.go b/resource-manager/datamigration/2021-06-30/taskresource/model_startmigrationscenarioserverroleresult.go new file mode 100644 index 00000000000..d77a89b3a07 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_startmigrationscenarioserverroleresult.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StartMigrationScenarioServerRoleResult struct { + ExceptionsAndWarnings *[]ReportableException `json:"exceptionsAndWarnings,omitempty"` + Name *string `json:"name,omitempty"` + State *MigrationState `json:"state,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_syncmigrationdatabaseerrorevent.go b/resource-manager/datamigration/2021-06-30/taskresource/model_syncmigrationdatabaseerrorevent.go new file mode 100644 index 00000000000..c67bec7e070 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_syncmigrationdatabaseerrorevent.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SyncMigrationDatabaseErrorEvent struct { + EventText *string `json:"eventText,omitempty"` + EventTypeString *string `json:"eventTypeString,omitempty"` + TimestampString *string `json:"timestampString,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go new file mode 100644 index 00000000000..78c3a185c48 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqldbsynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlDbSyncTaskProperties struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlDbSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.SqlDb.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlDbSyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlDbSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateSyncMigrationInputSqlServerTaskInput `json:"input,omitempty"` + Output *[]ValidateSyncMigrationInputSqlServerTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlDbSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlDbSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go new file mode 100644 index 00000000000..4ace5ea7dbc --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmisynctaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMISyncTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go new file mode 100644 index 00000000000..cd497c5ec28 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmisynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +type ValidateMigrationInputSqlServerSqlMISyncTaskProperties struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMISyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMISyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMISyncTaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMISyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *SqlServerSqlMISyncTaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMISyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMISyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMISyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskinput.go new file mode 100644 index 00000000000..3679ddf26eb --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskinput.go @@ -0,0 +1,14 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskInput struct { + BackupBlobShare BlobShare `json:"backupBlobShare"` + BackupFileShare *FileShare `json:"backupFileShare,omitempty"` + BackupMode *BackupMode `json:"backupMode,omitempty"` + SelectedDatabases []MigrateSqlServerSqlMIDatabaseInput `json:"selectedDatabases"` + SelectedLogins *[]string `json:"selectedLogins,omitempty"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go new file mode 100644 index 00000000000..3ce9bbb8d9b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskoutput.go @@ -0,0 +1,15 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateMigrationInputSqlServerSqlMITaskOutput struct { + BackupFolderErrors *[]ReportableException `json:"backupFolderErrors,omitempty"` + BackupShareCredentialsErrors *[]ReportableException `json:"backupShareCredentialsErrors,omitempty"` + BackupStorageAccountErrors *[]ReportableException `json:"backupStorageAccountErrors,omitempty"` + DatabaseBackupInfo *DatabaseBackupInfo `json:"databaseBackupInfo,omitempty"` + ExistingBackupErrors *[]ReportableException `json:"existingBackupErrors,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RestoreDatabaseNameErrors *[]ReportableException `json:"restoreDatabaseNameErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go new file mode 100644 index 00000000000..452104b8b60 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemigrationinputsqlserversqlmitaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +type ValidateMigrationInputSqlServerSqlMITaskProperties struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s ValidateMigrationInputSqlServerSqlMITaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMigrationInputSqlServerSqlMITaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + decoded["taskType"] = "ValidateMigrationInput.SqlServer.AzureSqlDbMI" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMigrationInputSqlServerSqlMITaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMigrationInputSqlServerSqlMITaskProperties{} + +func (s *ValidateMigrationInputSqlServerSqlMITaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *ValidateMigrationInputSqlServerSqlMITaskInput `json:"input,omitempty"` + Output *[]ValidateMigrationInputSqlServerSqlMITaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMigrationInputSqlServerSqlMITaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMigrationInputSqlServerSqlMITaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatemongodbtaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemongodbtaskproperties.go new file mode 100644 index 00000000000..26ba5025b34 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatemongodbtaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateMongoDbTaskProperties{} + +type ValidateMongoDbTaskProperties struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateMongoDbTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateMongoDbTaskProperties{} + +func (s ValidateMongoDbTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateMongoDbTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.MongoDb" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateMongoDbTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateMongoDbTaskProperties{} + +func (s *ValidateMongoDbTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MongoDbMigrationSettings `json:"input,omitempty"` + Output *[]MongoDbMigrationProgress `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateMongoDbTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateMongoDbTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go new file mode 100644 index 00000000000..dbd0cb2c3ab --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validateoracleazuredbforpostgresqlsynctaskproperties.go @@ -0,0 +1,106 @@ +package taskresource + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ProjectTaskProperties = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +type ValidateOracleAzureDbForPostgreSqlSyncTaskProperties struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + + // Fields inherited from ProjectTaskProperties + + ClientData *map[string]string `json:"clientData,omitempty"` + Commands *[]CommandProperties `json:"commands,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` +} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) ProjectTaskProperties() BaseProjectTaskPropertiesImpl { + return BaseProjectTaskPropertiesImpl{ + ClientData: s.ClientData, + Commands: s.Commands, + Errors: s.Errors, + State: s.State, + TaskType: s.TaskType, + } +} + +var _ json.Marshaler = ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) MarshalJSON() ([]byte, error) { + type wrapper ValidateOracleAzureDbForPostgreSqlSyncTaskProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + decoded["taskType"] = "Validate.Oracle.AzureDbPostgreSql.Sync" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties: %+v", err) + } + + return encoded, nil +} + +var _ json.Unmarshaler = &ValidateOracleAzureDbForPostgreSqlSyncTaskProperties{} + +func (s *ValidateOracleAzureDbForPostgreSqlSyncTaskProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Input *MigrateOracleAzureDbPostgreSqlSyncTaskInput `json:"input,omitempty"` + Output *[]ValidateOracleAzureDbPostgreSqlSyncTaskOutput `json:"output,omitempty"` + ClientData *map[string]string `json:"clientData,omitempty"` + Errors *[]ODataError `json:"errors,omitempty"` + State *TaskState `json:"state,omitempty"` + TaskType string `json:"taskType"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Input = decoded.Input + s.Output = decoded.Output + s.ClientData = decoded.ClientData + s.Errors = decoded.Errors + s.State = decoded.State + s.TaskType = decoded.TaskType + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ValidateOracleAzureDbForPostgreSqlSyncTaskProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["commands"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Commands into list []json.RawMessage: %+v", err) + } + + output := make([]CommandProperties, 0) + for i, val := range listTemp { + impl, err := UnmarshalCommandPropertiesImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Commands' for 'ValidateOracleAzureDbForPostgreSqlSyncTaskProperties': %+v", i, err) + } + output = append(output, impl) + } + s.Commands = &output + } + + return nil +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go new file mode 100644 index 00000000000..c92b765c870 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validateoracleazuredbpostgresqlsynctaskoutput.go @@ -0,0 +1,8 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateOracleAzureDbPostgreSqlSyncTaskOutput struct { + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatesyncmigrationinputsqlservertaskinput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatesyncmigrationinputsqlservertaskinput.go new file mode 100644 index 00000000000..58f491be4c1 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatesyncmigrationinputsqlservertaskinput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskInput struct { + SelectedDatabases []MigrateSqlServerSqlDbSyncDatabaseInput `json:"selectedDatabases"` + SourceConnectionInfo SqlConnectionInfo `json:"sourceConnectionInfo"` + TargetConnectionInfo SqlConnectionInfo `json:"targetConnectionInfo"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validatesyncmigrationinputsqlservertaskoutput.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validatesyncmigrationinputsqlservertaskoutput.go new file mode 100644 index 00000000000..32bb29910ee --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validatesyncmigrationinputsqlservertaskoutput.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateSyncMigrationInputSqlServerTaskOutput struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ValidationErrors *[]ReportableException `json:"validationErrors,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_validationerror.go b/resource-manager/datamigration/2021-06-30/taskresource/model_validationerror.go new file mode 100644 index 00000000000..3ed9aa47b1b --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_validationerror.go @@ -0,0 +1,9 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidationError struct { + Severity *Severity `json:"severity,omitempty"` + Text *string `json:"text,omitempty"` +} diff --git a/resource-manager/datamigration/2021-06-30/taskresource/model_waitstatistics.go b/resource-manager/datamigration/2021-06-30/taskresource/model_waitstatistics.go new file mode 100644 index 00000000000..e3a8eaec0f9 --- /dev/null +++ b/resource-manager/datamigration/2021-06-30/taskresource/model_waitstatistics.go @@ -0,0 +1,10 @@ +package taskresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WaitStatistics struct { + WaitCount *int64 `json:"waitCount,omitempty"` + WaitTimeMs *float64 `json:"waitTimeMs,omitempty"` + WaitType *string `json:"waitType,omitempty"` +} diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/README.md b/resource-manager/dataprotection/2024-04-01/azurebackupjob/README.md index b003500508d..991e7c2e1ec 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/README.md +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := azurebackupjob.NewOperationIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "operationId") +id := azurebackupjob.NewOperationIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "operationId") read, err := client.ExportJobsOperationResultGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := azurebackupjob.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := azurebackupjob.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if err := client.ExportJobsTriggerThenPoll(ctx, id); err != nil { // handle the error @@ -52,7 +52,7 @@ if err := client.ExportJobsTriggerThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := azurebackupjob.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobId") +id := azurebackupjob.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "jobId") read, err := client.JobsGet(ctx, id) if err != nil { diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupjob.go b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupjob.go index 09371b8528b..61310319446 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupjob.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupjob.go @@ -121,7 +121,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), resourceids.UserSpecifiedSegment("jobId", "jobId"), } diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupjob_test.go b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupjob_test.go index dd6331e64fb..41599abfb7e 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupjob_test.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobId") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "jobId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } if id.JobId != "jobId" { @@ -32,8 +32,8 @@ func TestNewBackupJobID(t *testing.T) { } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/jobId" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "jobId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/jobId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/jobId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/jobId", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", JobId: "jobId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/jobId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/jobId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPjObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/jobId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/jobId", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", JobId: "jobId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/jobId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/jobId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPjObS/jObId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPjObS/jObId", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", JobId: "jObId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPjObS/jObId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPjObS/jObId/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupvault.go b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupvault.go index ce702f88340..60e15b184a4 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupvault.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupvault.go @@ -115,7 +115,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupvault_test.go b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupvault_test.go index b0af70ae6b5..c0e90f2c7e4 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupvault_test.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_operationid.go b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_operationid.go index eedf7ca5cf5..5ebcd8579b2 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_operationid.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_operationid.go @@ -121,7 +121,7 @@ func (id OperationIdId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), resourceids.StaticSegment("staticOperations", "operations", "operations"), resourceids.UserSpecifiedSegment("operationId", "operationId"), diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_operationid_test.go b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_operationid_test.go index d5074d34ee7..f4e747655e1 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_operationid_test.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/id_operationid_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OperationIdId{} func TestNewOperationIdID(t *testing.T) { - id := NewOperationIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "operationId") + id := NewOperationIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewOperationIdID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } if id.OperationId != "operationId" { @@ -32,8 +32,8 @@ func TestNewOperationIdID(t *testing.T) { } func TestFormatOperationIdID(t *testing.T) { - actual := NewOperationIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/operations/operationId" + actual := NewOperationIdID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/operations/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,32 +87,32 @@ func TestParseOperationIdID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/operations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/operations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/operations/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/operations/operationId", Expected: &OperationIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/operations/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/operations/operationId/extra", Error: true, }, } @@ -233,62 +233,62 @@ func TestParseOperationIdIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPjObS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/operations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/operations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPjObS/oPeRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPjObS/oPeRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/operations/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/operations/operationId", Expected: &OperationIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupJobs/operations/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupJobs/operations/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPjObS/oPeRaTiOnS/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPjObS/oPeRaTiOnS/oPeRaTiOnId", Expected: &OperationIdId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPjObS/oPeRaTiOnS/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPjObS/oPeRaTiOnS/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/model_azurebackupjob.go b/resource-manager/dataprotection/2024-04-01/azurebackupjob/model_azurebackupjob.go index cdd1d824b08..bded4dcf089 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/model_azurebackupjob.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/model_azurebackupjob.go @@ -30,7 +30,7 @@ type AzureBackupJob struct { PolicyId *string `json:"policyId,omitempty"` PolicyName *string `json:"policyName,omitempty"` ProgressEnabled bool `json:"progressEnabled"` - ProgressUrl *string `json:"progressUrl,omitempty"` + ProgressURL *string `json:"progressUrl,omitempty"` RehydrationPriority *string `json:"rehydrationPriority,omitempty"` RestoreType *string `json:"restoreType,omitempty"` SourceDataStoreName *string `json:"sourceDataStoreName,omitempty"` diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjob/model_exportjobsresult.go b/resource-manager/dataprotection/2024-04-01/azurebackupjob/model_exportjobsresult.go index 75c7ef5aad4..ae0bef75ce4 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjob/model_exportjobsresult.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjob/model_exportjobsresult.go @@ -5,7 +5,7 @@ package azurebackupjob type ExportJobsResult struct { BlobSasKey *string `json:"blobSasKey,omitempty"` - BlobUrl *string `json:"blobUrl,omitempty"` + BlobURL *string `json:"blobUrl,omitempty"` ExcelFileBlobSasKey *string `json:"excelFileBlobSasKey,omitempty"` - ExcelFileBlobUrl *string `json:"excelFileBlobUrl,omitempty"` + ExcelFileBlobURL *string `json:"excelFileBlobUrl,omitempty"` } diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjobs/README.md b/resource-manager/dataprotection/2024-04-01/azurebackupjobs/README.md index 015f22caa33..26cd87789ba 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjobs/README.md +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjobs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := azurebackupjobs.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := azurebackupjobs.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") // alternatively `client.JobsList(ctx, id)` can be used to do batched pagination items, err := client.JobsListComplete(ctx, id) diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjobs/id_backupvault.go b/resource-manager/dataprotection/2024-04-01/azurebackupjobs/id_backupvault.go index d99cf0beda8..872d9e4671b 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjobs/id_backupvault.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjobs/id_backupvault.go @@ -115,7 +115,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjobs/id_backupvault_test.go b/resource-manager/dataprotection/2024-04-01/azurebackupjobs/id_backupvault_test.go index 6eec8c41921..ce956b8e296 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjobs/id_backupvault_test.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjobs/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/azurebackupjobs/model_azurebackupjob.go b/resource-manager/dataprotection/2024-04-01/azurebackupjobs/model_azurebackupjob.go index c92a5895788..72b72465937 100644 --- a/resource-manager/dataprotection/2024-04-01/azurebackupjobs/model_azurebackupjob.go +++ b/resource-manager/dataprotection/2024-04-01/azurebackupjobs/model_azurebackupjob.go @@ -30,7 +30,7 @@ type AzureBackupJob struct { PolicyId *string `json:"policyId,omitempty"` PolicyName *string `json:"policyName,omitempty"` ProgressEnabled bool `json:"progressEnabled"` - ProgressUrl *string `json:"progressUrl,omitempty"` + ProgressURL *string `json:"progressUrl,omitempty"` RehydrationPriority *string `json:"rehydrationPriority,omitempty"` RestoreType *string `json:"restoreType,omitempty"` SourceDataStoreName *string `json:"sourceDataStoreName,omitempty"` diff --git a/resource-manager/dataprotection/2024-04-01/backupinstances/README.md b/resource-manager/dataprotection/2024-04-01/backupinstances/README.md index 78c002ba28d..492687834fc 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstances/README.md +++ b/resource-manager/dataprotection/2024-04-01/backupinstances/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := backupinstances.TriggerBackupRequest{ // ... @@ -41,7 +41,7 @@ if err := client.AdhocBackupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := backupinstances.BackupInstanceResource{ // ... @@ -58,7 +58,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, backupinstances.Defaul ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") if err := client.DeleteThenPoll(ctx, id, backupinstances.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.DeleteThenPoll(ctx, id, backupinstances.DefaultDeleteOperationO ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backupinstances.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := backupinstances.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") if err := client.ResumeBackupsThenPoll(ctx, id); err != nil { // handle the error @@ -115,7 +115,7 @@ if err := client.ResumeBackupsThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") if err := client.ResumeProtectionThenPoll(ctx, id); err != nil { // handle the error @@ -127,7 +127,7 @@ if err := client.ResumeProtectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := backupinstances.StopProtectionRequest{ // ... @@ -144,7 +144,7 @@ if err := client.StopProtectionThenPoll(ctx, id, payload, backupinstances.Defaul ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := backupinstances.SuspendBackupRequest{ // ... @@ -161,7 +161,7 @@ if err := client.SuspendBackupsThenPoll(ctx, id, payload, backupinstances.Defaul ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := backupinstances.SyncBackupInstanceRequest{ // ... @@ -178,7 +178,7 @@ if err := client.SyncBackupInstanceThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backupinstances.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := backupinstances.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := backupinstances.CrossRegionRestoreRequestObject{ // ... @@ -195,7 +195,7 @@ if err := client.TriggerCrossRegionRestoreThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := backupinstances.AzureBackupRehydrationRequest{ // ... @@ -212,7 +212,7 @@ if err := client.TriggerRehydrateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := backupinstances.AzureBackupRestoreRequest{ // ... @@ -229,7 +229,7 @@ if err := client.TriggerRestoreThenPoll(ctx, id, payload, backupinstances.Defaul ```go ctx := context.TODO() -id := backupinstances.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := backupinstances.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := backupinstances.ValidateCrossRegionRestoreRequestObject{ // ... @@ -246,7 +246,7 @@ if err := client.ValidateCrossRegionRestoreThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := backupinstances.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := backupinstances.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") payload := backupinstances.ValidateForBackupRequest{ // ... @@ -263,7 +263,7 @@ if err := client.ValidateForBackupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := backupinstances.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := backupinstances.ValidateRestoreRequestObject{ // ... diff --git a/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupinstance.go b/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupinstance.go index 157878b86b2..ba2f8ee0d24 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupinstance.go +++ b/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupinstance.go @@ -121,7 +121,7 @@ func (id BackupInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackupInstances", "backupInstances", "backupInstances"), resourceids.UserSpecifiedSegment("backupInstanceName", "backupInstanceName"), } diff --git a/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupinstance_test.go b/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupinstance_test.go index 3790b807722..cf93cede095 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupinstance_test.go +++ b/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupInstanceId{} func TestNewBackupInstanceID(t *testing.T) { - id := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") + id := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } if id.BackupInstanceName != "backupInstanceName" { @@ -32,8 +32,8 @@ func TestNewBackupInstanceID(t *testing.T) { } func TestFormatBackupInstanceID(t *testing.T) { - actual := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName" + actual := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupInstanceName: "backupInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupInstanceName: "backupInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", BackupInstanceName: "bAcKuPiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupvault.go b/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupvault.go index c82f2231710..342e7e6842d 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupvault.go +++ b/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupvault.go @@ -115,7 +115,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupvault_test.go b/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupvault_test.go index 24f8cbe88c7..a7e929d4ab1 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupvault_test.go +++ b/resource-manager/dataprotection/2024-04-01/backupinstances/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/backupinstances/id_providerlocation.go b/resource-manager/dataprotection/2024-04-01/backupinstances/id_providerlocation.go index 72a497634bd..5d023dc0eb9 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstances/id_providerlocation.go +++ b/resource-manager/dataprotection/2024-04-01/backupinstances/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/backupinstances/id_providerlocation_test.go b/resource-manager/dataprotection/2024-04-01/backupinstances/id_providerlocation_test.go index 8769318e4cb..ef5e7d201b7 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstances/id_providerlocation_test.go +++ b/resource-manager/dataprotection/2024-04-01/backupinstances/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/backupinstances/model_identitydetails.go b/resource-manager/dataprotection/2024-04-01/backupinstances/model_identitydetails.go index 60ba2542236..0b2cd743ef3 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstances/model_identitydetails.go +++ b/resource-manager/dataprotection/2024-04-01/backupinstances/model_identitydetails.go @@ -5,5 +5,5 @@ package backupinstances type IdentityDetails struct { UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"` - UserAssignedIdentityArmUrl *string `json:"userAssignedIdentityArmUrl,omitempty"` + UserAssignedIdentityArmURL *string `json:"userAssignedIdentityArmUrl,omitempty"` } diff --git a/resource-manager/dataprotection/2024-04-01/backupinstancesextensionrouting/model_identitydetails.go b/resource-manager/dataprotection/2024-04-01/backupinstancesextensionrouting/model_identitydetails.go index 9d42f3fdf28..5933b86797c 100644 --- a/resource-manager/dataprotection/2024-04-01/backupinstancesextensionrouting/model_identitydetails.go +++ b/resource-manager/dataprotection/2024-04-01/backupinstancesextensionrouting/model_identitydetails.go @@ -5,5 +5,5 @@ package backupinstancesextensionrouting type IdentityDetails struct { UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"` - UserAssignedIdentityArmUrl *string `json:"userAssignedIdentityArmUrl,omitempty"` + UserAssignedIdentityArmURL *string `json:"userAssignedIdentityArmUrl,omitempty"` } diff --git a/resource-manager/dataprotection/2024-04-01/backuppolicies/README.md b/resource-manager/dataprotection/2024-04-01/backuppolicies/README.md index f6b8cbad2c6..57dc9184e35 100644 --- a/resource-manager/dataprotection/2024-04-01/backuppolicies/README.md +++ b/resource-manager/dataprotection/2024-04-01/backuppolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") +id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupPolicyName") payload := backuppolicies.BaseBackupPolicyResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") +id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupPolicyName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") +id := backuppolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupPolicyName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicies.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := backuppolicies.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backuppolicy.go b/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backuppolicy.go index 2eaa2e598a3..b53eed252bf 100644 --- a/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backuppolicy.go +++ b/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backuppolicy.go @@ -121,7 +121,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } diff --git a/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backuppolicy_test.go b/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backuppolicy_test.go index 05ee5dffa69..7db596ffd5c 100644 --- a/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backuppolicy_test.go +++ b/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } if id.BackupPolicyName != "backupPolicyName" { @@ -32,8 +32,8 @@ func TestNewBackupPolicyID(t *testing.T) { } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupPolicies/backupPolicyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backupvault.go b/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backupvault.go index 96cff884116..2e13f9aeb84 100644 --- a/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backupvault.go +++ b/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backupvault.go @@ -115,7 +115,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backupvault_test.go b/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backupvault_test.go index ab58efde481..5844e8c8de1 100644 --- a/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backupvault_test.go +++ b/resource-manager/dataprotection/2024-04-01/backuppolicies/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/backupvaults/README.md b/resource-manager/dataprotection/2024-04-01/backupvaults/README.md index f99807069b3..22727a51dde 100644 --- a/resource-manager/dataprotection/2024-04-01/backupvaults/README.md +++ b/resource-manager/dataprotection/2024-04-01/backupvaults/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupvaults.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := backupvaults.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := backupvaults.CheckNameAvailabilityRequest{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") payload := backupvaults.BackupVaultResource{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, backupvaults.DefaultCr ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -75,7 +75,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") read, err := client.Get(ctx, id) if err != nil { @@ -125,7 +125,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") payload := backupvaults.PatchResourceRequestInput{ // ... diff --git a/resource-manager/dataprotection/2024-04-01/backupvaults/id_backupvault.go b/resource-manager/dataprotection/2024-04-01/backupvaults/id_backupvault.go index dd0fb392ab4..4a410f65278 100644 --- a/resource-manager/dataprotection/2024-04-01/backupvaults/id_backupvault.go +++ b/resource-manager/dataprotection/2024-04-01/backupvaults/id_backupvault.go @@ -115,7 +115,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/backupvaults/id_backupvault_test.go b/resource-manager/dataprotection/2024-04-01/backupvaults/id_backupvault_test.go index 1af5636b85a..c9950a006d0 100644 --- a/resource-manager/dataprotection/2024-04-01/backupvaults/id_backupvault_test.go +++ b/resource-manager/dataprotection/2024-04-01/backupvaults/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/backupvaults/id_providerlocation.go b/resource-manager/dataprotection/2024-04-01/backupvaults/id_providerlocation.go index 1d5b6d546f7..2d81f0401de 100644 --- a/resource-manager/dataprotection/2024-04-01/backupvaults/id_providerlocation.go +++ b/resource-manager/dataprotection/2024-04-01/backupvaults/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/backupvaults/id_providerlocation_test.go b/resource-manager/dataprotection/2024-04-01/backupvaults/id_providerlocation_test.go index 8344118d071..00af9361aba 100644 --- a/resource-manager/dataprotection/2024-04-01/backupvaults/id_providerlocation_test.go +++ b/resource-manager/dataprotection/2024-04-01/backupvaults/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/README.md b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/README.md index f423d2aa62b..462313a231a 100644 --- a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/README.md +++ b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedbackupinstances.NewDeletedBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := deletedbackupinstances.NewDeletedBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "deletedBackupInstanceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := deletedbackupinstances.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := deletedbackupinstances.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedbackupinstances.NewDeletedBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := deletedbackupinstances.NewDeletedBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "deletedBackupInstanceName") if err := client.UndeleteThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_backupvault.go b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_backupvault.go index 7f9d9101a62..e31a02e04e6 100644 --- a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_backupvault.go +++ b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_backupvault.go @@ -115,7 +115,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_backupvault_test.go b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_backupvault_test.go index 5a6600ae319..cad24bffff5 100644 --- a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_backupvault_test.go +++ b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_deletedbackupinstance.go b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_deletedbackupinstance.go index f59524f5b62..ebf0ba1b2ed 100644 --- a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_deletedbackupinstance.go +++ b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_deletedbackupinstance.go @@ -121,9 +121,9 @@ func (id DeletedBackupInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticDeletedBackupInstances", "deletedBackupInstances", "deletedBackupInstances"), - resourceids.UserSpecifiedSegment("deletedBackupInstanceName", "backupInstanceName"), + resourceids.UserSpecifiedSegment("deletedBackupInstanceName", "deletedBackupInstanceName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_deletedbackupinstance_test.go b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_deletedbackupinstance_test.go index 504f221fb21..6c9c0af46dd 100644 --- a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_deletedbackupinstance_test.go +++ b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/id_deletedbackupinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeletedBackupInstanceId{} func TestNewDeletedBackupInstanceID(t *testing.T) { - id := NewDeletedBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") + id := NewDeletedBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "deletedBackupInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDeletedBackupInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } - if id.DeletedBackupInstanceName != "backupInstanceName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedBackupInstanceName'", id.DeletedBackupInstanceName, "backupInstanceName") + if id.DeletedBackupInstanceName != "deletedBackupInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedBackupInstanceName'", id.DeletedBackupInstanceName, "deletedBackupInstanceName") } } func TestFormatDeletedBackupInstanceID(t *testing.T) { - actual := NewDeletedBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/deletedBackupInstances/backupInstanceName" + actual := NewDeletedBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "deletedBackupInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/deletedBackupInstances/deletedBackupInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDeletedBackupInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/deletedBackupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/deletedBackupInstances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/deletedBackupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/deletedBackupInstances/deletedBackupInstanceName", Expected: &DeletedBackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", - DeletedBackupInstanceName: "backupInstanceName", + BackupVaultName: "backupVaultName", + DeletedBackupInstanceName: "deletedBackupInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/deletedBackupInstances/backupInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/deletedBackupInstances/deletedBackupInstanceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDeletedBackupInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/deletedBackupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/deletedBackupInstances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/dElEtEdBaCkUpInStAnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/dElEtEdBaCkUpInStAnCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/deletedBackupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/deletedBackupInstances/deletedBackupInstanceName", Expected: &DeletedBackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", - DeletedBackupInstanceName: "backupInstanceName", + BackupVaultName: "backupVaultName", + DeletedBackupInstanceName: "deletedBackupInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/deletedBackupInstances/backupInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/deletedBackupInstances/deletedBackupInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/dElEtEdBaCkUpInStAnCeS/bAcKuPiNsTaNcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/dElEtEdBaCkUpInStAnCeS/dElEtEdBaCkUpInStAnCeNaMe", Expected: &DeletedBackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", - DeletedBackupInstanceName: "bAcKuPiNsTaNcEnAmE", + BackupVaultName: "bAcKuPvAuLtNaMe", + DeletedBackupInstanceName: "dElEtEdBaCkUpInStAnCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/dElEtEdBaCkUpInStAnCeS/bAcKuPiNsTaNcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/dElEtEdBaCkUpInStAnCeS/dElEtEdBaCkUpInStAnCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/model_identitydetails.go b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/model_identitydetails.go index e04ae4cdbf2..630b05d040e 100644 --- a/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/model_identitydetails.go +++ b/resource-manager/dataprotection/2024-04-01/deletedbackupinstances/model_identitydetails.go @@ -5,5 +5,5 @@ package deletedbackupinstances type IdentityDetails struct { UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"` - UserAssignedIdentityArmUrl *string `json:"userAssignedIdentityArmUrl,omitempty"` + UserAssignedIdentityArmURL *string `json:"userAssignedIdentityArmUrl,omitempty"` } diff --git a/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/README.md b/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/README.md index 7aceb104254..470f4df7fc9 100644 --- a/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/README.md +++ b/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dppfeaturesupport.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := dppfeaturesupport.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := dppfeaturesupport.FeatureValidationRequestBase{ // ... diff --git a/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/id_location.go b/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/id_location.go index 9a210691b52..5d4454ffdcc 100644 --- a/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/id_location.go +++ b/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/id_location_test.go b/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/id_location_test.go index d2e80053713..3f55e63451d 100644 --- a/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/id_location_test.go +++ b/resource-manager/dataprotection/2024-04-01/dppfeaturesupport/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/dppjob/README.md b/resource-manager/dataprotection/2024-04-01/dppjob/README.md index e92c6f32512..3099117a899 100644 --- a/resource-manager/dataprotection/2024-04-01/dppjob/README.md +++ b/resource-manager/dataprotection/2024-04-01/dppjob/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dppjob.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := dppjob.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := dppjob.CrossRegionRestoreJobRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dppjob.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := dppjob.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := dppjob.CrossRegionRestoreJobsRequest{ // ... diff --git a/resource-manager/dataprotection/2024-04-01/dppjob/id_providerlocation.go b/resource-manager/dataprotection/2024-04-01/dppjob/id_providerlocation.go index a142d0c8e15..bd5fbb2e23c 100644 --- a/resource-manager/dataprotection/2024-04-01/dppjob/id_providerlocation.go +++ b/resource-manager/dataprotection/2024-04-01/dppjob/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/dppjob/id_providerlocation_test.go b/resource-manager/dataprotection/2024-04-01/dppjob/id_providerlocation_test.go index 9ae157e585d..72d16fa5fe3 100644 --- a/resource-manager/dataprotection/2024-04-01/dppjob/id_providerlocation_test.go +++ b/resource-manager/dataprotection/2024-04-01/dppjob/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/dppjob/model_azurebackupjob.go b/resource-manager/dataprotection/2024-04-01/dppjob/model_azurebackupjob.go index 65be91508fc..32eeb40d251 100644 --- a/resource-manager/dataprotection/2024-04-01/dppjob/model_azurebackupjob.go +++ b/resource-manager/dataprotection/2024-04-01/dppjob/model_azurebackupjob.go @@ -30,7 +30,7 @@ type AzureBackupJob struct { PolicyId *string `json:"policyId,omitempty"` PolicyName *string `json:"policyName,omitempty"` ProgressEnabled bool `json:"progressEnabled"` - ProgressUrl *string `json:"progressUrl,omitempty"` + ProgressURL *string `json:"progressUrl,omitempty"` RehydrationPriority *string `json:"rehydrationPriority,omitempty"` RestoreType *string `json:"restoreType,omitempty"` SourceDataStoreName *string `json:"sourceDataStoreName,omitempty"` diff --git a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/README.md b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/README.md index 750c6737f10..194bc4930ee 100644 --- a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/README.md +++ b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dppresourceguardproxies.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := dppresourceguardproxies.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupResourceGuardProxyName") payload := dppresourceguardproxies.ResourceGuardProxyBaseResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dppresourceguardproxies.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := dppresourceguardproxies.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupResourceGuardProxyName") read, err := client.DppResourceGuardProxyDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dppresourceguardproxies.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := dppresourceguardproxies.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupResourceGuardProxyName") read, err := client.DppResourceGuardProxyGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dppresourceguardproxies.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") +id := dppresourceguardproxies.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") // alternatively `client.DppResourceGuardProxyList(ctx, id)` can be used to do batched pagination items, err := client.DppResourceGuardProxyListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := dppresourceguardproxies.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := dppresourceguardproxies.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupResourceGuardProxyName") payload := dppresourceguardproxies.UnlockDeleteRequest{ // ... diff --git a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupresourceguardproxy.go b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupresourceguardproxy.go index 6fb12d4669a..6f7a531c0ca 100644 --- a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupresourceguardproxy.go +++ b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupresourceguardproxy.go @@ -121,9 +121,9 @@ func (id BackupResourceGuardProxyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackupResourceGuardProxies", "backupResourceGuardProxies", "backupResourceGuardProxies"), - resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "resourceGuardProxyName"), + resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "backupResourceGuardProxyName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupresourceguardproxy_test.go b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupresourceguardproxy_test.go index ad543c35b07..3b3bc8930ae 100644 --- a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupresourceguardproxy_test.go +++ b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupresourceguardproxy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupResourceGuardProxyId{} func TestNewBackupResourceGuardProxyID(t *testing.T) { - id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") + id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupResourceGuardProxyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewBackupResourceGuardProxyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } - if id.BackupResourceGuardProxyName != "resourceGuardProxyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "resourceGuardProxyName") + if id.BackupResourceGuardProxyName != "backupResourceGuardProxyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "backupResourceGuardProxyName") } } func TestFormatBackupResourceGuardProxyID(t *testing.T) { - actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName" + actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupResourceGuardProxyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupResourceGuardProxies/backupResourceGuardProxyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupResourceGuardProxyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupResourceGuardProxies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupResourceGuardProxies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupVaultName: "backupVaultName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupResourceGuardProxyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupResourceGuardProxies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupResourceGuardProxies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupVaultName: "backupVaultName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", - BackupResourceGuardProxyName: "rEsOuRcEgUaRdPrOxYnAmE", + BackupVaultName: "bAcKuPvAuLtNaMe", + BackupResourceGuardProxyName: "bAcKuPrEsOuRcEgUaRdPrOxYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupvault.go b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupvault.go index a1b43df0411..8d5e6414971 100644 --- a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupvault.go +++ b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupvault.go @@ -115,7 +115,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupvault_test.go b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupvault_test.go index d7c21ed070c..7f72b2b11d4 100644 --- a/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupvault_test.go +++ b/resource-manager/dataprotection/2024-04-01/dppresourceguardproxies/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/README.md b/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/README.md index 406a8ba38fa..7210a686802 100644 --- a/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/README.md +++ b/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fetchsecondaryrecoverypoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := fetchsecondaryrecoverypoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := fetchsecondaryrecoverypoints.FetchSecondaryRPsRequestParameters{ // ... diff --git a/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/id_providerlocation.go b/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/id_providerlocation.go index 3cdae9fe687..5879bb8e5aa 100644 --- a/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/id_providerlocation.go +++ b/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/id_providerlocation_test.go b/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/id_providerlocation_test.go index 428482d71cc..8f7a9e4627a 100644 --- a/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/id_providerlocation_test.go +++ b/resource-manager/dataprotection/2024-04-01/fetchsecondaryrecoverypoints/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/README.md b/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/README.md index c7ec22762d3..29f2676313f 100644 --- a/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/README.md +++ b/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := findrestorabletimeranges.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := findrestorabletimeranges.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") payload := findrestorabletimeranges.AzureBackupFindRestorableTimeRangesRequest{ // ... diff --git a/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/id_backupinstance.go b/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/id_backupinstance.go index bc05553b785..6ababa9f6f5 100644 --- a/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/id_backupinstance.go +++ b/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/id_backupinstance.go @@ -121,7 +121,7 @@ func (id BackupInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackupInstances", "backupInstances", "backupInstances"), resourceids.UserSpecifiedSegment("backupInstanceName", "backupInstanceName"), } diff --git a/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/id_backupinstance_test.go b/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/id_backupinstance_test.go index d16488d626d..b6a1a836563 100644 --- a/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/id_backupinstance_test.go +++ b/resource-manager/dataprotection/2024-04-01/findrestorabletimeranges/id_backupinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupInstanceId{} func TestNewBackupInstanceID(t *testing.T) { - id := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") + id := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } if id.BackupInstanceName != "backupInstanceName" { @@ -32,8 +32,8 @@ func TestNewBackupInstanceID(t *testing.T) { } func TestFormatBackupInstanceID(t *testing.T) { - actual := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName" + actual := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupInstanceName: "backupInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupInstanceName: "backupInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", BackupInstanceName: "bAcKuPiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/recoverypoint/README.md b/resource-manager/dataprotection/2024-04-01/recoverypoint/README.md index d50637264ec..216b9f11fc4 100644 --- a/resource-manager/dataprotection/2024-04-01/recoverypoint/README.md +++ b/resource-manager/dataprotection/2024-04-01/recoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName", "recoveryPointId") +id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName", "recoveryPointId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoint.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") +id := recoverypoint.NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") // alternatively `client.List(ctx, id, recoverypoint.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recoverypoint.DefaultListOperationOptions()) diff --git a/resource-manager/dataprotection/2024-04-01/recoverypoint/id_backupinstance.go b/resource-manager/dataprotection/2024-04-01/recoverypoint/id_backupinstance.go index a58325fdb5c..26cc0f06e97 100644 --- a/resource-manager/dataprotection/2024-04-01/recoverypoint/id_backupinstance.go +++ b/resource-manager/dataprotection/2024-04-01/recoverypoint/id_backupinstance.go @@ -121,7 +121,7 @@ func (id BackupInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackupInstances", "backupInstances", "backupInstances"), resourceids.UserSpecifiedSegment("backupInstanceName", "backupInstanceName"), } diff --git a/resource-manager/dataprotection/2024-04-01/recoverypoint/id_backupinstance_test.go b/resource-manager/dataprotection/2024-04-01/recoverypoint/id_backupinstance_test.go index 3966bceeaf2..807cb4b10ae 100644 --- a/resource-manager/dataprotection/2024-04-01/recoverypoint/id_backupinstance_test.go +++ b/resource-manager/dataprotection/2024-04-01/recoverypoint/id_backupinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupInstanceId{} func TestNewBackupInstanceID(t *testing.T) { - id := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName") + id := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } if id.BackupInstanceName != "backupInstanceName" { @@ -32,8 +32,8 @@ func TestNewBackupInstanceID(t *testing.T) { } func TestFormatBackupInstanceID(t *testing.T) { - actual := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName" + actual := NewBackupInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupInstanceName: "backupInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupInstanceName: "backupInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE", Expected: &BackupInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", BackupInstanceName: "bAcKuPiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/recoverypoint/id_recoverypoint.go b/resource-manager/dataprotection/2024-04-01/recoverypoint/id_recoverypoint.go index 7f3e4500f51..f05d98b51c0 100644 --- a/resource-manager/dataprotection/2024-04-01/recoverypoint/id_recoverypoint.go +++ b/resource-manager/dataprotection/2024-04-01/recoverypoint/id_recoverypoint.go @@ -127,7 +127,7 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), - resourceids.UserSpecifiedSegment("backupVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackupInstances", "backupInstances", "backupInstances"), resourceids.UserSpecifiedSegment("backupInstanceName", "backupInstanceName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/dataprotection/2024-04-01/recoverypoint/id_recoverypoint_test.go b/resource-manager/dataprotection/2024-04-01/recoverypoint/id_recoverypoint_test.go index 90919243e60..8896fa388eb 100644 --- a/resource-manager/dataprotection/2024-04-01/recoverypoint/id_recoverypoint_test.go +++ b/resource-manager/dataprotection/2024-04-01/recoverypoint/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.BackupVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "vaultName") + if id.BackupVaultName != "backupVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultName") } if id.BackupInstanceName != "backupInstanceName" { @@ -36,8 +36,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupInstanceName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "backupVaultName", "backupInstanceName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupInstanceName: "backupInstanceName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - BackupVaultName: "vaultName", + BackupVaultName: "backupVaultName", BackupInstanceName: "backupInstanceName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/vaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/backupVaults/backupVaultName/backupInstances/backupInstanceName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BackupVaultName: "vAuLtNaMe", + BackupVaultName: "bAcKuPvAuLtNaMe", BackupInstanceName: "bAcKuPiNsTaNcEnAmE", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/vAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPiNsTaNcEs/bAcKuPiNsTaNcEnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/README.md b/resource-manager/dataprotection/2024-04-01/resourceguards/README.md index 1c3d02e212b..4bcdc6a2e0c 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/README.md +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") read, err := client.Delete(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") // alternatively `client.GetBackupSecurityPINRequestsObjects(ctx, id)` can be used to do batched pagination items, err := client.GetBackupSecurityPINRequestsObjectsComplete(ctx, id) @@ -74,7 +74,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourceguards.NewGetBackupSecurityPINRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") +id := resourceguards.NewGetBackupSecurityPINRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "getBackupSecurityPINRequestName") read, err := client.GetDefaultBackupSecurityPINRequestsObject(ctx, id) if err != nil { @@ -90,7 +90,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewDeleteProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") +id := resourceguards.NewDeleteProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "deleteProtectedItemRequestName") read, err := client.GetDefaultDeleteProtectedItemRequestsObject(ctx, id) if err != nil { @@ -106,7 +106,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewDeleteResourceGuardProxyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") +id := resourceguards.NewDeleteResourceGuardProxyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "deleteResourceGuardProxyRequestName") read, err := client.GetDefaultDeleteResourceGuardProxyRequestsObject(ctx, id) if err != nil { @@ -122,7 +122,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewDisableSoftDeleteRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") +id := resourceguards.NewDisableSoftDeleteRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "disableSoftDeleteRequestName") read, err := client.GetDefaultDisableSoftDeleteRequestsObject(ctx, id) if err != nil { @@ -138,7 +138,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewUpdateProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") +id := resourceguards.NewUpdateProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "updateProtectedItemRequestName") read, err := client.GetDefaultUpdateProtectedItemRequestsObject(ctx, id) if err != nil { @@ -154,7 +154,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewUpdateProtectionPolicyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") +id := resourceguards.NewUpdateProtectionPolicyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "updateProtectionPolicyRequestName") read, err := client.GetDefaultUpdateProtectionPolicyRequestsObject(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") // alternatively `client.GetDeleteProtectedItemRequestsObjects(ctx, id)` can be used to do batched pagination items, err := client.GetDeleteProtectedItemRequestsObjectsComplete(ctx, id) @@ -187,7 +187,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") // alternatively `client.GetDeleteResourceGuardProxyRequestsObjects(ctx, id)` can be used to do batched pagination items, err := client.GetDeleteResourceGuardProxyRequestsObjectsComplete(ctx, id) @@ -204,7 +204,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") // alternatively `client.GetDisableSoftDeleteRequestsObjects(ctx, id)` can be used to do batched pagination items, err := client.GetDisableSoftDeleteRequestsObjectsComplete(ctx, id) @@ -255,7 +255,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") // alternatively `client.GetUpdateProtectedItemRequestsObjects(ctx, id)` can be used to do batched pagination items, err := client.GetUpdateProtectedItemRequestsObjectsComplete(ctx, id) @@ -272,7 +272,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") // alternatively `client.GetUpdateProtectionPolicyRequestsObjects(ctx, id)` can be used to do batched pagination items, err := client.GetUpdateProtectionPolicyRequestsObjectsComplete(ctx, id) @@ -289,7 +289,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") payload := resourceguards.PatchResourceGuardInput{ // ... @@ -310,7 +310,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") +id := resourceguards.NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") payload := resourceguards.ResourceGuardResource{ // ... diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteprotecteditemrequest.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteprotecteditemrequest.go index e76d7b7fdac..5df2a8b27db 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteprotecteditemrequest.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteprotecteditemrequest.go @@ -121,9 +121,9 @@ func (id DeleteProtectedItemRequestId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticResourceGuards", "resourceGuards", "resourceGuards"), - resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardsName"), + resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardName"), resourceids.StaticSegment("staticDeleteProtectedItemRequests", "deleteProtectedItemRequests", "deleteProtectedItemRequests"), - resourceids.UserSpecifiedSegment("deleteProtectedItemRequestName", "requestName"), + resourceids.UserSpecifiedSegment("deleteProtectedItemRequestName", "deleteProtectedItemRequestName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteprotecteditemrequest_test.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteprotecteditemrequest_test.go index 0243140c7d2..69a5e3310cc 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteprotecteditemrequest_test.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteprotecteditemrequest_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeleteProtectedItemRequestId{} func TestNewDeleteProtectedItemRequestID(t *testing.T) { - id := NewDeleteProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") + id := NewDeleteProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "deleteProtectedItemRequestName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDeleteProtectedItemRequestID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ResourceGuardName != "resourceGuardsName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardsName") + if id.ResourceGuardName != "resourceGuardName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardName") } - if id.DeleteProtectedItemRequestName != "requestName" { - t.Fatalf("Expected %q but got %q for Segment 'DeleteProtectedItemRequestName'", id.DeleteProtectedItemRequestName, "requestName") + if id.DeleteProtectedItemRequestName != "deleteProtectedItemRequestName" { + t.Fatalf("Expected %q but got %q for Segment 'DeleteProtectedItemRequestName'", id.DeleteProtectedItemRequestName, "deleteProtectedItemRequestName") } } func TestFormatDeleteProtectedItemRequestID(t *testing.T) { - actual := NewDeleteProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteProtectedItemRequests/requestName" + actual := NewDeleteProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "deleteProtectedItemRequestName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteProtectedItemRequests/deleteProtectedItemRequestName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDeleteProtectedItemRequestID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteProtectedItemRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteProtectedItemRequests", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteProtectedItemRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteProtectedItemRequests/deleteProtectedItemRequestName", Expected: &DeleteProtectedItemRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - DeleteProtectedItemRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + DeleteProtectedItemRequestName: "deleteProtectedItemRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteProtectedItemRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteProtectedItemRequests/deleteProtectedItemRequestName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDeleteProtectedItemRequestIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteProtectedItemRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteProtectedItemRequests", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dElEtEpRoTeCtEdItEmReQuEsTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dElEtEpRoTeCtEdItEmReQuEsTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteProtectedItemRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteProtectedItemRequests/deleteProtectedItemRequestName", Expected: &DeleteProtectedItemRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - DeleteProtectedItemRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + DeleteProtectedItemRequestName: "deleteProtectedItemRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteProtectedItemRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteProtectedItemRequests/deleteProtectedItemRequestName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dElEtEpRoTeCtEdItEmReQuEsTs/rEqUeStNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dElEtEpRoTeCtEdItEmReQuEsTs/dElEtEpRoTeCtEdItEmReQuEsTnAmE", Expected: &DeleteProtectedItemRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ResourceGuardName: "rEsOuRcEgUaRdSnAmE", - DeleteProtectedItemRequestName: "rEqUeStNaMe", + ResourceGuardName: "rEsOuRcEgUaRdNaMe", + DeleteProtectedItemRequestName: "dElEtEpRoTeCtEdItEmReQuEsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dElEtEpRoTeCtEdItEmReQuEsTs/rEqUeStNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dElEtEpRoTeCtEdItEmReQuEsTs/dElEtEpRoTeCtEdItEmReQuEsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteresourceguardproxyrequest.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteresourceguardproxyrequest.go index 75a630a0cb3..5f1ebab8149 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteresourceguardproxyrequest.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteresourceguardproxyrequest.go @@ -121,9 +121,9 @@ func (id DeleteResourceGuardProxyRequestId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticResourceGuards", "resourceGuards", "resourceGuards"), - resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardsName"), + resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardName"), resourceids.StaticSegment("staticDeleteResourceGuardProxyRequests", "deleteResourceGuardProxyRequests", "deleteResourceGuardProxyRequests"), - resourceids.UserSpecifiedSegment("deleteResourceGuardProxyRequestName", "requestName"), + resourceids.UserSpecifiedSegment("deleteResourceGuardProxyRequestName", "deleteResourceGuardProxyRequestName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteresourceguardproxyrequest_test.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteresourceguardproxyrequest_test.go index 180a4820339..22bd74e3abb 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteresourceguardproxyrequest_test.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_deleteresourceguardproxyrequest_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeleteResourceGuardProxyRequestId{} func TestNewDeleteResourceGuardProxyRequestID(t *testing.T) { - id := NewDeleteResourceGuardProxyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") + id := NewDeleteResourceGuardProxyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "deleteResourceGuardProxyRequestName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDeleteResourceGuardProxyRequestID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ResourceGuardName != "resourceGuardsName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardsName") + if id.ResourceGuardName != "resourceGuardName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardName") } - if id.DeleteResourceGuardProxyRequestName != "requestName" { - t.Fatalf("Expected %q but got %q for Segment 'DeleteResourceGuardProxyRequestName'", id.DeleteResourceGuardProxyRequestName, "requestName") + if id.DeleteResourceGuardProxyRequestName != "deleteResourceGuardProxyRequestName" { + t.Fatalf("Expected %q but got %q for Segment 'DeleteResourceGuardProxyRequestName'", id.DeleteResourceGuardProxyRequestName, "deleteResourceGuardProxyRequestName") } } func TestFormatDeleteResourceGuardProxyRequestID(t *testing.T) { - actual := NewDeleteResourceGuardProxyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteResourceGuardProxyRequests/requestName" + actual := NewDeleteResourceGuardProxyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "deleteResourceGuardProxyRequestName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteResourceGuardProxyRequests/deleteResourceGuardProxyRequestName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDeleteResourceGuardProxyRequestID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteResourceGuardProxyRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteResourceGuardProxyRequests", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteResourceGuardProxyRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteResourceGuardProxyRequests/deleteResourceGuardProxyRequestName", Expected: &DeleteResourceGuardProxyRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - DeleteResourceGuardProxyRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + DeleteResourceGuardProxyRequestName: "deleteResourceGuardProxyRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteResourceGuardProxyRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteResourceGuardProxyRequests/deleteResourceGuardProxyRequestName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDeleteResourceGuardProxyRequestIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteResourceGuardProxyRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteResourceGuardProxyRequests", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dElEtErEsOuRcEgUaRdPrOxYrEqUeStS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dElEtErEsOuRcEgUaRdPrOxYrEqUeStS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteResourceGuardProxyRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteResourceGuardProxyRequests/deleteResourceGuardProxyRequestName", Expected: &DeleteResourceGuardProxyRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - DeleteResourceGuardProxyRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + DeleteResourceGuardProxyRequestName: "deleteResourceGuardProxyRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/deleteResourceGuardProxyRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/deleteResourceGuardProxyRequests/deleteResourceGuardProxyRequestName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dElEtErEsOuRcEgUaRdPrOxYrEqUeStS/rEqUeStNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dElEtErEsOuRcEgUaRdPrOxYrEqUeStS/dElEtErEsOuRcEgUaRdPrOxYrEqUeStNaMe", Expected: &DeleteResourceGuardProxyRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ResourceGuardName: "rEsOuRcEgUaRdSnAmE", - DeleteResourceGuardProxyRequestName: "rEqUeStNaMe", + ResourceGuardName: "rEsOuRcEgUaRdNaMe", + DeleteResourceGuardProxyRequestName: "dElEtErEsOuRcEgUaRdPrOxYrEqUeStNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dElEtErEsOuRcEgUaRdPrOxYrEqUeStS/rEqUeStNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dElEtErEsOuRcEgUaRdPrOxYrEqUeStS/dElEtErEsOuRcEgUaRdPrOxYrEqUeStNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_disablesoftdeleterequest.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_disablesoftdeleterequest.go index 86b4338ff50..bd69590ab7e 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_disablesoftdeleterequest.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_disablesoftdeleterequest.go @@ -121,9 +121,9 @@ func (id DisableSoftDeleteRequestId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticResourceGuards", "resourceGuards", "resourceGuards"), - resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardsName"), + resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardName"), resourceids.StaticSegment("staticDisableSoftDeleteRequests", "disableSoftDeleteRequests", "disableSoftDeleteRequests"), - resourceids.UserSpecifiedSegment("disableSoftDeleteRequestName", "requestName"), + resourceids.UserSpecifiedSegment("disableSoftDeleteRequestName", "disableSoftDeleteRequestName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_disablesoftdeleterequest_test.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_disablesoftdeleterequest_test.go index cf592116a5e..ed2e45df963 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_disablesoftdeleterequest_test.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_disablesoftdeleterequest_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisableSoftDeleteRequestId{} func TestNewDisableSoftDeleteRequestID(t *testing.T) { - id := NewDisableSoftDeleteRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") + id := NewDisableSoftDeleteRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "disableSoftDeleteRequestName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDisableSoftDeleteRequestID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ResourceGuardName != "resourceGuardsName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardsName") + if id.ResourceGuardName != "resourceGuardName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardName") } - if id.DisableSoftDeleteRequestName != "requestName" { - t.Fatalf("Expected %q but got %q for Segment 'DisableSoftDeleteRequestName'", id.DisableSoftDeleteRequestName, "requestName") + if id.DisableSoftDeleteRequestName != "disableSoftDeleteRequestName" { + t.Fatalf("Expected %q but got %q for Segment 'DisableSoftDeleteRequestName'", id.DisableSoftDeleteRequestName, "disableSoftDeleteRequestName") } } func TestFormatDisableSoftDeleteRequestID(t *testing.T) { - actual := NewDisableSoftDeleteRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/disableSoftDeleteRequests/requestName" + actual := NewDisableSoftDeleteRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "disableSoftDeleteRequestName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/disableSoftDeleteRequests/disableSoftDeleteRequestName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDisableSoftDeleteRequestID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/disableSoftDeleteRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/disableSoftDeleteRequests", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/disableSoftDeleteRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/disableSoftDeleteRequests/disableSoftDeleteRequestName", Expected: &DisableSoftDeleteRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - DisableSoftDeleteRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + DisableSoftDeleteRequestName: "disableSoftDeleteRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/disableSoftDeleteRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/disableSoftDeleteRequests/disableSoftDeleteRequestName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDisableSoftDeleteRequestIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/disableSoftDeleteRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/disableSoftDeleteRequests", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dIsAbLeSoFtDeLeTeReQuEsTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dIsAbLeSoFtDeLeTeReQuEsTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/disableSoftDeleteRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/disableSoftDeleteRequests/disableSoftDeleteRequestName", Expected: &DisableSoftDeleteRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - DisableSoftDeleteRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + DisableSoftDeleteRequestName: "disableSoftDeleteRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/disableSoftDeleteRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/disableSoftDeleteRequests/disableSoftDeleteRequestName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dIsAbLeSoFtDeLeTeReQuEsTs/rEqUeStNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dIsAbLeSoFtDeLeTeReQuEsTs/dIsAbLeSoFtDeLeTeReQuEsTnAmE", Expected: &DisableSoftDeleteRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ResourceGuardName: "rEsOuRcEgUaRdSnAmE", - DisableSoftDeleteRequestName: "rEqUeStNaMe", + ResourceGuardName: "rEsOuRcEgUaRdNaMe", + DisableSoftDeleteRequestName: "dIsAbLeSoFtDeLeTeReQuEsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/dIsAbLeSoFtDeLeTeReQuEsTs/rEqUeStNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/dIsAbLeSoFtDeLeTeReQuEsTs/dIsAbLeSoFtDeLeTeReQuEsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_getbackupsecuritypinrequest.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_getbackupsecuritypinrequest.go index 9b5895ab3e2..73508192a58 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_getbackupsecuritypinrequest.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_getbackupsecuritypinrequest.go @@ -121,9 +121,9 @@ func (id GetBackupSecurityPINRequestId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticResourceGuards", "resourceGuards", "resourceGuards"), - resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardsName"), + resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardName"), resourceids.StaticSegment("staticGetBackupSecurityPINRequests", "getBackupSecurityPINRequests", "getBackupSecurityPINRequests"), - resourceids.UserSpecifiedSegment("getBackupSecurityPINRequestName", "requestName"), + resourceids.UserSpecifiedSegment("getBackupSecurityPINRequestName", "getBackupSecurityPINRequestName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_getbackupsecuritypinrequest_test.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_getbackupsecuritypinrequest_test.go index 0dffd9ace39..cd05f745583 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_getbackupsecuritypinrequest_test.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_getbackupsecuritypinrequest_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GetBackupSecurityPINRequestId{} func TestNewGetBackupSecurityPINRequestID(t *testing.T) { - id := NewGetBackupSecurityPINRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") + id := NewGetBackupSecurityPINRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "getBackupSecurityPINRequestName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGetBackupSecurityPINRequestID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ResourceGuardName != "resourceGuardsName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardsName") + if id.ResourceGuardName != "resourceGuardName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardName") } - if id.GetBackupSecurityPINRequestName != "requestName" { - t.Fatalf("Expected %q but got %q for Segment 'GetBackupSecurityPINRequestName'", id.GetBackupSecurityPINRequestName, "requestName") + if id.GetBackupSecurityPINRequestName != "getBackupSecurityPINRequestName" { + t.Fatalf("Expected %q but got %q for Segment 'GetBackupSecurityPINRequestName'", id.GetBackupSecurityPINRequestName, "getBackupSecurityPINRequestName") } } func TestFormatGetBackupSecurityPINRequestID(t *testing.T) { - actual := NewGetBackupSecurityPINRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/getBackupSecurityPINRequests/requestName" + actual := NewGetBackupSecurityPINRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "getBackupSecurityPINRequestName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/getBackupSecurityPINRequests/getBackupSecurityPINRequestName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseGetBackupSecurityPINRequestID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/getBackupSecurityPINRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/getBackupSecurityPINRequests", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/getBackupSecurityPINRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/getBackupSecurityPINRequests/getBackupSecurityPINRequestName", Expected: &GetBackupSecurityPINRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - GetBackupSecurityPINRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + GetBackupSecurityPINRequestName: "getBackupSecurityPINRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/getBackupSecurityPINRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/getBackupSecurityPINRequests/getBackupSecurityPINRequestName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseGetBackupSecurityPINRequestIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/getBackupSecurityPINRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/getBackupSecurityPINRequests", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/gEtBaCkUpSeCuRiTyPiNrEqUeStS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/gEtBaCkUpSeCuRiTyPiNrEqUeStS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/getBackupSecurityPINRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/getBackupSecurityPINRequests/getBackupSecurityPINRequestName", Expected: &GetBackupSecurityPINRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - GetBackupSecurityPINRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + GetBackupSecurityPINRequestName: "getBackupSecurityPINRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/getBackupSecurityPINRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/getBackupSecurityPINRequests/getBackupSecurityPINRequestName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/gEtBaCkUpSeCuRiTyPiNrEqUeStS/rEqUeStNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/gEtBaCkUpSeCuRiTyPiNrEqUeStS/gEtBaCkUpSeCuRiTyPiNrEqUeStNaMe", Expected: &GetBackupSecurityPINRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ResourceGuardName: "rEsOuRcEgUaRdSnAmE", - GetBackupSecurityPINRequestName: "rEqUeStNaMe", + ResourceGuardName: "rEsOuRcEgUaRdNaMe", + GetBackupSecurityPINRequestName: "gEtBaCkUpSeCuRiTyPiNrEqUeStNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/gEtBaCkUpSeCuRiTyPiNrEqUeStS/rEqUeStNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/gEtBaCkUpSeCuRiTyPiNrEqUeStS/gEtBaCkUpSeCuRiTyPiNrEqUeStNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_resourceguard.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_resourceguard.go index 42898691a60..d25e5e58ab8 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_resourceguard.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_resourceguard.go @@ -115,7 +115,7 @@ func (id ResourceGuardId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticResourceGuards", "resourceGuards", "resourceGuards"), - resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardsName"), + resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_resourceguard_test.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_resourceguard_test.go index acedfaa09a9..74d59cc7473 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_resourceguard_test.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_resourceguard_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ResourceGuardId{} func TestNewResourceGuardID(t *testing.T) { - id := NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName") + id := NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewResourceGuardID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ResourceGuardName != "resourceGuardsName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardsName") + if id.ResourceGuardName != "resourceGuardName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardName") } } func TestFormatResourceGuardID(t *testing.T) { - actual := NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName" + actual := NewResourceGuardID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseResourceGuardID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Expected: &ResourceGuardId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", + ResourceGuardName: "resourceGuardName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseResourceGuardIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Expected: &ResourceGuardId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", + ResourceGuardName: "resourceGuardName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe", Expected: &ResourceGuardId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ResourceGuardName: "rEsOuRcEgUaRdSnAmE", + ResourceGuardName: "rEsOuRcEgUaRdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotecteditemrequest.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotecteditemrequest.go index 70552469040..5375caa22ab 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotecteditemrequest.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotecteditemrequest.go @@ -121,9 +121,9 @@ func (id UpdateProtectedItemRequestId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticResourceGuards", "resourceGuards", "resourceGuards"), - resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardsName"), + resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardName"), resourceids.StaticSegment("staticUpdateProtectedItemRequests", "updateProtectedItemRequests", "updateProtectedItemRequests"), - resourceids.UserSpecifiedSegment("updateProtectedItemRequestName", "requestName"), + resourceids.UserSpecifiedSegment("updateProtectedItemRequestName", "updateProtectedItemRequestName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotecteditemrequest_test.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotecteditemrequest_test.go index 9b5d76d7115..32c7d482013 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotecteditemrequest_test.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotecteditemrequest_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UpdateProtectedItemRequestId{} func TestNewUpdateProtectedItemRequestID(t *testing.T) { - id := NewUpdateProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") + id := NewUpdateProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "updateProtectedItemRequestName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUpdateProtectedItemRequestID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ResourceGuardName != "resourceGuardsName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardsName") + if id.ResourceGuardName != "resourceGuardName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardName") } - if id.UpdateProtectedItemRequestName != "requestName" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateProtectedItemRequestName'", id.UpdateProtectedItemRequestName, "requestName") + if id.UpdateProtectedItemRequestName != "updateProtectedItemRequestName" { + t.Fatalf("Expected %q but got %q for Segment 'UpdateProtectedItemRequestName'", id.UpdateProtectedItemRequestName, "updateProtectedItemRequestName") } } func TestFormatUpdateProtectedItemRequestID(t *testing.T) { - actual := NewUpdateProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectedItemRequests/requestName" + actual := NewUpdateProtectedItemRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "updateProtectedItemRequestName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectedItemRequests/updateProtectedItemRequestName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUpdateProtectedItemRequestID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectedItemRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectedItemRequests", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectedItemRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectedItemRequests/updateProtectedItemRequestName", Expected: &UpdateProtectedItemRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - UpdateProtectedItemRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + UpdateProtectedItemRequestName: "updateProtectedItemRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectedItemRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectedItemRequests/updateProtectedItemRequestName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUpdateProtectedItemRequestIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectedItemRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectedItemRequests", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/uPdAtEpRoTeCtEdItEmReQuEsTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/uPdAtEpRoTeCtEdItEmReQuEsTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectedItemRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectedItemRequests/updateProtectedItemRequestName", Expected: &UpdateProtectedItemRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - UpdateProtectedItemRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + UpdateProtectedItemRequestName: "updateProtectedItemRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectedItemRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectedItemRequests/updateProtectedItemRequestName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/uPdAtEpRoTeCtEdItEmReQuEsTs/rEqUeStNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/uPdAtEpRoTeCtEdItEmReQuEsTs/uPdAtEpRoTeCtEdItEmReQuEsTnAmE", Expected: &UpdateProtectedItemRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ResourceGuardName: "rEsOuRcEgUaRdSnAmE", - UpdateProtectedItemRequestName: "rEqUeStNaMe", + ResourceGuardName: "rEsOuRcEgUaRdNaMe", + UpdateProtectedItemRequestName: "uPdAtEpRoTeCtEdItEmReQuEsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/uPdAtEpRoTeCtEdItEmReQuEsTs/rEqUeStNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/uPdAtEpRoTeCtEdItEmReQuEsTs/uPdAtEpRoTeCtEdItEmReQuEsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotectionpolicyrequest.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotectionpolicyrequest.go index f41aa366d34..ad9cdaf67e7 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotectionpolicyrequest.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotectionpolicyrequest.go @@ -121,9 +121,9 @@ func (id UpdateProtectionPolicyRequestId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataProtection", "Microsoft.DataProtection", "Microsoft.DataProtection"), resourceids.StaticSegment("staticResourceGuards", "resourceGuards", "resourceGuards"), - resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardsName"), + resourceids.UserSpecifiedSegment("resourceGuardName", "resourceGuardName"), resourceids.StaticSegment("staticUpdateProtectionPolicyRequests", "updateProtectionPolicyRequests", "updateProtectionPolicyRequests"), - resourceids.UserSpecifiedSegment("updateProtectionPolicyRequestName", "requestName"), + resourceids.UserSpecifiedSegment("updateProtectionPolicyRequestName", "updateProtectionPolicyRequestName"), } } diff --git a/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotectionpolicyrequest_test.go b/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotectionpolicyrequest_test.go index 3f7850cbd4a..5fbbb38db64 100644 --- a/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotectionpolicyrequest_test.go +++ b/resource-manager/dataprotection/2024-04-01/resourceguards/id_updateprotectionpolicyrequest_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UpdateProtectionPolicyRequestId{} func TestNewUpdateProtectionPolicyRequestID(t *testing.T) { - id := NewUpdateProtectionPolicyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName") + id := NewUpdateProtectionPolicyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "updateProtectionPolicyRequestName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUpdateProtectionPolicyRequestID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ResourceGuardName != "resourceGuardsName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardsName") + if id.ResourceGuardName != "resourceGuardName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGuardName'", id.ResourceGuardName, "resourceGuardName") } - if id.UpdateProtectionPolicyRequestName != "requestName" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateProtectionPolicyRequestName'", id.UpdateProtectionPolicyRequestName, "requestName") + if id.UpdateProtectionPolicyRequestName != "updateProtectionPolicyRequestName" { + t.Fatalf("Expected %q but got %q for Segment 'UpdateProtectionPolicyRequestName'", id.UpdateProtectionPolicyRequestName, "updateProtectionPolicyRequestName") } } func TestFormatUpdateProtectionPolicyRequestID(t *testing.T) { - actual := NewUpdateProtectionPolicyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardsName", "requestName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectionPolicyRequests/requestName" + actual := NewUpdateProtectionPolicyRequestID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceGuardName", "updateProtectionPolicyRequestName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectionPolicyRequests/updateProtectionPolicyRequestName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUpdateProtectionPolicyRequestID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectionPolicyRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectionPolicyRequests", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectionPolicyRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectionPolicyRequests/updateProtectionPolicyRequestName", Expected: &UpdateProtectionPolicyRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - UpdateProtectionPolicyRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + UpdateProtectionPolicyRequestName: "updateProtectionPolicyRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectionPolicyRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectionPolicyRequests/updateProtectionPolicyRequestName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUpdateProtectionPolicyRequestIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectionPolicyRequests", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectionPolicyRequests", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/uPdAtEpRoTeCtIoNpOlIcYrEqUeStS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/uPdAtEpRoTeCtIoNpOlIcYrEqUeStS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectionPolicyRequests/requestName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectionPolicyRequests/updateProtectionPolicyRequestName", Expected: &UpdateProtectionPolicyRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceGuardName: "resourceGuardsName", - UpdateProtectionPolicyRequestName: "requestName", + ResourceGuardName: "resourceGuardName", + UpdateProtectionPolicyRequestName: "updateProtectionPolicyRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardsName/updateProtectionPolicyRequests/requestName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DataProtection/resourceGuards/resourceGuardName/updateProtectionPolicyRequests/updateProtectionPolicyRequestName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/uPdAtEpRoTeCtIoNpOlIcYrEqUeStS/rEqUeStNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/uPdAtEpRoTeCtIoNpOlIcYrEqUeStS/uPdAtEpRoTeCtIoNpOlIcYrEqUeStNaMe", Expected: &UpdateProtectionPolicyRequestId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ResourceGuardName: "rEsOuRcEgUaRdSnAmE", - UpdateProtectionPolicyRequestName: "rEqUeStNaMe", + ResourceGuardName: "rEsOuRcEgUaRdNaMe", + UpdateProtectionPolicyRequestName: "uPdAtEpRoTeCtIoNpOlIcYrEqUeStNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdSnAmE/uPdAtEpRoTeCtIoNpOlIcYrEqUeStS/rEqUeStNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dAtApRoTeCtIoN/rEsOuRcEgUaRdS/rEsOuRcEgUaRdNaMe/uPdAtEpRoTeCtIoNpOlIcYrEqUeStS/uPdAtEpRoTeCtIoNpOlIcYrEqUeStNaMe/extra", Error: true, }, } diff --git a/resource-manager/datashare/2019-11-01/consumerinvitation/README.md b/resource-manager/datashare/2019-11-01/consumerinvitation/README.md index acab880ee38..559b9a6653a 100644 --- a/resource-manager/datashare/2019-11-01/consumerinvitation/README.md +++ b/resource-manager/datashare/2019-11-01/consumerinvitation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := consumerinvitation.NewConsumerInvitationID("location", "invitationId") +id := consumerinvitation.NewConsumerInvitationID("locationName", "invitationId") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := consumerinvitation.NewLocationID("location") +id := consumerinvitation.NewLocationID("locationName") payload := consumerinvitation.ConsumerInvitation{ // ... diff --git a/resource-manager/datashare/2019-11-01/consumerinvitation/id_consumerinvitation.go b/resource-manager/datashare/2019-11-01/consumerinvitation/id_consumerinvitation.go index 4faadda402b..a4d4d8a6125 100644 --- a/resource-manager/datashare/2019-11-01/consumerinvitation/id_consumerinvitation.go +++ b/resource-manager/datashare/2019-11-01/consumerinvitation/id_consumerinvitation.go @@ -105,7 +105,7 @@ func (id ConsumerInvitationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataShare", "Microsoft.DataShare", "Microsoft.DataShare"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticConsumerInvitations", "consumerInvitations", "consumerInvitations"), resourceids.UserSpecifiedSegment("invitationId", "invitationId"), } diff --git a/resource-manager/datashare/2019-11-01/consumerinvitation/id_consumerinvitation_test.go b/resource-manager/datashare/2019-11-01/consumerinvitation/id_consumerinvitation_test.go index f46685fb26f..68edc693db6 100644 --- a/resource-manager/datashare/2019-11-01/consumerinvitation/id_consumerinvitation_test.go +++ b/resource-manager/datashare/2019-11-01/consumerinvitation/id_consumerinvitation_test.go @@ -12,10 +12,10 @@ import ( var _ resourceids.ResourceId = &ConsumerInvitationId{} func TestNewConsumerInvitationID(t *testing.T) { - id := NewConsumerInvitationID("location", "invitationId") + id := NewConsumerInvitationID("locationName", "invitationId") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InvitationId != "invitationId" { @@ -24,8 +24,8 @@ func TestNewConsumerInvitationID(t *testing.T) { } func TestFormatConsumerInvitationID(t *testing.T) { - actual := NewConsumerInvitationID("location", "invitationId").ID() - expected := "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId" + actual := NewConsumerInvitationID("locationName", "invitationId").ID() + expected := "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,25 +59,25 @@ func TestParseConsumerInvitationID(t *testing.T) { }, { // Incomplete URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations", Error: true, }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId", Expected: &ConsumerInvitationId{ - LocationName: "location", + LocationName: "locationName", InvitationId: "invitationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId/extra", Error: true, }, } @@ -150,48 +150,48 @@ func TestParseConsumerInvitationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/cOnSuMeRiNvItAtIoNs", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/cOnSuMeRiNvItAtIoNs", Error: true, }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId", Expected: &ConsumerInvitationId{ - LocationName: "location", + LocationName: "locationName", InvitationId: "invitationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/cOnSuMeRiNvItAtIoNs/iNvItAtIoNiD", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/cOnSuMeRiNvItAtIoNs/iNvItAtIoNiD", Expected: &ConsumerInvitationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InvitationId: "iNvItAtIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/cOnSuMeRiNvItAtIoNs/iNvItAtIoNiD/extra", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/cOnSuMeRiNvItAtIoNs/iNvItAtIoNiD/extra", Error: true, }, } diff --git a/resource-manager/datashare/2019-11-01/consumerinvitation/id_location.go b/resource-manager/datashare/2019-11-01/consumerinvitation/id_location.go index 08f916c6a04..ed9d60599ff 100644 --- a/resource-manager/datashare/2019-11-01/consumerinvitation/id_location.go +++ b/resource-manager/datashare/2019-11-01/consumerinvitation/id_location.go @@ -99,7 +99,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataShare", "Microsoft.DataShare", "Microsoft.DataShare"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datashare/2019-11-01/consumerinvitation/id_location_test.go b/resource-manager/datashare/2019-11-01/consumerinvitation/id_location_test.go index 5fb058860bf..67c2fb6b905 100644 --- a/resource-manager/datashare/2019-11-01/consumerinvitation/id_location_test.go +++ b/resource-manager/datashare/2019-11-01/consumerinvitation/id_location_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("location") + id := NewLocationID("locationName") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("location").ID() - expected := "/providers/Microsoft.DataShare/locations/location" + actual := NewLocationID("locationName").ID() + expected := "/providers/Microsoft.DataShare/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datashare/2019-11-01/emailregistration/README.md b/resource-manager/datashare/2019-11-01/emailregistration/README.md index 9465eb47b7c..82ec9e4af75 100644 --- a/resource-manager/datashare/2019-11-01/emailregistration/README.md +++ b/resource-manager/datashare/2019-11-01/emailregistration/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := emailregistration.NewLocationID("location") +id := emailregistration.NewLocationID("locationName") payload := emailregistration.EmailRegistration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := emailregistration.NewLocationID("location") +id := emailregistration.NewLocationID("locationName") read, err := client.RegisterEmail(ctx, id) if err != nil { diff --git a/resource-manager/datashare/2019-11-01/emailregistration/id_location.go b/resource-manager/datashare/2019-11-01/emailregistration/id_location.go index 8d5fd0f64ad..d5afbf65e48 100644 --- a/resource-manager/datashare/2019-11-01/emailregistration/id_location.go +++ b/resource-manager/datashare/2019-11-01/emailregistration/id_location.go @@ -99,7 +99,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataShare", "Microsoft.DataShare", "Microsoft.DataShare"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datashare/2019-11-01/emailregistration/id_location_test.go b/resource-manager/datashare/2019-11-01/emailregistration/id_location_test.go index 879d97b2eb3..d9d19e669c2 100644 --- a/resource-manager/datashare/2019-11-01/emailregistration/id_location_test.go +++ b/resource-manager/datashare/2019-11-01/emailregistration/id_location_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("location") + id := NewLocationID("locationName") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("location").ID() - expected := "/providers/Microsoft.DataShare/locations/location" + actual := NewLocationID("locationName").ID() + expected := "/providers/Microsoft.DataShare/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datashare/2021-08-01/consumerinvitation/README.md b/resource-manager/datashare/2021-08-01/consumerinvitation/README.md index 6f2103bcbc3..827916360f2 100644 --- a/resource-manager/datashare/2021-08-01/consumerinvitation/README.md +++ b/resource-manager/datashare/2021-08-01/consumerinvitation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := consumerinvitation.NewConsumerInvitationID("location", "invitationId") +id := consumerinvitation.NewConsumerInvitationID("locationName", "invitationId") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := consumerinvitation.NewLocationID("location") +id := consumerinvitation.NewLocationID("locationName") payload := consumerinvitation.ConsumerInvitation{ // ... diff --git a/resource-manager/datashare/2021-08-01/consumerinvitation/id_consumerinvitation.go b/resource-manager/datashare/2021-08-01/consumerinvitation/id_consumerinvitation.go index 4faadda402b..a4d4d8a6125 100644 --- a/resource-manager/datashare/2021-08-01/consumerinvitation/id_consumerinvitation.go +++ b/resource-manager/datashare/2021-08-01/consumerinvitation/id_consumerinvitation.go @@ -105,7 +105,7 @@ func (id ConsumerInvitationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataShare", "Microsoft.DataShare", "Microsoft.DataShare"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticConsumerInvitations", "consumerInvitations", "consumerInvitations"), resourceids.UserSpecifiedSegment("invitationId", "invitationId"), } diff --git a/resource-manager/datashare/2021-08-01/consumerinvitation/id_consumerinvitation_test.go b/resource-manager/datashare/2021-08-01/consumerinvitation/id_consumerinvitation_test.go index f46685fb26f..68edc693db6 100644 --- a/resource-manager/datashare/2021-08-01/consumerinvitation/id_consumerinvitation_test.go +++ b/resource-manager/datashare/2021-08-01/consumerinvitation/id_consumerinvitation_test.go @@ -12,10 +12,10 @@ import ( var _ resourceids.ResourceId = &ConsumerInvitationId{} func TestNewConsumerInvitationID(t *testing.T) { - id := NewConsumerInvitationID("location", "invitationId") + id := NewConsumerInvitationID("locationName", "invitationId") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.InvitationId != "invitationId" { @@ -24,8 +24,8 @@ func TestNewConsumerInvitationID(t *testing.T) { } func TestFormatConsumerInvitationID(t *testing.T) { - actual := NewConsumerInvitationID("location", "invitationId").ID() - expected := "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId" + actual := NewConsumerInvitationID("locationName", "invitationId").ID() + expected := "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,25 +59,25 @@ func TestParseConsumerInvitationID(t *testing.T) { }, { // Incomplete URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations", Error: true, }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId", Expected: &ConsumerInvitationId{ - LocationName: "location", + LocationName: "locationName", InvitationId: "invitationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId/extra", Error: true, }, } @@ -150,48 +150,48 @@ func TestParseConsumerInvitationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/cOnSuMeRiNvItAtIoNs", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/cOnSuMeRiNvItAtIoNs", Error: true, }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId", Expected: &ConsumerInvitationId{ - LocationName: "location", + LocationName: "locationName", InvitationId: "invitationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/consumerInvitations/invitationId/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/consumerInvitations/invitationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/cOnSuMeRiNvItAtIoNs/iNvItAtIoNiD", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/cOnSuMeRiNvItAtIoNs/iNvItAtIoNiD", Expected: &ConsumerInvitationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", InvitationId: "iNvItAtIoNiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/cOnSuMeRiNvItAtIoNs/iNvItAtIoNiD/extra", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/cOnSuMeRiNvItAtIoNs/iNvItAtIoNiD/extra", Error: true, }, } diff --git a/resource-manager/datashare/2021-08-01/consumerinvitation/id_location.go b/resource-manager/datashare/2021-08-01/consumerinvitation/id_location.go index 08f916c6a04..ed9d60599ff 100644 --- a/resource-manager/datashare/2021-08-01/consumerinvitation/id_location.go +++ b/resource-manager/datashare/2021-08-01/consumerinvitation/id_location.go @@ -99,7 +99,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataShare", "Microsoft.DataShare", "Microsoft.DataShare"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datashare/2021-08-01/consumerinvitation/id_location_test.go b/resource-manager/datashare/2021-08-01/consumerinvitation/id_location_test.go index 5fb058860bf..67c2fb6b905 100644 --- a/resource-manager/datashare/2021-08-01/consumerinvitation/id_location_test.go +++ b/resource-manager/datashare/2021-08-01/consumerinvitation/id_location_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("location") + id := NewLocationID("locationName") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("location").ID() - expected := "/providers/Microsoft.DataShare/locations/location" + actual := NewLocationID("locationName").ID() + expected := "/providers/Microsoft.DataShare/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/datashare/2021-08-01/emailregistration/README.md b/resource-manager/datashare/2021-08-01/emailregistration/README.md index 3f12e58c727..719316bf655 100644 --- a/resource-manager/datashare/2021-08-01/emailregistration/README.md +++ b/resource-manager/datashare/2021-08-01/emailregistration/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := emailregistration.NewLocationID("location") +id := emailregistration.NewLocationID("locationName") payload := emailregistration.EmailRegistration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := emailregistration.NewLocationID("location") +id := emailregistration.NewLocationID("locationName") read, err := client.RegisterEmail(ctx, id) if err != nil { diff --git a/resource-manager/datashare/2021-08-01/emailregistration/id_location.go b/resource-manager/datashare/2021-08-01/emailregistration/id_location.go index 8d5fd0f64ad..d5afbf65e48 100644 --- a/resource-manager/datashare/2021-08-01/emailregistration/id_location.go +++ b/resource-manager/datashare/2021-08-01/emailregistration/id_location.go @@ -99,7 +99,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDataShare", "Microsoft.DataShare", "Microsoft.DataShare"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/datashare/2021-08-01/emailregistration/id_location_test.go b/resource-manager/datashare/2021-08-01/emailregistration/id_location_test.go index 879d97b2eb3..d9d19e669c2 100644 --- a/resource-manager/datashare/2021-08-01/emailregistration/id_location_test.go +++ b/resource-manager/datashare/2021-08-01/emailregistration/id_location_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("location") + id := NewLocationID("locationName") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("location").ID() - expected := "/providers/Microsoft.DataShare/locations/location" + actual := NewLocationID("locationName").ID() + expected := "/providers/Microsoft.DataShare/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.DataShare/locations/location", + Input: "/providers/Microsoft.DataShare/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.DataShare/locations/location/extra", + Input: "/providers/Microsoft.DataShare/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/pRoViDeRs/mIcRoSoFt.dAtAsHaRe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/README.md b/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/README.md index 58901e03b3a..af2a550e204 100644 --- a/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/README.md +++ b/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") payload := msixpackage.MSIXPackage{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") payload := msixpackage.MSIXPackagePatch{ // ... diff --git a/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/id_msixpackage.go b/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/id_msixpackage.go index 4d2bc9427fc..f72e6d6f0f1 100644 --- a/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/id_msixpackage.go +++ b/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/id_msixpackage.go @@ -123,7 +123,7 @@ func (id MsixPackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticHostPools", "hostPools", "hostPools"), resourceids.UserSpecifiedSegment("hostPoolName", "hostPoolName"), resourceids.StaticSegment("staticMsixPackages", "msixPackages", "msixPackages"), - resourceids.UserSpecifiedSegment("msixPackageName", "msixPackageFullName"), + resourceids.UserSpecifiedSegment("msixPackageName", "msixPackageName"), } } diff --git a/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/id_msixpackage_test.go b/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/id_msixpackage_test.go index 6ea3717eef0..bea1658d0de 100644 --- a/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/id_msixpackage_test.go +++ b/resource-manager/desktopvirtualization/2021-09-03-preview/msixpackage/id_msixpackage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MsixPackageId{} func TestNewMsixPackageID(t *testing.T) { - id := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") + id := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewMsixPackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'HostPoolName'", id.HostPoolName, "hostPoolName") } - if id.MsixPackageName != "msixPackageFullName" { - t.Fatalf("Expected %q but got %q for Segment 'MsixPackageName'", id.MsixPackageName, "msixPackageFullName") + if id.MsixPackageName != "msixPackageName" { + t.Fatalf("Expected %q but got %q for Segment 'MsixPackageName'", id.MsixPackageName, "msixPackageName") } } func TestFormatMsixPackageID(t *testing.T) { - actual := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName" + actual := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseMsixPackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostPoolName: "hostPoolName", - MsixPackageName: "msixPackageFullName", + MsixPackageName: "msixPackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseMsixPackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostPoolName: "hostPoolName", - MsixPackageName: "msixPackageFullName", + MsixPackageName: "msixPackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeFuLlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeNaMe", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", HostPoolName: "hOsTpOoLnAmE", - MsixPackageName: "mSiXpAcKaGeFuLlNaMe", + MsixPackageName: "mSiXpAcKaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeFuLlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/desktopvirtualization/2021-09-03-preview/sessionhost/constants.go b/resource-manager/desktopvirtualization/2021-09-03-preview/sessionhost/constants.go index cc6f0b936b1..d48400f37c2 100644 --- a/resource-manager/desktopvirtualization/2021-09-03-preview/sessionhost/constants.go +++ b/resource-manager/desktopvirtualization/2021-09-03-preview/sessionhost/constants.go @@ -21,7 +21,7 @@ const ( HealthCheckNameMonitoringAgentCheck HealthCheckName = "MonitoringAgentCheck" HealthCheckNameSupportedEncryptionCheck HealthCheckName = "SupportedEncryptionCheck" HealthCheckNameSxSStackListenerCheck HealthCheckName = "SxSStackListenerCheck" - HealthCheckNameUrlsAccessibleCheck HealthCheckName = "UrlsAccessibleCheck" + HealthCheckNameURLsAccessibleCheck HealthCheckName = "UrlsAccessibleCheck" HealthCheckNameWebRTCRedirectorCheck HealthCheckName = "WebRTCRedirectorCheck" ) @@ -36,7 +36,7 @@ func PossibleValuesForHealthCheckName() []string { string(HealthCheckNameMonitoringAgentCheck), string(HealthCheckNameSupportedEncryptionCheck), string(HealthCheckNameSxSStackListenerCheck), - string(HealthCheckNameUrlsAccessibleCheck), + string(HealthCheckNameURLsAccessibleCheck), string(HealthCheckNameWebRTCRedirectorCheck), } } @@ -65,7 +65,7 @@ func parseHealthCheckName(input string) (*HealthCheckName, error) { "monitoringagentcheck": HealthCheckNameMonitoringAgentCheck, "supportedencryptioncheck": HealthCheckNameSupportedEncryptionCheck, "sxsstacklistenercheck": HealthCheckNameSxSStackListenerCheck, - "urlsaccessiblecheck": HealthCheckNameUrlsAccessibleCheck, + "urlsaccessiblecheck": HealthCheckNameURLsAccessibleCheck, "webrtcredirectorcheck": HealthCheckNameWebRTCRedirectorCheck, } if v, ok := vals[strings.ToLower(input)]; ok { diff --git a/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/README.md b/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/README.md index 8a36afab495..7275484b521 100644 --- a/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/README.md +++ b/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") payload := msixpackage.MSIXPackage{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") payload := msixpackage.MSIXPackagePatch{ // ... diff --git a/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/id_msixpackage.go b/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/id_msixpackage.go index 4d2bc9427fc..f72e6d6f0f1 100644 --- a/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/id_msixpackage.go +++ b/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/id_msixpackage.go @@ -123,7 +123,7 @@ func (id MsixPackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticHostPools", "hostPools", "hostPools"), resourceids.UserSpecifiedSegment("hostPoolName", "hostPoolName"), resourceids.StaticSegment("staticMsixPackages", "msixPackages", "msixPackages"), - resourceids.UserSpecifiedSegment("msixPackageName", "msixPackageFullName"), + resourceids.UserSpecifiedSegment("msixPackageName", "msixPackageName"), } } diff --git a/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/id_msixpackage_test.go b/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/id_msixpackage_test.go index 6ea3717eef0..bea1658d0de 100644 --- a/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/id_msixpackage_test.go +++ b/resource-manager/desktopvirtualization/2022-02-10-preview/msixpackage/id_msixpackage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MsixPackageId{} func TestNewMsixPackageID(t *testing.T) { - id := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") + id := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewMsixPackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'HostPoolName'", id.HostPoolName, "hostPoolName") } - if id.MsixPackageName != "msixPackageFullName" { - t.Fatalf("Expected %q but got %q for Segment 'MsixPackageName'", id.MsixPackageName, "msixPackageFullName") + if id.MsixPackageName != "msixPackageName" { + t.Fatalf("Expected %q but got %q for Segment 'MsixPackageName'", id.MsixPackageName, "msixPackageName") } } func TestFormatMsixPackageID(t *testing.T) { - actual := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName" + actual := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseMsixPackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostPoolName: "hostPoolName", - MsixPackageName: "msixPackageFullName", + MsixPackageName: "msixPackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseMsixPackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostPoolName: "hostPoolName", - MsixPackageName: "msixPackageFullName", + MsixPackageName: "msixPackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeFuLlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeNaMe", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", HostPoolName: "hOsTpOoLnAmE", - MsixPackageName: "mSiXpAcKaGeFuLlNaMe", + MsixPackageName: "mSiXpAcKaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeFuLlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/desktopvirtualization/2022-02-10-preview/sessionhost/constants.go b/resource-manager/desktopvirtualization/2022-02-10-preview/sessionhost/constants.go index cc6f0b936b1..d48400f37c2 100644 --- a/resource-manager/desktopvirtualization/2022-02-10-preview/sessionhost/constants.go +++ b/resource-manager/desktopvirtualization/2022-02-10-preview/sessionhost/constants.go @@ -21,7 +21,7 @@ const ( HealthCheckNameMonitoringAgentCheck HealthCheckName = "MonitoringAgentCheck" HealthCheckNameSupportedEncryptionCheck HealthCheckName = "SupportedEncryptionCheck" HealthCheckNameSxSStackListenerCheck HealthCheckName = "SxSStackListenerCheck" - HealthCheckNameUrlsAccessibleCheck HealthCheckName = "UrlsAccessibleCheck" + HealthCheckNameURLsAccessibleCheck HealthCheckName = "UrlsAccessibleCheck" HealthCheckNameWebRTCRedirectorCheck HealthCheckName = "WebRTCRedirectorCheck" ) @@ -36,7 +36,7 @@ func PossibleValuesForHealthCheckName() []string { string(HealthCheckNameMonitoringAgentCheck), string(HealthCheckNameSupportedEncryptionCheck), string(HealthCheckNameSxSStackListenerCheck), - string(HealthCheckNameUrlsAccessibleCheck), + string(HealthCheckNameURLsAccessibleCheck), string(HealthCheckNameWebRTCRedirectorCheck), } } @@ -65,7 +65,7 @@ func parseHealthCheckName(input string) (*HealthCheckName, error) { "monitoringagentcheck": HealthCheckNameMonitoringAgentCheck, "supportedencryptioncheck": HealthCheckNameSupportedEncryptionCheck, "sxsstacklistenercheck": HealthCheckNameSxSStackListenerCheck, - "urlsaccessiblecheck": HealthCheckNameUrlsAccessibleCheck, + "urlsaccessiblecheck": HealthCheckNameURLsAccessibleCheck, "webrtcredirectorcheck": HealthCheckNameWebRTCRedirectorCheck, } if v, ok := vals[strings.ToLower(input)]; ok { diff --git a/resource-manager/desktopvirtualization/2022-09-09/msixpackage/README.md b/resource-manager/desktopvirtualization/2022-09-09/msixpackage/README.md index 882861d12d8..dd2807a5434 100644 --- a/resource-manager/desktopvirtualization/2022-09-09/msixpackage/README.md +++ b/resource-manager/desktopvirtualization/2022-09-09/msixpackage/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") payload := msixpackage.MSIXPackage{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") +id := msixpackage.NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") payload := msixpackage.MSIXPackagePatch{ // ... diff --git a/resource-manager/desktopvirtualization/2022-09-09/msixpackage/id_msixpackage.go b/resource-manager/desktopvirtualization/2022-09-09/msixpackage/id_msixpackage.go index 4d2bc9427fc..f72e6d6f0f1 100644 --- a/resource-manager/desktopvirtualization/2022-09-09/msixpackage/id_msixpackage.go +++ b/resource-manager/desktopvirtualization/2022-09-09/msixpackage/id_msixpackage.go @@ -123,7 +123,7 @@ func (id MsixPackageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticHostPools", "hostPools", "hostPools"), resourceids.UserSpecifiedSegment("hostPoolName", "hostPoolName"), resourceids.StaticSegment("staticMsixPackages", "msixPackages", "msixPackages"), - resourceids.UserSpecifiedSegment("msixPackageName", "msixPackageFullName"), + resourceids.UserSpecifiedSegment("msixPackageName", "msixPackageName"), } } diff --git a/resource-manager/desktopvirtualization/2022-09-09/msixpackage/id_msixpackage_test.go b/resource-manager/desktopvirtualization/2022-09-09/msixpackage/id_msixpackage_test.go index 6ea3717eef0..bea1658d0de 100644 --- a/resource-manager/desktopvirtualization/2022-09-09/msixpackage/id_msixpackage_test.go +++ b/resource-manager/desktopvirtualization/2022-09-09/msixpackage/id_msixpackage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MsixPackageId{} func TestNewMsixPackageID(t *testing.T) { - id := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName") + id := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewMsixPackageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'HostPoolName'", id.HostPoolName, "hostPoolName") } - if id.MsixPackageName != "msixPackageFullName" { - t.Fatalf("Expected %q but got %q for Segment 'MsixPackageName'", id.MsixPackageName, "msixPackageFullName") + if id.MsixPackageName != "msixPackageName" { + t.Fatalf("Expected %q but got %q for Segment 'MsixPackageName'", id.MsixPackageName, "msixPackageName") } } func TestFormatMsixPackageID(t *testing.T) { - actual := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageFullName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName" + actual := NewMsixPackageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostPoolName", "msixPackageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseMsixPackageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostPoolName: "hostPoolName", - MsixPackageName: "msixPackageFullName", + MsixPackageName: "msixPackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseMsixPackageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostPoolName: "hostPoolName", - MsixPackageName: "msixPackageFullName", + MsixPackageName: "msixPackageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageFullName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/hostPools/hostPoolName/msixPackages/msixPackageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeFuLlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeNaMe", Expected: &MsixPackageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", HostPoolName: "hOsTpOoLnAmE", - MsixPackageName: "mSiXpAcKaGeFuLlNaMe", + MsixPackageName: "mSiXpAcKaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeFuLlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/hOsTpOoLs/hOsTpOoLnAmE/mSiXpAcKaGeS/mSiXpAcKaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/README.md b/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/README.md index af4b2708dbd..b98ca46dc37 100644 --- a/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/README.md +++ b/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := scalingplanpooledschedule.NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "scalingPlanScheduleName") +id := scalingplanpooledschedule.NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "pooledScheduleName") payload := scalingplanpooledschedule.ScalingPlanPooledSchedule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scalingplanpooledschedule.NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "scalingPlanScheduleName") +id := scalingplanpooledschedule.NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "pooledScheduleName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scalingplanpooledschedule.NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "scalingPlanScheduleName") +id := scalingplanpooledschedule.NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "pooledScheduleName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := scalingplanpooledschedule.NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "scalingPlanScheduleName") +id := scalingplanpooledschedule.NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "pooledScheduleName") payload := scalingplanpooledschedule.ScalingPlanPooledSchedulePatch{ // ... diff --git a/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/id_pooledschedule.go b/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/id_pooledschedule.go index a9288a112e1..4e8f4e64453 100644 --- a/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/id_pooledschedule.go +++ b/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/id_pooledschedule.go @@ -123,7 +123,7 @@ func (id PooledScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticScalingPlans", "scalingPlans", "scalingPlans"), resourceids.UserSpecifiedSegment("scalingPlanName", "scalingPlanName"), resourceids.StaticSegment("staticPooledSchedules", "pooledSchedules", "pooledSchedules"), - resourceids.UserSpecifiedSegment("pooledScheduleName", "scalingPlanScheduleName"), + resourceids.UserSpecifiedSegment("pooledScheduleName", "pooledScheduleName"), } } diff --git a/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/id_pooledschedule_test.go b/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/id_pooledschedule_test.go index 89b038865a3..9ab45df15b4 100644 --- a/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/id_pooledschedule_test.go +++ b/resource-manager/desktopvirtualization/2022-09-09/scalingplanpooledschedule/id_pooledschedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PooledScheduleId{} func TestNewPooledScheduleID(t *testing.T) { - id := NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "scalingPlanScheduleName") + id := NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "pooledScheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPooledScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ScalingPlanName'", id.ScalingPlanName, "scalingPlanName") } - if id.PooledScheduleName != "scalingPlanScheduleName" { - t.Fatalf("Expected %q but got %q for Segment 'PooledScheduleName'", id.PooledScheduleName, "scalingPlanScheduleName") + if id.PooledScheduleName != "pooledScheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'PooledScheduleName'", id.PooledScheduleName, "pooledScheduleName") } } func TestFormatPooledScheduleID(t *testing.T) { - actual := NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "scalingPlanScheduleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/scalingPlanScheduleName" + actual := NewPooledScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scalingPlanName", "pooledScheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/pooledScheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePooledScheduleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/scalingPlanScheduleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/pooledScheduleName", Expected: &PooledScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ScalingPlanName: "scalingPlanName", - PooledScheduleName: "scalingPlanScheduleName", + PooledScheduleName: "pooledScheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/scalingPlanScheduleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/pooledScheduleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePooledScheduleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/scalingPlanScheduleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/pooledScheduleName", Expected: &PooledScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ScalingPlanName: "scalingPlanName", - PooledScheduleName: "scalingPlanScheduleName", + PooledScheduleName: "pooledScheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/scalingPlanScheduleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DesktopVirtualization/scalingPlans/scalingPlanName/pooledSchedules/pooledScheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/sCaLiNgPlAnS/sCaLiNgPlAnNaMe/pOoLeDsChEdUlEs/sCaLiNgPlAnScHeDuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/sCaLiNgPlAnS/sCaLiNgPlAnNaMe/pOoLeDsChEdUlEs/pOoLeDsChEdUlEnAmE", Expected: &PooledScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ScalingPlanName: "sCaLiNgPlAnNaMe", - PooledScheduleName: "sCaLiNgPlAnScHeDuLeNaMe", + PooledScheduleName: "pOoLeDsChEdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/sCaLiNgPlAnS/sCaLiNgPlAnNaMe/pOoLeDsChEdUlEs/sCaLiNgPlAnScHeDuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEsKtOpViRtUaLiZaTiOn/sCaLiNgPlAnS/sCaLiNgPlAnNaMe/pOoLeDsChEdUlEs/pOoLeDsChEdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/desktopvirtualization/2022-09-09/sessionhost/constants.go b/resource-manager/desktopvirtualization/2022-09-09/sessionhost/constants.go index cc6f0b936b1..d48400f37c2 100644 --- a/resource-manager/desktopvirtualization/2022-09-09/sessionhost/constants.go +++ b/resource-manager/desktopvirtualization/2022-09-09/sessionhost/constants.go @@ -21,7 +21,7 @@ const ( HealthCheckNameMonitoringAgentCheck HealthCheckName = "MonitoringAgentCheck" HealthCheckNameSupportedEncryptionCheck HealthCheckName = "SupportedEncryptionCheck" HealthCheckNameSxSStackListenerCheck HealthCheckName = "SxSStackListenerCheck" - HealthCheckNameUrlsAccessibleCheck HealthCheckName = "UrlsAccessibleCheck" + HealthCheckNameURLsAccessibleCheck HealthCheckName = "UrlsAccessibleCheck" HealthCheckNameWebRTCRedirectorCheck HealthCheckName = "WebRTCRedirectorCheck" ) @@ -36,7 +36,7 @@ func PossibleValuesForHealthCheckName() []string { string(HealthCheckNameMonitoringAgentCheck), string(HealthCheckNameSupportedEncryptionCheck), string(HealthCheckNameSxSStackListenerCheck), - string(HealthCheckNameUrlsAccessibleCheck), + string(HealthCheckNameURLsAccessibleCheck), string(HealthCheckNameWebRTCRedirectorCheck), } } @@ -65,7 +65,7 @@ func parseHealthCheckName(input string) (*HealthCheckName, error) { "monitoringagentcheck": HealthCheckNameMonitoringAgentCheck, "supportedencryptioncheck": HealthCheckNameSupportedEncryptionCheck, "sxsstacklistenercheck": HealthCheckNameSxSStackListenerCheck, - "urlsaccessiblecheck": HealthCheckNameUrlsAccessibleCheck, + "urlsaccessiblecheck": HealthCheckNameURLsAccessibleCheck, "webrtcredirectorcheck": HealthCheckNameWebRTCRedirectorCheck, } if v, ok := vals[strings.ToLower(input)]; ok { diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/README.md b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/README.md index b411e7ebf8b..b03f40a61a6 100644 --- a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/README.md +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/README.md @@ -20,6 +20,67 @@ client.Client.Authorizer = authorizer ``` +### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksCreateOrUpdate` + +```go +ctx := context.TODO() +id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName") + +payload := attachednetworkconnections.AttachedNetworkConnection{ + // ... +} + + +if err := client.AttachedNetworksCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksDelete` + +```go +ctx := context.TODO() +id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName") + +if err := client.AttachedNetworksDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksGetByDevCenter` + +```go +ctx := context.TODO() +id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName") + +read, err := client.AttachedNetworksGetByDevCenter(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksGetByProject` + +```go +ctx := context.TODO() +id := attachednetworkconnections.NewAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "attachedNetworkName") + +read, err := client.AttachedNetworksGetByProject(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + ### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksListByDevCenter` ```go diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_attachednetwork.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_attachednetwork.go new file mode 100644 index 00000000000..79cb32bc017 --- /dev/null +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_attachednetwork.go @@ -0,0 +1,139 @@ +package attachednetworkconnections + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&AttachedNetworkId{}) +} + +var _ resourceids.ResourceId = &AttachedNetworkId{} + +// AttachedNetworkId is a struct representing the Resource ID for a Attached Network +type AttachedNetworkId struct { + SubscriptionId string + ResourceGroupName string + ProjectName string + AttachedNetworkName string +} + +// NewAttachedNetworkID returns a new AttachedNetworkId struct +func NewAttachedNetworkID(subscriptionId string, resourceGroupName string, projectName string, attachedNetworkName string) AttachedNetworkId { + return AttachedNetworkId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ProjectName: projectName, + AttachedNetworkName: attachedNetworkName, + } +} + +// ParseAttachedNetworkID parses 'input' into a AttachedNetworkId +func ParseAttachedNetworkID(input string) (*AttachedNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&AttachedNetworkId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AttachedNetworkId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAttachedNetworkIDInsensitively parses 'input' case-insensitively into a AttachedNetworkId +// note: this method should only be used for API response data and not user input +func ParseAttachedNetworkIDInsensitively(input string) (*AttachedNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&AttachedNetworkId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AttachedNetworkId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AttachedNetworkId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ProjectName, ok = input.Parsed["projectName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "projectName", input) + } + + if id.AttachedNetworkName, ok = input.Parsed["attachedNetworkName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "attachedNetworkName", input) + } + + return nil +} + +// ValidateAttachedNetworkID checks that 'input' can be parsed as a Attached Network ID +func ValidateAttachedNetworkID(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 := ParseAttachedNetworkID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Attached Network ID +func (id AttachedNetworkId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DevCenter/projects/%s/attachedNetworks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ProjectName, id.AttachedNetworkName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Attached Network ID +func (id AttachedNetworkId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDevCenter", "Microsoft.DevCenter", "Microsoft.DevCenter"), + resourceids.StaticSegment("staticProjects", "projects", "projects"), + resourceids.UserSpecifiedSegment("projectName", "projectName"), + resourceids.StaticSegment("staticAttachedNetworks", "attachedNetworks", "attachedNetworks"), + resourceids.UserSpecifiedSegment("attachedNetworkName", "attachedNetworkName"), + } +} + +// String returns a human-readable description of this Attached Network ID +func (id AttachedNetworkId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Project Name: %q", id.ProjectName), + fmt.Sprintf("Attached Network Name: %q", id.AttachedNetworkName), + } + return fmt.Sprintf("Attached Network (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_attachednetwork_test.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_attachednetwork_test.go new file mode 100644 index 00000000000..7949d91be97 --- /dev/null +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_attachednetwork_test.go @@ -0,0 +1,327 @@ +package attachednetworkconnections + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &AttachedNetworkId{} + +func TestNewAttachedNetworkID(t *testing.T) { + id := NewAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "attachedNetworkName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.ProjectName != "projectName" { + t.Fatalf("Expected %q but got %q for Segment 'ProjectName'", id.ProjectName, "projectName") + } + + if id.AttachedNetworkName != "attachedNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'AttachedNetworkName'", id.AttachedNetworkName, "attachedNetworkName") + } +} + +func TestFormatAttachedNetworkID(t *testing.T) { + actual := NewAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "attachedNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseAttachedNetworkID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *AttachedNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName", + Expected: &AttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ProjectName: "projectName", + AttachedNetworkName: "attachedNetworkName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseAttachedNetworkID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ProjectName != v.Expected.ProjectName { + t.Fatalf("Expected %q but got %q for ProjectName", v.Expected.ProjectName, actual.ProjectName) + } + + if actual.AttachedNetworkName != v.Expected.AttachedNetworkName { + t.Fatalf("Expected %q but got %q for AttachedNetworkName", v.Expected.AttachedNetworkName, actual.AttachedNetworkName) + } + + } +} + +func TestParseAttachedNetworkIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *AttachedNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aTtAcHeDnEtWoRkS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName", + Expected: &AttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ProjectName: "projectName", + AttachedNetworkName: "attachedNetworkName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aTtAcHeDnEtWoRkS/aTtAcHeDnEtWoRkNaMe", + Expected: &AttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ProjectName: "pRoJeCtNaMe", + AttachedNetworkName: "aTtAcHeDnEtWoRkNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aTtAcHeDnEtWoRkS/aTtAcHeDnEtWoRkNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseAttachedNetworkIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ProjectName != v.Expected.ProjectName { + t.Fatalf("Expected %q but got %q for ProjectName", v.Expected.ProjectName, actual.ProjectName) + } + + if actual.AttachedNetworkName != v.Expected.AttachedNetworkName { + t.Fatalf("Expected %q but got %q for AttachedNetworkName", v.Expected.AttachedNetworkName, actual.AttachedNetworkName) + } + + } +} + +func TestSegmentsForAttachedNetworkId(t *testing.T) { + segments := AttachedNetworkId{}.Segments() + if len(segments) == 0 { + t.Fatalf("AttachedNetworkId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_devcenterattachednetwork.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_devcenterattachednetwork.go new file mode 100644 index 00000000000..e5f67841fd2 --- /dev/null +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_devcenterattachednetwork.go @@ -0,0 +1,139 @@ +package attachednetworkconnections + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&DevCenterAttachedNetworkId{}) +} + +var _ resourceids.ResourceId = &DevCenterAttachedNetworkId{} + +// DevCenterAttachedNetworkId is a struct representing the Resource ID for a Dev Center Attached Network +type DevCenterAttachedNetworkId struct { + SubscriptionId string + ResourceGroupName string + DevCenterName string + AttachedNetworkName string +} + +// NewDevCenterAttachedNetworkID returns a new DevCenterAttachedNetworkId struct +func NewDevCenterAttachedNetworkID(subscriptionId string, resourceGroupName string, devCenterName string, attachedNetworkName string) DevCenterAttachedNetworkId { + return DevCenterAttachedNetworkId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DevCenterName: devCenterName, + AttachedNetworkName: attachedNetworkName, + } +} + +// ParseDevCenterAttachedNetworkID parses 'input' into a DevCenterAttachedNetworkId +func ParseDevCenterAttachedNetworkID(input string) (*DevCenterAttachedNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&DevCenterAttachedNetworkId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DevCenterAttachedNetworkId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDevCenterAttachedNetworkIDInsensitively parses 'input' case-insensitively into a DevCenterAttachedNetworkId +// note: this method should only be used for API response data and not user input +func ParseDevCenterAttachedNetworkIDInsensitively(input string) (*DevCenterAttachedNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&DevCenterAttachedNetworkId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DevCenterAttachedNetworkId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DevCenterAttachedNetworkId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.DevCenterName, ok = input.Parsed["devCenterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "devCenterName", input) + } + + if id.AttachedNetworkName, ok = input.Parsed["attachedNetworkName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "attachedNetworkName", input) + } + + return nil +} + +// ValidateDevCenterAttachedNetworkID checks that 'input' can be parsed as a Dev Center Attached Network ID +func ValidateDevCenterAttachedNetworkID(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 := ParseDevCenterAttachedNetworkID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Dev Center Attached Network ID +func (id DevCenterAttachedNetworkId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DevCenter/devCenters/%s/attachedNetworks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DevCenterName, id.AttachedNetworkName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Dev Center Attached Network ID +func (id DevCenterAttachedNetworkId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDevCenter", "Microsoft.DevCenter", "Microsoft.DevCenter"), + resourceids.StaticSegment("staticDevCenters", "devCenters", "devCenters"), + resourceids.UserSpecifiedSegment("devCenterName", "devCenterName"), + resourceids.StaticSegment("staticAttachedNetworks", "attachedNetworks", "attachedNetworks"), + resourceids.UserSpecifiedSegment("attachedNetworkName", "attachedNetworkName"), + } +} + +// String returns a human-readable description of this Dev Center Attached Network ID +func (id DevCenterAttachedNetworkId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Dev Center Name: %q", id.DevCenterName), + fmt.Sprintf("Attached Network Name: %q", id.AttachedNetworkName), + } + return fmt.Sprintf("Dev Center Attached Network (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_devcenterattachednetwork_test.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_devcenterattachednetwork_test.go new file mode 100644 index 00000000000..7bc32d5d1e4 --- /dev/null +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/id_devcenterattachednetwork_test.go @@ -0,0 +1,327 @@ +package attachednetworkconnections + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &DevCenterAttachedNetworkId{} + +func TestNewDevCenterAttachedNetworkID(t *testing.T) { + id := NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.DevCenterName != "devCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'DevCenterName'", id.DevCenterName, "devCenterName") + } + + if id.AttachedNetworkName != "attachedNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'AttachedNetworkName'", id.AttachedNetworkName, "attachedNetworkName") + } +} + +func TestFormatDevCenterAttachedNetworkID(t *testing.T) { + actual := NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseDevCenterAttachedNetworkID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *DevCenterAttachedNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName", + Expected: &DevCenterAttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + DevCenterName: "devCenterName", + AttachedNetworkName: "attachedNetworkName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseDevCenterAttachedNetworkID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.DevCenterName != v.Expected.DevCenterName { + t.Fatalf("Expected %q but got %q for DevCenterName", v.Expected.DevCenterName, actual.DevCenterName) + } + + if actual.AttachedNetworkName != v.Expected.AttachedNetworkName { + t.Fatalf("Expected %q but got %q for AttachedNetworkName", v.Expected.AttachedNetworkName, actual.AttachedNetworkName) + } + + } +} + +func TestParseDevCenterAttachedNetworkIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *DevCenterAttachedNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS/dEvCeNtErNaMe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS/dEvCeNtErNaMe/aTtAcHeDnEtWoRkS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName", + Expected: &DevCenterAttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + DevCenterName: "devCenterName", + AttachedNetworkName: "attachedNetworkName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS/dEvCeNtErNaMe/aTtAcHeDnEtWoRkS/aTtAcHeDnEtWoRkNaMe", + Expected: &DevCenterAttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + DevCenterName: "dEvCeNtErNaMe", + AttachedNetworkName: "aTtAcHeDnEtWoRkNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS/dEvCeNtErNaMe/aTtAcHeDnEtWoRkS/aTtAcHeDnEtWoRkNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseDevCenterAttachedNetworkIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.DevCenterName != v.Expected.DevCenterName { + t.Fatalf("Expected %q but got %q for DevCenterName", v.Expected.DevCenterName, actual.DevCenterName) + } + + if actual.AttachedNetworkName != v.Expected.AttachedNetworkName { + t.Fatalf("Expected %q but got %q for AttachedNetworkName", v.Expected.AttachedNetworkName, actual.AttachedNetworkName) + } + + } +} + +func TestSegmentsForDevCenterAttachedNetworkId(t *testing.T) { + segments := DevCenterAttachedNetworkId{}.Segments() + if len(segments) == 0 { + t.Fatalf("DevCenterAttachedNetworkId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkscreateorupdate.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkscreateorupdate.go new file mode 100644 index 00000000000..a0a3b44d179 --- /dev/null +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkscreateorupdate.go @@ -0,0 +1,74 @@ +package attachednetworkconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttachedNetworksCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AttachedNetworkConnection +} + +// AttachedNetworksCreateOrUpdate ... +func (c AttachedNetworkConnectionsClient) AttachedNetworksCreateOrUpdate(ctx context.Context, id DevCenterAttachedNetworkId, input AttachedNetworkConnection) (result AttachedNetworksCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AttachedNetworksCreateOrUpdateThenPoll performs AttachedNetworksCreateOrUpdate then polls until it's completed +func (c AttachedNetworkConnectionsClient) AttachedNetworksCreateOrUpdateThenPoll(ctx context.Context, id DevCenterAttachedNetworkId, input AttachedNetworkConnection) error { + result, err := c.AttachedNetworksCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AttachedNetworksCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AttachedNetworksCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksdelete.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksdelete.go new file mode 100644 index 00000000000..2ca549594c9 --- /dev/null +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksdelete.go @@ -0,0 +1,71 @@ +package attachednetworkconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttachedNetworksDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// AttachedNetworksDelete ... +func (c AttachedNetworkConnectionsClient) AttachedNetworksDelete(ctx context.Context, id DevCenterAttachedNetworkId) (result AttachedNetworksDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AttachedNetworksDeleteThenPoll performs AttachedNetworksDelete then polls until it's completed +func (c AttachedNetworkConnectionsClient) AttachedNetworksDeleteThenPoll(ctx context.Context, id DevCenterAttachedNetworkId) error { + result, err := c.AttachedNetworksDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing AttachedNetworksDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AttachedNetworksDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksgetbydevcenter.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksgetbydevcenter.go new file mode 100644 index 00000000000..7196816ecfd --- /dev/null +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksgetbydevcenter.go @@ -0,0 +1,53 @@ +package attachednetworkconnections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttachedNetworksGetByDevCenterOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AttachedNetworkConnection +} + +// AttachedNetworksGetByDevCenter ... +func (c AttachedNetworkConnectionsClient) AttachedNetworksGetByDevCenter(ctx context.Context, id DevCenterAttachedNetworkId) (result AttachedNetworksGetByDevCenterOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model AttachedNetworkConnection + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksgetbyproject.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksgetbyproject.go new file mode 100644 index 00000000000..f6c9f99c2af --- /dev/null +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworksgetbyproject.go @@ -0,0 +1,53 @@ +package attachednetworkconnections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttachedNetworksGetByProjectOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AttachedNetworkConnection +} + +// AttachedNetworksGetByProject ... +func (c AttachedNetworkConnectionsClient) AttachedNetworksGetByProject(ctx context.Context, id AttachedNetworkId) (result AttachedNetworksGetByProjectOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model AttachedNetworkConnection + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkslistbydevcenter.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkslistbydevcenter.go index 33befb6558b..84d9a78aa72 100644 --- a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkslistbydevcenter.go +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkslistbydevcenter.go @@ -73,7 +73,7 @@ func (c AttachedNetworkConnectionsClient) AttachedNetworksListByDevCenter(ctx co HttpMethod: http.MethodGet, OptionsObject: options, Pager: &AttachedNetworksListByDevCenterCustomPager{}, - Path: fmt.Sprintf("%s/attachednetworks", id.ID()), + Path: fmt.Sprintf("%s/attachedNetworks", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) diff --git a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkslistbyproject.go b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkslistbyproject.go index 9b9a721d6dc..d729378d3ac 100644 --- a/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkslistbyproject.go +++ b/resource-manager/devcenter/2023-04-01/attachednetworkconnections/method_attachednetworkslistbyproject.go @@ -73,7 +73,7 @@ func (c AttachedNetworkConnectionsClient) AttachedNetworksListByProject(ctx cont HttpMethod: http.MethodGet, OptionsObject: options, Pager: &AttachedNetworksListByProjectCustomPager{}, - Path: fmt.Sprintf("%s/attachednetworks", id.ID()), + Path: fmt.Sprintf("%s/attachedNetworks", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) diff --git a/resource-manager/devcenter/2023-04-01/environmenttypes/README.md b/resource-manager/devcenter/2023-04-01/environmenttypes/README.md index 6bbeb3c0342..90254e4b91d 100644 --- a/resource-manager/devcenter/2023-04-01/environmenttypes/README.md +++ b/resource-manager/devcenter/2023-04-01/environmenttypes/README.md @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := environmenttypes.NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "environmentTypeName") +id := environmenttypes.NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "allowedEnvironmentTypeName") read, err := client.ProjectAllowedEnvironmentTypesGet(ctx, id) if err != nil { diff --git a/resource-manager/devcenter/2023-04-01/environmenttypes/id_allowedenvironmenttype.go b/resource-manager/devcenter/2023-04-01/environmenttypes/id_allowedenvironmenttype.go index 215741c4b78..f96b6503a61 100644 --- a/resource-manager/devcenter/2023-04-01/environmenttypes/id_allowedenvironmenttype.go +++ b/resource-manager/devcenter/2023-04-01/environmenttypes/id_allowedenvironmenttype.go @@ -123,7 +123,7 @@ func (id AllowedEnvironmentTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProjects", "projects", "projects"), resourceids.UserSpecifiedSegment("projectName", "projectName"), resourceids.StaticSegment("staticAllowedEnvironmentTypes", "allowedEnvironmentTypes", "allowedEnvironmentTypes"), - resourceids.UserSpecifiedSegment("allowedEnvironmentTypeName", "environmentTypeName"), + resourceids.UserSpecifiedSegment("allowedEnvironmentTypeName", "allowedEnvironmentTypeName"), } } diff --git a/resource-manager/devcenter/2023-04-01/environmenttypes/id_allowedenvironmenttype_test.go b/resource-manager/devcenter/2023-04-01/environmenttypes/id_allowedenvironmenttype_test.go index 7e98ca54606..60bda5082ca 100644 --- a/resource-manager/devcenter/2023-04-01/environmenttypes/id_allowedenvironmenttype_test.go +++ b/resource-manager/devcenter/2023-04-01/environmenttypes/id_allowedenvironmenttype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AllowedEnvironmentTypeId{} func TestNewAllowedEnvironmentTypeID(t *testing.T) { - id := NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "environmentTypeName") + id := NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "allowedEnvironmentTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAllowedEnvironmentTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProjectName'", id.ProjectName, "projectName") } - if id.AllowedEnvironmentTypeName != "environmentTypeName" { - t.Fatalf("Expected %q but got %q for Segment 'AllowedEnvironmentTypeName'", id.AllowedEnvironmentTypeName, "environmentTypeName") + if id.AllowedEnvironmentTypeName != "allowedEnvironmentTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'AllowedEnvironmentTypeName'", id.AllowedEnvironmentTypeName, "allowedEnvironmentTypeName") } } func TestFormatAllowedEnvironmentTypeID(t *testing.T) { - actual := NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "environmentTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName" + actual := NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "allowedEnvironmentTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAllowedEnvironmentTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName", Expected: &AllowedEnvironmentTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProjectName: "projectName", - AllowedEnvironmentTypeName: "environmentTypeName", + AllowedEnvironmentTypeName: "allowedEnvironmentTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAllowedEnvironmentTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName", Expected: &AllowedEnvironmentTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProjectName: "projectName", - AllowedEnvironmentTypeName: "environmentTypeName", + AllowedEnvironmentTypeName: "allowedEnvironmentTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aLlOwEdEnViRoNmEnTtYpEs/eNvIrOnMeNtTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aLlOwEdEnViRoNmEnTtYpEs/aLlOwEdEnViRoNmEnTtYpEnAmE", Expected: &AllowedEnvironmentTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ProjectName: "pRoJeCtNaMe", - AllowedEnvironmentTypeName: "eNvIrOnMeNtTyPeNaMe", + AllowedEnvironmentTypeName: "aLlOwEdEnViRoNmEnTtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aLlOwEdEnViRoNmEnTtYpEs/eNvIrOnMeNtTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aLlOwEdEnViRoNmEnTtYpEs/aLlOwEdEnViRoNmEnTtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devcenter/2023-04-01/usages/README.md b/resource-manager/devcenter/2023-04-01/usages/README.md index 539780157d2..77e28f15958 100644 --- a/resource-manager/devcenter/2023-04-01/usages/README.md +++ b/resource-manager/devcenter/2023-04-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/devcenter/2023-04-01/usages/id_location.go b/resource-manager/devcenter/2023-04-01/usages/id_location.go index 5a93fab23d6..0ac59b158f8 100644 --- a/resource-manager/devcenter/2023-04-01/usages/id_location.go +++ b/resource-manager/devcenter/2023-04-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevCenter", "Microsoft.DevCenter", "Microsoft.DevCenter"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/devcenter/2023-04-01/usages/id_location_test.go b/resource-manager/devcenter/2023-04-01/usages/id_location_test.go index 375fc1a49b6..d24316d5aef 100644 --- a/resource-manager/devcenter/2023-04-01/usages/id_location_test.go +++ b/resource-manager/devcenter/2023-04-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/README.md b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/README.md index 7aa459e6064..0777a589d64 100644 --- a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/README.md +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/README.md @@ -20,6 +20,67 @@ client.Client.Authorizer = authorizer ``` +### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksCreateOrUpdate` + +```go +ctx := context.TODO() +id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName") + +payload := attachednetworkconnections.AttachedNetworkConnection{ + // ... +} + + +if err := client.AttachedNetworksCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksDelete` + +```go +ctx := context.TODO() +id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName") + +if err := client.AttachedNetworksDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksGetByDevCenter` + +```go +ctx := context.TODO() +id := attachednetworkconnections.NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName") + +read, err := client.AttachedNetworksGetByDevCenter(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksGetByProject` + +```go +ctx := context.TODO() +id := attachednetworkconnections.NewAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "attachedNetworkName") + +read, err := client.AttachedNetworksGetByProject(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + ### Example Usage: `AttachedNetworkConnectionsClient.AttachedNetworksListByDevCenter` ```go diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_attachednetwork.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_attachednetwork.go new file mode 100644 index 00000000000..79cb32bc017 --- /dev/null +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_attachednetwork.go @@ -0,0 +1,139 @@ +package attachednetworkconnections + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&AttachedNetworkId{}) +} + +var _ resourceids.ResourceId = &AttachedNetworkId{} + +// AttachedNetworkId is a struct representing the Resource ID for a Attached Network +type AttachedNetworkId struct { + SubscriptionId string + ResourceGroupName string + ProjectName string + AttachedNetworkName string +} + +// NewAttachedNetworkID returns a new AttachedNetworkId struct +func NewAttachedNetworkID(subscriptionId string, resourceGroupName string, projectName string, attachedNetworkName string) AttachedNetworkId { + return AttachedNetworkId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ProjectName: projectName, + AttachedNetworkName: attachedNetworkName, + } +} + +// ParseAttachedNetworkID parses 'input' into a AttachedNetworkId +func ParseAttachedNetworkID(input string) (*AttachedNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&AttachedNetworkId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AttachedNetworkId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAttachedNetworkIDInsensitively parses 'input' case-insensitively into a AttachedNetworkId +// note: this method should only be used for API response data and not user input +func ParseAttachedNetworkIDInsensitively(input string) (*AttachedNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&AttachedNetworkId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AttachedNetworkId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AttachedNetworkId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.ProjectName, ok = input.Parsed["projectName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "projectName", input) + } + + if id.AttachedNetworkName, ok = input.Parsed["attachedNetworkName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "attachedNetworkName", input) + } + + return nil +} + +// ValidateAttachedNetworkID checks that 'input' can be parsed as a Attached Network ID +func ValidateAttachedNetworkID(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 := ParseAttachedNetworkID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Attached Network ID +func (id AttachedNetworkId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DevCenter/projects/%s/attachedNetworks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ProjectName, id.AttachedNetworkName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Attached Network ID +func (id AttachedNetworkId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDevCenter", "Microsoft.DevCenter", "Microsoft.DevCenter"), + resourceids.StaticSegment("staticProjects", "projects", "projects"), + resourceids.UserSpecifiedSegment("projectName", "projectName"), + resourceids.StaticSegment("staticAttachedNetworks", "attachedNetworks", "attachedNetworks"), + resourceids.UserSpecifiedSegment("attachedNetworkName", "attachedNetworkName"), + } +} + +// String returns a human-readable description of this Attached Network ID +func (id AttachedNetworkId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Project Name: %q", id.ProjectName), + fmt.Sprintf("Attached Network Name: %q", id.AttachedNetworkName), + } + return fmt.Sprintf("Attached Network (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_attachednetwork_test.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_attachednetwork_test.go new file mode 100644 index 00000000000..7949d91be97 --- /dev/null +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_attachednetwork_test.go @@ -0,0 +1,327 @@ +package attachednetworkconnections + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &AttachedNetworkId{} + +func TestNewAttachedNetworkID(t *testing.T) { + id := NewAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "attachedNetworkName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.ProjectName != "projectName" { + t.Fatalf("Expected %q but got %q for Segment 'ProjectName'", id.ProjectName, "projectName") + } + + if id.AttachedNetworkName != "attachedNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'AttachedNetworkName'", id.AttachedNetworkName, "attachedNetworkName") + } +} + +func TestFormatAttachedNetworkID(t *testing.T) { + actual := NewAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "attachedNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseAttachedNetworkID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *AttachedNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName", + Expected: &AttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ProjectName: "projectName", + AttachedNetworkName: "attachedNetworkName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseAttachedNetworkID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ProjectName != v.Expected.ProjectName { + t.Fatalf("Expected %q but got %q for ProjectName", v.Expected.ProjectName, actual.ProjectName) + } + + if actual.AttachedNetworkName != v.Expected.AttachedNetworkName { + t.Fatalf("Expected %q but got %q for AttachedNetworkName", v.Expected.AttachedNetworkName, actual.AttachedNetworkName) + } + + } +} + +func TestParseAttachedNetworkIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *AttachedNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aTtAcHeDnEtWoRkS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName", + Expected: &AttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ProjectName: "projectName", + AttachedNetworkName: "attachedNetworkName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/attachedNetworks/attachedNetworkName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aTtAcHeDnEtWoRkS/aTtAcHeDnEtWoRkNaMe", + Expected: &AttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ProjectName: "pRoJeCtNaMe", + AttachedNetworkName: "aTtAcHeDnEtWoRkNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aTtAcHeDnEtWoRkS/aTtAcHeDnEtWoRkNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseAttachedNetworkIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.ProjectName != v.Expected.ProjectName { + t.Fatalf("Expected %q but got %q for ProjectName", v.Expected.ProjectName, actual.ProjectName) + } + + if actual.AttachedNetworkName != v.Expected.AttachedNetworkName { + t.Fatalf("Expected %q but got %q for AttachedNetworkName", v.Expected.AttachedNetworkName, actual.AttachedNetworkName) + } + + } +} + +func TestSegmentsForAttachedNetworkId(t *testing.T) { + segments := AttachedNetworkId{}.Segments() + if len(segments) == 0 { + t.Fatalf("AttachedNetworkId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_devcenterattachednetwork.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_devcenterattachednetwork.go new file mode 100644 index 00000000000..e5f67841fd2 --- /dev/null +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_devcenterattachednetwork.go @@ -0,0 +1,139 @@ +package attachednetworkconnections + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&DevCenterAttachedNetworkId{}) +} + +var _ resourceids.ResourceId = &DevCenterAttachedNetworkId{} + +// DevCenterAttachedNetworkId is a struct representing the Resource ID for a Dev Center Attached Network +type DevCenterAttachedNetworkId struct { + SubscriptionId string + ResourceGroupName string + DevCenterName string + AttachedNetworkName string +} + +// NewDevCenterAttachedNetworkID returns a new DevCenterAttachedNetworkId struct +func NewDevCenterAttachedNetworkID(subscriptionId string, resourceGroupName string, devCenterName string, attachedNetworkName string) DevCenterAttachedNetworkId { + return DevCenterAttachedNetworkId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DevCenterName: devCenterName, + AttachedNetworkName: attachedNetworkName, + } +} + +// ParseDevCenterAttachedNetworkID parses 'input' into a DevCenterAttachedNetworkId +func ParseDevCenterAttachedNetworkID(input string) (*DevCenterAttachedNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&DevCenterAttachedNetworkId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DevCenterAttachedNetworkId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDevCenterAttachedNetworkIDInsensitively parses 'input' case-insensitively into a DevCenterAttachedNetworkId +// note: this method should only be used for API response data and not user input +func ParseDevCenterAttachedNetworkIDInsensitively(input string) (*DevCenterAttachedNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&DevCenterAttachedNetworkId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DevCenterAttachedNetworkId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DevCenterAttachedNetworkId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.DevCenterName, ok = input.Parsed["devCenterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "devCenterName", input) + } + + if id.AttachedNetworkName, ok = input.Parsed["attachedNetworkName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "attachedNetworkName", input) + } + + return nil +} + +// ValidateDevCenterAttachedNetworkID checks that 'input' can be parsed as a Dev Center Attached Network ID +func ValidateDevCenterAttachedNetworkID(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 := ParseDevCenterAttachedNetworkID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Dev Center Attached Network ID +func (id DevCenterAttachedNetworkId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DevCenter/devCenters/%s/attachedNetworks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DevCenterName, id.AttachedNetworkName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Dev Center Attached Network ID +func (id DevCenterAttachedNetworkId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftDevCenter", "Microsoft.DevCenter", "Microsoft.DevCenter"), + resourceids.StaticSegment("staticDevCenters", "devCenters", "devCenters"), + resourceids.UserSpecifiedSegment("devCenterName", "devCenterName"), + resourceids.StaticSegment("staticAttachedNetworks", "attachedNetworks", "attachedNetworks"), + resourceids.UserSpecifiedSegment("attachedNetworkName", "attachedNetworkName"), + } +} + +// String returns a human-readable description of this Dev Center Attached Network ID +func (id DevCenterAttachedNetworkId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Dev Center Name: %q", id.DevCenterName), + fmt.Sprintf("Attached Network Name: %q", id.AttachedNetworkName), + } + return fmt.Sprintf("Dev Center Attached Network (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_devcenterattachednetwork_test.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_devcenterattachednetwork_test.go new file mode 100644 index 00000000000..7bc32d5d1e4 --- /dev/null +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/id_devcenterattachednetwork_test.go @@ -0,0 +1,327 @@ +package attachednetworkconnections + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &DevCenterAttachedNetworkId{} + +func TestNewDevCenterAttachedNetworkID(t *testing.T) { + id := NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.DevCenterName != "devCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'DevCenterName'", id.DevCenterName, "devCenterName") + } + + if id.AttachedNetworkName != "attachedNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'AttachedNetworkName'", id.AttachedNetworkName, "attachedNetworkName") + } +} + +func TestFormatDevCenterAttachedNetworkID(t *testing.T) { + actual := NewDevCenterAttachedNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "devCenterName", "attachedNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseDevCenterAttachedNetworkID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *DevCenterAttachedNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName", + Expected: &DevCenterAttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + DevCenterName: "devCenterName", + AttachedNetworkName: "attachedNetworkName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseDevCenterAttachedNetworkID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.DevCenterName != v.Expected.DevCenterName { + t.Fatalf("Expected %q but got %q for DevCenterName", v.Expected.DevCenterName, actual.DevCenterName) + } + + if actual.AttachedNetworkName != v.Expected.AttachedNetworkName { + t.Fatalf("Expected %q but got %q for AttachedNetworkName", v.Expected.AttachedNetworkName, actual.AttachedNetworkName) + } + + } +} + +func TestParseDevCenterAttachedNetworkIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *DevCenterAttachedNetworkId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS/dEvCeNtErNaMe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS/dEvCeNtErNaMe/aTtAcHeDnEtWoRkS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName", + Expected: &DevCenterAttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + DevCenterName: "devCenterName", + AttachedNetworkName: "attachedNetworkName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/devCenters/devCenterName/attachedNetworks/attachedNetworkName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS/dEvCeNtErNaMe/aTtAcHeDnEtWoRkS/aTtAcHeDnEtWoRkNaMe", + Expected: &DevCenterAttachedNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + DevCenterName: "dEvCeNtErNaMe", + AttachedNetworkName: "aTtAcHeDnEtWoRkNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/dEvCeNtErS/dEvCeNtErNaMe/aTtAcHeDnEtWoRkS/aTtAcHeDnEtWoRkNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseDevCenterAttachedNetworkIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.DevCenterName != v.Expected.DevCenterName { + t.Fatalf("Expected %q but got %q for DevCenterName", v.Expected.DevCenterName, actual.DevCenterName) + } + + if actual.AttachedNetworkName != v.Expected.AttachedNetworkName { + t.Fatalf("Expected %q but got %q for AttachedNetworkName", v.Expected.AttachedNetworkName, actual.AttachedNetworkName) + } + + } +} + +func TestSegmentsForDevCenterAttachedNetworkId(t *testing.T) { + segments := DevCenterAttachedNetworkId{}.Segments() + if len(segments) == 0 { + t.Fatalf("DevCenterAttachedNetworkId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkscreateorupdate.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkscreateorupdate.go new file mode 100644 index 00000000000..1df2d1ad832 --- /dev/null +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkscreateorupdate.go @@ -0,0 +1,75 @@ +package attachednetworkconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttachedNetworksCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AttachedNetworkConnection +} + +// AttachedNetworksCreateOrUpdate ... +func (c AttachedNetworkConnectionsClient) AttachedNetworksCreateOrUpdate(ctx context.Context, id DevCenterAttachedNetworkId, input AttachedNetworkConnection) (result AttachedNetworksCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AttachedNetworksCreateOrUpdateThenPoll performs AttachedNetworksCreateOrUpdate then polls until it's completed +func (c AttachedNetworkConnectionsClient) AttachedNetworksCreateOrUpdateThenPoll(ctx context.Context, id DevCenterAttachedNetworkId, input AttachedNetworkConnection) error { + result, err := c.AttachedNetworksCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AttachedNetworksCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AttachedNetworksCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksdelete.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksdelete.go new file mode 100644 index 00000000000..2338eca4c73 --- /dev/null +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksdelete.go @@ -0,0 +1,70 @@ +package attachednetworkconnections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttachedNetworksDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// AttachedNetworksDelete ... +func (c AttachedNetworkConnectionsClient) AttachedNetworksDelete(ctx context.Context, id DevCenterAttachedNetworkId) (result AttachedNetworksDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AttachedNetworksDeleteThenPoll performs AttachedNetworksDelete then polls until it's completed +func (c AttachedNetworkConnectionsClient) AttachedNetworksDeleteThenPoll(ctx context.Context, id DevCenterAttachedNetworkId) error { + result, err := c.AttachedNetworksDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing AttachedNetworksDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AttachedNetworksDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksgetbydevcenter.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksgetbydevcenter.go new file mode 100644 index 00000000000..7196816ecfd --- /dev/null +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksgetbydevcenter.go @@ -0,0 +1,53 @@ +package attachednetworkconnections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttachedNetworksGetByDevCenterOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AttachedNetworkConnection +} + +// AttachedNetworksGetByDevCenter ... +func (c AttachedNetworkConnectionsClient) AttachedNetworksGetByDevCenter(ctx context.Context, id DevCenterAttachedNetworkId) (result AttachedNetworksGetByDevCenterOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model AttachedNetworkConnection + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksgetbyproject.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksgetbyproject.go new file mode 100644 index 00000000000..f6c9f99c2af --- /dev/null +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworksgetbyproject.go @@ -0,0 +1,53 @@ +package attachednetworkconnections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AttachedNetworksGetByProjectOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AttachedNetworkConnection +} + +// AttachedNetworksGetByProject ... +func (c AttachedNetworkConnectionsClient) AttachedNetworksGetByProject(ctx context.Context, id AttachedNetworkId) (result AttachedNetworksGetByProjectOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model AttachedNetworkConnection + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkslistbydevcenter.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkslistbydevcenter.go index 33befb6558b..84d9a78aa72 100644 --- a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkslistbydevcenter.go +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkslistbydevcenter.go @@ -73,7 +73,7 @@ func (c AttachedNetworkConnectionsClient) AttachedNetworksListByDevCenter(ctx co HttpMethod: http.MethodGet, OptionsObject: options, Pager: &AttachedNetworksListByDevCenterCustomPager{}, - Path: fmt.Sprintf("%s/attachednetworks", id.ID()), + Path: fmt.Sprintf("%s/attachedNetworks", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) diff --git a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkslistbyproject.go b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkslistbyproject.go index 9b9a721d6dc..d729378d3ac 100644 --- a/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkslistbyproject.go +++ b/resource-manager/devcenter/2024-02-01/attachednetworkconnections/method_attachednetworkslistbyproject.go @@ -73,7 +73,7 @@ func (c AttachedNetworkConnectionsClient) AttachedNetworksListByProject(ctx cont HttpMethod: http.MethodGet, OptionsObject: options, Pager: &AttachedNetworksListByProjectCustomPager{}, - Path: fmt.Sprintf("%s/attachednetworks", id.ID()), + Path: fmt.Sprintf("%s/attachedNetworks", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) diff --git a/resource-manager/devcenter/2024-02-01/devcenters/model_customermanagedkeyencryption.go b/resource-manager/devcenter/2024-02-01/devcenters/model_customermanagedkeyencryption.go index 4b41a19c823..74b20f184a6 100644 --- a/resource-manager/devcenter/2024-02-01/devcenters/model_customermanagedkeyencryption.go +++ b/resource-manager/devcenter/2024-02-01/devcenters/model_customermanagedkeyencryption.go @@ -5,5 +5,5 @@ package devcenters type CustomerManagedKeyEncryption struct { KeyEncryptionKeyIdentity *CustomerManagedKeyEncryptionKeyEncryptionKeyIdentity `json:"keyEncryptionKeyIdentity,omitempty"` - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/devcenter/2024-02-01/environmenttypes/README.md b/resource-manager/devcenter/2024-02-01/environmenttypes/README.md index abf0bb2379c..ac0b7bbc7ed 100644 --- a/resource-manager/devcenter/2024-02-01/environmenttypes/README.md +++ b/resource-manager/devcenter/2024-02-01/environmenttypes/README.md @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := environmenttypes.NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "environmentTypeName") +id := environmenttypes.NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "allowedEnvironmentTypeName") read, err := client.ProjectAllowedEnvironmentTypesGet(ctx, id) if err != nil { diff --git a/resource-manager/devcenter/2024-02-01/environmenttypes/id_allowedenvironmenttype.go b/resource-manager/devcenter/2024-02-01/environmenttypes/id_allowedenvironmenttype.go index 215741c4b78..f96b6503a61 100644 --- a/resource-manager/devcenter/2024-02-01/environmenttypes/id_allowedenvironmenttype.go +++ b/resource-manager/devcenter/2024-02-01/environmenttypes/id_allowedenvironmenttype.go @@ -123,7 +123,7 @@ func (id AllowedEnvironmentTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProjects", "projects", "projects"), resourceids.UserSpecifiedSegment("projectName", "projectName"), resourceids.StaticSegment("staticAllowedEnvironmentTypes", "allowedEnvironmentTypes", "allowedEnvironmentTypes"), - resourceids.UserSpecifiedSegment("allowedEnvironmentTypeName", "environmentTypeName"), + resourceids.UserSpecifiedSegment("allowedEnvironmentTypeName", "allowedEnvironmentTypeName"), } } diff --git a/resource-manager/devcenter/2024-02-01/environmenttypes/id_allowedenvironmenttype_test.go b/resource-manager/devcenter/2024-02-01/environmenttypes/id_allowedenvironmenttype_test.go index 7e98ca54606..60bda5082ca 100644 --- a/resource-manager/devcenter/2024-02-01/environmenttypes/id_allowedenvironmenttype_test.go +++ b/resource-manager/devcenter/2024-02-01/environmenttypes/id_allowedenvironmenttype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AllowedEnvironmentTypeId{} func TestNewAllowedEnvironmentTypeID(t *testing.T) { - id := NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "environmentTypeName") + id := NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "allowedEnvironmentTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAllowedEnvironmentTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProjectName'", id.ProjectName, "projectName") } - if id.AllowedEnvironmentTypeName != "environmentTypeName" { - t.Fatalf("Expected %q but got %q for Segment 'AllowedEnvironmentTypeName'", id.AllowedEnvironmentTypeName, "environmentTypeName") + if id.AllowedEnvironmentTypeName != "allowedEnvironmentTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'AllowedEnvironmentTypeName'", id.AllowedEnvironmentTypeName, "allowedEnvironmentTypeName") } } func TestFormatAllowedEnvironmentTypeID(t *testing.T) { - actual := NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "environmentTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName" + actual := NewAllowedEnvironmentTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "projectName", "allowedEnvironmentTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAllowedEnvironmentTypeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName", Expected: &AllowedEnvironmentTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProjectName: "projectName", - AllowedEnvironmentTypeName: "environmentTypeName", + AllowedEnvironmentTypeName: "allowedEnvironmentTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAllowedEnvironmentTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName", Expected: &AllowedEnvironmentTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ProjectName: "projectName", - AllowedEnvironmentTypeName: "environmentTypeName", + AllowedEnvironmentTypeName: "allowedEnvironmentTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/environmentTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevCenter/projects/projectName/allowedEnvironmentTypes/allowedEnvironmentTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aLlOwEdEnViRoNmEnTtYpEs/eNvIrOnMeNtTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aLlOwEdEnViRoNmEnTtYpEs/aLlOwEdEnViRoNmEnTtYpEnAmE", Expected: &AllowedEnvironmentTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ProjectName: "pRoJeCtNaMe", - AllowedEnvironmentTypeName: "eNvIrOnMeNtTyPeNaMe", + AllowedEnvironmentTypeName: "aLlOwEdEnViRoNmEnTtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aLlOwEdEnViRoNmEnTtYpEs/eNvIrOnMeNtTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/pRoJeCtS/pRoJeCtNaMe/aLlOwEdEnViRoNmEnTtYpEs/aLlOwEdEnViRoNmEnTtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devcenter/2024-02-01/usages/README.md b/resource-manager/devcenter/2024-02-01/usages/README.md index ab4f8796895..17ae95d3a66 100644 --- a/resource-manager/devcenter/2024-02-01/usages/README.md +++ b/resource-manager/devcenter/2024-02-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/devcenter/2024-02-01/usages/id_location.go b/resource-manager/devcenter/2024-02-01/usages/id_location.go index 5a93fab23d6..0ac59b158f8 100644 --- a/resource-manager/devcenter/2024-02-01/usages/id_location.go +++ b/resource-manager/devcenter/2024-02-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevCenter", "Microsoft.DevCenter", "Microsoft.DevCenter"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/devcenter/2024-02-01/usages/id_location_test.go b/resource-manager/devcenter/2024-02-01/usages/id_location_test.go index 375fc1a49b6..d24316d5aef 100644 --- a/resource-manager/devcenter/2024-02-01/usages/id_location_test.go +++ b/resource-manager/devcenter/2024-02-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevCenter/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvCeNtEr/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/README.md b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/README.md index d3feeb6f923..aa6151fbd84 100644 --- a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/README.md +++ b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/README.md @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName") payload := iotdpsresource.PrivateEndpointConnection{ // ... @@ -92,7 +92,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := iotdpsresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId") +id := iotdpsresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "groupId") read, err := client.GetPrivateLinkResources(ctx, id) if err != nil { diff --git a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privateendpointconnection.go b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privateendpointconnection.go index fb4b102b577..f784189b605 100644 --- a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privateendpointconnection.go +++ b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevices", "Microsoft.Devices", "Microsoft.Devices"), resourceids.StaticSegment("staticProvisioningServices", "provisioningServices", "provisioningServices"), - resourceids.UserSpecifiedSegment("provisioningServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("provisioningServiceName", "provisioningServiceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privateendpointconnection_test.go b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privateendpointconnection_test.go index b2969d909cf..b8dbaac4384 100644 --- a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privateendpointconnection_test.go +++ b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ProvisioningServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ProvisioningServiceName'", id.ProvisioningServiceName, "resourceName") + if id.ProvisioningServiceName != "provisioningServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'ProvisioningServiceName'", id.ProvisioningServiceName, "provisioningServiceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ProvisioningServiceName: "resourceName", + ProvisioningServiceName: "provisioningServiceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ProvisioningServiceName: "resourceName", + ProvisioningServiceName: "provisioningServiceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ProvisioningServiceName: "rEsOuRcEnAmE", + ProvisioningServiceName: "pRoViSiOnInGsErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privatelinkresource.go b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privatelinkresource.go index e39fa412d87..83b35436b52 100644 --- a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privatelinkresource.go +++ b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevices", "Microsoft.Devices", "Microsoft.Devices"), resourceids.StaticSegment("staticProvisioningServices", "provisioningServices", "provisioningServices"), - resourceids.UserSpecifiedSegment("provisioningServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("provisioningServiceName", "provisioningServiceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("groupId", "groupId"), } diff --git a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privatelinkresource_test.go b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privatelinkresource_test.go index 03bbc1c0fcf..833a9bdbf9b 100644 --- a/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privatelinkresource_test.go +++ b/resource-manager/deviceprovisioningservices/2022-02-05/iotdpsresource/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "groupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ProvisioningServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ProvisioningServiceName'", id.ProvisioningServiceName, "resourceName") + if id.ProvisioningServiceName != "provisioningServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'ProvisioningServiceName'", id.ProvisioningServiceName, "provisioningServiceName") } if id.GroupId != "groupId" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "groupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ProvisioningServiceName: "resourceName", + ProvisioningServiceName: "provisioningServiceName", GroupId: "groupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ProvisioningServiceName: "resourceName", + ProvisioningServiceName: "provisioningServiceName", GroupId: "groupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ProvisioningServiceName: "rEsOuRcEnAmE", + ProvisioningServiceName: "pRoViSiOnInGsErViCeNaMe", GroupId: "gRoUpId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpId/extra", Error: true, }, } diff --git a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/README.md b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/README.md index fee301e2d17..9f465053400 100644 --- a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/README.md +++ b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/README.md @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName") payload := iotdpsresource.PrivateEndpointConnection{ // ... @@ -92,7 +92,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := iotdpsresource.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := iotdpsresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId") +id := iotdpsresource.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "groupId") read, err := client.GetPrivateLinkResources(ctx, id) if err != nil { diff --git a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privateendpointconnection.go b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privateendpointconnection.go index fb4b102b577..f784189b605 100644 --- a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privateendpointconnection.go +++ b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevices", "Microsoft.Devices", "Microsoft.Devices"), resourceids.StaticSegment("staticProvisioningServices", "provisioningServices", "provisioningServices"), - resourceids.UserSpecifiedSegment("provisioningServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("provisioningServiceName", "provisioningServiceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privateendpointconnection_test.go b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privateendpointconnection_test.go index b2969d909cf..b8dbaac4384 100644 --- a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privateendpointconnection_test.go +++ b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ProvisioningServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ProvisioningServiceName'", id.ProvisioningServiceName, "resourceName") + if id.ProvisioningServiceName != "provisioningServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'ProvisioningServiceName'", id.ProvisioningServiceName, "provisioningServiceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ProvisioningServiceName: "resourceName", + ProvisioningServiceName: "provisioningServiceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ProvisioningServiceName: "resourceName", + ProvisioningServiceName: "provisioningServiceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ProvisioningServiceName: "rEsOuRcEnAmE", + ProvisioningServiceName: "pRoViSiOnInGsErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privatelinkresource.go b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privatelinkresource.go index e39fa412d87..83b35436b52 100644 --- a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privatelinkresource.go +++ b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevices", "Microsoft.Devices", "Microsoft.Devices"), resourceids.StaticSegment("staticProvisioningServices", "provisioningServices", "provisioningServices"), - resourceids.UserSpecifiedSegment("provisioningServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("provisioningServiceName", "provisioningServiceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("groupId", "groupId"), } diff --git a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privatelinkresource_test.go b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privatelinkresource_test.go index 03bbc1c0fcf..833a9bdbf9b 100644 --- a/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privatelinkresource_test.go +++ b/resource-manager/deviceprovisioningservices/2022-12-12/iotdpsresource/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "groupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ProvisioningServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ProvisioningServiceName'", id.ProvisioningServiceName, "resourceName") + if id.ProvisioningServiceName != "provisioningServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'ProvisioningServiceName'", id.ProvisioningServiceName, "provisioningServiceName") } if id.GroupId != "groupId" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "provisioningServiceName", "groupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ProvisioningServiceName: "resourceName", + ProvisioningServiceName: "provisioningServiceName", GroupId: "groupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ProvisioningServiceName: "resourceName", + ProvisioningServiceName: "provisioningServiceName", GroupId: "groupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/resourceName/privateLinkResources/groupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Devices/provisioningServices/provisioningServiceName/privateLinkResources/groupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ProvisioningServiceName: "rEsOuRcEnAmE", + ProvisioningServiceName: "pRoViSiOnInGsErViCeNaMe", GroupId: "gRoUpId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvIcEs/pRoViSiOnInGsErViCeS/pRoViSiOnInGsErViCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpId/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/armtemplates/README.md b/resource-manager/devtestlab/2018-09-15/armtemplates/README.md index 5159e8472ef..4b0e86bd73d 100644 --- a/resource-manager/devtestlab/2018-09-15/armtemplates/README.md +++ b/resource-manager/devtestlab/2018-09-15/armtemplates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := armtemplates.NewArmTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "name") +id := armtemplates.NewArmTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "armTemplateName") read, err := client.Get(ctx, id, armtemplates.DefaultGetOperationOptions()) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := armtemplates.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := armtemplates.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") // alternatively `client.List(ctx, id, armtemplates.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, armtemplates.DefaultListOperationOptions()) diff --git a/resource-manager/devtestlab/2018-09-15/armtemplates/id_armtemplate.go b/resource-manager/devtestlab/2018-09-15/armtemplates/id_armtemplate.go index b9558999948..31eb75d5722 100644 --- a/resource-manager/devtestlab/2018-09-15/armtemplates/id_armtemplate.go +++ b/resource-manager/devtestlab/2018-09-15/armtemplates/id_armtemplate.go @@ -131,7 +131,7 @@ func (id ArmTemplateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticArtifactSources", "artifactSources", "artifactSources"), resourceids.UserSpecifiedSegment("artifactSourceName", "artifactSourceName"), resourceids.StaticSegment("staticArmTemplates", "armTemplates", "armTemplates"), - resourceids.UserSpecifiedSegment("armTemplateName", "name"), + resourceids.UserSpecifiedSegment("armTemplateName", "armTemplateName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/armtemplates/id_armtemplate_test.go b/resource-manager/devtestlab/2018-09-15/armtemplates/id_armtemplate_test.go index 3c09a8b0edd..aa009c823d5 100644 --- a/resource-manager/devtestlab/2018-09-15/armtemplates/id_armtemplate_test.go +++ b/resource-manager/devtestlab/2018-09-15/armtemplates/id_armtemplate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArmTemplateId{} func TestNewArmTemplateID(t *testing.T) { - id := NewArmTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "name") + id := NewArmTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "armTemplateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewArmTemplateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ArtifactSourceName'", id.ArtifactSourceName, "artifactSourceName") } - if id.ArmTemplateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ArmTemplateName'", id.ArmTemplateName, "name") + if id.ArmTemplateName != "armTemplateName" { + t.Fatalf("Expected %q but got %q for Segment 'ArmTemplateName'", id.ArmTemplateName, "armTemplateName") } } func TestFormatArmTemplateID(t *testing.T) { - actual := NewArmTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/name" + actual := NewArmTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "armTemplateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/armTemplateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseArmTemplateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/armTemplateName", Expected: &ArmTemplateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", ArtifactSourceName: "artifactSourceName", - ArmTemplateName: "name", + ArmTemplateName: "armTemplateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/armTemplateName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseArmTemplateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/armTemplateName", Expected: &ArmTemplateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", ArtifactSourceName: "artifactSourceName", - ArmTemplateName: "name", + ArmTemplateName: "armTemplateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/armTemplates/armTemplateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/aRmTeMpLaTeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/aRmTeMpLaTeS/aRmTeMpLaTeNaMe", Expected: &ArmTemplateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", ArtifactSourceName: "aRtIfAcTsOuRcEnAmE", - ArmTemplateName: "nAmE", + ArmTemplateName: "aRmTeMpLaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/aRmTeMpLaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/aRmTeMpLaTeS/aRmTeMpLaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/armtemplates/id_artifactsource.go b/resource-manager/devtestlab/2018-09-15/armtemplates/id_artifactsource.go index c8e2f2a4b78..7b7693cd4b0 100644 --- a/resource-manager/devtestlab/2018-09-15/armtemplates/id_artifactsource.go +++ b/resource-manager/devtestlab/2018-09-15/armtemplates/id_artifactsource.go @@ -123,7 +123,7 @@ func (id ArtifactSourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticArtifactSources", "artifactSources", "artifactSources"), - resourceids.UserSpecifiedSegment("artifactSourceName", "name"), + resourceids.UserSpecifiedSegment("artifactSourceName", "artifactSourceName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/armtemplates/id_artifactsource_test.go b/resource-manager/devtestlab/2018-09-15/armtemplates/id_artifactsource_test.go index f6fcce3add7..3751c0df0fa 100644 --- a/resource-manager/devtestlab/2018-09-15/armtemplates/id_artifactsource_test.go +++ b/resource-manager/devtestlab/2018-09-15/armtemplates/id_artifactsource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArtifactSourceId{} func TestNewArtifactSourceID(t *testing.T) { - id := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewArtifactSourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.ArtifactSourceName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ArtifactSourceName'", id.ArtifactSourceName, "name") + if id.ArtifactSourceName != "artifactSourceName" { + t.Fatalf("Expected %q but got %q for Segment 'ArtifactSourceName'", id.ArtifactSourceName, "artifactSourceName") } } func TestFormatArtifactSourceID(t *testing.T) { - actual := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name" + actual := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseArtifactSourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ArtifactSourceName: "name", + ArtifactSourceName: "artifactSourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseArtifactSourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ArtifactSourceName: "name", + ArtifactSourceName: "artifactSourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - ArtifactSourceName: "nAmE", + ArtifactSourceName: "aRtIfAcTsOuRcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/artifacts/README.md b/resource-manager/devtestlab/2018-09-15/artifacts/README.md index da537a2a6e8..a7fa1cb1914 100644 --- a/resource-manager/devtestlab/2018-09-15/artifacts/README.md +++ b/resource-manager/devtestlab/2018-09-15/artifacts/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := artifacts.NewArtifactID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "name") +id := artifacts.NewArtifactID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "artifactName") payload := artifacts.GenerateArmTemplateRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := artifacts.NewArtifactID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "name") +id := artifacts.NewArtifactID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "artifactName") read, err := client.Get(ctx, id, artifacts.DefaultGetOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := artifacts.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := artifacts.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") // alternatively `client.List(ctx, id, artifacts.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, artifacts.DefaultListOperationOptions()) diff --git a/resource-manager/devtestlab/2018-09-15/artifacts/id_artifact.go b/resource-manager/devtestlab/2018-09-15/artifacts/id_artifact.go index cb266eac3a3..880ef7840ca 100644 --- a/resource-manager/devtestlab/2018-09-15/artifacts/id_artifact.go +++ b/resource-manager/devtestlab/2018-09-15/artifacts/id_artifact.go @@ -131,7 +131,7 @@ func (id ArtifactId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticArtifactSources", "artifactSources", "artifactSources"), resourceids.UserSpecifiedSegment("artifactSourceName", "artifactSourceName"), resourceids.StaticSegment("staticArtifacts", "artifacts", "artifacts"), - resourceids.UserSpecifiedSegment("artifactName", "name"), + resourceids.UserSpecifiedSegment("artifactName", "artifactName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/artifacts/id_artifact_test.go b/resource-manager/devtestlab/2018-09-15/artifacts/id_artifact_test.go index 629a9fc85b5..2891a1b0ed2 100644 --- a/resource-manager/devtestlab/2018-09-15/artifacts/id_artifact_test.go +++ b/resource-manager/devtestlab/2018-09-15/artifacts/id_artifact_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArtifactId{} func TestNewArtifactID(t *testing.T) { - id := NewArtifactID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "name") + id := NewArtifactID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "artifactName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewArtifactID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ArtifactSourceName'", id.ArtifactSourceName, "artifactSourceName") } - if id.ArtifactName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ArtifactName'", id.ArtifactName, "name") + if id.ArtifactName != "artifactName" { + t.Fatalf("Expected %q but got %q for Segment 'ArtifactName'", id.ArtifactName, "artifactName") } } func TestFormatArtifactID(t *testing.T) { - actual := NewArtifactID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/name" + actual := NewArtifactID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName", "artifactName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/artifactName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseArtifactID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/artifactName", Expected: &ArtifactId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", ArtifactSourceName: "artifactSourceName", - ArtifactName: "name", + ArtifactName: "artifactName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/artifactName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseArtifactIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/artifactName", Expected: &ArtifactId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", ArtifactSourceName: "artifactSourceName", - ArtifactName: "name", + ArtifactName: "artifactName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/artifacts/artifactName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/aRtIfAcTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/aRtIfAcTs/aRtIfAcTnAmE", Expected: &ArtifactId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", ArtifactSourceName: "aRtIfAcTsOuRcEnAmE", - ArtifactName: "nAmE", + ArtifactName: "aRtIfAcTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/aRtIfAcTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/aRtIfAcTs/aRtIfAcTnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/artifacts/id_artifactsource.go b/resource-manager/devtestlab/2018-09-15/artifacts/id_artifactsource.go index ace6a85fc38..8c6d7282b6f 100644 --- a/resource-manager/devtestlab/2018-09-15/artifacts/id_artifactsource.go +++ b/resource-manager/devtestlab/2018-09-15/artifacts/id_artifactsource.go @@ -123,7 +123,7 @@ func (id ArtifactSourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticArtifactSources", "artifactSources", "artifactSources"), - resourceids.UserSpecifiedSegment("artifactSourceName", "name"), + resourceids.UserSpecifiedSegment("artifactSourceName", "artifactSourceName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/artifacts/id_artifactsource_test.go b/resource-manager/devtestlab/2018-09-15/artifacts/id_artifactsource_test.go index ef0443e5fbd..837260d8c0e 100644 --- a/resource-manager/devtestlab/2018-09-15/artifacts/id_artifactsource_test.go +++ b/resource-manager/devtestlab/2018-09-15/artifacts/id_artifactsource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArtifactSourceId{} func TestNewArtifactSourceID(t *testing.T) { - id := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewArtifactSourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.ArtifactSourceName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ArtifactSourceName'", id.ArtifactSourceName, "name") + if id.ArtifactSourceName != "artifactSourceName" { + t.Fatalf("Expected %q but got %q for Segment 'ArtifactSourceName'", id.ArtifactSourceName, "artifactSourceName") } } func TestFormatArtifactSourceID(t *testing.T) { - actual := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name" + actual := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseArtifactSourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ArtifactSourceName: "name", + ArtifactSourceName: "artifactSourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseArtifactSourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ArtifactSourceName: "name", + ArtifactSourceName: "artifactSourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - ArtifactSourceName: "nAmE", + ArtifactSourceName: "aRtIfAcTsOuRcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/artifactsources/README.md b/resource-manager/devtestlab/2018-09-15/artifactsources/README.md index 31ab2869f18..1e3d0321f41 100644 --- a/resource-manager/devtestlab/2018-09-15/artifactsources/README.md +++ b/resource-manager/devtestlab/2018-09-15/artifactsources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := artifactsources.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := artifactsources.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") payload := artifactsources.ArtifactSource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := artifactsources.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := artifactsources.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := artifactsources.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := artifactsources.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") read, err := client.Get(ctx, id, artifactsources.DefaultGetOperationOptions()) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := artifactsources.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := artifactsources.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, artifactsources.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, artifactsources.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := artifactsources.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := artifactsources.NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") payload := artifactsources.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/artifactsources/id_artifactsource.go b/resource-manager/devtestlab/2018-09-15/artifactsources/id_artifactsource.go index b4bd70a2a2d..32cbdde71b9 100644 --- a/resource-manager/devtestlab/2018-09-15/artifactsources/id_artifactsource.go +++ b/resource-manager/devtestlab/2018-09-15/artifactsources/id_artifactsource.go @@ -123,7 +123,7 @@ func (id ArtifactSourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticArtifactSources", "artifactSources", "artifactSources"), - resourceids.UserSpecifiedSegment("artifactSourceName", "name"), + resourceids.UserSpecifiedSegment("artifactSourceName", "artifactSourceName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/artifactsources/id_artifactsource_test.go b/resource-manager/devtestlab/2018-09-15/artifactsources/id_artifactsource_test.go index 81d6aaddfab..90a5a4f0280 100644 --- a/resource-manager/devtestlab/2018-09-15/artifactsources/id_artifactsource_test.go +++ b/resource-manager/devtestlab/2018-09-15/artifactsources/id_artifactsource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArtifactSourceId{} func TestNewArtifactSourceID(t *testing.T) { - id := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewArtifactSourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.ArtifactSourceName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ArtifactSourceName'", id.ArtifactSourceName, "name") + if id.ArtifactSourceName != "artifactSourceName" { + t.Fatalf("Expected %q but got %q for Segment 'ArtifactSourceName'", id.ArtifactSourceName, "artifactSourceName") } } func TestFormatArtifactSourceID(t *testing.T) { - actual := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name" + actual := NewArtifactSourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "artifactSourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseArtifactSourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ArtifactSourceName: "name", + ArtifactSourceName: "artifactSourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseArtifactSourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ArtifactSourceName: "name", + ArtifactSourceName: "artifactSourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/artifactSources/artifactSourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE", Expected: &ArtifactSourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - ArtifactSourceName: "nAmE", + ArtifactSourceName: "aRtIfAcTsOuRcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/aRtIfAcTsOuRcEs/aRtIfAcTsOuRcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/artifactsources/id_lab.go b/resource-manager/devtestlab/2018-09-15/artifactsources/id_lab.go index 5d6b061507a..5b5b430aa8e 100644 --- a/resource-manager/devtestlab/2018-09-15/artifactsources/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/artifactsources/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/artifactsources/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/artifactsources/id_lab_test.go index c8661ed9028..1bc6518eb7e 100644 --- a/resource-manager/devtestlab/2018-09-15/artifactsources/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/artifactsources/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/costs/README.md b/resource-manager/devtestlab/2018-09-15/costs/README.md index 66f35be916d..44f399917f4 100644 --- a/resource-manager/devtestlab/2018-09-15/costs/README.md +++ b/resource-manager/devtestlab/2018-09-15/costs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := costs.NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := costs.NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "costName") payload := costs.LabCost{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := costs.NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := costs.NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "costName") read, err := client.Get(ctx, id, costs.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/devtestlab/2018-09-15/costs/id_cost.go b/resource-manager/devtestlab/2018-09-15/costs/id_cost.go index 7a7cc3084a4..eb3bfad0e1f 100644 --- a/resource-manager/devtestlab/2018-09-15/costs/id_cost.go +++ b/resource-manager/devtestlab/2018-09-15/costs/id_cost.go @@ -123,7 +123,7 @@ func (id CostId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticCosts", "costs", "costs"), - resourceids.UserSpecifiedSegment("costName", "name"), + resourceids.UserSpecifiedSegment("costName", "costName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/costs/id_cost_test.go b/resource-manager/devtestlab/2018-09-15/costs/id_cost_test.go index 69ad42bc491..eab30bf9e0b 100644 --- a/resource-manager/devtestlab/2018-09-15/costs/id_cost_test.go +++ b/resource-manager/devtestlab/2018-09-15/costs/id_cost_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CostId{} func TestNewCostID(t *testing.T) { - id := NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "costName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewCostID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.CostName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CostName'", id.CostName, "name") + if id.CostName != "costName" { + t.Fatalf("Expected %q but got %q for Segment 'CostName'", id.CostName, "costName") } } func TestFormatCostID(t *testing.T) { - actual := NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/name" + actual := NewCostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "costName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/costName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseCostID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/costName", Expected: &CostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - CostName: "name", + CostName: "costName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/costName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseCostIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/costName", Expected: &CostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - CostName: "name", + CostName: "costName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/costs/costName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/cOsTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/cOsTs/cOsTnAmE", Expected: &CostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - CostName: "nAmE", + CostName: "cOsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/cOsTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/cOsTs/cOsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/customimages/README.md b/resource-manager/devtestlab/2018-09-15/customimages/README.md index 331cdc5c130..df81f9f98fe 100644 --- a/resource-manager/devtestlab/2018-09-15/customimages/README.md +++ b/resource-manager/devtestlab/2018-09-15/customimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customimages.NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := customimages.NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "customImageName") payload := customimages.CustomImage{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := customimages.NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := customimages.NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "customImageName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customimages.NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := customimages.NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "customImageName") read, err := client.Get(ctx, id, customimages.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customimages.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := customimages.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, customimages.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, customimages.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := customimages.NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := customimages.NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "customImageName") payload := customimages.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/customimages/id_customimage.go b/resource-manager/devtestlab/2018-09-15/customimages/id_customimage.go index ac39105b7f8..18f405038c1 100644 --- a/resource-manager/devtestlab/2018-09-15/customimages/id_customimage.go +++ b/resource-manager/devtestlab/2018-09-15/customimages/id_customimage.go @@ -123,7 +123,7 @@ func (id CustomImageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticCustomImages", "customImages", "customImages"), - resourceids.UserSpecifiedSegment("customImageName", "name"), + resourceids.UserSpecifiedSegment("customImageName", "customImageName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/customimages/id_customimage_test.go b/resource-manager/devtestlab/2018-09-15/customimages/id_customimage_test.go index c7d86333334..e6d3e505cbd 100644 --- a/resource-manager/devtestlab/2018-09-15/customimages/id_customimage_test.go +++ b/resource-manager/devtestlab/2018-09-15/customimages/id_customimage_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomImageId{} func TestNewCustomImageID(t *testing.T) { - id := NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "customImageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewCustomImageID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.CustomImageName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CustomImageName'", id.CustomImageName, "name") + if id.CustomImageName != "customImageName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomImageName'", id.CustomImageName, "customImageName") } } func TestFormatCustomImageID(t *testing.T) { - actual := NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/name" + actual := NewCustomImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "customImageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/customImageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseCustomImageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/customImageName", Expected: &CustomImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - CustomImageName: "name", + CustomImageName: "customImageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/customImageName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseCustomImageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/customImageName", Expected: &CustomImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - CustomImageName: "name", + CustomImageName: "customImageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/customImages/customImageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/cUsToMiMaGeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/cUsToMiMaGeS/cUsToMiMaGeNaMe", Expected: &CustomImageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - CustomImageName: "nAmE", + CustomImageName: "cUsToMiMaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/cUsToMiMaGeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/cUsToMiMaGeS/cUsToMiMaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/customimages/id_lab.go b/resource-manager/devtestlab/2018-09-15/customimages/id_lab.go index f9ab4d6912a..a29b7f20256 100644 --- a/resource-manager/devtestlab/2018-09-15/customimages/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/customimages/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/customimages/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/customimages/id_lab_test.go index 46f8c9a4980..0803d84c01b 100644 --- a/resource-manager/devtestlab/2018-09-15/customimages/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/customimages/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/disks/README.md b/resource-manager/devtestlab/2018-09-15/disks/README.md index 5aa8a7f5b53..d58096806f4 100644 --- a/resource-manager/devtestlab/2018-09-15/disks/README.md +++ b/resource-manager/devtestlab/2018-09-15/disks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "diskName") payload := disks.AttachDiskProperties{ // ... @@ -41,7 +41,7 @@ if err := client.AttachThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "diskName") payload := disks.Disk{ // ... @@ -58,7 +58,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "diskName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "diskName") payload := disks.DetachDiskProperties{ // ... @@ -87,7 +87,7 @@ if err := client.DetachThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "diskName") read, err := client.Get(ctx, id, disks.DefaultGetOperationOptions()) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disks.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := disks.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") // alternatively `client.List(ctx, id, disks.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, disks.DefaultListOperationOptions()) @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "diskName") payload := disks.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/disks/id_disk.go b/resource-manager/devtestlab/2018-09-15/disks/id_disk.go index abafefc0ab2..ea8c2247a27 100644 --- a/resource-manager/devtestlab/2018-09-15/disks/id_disk.go +++ b/resource-manager/devtestlab/2018-09-15/disks/id_disk.go @@ -131,7 +131,7 @@ func (id DiskId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userName", "userName"), resourceids.StaticSegment("staticDisks", "disks", "disks"), - resourceids.UserSpecifiedSegment("diskName", "name"), + resourceids.UserSpecifiedSegment("diskName", "diskName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/disks/id_disk_test.go b/resource-manager/devtestlab/2018-09-15/disks/id_disk_test.go index 6a0ab65655c..65b42cbe225 100644 --- a/resource-manager/devtestlab/2018-09-15/disks/id_disk_test.go +++ b/resource-manager/devtestlab/2018-09-15/disks/id_disk_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiskId{} func TestNewDiskID(t *testing.T) { - id := NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") + id := NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "diskName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewDiskID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } - if id.DiskName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DiskName'", id.DiskName, "name") + if id.DiskName != "diskName" { + t.Fatalf("Expected %q but got %q for Segment 'DiskName'", id.DiskName, "diskName") } } func TestFormatDiskID(t *testing.T) { - actual := NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/name" + actual := NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "diskName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/diskName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseDiskID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/diskName", Expected: &DiskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - DiskName: "name", + DiskName: "diskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/diskName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseDiskIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/diskName", Expected: &DiskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - DiskName: "name", + DiskName: "diskName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/disks/diskName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/dIsKs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/dIsKs/dIsKnAmE", Expected: &DiskId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", UserName: "uSeRnAmE", - DiskName: "nAmE", + DiskName: "dIsKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/dIsKs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/dIsKs/dIsKnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/disks/id_user.go b/resource-manager/devtestlab/2018-09-15/disks/id_user.go index b798337d7cb..edee8608163 100644 --- a/resource-manager/devtestlab/2018-09-15/disks/id_user.go +++ b/resource-manager/devtestlab/2018-09-15/disks/id_user.go @@ -123,7 +123,7 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "name"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/disks/id_user_test.go b/resource-manager/devtestlab/2018-09-15/disks/id_user_test.go index 6417b7fb540..64f5a5473e0 100644 --- a/resource-manager/devtestlab/2018-09-15/disks/id_user_test.go +++ b/resource-manager/devtestlab/2018-09-15/disks/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.UserName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "name") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseUserID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - UserName: "nAmE", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/environments/README.md b/resource-manager/devtestlab/2018-09-15/environments/README.md index 4a3d8857dce..501d3315d21 100644 --- a/resource-manager/devtestlab/2018-09-15/environments/README.md +++ b/resource-manager/devtestlab/2018-09-15/environments/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := environments.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := environments.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "environmentName") payload := environments.DtlEnvironment{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := environments.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := environments.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "environmentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := environments.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := environments.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "environmentName") read, err := client.Get(ctx, id, environments.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := environments.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := environments.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") // alternatively `client.List(ctx, id, environments.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, environments.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := environments.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := environments.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "environmentName") payload := environments.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/environments/id_environment.go b/resource-manager/devtestlab/2018-09-15/environments/id_environment.go index 38128266ffc..bc6b54755e4 100644 --- a/resource-manager/devtestlab/2018-09-15/environments/id_environment.go +++ b/resource-manager/devtestlab/2018-09-15/environments/id_environment.go @@ -131,7 +131,7 @@ func (id EnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userName", "userName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), - resourceids.UserSpecifiedSegment("environmentName", "name"), + resourceids.UserSpecifiedSegment("environmentName", "environmentName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/environments/id_environment_test.go b/resource-manager/devtestlab/2018-09-15/environments/id_environment_test.go index 66af55b0020..a5367db4cf2 100644 --- a/resource-manager/devtestlab/2018-09-15/environments/id_environment_test.go +++ b/resource-manager/devtestlab/2018-09-15/environments/id_environment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EnvironmentId{} func TestNewEnvironmentID(t *testing.T) { - id := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") + id := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "environmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } - if id.EnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "name") + if id.EnvironmentName != "environmentName" { + t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "environmentName") } } func TestFormatEnvironmentID(t *testing.T) { - actual := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/name" + actual := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "environmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/environmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/environmentName", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - EnvironmentName: "name", + EnvironmentName: "environmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/environmentName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/environmentName", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - EnvironmentName: "name", + EnvironmentName: "environmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/environments/environmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/eNvIrOnMeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/eNvIrOnMeNtS/eNvIrOnMeNtNaMe", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", UserName: "uSeRnAmE", - EnvironmentName: "nAmE", + EnvironmentName: "eNvIrOnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/eNvIrOnMeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/environments/id_user.go b/resource-manager/devtestlab/2018-09-15/environments/id_user.go index 1bae57b0b6d..8df2760c244 100644 --- a/resource-manager/devtestlab/2018-09-15/environments/id_user.go +++ b/resource-manager/devtestlab/2018-09-15/environments/id_user.go @@ -123,7 +123,7 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "name"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/environments/id_user_test.go b/resource-manager/devtestlab/2018-09-15/environments/id_user_test.go index f03adf518a2..a0e412d01f8 100644 --- a/resource-manager/devtestlab/2018-09-15/environments/id_user_test.go +++ b/resource-manager/devtestlab/2018-09-15/environments/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.UserName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "name") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseUserID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - UserName: "nAmE", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/formulas/README.md b/resource-manager/devtestlab/2018-09-15/formulas/README.md index 3c3e33e24be..67f70830289 100644 --- a/resource-manager/devtestlab/2018-09-15/formulas/README.md +++ b/resource-manager/devtestlab/2018-09-15/formulas/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := formulas.NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := formulas.NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "formulaName") payload := formulas.Formula{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := formulas.NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := formulas.NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "formulaName") read, err := client.Delete(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := formulas.NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := formulas.NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "formulaName") read, err := client.Get(ctx, id, formulas.DefaultGetOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := formulas.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := formulas.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, formulas.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, formulas.DefaultListOperationOptions()) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := formulas.NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := formulas.NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "formulaName") payload := formulas.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/formulas/id_formula.go b/resource-manager/devtestlab/2018-09-15/formulas/id_formula.go index cf8ada237b8..e4903e2b69d 100644 --- a/resource-manager/devtestlab/2018-09-15/formulas/id_formula.go +++ b/resource-manager/devtestlab/2018-09-15/formulas/id_formula.go @@ -123,7 +123,7 @@ func (id FormulaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticFormulas", "formulas", "formulas"), - resourceids.UserSpecifiedSegment("formulaName", "name"), + resourceids.UserSpecifiedSegment("formulaName", "formulaName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/formulas/id_formula_test.go b/resource-manager/devtestlab/2018-09-15/formulas/id_formula_test.go index 3e169780714..be1fc8f485f 100644 --- a/resource-manager/devtestlab/2018-09-15/formulas/id_formula_test.go +++ b/resource-manager/devtestlab/2018-09-15/formulas/id_formula_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FormulaId{} func TestNewFormulaID(t *testing.T) { - id := NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "formulaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewFormulaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.FormulaName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FormulaName'", id.FormulaName, "name") + if id.FormulaName != "formulaName" { + t.Fatalf("Expected %q but got %q for Segment 'FormulaName'", id.FormulaName, "formulaName") } } func TestFormatFormulaID(t *testing.T) { - actual := NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/name" + actual := NewFormulaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "formulaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/formulaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseFormulaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/formulaName", Expected: &FormulaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - FormulaName: "name", + FormulaName: "formulaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/formulaName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseFormulaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/formulaName", Expected: &FormulaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - FormulaName: "name", + FormulaName: "formulaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/formulas/formulaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/fOrMuLaS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/fOrMuLaS/fOrMuLaNaMe", Expected: &FormulaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - FormulaName: "nAmE", + FormulaName: "fOrMuLaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/fOrMuLaS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/fOrMuLaS/fOrMuLaNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/formulas/id_lab.go b/resource-manager/devtestlab/2018-09-15/formulas/id_lab.go index 22d30279269..faf896d2f1d 100644 --- a/resource-manager/devtestlab/2018-09-15/formulas/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/formulas/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/formulas/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/formulas/id_lab_test.go index 386986561ac..5375154962c 100644 --- a/resource-manager/devtestlab/2018-09-15/formulas/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/formulas/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/formulas/model_notificationsettings.go b/resource-manager/devtestlab/2018-09-15/formulas/model_notificationsettings.go index eb68e988edc..d5ca6d62d88 100644 --- a/resource-manager/devtestlab/2018-09-15/formulas/model_notificationsettings.go +++ b/resource-manager/devtestlab/2018-09-15/formulas/model_notificationsettings.go @@ -8,5 +8,5 @@ type NotificationSettings struct { NotificationLocale *string `json:"notificationLocale,omitempty"` Status *EnableStatus `json:"status,omitempty"` TimeInMinutes *int64 `json:"timeInMinutes,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/devtestlab/2018-09-15/galleryimages/README.md b/resource-manager/devtestlab/2018-09-15/galleryimages/README.md index e145146e026..2055838e2e7 100644 --- a/resource-manager/devtestlab/2018-09-15/galleryimages/README.md +++ b/resource-manager/devtestlab/2018-09-15/galleryimages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := galleryimages.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := galleryimages.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, galleryimages.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, galleryimages.DefaultListOperationOptions()) diff --git a/resource-manager/devtestlab/2018-09-15/galleryimages/id_lab.go b/resource-manager/devtestlab/2018-09-15/galleryimages/id_lab.go index e336fdc99b4..69a048ba21d 100644 --- a/resource-manager/devtestlab/2018-09-15/galleryimages/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/galleryimages/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/galleryimages/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/galleryimages/id_lab_test.go index aa25761acc4..5462e09a2ce 100644 --- a/resource-manager/devtestlab/2018-09-15/galleryimages/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/galleryimages/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/globalschedules/README.md b/resource-manager/devtestlab/2018-09-15/globalschedules/README.md index b49d2d79ccb..80f06528497 100644 --- a/resource-manager/devtestlab/2018-09-15/globalschedules/README.md +++ b/resource-manager/devtestlab/2018-09-15/globalschedules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduleName") payload := globalschedules.Schedule{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduleName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduleName") if err := client.ExecuteThenPoll(ctx, id); err != nil { // handle the error @@ -74,7 +74,7 @@ if err := client.ExecuteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduleName") read, err := client.Get(ctx, id, globalschedules.DefaultGetOperationOptions()) if err != nil { @@ -124,7 +124,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduleName") payload := globalschedules.RetargetScheduleProperties{ // ... @@ -141,7 +141,7 @@ if err := client.RetargetThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := globalschedules.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduleName") payload := globalschedules.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/globalschedules/id_schedule.go b/resource-manager/devtestlab/2018-09-15/globalschedules/id_schedule.go index 9390ae73d13..e93447680a8 100644 --- a/resource-manager/devtestlab/2018-09-15/globalschedules/id_schedule.go +++ b/resource-manager/devtestlab/2018-09-15/globalschedules/id_schedule.go @@ -115,7 +115,7 @@ func (id ScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticSchedules", "schedules", "schedules"), - resourceids.UserSpecifiedSegment("scheduleName", "name"), + resourceids.UserSpecifiedSegment("scheduleName", "scheduleName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/globalschedules/id_schedule_test.go b/resource-manager/devtestlab/2018-09-15/globalschedules/id_schedule_test.go index 5f53679a75b..1a08a95a7dd 100644 --- a/resource-manager/devtestlab/2018-09-15/globalschedules/id_schedule_test.go +++ b/resource-manager/devtestlab/2018-09-15/globalschedules/id_schedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScheduleId{} func TestNewScheduleID(t *testing.T) { - id := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ScheduleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "name") + if id.ScheduleName != "scheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "scheduleName") } } func TestFormatScheduleID(t *testing.T) { - actual := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/name" + actual := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/scheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseScheduleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/scheduleName", Expected: &ScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/scheduleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseScheduleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/scheduleName", Expected: &ScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/schedules/scheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/sChEdUlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/sChEdUlEs/sChEdUlEnAmE", Expected: &ScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ScheduleName: "nAmE", + ScheduleName: "sChEdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/sChEdUlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/sChEdUlEs/sChEdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/globalschedules/model_notificationsettings.go b/resource-manager/devtestlab/2018-09-15/globalschedules/model_notificationsettings.go index b9842a66f7b..b8d0c39569b 100644 --- a/resource-manager/devtestlab/2018-09-15/globalschedules/model_notificationsettings.go +++ b/resource-manager/devtestlab/2018-09-15/globalschedules/model_notificationsettings.go @@ -8,5 +8,5 @@ type NotificationSettings struct { NotificationLocale *string `json:"notificationLocale,omitempty"` Status *EnableStatus `json:"status,omitempty"` TimeInMinutes *int64 `json:"timeInMinutes,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/devtestlab/2018-09-15/labs/README.md b/resource-manager/devtestlab/2018-09-15/labs/README.md index 80efee7570a..9d56c82c7fa 100644 --- a/resource-manager/devtestlab/2018-09-15/labs/README.md +++ b/resource-manager/devtestlab/2018-09-15/labs/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if err := client.ClaimAnyVMThenPoll(ctx, id); err != nil { // handle the error @@ -37,7 +37,7 @@ if err := client.ClaimAnyVMThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") payload := labs.LabVirtualMachineCreationParameter{ // ... @@ -54,7 +54,7 @@ if err := client.CreateEnvironmentThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") payload := labs.Lab{ // ... @@ -71,7 +71,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -83,7 +83,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") payload := labs.ExportResourceUsageParameters{ // ... @@ -100,7 +100,7 @@ if err := client.ExportResourceUsageThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") payload := labs.GenerateUploadUriParameter{ // ... @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") read, err := client.Get(ctx, id, labs.DefaultGetOperationOptions()) if err != nil { @@ -137,7 +137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") payload := labs.ImportLabVirtualMachineRequest{ // ... @@ -188,7 +188,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.ListVhds(ctx, id)` can be used to do batched pagination items, err := client.ListVhdsComplete(ctx, id) @@ -205,7 +205,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := labs.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") payload := labs.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/labs/id_lab.go b/resource-manager/devtestlab/2018-09-15/labs/id_lab.go index 1f23313cbb3..204b3231a24 100644 --- a/resource-manager/devtestlab/2018-09-15/labs/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/labs/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/labs/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/labs/id_lab_test.go index 51c2a19b20b..5271e6f681e 100644 --- a/resource-manager/devtestlab/2018-09-15/labs/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/labs/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/labs/model_notificationsettings.go b/resource-manager/devtestlab/2018-09-15/labs/model_notificationsettings.go index 46e45c6853c..b6467dc6065 100644 --- a/resource-manager/devtestlab/2018-09-15/labs/model_notificationsettings.go +++ b/resource-manager/devtestlab/2018-09-15/labs/model_notificationsettings.go @@ -8,5 +8,5 @@ type NotificationSettings struct { NotificationLocale *string `json:"notificationLocale,omitempty"` Status *EnableStatus `json:"status,omitempty"` TimeInMinutes *int64 `json:"timeInMinutes,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/devtestlab/2018-09-15/notificationchannels/README.md b/resource-manager/devtestlab/2018-09-15/notificationchannels/README.md index c56622d8991..3fca34700fb 100644 --- a/resource-manager/devtestlab/2018-09-15/notificationchannels/README.md +++ b/resource-manager/devtestlab/2018-09-15/notificationchannels/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "notificationChannelName") payload := notificationchannels.NotificationChannel{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "notificationChannelName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "notificationChannelName") read, err := client.Get(ctx, id, notificationchannels.DefaultGetOperationOptions()) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationchannels.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := notificationchannels.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, notificationchannels.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, notificationchannels.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "notificationChannelName") payload := notificationchannels.NotifyParameters{ // ... @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := notificationchannels.NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "notificationChannelName") payload := notificationchannels.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/notificationchannels/id_lab.go b/resource-manager/devtestlab/2018-09-15/notificationchannels/id_lab.go index 1b138e07f70..b9eb058389e 100644 --- a/resource-manager/devtestlab/2018-09-15/notificationchannels/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/notificationchannels/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/notificationchannels/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/notificationchannels/id_lab_test.go index 935aa6f03e5..c2a1d635cd9 100644 --- a/resource-manager/devtestlab/2018-09-15/notificationchannels/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/notificationchannels/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/notificationchannels/id_notificationchannel.go b/resource-manager/devtestlab/2018-09-15/notificationchannels/id_notificationchannel.go index 1a110eece4a..ef5b7e61c9a 100644 --- a/resource-manager/devtestlab/2018-09-15/notificationchannels/id_notificationchannel.go +++ b/resource-manager/devtestlab/2018-09-15/notificationchannels/id_notificationchannel.go @@ -123,7 +123,7 @@ func (id NotificationChannelId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticNotificationChannels", "notificationChannels", "notificationChannels"), - resourceids.UserSpecifiedSegment("notificationChannelName", "name"), + resourceids.UserSpecifiedSegment("notificationChannelName", "notificationChannelName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/notificationchannels/id_notificationchannel_test.go b/resource-manager/devtestlab/2018-09-15/notificationchannels/id_notificationchannel_test.go index 063b6e0f56e..ebfa3869323 100644 --- a/resource-manager/devtestlab/2018-09-15/notificationchannels/id_notificationchannel_test.go +++ b/resource-manager/devtestlab/2018-09-15/notificationchannels/id_notificationchannel_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NotificationChannelId{} func TestNewNotificationChannelID(t *testing.T) { - id := NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "notificationChannelName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNotificationChannelID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.NotificationChannelName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'NotificationChannelName'", id.NotificationChannelName, "name") + if id.NotificationChannelName != "notificationChannelName" { + t.Fatalf("Expected %q but got %q for Segment 'NotificationChannelName'", id.NotificationChannelName, "notificationChannelName") } } func TestFormatNotificationChannelID(t *testing.T) { - actual := NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/name" + actual := NewNotificationChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "notificationChannelName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/notificationChannelName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNotificationChannelID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/notificationChannelName", Expected: &NotificationChannelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - NotificationChannelName: "name", + NotificationChannelName: "notificationChannelName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/notificationChannelName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNotificationChannelIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/notificationChannelName", Expected: &NotificationChannelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - NotificationChannelName: "name", + NotificationChannelName: "notificationChannelName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/notificationChannels/notificationChannelName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/nOtIfIcAtIoNcHaNnElS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/nOtIfIcAtIoNcHaNnElS/nOtIfIcAtIoNcHaNnElNaMe", Expected: &NotificationChannelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - NotificationChannelName: "nAmE", + NotificationChannelName: "nOtIfIcAtIoNcHaNnElNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/nOtIfIcAtIoNcHaNnElS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/nOtIfIcAtIoNcHaNnElS/nOtIfIcAtIoNcHaNnElNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/notificationchannels/model_notificationchannelproperties.go b/resource-manager/devtestlab/2018-09-15/notificationchannels/model_notificationchannelproperties.go index ba710cd83b4..71e709ef4ce 100644 --- a/resource-manager/devtestlab/2018-09-15/notificationchannels/model_notificationchannelproperties.go +++ b/resource-manager/devtestlab/2018-09-15/notificationchannels/model_notificationchannelproperties.go @@ -17,7 +17,7 @@ type NotificationChannelProperties struct { NotificationLocale *string `json:"notificationLocale,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` - WebHookUrl *string `json:"webHookUrl,omitempty"` + WebHookURL *string `json:"webHookUrl,omitempty"` } func (o *NotificationChannelProperties) GetCreatedDateAsTime() (*time.Time, error) { diff --git a/resource-manager/devtestlab/2018-09-15/operations/README.md b/resource-manager/devtestlab/2018-09-15/operations/README.md index 84759c74b72..f088ef064f0 100644 --- a/resource-manager/devtestlab/2018-09-15/operations/README.md +++ b/resource-manager/devtestlab/2018-09-15/operations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := operations.NewOperationID("12345678-1234-9876-4563-123456789012", "locationName", "name") +id := operations.NewOperationID("12345678-1234-9876-4563-123456789012", "locationName", "operationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/devtestlab/2018-09-15/operations/id_operation.go b/resource-manager/devtestlab/2018-09-15/operations/id_operation.go index 1b3a791bb9e..f291088a9f1 100644 --- a/resource-manager/devtestlab/2018-09-15/operations/id_operation.go +++ b/resource-manager/devtestlab/2018-09-15/operations/id_operation.go @@ -115,7 +115,7 @@ func (id OperationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocations", "locations", "locations"), resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticOperations", "operations", "operations"), - resourceids.UserSpecifiedSegment("operationName", "name"), + resourceids.UserSpecifiedSegment("operationName", "operationName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/operations/id_operation_test.go b/resource-manager/devtestlab/2018-09-15/operations/id_operation_test.go index 28efb5f378d..b589494ec4f 100644 --- a/resource-manager/devtestlab/2018-09-15/operations/id_operation_test.go +++ b/resource-manager/devtestlab/2018-09-15/operations/id_operation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OperationId{} func TestNewOperationID(t *testing.T) { - id := NewOperationID("12345678-1234-9876-4563-123456789012", "locationName", "name") + id := NewOperationID("12345678-1234-9876-4563-123456789012", "locationName", "operationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOperationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.OperationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'OperationName'", id.OperationName, "name") + if id.OperationName != "operationName" { + t.Fatalf("Expected %q but got %q for Segment 'OperationName'", id.OperationName, "operationName") } } func TestFormatOperationID(t *testing.T) { - actual := NewOperationID("12345678-1234-9876-4563-123456789012", "locationName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/name" + actual := NewOperationID("12345678-1234-9876-4563-123456789012", "locationName", "operationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/operationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOperationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/operationName", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", - OperationName: "name", + OperationName: "operationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/operationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOperationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/operationName", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", - OperationName: "name", + OperationName: "operationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DevTestLab/locations/locationName/operations/operationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lOcAtIoNs/lOcAtIoNnAmE/oPeRaTiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lOcAtIoNs/lOcAtIoNnAmE/oPeRaTiOnS/oPeRaTiOnNaMe", Expected: &OperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "lOcAtIoNnAmE", - OperationName: "nAmE", + OperationName: "oPeRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lOcAtIoNs/lOcAtIoNnAmE/oPeRaTiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lOcAtIoNs/lOcAtIoNnAmE/oPeRaTiOnS/oPeRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/policies/README.md b/resource-manager/devtestlab/2018-09-15/policies/README.md index 1b8496e5323..5382a33da15 100644 --- a/resource-manager/devtestlab/2018-09-15/policies/README.md +++ b/resource-manager/devtestlab/2018-09-15/policies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := policies.NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "name") +id := policies.NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "policyName") payload := policies.Policy{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policies.NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "name") +id := policies.NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "policyName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policies.NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "name") +id := policies.NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "policyName") read, err := client.Get(ctx, id, policies.DefaultGetOperationOptions()) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := policies.NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "name") +id := policies.NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "policyName") payload := policies.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/policies/id_policy.go b/resource-manager/devtestlab/2018-09-15/policies/id_policy.go index b2cd2d2f244..a5c455edb70 100644 --- a/resource-manager/devtestlab/2018-09-15/policies/id_policy.go +++ b/resource-manager/devtestlab/2018-09-15/policies/id_policy.go @@ -131,7 +131,7 @@ func (id PolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticPolicySets", "policySets", "policySets"), resourceids.UserSpecifiedSegment("policySetName", "policySetName"), resourceids.StaticSegment("staticPolicies", "policies", "policies"), - resourceids.UserSpecifiedSegment("policyName", "name"), + resourceids.UserSpecifiedSegment("policyName", "policyName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/policies/id_policy_test.go b/resource-manager/devtestlab/2018-09-15/policies/id_policy_test.go index 084388b467b..b0f5951c196 100644 --- a/resource-manager/devtestlab/2018-09-15/policies/id_policy_test.go +++ b/resource-manager/devtestlab/2018-09-15/policies/id_policy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PolicyId{} func TestNewPolicyID(t *testing.T) { - id := NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "name") + id := NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "policyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'PolicySetName'", id.PolicySetName, "policySetName") } - if id.PolicyName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'PolicyName'", id.PolicyName, "name") + if id.PolicyName != "policyName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicyName'", id.PolicyName, "policyName") } } func TestFormatPolicyID(t *testing.T) { - actual := NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/name" + actual := NewPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "policySetName", "policyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/policyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParsePolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/policyName", Expected: &PolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", PolicySetName: "policySetName", - PolicyName: "name", + PolicyName: "policyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/policyName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParsePolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/policyName", Expected: &PolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", PolicySetName: "policySetName", - PolicyName: "name", + PolicyName: "policyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/policySets/policySetName/policies/policyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/pOlIcYsEtS/pOlIcYsEtNaMe/pOlIcIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/pOlIcYsEtS/pOlIcYsEtNaMe/pOlIcIeS/pOlIcYnAmE", Expected: &PolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", PolicySetName: "pOlIcYsEtNaMe", - PolicyName: "nAmE", + PolicyName: "pOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/pOlIcYsEtS/pOlIcYsEtNaMe/pOlIcIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/pOlIcYsEtS/pOlIcYsEtNaMe/pOlIcIeS/pOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/schedules/README.md b/resource-manager/devtestlab/2018-09-15/schedules/README.md index 38b75e0c995..4496593c18c 100644 --- a/resource-manager/devtestlab/2018-09-15/schedules/README.md +++ b/resource-manager/devtestlab/2018-09-15/schedules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "scheduleName") payload := schedules.Schedule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "scheduleName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "scheduleName") if err := client.ExecuteThenPoll(ctx, id); err != nil { // handle the error @@ -73,7 +73,7 @@ if err := client.ExecuteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "scheduleName") read, err := client.Get(ctx, id, schedules.DefaultGetOperationOptions()) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := schedules.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := schedules.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, schedules.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, schedules.DefaultListOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "scheduleName") // alternatively `client.ListApplicable(ctx, id)` can be used to do batched pagination items, err := client.ListApplicableComplete(ctx, id) @@ -123,7 +123,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := schedules.NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "scheduleName") payload := schedules.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/schedules/id_lab.go b/resource-manager/devtestlab/2018-09-15/schedules/id_lab.go index afaa0ae50b9..4d4c5921a57 100644 --- a/resource-manager/devtestlab/2018-09-15/schedules/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/schedules/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/schedules/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/schedules/id_lab_test.go index ae19ae173d5..48fa599c589 100644 --- a/resource-manager/devtestlab/2018-09-15/schedules/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/schedules/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/schedules/id_labschedule.go b/resource-manager/devtestlab/2018-09-15/schedules/id_labschedule.go index c765a1d5e94..1ac8670d5aa 100644 --- a/resource-manager/devtestlab/2018-09-15/schedules/id_labschedule.go +++ b/resource-manager/devtestlab/2018-09-15/schedules/id_labschedule.go @@ -123,7 +123,7 @@ func (id LabScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticSchedules", "schedules", "schedules"), - resourceids.UserSpecifiedSegment("scheduleName", "name"), + resourceids.UserSpecifiedSegment("scheduleName", "scheduleName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/schedules/id_labschedule_test.go b/resource-manager/devtestlab/2018-09-15/schedules/id_labschedule_test.go index 864fa2cbe98..c252d87a2ed 100644 --- a/resource-manager/devtestlab/2018-09-15/schedules/id_labschedule_test.go +++ b/resource-manager/devtestlab/2018-09-15/schedules/id_labschedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabScheduleId{} func TestNewLabScheduleID(t *testing.T) { - id := NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "scheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLabScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.ScheduleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "name") + if id.ScheduleName != "scheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "scheduleName") } } func TestFormatLabScheduleID(t *testing.T) { - actual := NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/name" + actual := NewLabScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "scheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/scheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLabScheduleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/scheduleName", Expected: &LabScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/scheduleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLabScheduleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/scheduleName", Expected: &LabScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/schedules/scheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/sChEdUlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/sChEdUlEs/sChEdUlEnAmE", Expected: &LabScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - ScheduleName: "nAmE", + ScheduleName: "sChEdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/sChEdUlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/sChEdUlEs/sChEdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/schedules/model_notificationsettings.go b/resource-manager/devtestlab/2018-09-15/schedules/model_notificationsettings.go index 7f7a26ac704..15d8de7058c 100644 --- a/resource-manager/devtestlab/2018-09-15/schedules/model_notificationsettings.go +++ b/resource-manager/devtestlab/2018-09-15/schedules/model_notificationsettings.go @@ -8,5 +8,5 @@ type NotificationSettings struct { NotificationLocale *string `json:"notificationLocale,omitempty"` Status *EnableStatus `json:"status,omitempty"` TimeInMinutes *int64 `json:"timeInMinutes,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/devtestlab/2018-09-15/secrets/README.md b/resource-manager/devtestlab/2018-09-15/secrets/README.md index 905e0d339ea..8dd40d9c143 100644 --- a/resource-manager/devtestlab/2018-09-15/secrets/README.md +++ b/resource-manager/devtestlab/2018-09-15/secrets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "secretName") payload := secrets.Secret{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "secretName") read, err := client.Delete(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "secretName") read, err := client.Get(ctx, id, secrets.DefaultGetOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := secrets.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := secrets.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") // alternatively `client.List(ctx, id, secrets.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, secrets.DefaultListOperationOptions()) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "secretName") payload := secrets.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/secrets/id_secret.go b/resource-manager/devtestlab/2018-09-15/secrets/id_secret.go index b80015da96a..6d1f9669239 100644 --- a/resource-manager/devtestlab/2018-09-15/secrets/id_secret.go +++ b/resource-manager/devtestlab/2018-09-15/secrets/id_secret.go @@ -131,7 +131,7 @@ func (id SecretId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userName", "userName"), resourceids.StaticSegment("staticSecrets", "secrets", "secrets"), - resourceids.UserSpecifiedSegment("secretName", "name"), + resourceids.UserSpecifiedSegment("secretName", "secretName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/secrets/id_secret_test.go b/resource-manager/devtestlab/2018-09-15/secrets/id_secret_test.go index 273a70d070f..9ee6f6aefcf 100644 --- a/resource-manager/devtestlab/2018-09-15/secrets/id_secret_test.go +++ b/resource-manager/devtestlab/2018-09-15/secrets/id_secret_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecretId{} func TestNewSecretID(t *testing.T) { - id := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") + id := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "secretName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewSecretID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } - if id.SecretName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SecretName'", id.SecretName, "name") + if id.SecretName != "secretName" { + t.Fatalf("Expected %q but got %q for Segment 'SecretName'", id.SecretName, "secretName") } } func TestFormatSecretID(t *testing.T) { - actual := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/name" + actual := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "secretName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/secretName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseSecretID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/secretName", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - SecretName: "name", + SecretName: "secretName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/secretName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseSecretIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/secretName", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - SecretName: "name", + SecretName: "secretName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/secrets/secretName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sEcReTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sEcReTs/sEcReTnAmE", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", UserName: "uSeRnAmE", - SecretName: "nAmE", + SecretName: "sEcReTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sEcReTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sEcReTs/sEcReTnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/secrets/id_user.go b/resource-manager/devtestlab/2018-09-15/secrets/id_user.go index aee35441c64..c9a91dfead5 100644 --- a/resource-manager/devtestlab/2018-09-15/secrets/id_user.go +++ b/resource-manager/devtestlab/2018-09-15/secrets/id_user.go @@ -123,7 +123,7 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "name"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/secrets/id_user_test.go b/resource-manager/devtestlab/2018-09-15/secrets/id_user_test.go index 9da20b2b10d..80b5633083a 100644 --- a/resource-manager/devtestlab/2018-09-15/secrets/id_user_test.go +++ b/resource-manager/devtestlab/2018-09-15/secrets/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.UserName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "name") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseUserID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - UserName: "nAmE", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabrics/README.md b/resource-manager/devtestlab/2018-09-15/servicefabrics/README.md index ee2af03f9bd..c3d51926a0c 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabrics/README.md +++ b/resource-manager/devtestlab/2018-09-15/servicefabrics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") payload := servicefabrics.ServiceFabric{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") read, err := client.Get(ctx, id, servicefabrics.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicefabrics.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := servicefabrics.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") // alternatively `client.List(ctx, id, servicefabrics.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, servicefabrics.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") read, err := client.ListApplicableSchedules(ctx, id) if err != nil { @@ -102,7 +102,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") if err := client.StartThenPoll(ctx, id); err != nil { // handle the error @@ -114,7 +114,7 @@ if err := client.StartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") if err := client.StopThenPoll(ctx, id); err != nil { // handle the error @@ -126,7 +126,7 @@ if err := client.StopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := servicefabrics.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") payload := servicefabrics.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/servicefabrics/id_servicefabric.go b/resource-manager/devtestlab/2018-09-15/servicefabrics/id_servicefabric.go index 0ec0d747d28..356640e9bc3 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabrics/id_servicefabric.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabrics/id_servicefabric.go @@ -131,7 +131,7 @@ func (id ServiceFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userName", "userName"), resourceids.StaticSegment("staticServiceFabrics", "serviceFabrics", "serviceFabrics"), - resourceids.UserSpecifiedSegment("serviceFabricName", "name"), + resourceids.UserSpecifiedSegment("serviceFabricName", "serviceFabricName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabrics/id_servicefabric_test.go b/resource-manager/devtestlab/2018-09-15/servicefabrics/id_servicefabric_test.go index 2156202a0ad..5c746a7b6c8 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabrics/id_servicefabric_test.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabrics/id_servicefabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceFabricId{} func TestNewServiceFabricID(t *testing.T) { - id := NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") + id := NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewServiceFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } - if id.ServiceFabricName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceFabricName'", id.ServiceFabricName, "name") + if id.ServiceFabricName != "serviceFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceFabricName'", id.ServiceFabricName, "serviceFabricName") } } func TestFormatServiceFabricID(t *testing.T) { - actual := NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name" + actual := NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseServiceFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName", Expected: &ServiceFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - ServiceFabricName: "name", + ServiceFabricName: "serviceFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseServiceFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName", Expected: &ServiceFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - ServiceFabricName: "name", + ServiceFabricName: "serviceFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/sErViCeFaBrIcNaMe", Expected: &ServiceFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", UserName: "uSeRnAmE", - ServiceFabricName: "nAmE", + ServiceFabricName: "sErViCeFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/sErViCeFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabrics/id_user.go b/resource-manager/devtestlab/2018-09-15/servicefabrics/id_user.go index 93cdc9207f0..13d5285e885 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabrics/id_user.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabrics/id_user.go @@ -123,7 +123,7 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "name"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabrics/id_user_test.go b/resource-manager/devtestlab/2018-09-15/servicefabrics/id_user_test.go index 337252affe2..edbdb3d5cd8 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabrics/id_user_test.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabrics/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.UserName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "name") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseUserID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - UserName: "nAmE", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabrics/model_notificationsettings.go b/resource-manager/devtestlab/2018-09-15/servicefabrics/model_notificationsettings.go index 68f15826458..901963190ff 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabrics/model_notificationsettings.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabrics/model_notificationsettings.go @@ -8,5 +8,5 @@ type NotificationSettings struct { NotificationLocale *string `json:"notificationLocale,omitempty"` Status *EnableStatus `json:"status,omitempty"` TimeInMinutes *int64 `json:"timeInMinutes,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/README.md b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/README.md index e556fc5eebf..eec9817901a 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/README.md +++ b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "name") +id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "scheduleName") payload := servicefabricschedules.Schedule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "name") +id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "scheduleName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "name") +id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "scheduleName") if err := client.ExecuteThenPoll(ctx, id); err != nil { // handle the error @@ -73,7 +73,7 @@ if err := client.ExecuteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "name") +id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "scheduleName") read, err := client.Get(ctx, id, servicefabricschedules.DefaultGetOperationOptions()) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicefabricschedules.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") +id := servicefabricschedules.NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") // alternatively `client.List(ctx, id, servicefabricschedules.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, servicefabricschedules.DefaultListOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "name") +id := servicefabricschedules.NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "scheduleName") payload := servicefabricschedules.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabric.go b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabric.go index 2608c6b7cc6..51bc18dc2f3 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabric.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabric.go @@ -131,7 +131,7 @@ func (id ServiceFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticUsers", "users", "users"), resourceids.UserSpecifiedSegment("userName", "userName"), resourceids.StaticSegment("staticServiceFabrics", "serviceFabrics", "serviceFabrics"), - resourceids.UserSpecifiedSegment("serviceFabricName", "name"), + resourceids.UserSpecifiedSegment("serviceFabricName", "serviceFabricName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabric_test.go b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabric_test.go index 54d6e6ce9d3..6f42a247c44 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabric_test.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceFabricId{} func TestNewServiceFabricID(t *testing.T) { - id := NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name") + id := NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewServiceFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } - if id.ServiceFabricName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceFabricName'", id.ServiceFabricName, "name") + if id.ServiceFabricName != "serviceFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceFabricName'", id.ServiceFabricName, "serviceFabricName") } } func TestFormatServiceFabricID(t *testing.T) { - actual := NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name" + actual := NewServiceFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseServiceFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName", Expected: &ServiceFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - ServiceFabricName: "name", + ServiceFabricName: "serviceFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseServiceFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName", Expected: &ServiceFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", - ServiceFabricName: "name", + ServiceFabricName: "serviceFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/sErViCeFaBrIcNaMe", Expected: &ServiceFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", UserName: "uSeRnAmE", - ServiceFabricName: "nAmE", + ServiceFabricName: "sErViCeFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/sErViCeFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabricschedule.go b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabricschedule.go index 50466af0920..0db9e32cf39 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabricschedule.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabricschedule.go @@ -139,7 +139,7 @@ func (id ServiceFabricScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticServiceFabrics", "serviceFabrics", "serviceFabrics"), resourceids.UserSpecifiedSegment("serviceFabricName", "serviceFabricName"), resourceids.StaticSegment("staticSchedules", "schedules", "schedules"), - resourceids.UserSpecifiedSegment("scheduleName", "name"), + resourceids.UserSpecifiedSegment("scheduleName", "scheduleName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabricschedule_test.go b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabricschedule_test.go index 70db6ceadff..874b34d39f8 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabricschedule_test.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/id_servicefabricschedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceFabricScheduleId{} func TestNewServiceFabricScheduleID(t *testing.T) { - id := NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "name") + id := NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "scheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,14 +34,14 @@ func TestNewServiceFabricScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServiceFabricName'", id.ServiceFabricName, "serviceFabricName") } - if id.ScheduleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "name") + if id.ScheduleName != "scheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "scheduleName") } } func TestFormatServiceFabricScheduleID(t *testing.T) { - actual := NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/name" + actual := NewServiceFabricScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName", "serviceFabricName", "scheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/scheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -125,19 +125,19 @@ func TestParseServiceFabricScheduleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/scheduleName", Expected: &ServiceFabricScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", ServiceFabricName: "serviceFabricName", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/scheduleName/extra", Error: true, }, } @@ -326,36 +326,36 @@ func TestParseServiceFabricScheduleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/scheduleName", Expected: &ServiceFabricScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", UserName: "userName", ServiceFabricName: "serviceFabricName", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/serviceFabrics/serviceFabricName/schedules/scheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/sErViCeFaBrIcNaMe/sChEdUlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/sErViCeFaBrIcNaMe/sChEdUlEs/sChEdUlEnAmE", Expected: &ServiceFabricScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", UserName: "uSeRnAmE", ServiceFabricName: "sErViCeFaBrIcNaMe", - ScheduleName: "nAmE", + ScheduleName: "sChEdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/sErViCeFaBrIcNaMe/sChEdUlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/sErViCeFaBrIcS/sErViCeFaBrIcNaMe/sChEdUlEs/sChEdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/model_notificationsettings.go b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/model_notificationsettings.go index 2e7b35bed9e..dcd986a8c93 100644 --- a/resource-manager/devtestlab/2018-09-15/servicefabricschedules/model_notificationsettings.go +++ b/resource-manager/devtestlab/2018-09-15/servicefabricschedules/model_notificationsettings.go @@ -8,5 +8,5 @@ type NotificationSettings struct { NotificationLocale *string `json:"notificationLocale,omitempty"` Status *EnableStatus `json:"status,omitempty"` TimeInMinutes *int64 `json:"timeInMinutes,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/devtestlab/2018-09-15/servicerunners/README.md b/resource-manager/devtestlab/2018-09-15/servicerunners/README.md index 56bdf90dc96..45de20f625a 100644 --- a/resource-manager/devtestlab/2018-09-15/servicerunners/README.md +++ b/resource-manager/devtestlab/2018-09-15/servicerunners/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servicerunners.NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := servicerunners.NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "serviceRunnerName") payload := servicerunners.ServiceRunner{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicerunners.NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := servicerunners.NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "serviceRunnerName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servicerunners.NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := servicerunners.NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "serviceRunnerName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/devtestlab/2018-09-15/servicerunners/id_servicerunner.go b/resource-manager/devtestlab/2018-09-15/servicerunners/id_servicerunner.go index 538bdf52f41..9dd643eeb56 100644 --- a/resource-manager/devtestlab/2018-09-15/servicerunners/id_servicerunner.go +++ b/resource-manager/devtestlab/2018-09-15/servicerunners/id_servicerunner.go @@ -123,7 +123,7 @@ func (id ServiceRunnerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticServiceRunners", "serviceRunners", "serviceRunners"), - resourceids.UserSpecifiedSegment("serviceRunnerName", "name"), + resourceids.UserSpecifiedSegment("serviceRunnerName", "serviceRunnerName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/servicerunners/id_servicerunner_test.go b/resource-manager/devtestlab/2018-09-15/servicerunners/id_servicerunner_test.go index 211bb8f8940..2f160fde44c 100644 --- a/resource-manager/devtestlab/2018-09-15/servicerunners/id_servicerunner_test.go +++ b/resource-manager/devtestlab/2018-09-15/servicerunners/id_servicerunner_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceRunnerId{} func TestNewServiceRunnerID(t *testing.T) { - id := NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "serviceRunnerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewServiceRunnerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.ServiceRunnerName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceRunnerName'", id.ServiceRunnerName, "name") + if id.ServiceRunnerName != "serviceRunnerName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceRunnerName'", id.ServiceRunnerName, "serviceRunnerName") } } func TestFormatServiceRunnerID(t *testing.T) { - actual := NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/name" + actual := NewServiceRunnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "serviceRunnerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/serviceRunnerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseServiceRunnerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/serviceRunnerName", Expected: &ServiceRunnerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ServiceRunnerName: "name", + ServiceRunnerName: "serviceRunnerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/serviceRunnerName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseServiceRunnerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/serviceRunnerName", Expected: &ServiceRunnerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - ServiceRunnerName: "name", + ServiceRunnerName: "serviceRunnerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/serviceRunners/serviceRunnerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/sErViCeRuNnErS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/sErViCeRuNnErS/sErViCeRuNnErNaMe", Expected: &ServiceRunnerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - ServiceRunnerName: "nAmE", + ServiceRunnerName: "sErViCeRuNnErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/sErViCeRuNnErS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/sErViCeRuNnErS/sErViCeRuNnErNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/servicerunners/model_identityproperties.go b/resource-manager/devtestlab/2018-09-15/servicerunners/model_identityproperties.go index 866ea989e9f..a5e8a7438b0 100644 --- a/resource-manager/devtestlab/2018-09-15/servicerunners/model_identityproperties.go +++ b/resource-manager/devtestlab/2018-09-15/servicerunners/model_identityproperties.go @@ -4,7 +4,7 @@ package servicerunners // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type IdentityProperties struct { - ClientSecretUrl *string `json:"clientSecretUrl,omitempty"` + ClientSecretURL *string `json:"clientSecretUrl,omitempty"` PrincipalId *string `json:"principalId,omitempty"` TenantId *string `json:"tenantId,omitempty"` Type *ManagedIdentityType `json:"type,omitempty"` diff --git a/resource-manager/devtestlab/2018-09-15/users/README.md b/resource-manager/devtestlab/2018-09-15/users/README.md index 9ec7b4d407a..8bcdc149ddc 100644 --- a/resource-manager/devtestlab/2018-09-15/users/README.md +++ b/resource-manager/devtestlab/2018-09-15/users/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") payload := users.User{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") read, err := client.Get(ctx, id, users.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := users.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := users.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, users.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, users.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := users.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") payload := users.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/users/id_lab.go b/resource-manager/devtestlab/2018-09-15/users/id_lab.go index dd8afbb1985..947fb00348f 100644 --- a/resource-manager/devtestlab/2018-09-15/users/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/users/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/users/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/users/id_lab_test.go index fefab3d578a..f8d6fe81b4d 100644 --- a/resource-manager/devtestlab/2018-09-15/users/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/users/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/users/id_user.go b/resource-manager/devtestlab/2018-09-15/users/id_user.go index d22d91a302d..424dffb01e4 100644 --- a/resource-manager/devtestlab/2018-09-15/users/id_user.go +++ b/resource-manager/devtestlab/2018-09-15/users/id_user.go @@ -123,7 +123,7 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "name"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/users/id_user_test.go b/resource-manager/devtestlab/2018-09-15/users/id_user_test.go index 7bbfacae7ff..bcce1d4d8ac 100644 --- a/resource-manager/devtestlab/2018-09-15/users/id_user_test.go +++ b/resource-manager/devtestlab/2018-09-15/users/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.UserName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "name") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseUserID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - UserName: "name", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - UserName: "nAmE", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachines/README.md b/resource-manager/devtestlab/2018-09-15/virtualmachines/README.md index e9c785cfa52..820df52289c 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachines/README.md +++ b/resource-manager/devtestlab/2018-09-15/virtualmachines/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") payload := virtualmachines.DataDiskProperties{ // ... @@ -41,7 +41,7 @@ if err := client.AddDataDiskThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") payload := virtualmachines.ApplyArtifactsRequest{ // ... @@ -58,7 +58,7 @@ if err := client.ApplyArtifactsThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if err := client.ClaimThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.ClaimThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") payload := virtualmachines.LabVirtualMachine{ // ... @@ -87,7 +87,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -99,7 +99,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") payload := virtualmachines.DetachDataDiskProperties{ // ... @@ -116,7 +116,7 @@ if err := client.DetachDataDiskThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") read, err := client.Get(ctx, id, virtualmachines.DefaultGetOperationOptions()) if err != nil { @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") read, err := client.GetRdpFileContents(ctx, id) if err != nil { @@ -148,7 +148,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualmachines.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, virtualmachines.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, virtualmachines.DefaultListOperationOptions()) @@ -165,7 +165,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") read, err := client.ListApplicableSchedules(ctx, id) if err != nil { @@ -181,7 +181,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if err := client.RedeployThenPoll(ctx, id); err != nil { // handle the error @@ -193,7 +193,7 @@ if err := client.RedeployThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") payload := virtualmachines.ResizeLabVirtualMachineProperties{ // ... @@ -210,7 +210,7 @@ if err := client.ResizeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -222,7 +222,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if err := client.StartThenPoll(ctx, id); err != nil { // handle the error @@ -234,7 +234,7 @@ if err := client.StartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if err := client.StopThenPoll(ctx, id); err != nil { // handle the error @@ -246,7 +246,7 @@ if err := client.StopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if err := client.TransferDisksThenPoll(ctx, id); err != nil { // handle the error @@ -258,7 +258,7 @@ if err := client.TransferDisksThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if err := client.UnClaimThenPoll(ctx, id); err != nil { // handle the error @@ -270,7 +270,7 @@ if err := client.UnClaimThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachines.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") payload := virtualmachines.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachines/id_lab.go b/resource-manager/devtestlab/2018-09-15/virtualmachines/id_lab.go index c0754323725..e7b575724fb 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachines/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachines/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachines/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/virtualmachines/id_lab_test.go index d6718d11219..163b068a794 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachines/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachines/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachines/id_virtualmachine.go b/resource-manager/devtestlab/2018-09-15/virtualmachines/id_virtualmachine.go index 0c9ba26ad6e..a53611ba127 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachines/id_virtualmachine.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachines/id_virtualmachine.go @@ -123,7 +123,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "name"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachines/id_virtualmachine_test.go b/resource-manager/devtestlab/2018-09-15/virtualmachines/id_virtualmachine_test.go index e1f96bf6781..26342d86364 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachines/id_virtualmachine_test.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachines/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.VirtualMachineName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "name") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - VirtualMachineName: "nAmE", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachines/model_notificationsettings.go b/resource-manager/devtestlab/2018-09-15/virtualmachines/model_notificationsettings.go index 684bfe30ec5..d99d9740ebd 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachines/model_notificationsettings.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachines/model_notificationsettings.go @@ -8,5 +8,5 @@ type NotificationSettings struct { NotificationLocale *string `json:"notificationLocale,omitempty"` Status *EnableStatus `json:"status,omitempty"` TimeInMinutes *int64 `json:"timeInMinutes,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/README.md b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/README.md index c6a052b2294..48442d9dbc5 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/README.md +++ b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "name") +id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "scheduleName") payload := virtualmachineschedules.Schedule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "name") +id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "scheduleName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "name") +id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "scheduleName") if err := client.ExecuteThenPoll(ctx, id); err != nil { // handle the error @@ -73,7 +73,7 @@ if err := client.ExecuteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "name") +id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "scheduleName") read, err := client.Get(ctx, id, virtualmachineschedules.DefaultGetOperationOptions()) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualmachineschedules.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualmachineschedules.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") // alternatively `client.List(ctx, id, virtualmachineschedules.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, virtualmachineschedules.DefaultListOperationOptions()) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "name") +id := virtualmachineschedules.NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "scheduleName") payload := virtualmachineschedules.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachine.go b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachine.go index 3c5b72900d8..1336b48d8be 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachine.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachine.go @@ -123,7 +123,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "name"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachine_test.go b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachine_test.go index e971dd3cdc6..bd5545df9fa 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachine_test.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.VirtualMachineName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "name") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - VirtualMachineName: "name", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - VirtualMachineName: "nAmE", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachineschedule.go b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachineschedule.go index e79ccca4b2f..e1ed22ec648 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachineschedule.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachineschedule.go @@ -131,7 +131,7 @@ func (id VirtualMachineScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), resourceids.StaticSegment("staticSchedules", "schedules", "schedules"), - resourceids.UserSpecifiedSegment("scheduleName", "name"), + resourceids.UserSpecifiedSegment("scheduleName", "scheduleName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachineschedule_test.go b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachineschedule_test.go index 39429a158b6..4127aab0b46 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachineschedule_test.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/id_virtualmachineschedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineScheduleId{} func TestNewVirtualMachineScheduleID(t *testing.T) { - id := NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "name") + id := NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "scheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewVirtualMachineScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } - if id.ScheduleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "name") + if id.ScheduleName != "scheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "scheduleName") } } func TestFormatVirtualMachineScheduleID(t *testing.T) { - actual := NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/name" + actual := NewVirtualMachineScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualMachineName", "scheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/scheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseVirtualMachineScheduleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/scheduleName", Expected: &VirtualMachineScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", VirtualMachineName: "virtualMachineName", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/scheduleName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseVirtualMachineScheduleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/scheduleName", Expected: &VirtualMachineScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", VirtualMachineName: "virtualMachineName", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualMachines/virtualMachineName/schedules/scheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/sChEdUlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/sChEdUlEs/sChEdUlEnAmE", Expected: &VirtualMachineScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", VirtualMachineName: "vIrTuAlMaChInEnAmE", - ScheduleName: "nAmE", + ScheduleName: "sChEdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/sChEdUlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/sChEdUlEs/sChEdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/model_notificationsettings.go b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/model_notificationsettings.go index da9a7adc4da..236b71a8af5 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/model_notificationsettings.go +++ b/resource-manager/devtestlab/2018-09-15/virtualmachineschedules/model_notificationsettings.go @@ -8,5 +8,5 @@ type NotificationSettings struct { NotificationLocale *string `json:"notificationLocale,omitempty"` Status *EnableStatus `json:"status,omitempty"` TimeInMinutes *int64 `json:"timeInMinutes,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/devtestlab/2018-09-15/virtualnetworks/README.md b/resource-manager/devtestlab/2018-09-15/virtualnetworks/README.md index d50b248fc3b..486d808b243 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualnetworks/README.md +++ b/resource-manager/devtestlab/2018-09-15/virtualnetworks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualNetworkName") payload := virtualnetworks.VirtualNetwork{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualNetworkName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualNetworkName") read, err := client.Get(ctx, id, virtualnetworks.DefaultGetOperationOptions()) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworks.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := virtualnetworks.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") // alternatively `client.List(ctx, id, virtualnetworks.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, virtualnetworks.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualNetworkName") payload := virtualnetworks.UpdateResource{ // ... diff --git a/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_lab.go b/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_lab.go index 5977b26c6b9..4fb3f9ce62d 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_lab.go +++ b/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_lab.go @@ -115,7 +115,7 @@ func (id LabId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDevTestLab", "Microsoft.DevTestLab", "Microsoft.DevTestLab"), resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "name"), + resourceids.UserSpecifiedSegment("labName", "labName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_lab_test.go b/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_lab_test.go index f1d4222017e..178e7ae5f9e 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_lab_test.go +++ b/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_lab_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LabId{} func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLabID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LabName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "name") + if id.LabName != "labName" { + t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } } func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name" + actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLabID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLabIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LabName: "name", + LabName: "labName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe", Expected: &LabId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "nAmE", + LabName: "lAbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/extra", Error: true, }, } diff --git a/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_virtualnetwork.go b/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_virtualnetwork.go index 6e84cd8efda..eac591849ce 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_virtualnetwork.go +++ b/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_virtualnetwork.go @@ -123,7 +123,7 @@ func (id VirtualNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLabs", "labs", "labs"), resourceids.UserSpecifiedSegment("labName", "labName"), resourceids.StaticSegment("staticVirtualNetworks", "virtualNetworks", "virtualNetworks"), - resourceids.UserSpecifiedSegment("virtualNetworkName", "name"), + resourceids.UserSpecifiedSegment("virtualNetworkName", "virtualNetworkName"), } } diff --git a/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_virtualnetwork_test.go b/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_virtualnetwork_test.go index 5beb353889f..22f9bcea39b 100644 --- a/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_virtualnetwork_test.go +++ b/resource-manager/devtestlab/2018-09-15/virtualnetworks/id_virtualnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkId{} func TestNewVirtualNetworkID(t *testing.T) { - id := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name") + id := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labName") } - if id.VirtualNetworkName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkName'", id.VirtualNetworkName, "name") + if id.VirtualNetworkName != "virtualNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkName'", id.VirtualNetworkName, "virtualNetworkName") } } func TestFormatVirtualNetworkID(t *testing.T) { - actual := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/name" + actual := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labName", "virtualNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/virtualNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualNetworkID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/virtualNetworkName", Expected: &VirtualNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - VirtualNetworkName: "name", + VirtualNetworkName: "virtualNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/virtualNetworkName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualNetworkIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/virtualNetworkName", Expected: &VirtualNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LabName: "labName", - VirtualNetworkName: "name", + VirtualNetworkName: "virtualNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DevTestLab/labs/labName/virtualNetworks/virtualNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlNeTwOrKs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKnAmE", Expected: &VirtualNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LabName: "lAbNaMe", - VirtualNetworkName: "nAmE", + VirtualNetworkName: "vIrTuAlNeTwOrKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlNeTwOrKs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dEvTeStLaB/lAbS/lAbNaMe/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKnAmE/extra", Error: true, }, } diff --git a/resource-manager/digitaltwins/2023-01-31/checknameavailability/README.md b/resource-manager/digitaltwins/2023-01-31/checknameavailability/README.md index 88e629443ed..d372b2079d6 100644 --- a/resource-manager/digitaltwins/2023-01-31/checknameavailability/README.md +++ b/resource-manager/digitaltwins/2023-01-31/checknameavailability/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := checknameavailability.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := checknameavailability.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := checknameavailability.CheckNameRequest{ // ... diff --git a/resource-manager/digitaltwins/2023-01-31/checknameavailability/id_location.go b/resource-manager/digitaltwins/2023-01-31/checknameavailability/id_location.go index 0c68c3a3177..59a2fa65c74 100644 --- a/resource-manager/digitaltwins/2023-01-31/checknameavailability/id_location.go +++ b/resource-manager/digitaltwins/2023-01-31/checknameavailability/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/digitaltwins/2023-01-31/checknameavailability/id_location_test.go b/resource-manager/digitaltwins/2023-01-31/checknameavailability/id_location_test.go index f729f3cbba7..3bb4fadca65 100644 --- a/resource-manager/digitaltwins/2023-01-31/checknameavailability/id_location_test.go +++ b/resource-manager/digitaltwins/2023-01-31/checknameavailability/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DigitalTwins/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/README.md b/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/README.md index b5e10c3207f..dc8055c5bc4 100644 --- a/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/README.md +++ b/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := digitaltwinsinstance.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := digitaltwinsinstance.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") payload := digitaltwinsinstance.DigitalTwinsDescription{ // ... @@ -42,7 +42,7 @@ if err := client.DigitalTwinsCreateOrUpdateThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := digitaltwinsinstance.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := digitaltwinsinstance.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") if err := client.DigitalTwinsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DigitalTwinsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := digitaltwinsinstance.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := digitaltwinsinstance.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") read, err := client.DigitalTwinsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := digitaltwinsinstance.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := digitaltwinsinstance.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") payload := digitaltwinsinstance.DigitalTwinsPatchDescription{ // ... diff --git a/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/id_digitaltwinsinstance.go b/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/id_digitaltwinsinstance.go index 13fb7902ef4..9bd89706890 100644 --- a/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/id_digitaltwinsinstance.go +++ b/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/id_digitaltwinsinstance.go @@ -115,7 +115,7 @@ func (id DigitalTwinsInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticDigitalTwinsInstances", "digitalTwinsInstances", "digitalTwinsInstances"), - resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "resourceName"), + resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "digitalTwinsInstanceName"), } } diff --git a/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/id_digitaltwinsinstance_test.go b/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/id_digitaltwinsinstance_test.go index 5074942a71f..9a30d7dce8e 100644 --- a/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/id_digitaltwinsinstance_test.go +++ b/resource-manager/digitaltwins/2023-01-31/digitaltwinsinstance/id_digitaltwinsinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DigitalTwinsInstanceId{} func TestNewDigitalTwinsInstanceID(t *testing.T) { - id := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDigitalTwinsInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DigitalTwinsInstanceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "resourceName") + if id.DigitalTwinsInstanceName != "digitalTwinsInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "digitalTwinsInstanceName") } } func TestFormatDigitalTwinsInstanceID(t *testing.T) { - actual := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName" + actual := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDigitalTwinsInstanceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDigitalTwinsInstanceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DigitalTwinsInstanceName: "rEsOuRcEnAmE", + DigitalTwinsInstanceName: "dIgItAlTwInSiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/digitaltwins/2023-01-31/endpoints/README.md b/resource-manager/digitaltwins/2023-01-31/endpoints/README.md index 925f6cdd149..25d453e5262 100644 --- a/resource-manager/digitaltwins/2023-01-31/endpoints/README.md +++ b/resource-manager/digitaltwins/2023-01-31/endpoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "endpointName") +id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "endpointName") payload := endpoints.DigitalTwinsEndpointResource{ // ... @@ -41,7 +41,7 @@ if err := client.DigitalTwinsEndpointCreateOrUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "endpointName") +id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "endpointName") if err := client.DigitalTwinsEndpointDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DigitalTwinsEndpointDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "endpointName") +id := endpoints.NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "endpointName") read, err := client.DigitalTwinsEndpointGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := endpoints.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := endpoints.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") // alternatively `client.DigitalTwinsEndpointList(ctx, id)` can be used to do batched pagination items, err := client.DigitalTwinsEndpointListComplete(ctx, id) diff --git a/resource-manager/digitaltwins/2023-01-31/endpoints/id_digitaltwinsinstance.go b/resource-manager/digitaltwins/2023-01-31/endpoints/id_digitaltwinsinstance.go index dcbaf9d7de8..f17e62b47fb 100644 --- a/resource-manager/digitaltwins/2023-01-31/endpoints/id_digitaltwinsinstance.go +++ b/resource-manager/digitaltwins/2023-01-31/endpoints/id_digitaltwinsinstance.go @@ -115,7 +115,7 @@ func (id DigitalTwinsInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticDigitalTwinsInstances", "digitalTwinsInstances", "digitalTwinsInstances"), - resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "resourceName"), + resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "digitalTwinsInstanceName"), } } diff --git a/resource-manager/digitaltwins/2023-01-31/endpoints/id_digitaltwinsinstance_test.go b/resource-manager/digitaltwins/2023-01-31/endpoints/id_digitaltwinsinstance_test.go index fced15561d9..f1bbcfd3b3f 100644 --- a/resource-manager/digitaltwins/2023-01-31/endpoints/id_digitaltwinsinstance_test.go +++ b/resource-manager/digitaltwins/2023-01-31/endpoints/id_digitaltwinsinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DigitalTwinsInstanceId{} func TestNewDigitalTwinsInstanceID(t *testing.T) { - id := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDigitalTwinsInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DigitalTwinsInstanceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "resourceName") + if id.DigitalTwinsInstanceName != "digitalTwinsInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "digitalTwinsInstanceName") } } func TestFormatDigitalTwinsInstanceID(t *testing.T) { - actual := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName" + actual := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDigitalTwinsInstanceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDigitalTwinsInstanceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DigitalTwinsInstanceName: "rEsOuRcEnAmE", + DigitalTwinsInstanceName: "dIgItAlTwInSiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/digitaltwins/2023-01-31/endpoints/id_endpoint.go b/resource-manager/digitaltwins/2023-01-31/endpoints/id_endpoint.go index 5e4ce62b394..ed43bf4f12e 100644 --- a/resource-manager/digitaltwins/2023-01-31/endpoints/id_endpoint.go +++ b/resource-manager/digitaltwins/2023-01-31/endpoints/id_endpoint.go @@ -121,7 +121,7 @@ func (id EndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticDigitalTwinsInstances", "digitalTwinsInstances", "digitalTwinsInstances"), - resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "resourceName"), + resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "digitalTwinsInstanceName"), resourceids.StaticSegment("staticEndpoints", "endpoints", "endpoints"), resourceids.UserSpecifiedSegment("endpointName", "endpointName"), } diff --git a/resource-manager/digitaltwins/2023-01-31/endpoints/id_endpoint_test.go b/resource-manager/digitaltwins/2023-01-31/endpoints/id_endpoint_test.go index b2e0d7f232b..2bfec424d43 100644 --- a/resource-manager/digitaltwins/2023-01-31/endpoints/id_endpoint_test.go +++ b/resource-manager/digitaltwins/2023-01-31/endpoints/id_endpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EndpointId{} func TestNewEndpointID(t *testing.T) { - id := NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "endpointName") + id := NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "endpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DigitalTwinsInstanceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "resourceName") + if id.DigitalTwinsInstanceName != "digitalTwinsInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "digitalTwinsInstanceName") } if id.EndpointName != "endpointName" { @@ -32,8 +32,8 @@ func TestNewEndpointID(t *testing.T) { } func TestFormatEndpointID(t *testing.T) { - actual := NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "endpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/endpoints/endpointName" + actual := NewEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "endpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/endpoints/endpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseEndpointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/endpoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/endpoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/endpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/endpoints/endpointName", Expected: &EndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", EndpointName: "endpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/endpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/endpoints/endpointName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseEndpointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/endpoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/endpoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/eNdPoInTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/eNdPoInTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/endpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/endpoints/endpointName", Expected: &EndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", EndpointName: "endpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/endpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/endpoints/endpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/eNdPoInTs/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/eNdPoInTs/eNdPoInTnAmE", Expected: &EndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DigitalTwinsInstanceName: "rEsOuRcEnAmE", + DigitalTwinsInstanceName: "dIgItAlTwInSiNsTaNcEnAmE", EndpointName: "eNdPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/eNdPoInTs/eNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/eNdPoInTs/eNdPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/digitaltwins/2023-01-31/privateendpoints/README.md b/resource-manager/digitaltwins/2023-01-31/privateendpoints/README.md index 705994f57e5..2e646be13fc 100644 --- a/resource-manager/digitaltwins/2023-01-31/privateendpoints/README.md +++ b/resource-manager/digitaltwins/2023-01-31/privateendpoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpoints.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "privateEndpointConnectionName") payload := privateendpoints.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.PrivateEndpointConnectionsCreateOrUpdateThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpoints.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "privateEndpointConnectionName") if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpoints.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "privateEndpointConnectionName") read, err := client.PrivateEndpointConnectionsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpoints.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpoints.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") read, err := client.PrivateEndpointConnectionsList(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpoints.NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") +id := privateendpoints.NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") read, err := client.PrivateLinkResourcesGet(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpoints.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpoints.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") read, err := client.PrivateLinkResourcesList(ctx, id) if err != nil { diff --git a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_digitaltwinsinstance.go b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_digitaltwinsinstance.go index e502df024d9..baa44683c37 100644 --- a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_digitaltwinsinstance.go +++ b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_digitaltwinsinstance.go @@ -115,7 +115,7 @@ func (id DigitalTwinsInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticDigitalTwinsInstances", "digitalTwinsInstances", "digitalTwinsInstances"), - resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "resourceName"), + resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "digitalTwinsInstanceName"), } } diff --git a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_digitaltwinsinstance_test.go b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_digitaltwinsinstance_test.go index da0d6e0a454..0c53434f454 100644 --- a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_digitaltwinsinstance_test.go +++ b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_digitaltwinsinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DigitalTwinsInstanceId{} func TestNewDigitalTwinsInstanceID(t *testing.T) { - id := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDigitalTwinsInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DigitalTwinsInstanceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "resourceName") + if id.DigitalTwinsInstanceName != "digitalTwinsInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "digitalTwinsInstanceName") } } func TestFormatDigitalTwinsInstanceID(t *testing.T) { - actual := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName" + actual := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDigitalTwinsInstanceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDigitalTwinsInstanceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DigitalTwinsInstanceName: "rEsOuRcEnAmE", + DigitalTwinsInstanceName: "dIgItAlTwInSiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_privateendpointconnection.go b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_privateendpointconnection.go index e83b1d48a07..97d8ae8fe1a 100644 --- a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_privateendpointconnection.go +++ b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticDigitalTwinsInstances", "digitalTwinsInstances", "digitalTwinsInstances"), - resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "resourceName"), + resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "digitalTwinsInstanceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_privateendpointconnection_test.go b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_privateendpointconnection_test.go index 5d6252494ad..2e92afe30c7 100644 --- a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_privateendpointconnection_test.go +++ b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DigitalTwinsInstanceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "resourceName") + if id.DigitalTwinsInstanceName != "digitalTwinsInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "digitalTwinsInstanceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DigitalTwinsInstanceName: "rEsOuRcEnAmE", + DigitalTwinsInstanceName: "dIgItAlTwInSiNsTaNcEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_resource.go b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_resource.go index 517f5b4ca3c..da062d72e85 100644 --- a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_resource.go +++ b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_resource.go @@ -121,7 +121,7 @@ func (id ResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticDigitalTwinsInstances", "digitalTwinsInstances", "digitalTwinsInstances"), - resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "resourceName"), + resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "digitalTwinsInstanceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.ScopeSegment("resourceId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), } diff --git a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_resource_test.go b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_resource_test.go index 4144a271279..3ef7a3d1ce3 100644 --- a/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_resource_test.go +++ b/resource-manager/digitaltwins/2023-01-31/privateendpoints/id_resource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ResourceId{} func TestNewResourceID(t *testing.T) { - id := NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + id := NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DigitalTwinsInstanceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "resourceName") + if id.DigitalTwinsInstanceName != "digitalTwinsInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "digitalTwinsInstanceName") } if id.ResourceId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { @@ -32,8 +32,8 @@ func TestNewResourceID(t *testing.T) { } func TestFormatResourceID(t *testing.T) { - actual := NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateLinkResources/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" + actual := NewResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateLinkResources/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,21 +87,21 @@ func TestParseResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateLinkResources/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateLinkResources/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &ResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", ResourceId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, @@ -223,41 +223,41 @@ func TestParseResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/privateLinkResources/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/privateLinkResources/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", Expected: &ResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", ResourceId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", }, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/pRiVaTeLiNkReSoUrCeS/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", Expected: &ResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DigitalTwinsInstanceName: "rEsOuRcEnAmE", + DigitalTwinsInstanceName: "dIgItAlTwInSiNsTaNcEnAmE", ResourceId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", }, }, diff --git a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/README.md b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/README.md index 432ec7d7b9d..c5a09cc8b0c 100644 --- a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/README.md +++ b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := timeseriesdatabaseconnections.NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "timeSeriesDatabaseConnectionName") +id := timeseriesdatabaseconnections.NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "timeSeriesDatabaseConnectionName") payload := timeseriesdatabaseconnections.TimeSeriesDatabaseConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := timeseriesdatabaseconnections.NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "timeSeriesDatabaseConnectionName") +id := timeseriesdatabaseconnections.NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "timeSeriesDatabaseConnectionName") if err := client.DeleteThenPoll(ctx, id, timeseriesdatabaseconnections.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, timeseriesdatabaseconnections.DefaultDe ```go ctx := context.TODO() -id := timeseriesdatabaseconnections.NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "timeSeriesDatabaseConnectionName") +id := timeseriesdatabaseconnections.NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "timeSeriesDatabaseConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := timeseriesdatabaseconnections.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := timeseriesdatabaseconnections.NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_digitaltwinsinstance.go b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_digitaltwinsinstance.go index 7bad479c1c1..ba659fbe36e 100644 --- a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_digitaltwinsinstance.go +++ b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_digitaltwinsinstance.go @@ -115,7 +115,7 @@ func (id DigitalTwinsInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticDigitalTwinsInstances", "digitalTwinsInstances", "digitalTwinsInstances"), - resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "resourceName"), + resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "digitalTwinsInstanceName"), } } diff --git a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_digitaltwinsinstance_test.go b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_digitaltwinsinstance_test.go index a4e603b36d8..6ab9f96f484 100644 --- a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_digitaltwinsinstance_test.go +++ b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_digitaltwinsinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DigitalTwinsInstanceId{} func TestNewDigitalTwinsInstanceID(t *testing.T) { - id := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDigitalTwinsInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DigitalTwinsInstanceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "resourceName") + if id.DigitalTwinsInstanceName != "digitalTwinsInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "digitalTwinsInstanceName") } } func TestFormatDigitalTwinsInstanceID(t *testing.T) { - actual := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName" + actual := NewDigitalTwinsInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDigitalTwinsInstanceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDigitalTwinsInstanceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE", Expected: &DigitalTwinsInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DigitalTwinsInstanceName: "rEsOuRcEnAmE", + DigitalTwinsInstanceName: "dIgItAlTwInSiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_timeseriesdatabaseconnection.go b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_timeseriesdatabaseconnection.go index 047031ea15f..8a9903ca3bd 100644 --- a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_timeseriesdatabaseconnection.go +++ b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_timeseriesdatabaseconnection.go @@ -121,7 +121,7 @@ func (id TimeSeriesDatabaseConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDigitalTwins", "Microsoft.DigitalTwins", "Microsoft.DigitalTwins"), resourceids.StaticSegment("staticDigitalTwinsInstances", "digitalTwinsInstances", "digitalTwinsInstances"), - resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "resourceName"), + resourceids.UserSpecifiedSegment("digitalTwinsInstanceName", "digitalTwinsInstanceName"), resourceids.StaticSegment("staticTimeSeriesDatabaseConnections", "timeSeriesDatabaseConnections", "timeSeriesDatabaseConnections"), resourceids.UserSpecifiedSegment("timeSeriesDatabaseConnectionName", "timeSeriesDatabaseConnectionName"), } diff --git a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_timeseriesdatabaseconnection_test.go b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_timeseriesdatabaseconnection_test.go index 98ce31d25ab..86b938e59e4 100644 --- a/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_timeseriesdatabaseconnection_test.go +++ b/resource-manager/digitaltwins/2023-01-31/timeseriesdatabaseconnections/id_timeseriesdatabaseconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TimeSeriesDatabaseConnectionId{} func TestNewTimeSeriesDatabaseConnectionID(t *testing.T) { - id := NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "timeSeriesDatabaseConnectionName") + id := NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "timeSeriesDatabaseConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTimeSeriesDatabaseConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DigitalTwinsInstanceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "resourceName") + if id.DigitalTwinsInstanceName != "digitalTwinsInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'DigitalTwinsInstanceName'", id.DigitalTwinsInstanceName, "digitalTwinsInstanceName") } if id.TimeSeriesDatabaseConnectionName != "timeSeriesDatabaseConnectionName" { @@ -32,8 +32,8 @@ func TestNewTimeSeriesDatabaseConnectionID(t *testing.T) { } func TestFormatTimeSeriesDatabaseConnectionID(t *testing.T) { - actual := NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "timeSeriesDatabaseConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName" + actual := NewTimeSeriesDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "digitalTwinsInstanceName", "timeSeriesDatabaseConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTimeSeriesDatabaseConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/timeSeriesDatabaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/timeSeriesDatabaseConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName", Expected: &TimeSeriesDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", TimeSeriesDatabaseConnectionName: "timeSeriesDatabaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTimeSeriesDatabaseConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/timeSeriesDatabaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/timeSeriesDatabaseConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/tImEsErIeSdAtAbAsEcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/tImEsErIeSdAtAbAsEcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName", Expected: &TimeSeriesDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DigitalTwinsInstanceName: "resourceName", + DigitalTwinsInstanceName: "digitalTwinsInstanceName", TimeSeriesDatabaseConnectionName: "timeSeriesDatabaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/resourceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DigitalTwins/digitalTwinsInstances/digitalTwinsInstanceName/timeSeriesDatabaseConnections/timeSeriesDatabaseConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/tImEsErIeSdAtAbAsEcOnNeCtIoNs/tImEsErIeSdAtAbAsEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/tImEsErIeSdAtAbAsEcOnNeCtIoNs/tImEsErIeSdAtAbAsEcOnNeCtIoNnAmE", Expected: &TimeSeriesDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DigitalTwinsInstanceName: "rEsOuRcEnAmE", + DigitalTwinsInstanceName: "dIgItAlTwInSiNsTaNcEnAmE", TimeSeriesDatabaseConnectionName: "tImEsErIeSdAtAbAsEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/rEsOuRcEnAmE/tImEsErIeSdAtAbAsEcOnNeCtIoNs/tImEsErIeSdAtAbAsEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dIgItAlTwInS/dIgItAlTwInSiNsTaNcEs/dIgItAlTwInSiNsTaNcEnAmE/tImEsErIeSdAtAbAsEcOnNeCtIoNs/tImEsErIeSdAtAbAsEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/dns/2018-05-01/recordsets/README.md b/resource-manager/dns/2018-05-01/recordsets/README.md index 1ef09c82513..b64e26c566b 100644 --- a/resource-manager/dns/2018-05-01/recordsets/README.md +++ b/resource-manager/dns/2018-05-01/recordsets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A", "relativeRecordSetName") payload := recordsets.RecordSet{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A", "relativeRecordSetName") read, err := client.Delete(ctx, id, recordsets.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A", "relativeRecordSetName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName") +id := recordsets.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName") // alternatively `client.ListAllByDnsZone(ctx, id, recordsets.DefaultListAllByDnsZoneOperationOptions())` can be used to do batched pagination items, err := client.ListAllByDnsZoneComplete(ctx, id, recordsets.DefaultListAllByDnsZoneOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := recordsets.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName") +id := recordsets.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName") // alternatively `client.ListByDnsZone(ctx, id, recordsets.DefaultListByDnsZoneOperationOptions())` can be used to do batched pagination items, err := client.ListByDnsZoneComplete(ctx, id, recordsets.DefaultListByDnsZoneOperationOptions()) @@ -111,7 +111,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := recordsets.NewZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A") +id := recordsets.NewZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A") // alternatively `client.ListByType(ctx, id, recordsets.DefaultListByTypeOperationOptions())` can be used to do batched pagination items, err := client.ListByTypeComplete(ctx, id, recordsets.DefaultListByTypeOperationOptions()) @@ -128,7 +128,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A", "relativeRecordSetName") payload := recordsets.RecordSet{ // ... diff --git a/resource-manager/dns/2018-05-01/recordsets/id_dnszone.go b/resource-manager/dns/2018-05-01/recordsets/id_dnszone.go index cc2d449ccbf..0ce4a125c86 100644 --- a/resource-manager/dns/2018-05-01/recordsets/id_dnszone.go +++ b/resource-manager/dns/2018-05-01/recordsets/id_dnszone.go @@ -115,7 +115,7 @@ func (id DnsZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticDnsZones", "dnsZones", "dnsZones"), - resourceids.UserSpecifiedSegment("dnsZoneName", "zoneName"), + resourceids.UserSpecifiedSegment("dnsZoneName", "dnsZoneName"), } } diff --git a/resource-manager/dns/2018-05-01/recordsets/id_dnszone_test.go b/resource-manager/dns/2018-05-01/recordsets/id_dnszone_test.go index ef0b1fcabad..f209b95420a 100644 --- a/resource-manager/dns/2018-05-01/recordsets/id_dnszone_test.go +++ b/resource-manager/dns/2018-05-01/recordsets/id_dnszone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DnsZoneId{} func TestNewDnsZoneID(t *testing.T) { - id := NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName") + id := NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDnsZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DnsZoneName != "zoneName" { - t.Fatalf("Expected %q but got %q for Segment 'DnsZoneName'", id.DnsZoneName, "zoneName") + if id.DnsZoneName != "dnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'DnsZoneName'", id.DnsZoneName, "dnsZoneName") } } func TestFormatDnsZoneID(t *testing.T) { - actual := NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName" + actual := NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDnsZoneID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName", Expected: &DnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DnsZoneName: "zoneName", + DnsZoneName: "dnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDnsZoneIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName", Expected: &DnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DnsZoneName: "zoneName", + DnsZoneName: "dnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe", Expected: &DnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DnsZoneName: "zOnEnAmE", + DnsZoneName: "dNsZoNeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe/extra", Error: true, }, } diff --git a/resource-manager/dns/2018-05-01/recordsets/id_recordtype.go b/resource-manager/dns/2018-05-01/recordsets/id_recordtype.go index 2efddaeeaca..f48781a8c1a 100644 --- a/resource-manager/dns/2018-05-01/recordsets/id_recordtype.go +++ b/resource-manager/dns/2018-05-01/recordsets/id_recordtype.go @@ -135,7 +135,7 @@ func (id RecordTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticDnsZones", "dnsZones", "dnsZones"), - resourceids.UserSpecifiedSegment("dnsZoneName", "zoneName"), + resourceids.UserSpecifiedSegment("dnsZoneName", "dnsZoneName"), resourceids.ConstantSegment("recordType", PossibleValuesForRecordType(), "A"), resourceids.UserSpecifiedSegment("relativeRecordSetName", "relativeRecordSetName"), } diff --git a/resource-manager/dns/2018-05-01/recordsets/id_recordtype_test.go b/resource-manager/dns/2018-05-01/recordsets/id_recordtype_test.go index f14ec5b61ca..4ac80e669f0 100644 --- a/resource-manager/dns/2018-05-01/recordsets/id_recordtype_test.go +++ b/resource-manager/dns/2018-05-01/recordsets/id_recordtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecordTypeId{} func TestNewRecordTypeID(t *testing.T) { - id := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A", "relativeRecordSetName") + id := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A", "relativeRecordSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRecordTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DnsZoneName != "zoneName" { - t.Fatalf("Expected %q but got %q for Segment 'DnsZoneName'", id.DnsZoneName, "zoneName") + if id.DnsZoneName != "dnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'DnsZoneName'", id.DnsZoneName, "dnsZoneName") } if id.RecordType != "A" { @@ -36,8 +36,8 @@ func TestNewRecordTypeID(t *testing.T) { } func TestFormatRecordTypeID(t *testing.T) { - actual := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A", "relativeRecordSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A/relativeRecordSetName" + actual := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A", "relativeRecordSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A/relativeRecordSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,28 +91,28 @@ func TestParseRecordTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A/relativeRecordSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A/relativeRecordSetName", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DnsZoneName: "zoneName", + DnsZoneName: "dnsZoneName", RecordType: "A", RelativeRecordSetName: "relativeRecordSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A/relativeRecordSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A/relativeRecordSetName/extra", Error: true, }, } @@ -237,54 +237,54 @@ func TestParseRecordTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE/a", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe/a", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A/relativeRecordSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A/relativeRecordSetName", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DnsZoneName: "zoneName", + DnsZoneName: "dnsZoneName", RecordType: "A", RelativeRecordSetName: "relativeRecordSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A/relativeRecordSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A/relativeRecordSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE/a/rElAtIvErEcOrDsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe/a/rElAtIvErEcOrDsEtNaMe", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DnsZoneName: "zOnEnAmE", + DnsZoneName: "dNsZoNeNaMe", RecordType: "A", RelativeRecordSetName: "rElAtIvErEcOrDsEtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE/a/rElAtIvErEcOrDsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe/a/rElAtIvErEcOrDsEtNaMe/extra", Error: true, }, } diff --git a/resource-manager/dns/2018-05-01/recordsets/id_zone.go b/resource-manager/dns/2018-05-01/recordsets/id_zone.go index e912608f2af..904a58824ab 100644 --- a/resource-manager/dns/2018-05-01/recordsets/id_zone.go +++ b/resource-manager/dns/2018-05-01/recordsets/id_zone.go @@ -129,7 +129,7 @@ func (id ZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticDnsZones", "dnsZones", "dnsZones"), - resourceids.UserSpecifiedSegment("dnsZoneName", "zoneName"), + resourceids.UserSpecifiedSegment("dnsZoneName", "dnsZoneName"), resourceids.ConstantSegment("recordType", PossibleValuesForRecordType(), "A"), } } diff --git a/resource-manager/dns/2018-05-01/recordsets/id_zone_test.go b/resource-manager/dns/2018-05-01/recordsets/id_zone_test.go index ec071f5ae08..bb7ea30a6b0 100644 --- a/resource-manager/dns/2018-05-01/recordsets/id_zone_test.go +++ b/resource-manager/dns/2018-05-01/recordsets/id_zone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ZoneId{} func TestNewZoneID(t *testing.T) { - id := NewZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A") + id := NewZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DnsZoneName != "zoneName" { - t.Fatalf("Expected %q but got %q for Segment 'DnsZoneName'", id.DnsZoneName, "zoneName") + if id.DnsZoneName != "dnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'DnsZoneName'", id.DnsZoneName, "dnsZoneName") } if id.RecordType != "A" { @@ -32,8 +32,8 @@ func TestNewZoneID(t *testing.T) { } func TestFormatZoneID(t *testing.T) { - actual := NewZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName", "A").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A" + actual := NewZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName", "A").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,22 +87,22 @@ func TestParseZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A", Expected: &ZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DnsZoneName: "zoneName", + DnsZoneName: "dnsZoneName", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A/extra", Error: true, }, } @@ -223,42 +223,42 @@ func TestParseZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A", Expected: &ZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DnsZoneName: "zoneName", + DnsZoneName: "dnsZoneName", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/A/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/A/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE/a", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe/a", Expected: &ZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DnsZoneName: "zOnEnAmE", + DnsZoneName: "dNsZoNeNaMe", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE/a/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe/a/extra", Error: true, }, } diff --git a/resource-manager/dns/2018-05-01/zones/README.md b/resource-manager/dns/2018-05-01/zones/README.md index 64d377a963f..deeef34a605 100644 --- a/resource-manager/dns/2018-05-01/zones/README.md +++ b/resource-manager/dns/2018-05-01/zones/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := zones.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName") +id := zones.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName") payload := zones.Zone{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := zones.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName") +id := zones.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName") if err := client.DeleteThenPoll(ctx, id, zones.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id, zones.DefaultDeleteOperationOptions()); ```go ctx := context.TODO() -id := zones.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName") +id := zones.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName") read, err := client.Get(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := zones.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName") +id := zones.NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName") payload := zones.ZoneUpdate{ // ... diff --git a/resource-manager/dns/2018-05-01/zones/id_dnszone.go b/resource-manager/dns/2018-05-01/zones/id_dnszone.go index 211308a108b..ac97aa86340 100644 --- a/resource-manager/dns/2018-05-01/zones/id_dnszone.go +++ b/resource-manager/dns/2018-05-01/zones/id_dnszone.go @@ -115,7 +115,7 @@ func (id DnsZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticDnsZones", "dnsZones", "dnsZones"), - resourceids.UserSpecifiedSegment("dnsZoneName", "zoneName"), + resourceids.UserSpecifiedSegment("dnsZoneName", "dnsZoneName"), } } diff --git a/resource-manager/dns/2018-05-01/zones/id_dnszone_test.go b/resource-manager/dns/2018-05-01/zones/id_dnszone_test.go index 9615ca78a65..6bf3e004b70 100644 --- a/resource-manager/dns/2018-05-01/zones/id_dnszone_test.go +++ b/resource-manager/dns/2018-05-01/zones/id_dnszone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DnsZoneId{} func TestNewDnsZoneID(t *testing.T) { - id := NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName") + id := NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDnsZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DnsZoneName != "zoneName" { - t.Fatalf("Expected %q but got %q for Segment 'DnsZoneName'", id.DnsZoneName, "zoneName") + if id.DnsZoneName != "dnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'DnsZoneName'", id.DnsZoneName, "dnsZoneName") } } func TestFormatDnsZoneID(t *testing.T) { - actual := NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "zoneName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName" + actual := NewDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dnsZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDnsZoneID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName", Expected: &DnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DnsZoneName: "zoneName", + DnsZoneName: "dnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDnsZoneIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName", Expected: &DnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DnsZoneName: "zoneName", + DnsZoneName: "dnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/zoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dnsZones/dnsZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe", Expected: &DnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DnsZoneName: "zOnEnAmE", + DnsZoneName: "dNsZoNeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/zOnEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dNsZoNeS/dNsZoNeNaMe/extra", Error: true, }, } diff --git a/resource-manager/dynatrace/2021-09-01/monitors/model_dynatracesinglesignonproperties.go b/resource-manager/dynatrace/2021-09-01/monitors/model_dynatracesinglesignonproperties.go index dc6953a41f9..e4127bd7317 100644 --- a/resource-manager/dynatrace/2021-09-01/monitors/model_dynatracesinglesignonproperties.go +++ b/resource-manager/dynatrace/2021-09-01/monitors/model_dynatracesinglesignonproperties.go @@ -8,5 +8,5 @@ type DynatraceSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/dynatrace/2021-09-01/monitors/model_ssodetailsresponse.go b/resource-manager/dynatrace/2021-09-01/monitors/model_ssodetailsresponse.go index 9437660c7f9..e25604ac82f 100644 --- a/resource-manager/dynatrace/2021-09-01/monitors/model_ssodetailsresponse.go +++ b/resource-manager/dynatrace/2021-09-01/monitors/model_ssodetailsresponse.go @@ -7,6 +7,6 @@ type SSODetailsResponse struct { AadDomains *[]string `json:"aadDomains,omitempty"` AdminUsers *[]string `json:"adminUsers,omitempty"` IsSsoEnabled *SSOStatus `json:"isSsoEnabled,omitempty"` - MetadataUrl *string `json:"metadataUrl,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + MetadataURL *string `json:"metadataUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/dynatrace/2021-09-01/singlesignon/README.md b/resource-manager/dynatrace/2021-09-01/singlesignon/README.md index 0ea764edfb3..1bc4ed2ef65 100644 --- a/resource-manager/dynatrace/2021-09-01/singlesignon/README.md +++ b/resource-manager/dynatrace/2021-09-01/singlesignon/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") payload := singlesignon.DynatraceSingleSignOnResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/dynatrace/2021-09-01/singlesignon/id_singlesignonconfiguration.go b/resource-manager/dynatrace/2021-09-01/singlesignon/id_singlesignonconfiguration.go index c8e33f80f9c..89bd69dfe4e 100644 --- a/resource-manager/dynatrace/2021-09-01/singlesignon/id_singlesignonconfiguration.go +++ b/resource-manager/dynatrace/2021-09-01/singlesignon/id_singlesignonconfiguration.go @@ -123,7 +123,7 @@ func (id SingleSignOnConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticSingleSignOnConfigurations", "singleSignOnConfigurations", "singleSignOnConfigurations"), - resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "singleSignOnConfigurationName"), } } diff --git a/resource-manager/dynatrace/2021-09-01/singlesignon/id_singlesignonconfiguration_test.go b/resource-manager/dynatrace/2021-09-01/singlesignon/id_singlesignonconfiguration_test.go index db5c46a0c68..bfa2f29eec7 100644 --- a/resource-manager/dynatrace/2021-09-01/singlesignon/id_singlesignonconfiguration_test.go +++ b/resource-manager/dynatrace/2021-09-01/singlesignon/id_singlesignonconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SingleSignOnConfigurationId{} func TestNewSingleSignOnConfigurationID(t *testing.T) { - id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") + id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSingleSignOnConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.SingleSignOnConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "configurationName") + if id.SingleSignOnConfigurationName != "singleSignOnConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "singleSignOnConfigurationName") } } func TestFormatSingleSignOnConfigurationID(t *testing.T) { - actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName" + actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSingleSignOnConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSingleSignOnConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - SingleSignOnConfigurationName: "cOnFiGuRaTiOnNaMe", + SingleSignOnConfigurationName: "sInGlEsIgNoNcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/dynatrace/2021-09-01/singlesignon/model_dynatracesinglesignonproperties.go b/resource-manager/dynatrace/2021-09-01/singlesignon/model_dynatracesinglesignonproperties.go index 0855507d5f9..2ed56325d50 100644 --- a/resource-manager/dynatrace/2021-09-01/singlesignon/model_dynatracesinglesignonproperties.go +++ b/resource-manager/dynatrace/2021-09-01/singlesignon/model_dynatracesinglesignonproperties.go @@ -8,5 +8,5 @@ type DynatraceSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/dynatrace/2021-09-01/tagrules/README.md b/resource-manager/dynatrace/2021-09-01/tagrules/README.md index 035690f05b4..ae32e8e0992 100644 --- a/resource-manager/dynatrace/2021-09-01/tagrules/README.md +++ b/resource-manager/dynatrace/2021-09-01/tagrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRuleUpdate{ // ... diff --git a/resource-manager/dynatrace/2021-09-01/tagrules/id_tagrule.go b/resource-manager/dynatrace/2021-09-01/tagrules/id_tagrule.go index e5e44a4331e..4f63d64c60c 100644 --- a/resource-manager/dynatrace/2021-09-01/tagrules/id_tagrule.go +++ b/resource-manager/dynatrace/2021-09-01/tagrules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/dynatrace/2021-09-01/tagrules/id_tagrule_test.go b/resource-manager/dynatrace/2021-09-01/tagrules/id_tagrule_test.go index 7d1fb2eb052..3ba00ec612e 100644 --- a/resource-manager/dynatrace/2021-09-01/tagrules/id_tagrule_test.go +++ b/resource-manager/dynatrace/2021-09-01/tagrules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/dynatrace/2023-04-27/monitors/model_dynatracesinglesignonproperties.go b/resource-manager/dynatrace/2023-04-27/monitors/model_dynatracesinglesignonproperties.go index dc6953a41f9..e4127bd7317 100644 --- a/resource-manager/dynatrace/2023-04-27/monitors/model_dynatracesinglesignonproperties.go +++ b/resource-manager/dynatrace/2023-04-27/monitors/model_dynatracesinglesignonproperties.go @@ -8,5 +8,5 @@ type DynatraceSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/dynatrace/2023-04-27/monitors/model_ssodetailsresponse.go b/resource-manager/dynatrace/2023-04-27/monitors/model_ssodetailsresponse.go index 9437660c7f9..e25604ac82f 100644 --- a/resource-manager/dynatrace/2023-04-27/monitors/model_ssodetailsresponse.go +++ b/resource-manager/dynatrace/2023-04-27/monitors/model_ssodetailsresponse.go @@ -7,6 +7,6 @@ type SSODetailsResponse struct { AadDomains *[]string `json:"aadDomains,omitempty"` AdminUsers *[]string `json:"adminUsers,omitempty"` IsSsoEnabled *SSOStatus `json:"isSsoEnabled,omitempty"` - MetadataUrl *string `json:"metadataUrl,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + MetadataURL *string `json:"metadataUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/dynatrace/2023-04-27/singlesignon/README.md b/resource-manager/dynatrace/2023-04-27/singlesignon/README.md index 166ff882eb0..3d662ebff16 100644 --- a/resource-manager/dynatrace/2023-04-27/singlesignon/README.md +++ b/resource-manager/dynatrace/2023-04-27/singlesignon/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") payload := singlesignon.DynatraceSingleSignOnResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/dynatrace/2023-04-27/singlesignon/id_singlesignonconfiguration.go b/resource-manager/dynatrace/2023-04-27/singlesignon/id_singlesignonconfiguration.go index c8e33f80f9c..89bd69dfe4e 100644 --- a/resource-manager/dynatrace/2023-04-27/singlesignon/id_singlesignonconfiguration.go +++ b/resource-manager/dynatrace/2023-04-27/singlesignon/id_singlesignonconfiguration.go @@ -123,7 +123,7 @@ func (id SingleSignOnConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticSingleSignOnConfigurations", "singleSignOnConfigurations", "singleSignOnConfigurations"), - resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "singleSignOnConfigurationName"), } } diff --git a/resource-manager/dynatrace/2023-04-27/singlesignon/id_singlesignonconfiguration_test.go b/resource-manager/dynatrace/2023-04-27/singlesignon/id_singlesignonconfiguration_test.go index db5c46a0c68..bfa2f29eec7 100644 --- a/resource-manager/dynatrace/2023-04-27/singlesignon/id_singlesignonconfiguration_test.go +++ b/resource-manager/dynatrace/2023-04-27/singlesignon/id_singlesignonconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SingleSignOnConfigurationId{} func TestNewSingleSignOnConfigurationID(t *testing.T) { - id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") + id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSingleSignOnConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.SingleSignOnConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "configurationName") + if id.SingleSignOnConfigurationName != "singleSignOnConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "singleSignOnConfigurationName") } } func TestFormatSingleSignOnConfigurationID(t *testing.T) { - actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName" + actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSingleSignOnConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSingleSignOnConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - SingleSignOnConfigurationName: "cOnFiGuRaTiOnNaMe", + SingleSignOnConfigurationName: "sInGlEsIgNoNcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/dynatrace/2023-04-27/singlesignon/model_dynatracesinglesignonproperties.go b/resource-manager/dynatrace/2023-04-27/singlesignon/model_dynatracesinglesignonproperties.go index 0855507d5f9..2ed56325d50 100644 --- a/resource-manager/dynatrace/2023-04-27/singlesignon/model_dynatracesinglesignonproperties.go +++ b/resource-manager/dynatrace/2023-04-27/singlesignon/model_dynatracesinglesignonproperties.go @@ -8,5 +8,5 @@ type DynatraceSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/dynatrace/2023-04-27/tagrules/README.md b/resource-manager/dynatrace/2023-04-27/tagrules/README.md index ddfde43c82c..79031312199 100644 --- a/resource-manager/dynatrace/2023-04-27/tagrules/README.md +++ b/resource-manager/dynatrace/2023-04-27/tagrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/dynatrace/2023-04-27/tagrules/id_tagrule.go b/resource-manager/dynatrace/2023-04-27/tagrules/id_tagrule.go index e5e44a4331e..4f63d64c60c 100644 --- a/resource-manager/dynatrace/2023-04-27/tagrules/id_tagrule.go +++ b/resource-manager/dynatrace/2023-04-27/tagrules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/dynatrace/2023-04-27/tagrules/id_tagrule_test.go b/resource-manager/dynatrace/2023-04-27/tagrules/id_tagrule_test.go index 7d1fb2eb052..3ba00ec612e 100644 --- a/resource-manager/dynatrace/2023-04-27/tagrules/id_tagrule_test.go +++ b/resource-manager/dynatrace/2023-04-27/tagrules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Dynatrace.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/dYnAtRaCe.oBsErVaBiLiTy/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/elastic/2023-06-01/deploymentinfo/model_deploymentinforesponse.go b/resource-manager/elastic/2023-06-01/deploymentinfo/model_deploymentinforesponse.go index 924ddde88e5..589ded94276 100644 --- a/resource-manager/elastic/2023-06-01/deploymentinfo/model_deploymentinforesponse.go +++ b/resource-manager/elastic/2023-06-01/deploymentinfo/model_deploymentinforesponse.go @@ -4,7 +4,7 @@ package deploymentinfo // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DeploymentInfoResponse struct { - DeploymentUrl *string `json:"deploymentUrl,omitempty"` + DeploymentURL *string `json:"deploymentUrl,omitempty"` DiskCapacity *string `json:"diskCapacity,omitempty"` MarketplaceSaasInfo *MarketplaceSaaSInfo `json:"marketplaceSaasInfo,omitempty"` MemoryCapacity *string `json:"memoryCapacity,omitempty"` diff --git a/resource-manager/elastic/2023-06-01/monitorsresource/model_elasticclouddeployment.go b/resource-manager/elastic/2023-06-01/monitorsresource/model_elasticclouddeployment.go index 38ed50f276c..d38d98d855b 100644 --- a/resource-manager/elastic/2023-06-01/monitorsresource/model_elasticclouddeployment.go +++ b/resource-manager/elastic/2023-06-01/monitorsresource/model_elasticclouddeployment.go @@ -7,8 +7,8 @@ type ElasticCloudDeployment struct { AzureSubscriptionId *string `json:"azureSubscriptionId,omitempty"` DeploymentId *string `json:"deploymentId,omitempty"` ElasticsearchRegion *string `json:"elasticsearchRegion,omitempty"` - ElasticsearchServiceUrl *string `json:"elasticsearchServiceUrl,omitempty"` - KibanaServiceUrl *string `json:"kibanaServiceUrl,omitempty"` - KibanaSsoUrl *string `json:"kibanaSsoUrl,omitempty"` + ElasticsearchServiceURL *string `json:"elasticsearchServiceUrl,omitempty"` + KibanaServiceURL *string `json:"kibanaServiceUrl,omitempty"` + KibanaSsoURL *string `json:"kibanaSsoUrl,omitempty"` Name *string `json:"name,omitempty"` } diff --git a/resource-manager/elastic/2023-06-01/monitorsresource/model_elasticclouduser.go b/resource-manager/elastic/2023-06-01/monitorsresource/model_elasticclouduser.go index 245a8bf8826..fc6a3c746a9 100644 --- a/resource-manager/elastic/2023-06-01/monitorsresource/model_elasticclouduser.go +++ b/resource-manager/elastic/2023-06-01/monitorsresource/model_elasticclouduser.go @@ -4,7 +4,7 @@ package monitorsresource // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ElasticCloudUser struct { - ElasticCloudSsoDefaultUrl *string `json:"elasticCloudSsoDefaultUrl,omitempty"` + ElasticCloudSsoDefaultURL *string `json:"elasticCloudSsoDefaultUrl,omitempty"` EmailAddress *string `json:"emailAddress,omitempty"` Id *string `json:"id,omitempty"` } diff --git a/resource-manager/elastic/2023-06-01/rules/README.md b/resource-manager/elastic/2023-06-01/rules/README.md index b263a67e762..b845698a556 100644 --- a/resource-manager/elastic/2023-06-01/rules/README.md +++ b/resource-manager/elastic/2023-06-01/rules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := rules.MonitoringTagRules{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if err := client.TagRulesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.TagRulesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.TagRulesGet(ctx, id) if err != nil { diff --git a/resource-manager/elastic/2023-06-01/rules/id_tagrule.go b/resource-manager/elastic/2023-06-01/rules/id_tagrule.go index 6aa67e798ed..77a0fd8007d 100644 --- a/resource-manager/elastic/2023-06-01/rules/id_tagrule.go +++ b/resource-manager/elastic/2023-06-01/rules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/elastic/2023-06-01/rules/id_tagrule_test.go b/resource-manager/elastic/2023-06-01/rules/id_tagrule_test.go index fe3df92b251..abae1d5331d 100644 --- a/resource-manager/elastic/2023-06-01/rules/id_tagrule_test.go +++ b/resource-manager/elastic/2023-06-01/rules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/elastic/2024-03-01/deploymentinfo/model_deploymentinforesponse.go b/resource-manager/elastic/2024-03-01/deploymentinfo/model_deploymentinforesponse.go index f5bcf24bdb6..e939d48548b 100644 --- a/resource-manager/elastic/2024-03-01/deploymentinfo/model_deploymentinforesponse.go +++ b/resource-manager/elastic/2024-03-01/deploymentinfo/model_deploymentinforesponse.go @@ -4,7 +4,7 @@ package deploymentinfo // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DeploymentInfoResponse struct { - DeploymentUrl *string `json:"deploymentUrl,omitempty"` + DeploymentURL *string `json:"deploymentUrl,omitempty"` DiskCapacity *string `json:"diskCapacity,omitempty"` ElasticsearchEndPoint *string `json:"elasticsearchEndPoint,omitempty"` MarketplaceSaasInfo *MarketplaceSaaSInfo `json:"marketplaceSaasInfo,omitempty"` diff --git a/resource-manager/elastic/2024-03-01/monitorsresource/model_elasticclouddeployment.go b/resource-manager/elastic/2024-03-01/monitorsresource/model_elasticclouddeployment.go index 38ed50f276c..d38d98d855b 100644 --- a/resource-manager/elastic/2024-03-01/monitorsresource/model_elasticclouddeployment.go +++ b/resource-manager/elastic/2024-03-01/monitorsresource/model_elasticclouddeployment.go @@ -7,8 +7,8 @@ type ElasticCloudDeployment struct { AzureSubscriptionId *string `json:"azureSubscriptionId,omitempty"` DeploymentId *string `json:"deploymentId,omitempty"` ElasticsearchRegion *string `json:"elasticsearchRegion,omitempty"` - ElasticsearchServiceUrl *string `json:"elasticsearchServiceUrl,omitempty"` - KibanaServiceUrl *string `json:"kibanaServiceUrl,omitempty"` - KibanaSsoUrl *string `json:"kibanaSsoUrl,omitempty"` + ElasticsearchServiceURL *string `json:"elasticsearchServiceUrl,omitempty"` + KibanaServiceURL *string `json:"kibanaServiceUrl,omitempty"` + KibanaSsoURL *string `json:"kibanaSsoUrl,omitempty"` Name *string `json:"name,omitempty"` } diff --git a/resource-manager/elastic/2024-03-01/monitorsresource/model_elasticclouduser.go b/resource-manager/elastic/2024-03-01/monitorsresource/model_elasticclouduser.go index 245a8bf8826..fc6a3c746a9 100644 --- a/resource-manager/elastic/2024-03-01/monitorsresource/model_elasticclouduser.go +++ b/resource-manager/elastic/2024-03-01/monitorsresource/model_elasticclouduser.go @@ -4,7 +4,7 @@ package monitorsresource // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ElasticCloudUser struct { - ElasticCloudSsoDefaultUrl *string `json:"elasticCloudSsoDefaultUrl,omitempty"` + ElasticCloudSsoDefaultURL *string `json:"elasticCloudSsoDefaultUrl,omitempty"` EmailAddress *string `json:"emailAddress,omitempty"` Id *string `json:"id,omitempty"` } diff --git a/resource-manager/elastic/2024-03-01/openaiintegration/README.md b/resource-manager/elastic/2024-03-01/openaiintegration/README.md index be0c43341dd..c84140f8858 100644 --- a/resource-manager/elastic/2024-03-01/openaiintegration/README.md +++ b/resource-manager/elastic/2024-03-01/openaiintegration/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openaiintegration.NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "integrationName") +id := openaiintegration.NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "openAIIntegrationName") payload := openaiintegration.OpenAIIntegrationRPModel{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openaiintegration.NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "integrationName") +id := openaiintegration.NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "openAIIntegrationName") read, err := client.OpenAIDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openaiintegration.NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "integrationName") +id := openaiintegration.NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "openAIIntegrationName") read, err := client.OpenAIGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openaiintegration.NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "integrationName") +id := openaiintegration.NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "openAIIntegrationName") read, err := client.OpenAIGetStatus(ctx, id) if err != nil { diff --git a/resource-manager/elastic/2024-03-01/openaiintegration/id_openaiintegration.go b/resource-manager/elastic/2024-03-01/openaiintegration/id_openaiintegration.go index ce008a03f8b..d980b3d225d 100644 --- a/resource-manager/elastic/2024-03-01/openaiintegration/id_openaiintegration.go +++ b/resource-manager/elastic/2024-03-01/openaiintegration/id_openaiintegration.go @@ -123,7 +123,7 @@ func (id OpenAIIntegrationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticOpenAIIntegrations", "openAIIntegrations", "openAIIntegrations"), - resourceids.UserSpecifiedSegment("openAIIntegrationName", "integrationName"), + resourceids.UserSpecifiedSegment("openAIIntegrationName", "openAIIntegrationName"), } } diff --git a/resource-manager/elastic/2024-03-01/openaiintegration/id_openaiintegration_test.go b/resource-manager/elastic/2024-03-01/openaiintegration/id_openaiintegration_test.go index 9a0b4dff5b5..714a1df5d85 100644 --- a/resource-manager/elastic/2024-03-01/openaiintegration/id_openaiintegration_test.go +++ b/resource-manager/elastic/2024-03-01/openaiintegration/id_openaiintegration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenAIIntegrationId{} func TestNewOpenAIIntegrationID(t *testing.T) { - id := NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "integrationName") + id := NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "openAIIntegrationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOpenAIIntegrationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.OpenAIIntegrationName != "integrationName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenAIIntegrationName'", id.OpenAIIntegrationName, "integrationName") + if id.OpenAIIntegrationName != "openAIIntegrationName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenAIIntegrationName'", id.OpenAIIntegrationName, "openAIIntegrationName") } } func TestFormatOpenAIIntegrationID(t *testing.T) { - actual := NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "integrationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/integrationName" + actual := NewOpenAIIntegrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "openAIIntegrationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/openAIIntegrationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOpenAIIntegrationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/integrationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/openAIIntegrationName", Expected: &OpenAIIntegrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - OpenAIIntegrationName: "integrationName", + OpenAIIntegrationName: "openAIIntegrationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/integrationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/openAIIntegrationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOpenAIIntegrationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/integrationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/openAIIntegrationName", Expected: &OpenAIIntegrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - OpenAIIntegrationName: "integrationName", + OpenAIIntegrationName: "openAIIntegrationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/integrationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/openAIIntegrations/openAIIntegrationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/oPeNaIiNtEgRaTiOnS/iNtEgRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/oPeNaIiNtEgRaTiOnS/oPeNaIiNtEgRaTiOnNaMe", Expected: &OpenAIIntegrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - OpenAIIntegrationName: "iNtEgRaTiOnNaMe", + OpenAIIntegrationName: "oPeNaIiNtEgRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/oPeNaIiNtEgRaTiOnS/iNtEgRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/oPeNaIiNtEgRaTiOnS/oPeNaIiNtEgRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/elastic/2024-03-01/rules/README.md b/resource-manager/elastic/2024-03-01/rules/README.md index 40daf7d1f30..76a20662ebe 100644 --- a/resource-manager/elastic/2024-03-01/rules/README.md +++ b/resource-manager/elastic/2024-03-01/rules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := rules.MonitoringTagRules{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if err := client.TagRulesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.TagRulesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := rules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.TagRulesGet(ctx, id) if err != nil { diff --git a/resource-manager/elastic/2024-03-01/rules/id_tagrule.go b/resource-manager/elastic/2024-03-01/rules/id_tagrule.go index 6aa67e798ed..77a0fd8007d 100644 --- a/resource-manager/elastic/2024-03-01/rules/id_tagrule.go +++ b/resource-manager/elastic/2024-03-01/rules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/elastic/2024-03-01/rules/id_tagrule_test.go b/resource-manager/elastic/2024-03-01/rules/id_tagrule_test.go index fe3df92b251..abae1d5331d 100644 --- a/resource-manager/elastic/2024-03-01/rules/id_tagrule_test.go +++ b/resource-manager/elastic/2024-03-01/rules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Elastic/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eLaStIc/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2022-06-15/channels/README.md b/resource-manager/eventgrid/2022-06-15/channels/README.md index 65e72a3a300..2ec6c78b2a5 100644 --- a/resource-manager/eventgrid/2022-06-15/channels/README.md +++ b/resource-manager/eventgrid/2022-06-15/channels/README.md @@ -69,13 +69,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ChannelsClient.GetFullUrl` +### Example Usage: `ChannelsClient.GetFullURL` ```go ctx := context.TODO() id := channels.NewChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "partnerNamespaceName", "channelName") -read, err := client.GetFullUrl(ctx, id) +read, err := client.GetFullURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/eventgrid/2022-06-15/channels/method_getfullurl.go b/resource-manager/eventgrid/2022-06-15/channels/method_getfullurl.go index cdf119d69dc..60f0a4d127e 100644 --- a/resource-manager/eventgrid/2022-06-15/channels/method_getfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/channels/method_getfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetFullUrlOperationResponse struct { +type GetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// GetFullUrl ... -func (c ChannelsClient) GetFullUrl(ctx context.Context, id ChannelId) (result GetFullUrlOperationResponse, err error) { +// GetFullURL ... +func (c ChannelsClient) GetFullURL(ctx context.Context, id ChannelId) (result GetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c ChannelsClient) GetFullUrl(ctx context.Context, id ChannelId) (result Ge return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2022-06-15/channels/model_eventsubscriptionfullurl.go b/resource-manager/eventgrid/2022-06-15/channels/model_eventsubscriptionfullurl.go index 4c1178f2d13..ae785b00c5a 100644 --- a/resource-manager/eventgrid/2022-06-15/channels/model_eventsubscriptionfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/channels/model_eventsubscriptionfullurl.go @@ -3,6 +3,6 @@ package channels // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type EventSubscriptionFullUrl struct { - EndpointUrl *string `json:"endpointUrl,omitempty"` +type EventSubscriptionFullURL struct { + EndpointURL *string `json:"endpointUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2022-06-15/channels/model_inlineeventproperties.go b/resource-manager/eventgrid/2022-06-15/channels/model_inlineeventproperties.go index 41e32688da0..b7b4414076a 100644 --- a/resource-manager/eventgrid/2022-06-15/channels/model_inlineeventproperties.go +++ b/resource-manager/eventgrid/2022-06-15/channels/model_inlineeventproperties.go @@ -4,8 +4,8 @@ package channels // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type InlineEventProperties struct { - DataSchemaUrl *string `json:"dataSchemaUrl,omitempty"` + DataSchemaURL *string `json:"dataSchemaUrl,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - DocumentationUrl *string `json:"documentationUrl,omitempty"` + DocumentationURL *string `json:"documentationUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2022-06-15/domaintopics/README.md b/resource-manager/eventgrid/2022-06-15/domaintopics/README.md index 470586774b5..55758dd0ae6 100644 --- a/resource-manager/eventgrid/2022-06-15/domaintopics/README.md +++ b/resource-manager/eventgrid/2022-06-15/domaintopics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") if err := client.CreateOrUpdateThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -48,7 +48,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/eventgrid/2022-06-15/domaintopics/id_domaintopic.go b/resource-manager/eventgrid/2022-06-15/domaintopics/id_domaintopic.go index b424401f3e6..53a7fb5f72a 100644 --- a/resource-manager/eventgrid/2022-06-15/domaintopics/id_domaintopic.go +++ b/resource-manager/eventgrid/2022-06-15/domaintopics/id_domaintopic.go @@ -123,7 +123,7 @@ func (id DomainTopicId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticTopics", "topics", "topics"), - resourceids.UserSpecifiedSegment("topicName", "domainTopicName"), + resourceids.UserSpecifiedSegment("topicName", "topicName"), } } diff --git a/resource-manager/eventgrid/2022-06-15/domaintopics/id_domaintopic_test.go b/resource-manager/eventgrid/2022-06-15/domaintopics/id_domaintopic_test.go index 933fb6e16bc..cdb00cbaee5 100644 --- a/resource-manager/eventgrid/2022-06-15/domaintopics/id_domaintopic_test.go +++ b/resource-manager/eventgrid/2022-06-15/domaintopics/id_domaintopic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DomainTopicId{} func TestNewDomainTopicID(t *testing.T) { - id := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") + id := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDomainTopicID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.TopicName != "domainTopicName" { - t.Fatalf("Expected %q but got %q for Segment 'TopicName'", id.TopicName, "domainTopicName") + if id.TopicName != "topicName" { + t.Fatalf("Expected %q but got %q for Segment 'TopicName'", id.TopicName, "topicName") } } func TestFormatDomainTopicID(t *testing.T) { - actual := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName" + actual := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDomainTopicID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - TopicName: "domainTopicName", + TopicName: "topicName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDomainTopicIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - TopicName: "domainTopicName", + TopicName: "topicName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/dOmAiNtOpIcNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/tOpIcNaMe", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", DomainName: "dOmAiNnAmE", - TopicName: "dOmAiNtOpIcNaMe", + TopicName: "tOpIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/dOmAiNtOpIcNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/tOpIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/README.md b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/README.md index 0714df6f38b..ee8ffed81b0 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/README.md +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/README.md @@ -111,13 +111,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.DomainEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.DomainEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewDomainEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "eventSubscriptionName") -read, err := client.DomainEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.DomainEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } @@ -222,13 +222,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.DomainTopicEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.DomainTopicEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewTopicEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName", "eventSubscriptionName") -read, err := client.DomainTopicEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.DomainTopicEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } @@ -242,7 +242,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventsubscriptions.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := eventsubscriptions.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") // alternatively `client.DomainTopicEventSubscriptionsList(ctx, id, eventsubscriptions.DefaultDomainTopicEventSubscriptionsListOperationOptions())` can be used to do batched pagination items, err := client.DomainTopicEventSubscriptionsListComplete(ctx, id, eventsubscriptions.DefaultDomainTopicEventSubscriptionsListOperationOptions()) @@ -304,13 +304,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.GetFullUrl` +### Example Usage: `EventSubscriptionsClient.GetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewScopedEventSubscriptionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "eventSubscriptionName") -read, err := client.GetFullUrl(ctx, id) +read, err := client.GetFullURL(ctx, id) if err != nil { // handle the error } @@ -324,7 +324,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventsubscriptions.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := eventsubscriptions.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") // alternatively `client.ListByDomainTopic(ctx, id, eventsubscriptions.DefaultListByDomainTopicOperationOptions())` can be used to do batched pagination items, err := client.ListByDomainTopicComplete(ctx, id, eventsubscriptions.DefaultListByDomainTopicOperationOptions()) @@ -426,7 +426,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := eventsubscriptions.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := eventsubscriptions.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListRegionalByResourceGroup(ctx, id, eventsubscriptions.DefaultListRegionalByResourceGroupOperationOptions())` can be used to do batched pagination items, err := client.ListRegionalByResourceGroupComplete(ctx, id, eventsubscriptions.DefaultListRegionalByResourceGroupOperationOptions()) @@ -443,7 +443,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := eventsubscriptions.NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "topicTypeName") +id := eventsubscriptions.NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topicTypeName") // alternatively `client.ListRegionalByResourceGroupForTopicType(ctx, id, eventsubscriptions.DefaultListRegionalByResourceGroupForTopicTypeOperationOptions())` can be used to do batched pagination items, err := client.ListRegionalByResourceGroupForTopicTypeComplete(ctx, id, eventsubscriptions.DefaultListRegionalByResourceGroupForTopicTypeOperationOptions()) @@ -460,7 +460,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := eventsubscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := eventsubscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListRegionalBySubscription(ctx, id, eventsubscriptions.DefaultListRegionalBySubscriptionOperationOptions())` can be used to do batched pagination items, err := client.ListRegionalBySubscriptionComplete(ctx, id, eventsubscriptions.DefaultListRegionalBySubscriptionOperationOptions()) @@ -477,7 +477,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := eventsubscriptions.NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "location", "topicTypeName") +id := eventsubscriptions.NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "locationName", "topicTypeName") // alternatively `client.ListRegionalBySubscriptionForTopicType(ctx, id, eventsubscriptions.DefaultListRegionalBySubscriptionForTopicTypeOperationOptions())` can be used to do batched pagination items, err := client.ListRegionalBySubscriptionForTopicTypeComplete(ctx, id, eventsubscriptions.DefaultListRegionalBySubscriptionForTopicTypeOperationOptions()) @@ -551,13 +551,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.PartnerTopicEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.PartnerTopicEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewPartnerTopicEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "partnerTopicName", "eventSubscriptionName") -read, err := client.PartnerTopicEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.PartnerTopicEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } @@ -662,13 +662,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.SystemTopicEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.SystemTopicEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewSystemTopicEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "systemTopicName", "eventSubscriptionName") -read, err := client.SystemTopicEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.SystemTopicEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } @@ -773,13 +773,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.TopicEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.TopicEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "topicName", "eventSubscriptionName") -read, err := client.TopicEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.TopicEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_domaintopic.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_domaintopic.go index 5f91ef8ff44..737d98cc27f 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_domaintopic.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_domaintopic.go @@ -123,7 +123,7 @@ func (id DomainTopicId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticTopics", "topics", "topics"), - resourceids.UserSpecifiedSegment("topicName", "domainTopicName"), + resourceids.UserSpecifiedSegment("topicName", "topicName"), } } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_domaintopic_test.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_domaintopic_test.go index c25b34f6503..e57e91deab7 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_domaintopic_test.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_domaintopic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DomainTopicId{} func TestNewDomainTopicID(t *testing.T) { - id := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") + id := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDomainTopicID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.TopicName != "domainTopicName" { - t.Fatalf("Expected %q but got %q for Segment 'TopicName'", id.TopicName, "domainTopicName") + if id.TopicName != "topicName" { + t.Fatalf("Expected %q but got %q for Segment 'TopicName'", id.TopicName, "topicName") } } func TestFormatDomainTopicID(t *testing.T) { - actual := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName" + actual := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDomainTopicID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - TopicName: "domainTopicName", + TopicName: "topicName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDomainTopicIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - TopicName: "domainTopicName", + TopicName: "topicName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/dOmAiNtOpIcNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/tOpIcNaMe", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", DomainName: "dOmAiNnAmE", - TopicName: "dOmAiNtOpIcNaMe", + TopicName: "tOpIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/dOmAiNtOpIcNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/tOpIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_location.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_location.go index 75607e8104d..c473cb74943 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_location.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftEventGrid", "Microsoft.EventGrid", "Microsoft.EventGrid"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_location_test.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_location_test.go index e9212e553e2..8a612dfda59 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_location_test.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_locationtopictype.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_locationtopictype.go index 1b6c5dc5809..fa0e89ff6e3 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_locationtopictype.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_locationtopictype.go @@ -113,7 +113,7 @@ func (id LocationTopicTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftEventGrid", "Microsoft.EventGrid", "Microsoft.EventGrid"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticTopicTypes", "topicTypes", "topicTypes"), resourceids.UserSpecifiedSegment("topicTypeName", "topicTypeName"), } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_locationtopictype_test.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_locationtopictype_test.go index bf991ead500..07ff8fad030 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_locationtopictype_test.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_locationtopictype_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LocationTopicTypeId{} func TestNewLocationTopicTypeID(t *testing.T) { - id := NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "location", "topicTypeName") + id := NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "locationName", "topicTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.TopicTypeName != "topicTypeName" { @@ -28,8 +28,8 @@ func TestNewLocationTopicTypeID(t *testing.T) { } func TestFormatLocationTopicTypeID(t *testing.T) { - actual := NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "location", "topicTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName" + actual := NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "locationName", "topicTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseLocationTopicTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName", Expected: &LocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", TopicTypeName: "topicTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseLocationTopicTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName", Expected: &LocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", TopicTypeName: "topicTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS/tOpIcTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS/tOpIcTyPeNaMe", Expected: &LocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", TopicTypeName: "tOpIcTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS/tOpIcTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS/tOpIcTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocation.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocation.go index f2b7c1490a4..84ff403e9af 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocation.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftEventGrid", "Microsoft.EventGrid", "Microsoft.EventGrid"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocation_test.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocation_test.go index ecb4135c15d..0326f423caa 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocation_test.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocationtopictype.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocationtopictype.go index 60cbe3dee8f..97f0af1a0b7 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocationtopictype.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocationtopictype.go @@ -121,7 +121,7 @@ func (id ProviderLocationTopicTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftEventGrid", "Microsoft.EventGrid", "Microsoft.EventGrid"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticTopicTypes", "topicTypes", "topicTypes"), resourceids.UserSpecifiedSegment("topicTypeName", "topicTypeName"), } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocationtopictype_test.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocationtopictype_test.go index 3a72fb4989c..363a2b7eadc 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocationtopictype_test.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/id_providerlocationtopictype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationTopicTypeId{} func TestNewProviderLocationTopicTypeID(t *testing.T) { - id := NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "topicTypeName") + id := NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topicTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewProviderLocationTopicTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.TopicTypeName != "topicTypeName" { @@ -32,8 +32,8 @@ func TestNewProviderLocationTopicTypeID(t *testing.T) { } func TestFormatProviderLocationTopicTypeID(t *testing.T) { - actual := NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "topicTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName" + actual := NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topicTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseProviderLocationTopicTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName", Expected: &ProviderLocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", TopicTypeName: "topicTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseProviderLocationTopicTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName", Expected: &ProviderLocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", TopicTypeName: "topicTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS/tOpIcTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS/tOpIcTyPeNaMe", Expected: &ProviderLocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", TopicTypeName: "tOpIcTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS/tOpIcTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS/tOpIcTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_domaineventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_domaineventsubscriptionsgetfullurl.go index b8b6b82fddd..c8c83150856 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_domaineventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_domaineventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DomainEventSubscriptionsGetFullUrlOperationResponse struct { +type DomainEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// DomainEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) DomainEventSubscriptionsGetFullUrl(ctx context.Context, id DomainEventSubscriptionId) (result DomainEventSubscriptionsGetFullUrlOperationResponse, err error) { +// DomainEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) DomainEventSubscriptionsGetFullURL(ctx context.Context, id DomainEventSubscriptionId) (result DomainEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) DomainEventSubscriptionsGetFullUrl(ctx context return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_domaintopiceventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_domaintopiceventsubscriptionsgetfullurl.go index 84a30dceed8..aa4c4c4381f 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_domaintopiceventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_domaintopiceventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DomainTopicEventSubscriptionsGetFullUrlOperationResponse struct { +type DomainTopicEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// DomainTopicEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) DomainTopicEventSubscriptionsGetFullUrl(ctx context.Context, id TopicEventSubscriptionId) (result DomainTopicEventSubscriptionsGetFullUrlOperationResponse, err error) { +// DomainTopicEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) DomainTopicEventSubscriptionsGetFullURL(ctx context.Context, id TopicEventSubscriptionId) (result DomainTopicEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) DomainTopicEventSubscriptionsGetFullUrl(ctx co return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_getfullurl.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_getfullurl.go index e4cc7356715..de0855e408e 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_getfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_getfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetFullUrlOperationResponse struct { +type GetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// GetFullUrl ... -func (c EventSubscriptionsClient) GetFullUrl(ctx context.Context, id ScopedEventSubscriptionId) (result GetFullUrlOperationResponse, err error) { +// GetFullURL ... +func (c EventSubscriptionsClient) GetFullURL(ctx context.Context, id ScopedEventSubscriptionId) (result GetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) GetFullUrl(ctx context.Context, id ScopedEvent return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_partnertopiceventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_partnertopiceventsubscriptionsgetfullurl.go index c94e3c6dadd..d59a398e4fd 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_partnertopiceventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_partnertopiceventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PartnerTopicEventSubscriptionsGetFullUrlOperationResponse struct { +type PartnerTopicEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// PartnerTopicEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) PartnerTopicEventSubscriptionsGetFullUrl(ctx context.Context, id PartnerTopicEventSubscriptionId) (result PartnerTopicEventSubscriptionsGetFullUrlOperationResponse, err error) { +// PartnerTopicEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) PartnerTopicEventSubscriptionsGetFullURL(ctx context.Context, id PartnerTopicEventSubscriptionId) (result PartnerTopicEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) PartnerTopicEventSubscriptionsGetFullUrl(ctx c return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_systemtopiceventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_systemtopiceventsubscriptionsgetfullurl.go index ec8d05a2ad3..3e23f96c4d8 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_systemtopiceventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_systemtopiceventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type SystemTopicEventSubscriptionsGetFullUrlOperationResponse struct { +type SystemTopicEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// SystemTopicEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) SystemTopicEventSubscriptionsGetFullUrl(ctx context.Context, id SystemTopicEventSubscriptionId) (result SystemTopicEventSubscriptionsGetFullUrlOperationResponse, err error) { +// SystemTopicEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) SystemTopicEventSubscriptionsGetFullURL(ctx context.Context, id SystemTopicEventSubscriptionId) (result SystemTopicEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) SystemTopicEventSubscriptionsGetFullUrl(ctx co return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_topiceventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_topiceventsubscriptionsgetfullurl.go index 998c1474a03..63a2e5da4b5 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_topiceventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/method_topiceventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type TopicEventSubscriptionsGetFullUrlOperationResponse struct { +type TopicEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// TopicEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) TopicEventSubscriptionsGetFullUrl(ctx context.Context, id EventSubscriptionId) (result TopicEventSubscriptionsGetFullUrlOperationResponse, err error) { +// TopicEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) TopicEventSubscriptionsGetFullURL(ctx context.Context, id EventSubscriptionId) (result TopicEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) TopicEventSubscriptionsGetFullUrl(ctx context. return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/model_eventsubscriptionfullurl.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/model_eventsubscriptionfullurl.go index 2c155f5fe55..e05ed8166d3 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/model_eventsubscriptionfullurl.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/model_eventsubscriptionfullurl.go @@ -3,6 +3,6 @@ package eventsubscriptions // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type EventSubscriptionFullUrl struct { - EndpointUrl *string `json:"endpointUrl,omitempty"` +type EventSubscriptionFullURL struct { + EndpointURL *string `json:"endpointUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/model_webhookeventsubscriptiondestinationproperties.go b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/model_webhookeventsubscriptiondestinationproperties.go index 4423a50123d..a67d5790c18 100644 --- a/resource-manager/eventgrid/2022-06-15/eventsubscriptions/model_webhookeventsubscriptiondestinationproperties.go +++ b/resource-manager/eventgrid/2022-06-15/eventsubscriptions/model_webhookeventsubscriptiondestinationproperties.go @@ -12,8 +12,8 @@ type WebHookEventSubscriptionDestinationProperties struct { AzureActiveDirectoryApplicationIdOrUri *string `json:"azureActiveDirectoryApplicationIdOrUri,omitempty"` AzureActiveDirectoryTenantId *string `json:"azureActiveDirectoryTenantId,omitempty"` DeliveryAttributeMappings *[]DeliveryAttributeMapping `json:"deliveryAttributeMappings,omitempty"` - EndpointBaseUrl *string `json:"endpointBaseUrl,omitempty"` - EndpointUrl *string `json:"endpointUrl,omitempty"` + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` MaxEventsPerBatch *int64 `json:"maxEventsPerBatch,omitempty"` PreferredBatchSizeInKilobytes *int64 `json:"preferredBatchSizeInKilobytes,omitempty"` } @@ -24,8 +24,8 @@ func (s *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(bytes []by var decoded struct { AzureActiveDirectoryApplicationIdOrUri *string `json:"azureActiveDirectoryApplicationIdOrUri,omitempty"` AzureActiveDirectoryTenantId *string `json:"azureActiveDirectoryTenantId,omitempty"` - EndpointBaseUrl *string `json:"endpointBaseUrl,omitempty"` - EndpointUrl *string `json:"endpointUrl,omitempty"` + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` MaxEventsPerBatch *int64 `json:"maxEventsPerBatch,omitempty"` PreferredBatchSizeInKilobytes *int64 `json:"preferredBatchSizeInKilobytes,omitempty"` } @@ -35,8 +35,8 @@ func (s *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(bytes []by s.AzureActiveDirectoryApplicationIdOrUri = decoded.AzureActiveDirectoryApplicationIdOrUri s.AzureActiveDirectoryTenantId = decoded.AzureActiveDirectoryTenantId - s.EndpointBaseUrl = decoded.EndpointBaseUrl - s.EndpointUrl = decoded.EndpointUrl + s.EndpointBaseURL = decoded.EndpointBaseURL + s.EndpointURL = decoded.EndpointURL s.MaxEventsPerBatch = decoded.MaxEventsPerBatch s.PreferredBatchSizeInKilobytes = decoded.PreferredBatchSizeInKilobytes diff --git a/resource-manager/eventgrid/2022-06-15/partnertopics/model_inlineeventproperties.go b/resource-manager/eventgrid/2022-06-15/partnertopics/model_inlineeventproperties.go index e03a71ee086..2be1172a4fb 100644 --- a/resource-manager/eventgrid/2022-06-15/partnertopics/model_inlineeventproperties.go +++ b/resource-manager/eventgrid/2022-06-15/partnertopics/model_inlineeventproperties.go @@ -4,8 +4,8 @@ package partnertopics // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type InlineEventProperties struct { - DataSchemaUrl *string `json:"dataSchemaUrl,omitempty"` + DataSchemaURL *string `json:"dataSchemaUrl,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - DocumentationUrl *string `json:"documentationUrl,omitempty"` + DocumentationURL *string `json:"documentationUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2022-06-15/topics/model_eventtypeproperties.go b/resource-manager/eventgrid/2022-06-15/topics/model_eventtypeproperties.go index d670b27156a..bf0ec9478ab 100644 --- a/resource-manager/eventgrid/2022-06-15/topics/model_eventtypeproperties.go +++ b/resource-manager/eventgrid/2022-06-15/topics/model_eventtypeproperties.go @@ -7,5 +7,5 @@ type EventTypeProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` IsInDefaultSet *bool `json:"isInDefaultSet,omitempty"` - SchemaUrl *string `json:"schemaUrl,omitempty"` + SchemaURL *string `json:"schemaUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2022-06-15/topictypes/model_eventtypeproperties.go b/resource-manager/eventgrid/2022-06-15/topictypes/model_eventtypeproperties.go index deadd920daf..313f891e8d1 100644 --- a/resource-manager/eventgrid/2022-06-15/topictypes/model_eventtypeproperties.go +++ b/resource-manager/eventgrid/2022-06-15/topictypes/model_eventtypeproperties.go @@ -7,5 +7,5 @@ type EventTypeProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` IsInDefaultSet *bool `json:"isInDefaultSet,omitempty"` - SchemaUrl *string `json:"schemaUrl,omitempty"` + SchemaURL *string `json:"schemaUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2023-12-15-preview/channels/README.md b/resource-manager/eventgrid/2023-12-15-preview/channels/README.md index 64b4ee21660..cb208d0d90c 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/channels/README.md +++ b/resource-manager/eventgrid/2023-12-15-preview/channels/README.md @@ -69,13 +69,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ChannelsClient.GetFullUrl` +### Example Usage: `ChannelsClient.GetFullURL` ```go ctx := context.TODO() id := channels.NewChannelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "partnerNamespaceName", "channelName") -read, err := client.GetFullUrl(ctx, id) +read, err := client.GetFullURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/eventgrid/2023-12-15-preview/channels/method_getfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/channels/method_getfullurl.go index cdf119d69dc..60f0a4d127e 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/channels/method_getfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/channels/method_getfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetFullUrlOperationResponse struct { +type GetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// GetFullUrl ... -func (c ChannelsClient) GetFullUrl(ctx context.Context, id ChannelId) (result GetFullUrlOperationResponse, err error) { +// GetFullURL ... +func (c ChannelsClient) GetFullURL(ctx context.Context, id ChannelId) (result GetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c ChannelsClient) GetFullUrl(ctx context.Context, id ChannelId) (result Ge return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2023-12-15-preview/channels/model_eventsubscriptionfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/channels/model_eventsubscriptionfullurl.go index 4c1178f2d13..ae785b00c5a 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/channels/model_eventsubscriptionfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/channels/model_eventsubscriptionfullurl.go @@ -3,6 +3,6 @@ package channels // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type EventSubscriptionFullUrl struct { - EndpointUrl *string `json:"endpointUrl,omitempty"` +type EventSubscriptionFullURL struct { + EndpointURL *string `json:"endpointUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2023-12-15-preview/channels/model_inlineeventproperties.go b/resource-manager/eventgrid/2023-12-15-preview/channels/model_inlineeventproperties.go index 41e32688da0..b7b4414076a 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/channels/model_inlineeventproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/channels/model_inlineeventproperties.go @@ -4,8 +4,8 @@ package channels // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type InlineEventProperties struct { - DataSchemaUrl *string `json:"dataSchemaUrl,omitempty"` + DataSchemaURL *string `json:"dataSchemaUrl,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - DocumentationUrl *string `json:"documentationUrl,omitempty"` + DocumentationURL *string `json:"documentationUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2023-12-15-preview/channels/model_webhookpartnerdestinationproperties.go b/resource-manager/eventgrid/2023-12-15-preview/channels/model_webhookpartnerdestinationproperties.go index 7b1b713c581..1a5a31a324d 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/channels/model_webhookpartnerdestinationproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/channels/model_webhookpartnerdestinationproperties.go @@ -10,23 +10,23 @@ import ( type WebhookPartnerDestinationProperties struct { ClientAuthentication PartnerClientAuthentication `json:"clientAuthentication"` - EndpointBaseUrl *string `json:"endpointBaseUrl,omitempty"` - EndpointUrl *string `json:"endpointUrl,omitempty"` + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` } var _ json.Unmarshaler = &WebhookPartnerDestinationProperties{} func (s *WebhookPartnerDestinationProperties) UnmarshalJSON(bytes []byte) error { var decoded struct { - EndpointBaseUrl *string `json:"endpointBaseUrl,omitempty"` - EndpointUrl *string `json:"endpointUrl,omitempty"` + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } - s.EndpointBaseUrl = decoded.EndpointBaseUrl - s.EndpointUrl = decoded.EndpointUrl + s.EndpointBaseURL = decoded.EndpointBaseURL + s.EndpointURL = decoded.EndpointURL var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/eventgrid/2023-12-15-preview/clients/model_clientproperties.go b/resource-manager/eventgrid/2023-12-15-preview/clients/model_clientproperties.go index 095d65a4697..713dcc3e954 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/clients/model_clientproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/clients/model_clientproperties.go @@ -4,7 +4,7 @@ package clients // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ClientProperties struct { - Attributes *interface{} `json:"attributes,omitempty"` + Attributes *map[string]interface{} `json:"attributes,omitempty"` AuthenticationName *string `json:"authenticationName,omitempty"` ClientCertificateAuthentication *ClientCertificateAuthentication `json:"clientCertificateAuthentication,omitempty"` Description *string `json:"description,omitempty"` diff --git a/resource-manager/eventgrid/2023-12-15-preview/domains/model_inlineeventproperties.go b/resource-manager/eventgrid/2023-12-15-preview/domains/model_inlineeventproperties.go index aeaa4d0db2c..ac7ba7c3620 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/domains/model_inlineeventproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/domains/model_inlineeventproperties.go @@ -4,8 +4,8 @@ package domains // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type InlineEventProperties struct { - DataSchemaUrl *string `json:"dataSchemaUrl,omitempty"` + DataSchemaURL *string `json:"dataSchemaUrl,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - DocumentationUrl *string `json:"documentationUrl,omitempty"` + DocumentationURL *string `json:"documentationUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2023-12-15-preview/domaintopics/README.md b/resource-manager/eventgrid/2023-12-15-preview/domaintopics/README.md index 5eb51958c81..ce0c978c6f6 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/domaintopics/README.md +++ b/resource-manager/eventgrid/2023-12-15-preview/domaintopics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") if err := client.CreateOrUpdateThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -48,7 +48,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := domaintopics.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/eventgrid/2023-12-15-preview/domaintopics/id_domaintopic.go b/resource-manager/eventgrid/2023-12-15-preview/domaintopics/id_domaintopic.go index b424401f3e6..53a7fb5f72a 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/domaintopics/id_domaintopic.go +++ b/resource-manager/eventgrid/2023-12-15-preview/domaintopics/id_domaintopic.go @@ -123,7 +123,7 @@ func (id DomainTopicId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticTopics", "topics", "topics"), - resourceids.UserSpecifiedSegment("topicName", "domainTopicName"), + resourceids.UserSpecifiedSegment("topicName", "topicName"), } } diff --git a/resource-manager/eventgrid/2023-12-15-preview/domaintopics/id_domaintopic_test.go b/resource-manager/eventgrid/2023-12-15-preview/domaintopics/id_domaintopic_test.go index 933fb6e16bc..cdb00cbaee5 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/domaintopics/id_domaintopic_test.go +++ b/resource-manager/eventgrid/2023-12-15-preview/domaintopics/id_domaintopic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DomainTopicId{} func TestNewDomainTopicID(t *testing.T) { - id := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") + id := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDomainTopicID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.TopicName != "domainTopicName" { - t.Fatalf("Expected %q but got %q for Segment 'TopicName'", id.TopicName, "domainTopicName") + if id.TopicName != "topicName" { + t.Fatalf("Expected %q but got %q for Segment 'TopicName'", id.TopicName, "topicName") } } func TestFormatDomainTopicID(t *testing.T) { - actual := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName" + actual := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDomainTopicID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - TopicName: "domainTopicName", + TopicName: "topicName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDomainTopicIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - TopicName: "domainTopicName", + TopicName: "topicName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/dOmAiNtOpIcNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/tOpIcNaMe", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", DomainName: "dOmAiNnAmE", - TopicName: "dOmAiNtOpIcNaMe", + TopicName: "tOpIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/dOmAiNtOpIcNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/tOpIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/README.md b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/README.md index eaf1fab3d29..dbeeb46d683 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/README.md +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/README.md @@ -111,13 +111,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.DomainEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.DomainEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewDomainEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "eventSubscriptionName") -read, err := client.DomainEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.DomainEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } @@ -222,13 +222,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.DomainTopicEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.DomainTopicEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewTopicEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName", "eventSubscriptionName") -read, err := client.DomainTopicEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.DomainTopicEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } @@ -242,7 +242,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventsubscriptions.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := eventsubscriptions.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") // alternatively `client.DomainTopicEventSubscriptionsList(ctx, id, eventsubscriptions.DefaultDomainTopicEventSubscriptionsListOperationOptions())` can be used to do batched pagination items, err := client.DomainTopicEventSubscriptionsListComplete(ctx, id, eventsubscriptions.DefaultDomainTopicEventSubscriptionsListOperationOptions()) @@ -304,13 +304,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.GetFullUrl` +### Example Usage: `EventSubscriptionsClient.GetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewScopedEventSubscriptionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "eventSubscriptionName") -read, err := client.GetFullUrl(ctx, id) +read, err := client.GetFullURL(ctx, id) if err != nil { // handle the error } @@ -324,7 +324,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventsubscriptions.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") +id := eventsubscriptions.NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") // alternatively `client.ListByDomainTopic(ctx, id, eventsubscriptions.DefaultListByDomainTopicOperationOptions())` can be used to do batched pagination items, err := client.ListByDomainTopicComplete(ctx, id, eventsubscriptions.DefaultListByDomainTopicOperationOptions()) @@ -426,7 +426,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := eventsubscriptions.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := eventsubscriptions.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListRegionalByResourceGroup(ctx, id, eventsubscriptions.DefaultListRegionalByResourceGroupOperationOptions())` can be used to do batched pagination items, err := client.ListRegionalByResourceGroupComplete(ctx, id, eventsubscriptions.DefaultListRegionalByResourceGroupOperationOptions()) @@ -443,7 +443,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := eventsubscriptions.NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "topicTypeName") +id := eventsubscriptions.NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topicTypeName") // alternatively `client.ListRegionalByResourceGroupForTopicType(ctx, id, eventsubscriptions.DefaultListRegionalByResourceGroupForTopicTypeOperationOptions())` can be used to do batched pagination items, err := client.ListRegionalByResourceGroupForTopicTypeComplete(ctx, id, eventsubscriptions.DefaultListRegionalByResourceGroupForTopicTypeOperationOptions()) @@ -460,7 +460,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := eventsubscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := eventsubscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListRegionalBySubscription(ctx, id, eventsubscriptions.DefaultListRegionalBySubscriptionOperationOptions())` can be used to do batched pagination items, err := client.ListRegionalBySubscriptionComplete(ctx, id, eventsubscriptions.DefaultListRegionalBySubscriptionOperationOptions()) @@ -477,7 +477,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := eventsubscriptions.NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "location", "topicTypeName") +id := eventsubscriptions.NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "locationName", "topicTypeName") // alternatively `client.ListRegionalBySubscriptionForTopicType(ctx, id, eventsubscriptions.DefaultListRegionalBySubscriptionForTopicTypeOperationOptions())` can be used to do batched pagination items, err := client.ListRegionalBySubscriptionForTopicTypeComplete(ctx, id, eventsubscriptions.DefaultListRegionalBySubscriptionForTopicTypeOperationOptions()) @@ -646,13 +646,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.PartnerTopicEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.PartnerTopicEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewPartnerTopicEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "partnerTopicName", "eventSubscriptionName") -read, err := client.PartnerTopicEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.PartnerTopicEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } @@ -757,13 +757,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.SystemTopicEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.SystemTopicEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewSystemTopicEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "systemTopicName", "eventSubscriptionName") -read, err := client.SystemTopicEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.SystemTopicEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } @@ -868,13 +868,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `EventSubscriptionsClient.TopicEventSubscriptionsGetFullUrl` +### Example Usage: `EventSubscriptionsClient.TopicEventSubscriptionsGetFullURL` ```go ctx := context.TODO() id := eventsubscriptions.NewEventSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "topicName", "eventSubscriptionName") -read, err := client.TopicEventSubscriptionsGetFullUrl(ctx, id) +read, err := client.TopicEventSubscriptionsGetFullURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_domaintopic.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_domaintopic.go index 5f91ef8ff44..737d98cc27f 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_domaintopic.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_domaintopic.go @@ -123,7 +123,7 @@ func (id DomainTopicId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticTopics", "topics", "topics"), - resourceids.UserSpecifiedSegment("topicName", "domainTopicName"), + resourceids.UserSpecifiedSegment("topicName", "topicName"), } } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_domaintopic_test.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_domaintopic_test.go index c25b34f6503..e57e91deab7 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_domaintopic_test.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_domaintopic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DomainTopicId{} func TestNewDomainTopicID(t *testing.T) { - id := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName") + id := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDomainTopicID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.TopicName != "domainTopicName" { - t.Fatalf("Expected %q but got %q for Segment 'TopicName'", id.TopicName, "domainTopicName") + if id.TopicName != "topicName" { + t.Fatalf("Expected %q but got %q for Segment 'TopicName'", id.TopicName, "topicName") } } func TestFormatDomainTopicID(t *testing.T) { - actual := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainTopicName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName" + actual := NewDomainTopicID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "topicName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDomainTopicID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - TopicName: "domainTopicName", + TopicName: "topicName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDomainTopicIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - TopicName: "domainTopicName", + TopicName: "topicName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/domainTopicName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/domains/domainName/topics/topicName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/dOmAiNtOpIcNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/tOpIcNaMe", Expected: &DomainTopicId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", DomainName: "dOmAiNnAmE", - TopicName: "dOmAiNtOpIcNaMe", + TopicName: "tOpIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/dOmAiNtOpIcNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/dOmAiNs/dOmAiNnAmE/tOpIcS/tOpIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_location.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_location.go index 75607e8104d..c473cb74943 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_location.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftEventGrid", "Microsoft.EventGrid", "Microsoft.EventGrid"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_location_test.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_location_test.go index e9212e553e2..8a612dfda59 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_location_test.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_locationtopictype.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_locationtopictype.go index 1b6c5dc5809..fa0e89ff6e3 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_locationtopictype.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_locationtopictype.go @@ -113,7 +113,7 @@ func (id LocationTopicTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftEventGrid", "Microsoft.EventGrid", "Microsoft.EventGrid"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticTopicTypes", "topicTypes", "topicTypes"), resourceids.UserSpecifiedSegment("topicTypeName", "topicTypeName"), } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_locationtopictype_test.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_locationtopictype_test.go index bf991ead500..07ff8fad030 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_locationtopictype_test.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_locationtopictype_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LocationTopicTypeId{} func TestNewLocationTopicTypeID(t *testing.T) { - id := NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "location", "topicTypeName") + id := NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "locationName", "topicTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.TopicTypeName != "topicTypeName" { @@ -28,8 +28,8 @@ func TestNewLocationTopicTypeID(t *testing.T) { } func TestFormatLocationTopicTypeID(t *testing.T) { - actual := NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "location", "topicTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName" + actual := NewLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "locationName", "topicTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseLocationTopicTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName", Expected: &LocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", TopicTypeName: "topicTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseLocationTopicTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName", Expected: &LocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", TopicTypeName: "topicTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS/tOpIcTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS/tOpIcTyPeNaMe", Expected: &LocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", TopicTypeName: "tOpIcTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS/tOpIcTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS/tOpIcTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocation.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocation.go index f2b7c1490a4..84ff403e9af 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocation.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftEventGrid", "Microsoft.EventGrid", "Microsoft.EventGrid"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocation_test.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocation_test.go index ecb4135c15d..0326f423caa 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocation_test.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocationtopictype.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocationtopictype.go index 60cbe3dee8f..97f0af1a0b7 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocationtopictype.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocationtopictype.go @@ -121,7 +121,7 @@ func (id ProviderLocationTopicTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftEventGrid", "Microsoft.EventGrid", "Microsoft.EventGrid"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticTopicTypes", "topicTypes", "topicTypes"), resourceids.UserSpecifiedSegment("topicTypeName", "topicTypeName"), } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocationtopictype_test.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocationtopictype_test.go index 3a72fb4989c..363a2b7eadc 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocationtopictype_test.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/id_providerlocationtopictype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationTopicTypeId{} func TestNewProviderLocationTopicTypeID(t *testing.T) { - id := NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "topicTypeName") + id := NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topicTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewProviderLocationTopicTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.TopicTypeName != "topicTypeName" { @@ -32,8 +32,8 @@ func TestNewProviderLocationTopicTypeID(t *testing.T) { } func TestFormatProviderLocationTopicTypeID(t *testing.T) { - actual := NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "topicTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName" + actual := NewProviderLocationTopicTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topicTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseProviderLocationTopicTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName", Expected: &ProviderLocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", TopicTypeName: "topicTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseProviderLocationTopicTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName", Expected: &ProviderLocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", TopicTypeName: "topicTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/location/topicTypes/topicTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventGrid/locations/locationName/topicTypes/topicTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS/tOpIcTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS/tOpIcTyPeNaMe", Expected: &ProviderLocationTopicTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", TopicTypeName: "tOpIcTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoN/tOpIcTyPeS/tOpIcTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtGrId/lOcAtIoNs/lOcAtIoNnAmE/tOpIcTyPeS/tOpIcTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_domaineventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_domaineventsubscriptionsgetfullurl.go index b8b6b82fddd..c8c83150856 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_domaineventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_domaineventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DomainEventSubscriptionsGetFullUrlOperationResponse struct { +type DomainEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// DomainEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) DomainEventSubscriptionsGetFullUrl(ctx context.Context, id DomainEventSubscriptionId) (result DomainEventSubscriptionsGetFullUrlOperationResponse, err error) { +// DomainEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) DomainEventSubscriptionsGetFullURL(ctx context.Context, id DomainEventSubscriptionId) (result DomainEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) DomainEventSubscriptionsGetFullUrl(ctx context return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_domaintopiceventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_domaintopiceventsubscriptionsgetfullurl.go index 84a30dceed8..aa4c4c4381f 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_domaintopiceventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_domaintopiceventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type DomainTopicEventSubscriptionsGetFullUrlOperationResponse struct { +type DomainTopicEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// DomainTopicEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) DomainTopicEventSubscriptionsGetFullUrl(ctx context.Context, id TopicEventSubscriptionId) (result DomainTopicEventSubscriptionsGetFullUrlOperationResponse, err error) { +// DomainTopicEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) DomainTopicEventSubscriptionsGetFullURL(ctx context.Context, id TopicEventSubscriptionId) (result DomainTopicEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) DomainTopicEventSubscriptionsGetFullUrl(ctx co return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_getfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_getfullurl.go index e4cc7356715..de0855e408e 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_getfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_getfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetFullUrlOperationResponse struct { +type GetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// GetFullUrl ... -func (c EventSubscriptionsClient) GetFullUrl(ctx context.Context, id ScopedEventSubscriptionId) (result GetFullUrlOperationResponse, err error) { +// GetFullURL ... +func (c EventSubscriptionsClient) GetFullURL(ctx context.Context, id ScopedEventSubscriptionId) (result GetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) GetFullUrl(ctx context.Context, id ScopedEvent return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_partnertopiceventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_partnertopiceventsubscriptionsgetfullurl.go index c94e3c6dadd..d59a398e4fd 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_partnertopiceventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_partnertopiceventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PartnerTopicEventSubscriptionsGetFullUrlOperationResponse struct { +type PartnerTopicEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// PartnerTopicEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) PartnerTopicEventSubscriptionsGetFullUrl(ctx context.Context, id PartnerTopicEventSubscriptionId) (result PartnerTopicEventSubscriptionsGetFullUrlOperationResponse, err error) { +// PartnerTopicEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) PartnerTopicEventSubscriptionsGetFullURL(ctx context.Context, id PartnerTopicEventSubscriptionId) (result PartnerTopicEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) PartnerTopicEventSubscriptionsGetFullUrl(ctx c return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_systemtopiceventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_systemtopiceventsubscriptionsgetfullurl.go index ec8d05a2ad3..3e23f96c4d8 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_systemtopiceventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_systemtopiceventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type SystemTopicEventSubscriptionsGetFullUrlOperationResponse struct { +type SystemTopicEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// SystemTopicEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) SystemTopicEventSubscriptionsGetFullUrl(ctx context.Context, id SystemTopicEventSubscriptionId) (result SystemTopicEventSubscriptionsGetFullUrlOperationResponse, err error) { +// SystemTopicEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) SystemTopicEventSubscriptionsGetFullURL(ctx context.Context, id SystemTopicEventSubscriptionId) (result SystemTopicEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) SystemTopicEventSubscriptionsGetFullUrl(ctx co return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_topiceventsubscriptionsgetfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_topiceventsubscriptionsgetfullurl.go index 998c1474a03..63a2e5da4b5 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_topiceventsubscriptionsgetfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/method_topiceventsubscriptionsgetfullurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type TopicEventSubscriptionsGetFullUrlOperationResponse struct { +type TopicEventSubscriptionsGetFullURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *EventSubscriptionFullUrl + Model *EventSubscriptionFullURL } -// TopicEventSubscriptionsGetFullUrl ... -func (c EventSubscriptionsClient) TopicEventSubscriptionsGetFullUrl(ctx context.Context, id EventSubscriptionId) (result TopicEventSubscriptionsGetFullUrlOperationResponse, err error) { +// TopicEventSubscriptionsGetFullURL ... +func (c EventSubscriptionsClient) TopicEventSubscriptionsGetFullURL(ctx context.Context, id EventSubscriptionId) (result TopicEventSubscriptionsGetFullURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c EventSubscriptionsClient) TopicEventSubscriptionsGetFullUrl(ctx context. return } - var model EventSubscriptionFullUrl + var model EventSubscriptionFullURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/model_eventsubscriptionfullurl.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/model_eventsubscriptionfullurl.go index 2c155f5fe55..e05ed8166d3 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/model_eventsubscriptionfullurl.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/model_eventsubscriptionfullurl.go @@ -3,6 +3,6 @@ package eventsubscriptions // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type EventSubscriptionFullUrl struct { - EndpointUrl *string `json:"endpointUrl,omitempty"` +type EventSubscriptionFullURL struct { + EndpointURL *string `json:"endpointUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/model_webhookeventsubscriptiondestinationproperties.go b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/model_webhookeventsubscriptiondestinationproperties.go index e5f0570f80d..84058c28f9c 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/model_webhookeventsubscriptiondestinationproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/eventsubscriptions/model_webhookeventsubscriptiondestinationproperties.go @@ -12,8 +12,8 @@ type WebHookEventSubscriptionDestinationProperties struct { AzureActiveDirectoryApplicationIdOrUri *string `json:"azureActiveDirectoryApplicationIdOrUri,omitempty"` AzureActiveDirectoryTenantId *string `json:"azureActiveDirectoryTenantId,omitempty"` DeliveryAttributeMappings *[]DeliveryAttributeMapping `json:"deliveryAttributeMappings,omitempty"` - EndpointBaseUrl *string `json:"endpointBaseUrl,omitempty"` - EndpointUrl *string `json:"endpointUrl,omitempty"` + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` MaxEventsPerBatch *int64 `json:"maxEventsPerBatch,omitempty"` MinimumTlsVersionAllowed *TlsVersion `json:"minimumTlsVersionAllowed,omitempty"` PreferredBatchSizeInKilobytes *int64 `json:"preferredBatchSizeInKilobytes,omitempty"` @@ -25,8 +25,8 @@ func (s *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(bytes []by var decoded struct { AzureActiveDirectoryApplicationIdOrUri *string `json:"azureActiveDirectoryApplicationIdOrUri,omitempty"` AzureActiveDirectoryTenantId *string `json:"azureActiveDirectoryTenantId,omitempty"` - EndpointBaseUrl *string `json:"endpointBaseUrl,omitempty"` - EndpointUrl *string `json:"endpointUrl,omitempty"` + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` MaxEventsPerBatch *int64 `json:"maxEventsPerBatch,omitempty"` MinimumTlsVersionAllowed *TlsVersion `json:"minimumTlsVersionAllowed,omitempty"` PreferredBatchSizeInKilobytes *int64 `json:"preferredBatchSizeInKilobytes,omitempty"` @@ -37,8 +37,8 @@ func (s *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(bytes []by s.AzureActiveDirectoryApplicationIdOrUri = decoded.AzureActiveDirectoryApplicationIdOrUri s.AzureActiveDirectoryTenantId = decoded.AzureActiveDirectoryTenantId - s.EndpointBaseUrl = decoded.EndpointBaseUrl - s.EndpointUrl = decoded.EndpointUrl + s.EndpointBaseURL = decoded.EndpointBaseURL + s.EndpointURL = decoded.EndpointURL s.MaxEventsPerBatch = decoded.MaxEventsPerBatch s.MinimumTlsVersionAllowed = decoded.MinimumTlsVersionAllowed s.PreferredBatchSizeInKilobytes = decoded.PreferredBatchSizeInKilobytes diff --git a/resource-manager/eventgrid/2023-12-15-preview/partnerdestinations/model_partnerdestinationproperties.go b/resource-manager/eventgrid/2023-12-15-preview/partnerdestinations/model_partnerdestinationproperties.go index 4caf77cb674..437eb9aecc8 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/partnerdestinations/model_partnerdestinationproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/partnerdestinations/model_partnerdestinationproperties.go @@ -11,7 +11,7 @@ import ( type PartnerDestinationProperties struct { ActivationState *PartnerDestinationActivationState `json:"activationState,omitempty"` - EndpointBaseUrl *string `json:"endpointBaseUrl,omitempty"` + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` EndpointServiceContext *string `json:"endpointServiceContext,omitempty"` ExpirationTimeIfNotActivatedUtc *string `json:"expirationTimeIfNotActivatedUtc,omitempty"` MessageForActivation *string `json:"messageForActivation,omitempty"` diff --git a/resource-manager/eventgrid/2023-12-15-preview/partnertopics/model_inlineeventproperties.go b/resource-manager/eventgrid/2023-12-15-preview/partnertopics/model_inlineeventproperties.go index e03a71ee086..2be1172a4fb 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/partnertopics/model_inlineeventproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/partnertopics/model_inlineeventproperties.go @@ -4,8 +4,8 @@ package partnertopics // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type InlineEventProperties struct { - DataSchemaUrl *string `json:"dataSchemaUrl,omitempty"` + DataSchemaURL *string `json:"dataSchemaUrl,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - DocumentationUrl *string `json:"documentationUrl,omitempty"` + DocumentationURL *string `json:"documentationUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/README.md b/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/README.md index 99fa7732a85..f9675dcc049 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/README.md +++ b/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := perimeterassociationproxies.NewScopedNetworkSecurityPerimeterConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "perimeterGuidassociationName") +id := perimeterassociationproxies.NewScopedNetworkSecurityPerimeterConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "networkSecurityPerimeterConfigurationName") read, err := client.NetworkSecurityPerimeterConfigurationsGet(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := perimeterassociationproxies.NewScopedNetworkSecurityPerimeterConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "perimeterGuidassociationName") +id := perimeterassociationproxies.NewScopedNetworkSecurityPerimeterConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "networkSecurityPerimeterConfigurationName") if err := client.NetworkSecurityPerimeterConfigurationsReconcileThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/id_scopednetworksecurityperimeterconfiguration.go b/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/id_scopednetworksecurityperimeterconfiguration.go index 2ae3fcd0801..993f9a2bd31 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/id_scopednetworksecurityperimeterconfiguration.go +++ b/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/id_scopednetworksecurityperimeterconfiguration.go @@ -104,7 +104,7 @@ func (id ScopedNetworkSecurityPerimeterConfigurationId) Segments() []resourceids return []resourceids.Segment{ resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), - resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "perimeterGuidassociationName"), + resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } } diff --git a/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/id_scopednetworksecurityperimeterconfiguration_test.go b/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/id_scopednetworksecurityperimeterconfiguration_test.go index a0f2830db29..6d5eb544d6d 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/id_scopednetworksecurityperimeterconfiguration_test.go +++ b/resource-manager/eventgrid/2023-12-15-preview/perimeterassociationproxies/id_scopednetworksecurityperimeterconfiguration_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedNetworkSecurityPerimeterConfigurationId{} func TestNewScopedNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewScopedNetworkSecurityPerimeterConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "perimeterGuidassociationName") + id := NewScopedNetworkSecurityPerimeterConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "networkSecurityPerimeterConfigurationName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.NetworkSecurityPerimeterConfigurationName != "perimeterGuidassociationName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "perimeterGuidassociationName") + if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "networkSecurityPerimeterConfigurationName") } } func TestFormatScopedNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewScopedNetworkSecurityPerimeterConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "perimeterGuidassociationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/perimeterGuidassociationName" + actual := NewScopedNetworkSecurityPerimeterConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -54,15 +54,15 @@ func TestParseScopedNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/perimeterGuidassociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &ScopedNetworkSecurityPerimeterConfigurationId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - NetworkSecurityPerimeterConfigurationName: "perimeterGuidassociationName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/perimeterGuidassociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -125,28 +125,28 @@ func TestParseScopedNetworkSecurityPerimeterConfigurationIDInsensitively(t *test }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/perimeterGuidassociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &ScopedNetworkSecurityPerimeterConfigurationId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - NetworkSecurityPerimeterConfigurationName: "perimeterGuidassociationName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/perimeterGuidassociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/pErImEtErGuIdAsSoCiAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &ScopedNetworkSecurityPerimeterConfigurationId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - NetworkSecurityPerimeterConfigurationName: "pErImEtErGuIdAsSoCiAtIoNnAmE", + NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/pErImEtErGuIdAsSoCiAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventgrid/2023-12-15-preview/topics/model_eventtypeproperties.go b/resource-manager/eventgrid/2023-12-15-preview/topics/model_eventtypeproperties.go index d670b27156a..bf0ec9478ab 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/topics/model_eventtypeproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/topics/model_eventtypeproperties.go @@ -7,5 +7,5 @@ type EventTypeProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` IsInDefaultSet *bool `json:"isInDefaultSet,omitempty"` - SchemaUrl *string `json:"schemaUrl,omitempty"` + SchemaURL *string `json:"schemaUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2023-12-15-preview/topics/model_inlineeventproperties.go b/resource-manager/eventgrid/2023-12-15-preview/topics/model_inlineeventproperties.go index ccd709dcb50..39cadabb34d 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/topics/model_inlineeventproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/topics/model_inlineeventproperties.go @@ -4,8 +4,8 @@ package topics // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type InlineEventProperties struct { - DataSchemaUrl *string `json:"dataSchemaUrl,omitempty"` + DataSchemaURL *string `json:"dataSchemaUrl,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - DocumentationUrl *string `json:"documentationUrl,omitempty"` + DocumentationURL *string `json:"documentationUrl,omitempty"` } diff --git a/resource-manager/eventgrid/2023-12-15-preview/topictypes/model_eventtypeproperties.go b/resource-manager/eventgrid/2023-12-15-preview/topictypes/model_eventtypeproperties.go index deadd920daf..313f891e8d1 100644 --- a/resource-manager/eventgrid/2023-12-15-preview/topictypes/model_eventtypeproperties.go +++ b/resource-manager/eventgrid/2023-12-15-preview/topictypes/model_eventtypeproperties.go @@ -7,5 +7,5 @@ type EventTypeProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` IsInDefaultSet *bool `json:"isInDefaultSet,omitempty"` - SchemaUrl *string `json:"schemaUrl,omitempty"` + SchemaURL *string `json:"schemaUrl,omitempty"` } diff --git a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/README.md b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/README.md index 7ba1ec92d87..7584815c97e 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/README.md +++ b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.DisasterRecoveryConfigsGetAuthorizationRule(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") // alternatively `client.DisasterRecoveryConfigsListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.DisasterRecoveryConfigsListAuthorizationRulesComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.DisasterRecoveryConfigsListKeys(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go index 2a97374b539..ed126bb1785 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 6380c44193a..b3f310351e2 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go index 1872529519f..4cca7fa823d 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go +++ b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go @@ -129,7 +129,7 @@ func (id DisasterRecoveryConfigAuthorizationRuleId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go index 161bbdbdb3c..c4701446fbc 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go +++ b/resource-manager/eventhub/2021-11-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigAuthorizationRuleId{} func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") + id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { } func TestFormatDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName" + actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/README.md b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/README.md index 09c4f19676c..fafede0f676 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/README.md +++ b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") payload := authorizationruleseventhubs.AuthorizationRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := authorizationruleseventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") // alternatively `client.EventHubsListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.EventHubsListAuthorizationRulesComplete(ctx, id) @@ -62,7 +62,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.EventHubsListKeys(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") payload := authorizationruleseventhubs.RegenerateAccessKeyParameters{ // ... diff --git a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhub.go b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhub.go index b09c0c4f428..3cf6d3d3155 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhub.go +++ b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhub_test.go b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhub_test.go index cb8454153fb..c80edc72dbd 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhub_test.go +++ b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhubauthorizationrule.go b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhubauthorizationrule.go index a954ec8d9bb..c27ec213288 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhubauthorizationrule.go +++ b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhubauthorizationrule.go @@ -129,7 +129,7 @@ func (id EventhubAuthorizationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go index 69214b68b04..cce88a1315f 100644 --- a/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go +++ b/resource-manager/eventhub/2021-11-01/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubAuthorizationRuleId{} func TestNewEventhubAuthorizationRuleID(t *testing.T) { - id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") + id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { } func TestFormatEventhubAuthorizationRuleID(t *testing.T) { - actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName" + actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseEventhubAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2021-11-01/consumergroups/README.md b/resource-manager/eventhub/2021-11-01/consumergroups/README.md index d3872dee440..2f05e1ae0d2 100644 --- a/resource-manager/eventhub/2021-11-01/consumergroups/README.md +++ b/resource-manager/eventhub/2021-11-01/consumergroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") payload := consumergroups.ConsumerGroup{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := consumergroups.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") // alternatively `client.ListByEventHub(ctx, id, consumergroups.DefaultListByEventHubOperationOptions())` can be used to do batched pagination items, err := client.ListByEventHubComplete(ctx, id, consumergroups.DefaultListByEventHubOperationOptions()) diff --git a/resource-manager/eventhub/2021-11-01/consumergroups/id_consumergroup.go b/resource-manager/eventhub/2021-11-01/consumergroups/id_consumergroup.go index c3fe87d1136..070efa7e6fb 100644 --- a/resource-manager/eventhub/2021-11-01/consumergroups/id_consumergroup.go +++ b/resource-manager/eventhub/2021-11-01/consumergroups/id_consumergroup.go @@ -129,7 +129,7 @@ func (id ConsumerGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticConsumerGroups", "consumerGroups", "consumerGroups"), resourceids.UserSpecifiedSegment("consumerGroupName", "consumerGroupName"), } diff --git a/resource-manager/eventhub/2021-11-01/consumergroups/id_consumergroup_test.go b/resource-manager/eventhub/2021-11-01/consumergroups/id_consumergroup_test.go index 6b754b3bc7a..87dbdb80e9b 100644 --- a/resource-manager/eventhub/2021-11-01/consumergroups/id_consumergroup_test.go +++ b/resource-manager/eventhub/2021-11-01/consumergroups/id_consumergroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConsumerGroupId{} func TestNewConsumerGroupID(t *testing.T) { - id := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") + id := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewConsumerGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.ConsumerGroupName != "consumerGroupName" { @@ -36,8 +36,8 @@ func TestNewConsumerGroupID(t *testing.T) { } func TestFormatConsumerGroupID(t *testing.T) { - actual := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName" + actual := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseConsumerGroupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName", Expected: &ConsumerGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", ConsumerGroupName: "consumerGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName", Expected: &ConsumerGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", ConsumerGroupName: "consumerGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2021-11-01/consumergroups/id_eventhub.go b/resource-manager/eventhub/2021-11-01/consumergroups/id_eventhub.go index 5275e910060..8a7139cbbe6 100644 --- a/resource-manager/eventhub/2021-11-01/consumergroups/id_eventhub.go +++ b/resource-manager/eventhub/2021-11-01/consumergroups/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2021-11-01/consumergroups/id_eventhub_test.go b/resource-manager/eventhub/2021-11-01/consumergroups/id_eventhub_test.go index cd2c00689e4..e72db87cc5f 100644 --- a/resource-manager/eventhub/2021-11-01/consumergroups/id_eventhub_test.go +++ b/resource-manager/eventhub/2021-11-01/consumergroups/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/README.md b/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/README.md index 8a5a33a93fc..d6045f3ba2c 100644 --- a/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/README.md +++ b/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.BreakPairing(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.ArmDisasterRecovery{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Delete(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.FailOver(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go index 2ce34642676..52688254200 100644 --- a/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 4541f78d3ae..aaca923e721 100644 --- a/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/eventhub/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2021-11-01/eventhubs/README.md b/resource-manager/eventhub/2021-11-01/eventhubs/README.md index fe8da8c1c9e..5b462fc84f0 100644 --- a/resource-manager/eventhub/2021-11-01/eventhubs/README.md +++ b/resource-manager/eventhub/2021-11-01/eventhubs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") payload := eventhubs.Eventhub{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.DeleteAuthorizationRule(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") read, err := client.Get(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhub.go b/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhub.go index d7cc33529d5..2bd22729cb4 100644 --- a/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhub.go +++ b/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhub_test.go b/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhub_test.go index e45cce53ca3..4f11ccaf93e 100644 --- a/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhub_test.go +++ b/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhubauthorizationrule.go b/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhubauthorizationrule.go index 7fdece21bff..6f0c967f71c 100644 --- a/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhubauthorizationrule.go +++ b/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhubauthorizationrule.go @@ -129,7 +129,7 @@ func (id EventhubAuthorizationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhubauthorizationrule_test.go b/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhubauthorizationrule_test.go index 29864743f90..233fd38581c 100644 --- a/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhubauthorizationrule_test.go +++ b/resource-manager/eventhub/2021-11-01/eventhubs/id_eventhubauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubAuthorizationRuleId{} func TestNewEventhubAuthorizationRuleID(t *testing.T) { - id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") + id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { } func TestFormatEventhubAuthorizationRuleID(t *testing.T) { - actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName" + actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseEventhubAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/README.md b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/README.md index 78e151f87fc..50689d842b6 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/README.md +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.DisasterRecoveryConfigsGetAuthorizationRule(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") // alternatively `client.DisasterRecoveryConfigsListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.DisasterRecoveryConfigsListAuthorizationRulesComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.DisasterRecoveryConfigsListKeys(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go index 2a97374b539..ed126bb1785 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 6380c44193a..b3f310351e2 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go index 1872529519f..4cca7fa823d 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go @@ -129,7 +129,7 @@ func (id DisasterRecoveryConfigAuthorizationRuleId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go index 161bbdbdb3c..c4701446fbc 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigAuthorizationRuleId{} func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") + id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { } func TestFormatDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName" + actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/README.md b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/README.md index c9685ec50c6..575e244ff4d 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/README.md +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") payload := authorizationruleseventhubs.AuthorizationRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := authorizationruleseventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") // alternatively `client.EventHubsListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.EventHubsListAuthorizationRulesComplete(ctx, id) @@ -62,7 +62,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.EventHubsListKeys(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") payload := authorizationruleseventhubs.RegenerateAccessKeyParameters{ // ... diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhub.go b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhub.go index b09c0c4f428..3cf6d3d3155 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhub.go +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhub_test.go b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhub_test.go index cb8454153fb..c80edc72dbd 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhub_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhubauthorizationrule.go b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhubauthorizationrule.go index a954ec8d9bb..c27ec213288 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhubauthorizationrule.go +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhubauthorizationrule.go @@ -129,7 +129,7 @@ func (id EventhubAuthorizationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go index 69214b68b04..cce88a1315f 100644 --- a/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubAuthorizationRuleId{} func TestNewEventhubAuthorizationRuleID(t *testing.T) { - id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") + id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { } func TestFormatEventhubAuthorizationRuleID(t *testing.T) { - actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName" + actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseEventhubAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2022-01-01-preview/consumergroups/README.md b/resource-manager/eventhub/2022-01-01-preview/consumergroups/README.md index 9cd78c9c9eb..b637638d364 100644 --- a/resource-manager/eventhub/2022-01-01-preview/consumergroups/README.md +++ b/resource-manager/eventhub/2022-01-01-preview/consumergroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") payload := consumergroups.ConsumerGroup{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := consumergroups.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") // alternatively `client.ListByEventHub(ctx, id, consumergroups.DefaultListByEventHubOperationOptions())` can be used to do batched pagination items, err := client.ListByEventHubComplete(ctx, id, consumergroups.DefaultListByEventHubOperationOptions()) diff --git a/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_consumergroup.go b/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_consumergroup.go index c3fe87d1136..070efa7e6fb 100644 --- a/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_consumergroup.go +++ b/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_consumergroup.go @@ -129,7 +129,7 @@ func (id ConsumerGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticConsumerGroups", "consumerGroups", "consumerGroups"), resourceids.UserSpecifiedSegment("consumerGroupName", "consumerGroupName"), } diff --git a/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_consumergroup_test.go b/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_consumergroup_test.go index 6b754b3bc7a..87dbdb80e9b 100644 --- a/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_consumergroup_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_consumergroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConsumerGroupId{} func TestNewConsumerGroupID(t *testing.T) { - id := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") + id := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewConsumerGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.ConsumerGroupName != "consumerGroupName" { @@ -36,8 +36,8 @@ func TestNewConsumerGroupID(t *testing.T) { } func TestFormatConsumerGroupID(t *testing.T) { - actual := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName" + actual := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseConsumerGroupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName", Expected: &ConsumerGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", ConsumerGroupName: "consumerGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName", Expected: &ConsumerGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", ConsumerGroupName: "consumerGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_eventhub.go b/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_eventhub.go index 5275e910060..8a7139cbbe6 100644 --- a/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_eventhub.go +++ b/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_eventhub_test.go b/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_eventhub_test.go index cd2c00689e4..e72db87cc5f 100644 --- a/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_eventhub_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/consumergroups/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/README.md b/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/README.md index d08d34a59c6..efcbf1d2e78 100644 --- a/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/README.md +++ b/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.BreakPairing(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.ArmDisasterRecovery{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Delete(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.FailOver(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go index 2ce34642676..52688254200 100644 --- a/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 4541f78d3ae..aaca923e721 100644 --- a/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2022-01-01-preview/eventhubs/README.md b/resource-manager/eventhub/2022-01-01-preview/eventhubs/README.md index c62f398be45..61d1b98a2c8 100644 --- a/resource-manager/eventhub/2022-01-01-preview/eventhubs/README.md +++ b/resource-manager/eventhub/2022-01-01-preview/eventhubs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") payload := eventhubs.Eventhub{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.DeleteAuthorizationRule(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") read, err := client.Get(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhub.go b/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhub.go index d7cc33529d5..2bd22729cb4 100644 --- a/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhub.go +++ b/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhub_test.go b/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhub_test.go index e45cce53ca3..4f11ccaf93e 100644 --- a/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhub_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhubauthorizationrule.go b/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhubauthorizationrule.go index 7fdece21bff..6f0c967f71c 100644 --- a/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhubauthorizationrule.go +++ b/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhubauthorizationrule.go @@ -129,7 +129,7 @@ func (id EventhubAuthorizationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhubauthorizationrule_test.go b/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhubauthorizationrule_test.go index 29864743f90..233fd38581c 100644 --- a/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhubauthorizationrule_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/eventhubs/id_eventhubauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubAuthorizationRuleId{} func TestNewEventhubAuthorizationRuleID(t *testing.T) { - id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") + id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { } func TestFormatEventhubAuthorizationRuleID(t *testing.T) { - actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName" + actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseEventhubAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/README.md b/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/README.md index d70a5e9d6bb..a05bb450618 100644 --- a/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/README.md +++ b/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/README.md @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := namespacesnetworksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "resourceAssociationName") +id := namespacesnetworksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "networkSecurityPerimeterConfigurationName") if err := client.NetworkSecurityPerimeterConfigurationsCreateOrUpdateThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go b/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go index 942a810adc5..6e12cbfbb25 100644 --- a/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go +++ b/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go @@ -123,7 +123,7 @@ func (id NetworkSecurityPerimeterConfigurationId) Segments() []resourceids.Segme resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), - resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "resourceAssociationName"), + resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } } diff --git a/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go b/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go index 797765624ae..f04528b7fbb 100644 --- a/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go +++ b/resource-manager/eventhub/2022-01-01-preview/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkSecurityPerimeterConfigurationId{} func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "resourceAssociationName") + id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "networkSecurityPerimeterConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.NetworkSecurityPerimeterConfigurationName != "resourceAssociationName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "resourceAssociationName") + if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "networkSecurityPerimeterConfigurationName") } } func TestFormatNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "resourceAssociationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName" + actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - NetworkSecurityPerimeterConfigurationName: "resourceAssociationName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNetworkSecurityPerimeterConfigurationIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - NetworkSecurityPerimeterConfigurationName: "resourceAssociationName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/rEsOuRcEaSsOcIaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - NetworkSecurityPerimeterConfigurationName: "rEsOuRcEaSsOcIaTiOnNaMe", + NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/rEsOuRcEaSsOcIaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/README.md b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/README.md index 8f42f789761..b6e5bec538a 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/README.md +++ b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.DisasterRecoveryConfigsGetAuthorizationRule(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") // alternatively `client.DisasterRecoveryConfigsListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.DisasterRecoveryConfigsListAuthorizationRulesComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := authorizationrulesdisasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.DisasterRecoveryConfigsListKeys(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go index 2a97374b539..ed126bb1785 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 6380c44193a..b3f310351e2 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go index 1872529519f..4cca7fa823d 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go +++ b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go @@ -129,7 +129,7 @@ func (id DisasterRecoveryConfigAuthorizationRuleId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go index 161bbdbdb3c..c4701446fbc 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go +++ b/resource-manager/eventhub/2024-01-01/authorizationrulesdisasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigAuthorizationRuleId{} func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") + id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { } func TestFormatDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName" + actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/README.md b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/README.md index 94fa160c69d..bcf409cf702 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/README.md +++ b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") payload := authorizationruleseventhubs.AuthorizationRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := authorizationruleseventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") // alternatively `client.EventHubsListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.EventHubsListAuthorizationRulesComplete(ctx, id) @@ -62,7 +62,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.EventHubsListKeys(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := authorizationruleseventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") payload := authorizationruleseventhubs.RegenerateAccessKeyParameters{ // ... diff --git a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhub.go b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhub.go index b09c0c4f428..3cf6d3d3155 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhub.go +++ b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhub_test.go b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhub_test.go index cb8454153fb..c80edc72dbd 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhub_test.go +++ b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhubauthorizationrule.go b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhubauthorizationrule.go index a954ec8d9bb..c27ec213288 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhubauthorizationrule.go +++ b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhubauthorizationrule.go @@ -129,7 +129,7 @@ func (id EventhubAuthorizationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go index 69214b68b04..cce88a1315f 100644 --- a/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go +++ b/resource-manager/eventhub/2024-01-01/authorizationruleseventhubs/id_eventhubauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubAuthorizationRuleId{} func TestNewEventhubAuthorizationRuleID(t *testing.T) { - id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") + id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { } func TestFormatEventhubAuthorizationRuleID(t *testing.T) { - actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName" + actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseEventhubAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2024-01-01/consumergroups/README.md b/resource-manager/eventhub/2024-01-01/consumergroups/README.md index 08f737355a9..ab8117e8d31 100644 --- a/resource-manager/eventhub/2024-01-01/consumergroups/README.md +++ b/resource-manager/eventhub/2024-01-01/consumergroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") payload := consumergroups.ConsumerGroup{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") +id := consumergroups.NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := consumergroups.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := consumergroups.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") // alternatively `client.ListByEventHub(ctx, id, consumergroups.DefaultListByEventHubOperationOptions())` can be used to do batched pagination items, err := client.ListByEventHubComplete(ctx, id, consumergroups.DefaultListByEventHubOperationOptions()) diff --git a/resource-manager/eventhub/2024-01-01/consumergroups/id_consumergroup.go b/resource-manager/eventhub/2024-01-01/consumergroups/id_consumergroup.go index c3fe87d1136..070efa7e6fb 100644 --- a/resource-manager/eventhub/2024-01-01/consumergroups/id_consumergroup.go +++ b/resource-manager/eventhub/2024-01-01/consumergroups/id_consumergroup.go @@ -129,7 +129,7 @@ func (id ConsumerGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticConsumerGroups", "consumerGroups", "consumerGroups"), resourceids.UserSpecifiedSegment("consumerGroupName", "consumerGroupName"), } diff --git a/resource-manager/eventhub/2024-01-01/consumergroups/id_consumergroup_test.go b/resource-manager/eventhub/2024-01-01/consumergroups/id_consumergroup_test.go index 6b754b3bc7a..87dbdb80e9b 100644 --- a/resource-manager/eventhub/2024-01-01/consumergroups/id_consumergroup_test.go +++ b/resource-manager/eventhub/2024-01-01/consumergroups/id_consumergroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConsumerGroupId{} func TestNewConsumerGroupID(t *testing.T) { - id := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName") + id := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewConsumerGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.ConsumerGroupName != "consumerGroupName" { @@ -36,8 +36,8 @@ func TestNewConsumerGroupID(t *testing.T) { } func TestFormatConsumerGroupID(t *testing.T) { - actual := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "consumerGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName" + actual := NewConsumerGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "consumerGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseConsumerGroupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName", Expected: &ConsumerGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", ConsumerGroupName: "consumerGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseConsumerGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName", Expected: &ConsumerGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", ConsumerGroupName: "consumerGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/consumerGroups/consumerGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/consumerGroups/consumerGroupName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2024-01-01/consumergroups/id_eventhub.go b/resource-manager/eventhub/2024-01-01/consumergroups/id_eventhub.go index 5275e910060..8a7139cbbe6 100644 --- a/resource-manager/eventhub/2024-01-01/consumergroups/id_eventhub.go +++ b/resource-manager/eventhub/2024-01-01/consumergroups/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2024-01-01/consumergroups/id_eventhub_test.go b/resource-manager/eventhub/2024-01-01/consumergroups/id_eventhub_test.go index cd2c00689e4..e72db87cc5f 100644 --- a/resource-manager/eventhub/2024-01-01/consumergroups/id_eventhub_test.go +++ b/resource-manager/eventhub/2024-01-01/consumergroups/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/README.md b/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/README.md index 9b1a33665f1..17385eaae95 100644 --- a/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/README.md +++ b/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.BreakPairing(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.ArmDisasterRecovery{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Delete(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.FailOver(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go index 2ce34642676..52688254200 100644 --- a/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 4541f78d3ae..aaca923e721 100644 --- a/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/eventhub/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/eventhub/2024-01-01/eventhubs/README.md b/resource-manager/eventhub/2024-01-01/eventhubs/README.md index 7f045513604..6b4116871c6 100644 --- a/resource-manager/eventhub/2024-01-01/eventhubs/README.md +++ b/resource-manager/eventhub/2024-01-01/eventhubs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") payload := eventhubs.Eventhub{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.DeleteAuthorizationRule(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") +id := eventhubs.NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") read, err := client.Get(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") +id := eventhubs.NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { diff --git a/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhub.go b/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhub.go index d7cc33529d5..2bd22729cb4 100644 --- a/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhub.go +++ b/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhub.go @@ -123,7 +123,7 @@ func (id EventhubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), } } diff --git a/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhub_test.go b/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhub_test.go index e45cce53ca3..4f11ccaf93e 100644 --- a/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhub_test.go +++ b/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubId{} func TestNewEventhubID(t *testing.T) { - id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName") + id := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEventhubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } } func TestFormatEventhubID(t *testing.T) { - actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName" + actual := NewEventhubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEventhubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, } @@ -248,17 +248,17 @@ func TestParseEventhubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Expected: &EventhubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhubauthorizationrule.go b/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhubauthorizationrule.go index 7fdece21bff..6f0c967f71c 100644 --- a/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhubauthorizationrule.go +++ b/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhubauthorizationrule.go @@ -129,7 +129,7 @@ func (id EventhubAuthorizationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticEventhubs", "eventhubs", "eventhubs"), - resourceids.UserSpecifiedSegment("eventhubName", "eventHubName"), + resourceids.UserSpecifiedSegment("eventhubName", "eventhubName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhubauthorizationrule_test.go b/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhubauthorizationrule_test.go index 29864743f90..233fd38581c 100644 --- a/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhubauthorizationrule_test.go +++ b/resource-manager/eventhub/2024-01-01/eventhubs/id_eventhubauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EventhubAuthorizationRuleId{} func TestNewEventhubAuthorizationRuleID(t *testing.T) { - id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName") + id := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.EventhubName != "eventHubName" { - t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventHubName") + if id.EventhubName != "eventhubName" { + t.Fatalf("Expected %q but got %q for Segment 'EventhubName'", id.EventhubName, "eventhubName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewEventhubAuthorizationRuleID(t *testing.T) { } func TestFormatEventhubAuthorizationRuleID(t *testing.T) { - actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventHubName", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName" + actual := NewEventhubAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "eventhubName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseEventhubAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,7 +267,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName", Error: true, }, { @@ -277,7 +277,7 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules", Error: true, }, { @@ -287,18 +287,18 @@ func TestParseEventhubAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName", Expected: &EventhubAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - EventhubName: "eventHubName", + EventhubName: "eventhubName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventHubName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/eventhubs/eventhubName/authorizationRules/authorizationRuleName/extra", Error: true, }, { diff --git a/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/README.md b/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/README.md index 02866cb6fd2..a611bfe47ac 100644 --- a/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/README.md +++ b/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/README.md @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := namespacesnetworksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "resourceAssociationName") +id := namespacesnetworksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "networkSecurityPerimeterConfigurationName") if err := client.NetworkSecurityPerimeterConfigurationsCreateOrUpdateThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go b/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go index 942a810adc5..6e12cbfbb25 100644 --- a/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go +++ b/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go @@ -123,7 +123,7 @@ func (id NetworkSecurityPerimeterConfigurationId) Segments() []resourceids.Segme resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), - resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "resourceAssociationName"), + resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } } diff --git a/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go b/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go index 797765624ae..f04528b7fbb 100644 --- a/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go +++ b/resource-manager/eventhub/2024-01-01/namespacesnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkSecurityPerimeterConfigurationId{} func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "resourceAssociationName") + id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "networkSecurityPerimeterConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.NetworkSecurityPerimeterConfigurationName != "resourceAssociationName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "resourceAssociationName") + if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "networkSecurityPerimeterConfigurationName") } } func TestFormatNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "resourceAssociationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName" + actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - NetworkSecurityPerimeterConfigurationName: "resourceAssociationName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNetworkSecurityPerimeterConfigurationIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - NetworkSecurityPerimeterConfigurationName: "resourceAssociationName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/resourceAssociationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.EventHub/namespaces/namespaceName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/rEsOuRcEaSsOcIaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - NetworkSecurityPerimeterConfigurationName: "rEsOuRcEaSsOcIaTiOnNaMe", + NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/rEsOuRcEaSsOcIaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eVeNtHuB/nAmEsPaCeS/nAmEsPaCeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/extendedlocation/2021-08-15/customlocations/README.md b/resource-manager/extendedlocation/2021-08-15/customlocations/README.md index ecdbe7900e7..90ed3642fcf 100644 --- a/resource-manager/extendedlocation/2021-08-15/customlocations/README.md +++ b/resource-manager/extendedlocation/2021-08-15/customlocations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customLocationName") payload := customlocations.CustomLocation{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customLocationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customLocationName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customLocationName") // alternatively `client.ListEnabledResourceTypes(ctx, id)` can be used to do batched pagination items, err := client.ListEnabledResourceTypesComplete(ctx, id) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := customlocations.NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customLocationName") payload := customlocations.PatchableCustomLocations{ // ... diff --git a/resource-manager/extendedlocation/2021-08-15/customlocations/id_customlocation.go b/resource-manager/extendedlocation/2021-08-15/customlocations/id_customlocation.go index f3c7b6facef..9b5679dca82 100644 --- a/resource-manager/extendedlocation/2021-08-15/customlocations/id_customlocation.go +++ b/resource-manager/extendedlocation/2021-08-15/customlocations/id_customlocation.go @@ -115,7 +115,7 @@ func (id CustomLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftExtendedLocation", "Microsoft.ExtendedLocation", "Microsoft.ExtendedLocation"), resourceids.StaticSegment("staticCustomLocations", "customLocations", "customLocations"), - resourceids.UserSpecifiedSegment("customLocationName", "resourceName"), + resourceids.UserSpecifiedSegment("customLocationName", "customLocationName"), } } diff --git a/resource-manager/extendedlocation/2021-08-15/customlocations/id_customlocation_test.go b/resource-manager/extendedlocation/2021-08-15/customlocations/id_customlocation_test.go index 12788f74117..89500e6367f 100644 --- a/resource-manager/extendedlocation/2021-08-15/customlocations/id_customlocation_test.go +++ b/resource-manager/extendedlocation/2021-08-15/customlocations/id_customlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomLocationId{} func TestNewCustomLocationID(t *testing.T) { - id := NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customLocationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCustomLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CustomLocationName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomLocationName'", id.CustomLocationName, "resourceName") + if id.CustomLocationName != "customLocationName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomLocationName'", id.CustomLocationName, "customLocationName") } } func TestFormatCustomLocationID(t *testing.T) { - actual := NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/resourceName" + actual := NewCustomLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customLocationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/customLocationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCustomLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", Expected: &CustomLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomLocationName: "resourceName", + CustomLocationName: "customLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/customLocationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCustomLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/customLocationName", Expected: &CustomLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomLocationName: "resourceName", + CustomLocationName: "customLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ExtendedLocation/customLocations/customLocationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eXtEnDeDlOcAtIoN/cUsToMlOcAtIoNs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eXtEnDeDlOcAtIoN/cUsToMlOcAtIoNs/cUsToMlOcAtIoNnAmE", Expected: &CustomLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CustomLocationName: "rEsOuRcEnAmE", + CustomLocationName: "cUsToMlOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eXtEnDeDlOcAtIoN/cUsToMlOcAtIoNs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.eXtEnDeDlOcAtIoN/cUsToMlOcAtIoNs/cUsToMlOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/fabric/2023-11-01/fabriccapacities/README.md b/resource-manager/fabric/2023-11-01/fabriccapacities/README.md index ba0e0495a6d..9f4cbe1ad0a 100644 --- a/resource-manager/fabric/2023-11-01/fabriccapacities/README.md +++ b/resource-manager/fabric/2023-11-01/fabriccapacities/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fabriccapacities.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := fabriccapacities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := fabriccapacities.CheckNameAvailabilityRequest{ // ... diff --git a/resource-manager/fabric/2023-11-01/fabriccapacities/id_location.go b/resource-manager/fabric/2023-11-01/fabriccapacities/id_location.go index eb486f1313f..ae114a983d9 100644 --- a/resource-manager/fabric/2023-11-01/fabriccapacities/id_location.go +++ b/resource-manager/fabric/2023-11-01/fabriccapacities/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftFabric", "Microsoft.Fabric", "Microsoft.Fabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/fabric/2023-11-01/fabriccapacities/id_location_test.go b/resource-manager/fabric/2023-11-01/fabriccapacities/id_location_test.go index 33eee81a41c..8e4011fad3c 100644 --- a/resource-manager/fabric/2023-11-01/fabriccapacities/id_location_test.go +++ b/resource-manager/fabric/2023-11-01/fabriccapacities/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Fabric/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fAbRiC/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fAbRiC/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fAbRiC/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fAbRiC/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/fluidrelay/2022-05-26/fluidrelayservers/model_customermanagedkeyencryptionproperties.go b/resource-manager/fluidrelay/2022-05-26/fluidrelayservers/model_customermanagedkeyencryptionproperties.go index c901b57f909..ce47f01c5d0 100644 --- a/resource-manager/fluidrelay/2022-05-26/fluidrelayservers/model_customermanagedkeyencryptionproperties.go +++ b/resource-manager/fluidrelay/2022-05-26/fluidrelayservers/model_customermanagedkeyencryptionproperties.go @@ -5,5 +5,5 @@ package fluidrelayservers type CustomerManagedKeyEncryptionProperties struct { KeyEncryptionKeyIdentity *CustomerManagedKeyEncryptionPropertiesKeyEncryptionKeyIdentity `json:"keyEncryptionKeyIdentity,omitempty"` - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/fluidrelay/2022-06-01/fluidrelayservers/model_customermanagedkeyencryptionproperties.go b/resource-manager/fluidrelay/2022-06-01/fluidrelayservers/model_customermanagedkeyencryptionproperties.go index c901b57f909..ce47f01c5d0 100644 --- a/resource-manager/fluidrelay/2022-06-01/fluidrelayservers/model_customermanagedkeyencryptionproperties.go +++ b/resource-manager/fluidrelay/2022-06-01/fluidrelayservers/model_customermanagedkeyencryptionproperties.go @@ -5,5 +5,5 @@ package fluidrelayservers type CustomerManagedKeyEncryptionProperties struct { KeyEncryptionKeyIdentity *CustomerManagedKeyEncryptionPropertiesKeyEncryptionKeyIdentity `json:"keyEncryptionKeyIdentity,omitempty"` - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/frontdoor/2020-04-01/frontdoors/constants.go b/resource-manager/frontdoor/2020-04-01/frontdoors/constants.go index 4d789b0851d..863f68fcd11 100644 --- a/resource-manager/frontdoor/2020-04-01/frontdoors/constants.go +++ b/resource-manager/frontdoor/2020-04-01/frontdoors/constants.go @@ -839,9 +839,9 @@ const ( TransformLowercase Transform = "Lowercase" TransformRemoveNulls Transform = "RemoveNulls" TransformTrim Transform = "Trim" + TransformURLDecode Transform = "UrlDecode" + TransformURLEncode Transform = "UrlEncode" TransformUppercase Transform = "Uppercase" - TransformUrlDecode Transform = "UrlDecode" - TransformUrlEncode Transform = "UrlEncode" ) func PossibleValuesForTransform() []string { @@ -849,9 +849,9 @@ func PossibleValuesForTransform() []string { string(TransformLowercase), string(TransformRemoveNulls), string(TransformTrim), + string(TransformURLDecode), + string(TransformURLEncode), string(TransformUppercase), - string(TransformUrlDecode), - string(TransformUrlEncode), } } @@ -860,9 +860,9 @@ func parseTransform(input string) (*Transform, error) { "lowercase": TransformLowercase, "removenulls": TransformRemoveNulls, "trim": TransformTrim, + "urldecode": TransformURLDecode, + "urlencode": TransformURLEncode, "uppercase": TransformUppercase, - "urldecode": TransformUrlDecode, - "urlencode": TransformUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/README.md b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/README.md index 8434571862e..7be645d5948 100644 --- a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/README.md +++ b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ // ... @@ -42,7 +42,7 @@ if err := client.PoliciesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") if err := client.PoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.PoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") read, err := client.PoliciesGet(ctx, id) if err != nil { diff --git a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/constants.go b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/constants.go index 24816afee99..ff167cdc1f4 100644 --- a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/constants.go +++ b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/constants.go @@ -405,9 +405,9 @@ const ( TransformTypeLowercase TransformType = "Lowercase" TransformTypeRemoveNulls TransformType = "RemoveNulls" TransformTypeTrim TransformType = "Trim" + TransformTypeURLDecode TransformType = "UrlDecode" + TransformTypeURLEncode TransformType = "UrlEncode" TransformTypeUppercase TransformType = "Uppercase" - TransformTypeUrlDecode TransformType = "UrlDecode" - TransformTypeUrlEncode TransformType = "UrlEncode" ) func PossibleValuesForTransformType() []string { @@ -415,9 +415,9 @@ func PossibleValuesForTransformType() []string { string(TransformTypeLowercase), string(TransformTypeRemoveNulls), string(TransformTypeTrim), + string(TransformTypeURLDecode), + string(TransformTypeURLEncode), string(TransformTypeUppercase), - string(TransformTypeUrlDecode), - string(TransformTypeUrlEncode), } } @@ -426,9 +426,9 @@ func parseTransformType(input string) (*TransformType, error) { "lowercase": TransformTypeLowercase, "removenulls": TransformTypeRemoveNulls, "trim": TransformTypeTrim, + "urldecode": TransformTypeURLDecode, + "urlencode": TransformTypeURLEncode, "uppercase": TransformTypeUppercase, - "urldecode": TransformTypeUrlDecode, - "urlencode": TransformTypeUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go index 4219ee8c438..ea213652257 100644 --- a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go +++ b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go @@ -115,7 +115,7 @@ func (id FrontDoorWebApplicationFirewallPolicyId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticFrontDoorWebApplicationFirewallPolicies", "frontDoorWebApplicationFirewallPolicies", "frontDoorWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("frontDoorWebApplicationFirewallPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("frontDoorWebApplicationFirewallPolicyName", "frontDoorWebApplicationFirewallPolicyName"), } } diff --git a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go index bd6c96d5c0c..2d78ddaba49 100644 --- a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go +++ b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FrontDoorWebApplicationFirewallPolicyId{} func TestNewFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { - id := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FrontDoorWebApplicationFirewallPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'FrontDoorWebApplicationFirewallPolicyName'", id.FrontDoorWebApplicationFirewallPolicyName, "policyName") + if id.FrontDoorWebApplicationFirewallPolicyName != "frontDoorWebApplicationFirewallPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'FrontDoorWebApplicationFirewallPolicyName'", id.FrontDoorWebApplicationFirewallPolicyName, "frontDoorWebApplicationFirewallPolicyName") } } func TestFormatFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName" + actual := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FrontDoorWebApplicationFirewallPolicyName: "policyName", + FrontDoorWebApplicationFirewallPolicyName: "frontDoorWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFrontDoorWebApplicationFirewallPolicyIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FrontDoorWebApplicationFirewallPolicyName: "policyName", + FrontDoorWebApplicationFirewallPolicyName: "frontDoorWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FrontDoorWebApplicationFirewallPolicyName: "pOlIcYnAmE", + FrontDoorWebApplicationFirewallPolicyName: "fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe/extra", Error: true, }, } diff --git a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/model_policysettings.go b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/model_policysettings.go index 54081f9511a..bd1cda95c24 100644 --- a/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/model_policysettings.go +++ b/resource-manager/frontdoor/2020-04-01/webapplicationfirewallpolicies/model_policysettings.go @@ -8,5 +8,5 @@ type PolicySettings struct { CustomBlockResponseStatusCode *int64 `json:"customBlockResponseStatusCode,omitempty"` EnabledState *PolicyEnabledState `json:"enabledState,omitempty"` Mode *PolicyMode `json:"mode,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` } diff --git a/resource-manager/frontdoor/2020-05-01/frontdoors/constants.go b/resource-manager/frontdoor/2020-05-01/frontdoors/constants.go index 4d789b0851d..863f68fcd11 100644 --- a/resource-manager/frontdoor/2020-05-01/frontdoors/constants.go +++ b/resource-manager/frontdoor/2020-05-01/frontdoors/constants.go @@ -839,9 +839,9 @@ const ( TransformLowercase Transform = "Lowercase" TransformRemoveNulls Transform = "RemoveNulls" TransformTrim Transform = "Trim" + TransformURLDecode Transform = "UrlDecode" + TransformURLEncode Transform = "UrlEncode" TransformUppercase Transform = "Uppercase" - TransformUrlDecode Transform = "UrlDecode" - TransformUrlEncode Transform = "UrlEncode" ) func PossibleValuesForTransform() []string { @@ -849,9 +849,9 @@ func PossibleValuesForTransform() []string { string(TransformLowercase), string(TransformRemoveNulls), string(TransformTrim), + string(TransformURLDecode), + string(TransformURLEncode), string(TransformUppercase), - string(TransformUrlDecode), - string(TransformUrlEncode), } } @@ -860,9 +860,9 @@ func parseTransform(input string) (*Transform, error) { "lowercase": TransformLowercase, "removenulls": TransformRemoveNulls, "trim": TransformTrim, + "urldecode": TransformURLDecode, + "urlencode": TransformURLEncode, "uppercase": TransformUppercase, - "urldecode": TransformUrlDecode, - "urlencode": TransformUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/README.md b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/README.md index 441afbc7550..a9bf871c9b1 100644 --- a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/README.md +++ b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ // ... @@ -42,7 +42,7 @@ if err := client.PoliciesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") if err := client.PoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.PoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") read, err := client.PoliciesGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.TagsObject{ // ... diff --git a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/constants.go b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/constants.go index 1b70eee7abe..ccb6756e691 100644 --- a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/constants.go +++ b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/constants.go @@ -501,9 +501,9 @@ const ( TransformTypeLowercase TransformType = "Lowercase" TransformTypeRemoveNulls TransformType = "RemoveNulls" TransformTypeTrim TransformType = "Trim" + TransformTypeURLDecode TransformType = "UrlDecode" + TransformTypeURLEncode TransformType = "UrlEncode" TransformTypeUppercase TransformType = "Uppercase" - TransformTypeUrlDecode TransformType = "UrlDecode" - TransformTypeUrlEncode TransformType = "UrlEncode" ) func PossibleValuesForTransformType() []string { @@ -511,9 +511,9 @@ func PossibleValuesForTransformType() []string { string(TransformTypeLowercase), string(TransformTypeRemoveNulls), string(TransformTypeTrim), + string(TransformTypeURLDecode), + string(TransformTypeURLEncode), string(TransformTypeUppercase), - string(TransformTypeUrlDecode), - string(TransformTypeUrlEncode), } } @@ -522,9 +522,9 @@ func parseTransformType(input string) (*TransformType, error) { "lowercase": TransformTypeLowercase, "removenulls": TransformTypeRemoveNulls, "trim": TransformTypeTrim, + "urldecode": TransformTypeURLDecode, + "urlencode": TransformTypeURLEncode, "uppercase": TransformTypeUppercase, - "urldecode": TransformTypeUrlDecode, - "urlencode": TransformTypeUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go index 4219ee8c438..ea213652257 100644 --- a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go +++ b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go @@ -115,7 +115,7 @@ func (id FrontDoorWebApplicationFirewallPolicyId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticFrontDoorWebApplicationFirewallPolicies", "frontDoorWebApplicationFirewallPolicies", "frontDoorWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("frontDoorWebApplicationFirewallPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("frontDoorWebApplicationFirewallPolicyName", "frontDoorWebApplicationFirewallPolicyName"), } } diff --git a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go index bd6c96d5c0c..2d78ddaba49 100644 --- a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go +++ b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FrontDoorWebApplicationFirewallPolicyId{} func TestNewFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { - id := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FrontDoorWebApplicationFirewallPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'FrontDoorWebApplicationFirewallPolicyName'", id.FrontDoorWebApplicationFirewallPolicyName, "policyName") + if id.FrontDoorWebApplicationFirewallPolicyName != "frontDoorWebApplicationFirewallPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'FrontDoorWebApplicationFirewallPolicyName'", id.FrontDoorWebApplicationFirewallPolicyName, "frontDoorWebApplicationFirewallPolicyName") } } func TestFormatFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName" + actual := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FrontDoorWebApplicationFirewallPolicyName: "policyName", + FrontDoorWebApplicationFirewallPolicyName: "frontDoorWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFrontDoorWebApplicationFirewallPolicyIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FrontDoorWebApplicationFirewallPolicyName: "policyName", + FrontDoorWebApplicationFirewallPolicyName: "frontDoorWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FrontDoorWebApplicationFirewallPolicyName: "pOlIcYnAmE", + FrontDoorWebApplicationFirewallPolicyName: "fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe/extra", Error: true, }, } diff --git a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/model_policysettings.go b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/model_policysettings.go index 1a41219ef51..fc24d6deb7b 100644 --- a/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/model_policysettings.go +++ b/resource-manager/frontdoor/2022-05-01/webapplicationfirewallpolicies/model_policysettings.go @@ -8,6 +8,6 @@ type PolicySettings struct { CustomBlockResponseStatusCode *int64 `json:"customBlockResponseStatusCode,omitempty"` EnabledState *PolicyEnabledState `json:"enabledState,omitempty"` Mode *PolicyMode `json:"mode,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` RequestBodyCheck *PolicyRequestBodyCheck `json:"requestBodyCheck,omitempty"` } diff --git a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/README.md b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/README.md index 31a6cbdb2cd..92bdbcf5cc1 100644 --- a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/README.md +++ b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ // ... @@ -42,7 +42,7 @@ if err := client.PoliciesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") if err := client.PoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.PoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") read, err := client.PoliciesGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.TagsObject{ // ... diff --git a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/constants.go b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/constants.go index ec1929c53ba..30ee141cf42 100644 --- a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/constants.go +++ b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/constants.go @@ -603,9 +603,9 @@ const ( TransformTypeLowercase TransformType = "Lowercase" TransformTypeRemoveNulls TransformType = "RemoveNulls" TransformTypeTrim TransformType = "Trim" + TransformTypeURLDecode TransformType = "UrlDecode" + TransformTypeURLEncode TransformType = "UrlEncode" TransformTypeUppercase TransformType = "Uppercase" - TransformTypeUrlDecode TransformType = "UrlDecode" - TransformTypeUrlEncode TransformType = "UrlEncode" ) func PossibleValuesForTransformType() []string { @@ -613,9 +613,9 @@ func PossibleValuesForTransformType() []string { string(TransformTypeLowercase), string(TransformTypeRemoveNulls), string(TransformTypeTrim), + string(TransformTypeURLDecode), + string(TransformTypeURLEncode), string(TransformTypeUppercase), - string(TransformTypeUrlDecode), - string(TransformTypeUrlEncode), } } @@ -624,9 +624,9 @@ func parseTransformType(input string) (*TransformType, error) { "lowercase": TransformTypeLowercase, "removenulls": TransformTypeRemoveNulls, "trim": TransformTypeTrim, + "urldecode": TransformTypeURLDecode, + "urlencode": TransformTypeURLEncode, "uppercase": TransformTypeUppercase, - "urldecode": TransformTypeUrlDecode, - "urlencode": TransformTypeUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go index 4219ee8c438..ea213652257 100644 --- a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go +++ b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy.go @@ -115,7 +115,7 @@ func (id FrontDoorWebApplicationFirewallPolicyId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticFrontDoorWebApplicationFirewallPolicies", "frontDoorWebApplicationFirewallPolicies", "frontDoorWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("frontDoorWebApplicationFirewallPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("frontDoorWebApplicationFirewallPolicyName", "frontDoorWebApplicationFirewallPolicyName"), } } diff --git a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go index bd6c96d5c0c..2d78ddaba49 100644 --- a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go +++ b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/id_frontdoorwebapplicationfirewallpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FrontDoorWebApplicationFirewallPolicyId{} func TestNewFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { - id := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FrontDoorWebApplicationFirewallPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'FrontDoorWebApplicationFirewallPolicyName'", id.FrontDoorWebApplicationFirewallPolicyName, "policyName") + if id.FrontDoorWebApplicationFirewallPolicyName != "frontDoorWebApplicationFirewallPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'FrontDoorWebApplicationFirewallPolicyName'", id.FrontDoorWebApplicationFirewallPolicyName, "frontDoorWebApplicationFirewallPolicyName") } } func TestFormatFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName" + actual := NewFrontDoorWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "frontDoorWebApplicationFirewallPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFrontDoorWebApplicationFirewallPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FrontDoorWebApplicationFirewallPolicyName: "policyName", + FrontDoorWebApplicationFirewallPolicyName: "frontDoorWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFrontDoorWebApplicationFirewallPolicyIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FrontDoorWebApplicationFirewallPolicyName: "policyName", + FrontDoorWebApplicationFirewallPolicyName: "frontDoorWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies/frontDoorWebApplicationFirewallPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe", Expected: &FrontDoorWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FrontDoorWebApplicationFirewallPolicyName: "pOlIcYnAmE", + FrontDoorWebApplicationFirewallPolicyName: "fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCiEs/fRoNtDoOrWeBaPpLiCaTiOnFiReWaLlPoLiCyNaMe/extra", Error: true, }, } diff --git a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/model_policysettings.go b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/model_policysettings.go index a900ecd7f98..ed2343a24c7 100644 --- a/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/model_policysettings.go +++ b/resource-manager/frontdoor/2024-02-01/webapplicationfirewallpolicies/model_policysettings.go @@ -10,6 +10,6 @@ type PolicySettings struct { JavascriptChallengeExpirationInMinutes *int64 `json:"javascriptChallengeExpirationInMinutes,omitempty"` LogScrubbing *PolicySettingsLogScrubbing `json:"logScrubbing,omitempty"` Mode *PolicyMode `json:"mode,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` RequestBodyCheck *PolicyRequestBodyCheck `json:"requestBodyCheck,omitempty"` } diff --git a/resource-manager/graphservices/2023-04-13/graphservicesprods/README.md b/resource-manager/graphservices/2023-04-13/graphservicesprods/README.md index d6a86692cb4..751e473315e 100644 --- a/resource-manager/graphservices/2023-04-13/graphservicesprods/README.md +++ b/resource-manager/graphservices/2023-04-13/graphservicesprods/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphservicesprods.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphservicesprods.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") payload := graphservicesprods.AccountResource{ // ... @@ -42,7 +42,7 @@ if err := client.AccountsCreateAndUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := graphservicesprods.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphservicesprods.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") read, err := client.AccountsDelete(ctx, id) if err != nil { @@ -58,7 +58,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := graphservicesprods.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphservicesprods.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") read, err := client.AccountsGet(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := graphservicesprods.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphservicesprods.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") payload := graphservicesprods.TagUpdate{ // ... diff --git a/resource-manager/graphservices/2023-04-13/graphservicesprods/id_account.go b/resource-manager/graphservices/2023-04-13/graphservicesprods/id_account.go index d4cf4ea0180..df4fa498670 100644 --- a/resource-manager/graphservices/2023-04-13/graphservicesprods/id_account.go +++ b/resource-manager/graphservices/2023-04-13/graphservicesprods/id_account.go @@ -115,7 +115,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftGraphServices", "Microsoft.GraphServices", "Microsoft.GraphServices"), resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), - resourceids.UserSpecifiedSegment("accountName", "resourceName"), + resourceids.UserSpecifiedSegment("accountName", "accountName"), } } diff --git a/resource-manager/graphservices/2023-04-13/graphservicesprods/id_account_test.go b/resource-manager/graphservices/2023-04-13/graphservicesprods/id_account_test.go index ff660dfaee0..96a43580c32 100644 --- a/resource-manager/graphservices/2023-04-13/graphservicesprods/id_account_test.go +++ b/resource-manager/graphservices/2023-04-13/graphservicesprods/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AccountName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "resourceName") + if id.AccountName != "accountName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountName") } } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/resourceName" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/accountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccountName: "resourceName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/accountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccountName: "resourceName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.GraphServices/accounts/accountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.gRaPhSeRvIcEs/aCcOuNtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.gRaPhSeRvIcEs/aCcOuNtS/aCcOuNtNaMe", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AccountName: "rEsOuRcEnAmE", + AccountName: "aCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.gRaPhSeRvIcEs/aCcOuNtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.gRaPhSeRvIcEs/aCcOuNtS/aCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/README.md b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/README.md index 4a282efd03d..eec4c194fc8 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/README.md +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/README.md @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignmentreports.NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name", "id") +id := guestconfigurationassignmentreports.NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName", "reportName") read, err := client.VMSSGet(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignmentreports.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") +id := guestconfigurationassignmentreports.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") read, err := client.VMSSList(ctx, id) if err != nil { diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_guestconfigurationassignment.go b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_guestconfigurationassignment.go index 40d50d61454..899d59c7870 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_guestconfigurationassignment.go +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_guestconfigurationassignment.go @@ -121,11 +121,11 @@ func (id GuestConfigurationAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "vmssName"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftGuestConfiguration", "Microsoft.GuestConfiguration", "Microsoft.GuestConfiguration"), resourceids.StaticSegment("staticGuestConfigurationAssignments", "guestConfigurationAssignments", "guestConfigurationAssignments"), - resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "name"), + resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "guestConfigurationAssignmentName"), } } diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_guestconfigurationassignment_test.go b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_guestconfigurationassignment_test.go index 2c2031b48a5..1888373da66 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_guestconfigurationassignment_test.go +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_guestconfigurationassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GuestConfigurationAssignmentId{} func TestNewGuestConfigurationAssignmentID(t *testing.T) { - id := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") + id := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGuestConfigurationAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineScaleSetName != "vmssName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "vmssName") + if id.VirtualMachineScaleSetName != "virtualMachineScaleSetName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.GuestConfigurationAssignmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "name") + if id.GuestConfigurationAssignmentName != "guestConfigurationAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "guestConfigurationAssignmentName") } } func TestFormatGuestConfigurationAssignmentID(t *testing.T) { - actual := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name" + actual := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseGuestConfigurationAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseGuestConfigurationAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vMsSnAmE", - GuestConfigurationAssignmentName: "nAmE", + VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", + GuestConfigurationAssignmentName: "gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_report.go b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_report.go index b86bd56194a..bd4c18af433 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_report.go +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_report.go @@ -127,13 +127,13 @@ func (id ReportId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "vmssName"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftGuestConfiguration", "Microsoft.GuestConfiguration", "Microsoft.GuestConfiguration"), resourceids.StaticSegment("staticGuestConfigurationAssignments", "guestConfigurationAssignments", "guestConfigurationAssignments"), - resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "name"), + resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "guestConfigurationAssignmentName"), resourceids.StaticSegment("staticReports", "reports", "reports"), - resourceids.UserSpecifiedSegment("reportName", "id"), + resourceids.UserSpecifiedSegment("reportName", "reportName"), } } diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_report_test.go b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_report_test.go index 1664ca34653..9c513e959c8 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_report_test.go +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignmentreports/id_report_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReportId{} func TestNewReportID(t *testing.T) { - id := NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name", "id") + id := NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName", "reportName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReportID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineScaleSetName != "vmssName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "vmssName") + if id.VirtualMachineScaleSetName != "virtualMachineScaleSetName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.GuestConfigurationAssignmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "name") + if id.GuestConfigurationAssignmentName != "guestConfigurationAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "guestConfigurationAssignmentName") } - if id.ReportName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'ReportName'", id.ReportName, "id") + if id.ReportName != "reportName" { + t.Fatalf("Expected %q but got %q for Segment 'ReportName'", id.ReportName, "reportName") } } func TestFormatReportID(t *testing.T) { - actual := NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id" + actual := NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName", "reportName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseReportID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName", Expected: &ReportId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", - ReportName: "id", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", + ReportName: "reportName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseReportIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/rEpOrTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/rEpOrTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName", Expected: &ReportId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", - ReportName: "id", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", + ReportName: "reportName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/rEpOrTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/rEpOrTs/rEpOrTnAmE", Expected: &ReportId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vMsSnAmE", - GuestConfigurationAssignmentName: "nAmE", - ReportName: "iD", + VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", + GuestConfigurationAssignmentName: "gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", + ReportName: "rEpOrTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/rEpOrTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/rEpOrTs/rEpOrTnAmE/extra", Error: true, }, } diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/README.md b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/README.md index 05e9d6250ec..dfdbbf01892 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/README.md +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/README.md @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") +id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") payload := guestconfigurationassignments.GuestConfigurationAssignment{ // ... @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") +id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") read, err := client.VMSSDelete(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") +id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") read, err := client.VMSSGet(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignments.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName") +id := guestconfigurationassignments.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName") read, err := client.VMSSList(ctx, id) if err != nil { diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_guestconfigurationassignment.go b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_guestconfigurationassignment.go index df1722b5782..c2269c4c248 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_guestconfigurationassignment.go +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_guestconfigurationassignment.go @@ -121,11 +121,11 @@ func (id GuestConfigurationAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "vmssName"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftGuestConfiguration", "Microsoft.GuestConfiguration", "Microsoft.GuestConfiguration"), resourceids.StaticSegment("staticGuestConfigurationAssignments", "guestConfigurationAssignments", "guestConfigurationAssignments"), - resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "name"), + resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "guestConfigurationAssignmentName"), } } diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_guestconfigurationassignment_test.go b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_guestconfigurationassignment_test.go index 3019fb464d8..09cb2edcd55 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_guestconfigurationassignment_test.go +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_guestconfigurationassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GuestConfigurationAssignmentId{} func TestNewGuestConfigurationAssignmentID(t *testing.T) { - id := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") + id := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGuestConfigurationAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineScaleSetName != "vmssName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "vmssName") + if id.VirtualMachineScaleSetName != "virtualMachineScaleSetName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.GuestConfigurationAssignmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "name") + if id.GuestConfigurationAssignmentName != "guestConfigurationAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "guestConfigurationAssignmentName") } } func TestFormatGuestConfigurationAssignmentID(t *testing.T) { - actual := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name" + actual := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseGuestConfigurationAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseGuestConfigurationAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vMsSnAmE", - GuestConfigurationAssignmentName: "nAmE", + VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", + GuestConfigurationAssignmentName: "gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_virtualmachinescaleset.go b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_virtualmachinescaleset.go index 9777ddf4456..0bcdc48e354 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_virtualmachinescaleset.go +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_virtualmachinescaleset.go @@ -115,7 +115,7 @@ func (id VirtualMachineScaleSetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "vmssName"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), } } diff --git a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_virtualmachinescaleset_test.go b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_virtualmachinescaleset_test.go index 186e01cb6d2..0fef3902bdd 100644 --- a/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_virtualmachinescaleset_test.go +++ b/resource-manager/guestconfiguration/2022-01-25/guestconfigurationassignments/id_virtualmachinescaleset_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineScaleSetId{} func TestNewVirtualMachineScaleSetID(t *testing.T) { - id := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName") + id := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualMachineScaleSetID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineScaleSetName != "vmssName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "vmssName") + if id.VirtualMachineScaleSetName != "virtualMachineScaleSetName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } } func TestFormatVirtualMachineScaleSetID(t *testing.T) { - actual := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName" + actual := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualMachineScaleSetID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Expected: &VirtualMachineScaleSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualMachineScaleSetIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Expected: &VirtualMachineScaleSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE", Expected: &VirtualMachineScaleSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vMsSnAmE", + VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/extra", Error: true, }, } diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/README.md b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/README.md index 1885decc861..056af97db70 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/README.md +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/README.md @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignmentreports.NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name", "id") +id := guestconfigurationassignmentreports.NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName", "reportName") read, err := client.VMSSGet(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignmentreports.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") +id := guestconfigurationassignmentreports.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") read, err := client.VMSSList(ctx, id) if err != nil { diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_guestconfigurationassignment.go b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_guestconfigurationassignment.go index 40d50d61454..899d59c7870 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_guestconfigurationassignment.go +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_guestconfigurationassignment.go @@ -121,11 +121,11 @@ func (id GuestConfigurationAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "vmssName"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftGuestConfiguration", "Microsoft.GuestConfiguration", "Microsoft.GuestConfiguration"), resourceids.StaticSegment("staticGuestConfigurationAssignments", "guestConfigurationAssignments", "guestConfigurationAssignments"), - resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "name"), + resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "guestConfigurationAssignmentName"), } } diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_guestconfigurationassignment_test.go b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_guestconfigurationassignment_test.go index 2c2031b48a5..1888373da66 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_guestconfigurationassignment_test.go +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_guestconfigurationassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GuestConfigurationAssignmentId{} func TestNewGuestConfigurationAssignmentID(t *testing.T) { - id := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") + id := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGuestConfigurationAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineScaleSetName != "vmssName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "vmssName") + if id.VirtualMachineScaleSetName != "virtualMachineScaleSetName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.GuestConfigurationAssignmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "name") + if id.GuestConfigurationAssignmentName != "guestConfigurationAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "guestConfigurationAssignmentName") } } func TestFormatGuestConfigurationAssignmentID(t *testing.T) { - actual := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name" + actual := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseGuestConfigurationAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseGuestConfigurationAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vMsSnAmE", - GuestConfigurationAssignmentName: "nAmE", + VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", + GuestConfigurationAssignmentName: "gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_report.go b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_report.go index b86bd56194a..bd4c18af433 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_report.go +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_report.go @@ -127,13 +127,13 @@ func (id ReportId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "vmssName"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftGuestConfiguration", "Microsoft.GuestConfiguration", "Microsoft.GuestConfiguration"), resourceids.StaticSegment("staticGuestConfigurationAssignments", "guestConfigurationAssignments", "guestConfigurationAssignments"), - resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "name"), + resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "guestConfigurationAssignmentName"), resourceids.StaticSegment("staticReports", "reports", "reports"), - resourceids.UserSpecifiedSegment("reportName", "id"), + resourceids.UserSpecifiedSegment("reportName", "reportName"), } } diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_report_test.go b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_report_test.go index 1664ca34653..9c513e959c8 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_report_test.go +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignmentreports/id_report_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReportId{} func TestNewReportID(t *testing.T) { - id := NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name", "id") + id := NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName", "reportName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReportID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineScaleSetName != "vmssName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "vmssName") + if id.VirtualMachineScaleSetName != "virtualMachineScaleSetName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.GuestConfigurationAssignmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "name") + if id.GuestConfigurationAssignmentName != "guestConfigurationAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "guestConfigurationAssignmentName") } - if id.ReportName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'ReportName'", id.ReportName, "id") + if id.ReportName != "reportName" { + t.Fatalf("Expected %q but got %q for Segment 'ReportName'", id.ReportName, "reportName") } } func TestFormatReportID(t *testing.T) { - actual := NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id" + actual := NewReportID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName", "reportName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseReportID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName", Expected: &ReportId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", - ReportName: "id", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", + ReportName: "reportName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseReportIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/rEpOrTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/rEpOrTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName", Expected: &ReportId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", - ReportName: "id", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", + ReportName: "reportName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/reports/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/reports/reportName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/rEpOrTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/rEpOrTs/rEpOrTnAmE", Expected: &ReportId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vMsSnAmE", - GuestConfigurationAssignmentName: "nAmE", - ReportName: "iD", + VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", + GuestConfigurationAssignmentName: "gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", + ReportName: "rEpOrTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/rEpOrTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/rEpOrTs/rEpOrTnAmE/extra", Error: true, }, } diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/README.md b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/README.md index 63c566f9127..0578b0165a1 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/README.md +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/README.md @@ -126,7 +126,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") +id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") payload := guestconfigurationassignments.GuestConfigurationAssignment{ // ... @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") +id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") read, err := client.VMSSDelete(ctx, id) if err != nil { @@ -163,7 +163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") +id := guestconfigurationassignments.NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") read, err := client.VMSSGet(ctx, id) if err != nil { @@ -179,7 +179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := guestconfigurationassignments.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName") +id := guestconfigurationassignments.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName") read, err := client.VMSSList(ctx, id) if err != nil { diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_guestconfigurationassignment.go b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_guestconfigurationassignment.go index df1722b5782..c2269c4c248 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_guestconfigurationassignment.go +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_guestconfigurationassignment.go @@ -121,11 +121,11 @@ func (id GuestConfigurationAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "vmssName"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftGuestConfiguration", "Microsoft.GuestConfiguration", "Microsoft.GuestConfiguration"), resourceids.StaticSegment("staticGuestConfigurationAssignments", "guestConfigurationAssignments", "guestConfigurationAssignments"), - resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "name"), + resourceids.UserSpecifiedSegment("guestConfigurationAssignmentName", "guestConfigurationAssignmentName"), } } diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_guestconfigurationassignment_test.go b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_guestconfigurationassignment_test.go index 3019fb464d8..09cb2edcd55 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_guestconfigurationassignment_test.go +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_guestconfigurationassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GuestConfigurationAssignmentId{} func TestNewGuestConfigurationAssignmentID(t *testing.T) { - id := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name") + id := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewGuestConfigurationAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineScaleSetName != "vmssName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "vmssName") + if id.VirtualMachineScaleSetName != "virtualMachineScaleSetName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.GuestConfigurationAssignmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "name") + if id.GuestConfigurationAssignmentName != "guestConfigurationAssignmentName" { + t.Fatalf("Expected %q but got %q for Segment 'GuestConfigurationAssignmentName'", id.GuestConfigurationAssignmentName, "guestConfigurationAssignmentName") } } func TestFormatGuestConfigurationAssignmentID(t *testing.T) { - actual := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name" + actual := NewGuestConfigurationAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "guestConfigurationAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseGuestConfigurationAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseGuestConfigurationAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", - GuestConfigurationAssignmentName: "name", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", + GuestConfigurationAssignmentName: "guestConfigurationAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/guestConfigurationAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", Expected: &GuestConfigurationAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vMsSnAmE", - GuestConfigurationAssignmentName: "nAmE", + VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", + GuestConfigurationAssignmentName: "gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/pRoViDeRs/mIcRoSoFt.gUeStCoNfIgUrAtIoN/gUeStCoNfIgUrAtIoNaSsIgNmEnTs/gUeStCoNfIgUrAtIoNaSsIgNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_virtualmachinescaleset.go b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_virtualmachinescaleset.go index 9777ddf4456..0bcdc48e354 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_virtualmachinescaleset.go +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_virtualmachinescaleset.go @@ -115,7 +115,7 @@ func (id VirtualMachineScaleSetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "vmssName"), + resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), } } diff --git a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_virtualmachinescaleset_test.go b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_virtualmachinescaleset_test.go index 186e01cb6d2..0fef3902bdd 100644 --- a/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_virtualmachinescaleset_test.go +++ b/resource-manager/guestconfiguration/2024-04-05/guestconfigurationassignments/id_virtualmachinescaleset_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineScaleSetId{} func TestNewVirtualMachineScaleSetID(t *testing.T) { - id := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName") + id := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualMachineScaleSetID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualMachineScaleSetName != "vmssName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "vmssName") + if id.VirtualMachineScaleSetName != "virtualMachineScaleSetName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } } func TestFormatVirtualMachineScaleSetID(t *testing.T) { - actual := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmssName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName" + actual := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualMachineScaleSetID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Expected: &VirtualMachineScaleSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualMachineScaleSetIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName", Expected: &VirtualMachineScaleSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "vmssName", + VirtualMachineScaleSetName: "virtualMachineScaleSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/vmssName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE", Expected: &VirtualMachineScaleSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vMsSnAmE", + VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vMsSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/extra", Error: true, }, } diff --git a/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/README.md b/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/README.md index 80de954a427..c9043e158ea 100644 --- a/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/README.md +++ b/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMName") payload := dedicatedhsms.DedicatedHsm{ // ... @@ -42,7 +42,7 @@ if err := client.DedicatedHsmCreateOrUpdateThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMName") if err := client.DedicatedHsmDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DedicatedHsmDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMName") read, err := client.DedicatedHsmGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMName") // alternatively `client.DedicatedHsmListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination items, err := client.DedicatedHsmListOutboundNetworkDependenciesEndpointsComplete(ctx, id) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := dedicatedhsms.NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMName") payload := dedicatedhsms.DedicatedHsmPatchParameters{ // ... diff --git a/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/id_dedicatedhsm.go b/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/id_dedicatedhsm.go index 1097105e86f..1e87a60246a 100644 --- a/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/id_dedicatedhsm.go +++ b/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/id_dedicatedhsm.go @@ -115,7 +115,7 @@ func (id DedicatedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHardwareSecurityModules", "Microsoft.HardwareSecurityModules", "Microsoft.HardwareSecurityModules"), resourceids.StaticSegment("staticDedicatedHSMs", "dedicatedHSMs", "dedicatedHSMs"), - resourceids.UserSpecifiedSegment("dedicatedHSMName", "name"), + resourceids.UserSpecifiedSegment("dedicatedHSMName", "dedicatedHSMName"), } } diff --git a/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/id_dedicatedhsm_test.go b/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/id_dedicatedhsm_test.go index ee2ba9f7a62..e18c39e3359 100644 --- a/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/id_dedicatedhsm_test.go +++ b/resource-manager/hardwaresecuritymodules/2021-11-30/dedicatedhsms/id_dedicatedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DedicatedHSMId{} func TestNewDedicatedHSMID(t *testing.T) { - id := NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDedicatedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DedicatedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DedicatedHSMName'", id.DedicatedHSMName, "name") + if id.DedicatedHSMName != "dedicatedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'DedicatedHSMName'", id.DedicatedHSMName, "dedicatedHSMName") } } func TestFormatDedicatedHSMID(t *testing.T) { - actual := NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/name" + actual := NewDedicatedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/dedicatedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDedicatedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/dedicatedHSMName", Expected: &DedicatedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DedicatedHSMName: "name", + DedicatedHSMName: "dedicatedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/dedicatedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDedicatedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/dedicatedHSMName", Expected: &DedicatedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DedicatedHSMName: "name", + DedicatedHSMName: "dedicatedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/dedicatedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hArDwArEsEcUrItYmOdUlEs/dEdIcAtEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hArDwArEsEcUrItYmOdUlEs/dEdIcAtEdHsMs/dEdIcAtEdHsMnAmE", Expected: &DedicatedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DedicatedHSMName: "nAmE", + DedicatedHSMName: "dEdIcAtEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hArDwArEsEcUrItYmOdUlEs/dEdIcAtEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hArDwArEsEcUrItYmOdUlEs/dEdIcAtEdHsMs/dEdIcAtEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/hdinsight/2021-06-01/clusters/model_securityprofile.go b/resource-manager/hdinsight/2021-06-01/clusters/model_securityprofile.go index 1253c24e306..be89459f8ce 100644 --- a/resource-manager/hdinsight/2021-06-01/clusters/model_securityprofile.go +++ b/resource-manager/hdinsight/2021-06-01/clusters/model_securityprofile.go @@ -10,7 +10,7 @@ type SecurityProfile struct { Domain *string `json:"domain,omitempty"` DomainUserPassword *string `json:"domainUserPassword,omitempty"` DomainUsername *string `json:"domainUsername,omitempty"` - LdapsUrls *[]string `json:"ldapsUrls,omitempty"` + LdapsURLs *[]string `json:"ldapsUrls,omitempty"` MsiResourceId *string `json:"msiResourceId,omitempty"` OrganizationalUnitDN *string `json:"organizationalUnitDN,omitempty"` } diff --git a/resource-manager/hdinsight/2021-06-01/regions/README.md b/resource-manager/hdinsight/2021-06-01/regions/README.md index e87114e16c7..5c95180750c 100644 --- a/resource-manager/hdinsight/2021-06-01/regions/README.md +++ b/resource-manager/hdinsight/2021-06-01/regions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := regions.NameAvailabilityCheckRequestParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsGetCapabilities(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsListBillingSpecs(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.LocationsListUsages(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := regions.ClusterCreateRequestValidationParameters{ // ... diff --git a/resource-manager/hdinsight/2021-06-01/regions/id_location.go b/resource-manager/hdinsight/2021-06-01/regions/id_location.go index 2f8088492a3..c92247e3917 100644 --- a/resource-manager/hdinsight/2021-06-01/regions/id_location.go +++ b/resource-manager/hdinsight/2021-06-01/regions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/hdinsight/2021-06-01/regions/id_location_test.go b/resource-manager/hdinsight/2021-06-01/regions/id_location_test.go index 3f35d57147c..6f2cc8c94b2 100644 --- a/resource-manager/hdinsight/2021-06-01/regions/id_location_test.go +++ b/resource-manager/hdinsight/2021-06-01/regions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/hdinsight/2021-06-01/regions/model_securityprofile.go b/resource-manager/hdinsight/2021-06-01/regions/model_securityprofile.go index d744d3f8c91..00428620864 100644 --- a/resource-manager/hdinsight/2021-06-01/regions/model_securityprofile.go +++ b/resource-manager/hdinsight/2021-06-01/regions/model_securityprofile.go @@ -10,7 +10,7 @@ type SecurityProfile struct { Domain *string `json:"domain,omitempty"` DomainUserPassword *string `json:"domainUserPassword,omitempty"` DomainUsername *string `json:"domainUsername,omitempty"` - LdapsUrls *[]string `json:"ldapsUrls,omitempty"` + LdapsURLs *[]string `json:"ldapsUrls,omitempty"` MsiResourceId *string `json:"msiResourceId,omitempty"` OrganizationalUnitDN *string `json:"organizationalUnitDN,omitempty"` } diff --git a/resource-manager/hdinsight/2021-06-01/scriptactions/README.md b/resource-manager/hdinsight/2021-06-01/scriptactions/README.md index dfa4412d00c..4368e3084f0 100644 --- a/resource-manager/hdinsight/2021-06-01/scriptactions/README.md +++ b/resource-manager/hdinsight/2021-06-01/scriptactions/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := scriptactions.NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "scriptName") +id := scriptactions.NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "scriptActionName") read, err := client.Delete(ctx, id) if err != nil { diff --git a/resource-manager/hdinsight/2021-06-01/scriptactions/id_scriptaction.go b/resource-manager/hdinsight/2021-06-01/scriptactions/id_scriptaction.go index f554fca07d6..ef6e7b77756 100644 --- a/resource-manager/hdinsight/2021-06-01/scriptactions/id_scriptaction.go +++ b/resource-manager/hdinsight/2021-06-01/scriptactions/id_scriptaction.go @@ -123,7 +123,7 @@ func (id ScriptActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticClusters", "clusters", "clusters"), resourceids.UserSpecifiedSegment("clusterName", "clusterName"), resourceids.StaticSegment("staticScriptActions", "scriptActions", "scriptActions"), - resourceids.UserSpecifiedSegment("scriptActionName", "scriptName"), + resourceids.UserSpecifiedSegment("scriptActionName", "scriptActionName"), } } diff --git a/resource-manager/hdinsight/2021-06-01/scriptactions/id_scriptaction_test.go b/resource-manager/hdinsight/2021-06-01/scriptactions/id_scriptaction_test.go index 82f6e4a5c0a..0859277f521 100644 --- a/resource-manager/hdinsight/2021-06-01/scriptactions/id_scriptaction_test.go +++ b/resource-manager/hdinsight/2021-06-01/scriptactions/id_scriptaction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScriptActionId{} func TestNewScriptActionID(t *testing.T) { - id := NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "scriptName") + id := NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "scriptActionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewScriptActionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterName") } - if id.ScriptActionName != "scriptName" { - t.Fatalf("Expected %q but got %q for Segment 'ScriptActionName'", id.ScriptActionName, "scriptName") + if id.ScriptActionName != "scriptActionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScriptActionName'", id.ScriptActionName, "scriptActionName") } } func TestFormatScriptActionID(t *testing.T) { - actual := NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "scriptName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptName" + actual := NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "scriptActionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptActionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseScriptActionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptActionName", Expected: &ScriptActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ClusterName: "clusterName", - ScriptActionName: "scriptName", + ScriptActionName: "scriptActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptActionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseScriptActionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptActionName", Expected: &ScriptActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ClusterName: "clusterName", - ScriptActionName: "scriptName", + ScriptActionName: "scriptActionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterName/scriptActions/scriptActionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErNaMe/sCrIpTaCtIoNs/sCrIpTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErNaMe/sCrIpTaCtIoNs/sCrIpTaCtIoNnAmE", Expected: &ScriptActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ClusterName: "cLuStErNaMe", - ScriptActionName: "sCrIpTnAmE", + ScriptActionName: "sCrIpTaCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErNaMe/sCrIpTaCtIoNs/sCrIpTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErNaMe/sCrIpTaCtIoNs/sCrIpTaCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/hdinsight/2021-06-01/virtualmachines/model_hostinfo.go b/resource-manager/hdinsight/2021-06-01/virtualmachines/model_hostinfo.go index 46c3fc54159..67080ee1bf9 100644 --- a/resource-manager/hdinsight/2021-06-01/virtualmachines/model_hostinfo.go +++ b/resource-manager/hdinsight/2021-06-01/virtualmachines/model_hostinfo.go @@ -4,7 +4,7 @@ package virtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HostInfo struct { - EffectiveDiskEncryptionKeyUrl *string `json:"effectiveDiskEncryptionKeyUrl,omitempty"` + EffectiveDiskEncryptionKeyURL *string `json:"effectiveDiskEncryptionKeyUrl,omitempty"` Fqdn *string `json:"fqdn,omitempty"` Name *string `json:"name,omitempty"` } diff --git a/resource-manager/healthbot/2022-08-08/healthbots/README.md b/resource-manager/healthbot/2022-08-08/healthbots/README.md index 8cd387d8d3a..f75b8212c21 100644 --- a/resource-manager/healthbot/2022-08-08/healthbots/README.md +++ b/resource-manager/healthbot/2022-08-08/healthbots/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") payload := healthbots.HealthBot{ // ... @@ -42,7 +42,7 @@ if err := client.BotsCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") if err := client.BotsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.BotsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsListSecrets(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsRegenerateApiJwtSecret(ctx, id) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") payload := healthbots.HealthBotUpdateParameters{ // ... diff --git a/resource-manager/healthbot/2022-08-08/healthbots/id_healthbot.go b/resource-manager/healthbot/2022-08-08/healthbots/id_healthbot.go index 2b70abd9066..0cd7bc0063f 100644 --- a/resource-manager/healthbot/2022-08-08/healthbots/id_healthbot.go +++ b/resource-manager/healthbot/2022-08-08/healthbots/id_healthbot.go @@ -115,7 +115,7 @@ func (id HealthBotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthBot", "Microsoft.HealthBot", "Microsoft.HealthBot"), resourceids.StaticSegment("staticHealthBots", "healthBots", "healthBots"), - resourceids.UserSpecifiedSegment("healthBotName", "botName"), + resourceids.UserSpecifiedSegment("healthBotName", "healthBotName"), } } diff --git a/resource-manager/healthbot/2022-08-08/healthbots/id_healthbot_test.go b/resource-manager/healthbot/2022-08-08/healthbots/id_healthbot_test.go index 582b0e7024d..d2b6d79df2d 100644 --- a/resource-manager/healthbot/2022-08-08/healthbots/id_healthbot_test.go +++ b/resource-manager/healthbot/2022-08-08/healthbots/id_healthbot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HealthBotId{} func TestNewHealthBotID(t *testing.T) { - id := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") + id := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHealthBotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HealthBotName != "botName" { - t.Fatalf("Expected %q but got %q for Segment 'HealthBotName'", id.HealthBotName, "botName") + if id.HealthBotName != "healthBotName" { + t.Fatalf("Expected %q but got %q for Segment 'HealthBotName'", id.HealthBotName, "healthBotName") } } func TestFormatHealthBotID(t *testing.T) { - actual := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName" + actual := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHealthBotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HealthBotName: "botName", + HealthBotName: "healthBotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHealthBotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HealthBotName: "botName", + HealthBotName: "healthBotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/bOtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/hEaLtHbOtNaMe", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HealthBotName: "bOtNaMe", + HealthBotName: "hEaLtHbOtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/bOtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/hEaLtHbOtNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthbot/2023-05-01/healthbots/README.md b/resource-manager/healthbot/2023-05-01/healthbots/README.md index 76bfe47f7c4..357c882e0a9 100644 --- a/resource-manager/healthbot/2023-05-01/healthbots/README.md +++ b/resource-manager/healthbot/2023-05-01/healthbots/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") payload := healthbots.HealthBot{ // ... @@ -42,7 +42,7 @@ if err := client.BotsCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") if err := client.BotsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.BotsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsListSecrets(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsRegenerateApiJwtSecret(ctx, id) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") payload := healthbots.HealthBotUpdateParameters{ // ... diff --git a/resource-manager/healthbot/2023-05-01/healthbots/id_healthbot.go b/resource-manager/healthbot/2023-05-01/healthbots/id_healthbot.go index 2b70abd9066..0cd7bc0063f 100644 --- a/resource-manager/healthbot/2023-05-01/healthbots/id_healthbot.go +++ b/resource-manager/healthbot/2023-05-01/healthbots/id_healthbot.go @@ -115,7 +115,7 @@ func (id HealthBotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthBot", "Microsoft.HealthBot", "Microsoft.HealthBot"), resourceids.StaticSegment("staticHealthBots", "healthBots", "healthBots"), - resourceids.UserSpecifiedSegment("healthBotName", "botName"), + resourceids.UserSpecifiedSegment("healthBotName", "healthBotName"), } } diff --git a/resource-manager/healthbot/2023-05-01/healthbots/id_healthbot_test.go b/resource-manager/healthbot/2023-05-01/healthbots/id_healthbot_test.go index 582b0e7024d..d2b6d79df2d 100644 --- a/resource-manager/healthbot/2023-05-01/healthbots/id_healthbot_test.go +++ b/resource-manager/healthbot/2023-05-01/healthbots/id_healthbot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HealthBotId{} func TestNewHealthBotID(t *testing.T) { - id := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") + id := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHealthBotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HealthBotName != "botName" { - t.Fatalf("Expected %q but got %q for Segment 'HealthBotName'", id.HealthBotName, "botName") + if id.HealthBotName != "healthBotName" { + t.Fatalf("Expected %q but got %q for Segment 'HealthBotName'", id.HealthBotName, "healthBotName") } } func TestFormatHealthBotID(t *testing.T) { - actual := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName" + actual := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHealthBotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HealthBotName: "botName", + HealthBotName: "healthBotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHealthBotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HealthBotName: "botName", + HealthBotName: "healthBotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/bOtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/hEaLtHbOtNaMe", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HealthBotName: "bOtNaMe", + HealthBotName: "hEaLtHbOtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/bOtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/hEaLtHbOtNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthbot/2024-02-01/healthbots/README.md b/resource-manager/healthbot/2024-02-01/healthbots/README.md index 49fd104f5ba..ab5cc3ef08e 100644 --- a/resource-manager/healthbot/2024-02-01/healthbots/README.md +++ b/resource-manager/healthbot/2024-02-01/healthbots/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") payload := healthbots.HealthBot{ // ... @@ -42,7 +42,7 @@ if err := client.BotsCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") if err := client.BotsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.BotsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsListSecrets(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") read, err := client.BotsRegenerateApiJwtSecret(ctx, id) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") +id := healthbots.NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") payload := healthbots.HealthBotUpdateParameters{ // ... diff --git a/resource-manager/healthbot/2024-02-01/healthbots/id_healthbot.go b/resource-manager/healthbot/2024-02-01/healthbots/id_healthbot.go index 2b70abd9066..0cd7bc0063f 100644 --- a/resource-manager/healthbot/2024-02-01/healthbots/id_healthbot.go +++ b/resource-manager/healthbot/2024-02-01/healthbots/id_healthbot.go @@ -115,7 +115,7 @@ func (id HealthBotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthBot", "Microsoft.HealthBot", "Microsoft.HealthBot"), resourceids.StaticSegment("staticHealthBots", "healthBots", "healthBots"), - resourceids.UserSpecifiedSegment("healthBotName", "botName"), + resourceids.UserSpecifiedSegment("healthBotName", "healthBotName"), } } diff --git a/resource-manager/healthbot/2024-02-01/healthbots/id_healthbot_test.go b/resource-manager/healthbot/2024-02-01/healthbots/id_healthbot_test.go index 582b0e7024d..d2b6d79df2d 100644 --- a/resource-manager/healthbot/2024-02-01/healthbots/id_healthbot_test.go +++ b/resource-manager/healthbot/2024-02-01/healthbots/id_healthbot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HealthBotId{} func TestNewHealthBotID(t *testing.T) { - id := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName") + id := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHealthBotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HealthBotName != "botName" { - t.Fatalf("Expected %q but got %q for Segment 'HealthBotName'", id.HealthBotName, "botName") + if id.HealthBotName != "healthBotName" { + t.Fatalf("Expected %q but got %q for Segment 'HealthBotName'", id.HealthBotName, "healthBotName") } } func TestFormatHealthBotID(t *testing.T) { - actual := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "botName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName" + actual := NewHealthBotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "healthBotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHealthBotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HealthBotName: "botName", + HealthBotName: "healthBotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHealthBotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HealthBotName: "botName", + HealthBotName: "healthBotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/botName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthBot/healthBots/healthBotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/bOtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/hEaLtHbOtNaMe", Expected: &HealthBotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HealthBotName: "bOtNaMe", + HealthBotName: "hEaLtHbOtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/bOtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHbOt/hEaLtHbOtS/hEaLtHbOtNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2022-12-01/dicomservices/model_dicomserviceproperties.go b/resource-manager/healthcareapis/2022-12-01/dicomservices/model_dicomserviceproperties.go index 70d482f3c2f..eebe78f5f3e 100644 --- a/resource-manager/healthcareapis/2022-12-01/dicomservices/model_dicomserviceproperties.go +++ b/resource-manager/healthcareapis/2022-12-01/dicomservices/model_dicomserviceproperties.go @@ -10,5 +10,5 @@ type DicomServiceProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/README.md b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/README.md index 991f8b56c27..bfcfd72a161 100644 --- a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/README.md +++ b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_privateendpointconnection.go index 7a4365aa6eb..70e604c38a1 100644 --- a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_privateendpointconnection_test.go index fbf269c798a..2e10ec990d1 100644 --- a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_service.go b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_service.go index 882be2fe644..9dce211d344 100644 --- a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_service.go +++ b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_service_test.go b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_service_test.go index 17fd8498495..525aad46aa6 100644 --- a/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_service_test.go +++ b/resource-manager/healthcareapis/2022-12-01/privateendpointconnections/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/README.md b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/README.md index 63d03342a73..f7908ab5510 100644 --- a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/README.md +++ b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_privatelinkresource.go b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_privatelinkresource.go index 6b34f0e6d14..e9019590800 100644 --- a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_privatelinkresource_test.go index 95950c5ba7a..d2c32a33913 100644 --- a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + ServiceName: "sErViCeNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_service.go b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_service.go index 72e43701cbe..7976b2c8bab 100644 --- a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_service.go +++ b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_service_test.go b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_service_test.go index fac44700990..4a2f5819a1a 100644 --- a/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_service_test.go +++ b/resource-manager/healthcareapis/2022-12-01/privatelinkresources/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2022-12-01/resource/README.md b/resource-manager/healthcareapis/2022-12-01/resource/README.md index 813e6edf5c7..62d06b3bbc8 100644 --- a/resource-manager/healthcareapis/2022-12-01/resource/README.md +++ b/resource-manager/healthcareapis/2022-12-01/resource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesDescription{ // ... @@ -41,7 +41,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesPatchDescription{ // ... diff --git a/resource-manager/healthcareapis/2022-12-01/resource/id_service.go b/resource-manager/healthcareapis/2022-12-01/resource/id_service.go index 928a209ac59..0dceff9da36 100644 --- a/resource-manager/healthcareapis/2022-12-01/resource/id_service.go +++ b/resource-manager/healthcareapis/2022-12-01/resource/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2022-12-01/resource/id_service_test.go b/resource-manager/healthcareapis/2022-12-01/resource/id_service_test.go index c10a11625b1..8916fd9c594 100644 --- a/resource-manager/healthcareapis/2022-12-01/resource/id_service_test.go +++ b/resource-manager/healthcareapis/2022-12-01/resource/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/README.md b/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/README.md index bae2d4ca86b..2147fa91493 100644 --- a/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/README.md +++ b/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") +id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go b/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go index 78afb5df8df..5c78b844ab8 100644 --- a/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go +++ b/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go @@ -123,7 +123,7 @@ func (id WorkspacePrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go b/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go index 57169d4d43e..e594eac1b5d 100644 --- a/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go +++ b/resource-manager/healthcareapis/2022-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePrivateLinkResourceId{} func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { - id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") + id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatWorkspacePrivateLinkResourceID(t *testing.T) { - actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName" + actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspacePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspacePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-02-28/dicomservices/model_dicomserviceproperties.go b/resource-manager/healthcareapis/2023-02-28/dicomservices/model_dicomserviceproperties.go index 70d482f3c2f..eebe78f5f3e 100644 --- a/resource-manager/healthcareapis/2023-02-28/dicomservices/model_dicomserviceproperties.go +++ b/resource-manager/healthcareapis/2023-02-28/dicomservices/model_dicomserviceproperties.go @@ -10,5 +10,5 @@ type DicomServiceProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/README.md b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/README.md index 0c30e8238a7..009e21df0b5 100644 --- a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/README.md +++ b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_privateendpointconnection.go index 7a4365aa6eb..70e604c38a1 100644 --- a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_privateendpointconnection_test.go index fbf269c798a..2e10ec990d1 100644 --- a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_service.go b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_service.go index 882be2fe644..9dce211d344 100644 --- a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_service.go +++ b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_service_test.go b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_service_test.go index 17fd8498495..525aad46aa6 100644 --- a/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_service_test.go +++ b/resource-manager/healthcareapis/2023-02-28/privateendpointconnections/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/README.md b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/README.md index 6239ed8221a..30f142c7cd1 100644 --- a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/README.md +++ b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_privatelinkresource.go b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_privatelinkresource.go index 6b34f0e6d14..e9019590800 100644 --- a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_privatelinkresource_test.go index 95950c5ba7a..d2c32a33913 100644 --- a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + ServiceName: "sErViCeNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_service.go b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_service.go index 72e43701cbe..7976b2c8bab 100644 --- a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_service.go +++ b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_service_test.go b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_service_test.go index fac44700990..4a2f5819a1a 100644 --- a/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_service_test.go +++ b/resource-manager/healthcareapis/2023-02-28/privatelinkresources/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-02-28/resource/README.md b/resource-manager/healthcareapis/2023-02-28/resource/README.md index 58d07811845..dac4344dcce 100644 --- a/resource-manager/healthcareapis/2023-02-28/resource/README.md +++ b/resource-manager/healthcareapis/2023-02-28/resource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesDescription{ // ... @@ -41,7 +41,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesPatchDescription{ // ... diff --git a/resource-manager/healthcareapis/2023-02-28/resource/id_service.go b/resource-manager/healthcareapis/2023-02-28/resource/id_service.go index 928a209ac59..0dceff9da36 100644 --- a/resource-manager/healthcareapis/2023-02-28/resource/id_service.go +++ b/resource-manager/healthcareapis/2023-02-28/resource/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-02-28/resource/id_service_test.go b/resource-manager/healthcareapis/2023-02-28/resource/id_service_test.go index c10a11625b1..8916fd9c594 100644 --- a/resource-manager/healthcareapis/2023-02-28/resource/id_service_test.go +++ b/resource-manager/healthcareapis/2023-02-28/resource/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/README.md b/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/README.md index 9f89729c419..68fc1c8e354 100644 --- a/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/README.md +++ b/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") +id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go b/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go index 78afb5df8df..5c78b844ab8 100644 --- a/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go +++ b/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go @@ -123,7 +123,7 @@ func (id WorkspacePrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go b/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go index 57169d4d43e..e594eac1b5d 100644 --- a/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go +++ b/resource-manager/healthcareapis/2023-02-28/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePrivateLinkResourceId{} func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { - id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") + id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatWorkspacePrivateLinkResourceID(t *testing.T) { - actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName" + actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspacePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspacePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-09-06/dicomservices/model_dicomserviceproperties.go b/resource-manager/healthcareapis/2023-09-06/dicomservices/model_dicomserviceproperties.go index 70d482f3c2f..eebe78f5f3e 100644 --- a/resource-manager/healthcareapis/2023-09-06/dicomservices/model_dicomserviceproperties.go +++ b/resource-manager/healthcareapis/2023-09-06/dicomservices/model_dicomserviceproperties.go @@ -10,5 +10,5 @@ type DicomServiceProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/README.md b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/README.md index 981feaa7c4f..3284d0e1ab8 100644 --- a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/README.md +++ b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_privateendpointconnection.go index 7a4365aa6eb..70e604c38a1 100644 --- a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_privateendpointconnection_test.go index fbf269c798a..2e10ec990d1 100644 --- a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_service.go b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_service.go index 882be2fe644..9dce211d344 100644 --- a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_service.go +++ b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_service_test.go b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_service_test.go index 17fd8498495..525aad46aa6 100644 --- a/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_service_test.go +++ b/resource-manager/healthcareapis/2023-09-06/privateendpointconnections/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/README.md b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/README.md index 27d17e1a636..cd5357267b2 100644 --- a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/README.md +++ b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_privatelinkresource.go b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_privatelinkresource.go index 6b34f0e6d14..e9019590800 100644 --- a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_privatelinkresource_test.go index 95950c5ba7a..d2c32a33913 100644 --- a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + ServiceName: "sErViCeNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_service.go b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_service.go index 72e43701cbe..7976b2c8bab 100644 --- a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_service.go +++ b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_service_test.go b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_service_test.go index fac44700990..4a2f5819a1a 100644 --- a/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_service_test.go +++ b/resource-manager/healthcareapis/2023-09-06/privatelinkresources/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-09-06/resource/README.md b/resource-manager/healthcareapis/2023-09-06/resource/README.md index f32e17f2e1e..9e8d5b6414d 100644 --- a/resource-manager/healthcareapis/2023-09-06/resource/README.md +++ b/resource-manager/healthcareapis/2023-09-06/resource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesDescription{ // ... @@ -41,7 +41,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesPatchDescription{ // ... diff --git a/resource-manager/healthcareapis/2023-09-06/resource/id_service.go b/resource-manager/healthcareapis/2023-09-06/resource/id_service.go index 928a209ac59..0dceff9da36 100644 --- a/resource-manager/healthcareapis/2023-09-06/resource/id_service.go +++ b/resource-manager/healthcareapis/2023-09-06/resource/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-09-06/resource/id_service_test.go b/resource-manager/healthcareapis/2023-09-06/resource/id_service_test.go index c10a11625b1..8916fd9c594 100644 --- a/resource-manager/healthcareapis/2023-09-06/resource/id_service_test.go +++ b/resource-manager/healthcareapis/2023-09-06/resource/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/README.md b/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/README.md index bfa7bb73bfd..f2e8137fe86 100644 --- a/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/README.md +++ b/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") +id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go b/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go index 78afb5df8df..5c78b844ab8 100644 --- a/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go +++ b/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go @@ -123,7 +123,7 @@ func (id WorkspacePrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go b/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go index 57169d4d43e..e594eac1b5d 100644 --- a/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go +++ b/resource-manager/healthcareapis/2023-09-06/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePrivateLinkResourceId{} func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { - id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") + id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatWorkspacePrivateLinkResourceID(t *testing.T) { - actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName" + actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspacePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspacePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-11-01/dicomservices/model_dicomserviceproperties.go b/resource-manager/healthcareapis/2023-11-01/dicomservices/model_dicomserviceproperties.go index 5252b28b7bf..6d3d92338f5 100644 --- a/resource-manager/healthcareapis/2023-11-01/dicomservices/model_dicomserviceproperties.go +++ b/resource-manager/healthcareapis/2023-11-01/dicomservices/model_dicomserviceproperties.go @@ -11,5 +11,5 @@ type DicomServiceProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2023-11-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go b/resource-manager/healthcareapis/2023-11-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go index 9365c0f5735..d08ec3e93f8 100644 --- a/resource-manager/healthcareapis/2023-11-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go +++ b/resource-manager/healthcareapis/2023-11-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go @@ -4,5 +4,5 @@ package dicomservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EncryptionCustomerManagedKeyEncryption struct { - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2023-11-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go b/resource-manager/healthcareapis/2023-11-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go index 4a76c4a4a44..b827d8627fd 100644 --- a/resource-manager/healthcareapis/2023-11-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go +++ b/resource-manager/healthcareapis/2023-11-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go @@ -4,5 +4,5 @@ package fhirservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EncryptionCustomerManagedKeyEncryption struct { - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/README.md b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/README.md index cab428db674..083bb457e7e 100644 --- a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/README.md +++ b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_privateendpointconnection.go index 7a4365aa6eb..70e604c38a1 100644 --- a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_privateendpointconnection_test.go index fbf269c798a..2e10ec990d1 100644 --- a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_service.go b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_service.go index 882be2fe644..9dce211d344 100644 --- a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_service.go +++ b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_service_test.go b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_service_test.go index 17fd8498495..525aad46aa6 100644 --- a/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_service_test.go +++ b/resource-manager/healthcareapis/2023-11-01/privateendpointconnections/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/README.md b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/README.md index f0d259ab3a3..63d56ef8178 100644 --- a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/README.md +++ b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_privatelinkresource.go b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_privatelinkresource.go index 6b34f0e6d14..e9019590800 100644 --- a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_privatelinkresource_test.go index 95950c5ba7a..d2c32a33913 100644 --- a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + ServiceName: "sErViCeNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_service.go b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_service.go index 72e43701cbe..7976b2c8bab 100644 --- a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_service.go +++ b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_service_test.go b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_service_test.go index fac44700990..4a2f5819a1a 100644 --- a/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_service_test.go +++ b/resource-manager/healthcareapis/2023-11-01/privatelinkresources/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-11-01/resource/README.md b/resource-manager/healthcareapis/2023-11-01/resource/README.md index 22b48f31730..2b6d59a2dd8 100644 --- a/resource-manager/healthcareapis/2023-11-01/resource/README.md +++ b/resource-manager/healthcareapis/2023-11-01/resource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesDescription{ // ... @@ -41,7 +41,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesPatchDescription{ // ... diff --git a/resource-manager/healthcareapis/2023-11-01/resource/id_service.go b/resource-manager/healthcareapis/2023-11-01/resource/id_service.go index 928a209ac59..0dceff9da36 100644 --- a/resource-manager/healthcareapis/2023-11-01/resource/id_service.go +++ b/resource-manager/healthcareapis/2023-11-01/resource/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-11-01/resource/id_service_test.go b/resource-manager/healthcareapis/2023-11-01/resource/id_service_test.go index c10a11625b1..8916fd9c594 100644 --- a/resource-manager/healthcareapis/2023-11-01/resource/id_service_test.go +++ b/resource-manager/healthcareapis/2023-11-01/resource/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/README.md b/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/README.md index 020e54d2252..6a4bef3b21b 100644 --- a/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/README.md +++ b/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") +id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go b/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go index 78afb5df8df..5c78b844ab8 100644 --- a/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go +++ b/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go @@ -123,7 +123,7 @@ func (id WorkspacePrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go b/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go index 57169d4d43e..e594eac1b5d 100644 --- a/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go +++ b/resource-manager/healthcareapis/2023-11-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePrivateLinkResourceId{} func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { - id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") + id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatWorkspacePrivateLinkResourceID(t *testing.T) { - actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName" + actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspacePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspacePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-12-01/dicomservices/model_dicomserviceproperties.go b/resource-manager/healthcareapis/2023-12-01/dicomservices/model_dicomserviceproperties.go index 5252b28b7bf..6d3d92338f5 100644 --- a/resource-manager/healthcareapis/2023-12-01/dicomservices/model_dicomserviceproperties.go +++ b/resource-manager/healthcareapis/2023-12-01/dicomservices/model_dicomserviceproperties.go @@ -11,5 +11,5 @@ type DicomServiceProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2023-12-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go b/resource-manager/healthcareapis/2023-12-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go index 9365c0f5735..d08ec3e93f8 100644 --- a/resource-manager/healthcareapis/2023-12-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go +++ b/resource-manager/healthcareapis/2023-12-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go @@ -4,5 +4,5 @@ package dicomservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EncryptionCustomerManagedKeyEncryption struct { - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2023-12-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go b/resource-manager/healthcareapis/2023-12-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go index 4a76c4a4a44..b827d8627fd 100644 --- a/resource-manager/healthcareapis/2023-12-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go +++ b/resource-manager/healthcareapis/2023-12-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go @@ -4,5 +4,5 @@ package fhirservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EncryptionCustomerManagedKeyEncryption struct { - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/README.md b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/README.md index 45313204367..7c5035ac203 100644 --- a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/README.md +++ b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_privateendpointconnection.go index 7a4365aa6eb..70e604c38a1 100644 --- a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_privateendpointconnection_test.go index fbf269c798a..2e10ec990d1 100644 --- a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_service.go b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_service.go index 882be2fe644..9dce211d344 100644 --- a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_service.go +++ b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_service_test.go b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_service_test.go index 17fd8498495..525aad46aa6 100644 --- a/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_service_test.go +++ b/resource-manager/healthcareapis/2023-12-01/privateendpointconnections/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/README.md b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/README.md index 7e52bec4ac0..5121783f012 100644 --- a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/README.md +++ b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_privatelinkresource.go b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_privatelinkresource.go index 6b34f0e6d14..e9019590800 100644 --- a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_privatelinkresource_test.go index 95950c5ba7a..d2c32a33913 100644 --- a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + ServiceName: "sErViCeNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_service.go b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_service.go index 72e43701cbe..7976b2c8bab 100644 --- a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_service.go +++ b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_service_test.go b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_service_test.go index fac44700990..4a2f5819a1a 100644 --- a/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_service_test.go +++ b/resource-manager/healthcareapis/2023-12-01/privatelinkresources/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-12-01/resource/README.md b/resource-manager/healthcareapis/2023-12-01/resource/README.md index 41732260ec3..cbddf7acc2c 100644 --- a/resource-manager/healthcareapis/2023-12-01/resource/README.md +++ b/resource-manager/healthcareapis/2023-12-01/resource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesDescription{ // ... @@ -41,7 +41,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesPatchDescription{ // ... diff --git a/resource-manager/healthcareapis/2023-12-01/resource/id_service.go b/resource-manager/healthcareapis/2023-12-01/resource/id_service.go index 928a209ac59..0dceff9da36 100644 --- a/resource-manager/healthcareapis/2023-12-01/resource/id_service.go +++ b/resource-manager/healthcareapis/2023-12-01/resource/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2023-12-01/resource/id_service_test.go b/resource-manager/healthcareapis/2023-12-01/resource/id_service_test.go index c10a11625b1..8916fd9c594 100644 --- a/resource-manager/healthcareapis/2023-12-01/resource/id_service_test.go +++ b/resource-manager/healthcareapis/2023-12-01/resource/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/README.md b/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/README.md index 772928c4232..cc5f4e2db04 100644 --- a/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/README.md +++ b/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") +id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go b/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go index 78afb5df8df..5c78b844ab8 100644 --- a/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go +++ b/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go @@ -123,7 +123,7 @@ func (id WorkspacePrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go b/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go index 57169d4d43e..e594eac1b5d 100644 --- a/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go +++ b/resource-manager/healthcareapis/2023-12-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePrivateLinkResourceId{} func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { - id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") + id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatWorkspacePrivateLinkResourceID(t *testing.T) { - actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName" + actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspacePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspacePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-01/dicomservices/model_dicomserviceproperties.go b/resource-manager/healthcareapis/2024-03-01/dicomservices/model_dicomserviceproperties.go index f205c15592e..cf290205879 100644 --- a/resource-manager/healthcareapis/2024-03-01/dicomservices/model_dicomserviceproperties.go +++ b/resource-manager/healthcareapis/2024-03-01/dicomservices/model_dicomserviceproperties.go @@ -11,6 +11,6 @@ type DicomServiceProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` StorageConfiguration *StorageConfiguration `json:"storageConfiguration,omitempty"` } diff --git a/resource-manager/healthcareapis/2024-03-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go b/resource-manager/healthcareapis/2024-03-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go index 9365c0f5735..d08ec3e93f8 100644 --- a/resource-manager/healthcareapis/2024-03-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go +++ b/resource-manager/healthcareapis/2024-03-01/dicomservices/model_encryptioncustomermanagedkeyencryption.go @@ -4,5 +4,5 @@ package dicomservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EncryptionCustomerManagedKeyEncryption struct { - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2024-03-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go b/resource-manager/healthcareapis/2024-03-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go index 4a76c4a4a44..b827d8627fd 100644 --- a/resource-manager/healthcareapis/2024-03-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go +++ b/resource-manager/healthcareapis/2024-03-01/fhirservices/model_encryptioncustomermanagedkeyencryption.go @@ -4,5 +4,5 @@ package fhirservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EncryptionCustomerManagedKeyEncryption struct { - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/README.md b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/README.md index b77e6be6619..155bcdb86e3 100644 --- a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/README.md +++ b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_privateendpointconnection.go index 7a4365aa6eb..70e604c38a1 100644 --- a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_privateendpointconnection_test.go index fbf269c798a..2e10ec990d1 100644 --- a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_service.go b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_service.go index 882be2fe644..9dce211d344 100644 --- a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_service.go +++ b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_service_test.go b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_service_test.go index 17fd8498495..525aad46aa6 100644 --- a/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_service_test.go +++ b/resource-manager/healthcareapis/2024-03-01/privateendpointconnections/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/README.md b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/README.md index 5f71479d1b1..94c96a18cd0 100644 --- a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/README.md +++ b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_privatelinkresource.go b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_privatelinkresource.go index 6b34f0e6d14..e9019590800 100644 --- a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_privatelinkresource_test.go index 95950c5ba7a..d2c32a33913 100644 --- a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + ServiceName: "sErViCeNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_service.go b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_service.go index 72e43701cbe..7976b2c8bab 100644 --- a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_service.go +++ b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_service_test.go b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_service_test.go index fac44700990..4a2f5819a1a 100644 --- a/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_service_test.go +++ b/resource-manager/healthcareapis/2024-03-01/privatelinkresources/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-01/resource/README.md b/resource-manager/healthcareapis/2024-03-01/resource/README.md index 52f522361aa..e8d70d754cb 100644 --- a/resource-manager/healthcareapis/2024-03-01/resource/README.md +++ b/resource-manager/healthcareapis/2024-03-01/resource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesDescription{ // ... @@ -41,7 +41,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesPatchDescription{ // ... diff --git a/resource-manager/healthcareapis/2024-03-01/resource/id_service.go b/resource-manager/healthcareapis/2024-03-01/resource/id_service.go index 928a209ac59..0dceff9da36 100644 --- a/resource-manager/healthcareapis/2024-03-01/resource/id_service.go +++ b/resource-manager/healthcareapis/2024-03-01/resource/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-01/resource/id_service_test.go b/resource-manager/healthcareapis/2024-03-01/resource/id_service_test.go index c10a11625b1..8916fd9c594 100644 --- a/resource-manager/healthcareapis/2024-03-01/resource/id_service_test.go +++ b/resource-manager/healthcareapis/2024-03-01/resource/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/README.md b/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/README.md index 036bdb2b229..017734df52c 100644 --- a/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/README.md +++ b/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") +id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go b/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go index 78afb5df8df..5c78b844ab8 100644 --- a/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go +++ b/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go @@ -123,7 +123,7 @@ func (id WorkspacePrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go b/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go index 57169d4d43e..e594eac1b5d 100644 --- a/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go +++ b/resource-manager/healthcareapis/2024-03-01/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePrivateLinkResourceId{} func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { - id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") + id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatWorkspacePrivateLinkResourceID(t *testing.T) { - actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName" + actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspacePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspacePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-31/dicomservices/model_dicomserviceproperties.go b/resource-manager/healthcareapis/2024-03-31/dicomservices/model_dicomserviceproperties.go index d832c369c24..8c2381af41a 100644 --- a/resource-manager/healthcareapis/2024-03-31/dicomservices/model_dicomserviceproperties.go +++ b/resource-manager/healthcareapis/2024-03-31/dicomservices/model_dicomserviceproperties.go @@ -12,6 +12,6 @@ type DicomServiceProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` StorageConfiguration *StorageConfiguration `json:"storageConfiguration,omitempty"` } diff --git a/resource-manager/healthcareapis/2024-03-31/dicomservices/model_encryptioncustomermanagedkeyencryption.go b/resource-manager/healthcareapis/2024-03-31/dicomservices/model_encryptioncustomermanagedkeyencryption.go index 9365c0f5735..d08ec3e93f8 100644 --- a/resource-manager/healthcareapis/2024-03-31/dicomservices/model_encryptioncustomermanagedkeyencryption.go +++ b/resource-manager/healthcareapis/2024-03-31/dicomservices/model_encryptioncustomermanagedkeyencryption.go @@ -4,5 +4,5 @@ package dicomservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EncryptionCustomerManagedKeyEncryption struct { - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2024-03-31/fhirservices/model_encryptioncustomermanagedkeyencryption.go b/resource-manager/healthcareapis/2024-03-31/fhirservices/model_encryptioncustomermanagedkeyencryption.go index 4a76c4a4a44..b827d8627fd 100644 --- a/resource-manager/healthcareapis/2024-03-31/fhirservices/model_encryptioncustomermanagedkeyencryption.go +++ b/resource-manager/healthcareapis/2024-03-31/fhirservices/model_encryptioncustomermanagedkeyencryption.go @@ -4,5 +4,5 @@ package fhirservices // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EncryptionCustomerManagedKeyEncryption struct { - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/README.md b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/README.md index ff84b74bc44..df1838cc395 100644 --- a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/README.md +++ b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privateendpointconnections.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_privateendpointconnection.go index 7a4365aa6eb..70e604c38a1 100644 --- a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_privateendpointconnection_test.go index fbf269c798a..2e10ec990d1 100644 --- a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_service.go b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_service.go index 882be2fe644..9dce211d344 100644 --- a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_service.go +++ b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_service_test.go b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_service_test.go index 17fd8498495..525aad46aa6 100644 --- a/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_service_test.go +++ b/resource-manager/healthcareapis/2024-03-31/privateendpointconnections/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/README.md b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/README.md index b8943b78a7f..32c4b84be8b 100644 --- a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/README.md +++ b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := privatelinkresources.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ListByService(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_privatelinkresource.go b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_privatelinkresource.go index 6b34f0e6d14..e9019590800 100644 --- a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_privatelinkresource_test.go index 95950c5ba7a..d2c32a33913 100644 --- a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", - PrivateLinkResourceName: "groupName", + ServiceName: "serviceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + ServiceName: "sErViCeNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_service.go b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_service.go index 72e43701cbe..7976b2c8bab 100644 --- a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_service.go +++ b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_service_test.go b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_service_test.go index fac44700990..4a2f5819a1a 100644 --- a/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_service_test.go +++ b/resource-manager/healthcareapis/2024-03-31/privatelinkresources/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-31/resource/README.md b/resource-manager/healthcareapis/2024-03-31/resource/README.md index 05a71a8eeaf..3c0f412bc38 100644 --- a/resource-manager/healthcareapis/2024-03-31/resource/README.md +++ b/resource-manager/healthcareapis/2024-03-31/resource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesDescription{ // ... @@ -41,7 +41,7 @@ if err := client.ServicesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ServicesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") read, err := client.ServicesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := resource.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") payload := resource.ServicesPatchDescription{ // ... diff --git a/resource-manager/healthcareapis/2024-03-31/resource/id_service.go b/resource-manager/healthcareapis/2024-03-31/resource/id_service.go index 928a209ac59..0dceff9da36 100644 --- a/resource-manager/healthcareapis/2024-03-31/resource/id_service.go +++ b/resource-manager/healthcareapis/2024-03-31/resource/id_service.go @@ -115,7 +115,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHealthcareApis", "Microsoft.HealthcareApis", "Microsoft.HealthcareApis"), resourceids.StaticSegment("staticServices", "services", "services"), - resourceids.UserSpecifiedSegment("serviceName", "resourceName"), + resourceids.UserSpecifiedSegment("serviceName", "serviceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-31/resource/id_service_test.go b/resource-manager/healthcareapis/2024-03-31/resource/id_service_test.go index c10a11625b1..8916fd9c594 100644 --- a/resource-manager/healthcareapis/2024-03-31/resource/id_service_test.go +++ b/resource-manager/healthcareapis/2024-03-31/resource/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "resourceName") + if id.ServiceName != "serviceName" { + t.Fatalf("Expected %q but got %q for Segment 'ServiceName'", id.ServiceName, "serviceName") } } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServiceName: "resourceName", + ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceName: "rEsOuRcEnAmE", + ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/README.md b/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/README.md index 6ca8925df58..6e7b666b235 100644 --- a/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/README.md +++ b/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") +id := workspaceprivatelinkresources.NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go b/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go index 78afb5df8df..5c78b844ab8 100644 --- a/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go +++ b/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/id_workspaceprivatelinkresource.go @@ -123,7 +123,7 @@ func (id WorkspacePrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go b/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go index 57169d4d43e..e594eac1b5d 100644 --- a/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go +++ b/resource-manager/healthcareapis/2024-03-31/workspaceprivatelinkresources/id_workspaceprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspacePrivateLinkResourceId{} func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { - id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName") + id := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspacePrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatWorkspacePrivateLinkResourceID(t *testing.T) { - actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName" + actual := NewWorkspacePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspacePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspacePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HealthcareApis/workspaces/workspaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &WorkspacePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hEaLtHcArEaPiS/wOrKsPaCeS/wOrKsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-11-10/extensions/README.md b/resource-manager/hybridcompute/2022-11-10/extensions/README.md index 026e33ddf73..76609acbe82 100644 --- a/resource-manager/hybridcompute/2022-11-10/extensions/README.md +++ b/resource-manager/hybridcompute/2022-11-10/extensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := extensions.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version") +id := extensions.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName") read, err := client.ExtensionMetadataGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := extensions.NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType") +id := extensions.NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName") read, err := client.ExtensionMetadataList(ctx, id) if err != nil { diff --git a/resource-manager/hybridcompute/2022-11-10/extensions/id_extensiontype.go b/resource-manager/hybridcompute/2022-11-10/extensions/id_extensiontype.go index 909461da4ec..ea8817db72b 100644 --- a/resource-manager/hybridcompute/2022-11-10/extensions/id_extensiontype.go +++ b/resource-manager/hybridcompute/2022-11-10/extensions/id_extensiontype.go @@ -119,11 +119,11 @@ func (id ExtensionTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisher"), + resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticExtensionTypes", "extensionTypes", "extensionTypes"), - resourceids.UserSpecifiedSegment("extensionTypeName", "extensionType"), + resourceids.UserSpecifiedSegment("extensionTypeName", "extensionTypeName"), } } diff --git a/resource-manager/hybridcompute/2022-11-10/extensions/id_extensiontype_test.go b/resource-manager/hybridcompute/2022-11-10/extensions/id_extensiontype_test.go index 1cc6c55f319..be079b7667f 100644 --- a/resource-manager/hybridcompute/2022-11-10/extensions/id_extensiontype_test.go +++ b/resource-manager/hybridcompute/2022-11-10/extensions/id_extensiontype_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ExtensionTypeId{} func TestNewExtensionTypeID(t *testing.T) { - id := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType") + id := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.PublisherName != "publisher" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisher") + if id.PublisherName != "publisherName" { + t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.ExtensionTypeName != "extensionType" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionType") + if id.ExtensionTypeName != "extensionTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionTypeName") } } func TestFormatExtensionTypeID(t *testing.T) { - actual := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType" + actual := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseExtensionTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseExtensionTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - PublisherName: "pUbLiShEr", - ExtensionTypeName: "eXtEnSiOnTyPe", + LocationName: "lOcAtIoNnAmE", + PublisherName: "pUbLiShErNaMe", + ExtensionTypeName: "eXtEnSiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-11-10/extensions/id_version.go b/resource-manager/hybridcompute/2022-11-10/extensions/id_version.go index 28dda5dc912..6f0e20e8d52 100644 --- a/resource-manager/hybridcompute/2022-11-10/extensions/id_version.go +++ b/resource-manager/hybridcompute/2022-11-10/extensions/id_version.go @@ -125,13 +125,13 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisher"), + resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticExtensionTypes", "extensionTypes", "extensionTypes"), - resourceids.UserSpecifiedSegment("extensionTypeName", "extensionType"), + resourceids.UserSpecifiedSegment("extensionTypeName", "extensionTypeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/hybridcompute/2022-11-10/extensions/id_version_test.go b/resource-manager/hybridcompute/2022-11-10/extensions/id_version_test.go index 907807453e2..4e52de8e82d 100644 --- a/resource-manager/hybridcompute/2022-11-10/extensions/id_version_test.go +++ b/resource-manager/hybridcompute/2022-11-10/extensions/id_version_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.PublisherName != "publisher" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisher") + if id.PublisherName != "publisherName" { + t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.ExtensionTypeName != "extensionType" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionType") + if id.ExtensionTypeName != "extensionTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionTypeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", - VersionName: "version", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", - VersionName: "version", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - PublisherName: "pUbLiShEr", - ExtensionTypeName: "eXtEnSiOnTyPe", - VersionName: "vErSiOn", + LocationName: "lOcAtIoNnAmE", + PublisherName: "pUbLiShErNaMe", + ExtensionTypeName: "eXtEnSiOnTyPeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-11-10/machineextensions/model_machineextensionproperties.go b/resource-manager/hybridcompute/2022-11-10/machineextensions/model_machineextensionproperties.go index d8f4dd106ea..6a42b8991a1 100644 --- a/resource-manager/hybridcompute/2022-11-10/machineextensions/model_machineextensionproperties.go +++ b/resource-manager/hybridcompute/2022-11-10/machineextensions/model_machineextensionproperties.go @@ -8,10 +8,10 @@ type MachineExtensionProperties struct { EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` InstanceView *MachineExtensionInstanceView `json:"instanceView,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2022-11-10/machineextensions/model_machineextensionupdateproperties.go b/resource-manager/hybridcompute/2022-11-10/machineextensions/model_machineextensionupdateproperties.go index d8a1ee28b65..9d7d54fd6cc 100644 --- a/resource-manager/hybridcompute/2022-11-10/machineextensions/model_machineextensionupdateproperties.go +++ b/resource-manager/hybridcompute/2022-11-10/machineextensions/model_machineextensionupdateproperties.go @@ -4,12 +4,12 @@ package machineextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type MachineExtensionUpdateProperties struct { - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` - Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` - Type *string `json:"type,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` + Publisher *string `json:"publisher,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` + Type *string `json:"type,omitempty"` + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2022-11-10/machines/model_agentconfiguration.go b/resource-manager/hybridcompute/2022-11-10/machines/model_agentconfiguration.go index 705bcf8d415..78597915af9 100644 --- a/resource-manager/hybridcompute/2022-11-10/machines/model_agentconfiguration.go +++ b/resource-manager/hybridcompute/2022-11-10/machines/model_agentconfiguration.go @@ -11,5 +11,5 @@ type AgentConfiguration struct { GuestConfigurationEnabled *string `json:"guestConfigurationEnabled,omitempty"` IncomingConnectionsPorts *[]string `json:"incomingConnectionsPorts,omitempty"` ProxyBypass *[]string `json:"proxyBypass,omitempty"` - ProxyUrl *string `json:"proxyUrl,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` } diff --git a/resource-manager/hybridcompute/2022-11-10/machines/model_machineextensionproperties.go b/resource-manager/hybridcompute/2022-11-10/machines/model_machineextensionproperties.go index 40a2c5bd9b3..afad01914ce 100644 --- a/resource-manager/hybridcompute/2022-11-10/machines/model_machineextensionproperties.go +++ b/resource-manager/hybridcompute/2022-11-10/machines/model_machineextensionproperties.go @@ -8,10 +8,10 @@ type MachineExtensionProperties struct { EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` InstanceView *MachineExtensionInstanceView `json:"instanceView,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/README.md b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/README.md index 1eb4d3b1bcc..21e9437892c 100644 --- a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/README.md +++ b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privateendpointconnections.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_privateendpointconnection.go index ddb5472edd7..48f7cbc1068 100644 --- a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_privateendpointconnection_test.go index 92279f4ba1b..25064b5ca1e 100644 --- a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_providerprivatelinkscope.go index 46d0b8c6ba9..e65e13354bc 100644 --- a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_providerprivatelinkscope_test.go index aff23a7a735..bf57b72fb1d 100644 --- a/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2022-11-10/privateendpointconnections/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/README.md b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/README.md index 1afb8878517..86db962b2f3 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/README.md +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkresources.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_privatelinkresource.go b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_privatelinkresource.go index 4b5f29de857..bc340a22775 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_privatelinkresource_test.go index cc189d85994..43a8b6e7d3a 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_providerprivatelinkscope.go index a81baeadabd..f21dc62c87e 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_providerprivatelinkscope_test.go index 0e67a7f985a..b2da5008a8c 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkresources/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/README.md b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/README.md index 097a9824400..3cdcf4a6f8d 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/README.md +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopes.HybridComputePrivateLinkScope{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId") +id := privatelinkscopes.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId") read, err := client.GetValidationDetails(ctx, id) if err != nil { @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopes.TagsResource{ // ... diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_privatelinkscope.go b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_privatelinkscope.go index df45f21ff44..a2a5feb8bb6 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_privatelinkscope.go +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_privatelinkscope.go @@ -113,7 +113,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), resourceids.UserSpecifiedSegment("privateLinkScopeId", "privateLinkScopeId"), } diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_privatelinkscope_test.go b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_privatelinkscope_test.go index 20bbb80e2c9..9a5f850d2bf 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_privatelinkscope_test.go +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_privatelinkscope_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PrivateLinkScopeId != "privateLinkScopeId" { @@ -28,8 +28,8 @@ func TestNewPrivateLinkScopeID(t *testing.T) { } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PrivateLinkScopeId: "privateLinkScopeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PrivateLinkScopeId: "privateLinkScopeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PrivateLinkScopeId: "pRiVaTeLiNkScOpEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_providerprivatelinkscope.go index e088291c056..33c545a7749 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_providerprivatelinkscope_test.go index fe6f5677a76..1ebda450104 100644 --- a/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2022-11-10/privatelinkscopes/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-12-27/extensions/README.md b/resource-manager/hybridcompute/2022-12-27/extensions/README.md index 21344444dc1..6a24a49d260 100644 --- a/resource-manager/hybridcompute/2022-12-27/extensions/README.md +++ b/resource-manager/hybridcompute/2022-12-27/extensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := extensions.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version") +id := extensions.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName") read, err := client.ExtensionMetadataGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := extensions.NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType") +id := extensions.NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName") read, err := client.ExtensionMetadataList(ctx, id) if err != nil { diff --git a/resource-manager/hybridcompute/2022-12-27/extensions/id_extensiontype.go b/resource-manager/hybridcompute/2022-12-27/extensions/id_extensiontype.go index 909461da4ec..ea8817db72b 100644 --- a/resource-manager/hybridcompute/2022-12-27/extensions/id_extensiontype.go +++ b/resource-manager/hybridcompute/2022-12-27/extensions/id_extensiontype.go @@ -119,11 +119,11 @@ func (id ExtensionTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisher"), + resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticExtensionTypes", "extensionTypes", "extensionTypes"), - resourceids.UserSpecifiedSegment("extensionTypeName", "extensionType"), + resourceids.UserSpecifiedSegment("extensionTypeName", "extensionTypeName"), } } diff --git a/resource-manager/hybridcompute/2022-12-27/extensions/id_extensiontype_test.go b/resource-manager/hybridcompute/2022-12-27/extensions/id_extensiontype_test.go index 1cc6c55f319..be079b7667f 100644 --- a/resource-manager/hybridcompute/2022-12-27/extensions/id_extensiontype_test.go +++ b/resource-manager/hybridcompute/2022-12-27/extensions/id_extensiontype_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ExtensionTypeId{} func TestNewExtensionTypeID(t *testing.T) { - id := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType") + id := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.PublisherName != "publisher" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisher") + if id.PublisherName != "publisherName" { + t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.ExtensionTypeName != "extensionType" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionType") + if id.ExtensionTypeName != "extensionTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionTypeName") } } func TestFormatExtensionTypeID(t *testing.T) { - actual := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType" + actual := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseExtensionTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseExtensionTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - PublisherName: "pUbLiShEr", - ExtensionTypeName: "eXtEnSiOnTyPe", + LocationName: "lOcAtIoNnAmE", + PublisherName: "pUbLiShErNaMe", + ExtensionTypeName: "eXtEnSiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-12-27/extensions/id_version.go b/resource-manager/hybridcompute/2022-12-27/extensions/id_version.go index 28dda5dc912..6f0e20e8d52 100644 --- a/resource-manager/hybridcompute/2022-12-27/extensions/id_version.go +++ b/resource-manager/hybridcompute/2022-12-27/extensions/id_version.go @@ -125,13 +125,13 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisher"), + resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticExtensionTypes", "extensionTypes", "extensionTypes"), - resourceids.UserSpecifiedSegment("extensionTypeName", "extensionType"), + resourceids.UserSpecifiedSegment("extensionTypeName", "extensionTypeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/hybridcompute/2022-12-27/extensions/id_version_test.go b/resource-manager/hybridcompute/2022-12-27/extensions/id_version_test.go index 907807453e2..4e52de8e82d 100644 --- a/resource-manager/hybridcompute/2022-12-27/extensions/id_version_test.go +++ b/resource-manager/hybridcompute/2022-12-27/extensions/id_version_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.PublisherName != "publisher" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisher") + if id.PublisherName != "publisherName" { + t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.ExtensionTypeName != "extensionType" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionType") + if id.ExtensionTypeName != "extensionTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionTypeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", - VersionName: "version", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", - VersionName: "version", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - PublisherName: "pUbLiShEr", - ExtensionTypeName: "eXtEnSiOnTyPe", - VersionName: "vErSiOn", + LocationName: "lOcAtIoNnAmE", + PublisherName: "pUbLiShErNaMe", + ExtensionTypeName: "eXtEnSiOnTyPeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-12-27/machineextensions/model_machineextensionproperties.go b/resource-manager/hybridcompute/2022-12-27/machineextensions/model_machineextensionproperties.go index d8f4dd106ea..6a42b8991a1 100644 --- a/resource-manager/hybridcompute/2022-12-27/machineextensions/model_machineextensionproperties.go +++ b/resource-manager/hybridcompute/2022-12-27/machineextensions/model_machineextensionproperties.go @@ -8,10 +8,10 @@ type MachineExtensionProperties struct { EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` InstanceView *MachineExtensionInstanceView `json:"instanceView,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2022-12-27/machineextensions/model_machineextensionupdateproperties.go b/resource-manager/hybridcompute/2022-12-27/machineextensions/model_machineextensionupdateproperties.go index d8a1ee28b65..9d7d54fd6cc 100644 --- a/resource-manager/hybridcompute/2022-12-27/machineextensions/model_machineextensionupdateproperties.go +++ b/resource-manager/hybridcompute/2022-12-27/machineextensions/model_machineextensionupdateproperties.go @@ -4,12 +4,12 @@ package machineextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type MachineExtensionUpdateProperties struct { - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` - Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` - Type *string `json:"type,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` + Publisher *string `json:"publisher,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` + Type *string `json:"type,omitempty"` + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2022-12-27/machines/model_agentconfiguration.go b/resource-manager/hybridcompute/2022-12-27/machines/model_agentconfiguration.go index 705bcf8d415..78597915af9 100644 --- a/resource-manager/hybridcompute/2022-12-27/machines/model_agentconfiguration.go +++ b/resource-manager/hybridcompute/2022-12-27/machines/model_agentconfiguration.go @@ -11,5 +11,5 @@ type AgentConfiguration struct { GuestConfigurationEnabled *string `json:"guestConfigurationEnabled,omitempty"` IncomingConnectionsPorts *[]string `json:"incomingConnectionsPorts,omitempty"` ProxyBypass *[]string `json:"proxyBypass,omitempty"` - ProxyUrl *string `json:"proxyUrl,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` } diff --git a/resource-manager/hybridcompute/2022-12-27/machines/model_machineextensionproperties.go b/resource-manager/hybridcompute/2022-12-27/machines/model_machineextensionproperties.go index 40a2c5bd9b3..afad01914ce 100644 --- a/resource-manager/hybridcompute/2022-12-27/machines/model_machineextensionproperties.go +++ b/resource-manager/hybridcompute/2022-12-27/machines/model_machineextensionproperties.go @@ -8,10 +8,10 @@ type MachineExtensionProperties struct { EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` InstanceView *MachineExtensionInstanceView `json:"instanceView,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/README.md b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/README.md index 44fa7b6e0ba..c77813aad84 100644 --- a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/README.md +++ b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privateendpointconnections.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_privateendpointconnection.go index ddb5472edd7..48f7cbc1068 100644 --- a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_privateendpointconnection_test.go index 92279f4ba1b..25064b5ca1e 100644 --- a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_providerprivatelinkscope.go index 46d0b8c6ba9..e65e13354bc 100644 --- a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_providerprivatelinkscope_test.go index aff23a7a735..bf57b72fb1d 100644 --- a/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2022-12-27/privateendpointconnections/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/README.md b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/README.md index 3239d49e824..8a11931a9f2 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/README.md +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkresources.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_privatelinkresource.go b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_privatelinkresource.go index 4b5f29de857..bc340a22775 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_privatelinkresource_test.go index cc189d85994..43a8b6e7d3a 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_providerprivatelinkscope.go index a81baeadabd..f21dc62c87e 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_providerprivatelinkscope_test.go index 0e67a7f985a..b2da5008a8c 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkresources/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/README.md b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/README.md index 2d6e8e6b129..b88698ea1b1 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/README.md +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopes.HybridComputePrivateLinkScope{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId") +id := privatelinkscopes.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId") read, err := client.GetValidationDetails(ctx, id) if err != nil { @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopes.TagsResource{ // ... diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_privatelinkscope.go b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_privatelinkscope.go index df45f21ff44..a2a5feb8bb6 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_privatelinkscope.go +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_privatelinkscope.go @@ -113,7 +113,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), resourceids.UserSpecifiedSegment("privateLinkScopeId", "privateLinkScopeId"), } diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_privatelinkscope_test.go b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_privatelinkscope_test.go index 20bbb80e2c9..9a5f850d2bf 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_privatelinkscope_test.go +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_privatelinkscope_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PrivateLinkScopeId != "privateLinkScopeId" { @@ -28,8 +28,8 @@ func TestNewPrivateLinkScopeID(t *testing.T) { } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PrivateLinkScopeId: "privateLinkScopeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PrivateLinkScopeId: "privateLinkScopeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PrivateLinkScopeId: "pRiVaTeLiNkScOpEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_providerprivatelinkscope.go index e088291c056..33c545a7749 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_providerprivatelinkscope_test.go index fe6f5677a76..1ebda450104 100644 --- a/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2022-12-27/privatelinkscopes/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/README.md b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/README.md index 99940e6593b..c30be3d18c8 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/README.md +++ b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := agentversions.NewAgentVersionID("osType", "version") +id := agentversions.NewAgentVersionID("osTypeName", "agentVersionName") read, err := client.AgentVersionGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := agentversions.NewOsTypeID("osType") +id := agentversions.NewOsTypeID("osTypeName") // alternatively `client.AgentVersionList(ctx, id)` can be used to do batched pagination items, err := client.AgentVersionListComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_agentversion.go b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_agentversion.go index b8c5ab6fc98..db8c8fb3be8 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_agentversion.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_agentversion.go @@ -105,9 +105,9 @@ func (id AgentVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticOsType", "osType", "osType"), - resourceids.UserSpecifiedSegment("osTypeName", "osType"), + resourceids.UserSpecifiedSegment("osTypeName", "osTypeName"), resourceids.StaticSegment("staticAgentVersions", "agentVersions", "agentVersions"), - resourceids.UserSpecifiedSegment("agentVersionName", "version"), + resourceids.UserSpecifiedSegment("agentVersionName", "agentVersionName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_agentversion_test.go b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_agentversion_test.go index 9a42ce19885..f1531e02399 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_agentversion_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_agentversion_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &AgentVersionId{} func TestNewAgentVersionID(t *testing.T) { - id := NewAgentVersionID("osType", "version") + id := NewAgentVersionID("osTypeName", "agentVersionName") - if id.OsTypeName != "osType" { - t.Fatalf("Expected %q but got %q for Segment 'OsTypeName'", id.OsTypeName, "osType") + if id.OsTypeName != "osTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'OsTypeName'", id.OsTypeName, "osTypeName") } - if id.AgentVersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'AgentVersionName'", id.AgentVersionName, "version") + if id.AgentVersionName != "agentVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'AgentVersionName'", id.AgentVersionName, "agentVersionName") } } func TestFormatAgentVersionID(t *testing.T) { - actual := NewAgentVersionID("osType", "version").ID() - expected := "/providers/Microsoft.HybridCompute/osType/osType/agentVersions/version" + actual := NewAgentVersionID("osTypeName", "agentVersionName").ID() + expected := "/providers/Microsoft.HybridCompute/osType/osTypeName/agentVersions/agentVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,25 +59,25 @@ func TestParseAgentVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/providers/Microsoft.HybridCompute/osType/osType", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName", Error: true, }, { // Incomplete URI - Input: "/providers/Microsoft.HybridCompute/osType/osType/agentVersions", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName/agentVersions", Error: true, }, { // Valid URI - Input: "/providers/Microsoft.HybridCompute/osType/osType/agentVersions/version", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName/agentVersions/agentVersionName", Expected: &AgentVersionId{ - OsTypeName: "osType", - AgentVersionName: "version", + OsTypeName: "osTypeName", + AgentVersionName: "agentVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.HybridCompute/osType/osType/agentVersions/version/extra", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName/agentVersions/agentVersionName/extra", Error: true, }, } @@ -150,48 +150,48 @@ func TestParseAgentVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/providers/Microsoft.HybridCompute/osType/osType", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpE", + Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpEnAmE", Error: true, }, { // Incomplete URI - Input: "/providers/Microsoft.HybridCompute/osType/osType/agentVersions", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName/agentVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpE/aGeNtVeRsIoNs", + Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpEnAmE/aGeNtVeRsIoNs", Error: true, }, { // Valid URI - Input: "/providers/Microsoft.HybridCompute/osType/osType/agentVersions/version", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName/agentVersions/agentVersionName", Expected: &AgentVersionId{ - OsTypeName: "osType", - AgentVersionName: "version", + OsTypeName: "osTypeName", + AgentVersionName: "agentVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.HybridCompute/osType/osType/agentVersions/version/extra", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName/agentVersions/agentVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpE/aGeNtVeRsIoNs/vErSiOn", + Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpEnAmE/aGeNtVeRsIoNs/aGeNtVeRsIoNnAmE", Expected: &AgentVersionId{ - OsTypeName: "oStYpE", - AgentVersionName: "vErSiOn", + OsTypeName: "oStYpEnAmE", + AgentVersionName: "aGeNtVeRsIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpE/aGeNtVeRsIoNs/vErSiOn/extra", + Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpEnAmE/aGeNtVeRsIoNs/aGeNtVeRsIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_ostype.go b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_ostype.go index fa83cde8ab9..58b12967543 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_ostype.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_ostype.go @@ -99,7 +99,7 @@ func (id OsTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticOsType", "osType", "osType"), - resourceids.UserSpecifiedSegment("osTypeName", "osType"), + resourceids.UserSpecifiedSegment("osTypeName", "osTypeName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_ostype_test.go b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_ostype_test.go index dd90c0ce443..e99bd3f66a4 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_ostype_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/agentversions/id_ostype_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &OsTypeId{} func TestNewOsTypeID(t *testing.T) { - id := NewOsTypeID("osType") + id := NewOsTypeID("osTypeName") - if id.OsTypeName != "osType" { - t.Fatalf("Expected %q but got %q for Segment 'OsTypeName'", id.OsTypeName, "osType") + if id.OsTypeName != "osTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'OsTypeName'", id.OsTypeName, "osTypeName") } } func TestFormatOsTypeID(t *testing.T) { - actual := NewOsTypeID("osType").ID() - expected := "/providers/Microsoft.HybridCompute/osType/osType" + actual := NewOsTypeID("osTypeName").ID() + expected := "/providers/Microsoft.HybridCompute/osType/osTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseOsTypeID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.HybridCompute/osType/osType", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName", Expected: &OsTypeId{ - OsTypeName: "osType", + OsTypeName: "osTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.HybridCompute/osType/osType/extra", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseOsTypeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.HybridCompute/osType/osType", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName", Expected: &OsTypeId{ - OsTypeName: "osType", + OsTypeName: "osTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.HybridCompute/osType/osType/extra", + Input: "/providers/Microsoft.HybridCompute/osType/osTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpE", + Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpEnAmE", Expected: &OsTypeId{ - OsTypeName: "oStYpE", + OsTypeName: "oStYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/oStYpE/oStYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/extensions/README.md b/resource-manager/hybridcompute/2024-05-20-preview/extensions/README.md index d285e5daf36..97eab52b862 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/extensions/README.md +++ b/resource-manager/hybridcompute/2024-05-20-preview/extensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := extensions.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version") +id := extensions.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName") read, err := client.ExtensionMetadataGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := extensions.NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType") +id := extensions.NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName") read, err := client.ExtensionMetadataList(ctx, id) if err != nil { diff --git a/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_extensiontype.go b/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_extensiontype.go index 909461da4ec..ea8817db72b 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_extensiontype.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_extensiontype.go @@ -119,11 +119,11 @@ func (id ExtensionTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisher"), + resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticExtensionTypes", "extensionTypes", "extensionTypes"), - resourceids.UserSpecifiedSegment("extensionTypeName", "extensionType"), + resourceids.UserSpecifiedSegment("extensionTypeName", "extensionTypeName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_extensiontype_test.go b/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_extensiontype_test.go index 1cc6c55f319..be079b7667f 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_extensiontype_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_extensiontype_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ExtensionTypeId{} func TestNewExtensionTypeID(t *testing.T) { - id := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType") + id := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.PublisherName != "publisher" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisher") + if id.PublisherName != "publisherName" { + t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.ExtensionTypeName != "extensionType" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionType") + if id.ExtensionTypeName != "extensionTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionTypeName") } } func TestFormatExtensionTypeID(t *testing.T) { - actual := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType" + actual := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseExtensionTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseExtensionTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - PublisherName: "pUbLiShEr", - ExtensionTypeName: "eXtEnSiOnTyPe", + LocationName: "lOcAtIoNnAmE", + PublisherName: "pUbLiShErNaMe", + ExtensionTypeName: "eXtEnSiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_version.go b/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_version.go index 28dda5dc912..6f0e20e8d52 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_version.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_version.go @@ -125,13 +125,13 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisher"), + resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticExtensionTypes", "extensionTypes", "extensionTypes"), - resourceids.UserSpecifiedSegment("extensionTypeName", "extensionType"), + resourceids.UserSpecifiedSegment("extensionTypeName", "extensionTypeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_version_test.go b/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_version_test.go index 907807453e2..4e52de8e82d 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_version_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/extensions/id_version_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.PublisherName != "publisher" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisher") + if id.PublisherName != "publisherName" { + t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.ExtensionTypeName != "extensionType" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionType") + if id.ExtensionTypeName != "extensionTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionTypeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", - VersionName: "version", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", - VersionName: "version", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - PublisherName: "pUbLiShEr", - ExtensionTypeName: "eXtEnSiOnTyPe", - VersionName: "vErSiOn", + LocationName: "lOcAtIoNnAmE", + PublisherName: "pUbLiShErNaMe", + ExtensionTypeName: "eXtEnSiOnTyPeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/README.md b/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/README.md index 36de924c371..e85b9cfca9f 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/README.md +++ b/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hybrididentitymetadata.NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineName", "metadataName") +id := hybrididentitymetadata.NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineName", "hybridIdentityMetadataName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/id_hybrididentitymetadata.go b/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/id_hybrididentitymetadata.go index 48c53544405..4738685f063 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/id_hybrididentitymetadata.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/id_hybrididentitymetadata.go @@ -123,7 +123,7 @@ func (id HybridIdentityMetadataId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMachines", "machines", "machines"), resourceids.UserSpecifiedSegment("machineName", "machineName"), resourceids.StaticSegment("staticHybridIdentityMetadata", "hybridIdentityMetadata", "hybridIdentityMetadata"), - resourceids.UserSpecifiedSegment("hybridIdentityMetadataName", "metadataName"), + resourceids.UserSpecifiedSegment("hybridIdentityMetadataName", "hybridIdentityMetadataName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/id_hybrididentitymetadata_test.go b/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/id_hybrididentitymetadata_test.go index 1c68197fad9..302dc29e61d 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/id_hybrididentitymetadata_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/hybrididentitymetadata/id_hybrididentitymetadata_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HybridIdentityMetadataId{} func TestNewHybridIdentityMetadataID(t *testing.T) { - id := NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineName", "metadataName") + id := NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineName", "hybridIdentityMetadataName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHybridIdentityMetadataID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MachineName'", id.MachineName, "machineName") } - if id.HybridIdentityMetadataName != "metadataName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridIdentityMetadataName'", id.HybridIdentityMetadataName, "metadataName") + if id.HybridIdentityMetadataName != "hybridIdentityMetadataName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridIdentityMetadataName'", id.HybridIdentityMetadataName, "hybridIdentityMetadataName") } } func TestFormatHybridIdentityMetadataID(t *testing.T) { - actual := NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineName", "metadataName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/metadataName" + actual := NewHybridIdentityMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "machineName", "hybridIdentityMetadataName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/hybridIdentityMetadataName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHybridIdentityMetadataID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/metadataName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/hybridIdentityMetadataName", Expected: &HybridIdentityMetadataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MachineName: "machineName", - HybridIdentityMetadataName: "metadataName", + HybridIdentityMetadataName: "hybridIdentityMetadataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/metadataName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/hybridIdentityMetadataName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHybridIdentityMetadataIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/metadataName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/hybridIdentityMetadataName", Expected: &HybridIdentityMetadataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MachineName: "machineName", - HybridIdentityMetadataName: "metadataName", + HybridIdentityMetadataName: "hybridIdentityMetadataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/metadataName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/machines/machineName/hybridIdentityMetadata/hybridIdentityMetadataName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/mAcHiNeS/mAcHiNeNaMe/hYbRiDiDeNtItYmEtAdAtA/mEtAdAtAnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/mAcHiNeS/mAcHiNeNaMe/hYbRiDiDeNtItYmEtAdAtA/hYbRiDiDeNtItYmEtAdAtAnAmE", Expected: &HybridIdentityMetadataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MachineName: "mAcHiNeNaMe", - HybridIdentityMetadataName: "mEtAdAtAnAmE", + HybridIdentityMetadataName: "hYbRiDiDeNtItYmEtAdAtAnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/mAcHiNeS/mAcHiNeNaMe/hYbRiDiDeNtItYmEtAdAtA/mEtAdAtAnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/mAcHiNeS/mAcHiNeNaMe/hYbRiDiDeNtItYmEtAdAtA/hYbRiDiDeNtItYmEtAdAtAnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/machineextensions/model_machineextensionproperties.go b/resource-manager/hybridcompute/2024-05-20-preview/machineextensions/model_machineextensionproperties.go index d8f4dd106ea..6a42b8991a1 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/machineextensions/model_machineextensionproperties.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/machineextensions/model_machineextensionproperties.go @@ -8,10 +8,10 @@ type MachineExtensionProperties struct { EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` InstanceView *MachineExtensionInstanceView `json:"instanceView,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/machineextensions/model_machineextensionupdateproperties.go b/resource-manager/hybridcompute/2024-05-20-preview/machineextensions/model_machineextensionupdateproperties.go index d8a1ee28b65..9d7d54fd6cc 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/machineextensions/model_machineextensionupdateproperties.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/machineextensions/model_machineextensionupdateproperties.go @@ -4,12 +4,12 @@ package machineextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type MachineExtensionUpdateProperties struct { - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` - Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` - Type *string `json:"type,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` + Publisher *string `json:"publisher,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` + Type *string `json:"type,omitempty"` + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/machines/model_agentconfiguration.go b/resource-manager/hybridcompute/2024-05-20-preview/machines/model_agentconfiguration.go index 705bcf8d415..78597915af9 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/machines/model_agentconfiguration.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/machines/model_agentconfiguration.go @@ -11,5 +11,5 @@ type AgentConfiguration struct { GuestConfigurationEnabled *string `json:"guestConfigurationEnabled,omitempty"` IncomingConnectionsPorts *[]string `json:"incomingConnectionsPorts,omitempty"` ProxyBypass *[]string `json:"proxyBypass,omitempty"` - ProxyUrl *string `json:"proxyUrl,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/machines/model_machineextensionproperties.go b/resource-manager/hybridcompute/2024-05-20-preview/machines/model_machineextensionproperties.go index 40a2c5bd9b3..afad01914ce 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/machines/model_machineextensionproperties.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/machines/model_machineextensionproperties.go @@ -8,10 +8,10 @@ type MachineExtensionProperties struct { EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` InstanceView *MachineExtensionInstanceView `json:"instanceView,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/README.md b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/README.md index eeb2a43ea54..e7c24e172a0 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/README.md +++ b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := networksecurityperimeterconfiguration.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "perimeterName") +id := networksecurityperimeterconfiguration.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "networkSecurityPerimeterConfigurationName") read, err := client.GetByPrivateLinkScope(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networksecurityperimeterconfiguration.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := networksecurityperimeterconfiguration.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networksecurityperimeterconfiguration.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "perimeterName") +id := networksecurityperimeterconfiguration.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "networkSecurityPerimeterConfigurationName") if err := client.ReconcileForPrivateLinkScopeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration.go b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration.go index 5b975b5768a..83f3c08f2f6 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration.go @@ -121,9 +121,9 @@ func (id NetworkSecurityPerimeterConfigurationId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), - resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "perimeterName"), + resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration_test.go b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration_test.go index f29ff035f4f..75c113e7a3e 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkSecurityPerimeterConfigurationId{} func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "perimeterName") + id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "networkSecurityPerimeterConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.NetworkSecurityPerimeterConfigurationName != "perimeterName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "perimeterName") + if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "networkSecurityPerimeterConfigurationName") } } func TestFormatNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "perimeterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName" + actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - NetworkSecurityPerimeterConfigurationName: "perimeterName", + PrivateLinkScopeName: "privateLinkScopeName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkSecurityPerimeterConfigurationIDInsensitively(t *testing.T) }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - NetworkSecurityPerimeterConfigurationName: "perimeterName", + PrivateLinkScopeName: "privateLinkScopeName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/pErImEtErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - NetworkSecurityPerimeterConfigurationName: "pErImEtErNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/pErImEtErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_providerprivatelinkscope.go index b2d002c57ba..3df939df2bd 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_providerprivatelinkscope_test.go index f27ce6cc9eb..28d08ae5ccf 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/networksecurityperimeterconfiguration/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/README.md b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/README.md index 570ba5d8ae2..ce189dc2a67 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/README.md +++ b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privateendpointconnections.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_privateendpointconnection.go index ddb5472edd7..48f7cbc1068 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_privateendpointconnection_test.go index 92279f4ba1b..25064b5ca1e 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_providerprivatelinkscope.go index 46d0b8c6ba9..e65e13354bc 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_providerprivatelinkscope_test.go index aff23a7a735..bf57b72fb1d 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privateendpointconnections/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/README.md b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/README.md index 54a40077eb5..6e22e332fef 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/README.md +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkresources.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_privatelinkresource.go b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_privatelinkresource.go index 4b5f29de857..bc340a22775 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_privatelinkresource_test.go index cc189d85994..43a8b6e7d3a 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_providerprivatelinkscope.go index a81baeadabd..f21dc62c87e 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_providerprivatelinkscope_test.go index 0e67a7f985a..b2da5008a8c 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkresources/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/README.md b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/README.md index 3c2f93abc2c..7bae9c36f98 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/README.md +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopes.HybridComputePrivateLinkScope{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId") +id := privatelinkscopes.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId") read, err := client.GetValidationDetails(ctx, id) if err != nil { @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopes.TagsResource{ // ... diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_privatelinkscope.go b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_privatelinkscope.go index df45f21ff44..a2a5feb8bb6 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_privatelinkscope.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_privatelinkscope.go @@ -113,7 +113,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), resourceids.UserSpecifiedSegment("privateLinkScopeId", "privateLinkScopeId"), } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_privatelinkscope_test.go b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_privatelinkscope_test.go index 20bbb80e2c9..9a5f850d2bf 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_privatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_privatelinkscope_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PrivateLinkScopeId != "privateLinkScopeId" { @@ -28,8 +28,8 @@ func TestNewPrivateLinkScopeID(t *testing.T) { } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PrivateLinkScopeId: "privateLinkScopeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PrivateLinkScopeId: "privateLinkScopeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PrivateLinkScopeId: "pRiVaTeLiNkScOpEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_providerprivatelinkscope.go index e088291c056..33c545a7749 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_providerprivatelinkscope_test.go index fe6f5677a76..1ebda450104 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/privatelinkscopes/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/settings/README.md b/resource-manager/hybridcompute/2024-05-20-preview/settings/README.md index 1c23369333a..edf473de1e7 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/settings/README.md +++ b/resource-manager/hybridcompute/2024-05-20-preview/settings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := settings.NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingsResourceName") +id := settings.NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := settings.NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingsResourceName") +id := settings.NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingName") payload := settings.Settings{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := settings.NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingsResourceName") +id := settings.NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingName") payload := settings.Settings{ // ... diff --git a/resource-manager/hybridcompute/2024-05-20-preview/settings/id_scopedsetting.go b/resource-manager/hybridcompute/2024-05-20-preview/settings/id_scopedsetting.go index 8ebc1d1fef6..ede13e743a3 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/settings/id_scopedsetting.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/settings/id_scopedsetting.go @@ -106,7 +106,7 @@ func (id ScopedSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticSettings", "settings", "settings"), - resourceids.UserSpecifiedSegment("settingName", "settingsResourceName"), + resourceids.UserSpecifiedSegment("settingName", "settingName"), } } diff --git a/resource-manager/hybridcompute/2024-05-20-preview/settings/id_scopedsetting_test.go b/resource-manager/hybridcompute/2024-05-20-preview/settings/id_scopedsetting_test.go index a9155b86e88..33e3425e2f3 100644 --- a/resource-manager/hybridcompute/2024-05-20-preview/settings/id_scopedsetting_test.go +++ b/resource-manager/hybridcompute/2024-05-20-preview/settings/id_scopedsetting_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedSettingId{} func TestNewScopedSettingID(t *testing.T) { - id := NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingsResourceName") + id := NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.SettingName != "settingsResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SettingName'", id.SettingName, "settingsResourceName") + if id.SettingName != "settingName" { + t.Fatalf("Expected %q but got %q for Segment 'SettingName'", id.SettingName, "settingName") } } func TestFormatScopedSettingID(t *testing.T) { - actual := NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingsResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingsResourceName" + actual := NewScopedSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "settingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingName", Expected: &ScopedSettingId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - SettingName: "settingsResourceName", + SettingName: "settingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingName", Expected: &ScopedSettingId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - SettingName: "settingsResourceName", + SettingName: "settingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.HybridCompute/settings/settingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/sEtTiNgS/sEtTiNgSrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/sEtTiNgS/sEtTiNgNaMe", Expected: &ScopedSettingId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - SettingName: "sEtTiNgSrEsOuRcEnAmE", + SettingName: "sEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/sEtTiNgS/sEtTiNgSrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/sEtTiNgS/sEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/extensions/README.md b/resource-manager/hybridcompute/2024-07-10/extensions/README.md index ad0d931cdc8..ffe16dec422 100644 --- a/resource-manager/hybridcompute/2024-07-10/extensions/README.md +++ b/resource-manager/hybridcompute/2024-07-10/extensions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := extensions.NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version") +id := extensions.NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName") read, err := client.ExtensionMetadataGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := extensions.NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType") +id := extensions.NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName") read, err := client.ExtensionMetadataList(ctx, id) if err != nil { diff --git a/resource-manager/hybridcompute/2024-07-10/extensions/id_extensiontype.go b/resource-manager/hybridcompute/2024-07-10/extensions/id_extensiontype.go index 909461da4ec..ea8817db72b 100644 --- a/resource-manager/hybridcompute/2024-07-10/extensions/id_extensiontype.go +++ b/resource-manager/hybridcompute/2024-07-10/extensions/id_extensiontype.go @@ -119,11 +119,11 @@ func (id ExtensionTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisher"), + resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticExtensionTypes", "extensionTypes", "extensionTypes"), - resourceids.UserSpecifiedSegment("extensionTypeName", "extensionType"), + resourceids.UserSpecifiedSegment("extensionTypeName", "extensionTypeName"), } } diff --git a/resource-manager/hybridcompute/2024-07-10/extensions/id_extensiontype_test.go b/resource-manager/hybridcompute/2024-07-10/extensions/id_extensiontype_test.go index 1cc6c55f319..be079b7667f 100644 --- a/resource-manager/hybridcompute/2024-07-10/extensions/id_extensiontype_test.go +++ b/resource-manager/hybridcompute/2024-07-10/extensions/id_extensiontype_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &ExtensionTypeId{} func TestNewExtensionTypeID(t *testing.T) { - id := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType") + id := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.PublisherName != "publisher" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisher") + if id.PublisherName != "publisherName" { + t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.ExtensionTypeName != "extensionType" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionType") + if id.ExtensionTypeName != "extensionTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionTypeName") } } func TestFormatExtensionTypeID(t *testing.T) { - actual := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType" + actual := NewExtensionTypeID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseExtensionTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseExtensionTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe", Expected: &ExtensionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - PublisherName: "pUbLiShEr", - ExtensionTypeName: "eXtEnSiOnTyPe", + LocationName: "lOcAtIoNnAmE", + PublisherName: "pUbLiShErNaMe", + ExtensionTypeName: "eXtEnSiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/extensions/id_version.go b/resource-manager/hybridcompute/2024-07-10/extensions/id_version.go index 28dda5dc912..6f0e20e8d52 100644 --- a/resource-manager/hybridcompute/2024-07-10/extensions/id_version.go +++ b/resource-manager/hybridcompute/2024-07-10/extensions/id_version.go @@ -125,13 +125,13 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisher"), + resourceids.UserSpecifiedSegment("publisherName", "publisherName"), resourceids.StaticSegment("staticExtensionTypes", "extensionTypes", "extensionTypes"), - resourceids.UserSpecifiedSegment("extensionTypeName", "extensionType"), + resourceids.UserSpecifiedSegment("extensionTypeName", "extensionTypeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/hybridcompute/2024-07-10/extensions/id_version_test.go b/resource-manager/hybridcompute/2024-07-10/extensions/id_version_test.go index 907807453e2..4e52de8e82d 100644 --- a/resource-manager/hybridcompute/2024-07-10/extensions/id_version_test.go +++ b/resource-manager/hybridcompute/2024-07-10/extensions/id_version_test.go @@ -12,32 +12,32 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.PublisherName != "publisher" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisher") + if id.PublisherName != "publisherName" { + t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherName") } - if id.ExtensionTypeName != "extensionType" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionType") + if id.ExtensionTypeName != "extensionTypeName" { + t.Fatalf("Expected %q but got %q for Segment 'ExtensionTypeName'", id.ExtensionTypeName, "extensionTypeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "location", "publisher", "extensionType", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "locationName", "publisherName", "extensionTypeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -81,48 +81,48 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", - VersionName: "version", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName/extra", Error: true, }, } @@ -227,94 +227,94 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - PublisherName: "publisher", - ExtensionTypeName: "extensionType", - VersionName: "version", + LocationName: "locationName", + PublisherName: "publisherName", + ExtensionTypeName: "extensionTypeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/publishers/publisher/extensionTypes/extensionType/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/publishers/publisherName/extensionTypes/extensionTypeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - PublisherName: "pUbLiShEr", - ExtensionTypeName: "eXtEnSiOnTyPe", - VersionName: "vErSiOn", + LocationName: "lOcAtIoNnAmE", + PublisherName: "pUbLiShErNaMe", + ExtensionTypeName: "eXtEnSiOnTyPeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pUbLiShErS/pUbLiShEr/eXtEnSiOnTyPeS/eXtEnSiOnTyPe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pUbLiShErS/pUbLiShErNaMe/eXtEnSiOnTyPeS/eXtEnSiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/machineextensions/model_machineextensionproperties.go b/resource-manager/hybridcompute/2024-07-10/machineextensions/model_machineextensionproperties.go index d8f4dd106ea..6a42b8991a1 100644 --- a/resource-manager/hybridcompute/2024-07-10/machineextensions/model_machineextensionproperties.go +++ b/resource-manager/hybridcompute/2024-07-10/machineextensions/model_machineextensionproperties.go @@ -8,10 +8,10 @@ type MachineExtensionProperties struct { EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` InstanceView *MachineExtensionInstanceView `json:"instanceView,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2024-07-10/machineextensions/model_machineextensionupdateproperties.go b/resource-manager/hybridcompute/2024-07-10/machineextensions/model_machineextensionupdateproperties.go index d8a1ee28b65..9d7d54fd6cc 100644 --- a/resource-manager/hybridcompute/2024-07-10/machineextensions/model_machineextensionupdateproperties.go +++ b/resource-manager/hybridcompute/2024-07-10/machineextensions/model_machineextensionupdateproperties.go @@ -4,12 +4,12 @@ package machineextensions // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type MachineExtensionUpdateProperties struct { - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` - Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` - Type *string `json:"type,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` + Publisher *string `json:"publisher,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` + Type *string `json:"type,omitempty"` + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2024-07-10/machines/model_agentconfiguration.go b/resource-manager/hybridcompute/2024-07-10/machines/model_agentconfiguration.go index 705bcf8d415..78597915af9 100644 --- a/resource-manager/hybridcompute/2024-07-10/machines/model_agentconfiguration.go +++ b/resource-manager/hybridcompute/2024-07-10/machines/model_agentconfiguration.go @@ -11,5 +11,5 @@ type AgentConfiguration struct { GuestConfigurationEnabled *string `json:"guestConfigurationEnabled,omitempty"` IncomingConnectionsPorts *[]string `json:"incomingConnectionsPorts,omitempty"` ProxyBypass *[]string `json:"proxyBypass,omitempty"` - ProxyUrl *string `json:"proxyUrl,omitempty"` + ProxyURL *string `json:"proxyUrl,omitempty"` } diff --git a/resource-manager/hybridcompute/2024-07-10/machines/model_machineextensionproperties.go b/resource-manager/hybridcompute/2024-07-10/machines/model_machineextensionproperties.go index 40a2c5bd9b3..afad01914ce 100644 --- a/resource-manager/hybridcompute/2024-07-10/machines/model_machineextensionproperties.go +++ b/resource-manager/hybridcompute/2024-07-10/machines/model_machineextensionproperties.go @@ -8,10 +8,10 @@ type MachineExtensionProperties struct { EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` InstanceView *MachineExtensionInstanceView `json:"instanceView,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` + ProtectedSettings *map[string]interface{} `json:"protectedSettings,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` + Settings *map[string]interface{} `json:"settings,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` } diff --git a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/README.md b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/README.md index b13fc53718f..4b5d17e96d5 100644 --- a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/README.md +++ b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := networksecurityperimeterconfiguration.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "perimeterName") +id := networksecurityperimeterconfiguration.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "networkSecurityPerimeterConfigurationName") read, err := client.GetByPrivateLinkScope(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networksecurityperimeterconfiguration.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := networksecurityperimeterconfiguration.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networksecurityperimeterconfiguration.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "perimeterName") +id := networksecurityperimeterconfiguration.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "networkSecurityPerimeterConfigurationName") if err := client.ReconcileForPrivateLinkScopeThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration.go b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration.go index 5b975b5768a..83f3c08f2f6 100644 --- a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration.go +++ b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration.go @@ -121,9 +121,9 @@ func (id NetworkSecurityPerimeterConfigurationId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), - resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "perimeterName"), + resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } } diff --git a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration_test.go b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration_test.go index f29ff035f4f..75c113e7a3e 100644 --- a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration_test.go +++ b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_networksecurityperimeterconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkSecurityPerimeterConfigurationId{} func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "perimeterName") + id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "networkSecurityPerimeterConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.NetworkSecurityPerimeterConfigurationName != "perimeterName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "perimeterName") + if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "networkSecurityPerimeterConfigurationName") } } func TestFormatNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "perimeterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName" + actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - NetworkSecurityPerimeterConfigurationName: "perimeterName", + PrivateLinkScopeName: "privateLinkScopeName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkSecurityPerimeterConfigurationIDInsensitively(t *testing.T) }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - NetworkSecurityPerimeterConfigurationName: "perimeterName", + PrivateLinkScopeName: "privateLinkScopeName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/networkSecurityPerimeterConfigurations/perimeterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/pErImEtErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - NetworkSecurityPerimeterConfigurationName: "pErImEtErNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/pErImEtErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_providerprivatelinkscope.go index b2d002c57ba..3df939df2bd 100644 --- a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_providerprivatelinkscope_test.go index f27ce6cc9eb..28d08ae5ccf 100644 --- a/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-07-10/networksecurityperimeterconfiguration/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/README.md b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/README.md index 4a1473ec596..02240544bf5 100644 --- a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/README.md +++ b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privateendpointconnections.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_privateendpointconnection.go index ddb5472edd7..48f7cbc1068 100644 --- a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_privateendpointconnection_test.go index 92279f4ba1b..25064b5ca1e 100644 --- a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_providerprivatelinkscope.go index 46d0b8c6ba9..e65e13354bc 100644 --- a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_providerprivatelinkscope_test.go index aff23a7a735..bf57b72fb1d 100644 --- a/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-07-10/privateendpointconnections/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/README.md b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/README.md index eed0baa024f..57232b4d2ed 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/README.md +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkresources.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_privatelinkresource.go b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_privatelinkresource.go index 4b5f29de857..bc340a22775 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_privatelinkresource_test.go index cc189d85994..43a8b6e7d3a 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_providerprivatelinkscope.go index a81baeadabd..f21dc62c87e 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_providerprivatelinkscope_test.go index 0e67a7f985a..b2da5008a8c 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkresources/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/README.md b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/README.md index bb6b4af1c28..c0dd1045edf 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/README.md +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopes.HybridComputePrivateLinkScope{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopes.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId") +id := privatelinkscopes.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId") read, err := client.GetValidationDetails(ctx, id) if err != nil { @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopes.NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopes.TagsResource{ // ... diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_privatelinkscope.go b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_privatelinkscope.go index df45f21ff44..a2a5feb8bb6 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_privatelinkscope.go +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_privatelinkscope.go @@ -113,7 +113,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), resourceids.UserSpecifiedSegment("privateLinkScopeId", "privateLinkScopeId"), } diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_privatelinkscope_test.go b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_privatelinkscope_test.go index 20bbb80e2c9..9a5f850d2bf 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_privatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_privatelinkscope_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.PrivateLinkScopeId != "privateLinkScopeId" { @@ -28,8 +28,8 @@ func TestNewPrivateLinkScopeID(t *testing.T) { } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "location", "privateLinkScopeId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "locationName", "privateLinkScopeId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PrivateLinkScopeId: "privateLinkScopeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", PrivateLinkScopeId: "privateLinkScopeId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/location/privateLinkScopes/privateLinkScopeId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HybridCompute/locations/locationName/privateLinkScopes/privateLinkScopeId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", PrivateLinkScopeId: "pRiVaTeLiNkScOpEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoN/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/lOcAtIoNs/lOcAtIoNnAmE/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEiD/extra", Error: true, }, } diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_providerprivatelinkscope.go b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_providerprivatelinkscope.go index e088291c056..33c545a7749 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_providerprivatelinkscope.go +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_providerprivatelinkscope.go @@ -115,7 +115,7 @@ func (id ProviderPrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftHybridCompute", "Microsoft.HybridCompute", "Microsoft.HybridCompute"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_providerprivatelinkscope_test.go b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_providerprivatelinkscope_test.go index fe6f5677a76..1ebda450104 100644 --- a/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_providerprivatelinkscope_test.go +++ b/resource-manager/hybridcompute/2024-07-10/privatelinkscopes/id_providerprivatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderPrivateLinkScopeId{} func TestNewProviderPrivateLinkScopeID(t *testing.T) { - id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatProviderPrivateLinkScopeID(t *testing.T) { - actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName" + actual := NewProviderPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderPrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderPrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &ProviderPrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hYbRiDcOmPuTe/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/README.md b/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/README.md index 2b30feee849..fe664702cf1 100644 --- a/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/README.md +++ b/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") payload := connectedclusters.ConnectedCluster{ // ... @@ -42,7 +42,7 @@ if err := client.ConnectedClusterCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") if err := client.ConnectedClusterDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.ConnectedClusterDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") read, err := client.ConnectedClusterGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") payload := connectedclusters.ListClusterUserCredentialProperties{ // ... @@ -125,7 +125,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") payload := connectedclusters.ConnectedClusterPatch{ // ... diff --git a/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/id_connectedcluster.go b/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/id_connectedcluster.go index 207ac777a3a..b16e5c6f345 100644 --- a/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/id_connectedcluster.go +++ b/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/id_connectedcluster.go @@ -115,7 +115,7 @@ func (id ConnectedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKubernetes", "Microsoft.Kubernetes", "Microsoft.Kubernetes"), resourceids.StaticSegment("staticConnectedClusters", "connectedClusters", "connectedClusters"), - resourceids.UserSpecifiedSegment("connectedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("connectedClusterName", "connectedClusterName"), } } diff --git a/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/id_connectedcluster_test.go b/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/id_connectedcluster_test.go index 80380adaf45..d09382086e2 100644 --- a/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/id_connectedcluster_test.go +++ b/resource-manager/hybridkubernetes/2021-10-01/connectedclusters/id_connectedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectedClusterId{} func TestNewConnectedClusterID(t *testing.T) { - id := NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectedClusterName'", id.ConnectedClusterName, "clusterName") + if id.ConnectedClusterName != "connectedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectedClusterName'", id.ConnectedClusterName, "connectedClusterName") } } func TestFormatConnectedClusterID(t *testing.T) { - actual := NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName" + actual := NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName", Expected: &ConnectedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectedClusterName: "clusterName", + ConnectedClusterName: "connectedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName", Expected: &ConnectedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectedClusterName: "clusterName", + ConnectedClusterName: "connectedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kUbErNeTeS/cOnNeCtEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kUbErNeTeS/cOnNeCtEdClUsTeRs/cOnNeCtEdClUsTeRnAmE", Expected: &ConnectedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectedClusterName: "cLuStErNaMe", + ConnectedClusterName: "cOnNeCtEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kUbErNeTeS/cOnNeCtEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kUbErNeTeS/cOnNeCtEdClUsTeRs/cOnNeCtEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/README.md b/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/README.md index 0bb1e64d3bc..b7a618c5979 100644 --- a/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/README.md +++ b/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") payload := connectedclusters.ConnectedCluster{ // ... @@ -42,7 +42,7 @@ if err := client.ConnectedClusterCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") if err := client.ConnectedClusterDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.ConnectedClusterDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") read, err := client.ConnectedClusterGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") payload := connectedclusters.ListClusterUserCredentialProperties{ // ... @@ -125,7 +125,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := connectedclusters.NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") payload := connectedclusters.ConnectedClusterPatch{ // ... diff --git a/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/id_connectedcluster.go b/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/id_connectedcluster.go index 207ac777a3a..b16e5c6f345 100644 --- a/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/id_connectedcluster.go +++ b/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/id_connectedcluster.go @@ -115,7 +115,7 @@ func (id ConnectedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKubernetes", "Microsoft.Kubernetes", "Microsoft.Kubernetes"), resourceids.StaticSegment("staticConnectedClusters", "connectedClusters", "connectedClusters"), - resourceids.UserSpecifiedSegment("connectedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("connectedClusterName", "connectedClusterName"), } } diff --git a/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/id_connectedcluster_test.go b/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/id_connectedcluster_test.go index 80380adaf45..d09382086e2 100644 --- a/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/id_connectedcluster_test.go +++ b/resource-manager/hybridkubernetes/2024-01-01/connectedclusters/id_connectedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectedClusterId{} func TestNewConnectedClusterID(t *testing.T) { - id := NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectedClusterName'", id.ConnectedClusterName, "clusterName") + if id.ConnectedClusterName != "connectedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectedClusterName'", id.ConnectedClusterName, "connectedClusterName") } } func TestFormatConnectedClusterID(t *testing.T) { - actual := NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName" + actual := NewConnectedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName", Expected: &ConnectedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectedClusterName: "clusterName", + ConnectedClusterName: "connectedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName", Expected: &ConnectedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectedClusterName: "clusterName", + ConnectedClusterName: "connectedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Kubernetes/connectedClusters/connectedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kUbErNeTeS/cOnNeCtEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kUbErNeTeS/cOnNeCtEdClUsTeRs/cOnNeCtEdClUsTeRnAmE", Expected: &ConnectedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectedClusterName: "cLuStErNaMe", + ConnectedClusterName: "cOnNeCtEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kUbErNeTeS/cOnNeCtEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kUbErNeTeS/cOnNeCtEdClUsTeRs/cOnNeCtEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/informatica/2024-05-08/organizations/model_informaticaproperties.go b/resource-manager/informatica/2024-05-08/organizations/model_informaticaproperties.go index 0f60512becf..0d36be0cb14 100644 --- a/resource-manager/informatica/2024-05-08/organizations/model_informaticaproperties.go +++ b/resource-manager/informatica/2024-05-08/organizations/model_informaticaproperties.go @@ -7,5 +7,5 @@ type InformaticaProperties struct { InformaticaRegion *string `json:"informaticaRegion,omitempty"` OrganizationId *string `json:"organizationId,omitempty"` OrganizationName *string `json:"organizationName,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/insights/2015-04-01/autoscaleapis/README.md b/resource-manager/insights/2015-04-01/autoscaleapis/README.md index 964f508402a..3d690f24b86 100644 --- a/resource-manager/insights/2015-04-01/autoscaleapis/README.md +++ b/resource-manager/insights/2015-04-01/autoscaleapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autoscaleapis.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscaleapis.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") payload := autoscaleapis.AutoscaleSettingResourcePatch{ // ... diff --git a/resource-manager/insights/2015-04-01/autoscaleapis/id_autoscalesetting.go b/resource-manager/insights/2015-04-01/autoscaleapis/id_autoscalesetting.go index dadccd226d0..201d4a4f19b 100644 --- a/resource-manager/insights/2015-04-01/autoscaleapis/id_autoscalesetting.go +++ b/resource-manager/insights/2015-04-01/autoscaleapis/id_autoscalesetting.go @@ -115,7 +115,7 @@ func (id AutoScaleSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAutoScaleSettings", "autoScaleSettings", "autoScaleSettings"), - resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoscaleSettingName"), + resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoScaleSettingName"), } } diff --git a/resource-manager/insights/2015-04-01/autoscaleapis/id_autoscalesetting_test.go b/resource-manager/insights/2015-04-01/autoscaleapis/id_autoscalesetting_test.go index f714cbdfeda..25bd14e2426 100644 --- a/resource-manager/insights/2015-04-01/autoscaleapis/id_autoscalesetting_test.go +++ b/resource-manager/insights/2015-04-01/autoscaleapis/id_autoscalesetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleSettingId{} func TestNewAutoScaleSettingID(t *testing.T) { - id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") + id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleSettingName != "autoscaleSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoscaleSettingName") + if id.AutoScaleSettingName != "autoScaleSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoScaleSettingName") } } func TestFormatAutoScaleSettingID(t *testing.T) { - actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName" + actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutoScaleSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, { diff --git a/resource-manager/insights/2015-04-01/autoscalesettings/README.md b/resource-manager/insights/2015-04-01/autoscalesettings/README.md index 0014ce91f97..b0366927039 100644 --- a/resource-manager/insights/2015-04-01/autoscalesettings/README.md +++ b/resource-manager/insights/2015-04-01/autoscalesettings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") payload := autoscalesettings.AutoscaleSettingResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/insights/2015-04-01/autoscalesettings/id_autoscalesetting.go b/resource-manager/insights/2015-04-01/autoscalesettings/id_autoscalesetting.go index 21e4f4101f4..567bed689c6 100644 --- a/resource-manager/insights/2015-04-01/autoscalesettings/id_autoscalesetting.go +++ b/resource-manager/insights/2015-04-01/autoscalesettings/id_autoscalesetting.go @@ -115,7 +115,7 @@ func (id AutoScaleSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAutoScaleSettings", "autoScaleSettings", "autoScaleSettings"), - resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoscaleSettingName"), + resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoScaleSettingName"), } } diff --git a/resource-manager/insights/2015-04-01/autoscalesettings/id_autoscalesetting_test.go b/resource-manager/insights/2015-04-01/autoscalesettings/id_autoscalesetting_test.go index 4f4cd460fec..0b21d3cfcb3 100644 --- a/resource-manager/insights/2015-04-01/autoscalesettings/id_autoscalesetting_test.go +++ b/resource-manager/insights/2015-04-01/autoscalesettings/id_autoscalesetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleSettingId{} func TestNewAutoScaleSettingID(t *testing.T) { - id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") + id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleSettingName != "autoscaleSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoscaleSettingName") + if id.AutoScaleSettingName != "autoScaleSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoScaleSettingName") } } func TestFormatAutoScaleSettingID(t *testing.T) { - actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName" + actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutoScaleSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, { diff --git a/resource-manager/insights/2016-03-01/alertruleincidents/README.md b/resource-manager/insights/2016-03-01/alertruleincidents/README.md index 40bf04553fa..b1be2e3dfbd 100644 --- a/resource-manager/insights/2016-03-01/alertruleincidents/README.md +++ b/resource-manager/insights/2016-03-01/alertruleincidents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := alertruleincidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName", "incidentName") +id := alertruleincidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName", "incidentName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alertruleincidents.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := alertruleincidents.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") read, err := client.ListByAlertRule(ctx, id) if err != nil { diff --git a/resource-manager/insights/2016-03-01/alertruleincidents/id_alertrule.go b/resource-manager/insights/2016-03-01/alertruleincidents/id_alertrule.go index dba0829448c..a70f1599396 100644 --- a/resource-manager/insights/2016-03-01/alertruleincidents/id_alertrule.go +++ b/resource-manager/insights/2016-03-01/alertruleincidents/id_alertrule.go @@ -115,7 +115,7 @@ func (id AlertRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("alertRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("alertRuleName", "alertRuleName"), } } diff --git a/resource-manager/insights/2016-03-01/alertruleincidents/id_alertrule_test.go b/resource-manager/insights/2016-03-01/alertruleincidents/id_alertrule_test.go index cb6d04293e3..d3a3fc52891 100644 --- a/resource-manager/insights/2016-03-01/alertruleincidents/id_alertrule_test.go +++ b/resource-manager/insights/2016-03-01/alertruleincidents/id_alertrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AlertRuleId{} func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") + id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAlertRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AlertRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'AlertRuleName'", id.AlertRuleName, "ruleName") + if id.AlertRuleName != "alertRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'AlertRuleName'", id.AlertRuleName, "alertRuleName") } } func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName" + actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAlertRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AlertRuleName: "ruleName", + AlertRuleName: "alertRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAlertRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AlertRuleName: "ruleName", + AlertRuleName: "alertRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AlertRuleName: "rUlEnAmE", + AlertRuleName: "aLeRtRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2016-03-01/alertruleincidents/id_incident.go b/resource-manager/insights/2016-03-01/alertruleincidents/id_incident.go index cb8cda8677e..15b3c00e495 100644 --- a/resource-manager/insights/2016-03-01/alertruleincidents/id_incident.go +++ b/resource-manager/insights/2016-03-01/alertruleincidents/id_incident.go @@ -121,7 +121,7 @@ func (id IncidentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("alertRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("alertRuleName", "alertRuleName"), resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), resourceids.UserSpecifiedSegment("incidentName", "incidentName"), } diff --git a/resource-manager/insights/2016-03-01/alertruleincidents/id_incident_test.go b/resource-manager/insights/2016-03-01/alertruleincidents/id_incident_test.go index 6f50deb503b..2a21f7a9d50 100644 --- a/resource-manager/insights/2016-03-01/alertruleincidents/id_incident_test.go +++ b/resource-manager/insights/2016-03-01/alertruleincidents/id_incident_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IncidentId{} func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName", "incidentName") + id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName", "incidentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewIncidentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AlertRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'AlertRuleName'", id.AlertRuleName, "ruleName") + if id.AlertRuleName != "alertRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'AlertRuleName'", id.AlertRuleName, "alertRuleName") } if id.IncidentName != "incidentName" { @@ -32,8 +32,8 @@ func TestNewIncidentID(t *testing.T) { } func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName", "incidentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/incidents/incidentName" + actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName", "incidentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/incidents/incidentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseIncidentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/incidents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/incidents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/incidents/incidentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/incidents/incidentName", Expected: &IncidentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AlertRuleName: "ruleName", + AlertRuleName: "alertRuleName", IncidentName: "incidentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/incidents/incidentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/incidents/incidentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseIncidentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/incidents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/incidents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE/iNcIdEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe/iNcIdEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/incidents/incidentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/incidents/incidentName", Expected: &IncidentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AlertRuleName: "ruleName", + AlertRuleName: "alertRuleName", IncidentName: "incidentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/incidents/incidentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/incidents/incidentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE/iNcIdEnTs/iNcIdEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe/iNcIdEnTs/iNcIdEnTnAmE", Expected: &IncidentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AlertRuleName: "rUlEnAmE", + AlertRuleName: "aLeRtRuLeNaMe", IncidentName: "iNcIdEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE/iNcIdEnTs/iNcIdEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe/iNcIdEnTs/iNcIdEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2016-03-01/alertrules/README.md b/resource-manager/insights/2016-03-01/alertrules/README.md index 282fbc2f116..8a625e5e75c 100644 --- a/resource-manager/insights/2016-03-01/alertrules/README.md +++ b/resource-manager/insights/2016-03-01/alertrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") payload := alertrules.AlertRuleResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/insights/2016-03-01/alertrules/id_alertrule.go b/resource-manager/insights/2016-03-01/alertrules/id_alertrule.go index 77c4b16d5e0..b1906f29b79 100644 --- a/resource-manager/insights/2016-03-01/alertrules/id_alertrule.go +++ b/resource-manager/insights/2016-03-01/alertrules/id_alertrule.go @@ -115,7 +115,7 @@ func (id AlertRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("alertRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("alertRuleName", "alertRuleName"), } } diff --git a/resource-manager/insights/2016-03-01/alertrules/id_alertrule_test.go b/resource-manager/insights/2016-03-01/alertrules/id_alertrule_test.go index b314902aadc..4036916c473 100644 --- a/resource-manager/insights/2016-03-01/alertrules/id_alertrule_test.go +++ b/resource-manager/insights/2016-03-01/alertrules/id_alertrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AlertRuleId{} func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") + id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAlertRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AlertRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'AlertRuleName'", id.AlertRuleName, "ruleName") + if id.AlertRuleName != "alertRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'AlertRuleName'", id.AlertRuleName, "alertRuleName") } } func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName" + actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAlertRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AlertRuleName: "ruleName", + AlertRuleName: "alertRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAlertRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AlertRuleName: "ruleName", + AlertRuleName: "alertRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AlertRuleName: "rUlEnAmE", + AlertRuleName: "aLeRtRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2016-03-01/alertrulesapis/README.md b/resource-manager/insights/2016-03-01/alertrulesapis/README.md index b00ea175f8c..fd444dfe609 100644 --- a/resource-manager/insights/2016-03-01/alertrulesapis/README.md +++ b/resource-manager/insights/2016-03-01/alertrulesapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := alertrulesapis.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := alertrulesapis.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") payload := alertrulesapis.AlertRuleResourcePatch{ // ... diff --git a/resource-manager/insights/2016-03-01/alertrulesapis/id_alertrule.go b/resource-manager/insights/2016-03-01/alertrulesapis/id_alertrule.go index 76f9e5aa49f..2547dd4fdf5 100644 --- a/resource-manager/insights/2016-03-01/alertrulesapis/id_alertrule.go +++ b/resource-manager/insights/2016-03-01/alertrulesapis/id_alertrule.go @@ -115,7 +115,7 @@ func (id AlertRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("alertRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("alertRuleName", "alertRuleName"), } } diff --git a/resource-manager/insights/2016-03-01/alertrulesapis/id_alertrule_test.go b/resource-manager/insights/2016-03-01/alertrulesapis/id_alertrule_test.go index 2614012c755..1cc5d979a6b 100644 --- a/resource-manager/insights/2016-03-01/alertrulesapis/id_alertrule_test.go +++ b/resource-manager/insights/2016-03-01/alertrulesapis/id_alertrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AlertRuleId{} func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") + id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAlertRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AlertRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'AlertRuleName'", id.AlertRuleName, "ruleName") + if id.AlertRuleName != "alertRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'AlertRuleName'", id.AlertRuleName, "alertRuleName") } } func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName" + actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "alertRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAlertRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AlertRuleName: "ruleName", + AlertRuleName: "alertRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAlertRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AlertRuleName: "ruleName", + AlertRuleName: "alertRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/alertRules/alertRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe", Expected: &AlertRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AlertRuleName: "rUlEnAmE", + AlertRuleName: "aLeRtRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/aLeRtRuLeS/aLeRtRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2018-03-01/actiongroupsapis/model_azurefunctionreceiver.go b/resource-manager/insights/2018-03-01/actiongroupsapis/model_azurefunctionreceiver.go index 10f6aa64998..4307509b05f 100644 --- a/resource-manager/insights/2018-03-01/actiongroupsapis/model_azurefunctionreceiver.go +++ b/resource-manager/insights/2018-03-01/actiongroupsapis/model_azurefunctionreceiver.go @@ -6,6 +6,6 @@ package actiongroupsapis type AzureFunctionReceiver struct { FunctionAppResourceId string `json:"functionAppResourceId"` FunctionName string `json:"functionName"` - HTTPTriggerUrl string `json:"httpTriggerUrl"` + HTTPTriggerURL string `json:"httpTriggerUrl"` Name string `json:"name"` } diff --git a/resource-manager/insights/2018-03-01/actiongroupsapis/model_logicappreceiver.go b/resource-manager/insights/2018-03-01/actiongroupsapis/model_logicappreceiver.go index 87d97363ca2..1a41b96051d 100644 --- a/resource-manager/insights/2018-03-01/actiongroupsapis/model_logicappreceiver.go +++ b/resource-manager/insights/2018-03-01/actiongroupsapis/model_logicappreceiver.go @@ -4,7 +4,7 @@ package actiongroupsapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type LogicAppReceiver struct { - CallbackUrl string `json:"callbackUrl"` + CallbackURL string `json:"callbackUrl"` Name string `json:"name"` ResourceId string `json:"resourceId"` } diff --git a/resource-manager/insights/2018-03-01/metricalerts/README.md b/resource-manager/insights/2018-03-01/metricalerts/README.md index 7146b7a4676..a9b508d7bfd 100644 --- a/resource-manager/insights/2018-03-01/metricalerts/README.md +++ b/resource-manager/insights/2018-03-01/metricalerts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := metricalerts.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := metricalerts.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName") payload := metricalerts.MetricAlertResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := metricalerts.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := metricalerts.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := metricalerts.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := metricalerts.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName") read, err := client.Get(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := metricalerts.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := metricalerts.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName") payload := metricalerts.MetricAlertResourcePatch{ // ... diff --git a/resource-manager/insights/2018-03-01/metricalerts/id_metricalert.go b/resource-manager/insights/2018-03-01/metricalerts/id_metricalert.go index d0baa873c62..577fe15381a 100644 --- a/resource-manager/insights/2018-03-01/metricalerts/id_metricalert.go +++ b/resource-manager/insights/2018-03-01/metricalerts/id_metricalert.go @@ -115,7 +115,7 @@ func (id MetricAlertId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticMetricAlerts", "metricAlerts", "metricAlerts"), - resourceids.UserSpecifiedSegment("metricAlertName", "ruleName"), + resourceids.UserSpecifiedSegment("metricAlertName", "metricAlertName"), } } diff --git a/resource-manager/insights/2018-03-01/metricalerts/id_metricalert_test.go b/resource-manager/insights/2018-03-01/metricalerts/id_metricalert_test.go index 6ff9f5ce9c3..bd8ed55651a 100644 --- a/resource-manager/insights/2018-03-01/metricalerts/id_metricalert_test.go +++ b/resource-manager/insights/2018-03-01/metricalerts/id_metricalert_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MetricAlertId{} func TestNewMetricAlertID(t *testing.T) { - id := NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") + id := NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewMetricAlertID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MetricAlertName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'MetricAlertName'", id.MetricAlertName, "ruleName") + if id.MetricAlertName != "metricAlertName" { + t.Fatalf("Expected %q but got %q for Segment 'MetricAlertName'", id.MetricAlertName, "metricAlertName") } } func TestFormatMetricAlertID(t *testing.T) { - actual := NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName" + actual := NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseMetricAlertID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName", Expected: &MetricAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MetricAlertName: "ruleName", + MetricAlertName: "metricAlertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseMetricAlertIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName", Expected: &MetricAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MetricAlertName: "ruleName", + MetricAlertName: "metricAlertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/mEtRiCaLeRtNaMe", Expected: &MetricAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MetricAlertName: "rUlEnAmE", + MetricAlertName: "mEtRiCaLeRtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/mEtRiCaLeRtNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2018-03-01/metricalertsstatus/README.md b/resource-manager/insights/2018-03-01/metricalertsstatus/README.md index 246c46b1dca..96ba487ec13 100644 --- a/resource-manager/insights/2018-03-01/metricalertsstatus/README.md +++ b/resource-manager/insights/2018-03-01/metricalertsstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := metricalertsstatus.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := metricalertsstatus.NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName") read, err := client.List(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := metricalertsstatus.NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName", "statusName") +id := metricalertsstatus.NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName", "statusName") read, err := client.ListByName(ctx, id) if err != nil { diff --git a/resource-manager/insights/2018-03-01/metricalertsstatus/id_metricalert.go b/resource-manager/insights/2018-03-01/metricalertsstatus/id_metricalert.go index 91d5eadb13e..343260a5a6e 100644 --- a/resource-manager/insights/2018-03-01/metricalertsstatus/id_metricalert.go +++ b/resource-manager/insights/2018-03-01/metricalertsstatus/id_metricalert.go @@ -115,7 +115,7 @@ func (id MetricAlertId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticMetricAlerts", "metricAlerts", "metricAlerts"), - resourceids.UserSpecifiedSegment("metricAlertName", "ruleName"), + resourceids.UserSpecifiedSegment("metricAlertName", "metricAlertName"), } } diff --git a/resource-manager/insights/2018-03-01/metricalertsstatus/id_metricalert_test.go b/resource-manager/insights/2018-03-01/metricalertsstatus/id_metricalert_test.go index 7f442f30d1c..7fac8952aea 100644 --- a/resource-manager/insights/2018-03-01/metricalertsstatus/id_metricalert_test.go +++ b/resource-manager/insights/2018-03-01/metricalertsstatus/id_metricalert_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MetricAlertId{} func TestNewMetricAlertID(t *testing.T) { - id := NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") + id := NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewMetricAlertID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MetricAlertName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'MetricAlertName'", id.MetricAlertName, "ruleName") + if id.MetricAlertName != "metricAlertName" { + t.Fatalf("Expected %q but got %q for Segment 'MetricAlertName'", id.MetricAlertName, "metricAlertName") } } func TestFormatMetricAlertID(t *testing.T) { - actual := NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName" + actual := NewMetricAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseMetricAlertID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName", Expected: &MetricAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MetricAlertName: "ruleName", + MetricAlertName: "metricAlertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseMetricAlertIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName", Expected: &MetricAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MetricAlertName: "ruleName", + MetricAlertName: "metricAlertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/mEtRiCaLeRtNaMe", Expected: &MetricAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MetricAlertName: "rUlEnAmE", + MetricAlertName: "mEtRiCaLeRtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/mEtRiCaLeRtNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2018-03-01/metricalertsstatus/id_status.go b/resource-manager/insights/2018-03-01/metricalertsstatus/id_status.go index e05f5d8602f..5a877d1b0f0 100644 --- a/resource-manager/insights/2018-03-01/metricalertsstatus/id_status.go +++ b/resource-manager/insights/2018-03-01/metricalertsstatus/id_status.go @@ -121,7 +121,7 @@ func (id StatusId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticMetricAlerts", "metricAlerts", "metricAlerts"), - resourceids.UserSpecifiedSegment("metricAlertName", "ruleName"), + resourceids.UserSpecifiedSegment("metricAlertName", "metricAlertName"), resourceids.StaticSegment("staticStatus", "status", "status"), resourceids.UserSpecifiedSegment("statusName", "statusName"), } diff --git a/resource-manager/insights/2018-03-01/metricalertsstatus/id_status_test.go b/resource-manager/insights/2018-03-01/metricalertsstatus/id_status_test.go index 747b984e60a..43e475f616c 100644 --- a/resource-manager/insights/2018-03-01/metricalertsstatus/id_status_test.go +++ b/resource-manager/insights/2018-03-01/metricalertsstatus/id_status_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StatusId{} func TestNewStatusID(t *testing.T) { - id := NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName", "statusName") + id := NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName", "statusName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStatusID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MetricAlertName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'MetricAlertName'", id.MetricAlertName, "ruleName") + if id.MetricAlertName != "metricAlertName" { + t.Fatalf("Expected %q but got %q for Segment 'MetricAlertName'", id.MetricAlertName, "metricAlertName") } if id.StatusName != "statusName" { @@ -32,8 +32,8 @@ func TestNewStatusID(t *testing.T) { } func TestFormatStatusID(t *testing.T) { - actual := NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName", "statusName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/status/statusName" + actual := NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "metricAlertName", "statusName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/status/statusName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStatusID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/status", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/status", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/status/statusName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/status/statusName", Expected: &StatusId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MetricAlertName: "ruleName", + MetricAlertName: "metricAlertName", StatusName: "statusName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/status/statusName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/status/statusName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStatusIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/mEtRiCaLeRtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/status", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/status", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/rUlEnAmE/sTaTuS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/mEtRiCaLeRtNaMe/sTaTuS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/status/statusName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/status/statusName", Expected: &StatusId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MetricAlertName: "ruleName", + MetricAlertName: "metricAlertName", StatusName: "statusName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/ruleName/status/statusName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/metricAlerts/metricAlertName/status/statusName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/rUlEnAmE/sTaTuS/sTaTuSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/mEtRiCaLeRtNaMe/sTaTuS/sTaTuSnAmE", Expected: &StatusId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MetricAlertName: "rUlEnAmE", + MetricAlertName: "mEtRiCaLeRtNaMe", StatusName: "sTaTuSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/rUlEnAmE/sTaTuS/sTaTuSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/mEtRiCaLeRtS/mEtRiCaLeRtNaMe/sTaTuS/sTaTuSnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2018-04-16/scheduledqueryrules/README.md b/resource-manager/insights/2018-04-16/scheduledqueryrules/README.md index 2592286694b..a66ea76ba8f 100644 --- a/resource-manager/insights/2018-04-16/scheduledqueryrules/README.md +++ b/resource-manager/insights/2018-04-16/scheduledqueryrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") payload := scheduledqueryrules.LogSearchRuleResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") payload := scheduledqueryrules.LogSearchRuleResourcePatch{ // ... diff --git a/resource-manager/insights/2018-04-16/scheduledqueryrules/id_scheduledqueryrule.go b/resource-manager/insights/2018-04-16/scheduledqueryrules/id_scheduledqueryrule.go index 4d5479238c0..e06ff643137 100644 --- a/resource-manager/insights/2018-04-16/scheduledqueryrules/id_scheduledqueryrule.go +++ b/resource-manager/insights/2018-04-16/scheduledqueryrules/id_scheduledqueryrule.go @@ -115,7 +115,7 @@ func (id ScheduledQueryRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticScheduledQueryRules", "scheduledQueryRules", "scheduledQueryRules"), - resourceids.UserSpecifiedSegment("scheduledQueryRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("scheduledQueryRuleName", "scheduledQueryRuleName"), } } diff --git a/resource-manager/insights/2018-04-16/scheduledqueryrules/id_scheduledqueryrule_test.go b/resource-manager/insights/2018-04-16/scheduledqueryrules/id_scheduledqueryrule_test.go index 2fc1df9d1c2..409d20d5776 100644 --- a/resource-manager/insights/2018-04-16/scheduledqueryrules/id_scheduledqueryrule_test.go +++ b/resource-manager/insights/2018-04-16/scheduledqueryrules/id_scheduledqueryrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScheduledQueryRuleId{} func TestNewScheduledQueryRuleID(t *testing.T) { - id := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") + id := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewScheduledQueryRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ScheduledQueryRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledQueryRuleName'", id.ScheduledQueryRuleName, "ruleName") + if id.ScheduledQueryRuleName != "scheduledQueryRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledQueryRuleName'", id.ScheduledQueryRuleName, "scheduledQueryRuleName") } } func TestFormatScheduledQueryRuleID(t *testing.T) { - actual := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName" + actual := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseScheduledQueryRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ScheduledQueryRuleName: "ruleName", + ScheduledQueryRuleName: "scheduledQueryRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseScheduledQueryRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ScheduledQueryRuleName: "ruleName", + ScheduledQueryRuleName: "scheduledQueryRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/sChEdUlEdQuErYrUlEnAmE", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ScheduledQueryRuleName: "rUlEnAmE", + ScheduledQueryRuleName: "sChEdUlEdQuErYrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/sChEdUlEdQuErYrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/README.md b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/README.md index 2f7066a9d1f..e0240aa3a10 100644 --- a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/README.md +++ b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privateendpointconnections.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privateendpointconnection.go index 527a0b8ca5c..6a6cd7e92fe 100644 --- a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privateendpointconnection_test.go index e09e781da77..62907492e0b 100644 --- a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privatelinkscope.go b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privatelinkscope.go index 93c36dee600..69b9cd8929c 100644 --- a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privatelinkscope.go +++ b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privatelinkscope.go @@ -115,7 +115,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privatelinkscope_test.go b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privatelinkscope_test.go index 22c759d44ad..7fbd94d16ce 100644 --- a/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privatelinkscope_test.go +++ b/resource-manager/insights/2019-10-17-preview/privateendpointconnections/id_privatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkresources/README.md b/resource-manager/insights/2019-10-17-preview/privatelinkresources/README.md index dbe1a59d3db..84d88e9f9a2 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkresources/README.md +++ b/resource-manager/insights/2019-10-17-preview/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkresource.go b/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkresource.go index 3f723579b05..39da09b1fd7 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkresource_test.go index 1b252e36123..5a02e943383 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkscope.go b/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkscope.go index 62e0f9a3662..79b442596da 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkscope.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkscope.go @@ -115,7 +115,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkscope_test.go b/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkscope_test.go index 769d76ef21a..efb76e84770 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkscope_test.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkresources/id_privatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/README.md b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/README.md index 337c1f043b1..0c0e832f7c4 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/README.md +++ b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name") +id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName") payload := privatelinkscopedresources.ScopedResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name") +id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name") +id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopedresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopedresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_privatelinkscope.go b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_privatelinkscope.go index bf3c1517faa..5486d719129 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_privatelinkscope.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_privatelinkscope.go @@ -115,7 +115,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_privatelinkscope_test.go b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_privatelinkscope_test.go index e700f8a6d3f..62b0de3df3e 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_privatelinkscope_test.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_privatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_scopedresource.go b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_scopedresource.go index fd427c312ba..5200085b150 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_scopedresource.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_scopedresource.go @@ -121,9 +121,9 @@ func (id ScopedResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticScopedResources", "scopedResources", "scopedResources"), - resourceids.UserSpecifiedSegment("scopedResourceName", "name"), + resourceids.UserSpecifiedSegment("scopedResourceName", "scopedResourceName"), } } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_scopedresource_test.go b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_scopedresource_test.go index 8b3de4c434b..d02fce8d827 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_scopedresource_test.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkscopedresources/id_scopedresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScopedResourceId{} func TestNewScopedResourceID(t *testing.T) { - id := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name") + id := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewScopedResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.ScopedResourceName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScopedResourceName'", id.ScopedResourceName, "name") + if id.ScopedResourceName != "scopedResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'ScopedResourceName'", id.ScopedResourceName, "scopedResourceName") } } func TestFormatScopedResourceID(t *testing.T) { - actual := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name" + actual := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseScopedResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName", Expected: &ScopedResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - ScopedResourceName: "name", + PrivateLinkScopeName: "privateLinkScopeName", + ScopedResourceName: "scopedResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseScopedResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/sCoPeDrEsOuRcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/sCoPeDrEsOuRcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName", Expected: &ScopedResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - ScopedResourceName: "name", + PrivateLinkScopeName: "privateLinkScopeName", + ScopedResourceName: "scopedResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/sCoPeDrEsOuRcEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/sCoPeDrEsOuRcEs/sCoPeDrEsOuRcEnAmE", Expected: &ScopedResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - ScopedResourceName: "nAmE", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + ScopedResourceName: "sCoPeDrEsOuRcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/sCoPeDrEsOuRcEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/sCoPeDrEsOuRcEs/sCoPeDrEsOuRcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/README.md b/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/README.md index e8c9bf2c4e8..d937efc9e24 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/README.md +++ b/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopesapis.AzureMonitorPrivateLinkScope{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if err := client.PrivateLinkScopesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.PrivateLinkScopesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") read, err := client.PrivateLinkScopesGet(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopesapis.TagsResource{ // ... diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope.go b/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope.go index f4c6f454cec..b42d123fdf2 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope.go @@ -115,7 +115,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope_test.go b/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope_test.go index f7a749bbdf0..e515a7d94e1 100644 --- a/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope_test.go +++ b/resource-manager/insights/2019-10-17-preview/privatelinkscopesapis/id_privatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-05-01-preview/autoscaleapis/README.md b/resource-manager/insights/2021-05-01-preview/autoscaleapis/README.md index d7dbec538f8..f001319d823 100644 --- a/resource-manager/insights/2021-05-01-preview/autoscaleapis/README.md +++ b/resource-manager/insights/2021-05-01-preview/autoscaleapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autoscaleapis.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscaleapis.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") payload := autoscaleapis.AutoscaleSettingResourcePatch{ // ... diff --git a/resource-manager/insights/2021-05-01-preview/autoscaleapis/id_autoscalesetting.go b/resource-manager/insights/2021-05-01-preview/autoscaleapis/id_autoscalesetting.go index dadccd226d0..201d4a4f19b 100644 --- a/resource-manager/insights/2021-05-01-preview/autoscaleapis/id_autoscalesetting.go +++ b/resource-manager/insights/2021-05-01-preview/autoscaleapis/id_autoscalesetting.go @@ -115,7 +115,7 @@ func (id AutoScaleSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAutoScaleSettings", "autoScaleSettings", "autoScaleSettings"), - resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoscaleSettingName"), + resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoScaleSettingName"), } } diff --git a/resource-manager/insights/2021-05-01-preview/autoscaleapis/id_autoscalesetting_test.go b/resource-manager/insights/2021-05-01-preview/autoscaleapis/id_autoscalesetting_test.go index f714cbdfeda..25bd14e2426 100644 --- a/resource-manager/insights/2021-05-01-preview/autoscaleapis/id_autoscalesetting_test.go +++ b/resource-manager/insights/2021-05-01-preview/autoscaleapis/id_autoscalesetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleSettingId{} func TestNewAutoScaleSettingID(t *testing.T) { - id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") + id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleSettingName != "autoscaleSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoscaleSettingName") + if id.AutoScaleSettingName != "autoScaleSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoScaleSettingName") } } func TestFormatAutoScaleSettingID(t *testing.T) { - actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName" + actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutoScaleSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, { diff --git a/resource-manager/insights/2021-05-01-preview/autoscalesettings/README.md b/resource-manager/insights/2021-05-01-preview/autoscalesettings/README.md index 8e8838f4f13..cf535815ad5 100644 --- a/resource-manager/insights/2021-05-01-preview/autoscalesettings/README.md +++ b/resource-manager/insights/2021-05-01-preview/autoscalesettings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") payload := autoscalesettings.AutoscaleSettingResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/insights/2021-05-01-preview/autoscalesettings/id_autoscalesetting.go b/resource-manager/insights/2021-05-01-preview/autoscalesettings/id_autoscalesetting.go index 21e4f4101f4..567bed689c6 100644 --- a/resource-manager/insights/2021-05-01-preview/autoscalesettings/id_autoscalesetting.go +++ b/resource-manager/insights/2021-05-01-preview/autoscalesettings/id_autoscalesetting.go @@ -115,7 +115,7 @@ func (id AutoScaleSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAutoScaleSettings", "autoScaleSettings", "autoScaleSettings"), - resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoscaleSettingName"), + resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoScaleSettingName"), } } diff --git a/resource-manager/insights/2021-05-01-preview/autoscalesettings/id_autoscalesetting_test.go b/resource-manager/insights/2021-05-01-preview/autoscalesettings/id_autoscalesetting_test.go index 4f4cd460fec..0b21d3cfcb3 100644 --- a/resource-manager/insights/2021-05-01-preview/autoscalesettings/id_autoscalesetting_test.go +++ b/resource-manager/insights/2021-05-01-preview/autoscalesettings/id_autoscalesetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleSettingId{} func TestNewAutoScaleSettingID(t *testing.T) { - id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") + id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleSettingName != "autoscaleSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoscaleSettingName") + if id.AutoScaleSettingName != "autoScaleSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoScaleSettingName") } } func TestFormatAutoScaleSettingID(t *testing.T) { - actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName" + actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutoScaleSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, { diff --git a/resource-manager/insights/2021-05-01-preview/diagnosticsettings/README.md b/resource-manager/insights/2021-05-01-preview/diagnosticsettings/README.md index 6eb911dba3c..5d3b8b666c3 100644 --- a/resource-manager/insights/2021-05-01-preview/diagnosticsettings/README.md +++ b/resource-manager/insights/2021-05-01-preview/diagnosticsettings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingName") payload := diagnosticsettings.DiagnosticSettingsResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := diagnosticsettings.NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/insights/2021-05-01-preview/diagnosticsettings/id_scopeddiagnosticsetting.go b/resource-manager/insights/2021-05-01-preview/diagnosticsettings/id_scopeddiagnosticsetting.go index 3af6f0dbead..63af41d13e0 100644 --- a/resource-manager/insights/2021-05-01-preview/diagnosticsettings/id_scopeddiagnosticsetting.go +++ b/resource-manager/insights/2021-05-01-preview/diagnosticsettings/id_scopeddiagnosticsetting.go @@ -106,7 +106,7 @@ func (id ScopedDiagnosticSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticDiagnosticSettings", "diagnosticSettings", "diagnosticSettings"), - resourceids.UserSpecifiedSegment("diagnosticSettingName", "name"), + resourceids.UserSpecifiedSegment("diagnosticSettingName", "diagnosticSettingName"), } } diff --git a/resource-manager/insights/2021-05-01-preview/diagnosticsettings/id_scopeddiagnosticsetting_test.go b/resource-manager/insights/2021-05-01-preview/diagnosticsettings/id_scopeddiagnosticsetting_test.go index b8b7f5dbe97..89e8c1c754b 100644 --- a/resource-manager/insights/2021-05-01-preview/diagnosticsettings/id_scopeddiagnosticsetting_test.go +++ b/resource-manager/insights/2021-05-01-preview/diagnosticsettings/id_scopeddiagnosticsetting_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedDiagnosticSettingId{} func TestNewScopedDiagnosticSettingID(t *testing.T) { - id := NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") + id := NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingName") if id.ResourceUri != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceUri'", id.ResourceUri, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.DiagnosticSettingName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingName'", id.DiagnosticSettingName, "name") + if id.DiagnosticSettingName != "diagnosticSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingName'", id.DiagnosticSettingName, "diagnosticSettingName") } } func TestFormatScopedDiagnosticSettingID(t *testing.T) { - actual := NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/name" + actual := NewScopedDiagnosticSettingID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedDiagnosticSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName", Expected: &ScopedDiagnosticSettingId{ ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DiagnosticSettingName: "name", + DiagnosticSettingName: "diagnosticSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedDiagnosticSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName", Expected: &ScopedDiagnosticSettingId{ ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DiagnosticSettingName: "name", + DiagnosticSettingName: "diagnosticSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/dIaGnOsTiCsEtTiNgNaMe", Expected: &ScopedDiagnosticSettingId{ ResourceUri: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - DiagnosticSettingName: "nAmE", + DiagnosticSettingName: "dIaGnOsTiCsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/dIaGnOsTiCsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/README.md b/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/README.md index d06f0b4a475..30140dbceec 100644 --- a/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/README.md +++ b/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnosticsettingscategories.NewScopedDiagnosticSettingsCategoryID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") +id := diagnosticsettingscategories.NewScopedDiagnosticSettingsCategoryID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingsCategoryName") read, err := client.DiagnosticSettingsCategoryGet(ctx, id) if err != nil { diff --git a/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/id_scopeddiagnosticsettingscategory.go b/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/id_scopeddiagnosticsettingscategory.go index 05cfa0cc805..7640fe4bc4b 100644 --- a/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/id_scopeddiagnosticsettingscategory.go +++ b/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/id_scopeddiagnosticsettingscategory.go @@ -106,7 +106,7 @@ func (id ScopedDiagnosticSettingsCategoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticDiagnosticSettingsCategories", "diagnosticSettingsCategories", "diagnosticSettingsCategories"), - resourceids.UserSpecifiedSegment("diagnosticSettingsCategoryName", "name"), + resourceids.UserSpecifiedSegment("diagnosticSettingsCategoryName", "diagnosticSettingsCategoryName"), } } diff --git a/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/id_scopeddiagnosticsettingscategory_test.go b/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/id_scopeddiagnosticsettingscategory_test.go index 0ba2a428242..9b938a7b307 100644 --- a/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/id_scopeddiagnosticsettingscategory_test.go +++ b/resource-manager/insights/2021-05-01-preview/diagnosticsettingscategories/id_scopeddiagnosticsettingscategory_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedDiagnosticSettingsCategoryId{} func TestNewScopedDiagnosticSettingsCategoryID(t *testing.T) { - id := NewScopedDiagnosticSettingsCategoryID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name") + id := NewScopedDiagnosticSettingsCategoryID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingsCategoryName") if id.ResourceUri != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceUri'", id.ResourceUri, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.DiagnosticSettingsCategoryName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingsCategoryName'", id.DiagnosticSettingsCategoryName, "name") + if id.DiagnosticSettingsCategoryName != "diagnosticSettingsCategoryName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingsCategoryName'", id.DiagnosticSettingsCategoryName, "diagnosticSettingsCategoryName") } } func TestFormatScopedDiagnosticSettingsCategoryID(t *testing.T) { - actual := NewScopedDiagnosticSettingsCategoryID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/name" + actual := NewScopedDiagnosticSettingsCategoryID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "diagnosticSettingsCategoryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/diagnosticSettingsCategoryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedDiagnosticSettingsCategoryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/diagnosticSettingsCategoryName", Expected: &ScopedDiagnosticSettingsCategoryId{ ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DiagnosticSettingsCategoryName: "name", + DiagnosticSettingsCategoryName: "diagnosticSettingsCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/diagnosticSettingsCategoryName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedDiagnosticSettingsCategoryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/diagnosticSettingsCategoryName", Expected: &ScopedDiagnosticSettingsCategoryId{ ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DiagnosticSettingsCategoryName: "name", + DiagnosticSettingsCategoryName: "diagnosticSettingsCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/diagnosticSettingsCategories/diagnosticSettingsCategoryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgScAtEgOrIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgScAtEgOrIeS/dIaGnOsTiCsEtTiNgScAtEgOrYnAmE", Expected: &ScopedDiagnosticSettingsCategoryId{ ResourceUri: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - DiagnosticSettingsCategoryName: "nAmE", + DiagnosticSettingsCategoryName: "dIaGnOsTiCsEtTiNgScAtEgOrYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgScAtEgOrIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgScAtEgOrIeS/dIaGnOsTiCsEtTiNgScAtEgOrYnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/README.md b/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/README.md index e2f8f6c2268..89dde53601f 100644 --- a/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/README.md +++ b/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managementgroupdiagnosticsettings.NewProviders2DiagnosticSettingID("managementGroupId", "name") +id := managementgroupdiagnosticsettings.NewProviders2DiagnosticSettingID("managementGroupId", "diagnosticSettingName") payload := managementgroupdiagnosticsettings.ManagementGroupDiagnosticSettingsResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managementgroupdiagnosticsettings.NewProviders2DiagnosticSettingID("managementGroupId", "name") +id := managementgroupdiagnosticsettings.NewProviders2DiagnosticSettingID("managementGroupId", "diagnosticSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managementgroupdiagnosticsettings.NewProviders2DiagnosticSettingID("managementGroupId", "name") +id := managementgroupdiagnosticsettings.NewProviders2DiagnosticSettingID("managementGroupId", "diagnosticSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/id_providers2diagnosticsetting.go b/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/id_providers2diagnosticsetting.go index 53c9b206d92..ef50a4e87a3 100644 --- a/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/id_providers2diagnosticsetting.go +++ b/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/id_providers2diagnosticsetting.go @@ -109,7 +109,7 @@ func (id Providers2DiagnosticSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticDiagnosticSettings", "diagnosticSettings", "diagnosticSettings"), - resourceids.UserSpecifiedSegment("diagnosticSettingName", "name"), + resourceids.UserSpecifiedSegment("diagnosticSettingName", "diagnosticSettingName"), } } diff --git a/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/id_providers2diagnosticsetting_test.go b/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/id_providers2diagnosticsetting_test.go index d7af2d6f869..d102a116bc9 100644 --- a/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/id_providers2diagnosticsetting_test.go +++ b/resource-manager/insights/2021-05-01-preview/managementgroupdiagnosticsettings/id_providers2diagnosticsetting_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &Providers2DiagnosticSettingId{} func TestNewProviders2DiagnosticSettingID(t *testing.T) { - id := NewProviders2DiagnosticSettingID("managementGroupId", "name") + id := NewProviders2DiagnosticSettingID("managementGroupId", "diagnosticSettingName") if id.ManagementGroupId != "managementGroupId" { t.Fatalf("Expected %q but got %q for Segment 'ManagementGroupId'", id.ManagementGroupId, "managementGroupId") } - if id.DiagnosticSettingName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingName'", id.DiagnosticSettingName, "name") + if id.DiagnosticSettingName != "diagnosticSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingName'", id.DiagnosticSettingName, "diagnosticSettingName") } } func TestFormatProviders2DiagnosticSettingID(t *testing.T) { - actual := NewProviders2DiagnosticSettingID("managementGroupId", "name").ID() - expected := "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/name" + actual := NewProviders2DiagnosticSettingID("managementGroupId", "diagnosticSettingName").ID() + expected := "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -79,15 +79,15 @@ func TestParseProviders2DiagnosticSettingID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/name", + Input: "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName", Expected: &Providers2DiagnosticSettingId{ ManagementGroupId: "managementGroupId", - DiagnosticSettingName: "name", + DiagnosticSettingName: "diagnosticSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/name/extra", + Input: "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName/extra", Error: true, }, } @@ -200,28 +200,28 @@ func TestParseProviders2DiagnosticSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/name", + Input: "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName", Expected: &Providers2DiagnosticSettingId{ ManagementGroupId: "managementGroupId", - DiagnosticSettingName: "name", + DiagnosticSettingName: "diagnosticSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/name/extra", + Input: "/providers/Microsoft.Management/managementGroups/managementGroupId/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpId/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/nAmE", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpId/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/dIaGnOsTiCsEtTiNgNaMe", Expected: &Providers2DiagnosticSettingId{ ManagementGroupId: "mAnAgEmEnTgRoUpId", - DiagnosticSettingName: "nAmE", + DiagnosticSettingName: "dIaGnOsTiCsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpId/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/nAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpId/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/dIaGnOsTiCsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-05-01-preview/metrics/README.md b/resource-manager/insights/2021-05-01-preview/metrics/README.md index 59d47a283f3..6cfbfe060e0 100644 --- a/resource-manager/insights/2021-05-01-preview/metrics/README.md +++ b/resource-manager/insights/2021-05-01-preview/metrics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := metrics.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := metrics.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") read, err := client.PredictiveMetricGet(ctx, id, metrics.DefaultPredictiveMetricGetOperationOptions()) if err != nil { diff --git a/resource-manager/insights/2021-05-01-preview/metrics/id_autoscalesetting.go b/resource-manager/insights/2021-05-01-preview/metrics/id_autoscalesetting.go index 4ec2e774728..4fe4ee472b9 100644 --- a/resource-manager/insights/2021-05-01-preview/metrics/id_autoscalesetting.go +++ b/resource-manager/insights/2021-05-01-preview/metrics/id_autoscalesetting.go @@ -115,7 +115,7 @@ func (id AutoScaleSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAutoScaleSettings", "autoScaleSettings", "autoScaleSettings"), - resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoscaleSettingName"), + resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoScaleSettingName"), } } diff --git a/resource-manager/insights/2021-05-01-preview/metrics/id_autoscalesetting_test.go b/resource-manager/insights/2021-05-01-preview/metrics/id_autoscalesetting_test.go index 1758739c567..009906616fd 100644 --- a/resource-manager/insights/2021-05-01-preview/metrics/id_autoscalesetting_test.go +++ b/resource-manager/insights/2021-05-01-preview/metrics/id_autoscalesetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleSettingId{} func TestNewAutoScaleSettingID(t *testing.T) { - id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") + id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleSettingName != "autoscaleSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoscaleSettingName") + if id.AutoScaleSettingName != "autoScaleSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoScaleSettingName") } } func TestFormatAutoScaleSettingID(t *testing.T) { - actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName" + actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutoScaleSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, { diff --git a/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/README.md b/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/README.md index 9b4aee12333..a912d3e4c85 100644 --- a/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/README.md +++ b/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subscriptiondiagnosticsettings.NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "name") +id := subscriptiondiagnosticsettings.NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "diagnosticSettingName") payload := subscriptiondiagnosticsettings.SubscriptionDiagnosticSettingsResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscriptiondiagnosticsettings.NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "name") +id := subscriptiondiagnosticsettings.NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "diagnosticSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscriptiondiagnosticsettings.NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "name") +id := subscriptiondiagnosticsettings.NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "diagnosticSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/id_diagnosticsetting.go b/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/id_diagnosticsetting.go index eb70d5f86b5..4fdff91a505 100644 --- a/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/id_diagnosticsetting.go +++ b/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/id_diagnosticsetting.go @@ -107,7 +107,7 @@ func (id DiagnosticSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticDiagnosticSettings", "diagnosticSettings", "diagnosticSettings"), - resourceids.UserSpecifiedSegment("diagnosticSettingName", "name"), + resourceids.UserSpecifiedSegment("diagnosticSettingName", "diagnosticSettingName"), } } diff --git a/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/id_diagnosticsetting_test.go b/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/id_diagnosticsetting_test.go index dd380c98f1e..7b639a13f8b 100644 --- a/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/id_diagnosticsetting_test.go +++ b/resource-manager/insights/2021-05-01-preview/subscriptiondiagnosticsettings/id_diagnosticsetting_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &DiagnosticSettingId{} func TestNewDiagnosticSettingID(t *testing.T) { - id := NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "name") + id := NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "diagnosticSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.DiagnosticSettingName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingName'", id.DiagnosticSettingName, "name") + if id.DiagnosticSettingName != "diagnosticSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticSettingName'", id.DiagnosticSettingName, "diagnosticSettingName") } } func TestFormatDiagnosticSettingID(t *testing.T) { - actual := NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/name" + actual := NewDiagnosticSettingID("12345678-1234-9876-4563-123456789012", "diagnosticSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseDiagnosticSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName", Expected: &DiagnosticSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - DiagnosticSettingName: "name", + DiagnosticSettingName: "diagnosticSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseDiagnosticSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName", Expected: &DiagnosticSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - DiagnosticSettingName: "name", + DiagnosticSettingName: "diagnosticSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Insights/diagnosticSettings/diagnosticSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/dIaGnOsTiCsEtTiNgNaMe", Expected: &DiagnosticSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - DiagnosticSettingName: "nAmE", + DiagnosticSettingName: "dIaGnOsTiCsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dIaGnOsTiCsEtTiNgS/dIaGnOsTiCsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/README.md b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/README.md index f0f68ab6257..1f8b9399c8c 100644 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/README.md +++ b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privateendpointconnections.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") read, err := client.ListByPrivateLinkScope(ctx, id) if err != nil { diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection.go index 527a0b8ca5c..6a6cd7e92fe 100644 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection_test.go index e09e781da77..62907492e0b 100644 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope.go index 93c36dee600..69b9cd8929c 100644 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope.go +++ b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope.go @@ -115,7 +115,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope_test.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope_test.go index 22c759d44ad..7fbd94d16ce 100644 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope_test.go +++ b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/README.md b/resource-manager/insights/2021-07-01-preview/privatelinkresources/README.md index 2f8ba758cce..4e07c31f8f4 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/README.md +++ b/resource-manager/insights/2021-07-01-preview/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") read, err := client.ListByPrivateLinkScope(ctx, id) if err != nil { diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource.go index 3f723579b05..39da09b1fd7 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource_test.go index 1b252e36123..5a02e943383 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - PrivateLinkResourceName: "groupName", + PrivateLinkScopeName: "privateLinkScopeName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope.go index 62e0f9a3662..79b442596da 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope.go @@ -115,7 +115,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope_test.go index 769d76ef21a..efb76e84770 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope_test.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/README.md b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/README.md index 67c5818de53..9d7084ec3d8 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/README.md +++ b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name") +id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName") payload := privatelinkscopedresources.ScopedResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name") +id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name") +id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopedresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopedresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") // alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination items, err := client.ListByPrivateLinkScopeComplete(ctx, id) diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope.go index bf3c1517faa..5486d719129 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope.go @@ -115,7 +115,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope_test.go index e700f8a6d3f..62b0de3df3e 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope_test.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource.go index fd427c312ba..5200085b150 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource.go @@ -121,9 +121,9 @@ func (id ScopedResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), resourceids.StaticSegment("staticScopedResources", "scopedResources", "scopedResources"), - resourceids.UserSpecifiedSegment("scopedResourceName", "name"), + resourceids.UserSpecifiedSegment("scopedResourceName", "scopedResourceName"), } } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource_test.go index 8b3de4c434b..d02fce8d827 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource_test.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScopedResourceId{} func TestNewScopedResourceID(t *testing.T) { - id := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name") + id := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewScopedResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } - if id.ScopedResourceName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScopedResourceName'", id.ScopedResourceName, "name") + if id.ScopedResourceName != "scopedResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'ScopedResourceName'", id.ScopedResourceName, "scopedResourceName") } } func TestFormatScopedResourceID(t *testing.T) { - actual := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name" + actual := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName", "scopedResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseScopedResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName", Expected: &ScopedResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - ScopedResourceName: "name", + PrivateLinkScopeName: "privateLinkScopeName", + ScopedResourceName: "scopedResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseScopedResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/sCoPeDrEsOuRcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/sCoPeDrEsOuRcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName", Expected: &ScopedResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", - ScopedResourceName: "name", + PrivateLinkScopeName: "privateLinkScopeName", + ScopedResourceName: "scopedResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/scopedResources/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/scopedResources/scopedResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/sCoPeDrEsOuRcEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/sCoPeDrEsOuRcEs/sCoPeDrEsOuRcEnAmE", Expected: &ScopedResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", - ScopedResourceName: "nAmE", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", + ScopedResourceName: "sCoPeDrEsOuRcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/sCoPeDrEsOuRcEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/sCoPeDrEsOuRcEs/sCoPeDrEsOuRcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md index 434bcbc233e..08ad58cfb01 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md +++ b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopesapis.AzureMonitorPrivateLinkScope{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if err := client.PrivateLinkScopesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.PrivateLinkScopesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") read, err := client.PrivateLinkScopesGet(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") +id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") payload := privatelinkscopesapis.TagsResource{ // ... diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go index f4c6f454cec..b42d123fdf2 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go @@ -115,7 +115,7 @@ func (id PrivateLinkScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "scopeName"), + resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeName"), } } diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope_test.go index f7a749bbdf0..e515a7d94e1 100644 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope_test.go +++ b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkScopeId{} func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName") + id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkScopeName != "scopeName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "scopeName") + if id.PrivateLinkScopeName != "privateLinkScopeName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeName") } } func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName" + actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkScopeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "scopeName", + PrivateLinkScopeName: "privateLinkScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/scopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE", Expected: &PrivateLinkScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "sCoPeNaMe", + PrivateLinkScopeName: "pRiVaTeLiNkScOpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/sCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-08-01/scheduledqueryrules/README.md b/resource-manager/insights/2021-08-01/scheduledqueryrules/README.md index c1647443cde..9d9707d5236 100644 --- a/resource-manager/insights/2021-08-01/scheduledqueryrules/README.md +++ b/resource-manager/insights/2021-08-01/scheduledqueryrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") payload := scheduledqueryrules.ScheduledQueryRuleResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") payload := scheduledqueryrules.ScheduledQueryRuleResourcePatch{ // ... diff --git a/resource-manager/insights/2021-08-01/scheduledqueryrules/id_scheduledqueryrule.go b/resource-manager/insights/2021-08-01/scheduledqueryrules/id_scheduledqueryrule.go index 4d5479238c0..e06ff643137 100644 --- a/resource-manager/insights/2021-08-01/scheduledqueryrules/id_scheduledqueryrule.go +++ b/resource-manager/insights/2021-08-01/scheduledqueryrules/id_scheduledqueryrule.go @@ -115,7 +115,7 @@ func (id ScheduledQueryRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticScheduledQueryRules", "scheduledQueryRules", "scheduledQueryRules"), - resourceids.UserSpecifiedSegment("scheduledQueryRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("scheduledQueryRuleName", "scheduledQueryRuleName"), } } diff --git a/resource-manager/insights/2021-08-01/scheduledqueryrules/id_scheduledqueryrule_test.go b/resource-manager/insights/2021-08-01/scheduledqueryrules/id_scheduledqueryrule_test.go index 2fc1df9d1c2..409d20d5776 100644 --- a/resource-manager/insights/2021-08-01/scheduledqueryrules/id_scheduledqueryrule_test.go +++ b/resource-manager/insights/2021-08-01/scheduledqueryrules/id_scheduledqueryrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScheduledQueryRuleId{} func TestNewScheduledQueryRuleID(t *testing.T) { - id := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") + id := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewScheduledQueryRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ScheduledQueryRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledQueryRuleName'", id.ScheduledQueryRuleName, "ruleName") + if id.ScheduledQueryRuleName != "scheduledQueryRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledQueryRuleName'", id.ScheduledQueryRuleName, "scheduledQueryRuleName") } } func TestFormatScheduledQueryRuleID(t *testing.T) { - actual := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName" + actual := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseScheduledQueryRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ScheduledQueryRuleName: "ruleName", + ScheduledQueryRuleName: "scheduledQueryRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseScheduledQueryRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ScheduledQueryRuleName: "ruleName", + ScheduledQueryRuleName: "scheduledQueryRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/sChEdUlEdQuErYrUlEnAmE", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ScheduledQueryRuleName: "rUlEnAmE", + ScheduledQueryRuleName: "sChEdUlEdQuErYrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/sChEdUlEdQuErYrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2021-09-01/actiongroupsapis/model_azurefunctionreceiver.go b/resource-manager/insights/2021-09-01/actiongroupsapis/model_azurefunctionreceiver.go index 1e726287aa2..9d984e7c6f8 100644 --- a/resource-manager/insights/2021-09-01/actiongroupsapis/model_azurefunctionreceiver.go +++ b/resource-manager/insights/2021-09-01/actiongroupsapis/model_azurefunctionreceiver.go @@ -6,7 +6,7 @@ package actiongroupsapis type AzureFunctionReceiver struct { FunctionAppResourceId string `json:"functionAppResourceId"` FunctionName string `json:"functionName"` - HTTPTriggerUrl string `json:"httpTriggerUrl"` + HTTPTriggerURL string `json:"httpTriggerUrl"` Name string `json:"name"` UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` } diff --git a/resource-manager/insights/2021-09-01/actiongroupsapis/model_logicappreceiver.go b/resource-manager/insights/2021-09-01/actiongroupsapis/model_logicappreceiver.go index d8c5ced9ba9..948fcca7cff 100644 --- a/resource-manager/insights/2021-09-01/actiongroupsapis/model_logicappreceiver.go +++ b/resource-manager/insights/2021-09-01/actiongroupsapis/model_logicappreceiver.go @@ -4,7 +4,7 @@ package actiongroupsapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type LogicAppReceiver struct { - CallbackUrl string `json:"callbackUrl"` + CallbackURL string `json:"callbackUrl"` Name string `json:"name"` ResourceId string `json:"resourceId"` UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` diff --git a/resource-manager/insights/2022-06-01/actiongroupsapis/model_azurefunctionreceiver.go b/resource-manager/insights/2022-06-01/actiongroupsapis/model_azurefunctionreceiver.go index 1e726287aa2..9d984e7c6f8 100644 --- a/resource-manager/insights/2022-06-01/actiongroupsapis/model_azurefunctionreceiver.go +++ b/resource-manager/insights/2022-06-01/actiongroupsapis/model_azurefunctionreceiver.go @@ -6,7 +6,7 @@ package actiongroupsapis type AzureFunctionReceiver struct { FunctionAppResourceId string `json:"functionAppResourceId"` FunctionName string `json:"functionName"` - HTTPTriggerUrl string `json:"httpTriggerUrl"` + HTTPTriggerURL string `json:"httpTriggerUrl"` Name string `json:"name"` UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` } diff --git a/resource-manager/insights/2022-06-01/actiongroupsapis/model_logicappreceiver.go b/resource-manager/insights/2022-06-01/actiongroupsapis/model_logicappreceiver.go index d8c5ced9ba9..948fcca7cff 100644 --- a/resource-manager/insights/2022-06-01/actiongroupsapis/model_logicappreceiver.go +++ b/resource-manager/insights/2022-06-01/actiongroupsapis/model_logicappreceiver.go @@ -4,7 +4,7 @@ package actiongroupsapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type LogicAppReceiver struct { - CallbackUrl string `json:"callbackUrl"` + CallbackURL string `json:"callbackUrl"` Name string `json:"name"` ResourceId string `json:"resourceId"` UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` diff --git a/resource-manager/insights/2022-06-01/datacollectionruleassociations/README.md b/resource-manager/insights/2022-06-01/datacollectionruleassociations/README.md index f86142122a3..72731bd5c94 100644 --- a/resource-manager/insights/2022-06-01/datacollectionruleassociations/README.md +++ b/resource-manager/insights/2022-06-01/datacollectionruleassociations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "associationName") +id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationName") payload := datacollectionruleassociations.DataCollectionRuleAssociationProxyOnlyResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "associationName") +id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "associationName") +id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/insights/2022-06-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation.go b/resource-manager/insights/2022-06-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation.go index 0642da0ecdd..56db58653a4 100644 --- a/resource-manager/insights/2022-06-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation.go +++ b/resource-manager/insights/2022-06-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation.go @@ -106,7 +106,7 @@ func (id ScopedDataCollectionRuleAssociationId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticDataCollectionRuleAssociations", "dataCollectionRuleAssociations", "dataCollectionRuleAssociations"), - resourceids.UserSpecifiedSegment("dataCollectionRuleAssociationName", "associationName"), + resourceids.UserSpecifiedSegment("dataCollectionRuleAssociationName", "dataCollectionRuleAssociationName"), } } diff --git a/resource-manager/insights/2022-06-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation_test.go b/resource-manager/insights/2022-06-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation_test.go index 2e1b76fb9e4..53f4f2df000 100644 --- a/resource-manager/insights/2022-06-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation_test.go +++ b/resource-manager/insights/2022-06-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedDataCollectionRuleAssociationId{} func TestNewScopedDataCollectionRuleAssociationID(t *testing.T) { - id := NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "associationName") + id := NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationName") if id.ResourceUri != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'ResourceUri'", id.ResourceUri, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.DataCollectionRuleAssociationName != "associationName" { - t.Fatalf("Expected %q but got %q for Segment 'DataCollectionRuleAssociationName'", id.DataCollectionRuleAssociationName, "associationName") + if id.DataCollectionRuleAssociationName != "dataCollectionRuleAssociationName" { + t.Fatalf("Expected %q but got %q for Segment 'DataCollectionRuleAssociationName'", id.DataCollectionRuleAssociationName, "dataCollectionRuleAssociationName") } } func TestFormatScopedDataCollectionRuleAssociationID(t *testing.T) { - actual := NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "associationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/associationName" + actual := NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedDataCollectionRuleAssociationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/associationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationName", Expected: &ScopedDataCollectionRuleAssociationId{ ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DataCollectionRuleAssociationName: "associationName", + DataCollectionRuleAssociationName: "dataCollectionRuleAssociationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/associationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedDataCollectionRuleAssociationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/associationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationName", Expected: &ScopedDataCollectionRuleAssociationId{ ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DataCollectionRuleAssociationName: "associationName", + DataCollectionRuleAssociationName: "dataCollectionRuleAssociationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/associationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnS/aSsOcIaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnNaMe", Expected: &ScopedDataCollectionRuleAssociationId{ ResourceUri: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - DataCollectionRuleAssociationName: "aSsOcIaTiOnNaMe", + DataCollectionRuleAssociationName: "dAtAcOlLeCtIoNrUlEaSsOcIaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnS/aSsOcIaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/insights/2022-10-01/autoscaleapis/README.md b/resource-manager/insights/2022-10-01/autoscaleapis/README.md index d427f33052b..c951c434598 100644 --- a/resource-manager/insights/2022-10-01/autoscaleapis/README.md +++ b/resource-manager/insights/2022-10-01/autoscaleapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autoscaleapis.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscaleapis.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") payload := autoscaleapis.AutoscaleSettingResourcePatch{ // ... diff --git a/resource-manager/insights/2022-10-01/autoscaleapis/id_autoscalesetting.go b/resource-manager/insights/2022-10-01/autoscaleapis/id_autoscalesetting.go index dadccd226d0..201d4a4f19b 100644 --- a/resource-manager/insights/2022-10-01/autoscaleapis/id_autoscalesetting.go +++ b/resource-manager/insights/2022-10-01/autoscaleapis/id_autoscalesetting.go @@ -115,7 +115,7 @@ func (id AutoScaleSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAutoScaleSettings", "autoScaleSettings", "autoScaleSettings"), - resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoscaleSettingName"), + resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoScaleSettingName"), } } diff --git a/resource-manager/insights/2022-10-01/autoscaleapis/id_autoscalesetting_test.go b/resource-manager/insights/2022-10-01/autoscaleapis/id_autoscalesetting_test.go index f714cbdfeda..25bd14e2426 100644 --- a/resource-manager/insights/2022-10-01/autoscaleapis/id_autoscalesetting_test.go +++ b/resource-manager/insights/2022-10-01/autoscaleapis/id_autoscalesetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleSettingId{} func TestNewAutoScaleSettingID(t *testing.T) { - id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") + id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleSettingName != "autoscaleSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoscaleSettingName") + if id.AutoScaleSettingName != "autoScaleSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoScaleSettingName") } } func TestFormatAutoScaleSettingID(t *testing.T) { - actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName" + actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutoScaleSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, { diff --git a/resource-manager/insights/2022-10-01/autoscalesettings/README.md b/resource-manager/insights/2022-10-01/autoscalesettings/README.md index 376c6d940d1..89dacb2ab4a 100644 --- a/resource-manager/insights/2022-10-01/autoscalesettings/README.md +++ b/resource-manager/insights/2022-10-01/autoscalesettings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") payload := autoscalesettings.AutoscaleSettingResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := autoscalesettings.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/insights/2022-10-01/autoscalesettings/id_autoscalesetting.go b/resource-manager/insights/2022-10-01/autoscalesettings/id_autoscalesetting.go index 21e4f4101f4..567bed689c6 100644 --- a/resource-manager/insights/2022-10-01/autoscalesettings/id_autoscalesetting.go +++ b/resource-manager/insights/2022-10-01/autoscalesettings/id_autoscalesetting.go @@ -115,7 +115,7 @@ func (id AutoScaleSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAutoScaleSettings", "autoScaleSettings", "autoScaleSettings"), - resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoscaleSettingName"), + resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoScaleSettingName"), } } diff --git a/resource-manager/insights/2022-10-01/autoscalesettings/id_autoscalesetting_test.go b/resource-manager/insights/2022-10-01/autoscalesettings/id_autoscalesetting_test.go index 4f4cd460fec..0b21d3cfcb3 100644 --- a/resource-manager/insights/2022-10-01/autoscalesettings/id_autoscalesetting_test.go +++ b/resource-manager/insights/2022-10-01/autoscalesettings/id_autoscalesetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleSettingId{} func TestNewAutoScaleSettingID(t *testing.T) { - id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") + id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleSettingName != "autoscaleSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoscaleSettingName") + if id.AutoScaleSettingName != "autoScaleSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoScaleSettingName") } } func TestFormatAutoScaleSettingID(t *testing.T) { - actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName" + actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutoScaleSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, { diff --git a/resource-manager/insights/2022-10-01/metrics/README.md b/resource-manager/insights/2022-10-01/metrics/README.md index c789601a0f7..4ccc74de14b 100644 --- a/resource-manager/insights/2022-10-01/metrics/README.md +++ b/resource-manager/insights/2022-10-01/metrics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := metrics.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") +id := metrics.NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") read, err := client.PredictiveMetricGet(ctx, id, metrics.DefaultPredictiveMetricGetOperationOptions()) if err != nil { diff --git a/resource-manager/insights/2022-10-01/metrics/id_autoscalesetting.go b/resource-manager/insights/2022-10-01/metrics/id_autoscalesetting.go index 4ec2e774728..4fe4ee472b9 100644 --- a/resource-manager/insights/2022-10-01/metrics/id_autoscalesetting.go +++ b/resource-manager/insights/2022-10-01/metrics/id_autoscalesetting.go @@ -115,7 +115,7 @@ func (id AutoScaleSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticAutoScaleSettings", "autoScaleSettings", "autoScaleSettings"), - resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoscaleSettingName"), + resourceids.UserSpecifiedSegment("autoScaleSettingName", "autoScaleSettingName"), } } diff --git a/resource-manager/insights/2022-10-01/metrics/id_autoscalesetting_test.go b/resource-manager/insights/2022-10-01/metrics/id_autoscalesetting_test.go index 1758739c567..009906616fd 100644 --- a/resource-manager/insights/2022-10-01/metrics/id_autoscalesetting_test.go +++ b/resource-manager/insights/2022-10-01/metrics/id_autoscalesetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleSettingId{} func TestNewAutoScaleSettingID(t *testing.T) { - id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName") + id := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleSettingName != "autoscaleSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoscaleSettingName") + if id.AutoScaleSettingName != "autoScaleSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleSettingName'", id.AutoScaleSettingName, "autoScaleSettingName") } } func TestFormatAutoScaleSettingID(t *testing.T) { - actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoscaleSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName" + actual := NewAutoScaleSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutoScaleSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName", Expected: &AutoScaleSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleSettingName: "autoscaleSettingName", + AutoScaleSettingName: "autoScaleSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoscaleSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/autoScaleSettings/autoScaleSettingName/extra", Error: true, }, { diff --git a/resource-manager/insights/2023-01-01/actiongroupsapis/model_azurefunctionreceiver.go b/resource-manager/insights/2023-01-01/actiongroupsapis/model_azurefunctionreceiver.go index 1e726287aa2..9d984e7c6f8 100644 --- a/resource-manager/insights/2023-01-01/actiongroupsapis/model_azurefunctionreceiver.go +++ b/resource-manager/insights/2023-01-01/actiongroupsapis/model_azurefunctionreceiver.go @@ -6,7 +6,7 @@ package actiongroupsapis type AzureFunctionReceiver struct { FunctionAppResourceId string `json:"functionAppResourceId"` FunctionName string `json:"functionName"` - HTTPTriggerUrl string `json:"httpTriggerUrl"` + HTTPTriggerURL string `json:"httpTriggerUrl"` Name string `json:"name"` UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` } diff --git a/resource-manager/insights/2023-01-01/actiongroupsapis/model_logicappreceiver.go b/resource-manager/insights/2023-01-01/actiongroupsapis/model_logicappreceiver.go index d8c5ced9ba9..948fcca7cff 100644 --- a/resource-manager/insights/2023-01-01/actiongroupsapis/model_logicappreceiver.go +++ b/resource-manager/insights/2023-01-01/actiongroupsapis/model_logicappreceiver.go @@ -4,7 +4,7 @@ package actiongroupsapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type LogicAppReceiver struct { - CallbackUrl string `json:"callbackUrl"` + CallbackURL string `json:"callbackUrl"` Name string `json:"name"` ResourceId string `json:"resourceId"` UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` diff --git a/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/README.md b/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/README.md index 41c0420e5d9..b78ff1d9f8a 100644 --- a/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/README.md +++ b/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") payload := scheduledqueryrules.ScheduledQueryRuleResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") +id := scheduledqueryrules.NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") payload := scheduledqueryrules.ScheduledQueryRuleResourcePatch{ // ... diff --git a/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/id_scheduledqueryrule.go b/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/id_scheduledqueryrule.go index 4d5479238c0..e06ff643137 100644 --- a/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/id_scheduledqueryrule.go +++ b/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/id_scheduledqueryrule.go @@ -115,7 +115,7 @@ func (id ScheduledQueryRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), resourceids.StaticSegment("staticScheduledQueryRules", "scheduledQueryRules", "scheduledQueryRules"), - resourceids.UserSpecifiedSegment("scheduledQueryRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("scheduledQueryRuleName", "scheduledQueryRuleName"), } } diff --git a/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/id_scheduledqueryrule_test.go b/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/id_scheduledqueryrule_test.go index 2fc1df9d1c2..409d20d5776 100644 --- a/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/id_scheduledqueryrule_test.go +++ b/resource-manager/insights/2023-03-15-preview/scheduledqueryrules/id_scheduledqueryrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScheduledQueryRuleId{} func TestNewScheduledQueryRuleID(t *testing.T) { - id := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName") + id := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewScheduledQueryRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ScheduledQueryRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduledQueryRuleName'", id.ScheduledQueryRuleName, "ruleName") + if id.ScheduledQueryRuleName != "scheduledQueryRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduledQueryRuleName'", id.ScheduledQueryRuleName, "scheduledQueryRuleName") } } func TestFormatScheduledQueryRuleID(t *testing.T) { - actual := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName" + actual := NewScheduledQueryRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scheduledQueryRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseScheduledQueryRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ScheduledQueryRuleName: "ruleName", + ScheduledQueryRuleName: "scheduledQueryRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseScheduledQueryRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ScheduledQueryRuleName: "ruleName", + ScheduledQueryRuleName: "scheduledQueryRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/scheduledQueryRules/scheduledQueryRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/sChEdUlEdQuErYrUlEnAmE", Expected: &ScheduledQueryRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ScheduledQueryRuleName: "rUlEnAmE", + ScheduledQueryRuleName: "sChEdUlEdQuErYrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/sChEdUlEdQuErYrUlEs/sChEdUlEdQuErYrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/insights/2023-04-03/azuremonitorworkspaces/README.md b/resource-manager/insights/2023-04-03/azuremonitorworkspaces/README.md index 6976ecbf7ae..361317b14fa 100644 --- a/resource-manager/insights/2023-04-03/azuremonitorworkspaces/README.md +++ b/resource-manager/insights/2023-04-03/azuremonitorworkspaces/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := azuremonitorworkspaces.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureMonitorWorkspaceName") +id := azuremonitorworkspaces.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") payload := azuremonitorworkspaces.AzureMonitorWorkspaceResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := azuremonitorworkspaces.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureMonitorWorkspaceName") +id := azuremonitorworkspaces.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := azuremonitorworkspaces.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureMonitorWorkspaceName") +id := azuremonitorworkspaces.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") read, err := client.Get(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := azuremonitorworkspaces.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureMonitorWorkspaceName") +id := azuremonitorworkspaces.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") payload := azuremonitorworkspaces.AzureMonitorWorkspaceResourceForUpdate{ // ... diff --git a/resource-manager/insights/2023-04-03/azuremonitorworkspaces/id_account.go b/resource-manager/insights/2023-04-03/azuremonitorworkspaces/id_account.go index b485d0acecf..8beb90b5b47 100644 --- a/resource-manager/insights/2023-04-03/azuremonitorworkspaces/id_account.go +++ b/resource-manager/insights/2023-04-03/azuremonitorworkspaces/id_account.go @@ -115,7 +115,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMonitor", "Microsoft.Monitor", "Microsoft.Monitor"), resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), - resourceids.UserSpecifiedSegment("accountName", "azureMonitorWorkspaceName"), + resourceids.UserSpecifiedSegment("accountName", "accountName"), } } diff --git a/resource-manager/insights/2023-04-03/azuremonitorworkspaces/id_account_test.go b/resource-manager/insights/2023-04-03/azuremonitorworkspaces/id_account_test.go index f502945daee..ad3e1d5ee6b 100644 --- a/resource-manager/insights/2023-04-03/azuremonitorworkspaces/id_account_test.go +++ b/resource-manager/insights/2023-04-03/azuremonitorworkspaces/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureMonitorWorkspaceName") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AccountName != "azureMonitorWorkspaceName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "azureMonitorWorkspaceName") + if id.AccountName != "accountName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountName") } } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureMonitorWorkspaceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/azureMonitorWorkspaceName" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/accountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/azureMonitorWorkspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccountName: "azureMonitorWorkspaceName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/azureMonitorWorkspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/accountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/azureMonitorWorkspaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AccountName: "azureMonitorWorkspaceName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/azureMonitorWorkspaceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Monitor/accounts/accountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mOnItOr/aCcOuNtS/aZuReMoNiToRwOrKsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mOnItOr/aCcOuNtS/aCcOuNtNaMe", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AccountName: "aZuReMoNiToRwOrKsPaCeNaMe", + AccountName: "aCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mOnItOr/aCcOuNtS/aZuReMoNiToRwOrKsPaCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mOnItOr/aCcOuNtS/aCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/iotcentral/2021-11-01-preview/apps/README.md b/resource-manager/iotcentral/2021-11-01-preview/apps/README.md index 9cd14c17bb4..c571e8280f9 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/apps/README.md +++ b/resource-manager/iotcentral/2021-11-01-preview/apps/README.md @@ -67,7 +67,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := apps.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := apps.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName") payload := apps.App{ // ... @@ -84,7 +84,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := apps.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := apps.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -96,7 +96,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := apps.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := apps.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName") read, err := client.Get(ctx, id) if err != nil { @@ -163,7 +163,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := apps.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := apps.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName") payload := apps.AppPatch{ // ... diff --git a/resource-manager/iotcentral/2021-11-01-preview/apps/id_iotapp.go b/resource-manager/iotcentral/2021-11-01-preview/apps/id_iotapp.go index 2a887f3f998..63348a65da2 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/apps/id_iotapp.go +++ b/resource-manager/iotcentral/2021-11-01-preview/apps/id_iotapp.go @@ -115,7 +115,7 @@ func (id IotAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftIoTCentral", "Microsoft.IoTCentral", "Microsoft.IoTCentral"), resourceids.StaticSegment("staticIotApps", "iotApps", "iotApps"), - resourceids.UserSpecifiedSegment("iotAppName", "resourceName"), + resourceids.UserSpecifiedSegment("iotAppName", "iotAppName"), } } diff --git a/resource-manager/iotcentral/2021-11-01-preview/apps/id_iotapp_test.go b/resource-manager/iotcentral/2021-11-01-preview/apps/id_iotapp_test.go index 47295d1979e..58a4bce6b97 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/apps/id_iotapp_test.go +++ b/resource-manager/iotcentral/2021-11-01-preview/apps/id_iotapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IotAppId{} func TestNewIotAppID(t *testing.T) { - id := NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewIotAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.IotAppName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'IotAppName'", id.IotAppName, "resourceName") + if id.IotAppName != "iotAppName" { + t.Fatalf("Expected %q but got %q for Segment 'IotAppName'", id.IotAppName, "iotAppName") } } func TestFormatIotAppID(t *testing.T) { - actual := NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName" + actual := NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseIotAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName", Expected: &IotAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IotAppName: "resourceName", + IotAppName: "iotAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseIotAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName", Expected: &IotAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IotAppName: "resourceName", + IotAppName: "iotAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE", Expected: &IotAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IotAppName: "rEsOuRcEnAmE", + IotAppName: "iOtApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/iotcentral/2021-11-01-preview/networking/README.md b/resource-manager/iotcentral/2021-11-01-preview/networking/README.md index 3aa045f6aeb..3e7be34483b 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/networking/README.md +++ b/resource-manager/iotcentral/2021-11-01-preview/networking/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := networking.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := networking.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName", "privateEndpointConnectionName") payload := networking.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.PrivateEndpointConnectionsCreateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := networking.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := networking.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName", "privateEndpointConnectionName") if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := networking.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := networking.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName", "privateEndpointConnectionName") read, err := client.PrivateEndpointConnectionsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networking.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := networking.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName") read, err := client.PrivateEndpointConnectionsList(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networking.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId") +id := networking.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName", "groupId") read, err := client.PrivateLinksGet(ctx, id) if err != nil { @@ -101,7 +101,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networking.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := networking.NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName") read, err := client.PrivateLinksList(ctx, id) if err != nil { diff --git a/resource-manager/iotcentral/2021-11-01-preview/networking/id_iotapp.go b/resource-manager/iotcentral/2021-11-01-preview/networking/id_iotapp.go index f006591b53a..e8384b79dce 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/networking/id_iotapp.go +++ b/resource-manager/iotcentral/2021-11-01-preview/networking/id_iotapp.go @@ -115,7 +115,7 @@ func (id IotAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftIoTCentral", "Microsoft.IoTCentral", "Microsoft.IoTCentral"), resourceids.StaticSegment("staticIotApps", "iotApps", "iotApps"), - resourceids.UserSpecifiedSegment("iotAppName", "resourceName"), + resourceids.UserSpecifiedSegment("iotAppName", "iotAppName"), } } diff --git a/resource-manager/iotcentral/2021-11-01-preview/networking/id_iotapp_test.go b/resource-manager/iotcentral/2021-11-01-preview/networking/id_iotapp_test.go index 2c31273d7ec..5e88c9333f7 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/networking/id_iotapp_test.go +++ b/resource-manager/iotcentral/2021-11-01-preview/networking/id_iotapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IotAppId{} func TestNewIotAppID(t *testing.T) { - id := NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewIotAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.IotAppName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'IotAppName'", id.IotAppName, "resourceName") + if id.IotAppName != "iotAppName" { + t.Fatalf("Expected %q but got %q for Segment 'IotAppName'", id.IotAppName, "iotAppName") } } func TestFormatIotAppID(t *testing.T) { - actual := NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName" + actual := NewIotAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseIotAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName", Expected: &IotAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IotAppName: "resourceName", + IotAppName: "iotAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseIotAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName", Expected: &IotAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IotAppName: "resourceName", + IotAppName: "iotAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE", Expected: &IotAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IotAppName: "rEsOuRcEnAmE", + IotAppName: "iOtApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/iotcentral/2021-11-01-preview/networking/id_privateendpointconnection.go b/resource-manager/iotcentral/2021-11-01-preview/networking/id_privateendpointconnection.go index 4b0a68ea10a..a0ee71d2c96 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/networking/id_privateendpointconnection.go +++ b/resource-manager/iotcentral/2021-11-01-preview/networking/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftIoTCentral", "Microsoft.IoTCentral", "Microsoft.IoTCentral"), resourceids.StaticSegment("staticIotApps", "iotApps", "iotApps"), - resourceids.UserSpecifiedSegment("iotAppName", "resourceName"), + resourceids.UserSpecifiedSegment("iotAppName", "iotAppName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/iotcentral/2021-11-01-preview/networking/id_privateendpointconnection_test.go b/resource-manager/iotcentral/2021-11-01-preview/networking/id_privateendpointconnection_test.go index 981fb793c49..532c8471c8a 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/networking/id_privateendpointconnection_test.go +++ b/resource-manager/iotcentral/2021-11-01-preview/networking/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.IotAppName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'IotAppName'", id.IotAppName, "resourceName") + if id.IotAppName != "iotAppName" { + t.Fatalf("Expected %q but got %q for Segment 'IotAppName'", id.IotAppName, "iotAppName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IotAppName: "resourceName", + IotAppName: "iotAppName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IotAppName: "resourceName", + IotAppName: "iotAppName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IotAppName: "rEsOuRcEnAmE", + IotAppName: "iOtApPnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/iotcentral/2021-11-01-preview/networking/id_privatelinkresource.go b/resource-manager/iotcentral/2021-11-01-preview/networking/id_privatelinkresource.go index 9ce01132734..24895cf8319 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/networking/id_privatelinkresource.go +++ b/resource-manager/iotcentral/2021-11-01-preview/networking/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftIoTCentral", "Microsoft.IoTCentral", "Microsoft.IoTCentral"), resourceids.StaticSegment("staticIotApps", "iotApps", "iotApps"), - resourceids.UserSpecifiedSegment("iotAppName", "resourceName"), + resourceids.UserSpecifiedSegment("iotAppName", "iotAppName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("groupId", "groupId"), } diff --git a/resource-manager/iotcentral/2021-11-01-preview/networking/id_privatelinkresource_test.go b/resource-manager/iotcentral/2021-11-01-preview/networking/id_privatelinkresource_test.go index f41a4f1f37c..2f9f9c34522 100644 --- a/resource-manager/iotcentral/2021-11-01-preview/networking/id_privatelinkresource_test.go +++ b/resource-manager/iotcentral/2021-11-01-preview/networking/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName", "groupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.IotAppName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'IotAppName'", id.IotAppName, "resourceName") + if id.IotAppName != "iotAppName" { + t.Fatalf("Expected %q but got %q for Segment 'IotAppName'", id.IotAppName, "iotAppName") } if id.GroupId != "groupId" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "groupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateLinkResources/groupId" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotAppName", "groupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateLinkResources/groupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateLinkResources/groupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateLinkResources/groupId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IotAppName: "resourceName", + IotAppName: "iotAppName", GroupId: "groupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateLinkResources/groupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateLinkResources/groupId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateLinkResources/groupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateLinkResources/groupId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IotAppName: "resourceName", + IotAppName: "iotAppName", GroupId: "groupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/resourceName/privateLinkResources/groupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.IoTCentral/iotApps/iotAppName/privateLinkResources/groupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpId", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IotAppName: "rEsOuRcEnAmE", + IotAppName: "iOtApPnAmE", GroupId: "gRoUpId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/rEsOuRcEnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iOtCeNtRaL/iOtApPs/iOtApPnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpId/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/managedhsmkeys/README.md b/resource-manager/keyvault/2023-02-01/managedhsmkeys/README.md index c39391e0862..fc97c3a3236 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsmkeys/README.md +++ b/resource-manager/keyvault/2023-02-01/managedhsmkeys/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName") +id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName") payload := managedhsmkeys.ManagedHsmKeyCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName") +id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsmkeys.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName", "keyVersion") +id := managedhsmkeys.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName", "versionName") read, err := client.GetVersion(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsmkeys.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsmkeys.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName") +id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName") // alternatively `client.ListVersions(ctx, id)` can be used to do batched pagination items, err := client.ListVersionsComplete(ctx, id) diff --git a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_key.go b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_key.go index 04a7e183e82..dd39b431e21 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_key.go +++ b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_key.go @@ -121,7 +121,7 @@ func (id KeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), resourceids.UserSpecifiedSegment("keyName", "keyName"), } diff --git a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_key_test.go b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_key_test.go index e340a60f3c2..b1a5df070b4 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_key_test.go +++ b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_key_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KeyId{} func TestNewKeyID(t *testing.T) { - id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName") + id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } if id.KeyName != "keyName" { @@ -32,8 +32,8 @@ func TestNewKeyID(t *testing.T) { } func TestFormatKeyID(t *testing.T) { - actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName" + actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_managedhsm.go b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_managedhsm.go index 41142a5626d..aea1e0c0000 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_managedhsm.go +++ b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_managedhsm_test.go b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_managedhsm_test.go index 1adc2a903da..7942622b058 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_version.go b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_version.go index b5c50d5f330..fdf99d70b75 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_version.go +++ b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_version.go @@ -127,11 +127,11 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), resourceids.UserSpecifiedSegment("keyName", "keyName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "keyVersion"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_version_test.go b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_version_test.go index ebfa3029fca..562636f04e4 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_version_test.go +++ b/resource-manager/keyvault/2023-02-01/managedhsmkeys/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName", "keyVersion") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } if id.KeyName != "keyName" { t.Fatalf("Expected %q but got %q for Segment 'KeyName'", id.KeyName, "keyName") } - if id.VersionName != "keyVersion" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "keyVersion") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName", "keyVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", KeyName: "keyName", - VersionName: "keyVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", KeyName: "keyName", - VersionName: "keyVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe/vErSiOnS/kEyVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", KeyName: "kEyNaMe", - VersionName: "kEyVeRsIoN", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe/vErSiOnS/kEyVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/managedhsms/README.md b/resource-manager/keyvault/2023-02-01/managedhsms/README.md index 5875b3ca0f8..bc6230377f7 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsms/README.md +++ b/resource-manager/keyvault/2023-02-01/managedhsms/README.md @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") payload := managedhsms.ManagedHsm{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -75,7 +75,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") read, err := client.Get(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsms.NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "location", "name") +id := managedhsms.NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "locationName", "deletedManagedHSMName") read, err := client.GetDeleted(ctx, id) if err != nil { @@ -158,7 +158,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedhsms.NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "location", "name") +id := managedhsms.NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "locationName", "deletedManagedHSMName") if err := client.PurgeDeletedThenPoll(ctx, id); err != nil { // handle the error @@ -170,7 +170,7 @@ if err := client.PurgeDeletedThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") payload := managedhsms.ManagedHsm{ // ... diff --git a/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm.go b/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm.go index 688949e5b66..38f9e319b85 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm.go +++ b/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm.go @@ -113,9 +113,9 @@ func (id DeletedManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedManagedHSMs", "deletedManagedHSMs", "deletedManagedHSMs"), - resourceids.UserSpecifiedSegment("deletedManagedHSMName", "name"), + resourceids.UserSpecifiedSegment("deletedManagedHSMName", "deletedManagedHSMName"), } } diff --git a/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm_test.go b/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm_test.go index 88776603677..6a00580931a 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm_test.go +++ b/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedManagedHSMId{} func TestNewDeletedManagedHSMID(t *testing.T) { - id := NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "location", "name") + id := NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "locationName", "deletedManagedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedManagedHSMName'", id.DeletedManagedHSMName, "name") + if id.DeletedManagedHSMName != "deletedManagedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedManagedHSMName'", id.DeletedManagedHSMName, "deletedManagedHSMName") } } func TestFormatDeletedManagedHSMID(t *testing.T) { - actual := NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "location", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name" + actual := NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "locationName", "deletedManagedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedManagedHSMID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName", Expected: &DeletedManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedManagedHSMName: "name", + LocationName: "locationName", + DeletedManagedHSMName: "deletedManagedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedManagedHSMIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdMaNaGeDhSmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdMaNaGeDhSmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName", Expected: &DeletedManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedManagedHSMName: "name", + LocationName: "locationName", + DeletedManagedHSMName: "deletedManagedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdMaNaGeDhSmS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdMaNaGeDhSmS/dElEtEdMaNaGeDhSmNaMe", Expected: &DeletedManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedManagedHSMName: "nAmE", + LocationName: "lOcAtIoNnAmE", + DeletedManagedHSMName: "dElEtEdMaNaGeDhSmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdMaNaGeDhSmS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdMaNaGeDhSmS/dElEtEdMaNaGeDhSmNaMe/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm.go b/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm.go index e960056dec1..53b05210ec3 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm.go +++ b/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm_test.go b/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm_test.go index 5791868157c..67cd6ac27d0 100644 --- a/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/README.md b/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/README.md index cf027188f4f..6180343af21 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/README.md +++ b/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mhsmlistprivateendpointconnections.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := mhsmlistprivateendpointconnections.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") // alternatively `client.MHSMPrivateEndpointConnectionsListByResource(ctx, id)` can be used to do batched pagination items, err := client.MHSMPrivateEndpointConnectionsListByResourceComplete(ctx, id) diff --git a/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/id_managedhsm.go b/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/id_managedhsm.go index 06640821903..d6cd800d486 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/id_managedhsm.go +++ b/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/id_managedhsm_test.go b/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/id_managedhsm_test.go index 260fccb77ec..0278e7c0b5c 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-02-01/mhsmlistprivateendpointconnections/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/mhsmlistregions/README.md b/resource-manager/keyvault/2023-02-01/mhsmlistregions/README.md index e383bac386b..641a0d7e2cc 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmlistregions/README.md +++ b/resource-manager/keyvault/2023-02-01/mhsmlistregions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mhsmlistregions.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := mhsmlistregions.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") // alternatively `client.MHSMRegionsListByResource(ctx, id)` can be used to do batched pagination items, err := client.MHSMRegionsListByResourceComplete(ctx, id) diff --git a/resource-manager/keyvault/2023-02-01/mhsmlistregions/id_managedhsm.go b/resource-manager/keyvault/2023-02-01/mhsmlistregions/id_managedhsm.go index 0777a7aa75f..c0f864925b2 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmlistregions/id_managedhsm.go +++ b/resource-manager/keyvault/2023-02-01/mhsmlistregions/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-02-01/mhsmlistregions/id_managedhsm_test.go b/resource-manager/keyvault/2023-02-01/mhsmlistregions/id_managedhsm_test.go index f347ecd3fc0..7c2608304e9 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmlistregions/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-02-01/mhsmlistregions/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/README.md b/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/README.md index 2e704273457..2337891e7e9 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/README.md +++ b/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName") payload := mhsmprivateendpointconnections.MHSMPrivateEndpointConnection{ // ... diff --git a/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/id_privateendpointconnection.go b/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/id_privateendpointconnection.go index 740188988ce..4a79649fb14 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/id_privateendpointconnection_test.go index 982fea7b2b7..4c384117c35 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/keyvault/2023-02-01/mhsmprivateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/README.md b/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/README.md index a48d6c29f9a..05805ca8ed4 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/README.md +++ b/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mhsmprivatelinkresources.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := mhsmprivatelinkresources.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") read, err := client.ListByMHSMResource(ctx, id) if err != nil { diff --git a/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/id_managedhsm.go b/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/id_managedhsm.go index d359c3bd014..0773a999e3d 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/id_managedhsm.go +++ b/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/id_managedhsm_test.go b/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/id_managedhsm_test.go index 429aac217af..0afe45bdb8e 100644 --- a/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-02-01/mhsmprivatelinkresources/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-02-01/vaults/README.md b/resource-manager/keyvault/2023-02-01/vaults/README.md index 4711db3cb72..59cf70c7fe0 100644 --- a/resource-manager/keyvault/2023-02-01/vaults/README.md +++ b/resource-manager/keyvault/2023-02-01/vaults/README.md @@ -95,7 +95,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vaults.NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "location", "vaultName") +id := vaults.NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "locationName", "deletedVaultName") read, err := client.GetDeleted(ctx, id) if err != nil { @@ -179,7 +179,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vaults.NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "location", "vaultName") +id := vaults.NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "locationName", "deletedVaultName") if err := client.PurgeDeletedThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/keyvault/2023-02-01/vaults/id_deletedvault.go b/resource-manager/keyvault/2023-02-01/vaults/id_deletedvault.go index 33bdd26f105..f9769000e5d 100644 --- a/resource-manager/keyvault/2023-02-01/vaults/id_deletedvault.go +++ b/resource-manager/keyvault/2023-02-01/vaults/id_deletedvault.go @@ -113,9 +113,9 @@ func (id DeletedVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedVaults", "deletedVaults", "deletedVaults"), - resourceids.UserSpecifiedSegment("deletedVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("deletedVaultName", "deletedVaultName"), } } diff --git a/resource-manager/keyvault/2023-02-01/vaults/id_deletedvault_test.go b/resource-manager/keyvault/2023-02-01/vaults/id_deletedvault_test.go index fc697b5fec2..10ca0ba01ad 100644 --- a/resource-manager/keyvault/2023-02-01/vaults/id_deletedvault_test.go +++ b/resource-manager/keyvault/2023-02-01/vaults/id_deletedvault_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedVaultId{} func TestNewDeletedVaultID(t *testing.T) { - id := NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "location", "vaultName") + id := NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "locationName", "deletedVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedVaultName'", id.DeletedVaultName, "vaultName") + if id.DeletedVaultName != "deletedVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedVaultName'", id.DeletedVaultName, "deletedVaultName") } } func TestFormatDeletedVaultID(t *testing.T) { - actual := NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "location", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName" + actual := NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "locationName", "deletedVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedVaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName", Expected: &DeletedVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedVaultName: "vaultName", + LocationName: "locationName", + DeletedVaultName: "deletedVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedVaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdVaUlTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdVaUlTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName", Expected: &DeletedVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedVaultName: "vaultName", + LocationName: "locationName", + DeletedVaultName: "deletedVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdVaUlTs/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdVaUlTs/dElEtEdVaUlTnAmE", Expected: &DeletedVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedVaultName: "vAuLtNaMe", + LocationName: "lOcAtIoNnAmE", + DeletedVaultName: "dElEtEdVaUlTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdVaUlTs/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdVaUlTs/dElEtEdVaUlTnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/managedhsmkeys/README.md b/resource-manager/keyvault/2023-07-01/managedhsmkeys/README.md index c013b9700a6..f75ed2261d5 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsmkeys/README.md +++ b/resource-manager/keyvault/2023-07-01/managedhsmkeys/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName") +id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName") payload := managedhsmkeys.ManagedHsmKeyCreateParameters{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName") +id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsmkeys.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName", "keyVersion") +id := managedhsmkeys.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName", "versionName") read, err := client.GetVersion(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsmkeys.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsmkeys.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName") +id := managedhsmkeys.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName") // alternatively `client.ListVersions(ctx, id)` can be used to do batched pagination items, err := client.ListVersionsComplete(ctx, id) diff --git a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_key.go b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_key.go index 04a7e183e82..dd39b431e21 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_key.go +++ b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_key.go @@ -121,7 +121,7 @@ func (id KeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), resourceids.UserSpecifiedSegment("keyName", "keyName"), } diff --git a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_key_test.go b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_key_test.go index e340a60f3c2..b1a5df070b4 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_key_test.go +++ b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_key_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KeyId{} func TestNewKeyID(t *testing.T) { - id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName") + id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } if id.KeyName != "keyName" { @@ -32,8 +32,8 @@ func TestNewKeyID(t *testing.T) { } func TestFormatKeyID(t *testing.T) { - actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName" + actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_managedhsm.go b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_managedhsm.go index 41142a5626d..aea1e0c0000 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_managedhsm.go +++ b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_managedhsm_test.go b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_managedhsm_test.go index 1adc2a903da..7942622b058 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_version.go b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_version.go index b5c50d5f330..fdf99d70b75 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_version.go +++ b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_version.go @@ -127,11 +127,11 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), resourceids.UserSpecifiedSegment("keyName", "keyName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "keyVersion"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_version_test.go b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_version_test.go index ebfa3029fca..562636f04e4 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_version_test.go +++ b/resource-manager/keyvault/2023-07-01/managedhsmkeys/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName", "keyVersion") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } if id.KeyName != "keyName" { t.Fatalf("Expected %q but got %q for Segment 'KeyName'", id.KeyName, "keyName") } - if id.VersionName != "keyVersion" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "keyVersion") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyName", "keyVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "keyName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", KeyName: "keyName", - VersionName: "keyVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", KeyName: "keyName", - VersionName: "keyVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/keys/keyName/versions/keyVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/keys/keyName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe/vErSiOnS/kEyVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", KeyName: "kEyNaMe", - VersionName: "kEyVeRsIoN", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/kEyS/kEyNaMe/vErSiOnS/kEyVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/kEyS/kEyNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/managedhsms/README.md b/resource-manager/keyvault/2023-07-01/managedhsms/README.md index e708340f1b5..b58352294e4 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsms/README.md +++ b/resource-manager/keyvault/2023-07-01/managedhsms/README.md @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") payload := managedhsms.ManagedHsm{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -75,7 +75,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") read, err := client.Get(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedhsms.NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "location", "name") +id := managedhsms.NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "locationName", "deletedManagedHSMName") read, err := client.GetDeleted(ctx, id) if err != nil { @@ -158,7 +158,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedhsms.NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "location", "name") +id := managedhsms.NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "locationName", "deletedManagedHSMName") if err := client.PurgeDeletedThenPoll(ctx, id); err != nil { // handle the error @@ -170,7 +170,7 @@ if err := client.PurgeDeletedThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := managedhsms.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") payload := managedhsms.ManagedHsm{ // ... diff --git a/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm.go b/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm.go index 688949e5b66..38f9e319b85 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm.go +++ b/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm.go @@ -113,9 +113,9 @@ func (id DeletedManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedManagedHSMs", "deletedManagedHSMs", "deletedManagedHSMs"), - resourceids.UserSpecifiedSegment("deletedManagedHSMName", "name"), + resourceids.UserSpecifiedSegment("deletedManagedHSMName", "deletedManagedHSMName"), } } diff --git a/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm_test.go b/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm_test.go index 88776603677..6a00580931a 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm_test.go +++ b/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedManagedHSMId{} func TestNewDeletedManagedHSMID(t *testing.T) { - id := NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "location", "name") + id := NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "locationName", "deletedManagedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedManagedHSMName'", id.DeletedManagedHSMName, "name") + if id.DeletedManagedHSMName != "deletedManagedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedManagedHSMName'", id.DeletedManagedHSMName, "deletedManagedHSMName") } } func TestFormatDeletedManagedHSMID(t *testing.T) { - actual := NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "location", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name" + actual := NewDeletedManagedHSMID("12345678-1234-9876-4563-123456789012", "locationName", "deletedManagedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedManagedHSMID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName", Expected: &DeletedManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedManagedHSMName: "name", + LocationName: "locationName", + DeletedManagedHSMName: "deletedManagedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedManagedHSMIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdMaNaGeDhSmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdMaNaGeDhSmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName", Expected: &DeletedManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedManagedHSMName: "name", + LocationName: "locationName", + DeletedManagedHSMName: "deletedManagedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedManagedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedManagedHSMs/deletedManagedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdMaNaGeDhSmS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdMaNaGeDhSmS/dElEtEdMaNaGeDhSmNaMe", Expected: &DeletedManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedManagedHSMName: "nAmE", + LocationName: "lOcAtIoNnAmE", + DeletedManagedHSMName: "dElEtEdMaNaGeDhSmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdMaNaGeDhSmS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdMaNaGeDhSmS/dElEtEdMaNaGeDhSmNaMe/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm.go b/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm.go index e960056dec1..53b05210ec3 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm.go +++ b/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm_test.go b/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm_test.go index 5791868157c..67cd6ac27d0 100644 --- a/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/README.md b/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/README.md index 834d49bd681..38bef8766a9 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/README.md +++ b/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mhsmlistprivateendpointconnections.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := mhsmlistprivateendpointconnections.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") // alternatively `client.MHSMPrivateEndpointConnectionsListByResource(ctx, id)` can be used to do batched pagination items, err := client.MHSMPrivateEndpointConnectionsListByResourceComplete(ctx, id) diff --git a/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/id_managedhsm.go b/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/id_managedhsm.go index 06640821903..d6cd800d486 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/id_managedhsm.go +++ b/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/id_managedhsm_test.go b/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/id_managedhsm_test.go index 260fccb77ec..0278e7c0b5c 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-07-01/mhsmlistprivateendpointconnections/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/mhsmlistregions/README.md b/resource-manager/keyvault/2023-07-01/mhsmlistregions/README.md index 0884cd4fb9c..150493a0af8 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmlistregions/README.md +++ b/resource-manager/keyvault/2023-07-01/mhsmlistregions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mhsmlistregions.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := mhsmlistregions.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") // alternatively `client.MHSMRegionsListByResource(ctx, id)` can be used to do batched pagination items, err := client.MHSMRegionsListByResourceComplete(ctx, id) diff --git a/resource-manager/keyvault/2023-07-01/mhsmlistregions/id_managedhsm.go b/resource-manager/keyvault/2023-07-01/mhsmlistregions/id_managedhsm.go index 0777a7aa75f..c0f864925b2 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmlistregions/id_managedhsm.go +++ b/resource-manager/keyvault/2023-07-01/mhsmlistregions/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-07-01/mhsmlistregions/id_managedhsm_test.go b/resource-manager/keyvault/2023-07-01/mhsmlistregions/id_managedhsm_test.go index f347ecd3fc0..7c2608304e9 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmlistregions/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-07-01/mhsmlistregions/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/README.md b/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/README.md index b1dd986162b..44d4f992dc6 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/README.md +++ b/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := mhsmprivateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName") payload := mhsmprivateendpointconnections.MHSMPrivateEndpointConnection{ // ... diff --git a/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/id_privateendpointconnection.go b/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/id_privateendpointconnection.go index 740188988ce..4a79649fb14 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/id_privateendpointconnection_test.go index 982fea7b2b7..4c384117c35 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/keyvault/2023-07-01/mhsmprivateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/README.md b/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/README.md index 278e891a96f..0d9bd0b29bf 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/README.md +++ b/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mhsmprivatelinkresources.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := mhsmprivatelinkresources.NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") read, err := client.ListByMHSMResource(ctx, id) if err != nil { diff --git a/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/id_managedhsm.go b/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/id_managedhsm.go index d359c3bd014..0773a999e3d 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/id_managedhsm.go +++ b/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/id_managedhsm.go @@ -115,7 +115,7 @@ func (id ManagedHSMId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticManagedHSMs", "managedHSMs", "managedHSMs"), - resourceids.UserSpecifiedSegment("managedHSMName", "name"), + resourceids.UserSpecifiedSegment("managedHSMName", "managedHSMName"), } } diff --git a/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/id_managedhsm_test.go b/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/id_managedhsm_test.go index 429aac217af..0afe45bdb8e 100644 --- a/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/id_managedhsm_test.go +++ b/resource-manager/keyvault/2023-07-01/mhsmprivatelinkresources/id_managedhsm_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedHSMId{} func TestNewManagedHSMID(t *testing.T) { - id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedHSMID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedHSMName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "name") + if id.ManagedHSMName != "managedHSMName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedHSMName'", id.ManagedHSMName, "managedHSMName") } } func TestFormatManagedHSMID(t *testing.T) { - actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name" + actual := NewManagedHSMID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedHSMName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedHSMID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedHSMIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedHSMName: "name", + ManagedHSMName: "managedHSMName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.KeyVault/managedHSMs/managedHSMName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE", Expected: &ManagedHSMId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedHSMName: "nAmE", + ManagedHSMName: "mAnAgEdHsMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.kEyVaUlT/mAnAgEdHsMs/mAnAgEdHsMnAmE/extra", Error: true, }, } diff --git a/resource-manager/keyvault/2023-07-01/vaults/README.md b/resource-manager/keyvault/2023-07-01/vaults/README.md index cb759a8446c..d072a824e53 100644 --- a/resource-manager/keyvault/2023-07-01/vaults/README.md +++ b/resource-manager/keyvault/2023-07-01/vaults/README.md @@ -95,7 +95,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vaults.NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "location", "vaultName") +id := vaults.NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "locationName", "deletedVaultName") read, err := client.GetDeleted(ctx, id) if err != nil { @@ -179,7 +179,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vaults.NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "location", "vaultName") +id := vaults.NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "locationName", "deletedVaultName") if err := client.PurgeDeletedThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/keyvault/2023-07-01/vaults/id_deletedvault.go b/resource-manager/keyvault/2023-07-01/vaults/id_deletedvault.go index 33bdd26f105..f9769000e5d 100644 --- a/resource-manager/keyvault/2023-07-01/vaults/id_deletedvault.go +++ b/resource-manager/keyvault/2023-07-01/vaults/id_deletedvault.go @@ -113,9 +113,9 @@ func (id DeletedVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKeyVault", "Microsoft.KeyVault", "Microsoft.KeyVault"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedVaults", "deletedVaults", "deletedVaults"), - resourceids.UserSpecifiedSegment("deletedVaultName", "vaultName"), + resourceids.UserSpecifiedSegment("deletedVaultName", "deletedVaultName"), } } diff --git a/resource-manager/keyvault/2023-07-01/vaults/id_deletedvault_test.go b/resource-manager/keyvault/2023-07-01/vaults/id_deletedvault_test.go index fc697b5fec2..10ca0ba01ad 100644 --- a/resource-manager/keyvault/2023-07-01/vaults/id_deletedvault_test.go +++ b/resource-manager/keyvault/2023-07-01/vaults/id_deletedvault_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DeletedVaultId{} func TestNewDeletedVaultID(t *testing.T) { - id := NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "location", "vaultName") + id := NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "locationName", "deletedVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DeletedVaultName != "vaultName" { - t.Fatalf("Expected %q but got %q for Segment 'DeletedVaultName'", id.DeletedVaultName, "vaultName") + if id.DeletedVaultName != "deletedVaultName" { + t.Fatalf("Expected %q but got %q for Segment 'DeletedVaultName'", id.DeletedVaultName, "deletedVaultName") } } func TestFormatDeletedVaultID(t *testing.T) { - actual := NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "location", "vaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName" + actual := NewDeletedVaultID("12345678-1234-9876-4563-123456789012", "locationName", "deletedVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedVaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName", Expected: &DeletedVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedVaultName: "vaultName", + LocationName: "locationName", + DeletedVaultName: "deletedVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedVaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdVaUlTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdVaUlTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName", Expected: &DeletedVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DeletedVaultName: "vaultName", + LocationName: "locationName", + DeletedVaultName: "deletedVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/location/deletedVaults/vaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.KeyVault/locations/locationName/deletedVaults/deletedVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdVaUlTs/vAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdVaUlTs/dElEtEdVaUlTnAmE", Expected: &DeletedVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DeletedVaultName: "vAuLtNaMe", + LocationName: "lOcAtIoNnAmE", + DeletedVaultName: "dElEtEdVaUlTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoN/dElEtEdVaUlTs/vAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kEyVaUlT/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdVaUlTs/dElEtEdVaUlTnAmE/extra", Error: true, }, } diff --git a/resource-manager/kubernetesconfiguration/2022-11-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go b/resource-manager/kubernetesconfiguration/2022-11-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go index dd979aadd87..ed60cf93565 100644 --- a/resource-manager/kubernetesconfiguration/2022-11-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go +++ b/resource-manager/kubernetesconfiguration/2022-11-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go @@ -15,6 +15,6 @@ type SourceControlConfigurationProperties struct { OperatorType *OperatorType `json:"operatorType,omitempty"` ProvisioningState *ProvisioningStateType `json:"provisioningState,omitempty"` RepositoryPublicKey *string `json:"repositoryPublicKey,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` SshKnownHostsContents *string `json:"sshKnownHostsContents,omitempty"` } diff --git a/resource-manager/kubernetesconfiguration/2023-05-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go b/resource-manager/kubernetesconfiguration/2023-05-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go index dd979aadd87..ed60cf93565 100644 --- a/resource-manager/kubernetesconfiguration/2023-05-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go +++ b/resource-manager/kubernetesconfiguration/2023-05-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go @@ -15,6 +15,6 @@ type SourceControlConfigurationProperties struct { OperatorType *OperatorType `json:"operatorType,omitempty"` ProvisioningState *ProvisioningStateType `json:"provisioningState,omitempty"` RepositoryPublicKey *string `json:"repositoryPublicKey,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` SshKnownHostsContents *string `json:"sshKnownHostsContents,omitempty"` } diff --git a/resource-manager/kusto/2023-08-15/attacheddatabaseconfigurations/README.md b/resource-manager/kusto/2023-08-15/attacheddatabaseconfigurations/README.md index 9dd06e77930..19bc05b5de4 100644 --- a/resource-manager/kusto/2023-08-15/attacheddatabaseconfigurations/README.md +++ b/resource-manager/kusto/2023-08-15/attacheddatabaseconfigurations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := attacheddatabaseconfigurations.AttachedDatabaseConfigurationsCheckNameRequest{ // ... @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/clusterprincipalassignments/README.md b/resource-manager/kusto/2023-08-15/clusterprincipalassignments/README.md index fda692e7c66..3b55f0c0b2f 100644 --- a/resource-manager/kusto/2023-08-15/clusterprincipalassignments/README.md +++ b/resource-manager/kusto/2023-08-15/clusterprincipalassignments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := clusterprincipalassignments.ClusterPrincipalAssignmentCheckNameRequest{ // ... @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/clusters/README.md b/resource-manager/kusto/2023-08-15/clusters/README.md index 8e8439c39c3..125c5316735 100644 --- a/resource-manager/kusto/2023-08-15/clusters/README.md +++ b/resource-manager/kusto/2023-08-15/clusters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := clusters.LanguageExtensionsList{ // ... @@ -42,7 +42,7 @@ if err := client.AddLanguageExtensionsThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := clusters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := clusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := clusters.ClusterCheckNameRequest{ // ... @@ -63,7 +63,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := clusters.Cluster{ // ... @@ -80,7 +80,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, clusters.DefaultCreate ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -92,7 +92,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := clusters.FollowerDatabaseDefinition{ // ... @@ -109,7 +109,7 @@ if err := client.DetachFollowerDatabasesThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") if err := client.DiagnoseVirtualNetworkThenPoll(ctx, id); err != nil { // handle the error @@ -121,7 +121,7 @@ if err := client.DiagnoseVirtualNetworkThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.Get(ctx, id) if err != nil { @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.ListFollowerDatabases(ctx, id) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.ListLanguageExtensions(ctx, id) if err != nil { @@ -201,7 +201,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.ListSkusByResource(ctx, id) if err != nil { @@ -217,7 +217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := clusters.ClusterMigrateRequest{ // ... @@ -234,7 +234,7 @@ if err := client.MigrateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := clusters.LanguageExtensionsList{ // ... @@ -251,7 +251,7 @@ if err := client.RemoveLanguageExtensionsThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") if err := client.StartThenPoll(ctx, id); err != nil { // handle the error @@ -263,7 +263,7 @@ if err := client.StartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") if err := client.StopThenPoll(ctx, id); err != nil { // handle the error @@ -275,7 +275,7 @@ if err := client.StopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := clusters.ClusterUpdate{ // ... diff --git a/resource-manager/kusto/2023-08-15/clusters/id_location.go b/resource-manager/kusto/2023-08-15/clusters/id_location.go index 0a5c1fb05e7..19571e74f04 100644 --- a/resource-manager/kusto/2023-08-15/clusters/id_location.go +++ b/resource-manager/kusto/2023-08-15/clusters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKusto", "Microsoft.Kusto", "Microsoft.Kusto"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/kusto/2023-08-15/clusters/id_location_test.go b/resource-manager/kusto/2023-08-15/clusters/id_location_test.go index aaa03343667..f5bc75b9954 100644 --- a/resource-manager/kusto/2023-08-15/clusters/id_location_test.go +++ b/resource-manager/kusto/2023-08-15/clusters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kUsTo/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kUsTo/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kUsTo/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kUsTo/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/kusto/2023-08-15/databaseprincipalassignments/README.md b/resource-manager/kusto/2023-08-15/databaseprincipalassignments/README.md index b84bd237a69..f20ed54e7f9 100644 --- a/resource-manager/kusto/2023-08-15/databaseprincipalassignments/README.md +++ b/resource-manager/kusto/2023-08-15/databaseprincipalassignments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := databaseprincipalassignments.DatabasePrincipalAssignmentCheckNameRequest{ // ... @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/databases/README.md b/resource-manager/kusto/2023-08-15/databases/README.md index d63f4bc8456..76582f900a1 100644 --- a/resource-manager/kusto/2023-08-15/databases/README.md +++ b/resource-manager/kusto/2023-08-15/databases/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := databases.DatabasePrincipalListRequest{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := databases.CheckNameRequest{ // ... @@ -67,7 +67,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := databases.Database{ // ... @@ -84,7 +84,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, databases.DefaultCreat ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := databases.DatabaseInviteFollowerRequest{ // ... @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -117,7 +117,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -133,7 +133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") // alternatively `client.ListByCluster(ctx, id, databases.DefaultListByClusterOperationOptions())` can be used to do batched pagination items, err := client.ListByClusterComplete(ctx, id, databases.DefaultListByClusterOperationOptions()) @@ -150,7 +150,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") read, err := client.ListPrincipals(ctx, id) if err != nil { @@ -166,7 +166,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := databases.DatabasePrincipalListRequest{ // ... @@ -187,7 +187,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := databases.Database{ // ... diff --git a/resource-manager/kusto/2023-08-15/dataconnections/README.md b/resource-manager/kusto/2023-08-15/dataconnections/README.md index d293e50663b..dda4bdebecc 100644 --- a/resource-manager/kusto/2023-08-15/dataconnections/README.md +++ b/resource-manager/kusto/2023-08-15/dataconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := dataconnections.DataConnectionCheckNameRequest{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := dataconnections.DataConnectionValidation{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") read, err := client.ListByDatabase(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/kusto/README.md b/resource-manager/kusto/2023-08-15/kusto/README.md index 86af2f7d653..46012be2d07 100644 --- a/resource-manager/kusto/2023-08-15/kusto/README.md +++ b/resource-manager/kusto/2023-08-15/kusto/README.md @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := kusto.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := kusto.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.SkusList(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/kusto/id_location.go b/resource-manager/kusto/2023-08-15/kusto/id_location.go index 23b025fd623..95b29f0e783 100644 --- a/resource-manager/kusto/2023-08-15/kusto/id_location.go +++ b/resource-manager/kusto/2023-08-15/kusto/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftKusto", "Microsoft.Kusto", "Microsoft.Kusto"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/kusto/2023-08-15/kusto/id_location_test.go b/resource-manager/kusto/2023-08-15/kusto/id_location_test.go index 5fc4dd5f746..f2b8171a641 100644 --- a/resource-manager/kusto/2023-08-15/kusto/id_location_test.go +++ b/resource-manager/kusto/2023-08-15/kusto/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Kusto/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kUsTo/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kUsTo/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kUsTo/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.kUsTo/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/kusto/2023-08-15/managedprivateendpoints/README.md b/resource-manager/kusto/2023-08-15/managedprivateendpoints/README.md index 2c586eab035..4505d20a7df 100644 --- a/resource-manager/kusto/2023-08-15/managedprivateendpoints/README.md +++ b/resource-manager/kusto/2023-08-15/managedprivateendpoints/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := managedprivateendpoints.ManagedPrivateEndpointsCheckNameRequest{ // ... @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/outboundnetworkdependenciesendpoints/README.md b/resource-manager/kusto/2023-08-15/outboundnetworkdependenciesendpoints/README.md index 8c478286660..0fa5863888e 100644 --- a/resource-manager/kusto/2023-08-15/outboundnetworkdependenciesendpoints/README.md +++ b/resource-manager/kusto/2023-08-15/outboundnetworkdependenciesendpoints/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") // alternatively `client.ClustersListOutboundNetworkDependenciesEndpoints(ctx, id)` can be used to do batched pagination items, err := client.ClustersListOutboundNetworkDependenciesEndpointsComplete(ctx, id) diff --git a/resource-manager/kusto/2023-08-15/privateendpointconnections/README.md b/resource-manager/kusto/2023-08-15/privateendpointconnections/README.md index 1e5a4266087..5be06e244cf 100644 --- a/resource-manager/kusto/2023-08-15/privateendpointconnections/README.md +++ b/resource-manager/kusto/2023-08-15/privateendpointconnections/README.md @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/privatelinkresources/README.md b/resource-manager/kusto/2023-08-15/privatelinkresources/README.md index 22162ade92b..1e63dbee243 100644 --- a/resource-manager/kusto/2023-08-15/privatelinkresources/README.md +++ b/resource-manager/kusto/2023-08-15/privatelinkresources/README.md @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/sandboxcustomimages/README.md b/resource-manager/kusto/2023-08-15/sandboxcustomimages/README.md index c97c8dbfde6..d21e6f35312 100644 --- a/resource-manager/kusto/2023-08-15/sandboxcustomimages/README.md +++ b/resource-manager/kusto/2023-08-15/sandboxcustomimages/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") payload := sandboxcustomimages.SandboxCustomImagesCheckNameRequest{ // ... @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName") +id := commonids.NewKustoClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") // alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByClusterComplete(ctx, id) diff --git a/resource-manager/kusto/2023-08-15/scripts/README.md b/resource-manager/kusto/2023-08-15/scripts/README.md index 05ea147d9ce..0f026292066 100644 --- a/resource-manager/kusto/2023-08-15/scripts/README.md +++ b/resource-manager/kusto/2023-08-15/scripts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") payload := scripts.ScriptCheckNameRequest{ // ... @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kustoClusterName", "kustoDatabaseName") +id := commonids.NewKustoDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") read, err := client.ListByDatabase(ctx, id) if err != nil { diff --git a/resource-manager/kusto/2023-08-15/scripts/model_scriptproperties.go b/resource-manager/kusto/2023-08-15/scripts/model_scriptproperties.go index c7494a45fd3..925afd57af3 100644 --- a/resource-manager/kusto/2023-08-15/scripts/model_scriptproperties.go +++ b/resource-manager/kusto/2023-08-15/scripts/model_scriptproperties.go @@ -8,6 +8,6 @@ type ScriptProperties struct { ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` ScriptContent *string `json:"scriptContent,omitempty"` - ScriptUrl *string `json:"scriptUrl,omitempty"` - ScriptUrlSasToken *string `json:"scriptUrlSasToken,omitempty"` + ScriptURL *string `json:"scriptUrl,omitempty"` + ScriptURLSasToken *string `json:"scriptUrlSasToken,omitempty"` } diff --git a/resource-manager/labservices/2022-08-01/image/model_imageproperties.go b/resource-manager/labservices/2022-08-01/image/model_imageproperties.go index 2a17e6bfd69..b6d53d104e4 100644 --- a/resource-manager/labservices/2022-08-01/image/model_imageproperties.go +++ b/resource-manager/labservices/2022-08-01/image/model_imageproperties.go @@ -9,7 +9,7 @@ type ImageProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` EnabledState *EnableState `json:"enabledState,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` Offer *string `json:"offer,omitempty"` OsState *OsState `json:"osState,omitempty"` OsType *OsType `json:"osType,omitempty"` diff --git a/resource-manager/labservices/2022-08-01/usages/README.md b/resource-manager/labservices/2022-08-01/usages/README.md index 03823f9e8f6..facfb7dc58c 100644 --- a/resource-manager/labservices/2022-08-01/usages/README.md +++ b/resource-manager/labservices/2022-08-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/labservices/2022-08-01/usages/id_location.go b/resource-manager/labservices/2022-08-01/usages/id_location.go index 0f1d6fc56c7..5e99287f0ee 100644 --- a/resource-manager/labservices/2022-08-01/usages/id_location.go +++ b/resource-manager/labservices/2022-08-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/labservices/2022-08-01/usages/id_location_test.go b/resource-manager/labservices/2022-08-01/usages/id_location_test.go index c983f40856f..9da7093c01d 100644 --- a/resource-manager/labservices/2022-08-01/usages/id_location_test.go +++ b/resource-manager/labservices/2022-08-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/labservices/2022-08-01/virtualmachine/model_virtualmachineconnectionprofile.go b/resource-manager/labservices/2022-08-01/virtualmachine/model_virtualmachineconnectionprofile.go index f6196aaa3c4..753ee309981 100644 --- a/resource-manager/labservices/2022-08-01/virtualmachine/model_virtualmachineconnectionprofile.go +++ b/resource-manager/labservices/2022-08-01/virtualmachine/model_virtualmachineconnectionprofile.go @@ -8,7 +8,7 @@ type VirtualMachineConnectionProfile struct { NonAdminUsername *string `json:"nonAdminUsername,omitempty"` PrivateIPAddress *string `json:"privateIpAddress,omitempty"` RdpAuthority *string `json:"rdpAuthority,omitempty"` - RdpInBrowserUrl *string `json:"rdpInBrowserUrl,omitempty"` + RdpInBrowserURL *string `json:"rdpInBrowserUrl,omitempty"` SshAuthority *string `json:"sshAuthority,omitempty"` - SshInBrowserUrl *string `json:"sshInBrowserUrl,omitempty"` + SshInBrowserURL *string `json:"sshInBrowserUrl,omitempty"` } diff --git a/resource-manager/labservices/2023-06-07/image/model_imageproperties.go b/resource-manager/labservices/2023-06-07/image/model_imageproperties.go index 2a17e6bfd69..b6d53d104e4 100644 --- a/resource-manager/labservices/2023-06-07/image/model_imageproperties.go +++ b/resource-manager/labservices/2023-06-07/image/model_imageproperties.go @@ -9,7 +9,7 @@ type ImageProperties struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` EnabledState *EnableState `json:"enabledState,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` Offer *string `json:"offer,omitempty"` OsState *OsState `json:"osState,omitempty"` OsType *OsType `json:"osType,omitempty"` diff --git a/resource-manager/labservices/2023-06-07/usages/README.md b/resource-manager/labservices/2023-06-07/usages/README.md index 4e6337e8753..65f0c645e8b 100644 --- a/resource-manager/labservices/2023-06-07/usages/README.md +++ b/resource-manager/labservices/2023-06-07/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/labservices/2023-06-07/usages/id_location.go b/resource-manager/labservices/2023-06-07/usages/id_location.go index 0f1d6fc56c7..5e99287f0ee 100644 --- a/resource-manager/labservices/2023-06-07/usages/id_location.go +++ b/resource-manager/labservices/2023-06-07/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/labservices/2023-06-07/usages/id_location_test.go b/resource-manager/labservices/2023-06-07/usages/id_location_test.go index c983f40856f..9da7093c01d 100644 --- a/resource-manager/labservices/2023-06-07/usages/id_location_test.go +++ b/resource-manager/labservices/2023-06-07/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LabServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/labservices/2023-06-07/virtualmachine/model_virtualmachineconnectionprofile.go b/resource-manager/labservices/2023-06-07/virtualmachine/model_virtualmachineconnectionprofile.go index f6196aaa3c4..753ee309981 100644 --- a/resource-manager/labservices/2023-06-07/virtualmachine/model_virtualmachineconnectionprofile.go +++ b/resource-manager/labservices/2023-06-07/virtualmachine/model_virtualmachineconnectionprofile.go @@ -8,7 +8,7 @@ type VirtualMachineConnectionProfile struct { NonAdminUsername *string `json:"nonAdminUsername,omitempty"` PrivateIPAddress *string `json:"privateIpAddress,omitempty"` RdpAuthority *string `json:"rdpAuthority,omitempty"` - RdpInBrowserUrl *string `json:"rdpInBrowserUrl,omitempty"` + RdpInBrowserURL *string `json:"rdpInBrowserUrl,omitempty"` SshAuthority *string `json:"sshAuthority,omitempty"` - SshInBrowserUrl *string `json:"sshInBrowserUrl,omitempty"` + SshInBrowserURL *string `json:"sshInBrowserUrl,omitempty"` } diff --git a/resource-manager/loadtestservice/2022-12-01/loadtests/model_encryptionproperties.go b/resource-manager/loadtestservice/2022-12-01/loadtests/model_encryptionproperties.go index d49ba9da3b6..b45489aad41 100644 --- a/resource-manager/loadtestservice/2022-12-01/loadtests/model_encryptionproperties.go +++ b/resource-manager/loadtestservice/2022-12-01/loadtests/model_encryptionproperties.go @@ -5,5 +5,5 @@ package loadtests type EncryptionProperties struct { Identity *EncryptionPropertiesIdentity `json:"identity,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/loadtestservice/2022-12-01/quotas/README.md b/resource-manager/loadtestservice/2022-12-01/quotas/README.md index b20ac9603ca..ee87e3a69ed 100644 --- a/resource-manager/loadtestservice/2022-12-01/quotas/README.md +++ b/resource-manager/loadtestservice/2022-12-01/quotas/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := quotas.NewQuotaID("12345678-1234-9876-4563-123456789012", "location", "quotaBucketName") +id := quotas.NewQuotaID("12345678-1234-9876-4563-123456789012", "locationName", "quotaName") payload := quotas.QuotaBucketRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := quotas.NewQuotaID("12345678-1234-9876-4563-123456789012", "location", "quotaBucketName") +id := quotas.NewQuotaID("12345678-1234-9876-4563-123456789012", "locationName", "quotaName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := quotas.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := quotas.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/loadtestservice/2022-12-01/quotas/id_location.go b/resource-manager/loadtestservice/2022-12-01/quotas/id_location.go index e3b9a2e9bd7..eae0c581ac1 100644 --- a/resource-manager/loadtestservice/2022-12-01/quotas/id_location.go +++ b/resource-manager/loadtestservice/2022-12-01/quotas/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftLoadTestService", "Microsoft.LoadTestService", "Microsoft.LoadTestService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/loadtestservice/2022-12-01/quotas/id_location_test.go b/resource-manager/loadtestservice/2022-12-01/quotas/id_location_test.go index d785b082712..f3e3ffb8f3d 100644 --- a/resource-manager/loadtestservice/2022-12-01/quotas/id_location_test.go +++ b/resource-manager/loadtestservice/2022-12-01/quotas/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/loadtestservice/2022-12-01/quotas/id_quota.go b/resource-manager/loadtestservice/2022-12-01/quotas/id_quota.go index 5653c8e9706..237ae33e1ad 100644 --- a/resource-manager/loadtestservice/2022-12-01/quotas/id_quota.go +++ b/resource-manager/loadtestservice/2022-12-01/quotas/id_quota.go @@ -113,9 +113,9 @@ func (id QuotaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftLoadTestService", "Microsoft.LoadTestService", "Microsoft.LoadTestService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticQuotas", "quotas", "quotas"), - resourceids.UserSpecifiedSegment("quotaName", "quotaBucketName"), + resourceids.UserSpecifiedSegment("quotaName", "quotaName"), } } diff --git a/resource-manager/loadtestservice/2022-12-01/quotas/id_quota_test.go b/resource-manager/loadtestservice/2022-12-01/quotas/id_quota_test.go index 09db457d669..e6bb2993700 100644 --- a/resource-manager/loadtestservice/2022-12-01/quotas/id_quota_test.go +++ b/resource-manager/loadtestservice/2022-12-01/quotas/id_quota_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &QuotaId{} func TestNewQuotaID(t *testing.T) { - id := NewQuotaID("12345678-1234-9876-4563-123456789012", "location", "quotaBucketName") + id := NewQuotaID("12345678-1234-9876-4563-123456789012", "locationName", "quotaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.QuotaName != "quotaBucketName" { - t.Fatalf("Expected %q but got %q for Segment 'QuotaName'", id.QuotaName, "quotaBucketName") + if id.QuotaName != "quotaName" { + t.Fatalf("Expected %q but got %q for Segment 'QuotaName'", id.QuotaName, "quotaName") } } func TestFormatQuotaID(t *testing.T) { - actual := NewQuotaID("12345678-1234-9876-4563-123456789012", "location", "quotaBucketName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/quotas/quotaBucketName" + actual := NewQuotaID("12345678-1234-9876-4563-123456789012", "locationName", "quotaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/quotas/quotaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseQuotaID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/quotas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/quotas", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/quotas/quotaBucketName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/quotas/quotaName", Expected: &QuotaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - QuotaName: "quotaBucketName", + LocationName: "locationName", + QuotaName: "quotaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/quotas/quotaBucketName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/quotas/quotaName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseQuotaIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/quotas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/quotas", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoN/qUoTaS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoNnAmE/qUoTaS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/quotas/quotaBucketName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/quotas/quotaName", Expected: &QuotaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - QuotaName: "quotaBucketName", + LocationName: "locationName", + QuotaName: "quotaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/location/quotas/quotaBucketName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.LoadTestService/locations/locationName/quotas/quotaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoN/qUoTaS/qUoTaBuCkEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoNnAmE/qUoTaS/qUoTaNaMe", Expected: &QuotaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - QuotaName: "qUoTaBuCkEtNaMe", + LocationName: "lOcAtIoNnAmE", + QuotaName: "qUoTaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoN/qUoTaS/qUoTaBuCkEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.lOaDtEsTsErViCe/lOcAtIoNs/lOcAtIoNnAmE/qUoTaS/qUoTaNaMe/extra", Error: true, }, } diff --git a/resource-manager/logic/2019-05-01/integrationaccountagreements/README.md b/resource-manager/logic/2019-05-01/integrationaccountagreements/README.md index 7ccc7055bbc..081c0e5a9f1 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountagreements/README.md +++ b/resource-manager/logic/2019-05-01/integrationaccountagreements/README.md @@ -90,18 +90,18 @@ for _, item := range items { ``` -### Example Usage: `IntegrationAccountAgreementsClient.ListContentCallbackUrl` +### Example Usage: `IntegrationAccountAgreementsClient.ListContentCallbackURL` ```go ctx := context.TODO() id := integrationaccountagreements.NewAgreementID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "agreementName") -payload := integrationaccountagreements.GetCallbackUrlParameters{ +payload := integrationaccountagreements.GetCallbackURLParameters{ // ... } -read, err := client.ListContentCallbackUrl(ctx, id, payload) +read, err := client.ListContentCallbackURL(ctx, id, payload) if err != nil { // handle the error } diff --git a/resource-manager/logic/2019-05-01/integrationaccountagreements/method_listcontentcallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountagreements/method_listcontentcallbackurl.go index 97ccdccb415..c02e2fd5891 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountagreements/method_listcontentcallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountagreements/method_listcontentcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListContentCallbackUrlOperationResponse struct { +type ListContentCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListContentCallbackUrl ... -func (c IntegrationAccountAgreementsClient) ListContentCallbackUrl(ctx context.Context, id AgreementId, input GetCallbackUrlParameters) (result ListContentCallbackUrlOperationResponse, err error) { +// ListContentCallbackURL ... +func (c IntegrationAccountAgreementsClient) ListContentCallbackURL(ctx context.Context, id AgreementId, input GetCallbackURLParameters) (result ListContentCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -48,7 +48,7 @@ func (c IntegrationAccountAgreementsClient) ListContentCallbackUrl(ctx context.C return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/integrationaccountagreements/model_as2mdnsettings.go b/resource-manager/logic/2019-05-01/integrationaccountagreements/model_as2mdnsettings.go index 0ac7377dac0..6aaebce547d 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountagreements/model_as2mdnsettings.go +++ b/resource-manager/logic/2019-05-01/integrationaccountagreements/model_as2mdnsettings.go @@ -8,7 +8,7 @@ type AS2MdnSettings struct { MdnText *string `json:"mdnText,omitempty"` MicHashingAlgorithm HashingAlgorithm `json:"micHashingAlgorithm"` NeedMDN bool `json:"needMDN"` - ReceiptDeliveryUrl *string `json:"receiptDeliveryUrl,omitempty"` + ReceiptDeliveryURL *string `json:"receiptDeliveryUrl,omitempty"` SendInboundMDNToMessageBox bool `json:"sendInboundMDNToMessageBox"` SendMDNAsynchronously bool `json:"sendMDNAsynchronously"` SignMDN bool `json:"signMDN"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountagreements/model_getcallbackurlparameters.go b/resource-manager/logic/2019-05-01/integrationaccountagreements/model_getcallbackurlparameters.go index 5b772da75a4..ab02d9649f2 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountagreements/model_getcallbackurlparameters.go +++ b/resource-manager/logic/2019-05-01/integrationaccountagreements/model_getcallbackurlparameters.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetCallbackUrlParameters struct { +type GetCallbackURLParameters struct { KeyType *KeyType `json:"keyType,omitempty"` NotAfter *string `json:"notAfter,omitempty"` } -func (o *GetCallbackUrlParameters) GetNotAfterAsTime() (*time.Time, error) { +func (o *GetCallbackURLParameters) GetNotAfterAsTime() (*time.Time, error) { if o.NotAfter == nil { return nil, nil } return dates.ParseAsFormat(o.NotAfter, "2006-01-02T15:04:05Z07:00") } -func (o *GetCallbackUrlParameters) SetNotAfterAsTime(input time.Time) { +func (o *GetCallbackURLParameters) SetNotAfterAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.NotAfter = &formatted } diff --git a/resource-manager/logic/2019-05-01/integrationaccountagreements/model_workflowtriggercallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountagreements/model_workflowtriggercallbackurl.go index 1897157aa73..b64aed2e7e7 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountagreements/model_workflowtriggercallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountagreements/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package integrationaccountagreements // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountagreements/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/logic/2019-05-01/integrationaccountagreements/model_workflowtriggerlistcallbackurlqueries.go index 04992a50c85..4cebef306c0 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountagreements/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/logic/2019-05-01/integrationaccountagreements/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package integrationaccountagreements // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountassemblies/README.md b/resource-manager/logic/2019-05-01/integrationaccountassemblies/README.md index fa108507390..f07043817cf 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountassemblies/README.md +++ b/resource-manager/logic/2019-05-01/integrationaccountassemblies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := integrationaccountassemblies.NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyArtifactName") +id := integrationaccountassemblies.NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyName") payload := integrationaccountassemblies.AssemblyDefinition{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := integrationaccountassemblies.NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyArtifactName") +id := integrationaccountassemblies.NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := integrationaccountassemblies.NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyArtifactName") +id := integrationaccountassemblies.NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyName") read, err := client.Get(ctx, id) if err != nil { @@ -89,13 +89,13 @@ if model := read.Model; model != nil { ``` -### Example Usage: `IntegrationAccountAssembliesClient.ListContentCallbackUrl` +### Example Usage: `IntegrationAccountAssembliesClient.ListContentCallbackURL` ```go ctx := context.TODO() -id := integrationaccountassemblies.NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyArtifactName") +id := integrationaccountassemblies.NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyName") -read, err := client.ListContentCallbackUrl(ctx, id) +read, err := client.ListContentCallbackURL(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/logic/2019-05-01/integrationaccountassemblies/id_assembly.go b/resource-manager/logic/2019-05-01/integrationaccountassemblies/id_assembly.go index 8025de6c6df..54d4ff456db 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountassemblies/id_assembly.go +++ b/resource-manager/logic/2019-05-01/integrationaccountassemblies/id_assembly.go @@ -123,7 +123,7 @@ func (id AssemblyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticIntegrationAccounts", "integrationAccounts", "integrationAccounts"), resourceids.UserSpecifiedSegment("integrationAccountName", "integrationAccountName"), resourceids.StaticSegment("staticAssemblies", "assemblies", "assemblies"), - resourceids.UserSpecifiedSegment("assemblyName", "assemblyArtifactName"), + resourceids.UserSpecifiedSegment("assemblyName", "assemblyName"), } } diff --git a/resource-manager/logic/2019-05-01/integrationaccountassemblies/id_assembly_test.go b/resource-manager/logic/2019-05-01/integrationaccountassemblies/id_assembly_test.go index 12576586c32..c071ed59d3f 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountassemblies/id_assembly_test.go +++ b/resource-manager/logic/2019-05-01/integrationaccountassemblies/id_assembly_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AssemblyId{} func TestNewAssemblyID(t *testing.T) { - id := NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyArtifactName") + id := NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAssemblyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'IntegrationAccountName'", id.IntegrationAccountName, "integrationAccountName") } - if id.AssemblyName != "assemblyArtifactName" { - t.Fatalf("Expected %q but got %q for Segment 'AssemblyName'", id.AssemblyName, "assemblyArtifactName") + if id.AssemblyName != "assemblyName" { + t.Fatalf("Expected %q but got %q for Segment 'AssemblyName'", id.AssemblyName, "assemblyName") } } func TestFormatAssemblyID(t *testing.T) { - actual := NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyArtifactName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyArtifactName" + actual := NewAssemblyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "assemblyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAssemblyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyArtifactName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyName", Expected: &AssemblyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", IntegrationAccountName: "integrationAccountName", - AssemblyName: "assemblyArtifactName", + AssemblyName: "assemblyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyArtifactName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAssemblyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyArtifactName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyName", Expected: &AssemblyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", IntegrationAccountName: "integrationAccountName", - AssemblyName: "assemblyArtifactName", + AssemblyName: "assemblyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyArtifactName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationAccounts/integrationAccountName/assemblies/assemblyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnAcCoUnTs/iNtEgRaTiOnAcCoUnTnAmE/aSsEmBlIeS/aSsEmBlYaRtIfAcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnAcCoUnTs/iNtEgRaTiOnAcCoUnTnAmE/aSsEmBlIeS/aSsEmBlYnAmE", Expected: &AssemblyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", IntegrationAccountName: "iNtEgRaTiOnAcCoUnTnAmE", - AssemblyName: "aSsEmBlYaRtIfAcTnAmE", + AssemblyName: "aSsEmBlYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnAcCoUnTs/iNtEgRaTiOnAcCoUnTnAmE/aSsEmBlIeS/aSsEmBlYaRtIfAcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnAcCoUnTs/iNtEgRaTiOnAcCoUnTnAmE/aSsEmBlIeS/aSsEmBlYnAmE/extra", Error: true, }, } diff --git a/resource-manager/logic/2019-05-01/integrationaccountassemblies/method_listcontentcallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountassemblies/method_listcontentcallbackurl.go index 579c09994d4..e88fdad691b 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountassemblies/method_listcontentcallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountassemblies/method_listcontentcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListContentCallbackUrlOperationResponse struct { +type ListContentCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListContentCallbackUrl ... -func (c IntegrationAccountAssembliesClient) ListContentCallbackUrl(ctx context.Context, id AssemblyId) (result ListContentCallbackUrlOperationResponse, err error) { +// ListContentCallbackURL ... +func (c IntegrationAccountAssembliesClient) ListContentCallbackURL(ctx context.Context, id AssemblyId) (result ListContentCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c IntegrationAccountAssembliesClient) ListContentCallbackUrl(ctx context.C return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/integrationaccountassemblies/model_workflowtriggercallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountassemblies/model_workflowtriggercallbackurl.go index c1b7488ead9..27b0d844028 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountassemblies/model_workflowtriggercallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountassemblies/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package integrationaccountassemblies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountassemblies/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/logic/2019-05-01/integrationaccountassemblies/model_workflowtriggerlistcallbackurlqueries.go index 38befad8a55..2bd53a260ae 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountassemblies/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/logic/2019-05-01/integrationaccountassemblies/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package integrationaccountassemblies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountmaps/README.md b/resource-manager/logic/2019-05-01/integrationaccountmaps/README.md index ef361c6cd5f..9a58f130083 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountmaps/README.md +++ b/resource-manager/logic/2019-05-01/integrationaccountmaps/README.md @@ -90,18 +90,18 @@ for _, item := range items { ``` -### Example Usage: `IntegrationAccountMapsClient.ListContentCallbackUrl` +### Example Usage: `IntegrationAccountMapsClient.ListContentCallbackURL` ```go ctx := context.TODO() id := integrationaccountmaps.NewMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "mapName") -payload := integrationaccountmaps.GetCallbackUrlParameters{ +payload := integrationaccountmaps.GetCallbackURLParameters{ // ... } -read, err := client.ListContentCallbackUrl(ctx, id, payload) +read, err := client.ListContentCallbackURL(ctx, id, payload) if err != nil { // handle the error } diff --git a/resource-manager/logic/2019-05-01/integrationaccountmaps/method_listcontentcallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountmaps/method_listcontentcallbackurl.go index f7b09fab439..74a0df18d5a 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountmaps/method_listcontentcallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountmaps/method_listcontentcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListContentCallbackUrlOperationResponse struct { +type ListContentCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListContentCallbackUrl ... -func (c IntegrationAccountMapsClient) ListContentCallbackUrl(ctx context.Context, id MapId, input GetCallbackUrlParameters) (result ListContentCallbackUrlOperationResponse, err error) { +// ListContentCallbackURL ... +func (c IntegrationAccountMapsClient) ListContentCallbackURL(ctx context.Context, id MapId, input GetCallbackURLParameters) (result ListContentCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -48,7 +48,7 @@ func (c IntegrationAccountMapsClient) ListContentCallbackUrl(ctx context.Context return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/integrationaccountmaps/model_getcallbackurlparameters.go b/resource-manager/logic/2019-05-01/integrationaccountmaps/model_getcallbackurlparameters.go index 3458f2415cc..d46590c6472 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountmaps/model_getcallbackurlparameters.go +++ b/resource-manager/logic/2019-05-01/integrationaccountmaps/model_getcallbackurlparameters.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetCallbackUrlParameters struct { +type GetCallbackURLParameters struct { KeyType *KeyType `json:"keyType,omitempty"` NotAfter *string `json:"notAfter,omitempty"` } -func (o *GetCallbackUrlParameters) GetNotAfterAsTime() (*time.Time, error) { +func (o *GetCallbackURLParameters) GetNotAfterAsTime() (*time.Time, error) { if o.NotAfter == nil { return nil, nil } return dates.ParseAsFormat(o.NotAfter, "2006-01-02T15:04:05Z07:00") } -func (o *GetCallbackUrlParameters) SetNotAfterAsTime(input time.Time) { +func (o *GetCallbackURLParameters) SetNotAfterAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.NotAfter = &formatted } diff --git a/resource-manager/logic/2019-05-01/integrationaccountmaps/model_workflowtriggercallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountmaps/model_workflowtriggercallbackurl.go index 64706937cad..096490f4f48 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountmaps/model_workflowtriggercallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountmaps/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package integrationaccountmaps // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountmaps/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/logic/2019-05-01/integrationaccountmaps/model_workflowtriggerlistcallbackurlqueries.go index d776410c056..e38a317f43c 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountmaps/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/logic/2019-05-01/integrationaccountmaps/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package integrationaccountmaps // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountpartners/README.md b/resource-manager/logic/2019-05-01/integrationaccountpartners/README.md index 4f2245acd2a..aa530864801 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountpartners/README.md +++ b/resource-manager/logic/2019-05-01/integrationaccountpartners/README.md @@ -90,18 +90,18 @@ for _, item := range items { ``` -### Example Usage: `IntegrationAccountPartnersClient.ListContentCallbackUrl` +### Example Usage: `IntegrationAccountPartnersClient.ListContentCallbackURL` ```go ctx := context.TODO() id := integrationaccountpartners.NewPartnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "partnerName") -payload := integrationaccountpartners.GetCallbackUrlParameters{ +payload := integrationaccountpartners.GetCallbackURLParameters{ // ... } -read, err := client.ListContentCallbackUrl(ctx, id, payload) +read, err := client.ListContentCallbackURL(ctx, id, payload) if err != nil { // handle the error } diff --git a/resource-manager/logic/2019-05-01/integrationaccountpartners/method_listcontentcallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountpartners/method_listcontentcallbackurl.go index 95f390fdfc1..359a26933f9 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountpartners/method_listcontentcallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountpartners/method_listcontentcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListContentCallbackUrlOperationResponse struct { +type ListContentCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListContentCallbackUrl ... -func (c IntegrationAccountPartnersClient) ListContentCallbackUrl(ctx context.Context, id PartnerId, input GetCallbackUrlParameters) (result ListContentCallbackUrlOperationResponse, err error) { +// ListContentCallbackURL ... +func (c IntegrationAccountPartnersClient) ListContentCallbackURL(ctx context.Context, id PartnerId, input GetCallbackURLParameters) (result ListContentCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -48,7 +48,7 @@ func (c IntegrationAccountPartnersClient) ListContentCallbackUrl(ctx context.Con return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/integrationaccountpartners/model_getcallbackurlparameters.go b/resource-manager/logic/2019-05-01/integrationaccountpartners/model_getcallbackurlparameters.go index 7369a99dd66..a8316963886 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountpartners/model_getcallbackurlparameters.go +++ b/resource-manager/logic/2019-05-01/integrationaccountpartners/model_getcallbackurlparameters.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetCallbackUrlParameters struct { +type GetCallbackURLParameters struct { KeyType *KeyType `json:"keyType,omitempty"` NotAfter *string `json:"notAfter,omitempty"` } -func (o *GetCallbackUrlParameters) GetNotAfterAsTime() (*time.Time, error) { +func (o *GetCallbackURLParameters) GetNotAfterAsTime() (*time.Time, error) { if o.NotAfter == nil { return nil, nil } return dates.ParseAsFormat(o.NotAfter, "2006-01-02T15:04:05Z07:00") } -func (o *GetCallbackUrlParameters) SetNotAfterAsTime(input time.Time) { +func (o *GetCallbackURLParameters) SetNotAfterAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.NotAfter = &formatted } diff --git a/resource-manager/logic/2019-05-01/integrationaccountpartners/model_workflowtriggercallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountpartners/model_workflowtriggercallbackurl.go index b3fa6182db1..f96b2408c3f 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountpartners/model_workflowtriggercallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountpartners/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package integrationaccountpartners // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountpartners/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/logic/2019-05-01/integrationaccountpartners/model_workflowtriggerlistcallbackurlqueries.go index fcbfbfd6b22..617d49b08ba 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountpartners/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/logic/2019-05-01/integrationaccountpartners/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package integrationaccountpartners // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccounts/README.md b/resource-manager/logic/2019-05-01/integrationaccounts/README.md index 30fbbadd8b8..3f1b5494ccb 100644 --- a/resource-manager/logic/2019-05-01/integrationaccounts/README.md +++ b/resource-manager/logic/2019-05-01/integrationaccounts/README.md @@ -108,18 +108,18 @@ for _, item := range items { ``` -### Example Usage: `IntegrationAccountsClient.ListCallbackUrl` +### Example Usage: `IntegrationAccountsClient.ListCallbackURL` ```go ctx := context.TODO() id := integrationaccounts.NewIntegrationAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName") -payload := integrationaccounts.GetCallbackUrlParameters{ +payload := integrationaccounts.GetCallbackURLParameters{ // ... } -read, err := client.ListCallbackUrl(ctx, id, payload) +read, err := client.ListCallbackURL(ctx, id, payload) if err != nil { // handle the error } diff --git a/resource-manager/logic/2019-05-01/integrationaccounts/method_listcallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccounts/method_listcallbackurl.go index 86ec6f72b0c..c494161eed8 100644 --- a/resource-manager/logic/2019-05-01/integrationaccounts/method_listcallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccounts/method_listcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListCallbackUrlOperationResponse struct { +type ListCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *CallbackUrl + Model *CallbackURL } -// ListCallbackUrl ... -func (c IntegrationAccountsClient) ListCallbackUrl(ctx context.Context, id IntegrationAccountId, input GetCallbackUrlParameters) (result ListCallbackUrlOperationResponse, err error) { +// ListCallbackURL ... +func (c IntegrationAccountsClient) ListCallbackURL(ctx context.Context, id IntegrationAccountId, input GetCallbackURLParameters) (result ListCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -48,7 +48,7 @@ func (c IntegrationAccountsClient) ListCallbackUrl(ctx context.Context, id Integ return } - var model CallbackUrl + var model CallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/integrationaccounts/model_callbackurl.go b/resource-manager/logic/2019-05-01/integrationaccounts/model_callbackurl.go index 3e1767321aa..7b67595d57e 100644 --- a/resource-manager/logic/2019-05-01/integrationaccounts/model_callbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccounts/model_callbackurl.go @@ -3,6 +3,6 @@ package integrationaccounts // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type CallbackUrl struct { +type CallbackURL struct { Value *string `json:"value,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationaccounts/model_getcallbackurlparameters.go b/resource-manager/logic/2019-05-01/integrationaccounts/model_getcallbackurlparameters.go index 1bc7b988576..602ad41ced8 100644 --- a/resource-manager/logic/2019-05-01/integrationaccounts/model_getcallbackurlparameters.go +++ b/resource-manager/logic/2019-05-01/integrationaccounts/model_getcallbackurlparameters.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetCallbackUrlParameters struct { +type GetCallbackURLParameters struct { KeyType *KeyType `json:"keyType,omitempty"` NotAfter *string `json:"notAfter,omitempty"` } -func (o *GetCallbackUrlParameters) GetNotAfterAsTime() (*time.Time, error) { +func (o *GetCallbackURLParameters) GetNotAfterAsTime() (*time.Time, error) { if o.NotAfter == nil { return nil, nil } return dates.ParseAsFormat(o.NotAfter, "2006-01-02T15:04:05Z07:00") } -func (o *GetCallbackUrlParameters) SetNotAfterAsTime(input time.Time) { +func (o *GetCallbackURLParameters) SetNotAfterAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.NotAfter = &formatted } diff --git a/resource-manager/logic/2019-05-01/integrationaccountschemas/README.md b/resource-manager/logic/2019-05-01/integrationaccountschemas/README.md index 07195b47fa3..5b738b7142e 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountschemas/README.md +++ b/resource-manager/logic/2019-05-01/integrationaccountschemas/README.md @@ -90,18 +90,18 @@ for _, item := range items { ``` -### Example Usage: `IntegrationAccountSchemasClient.ListContentCallbackUrl` +### Example Usage: `IntegrationAccountSchemasClient.ListContentCallbackURL` ```go ctx := context.TODO() id := integrationaccountschemas.NewSchemaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationAccountName", "schemaName") -payload := integrationaccountschemas.GetCallbackUrlParameters{ +payload := integrationaccountschemas.GetCallbackURLParameters{ // ... } -read, err := client.ListContentCallbackUrl(ctx, id, payload) +read, err := client.ListContentCallbackURL(ctx, id, payload) if err != nil { // handle the error } diff --git a/resource-manager/logic/2019-05-01/integrationaccountschemas/method_listcontentcallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountschemas/method_listcontentcallbackurl.go index 63791fca079..90795274cf4 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountschemas/method_listcontentcallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountschemas/method_listcontentcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListContentCallbackUrlOperationResponse struct { +type ListContentCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListContentCallbackUrl ... -func (c IntegrationAccountSchemasClient) ListContentCallbackUrl(ctx context.Context, id SchemaId, input GetCallbackUrlParameters) (result ListContentCallbackUrlOperationResponse, err error) { +// ListContentCallbackURL ... +func (c IntegrationAccountSchemasClient) ListContentCallbackURL(ctx context.Context, id SchemaId, input GetCallbackURLParameters) (result ListContentCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -48,7 +48,7 @@ func (c IntegrationAccountSchemasClient) ListContentCallbackUrl(ctx context.Cont return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/integrationaccountschemas/model_getcallbackurlparameters.go b/resource-manager/logic/2019-05-01/integrationaccountschemas/model_getcallbackurlparameters.go index 4e4b75dd9b4..c4a22935b12 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountschemas/model_getcallbackurlparameters.go +++ b/resource-manager/logic/2019-05-01/integrationaccountschemas/model_getcallbackurlparameters.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetCallbackUrlParameters struct { +type GetCallbackURLParameters struct { KeyType *KeyType `json:"keyType,omitempty"` NotAfter *string `json:"notAfter,omitempty"` } -func (o *GetCallbackUrlParameters) GetNotAfterAsTime() (*time.Time, error) { +func (o *GetCallbackURLParameters) GetNotAfterAsTime() (*time.Time, error) { if o.NotAfter == nil { return nil, nil } return dates.ParseAsFormat(o.NotAfter, "2006-01-02T15:04:05Z07:00") } -func (o *GetCallbackUrlParameters) SetNotAfterAsTime(input time.Time) { +func (o *GetCallbackURLParameters) SetNotAfterAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.NotAfter = &formatted } diff --git a/resource-manager/logic/2019-05-01/integrationaccountschemas/model_workflowtriggercallbackurl.go b/resource-manager/logic/2019-05-01/integrationaccountschemas/model_workflowtriggercallbackurl.go index a9f9a98cd79..94a3d253cca 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountschemas/model_workflowtriggercallbackurl.go +++ b/resource-manager/logic/2019-05-01/integrationaccountschemas/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package integrationaccountschemas // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationaccountschemas/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/logic/2019-05-01/integrationaccountschemas/model_workflowtriggerlistcallbackurlqueries.go index 19504960051..025206a0a04 100644 --- a/resource-manager/logic/2019-05-01/integrationaccountschemas/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/logic/2019-05-01/integrationaccountschemas/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package integrationaccountschemas // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/README.md b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/README.md index 943189a26e4..f886af2945b 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/README.md +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := integrationserviceenvironmentmanagedapi.NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "apiName") +id := integrationserviceenvironmentmanagedapi.NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "managedApiName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := integrationserviceenvironmentmanagedapi.NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "apiName") +id := integrationserviceenvironmentmanagedapi.NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "managedApiName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := integrationserviceenvironmentmanagedapi.NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "apiName") +id := integrationserviceenvironmentmanagedapi.NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "managedApiName") payload := integrationserviceenvironmentmanagedapi.IntegrationServiceEnvironmentManagedApi{ // ... diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/id_managedapi.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/id_managedapi.go index b10330c4f97..98a64c06544 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/id_managedapi.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/id_managedapi.go @@ -123,7 +123,7 @@ func (id ManagedApiId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticIntegrationServiceEnvironments", "integrationServiceEnvironments", "integrationServiceEnvironments"), resourceids.UserSpecifiedSegment("integrationServiceEnvironmentName", "integrationServiceEnvironmentName"), resourceids.StaticSegment("staticManagedApis", "managedApis", "managedApis"), - resourceids.UserSpecifiedSegment("managedApiName", "apiName"), + resourceids.UserSpecifiedSegment("managedApiName", "managedApiName"), } } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/id_managedapi_test.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/id_managedapi_test.go index f382d237899..ffd59a454a7 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/id_managedapi_test.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/id_managedapi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedApiId{} func TestNewManagedApiID(t *testing.T) { - id := NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "apiName") + id := NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "managedApiName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewManagedApiID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'IntegrationServiceEnvironmentName'", id.IntegrationServiceEnvironmentName, "integrationServiceEnvironmentName") } - if id.ManagedApiName != "apiName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedApiName'", id.ManagedApiName, "apiName") + if id.ManagedApiName != "managedApiName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedApiName'", id.ManagedApiName, "managedApiName") } } func TestFormatManagedApiID(t *testing.T) { - actual := NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "apiName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName" + actual := NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "managedApiName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseManagedApiID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroup: "example-resource-group", IntegrationServiceEnvironmentName: "integrationServiceEnvironmentName", - ManagedApiName: "apiName", + ManagedApiName: "managedApiName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseManagedApiIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroup: "example-resource-group", IntegrationServiceEnvironmentName: "integrationServiceEnvironmentName", - ManagedApiName: "apiName", + ManagedApiName: "managedApiName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtS/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe/mAnAgEdApIs/aPiNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtS/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe/mAnAgEdApIs/mAnAgEdApInAmE", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroup: "eXaMpLe-rEsOuRcE-GrOuP", IntegrationServiceEnvironmentName: "iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe", - ManagedApiName: "aPiNaMe", + ManagedApiName: "mAnAgEdApInAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtS/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe/mAnAgEdApIs/aPiNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtS/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe/mAnAgEdApIs/mAnAgEdApInAmE/extra", Error: true, }, } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcebackendservice.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcebackendservice.go index 882d8a8d39c..0016ee77341 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcebackendservice.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcebackendservice.go @@ -4,5 +4,5 @@ package integrationserviceenvironmentmanagedapi // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceBackendService struct { - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcedefinitions.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcedefinitions.go index 98f46d1b413..ae5d6948915 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcedefinitions.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcedefinitions.go @@ -4,6 +4,6 @@ package integrationserviceenvironmentmanagedapi // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceDefinitions struct { - ModifiedSwaggerUrl *string `json:"modifiedSwaggerUrl,omitempty"` - OriginalSwaggerUrl *string `json:"originalSwaggerUrl,omitempty"` + ModifiedSwaggerURL *string `json:"modifiedSwaggerUrl,omitempty"` + OriginalSwaggerURL *string `json:"originalSwaggerUrl,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcegeneralinformation.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcegeneralinformation.go index 989348f5659..50442f322ca 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcegeneralinformation.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_apiresourcegeneralinformation.go @@ -6,8 +6,8 @@ package integrationserviceenvironmentmanagedapi type ApiResourceGeneralInformation struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` ReleaseTag *string `json:"releaseTag,omitempty"` - TermsOfUseUrl *string `json:"termsOfUseUrl,omitempty"` + TermsOfUseURL *string `json:"termsOfUseUrl,omitempty"` Tier *ApiTier `json:"tier,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_integrationserviceenvironmentmanagedapiproperties.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_integrationserviceenvironmentmanagedapiproperties.go index 4162a1ec82a..a6fd18be45d 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_integrationserviceenvironmentmanagedapiproperties.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapi/model_integrationserviceenvironmentmanagedapiproperties.go @@ -4,7 +4,7 @@ package integrationserviceenvironmentmanagedapi // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type IntegrationServiceEnvironmentManagedApiProperties struct { - ApiDefinitionUrl *string `json:"apiDefinitionUrl,omitempty"` + ApiDefinitionURL *string `json:"apiDefinitionUrl,omitempty"` ApiDefinitions *ApiResourceDefinitions `json:"apiDefinitions,omitempty"` BackendService *ApiResourceBackendService `json:"backendService,omitempty"` Capabilities *[]string `json:"capabilities,omitempty"` @@ -17,5 +17,5 @@ type IntegrationServiceEnvironmentManagedApiProperties struct { Name *string `json:"name,omitempty"` Policies *ApiResourcePolicies `json:"policies,omitempty"` ProvisioningState *WorkflowProvisioningState `json:"provisioningState,omitempty"` - RuntimeUrls *[]string `json:"runtimeUrls,omitempty"` + RuntimeURLs *[]string `json:"runtimeUrls,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/README.md b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/README.md index a45b08e4327..b96ef16bc8c 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/README.md +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := integrationserviceenvironmentmanagedapis.NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "apiName") +id := integrationserviceenvironmentmanagedapis.NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "managedApiName") // alternatively `client.IntegrationServiceEnvironmentManagedApiOperationsList(ctx, id)` can be used to do batched pagination items, err := client.IntegrationServiceEnvironmentManagedApiOperationsListComplete(ctx, id) diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/id_managedapi.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/id_managedapi.go index f8afda053b3..a32c9673b7e 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/id_managedapi.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/id_managedapi.go @@ -123,7 +123,7 @@ func (id ManagedApiId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticIntegrationServiceEnvironments", "integrationServiceEnvironments", "integrationServiceEnvironments"), resourceids.UserSpecifiedSegment("integrationServiceEnvironmentName", "integrationServiceEnvironmentName"), resourceids.StaticSegment("staticManagedApis", "managedApis", "managedApis"), - resourceids.UserSpecifiedSegment("managedApiName", "apiName"), + resourceids.UserSpecifiedSegment("managedApiName", "managedApiName"), } } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/id_managedapi_test.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/id_managedapi_test.go index ee509f91e79..f26f9bca400 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/id_managedapi_test.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/id_managedapi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedApiId{} func TestNewManagedApiID(t *testing.T) { - id := NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "apiName") + id := NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "managedApiName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewManagedApiID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'IntegrationServiceEnvironmentName'", id.IntegrationServiceEnvironmentName, "integrationServiceEnvironmentName") } - if id.ManagedApiName != "apiName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedApiName'", id.ManagedApiName, "apiName") + if id.ManagedApiName != "managedApiName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedApiName'", id.ManagedApiName, "managedApiName") } } func TestFormatManagedApiID(t *testing.T) { - actual := NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "apiName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName" + actual := NewManagedApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "integrationServiceEnvironmentName", "managedApiName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseManagedApiID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroup: "example-resource-group", IntegrationServiceEnvironmentName: "integrationServiceEnvironmentName", - ManagedApiName: "apiName", + ManagedApiName: "managedApiName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseManagedApiIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroup: "example-resource-group", IntegrationServiceEnvironmentName: "integrationServiceEnvironmentName", - ManagedApiName: "apiName", + ManagedApiName: "managedApiName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/integrationServiceEnvironments/integrationServiceEnvironmentName/managedApis/managedApiName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtS/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe/mAnAgEdApIs/aPiNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtS/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe/mAnAgEdApIs/mAnAgEdApInAmE", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroup: "eXaMpLe-rEsOuRcE-GrOuP", IntegrationServiceEnvironmentName: "iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe", - ManagedApiName: "aPiNaMe", + ManagedApiName: "mAnAgEdApInAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtS/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe/mAnAgEdApIs/aPiNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtS/iNtEgRaTiOnSeRvIcEeNvIrOnMeNtNaMe/mAnAgEdApIs/mAnAgEdApInAmE/extra", Error: true, }, } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcebackendservice.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcebackendservice.go index 3d6ba02364f..5e897bca78d 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcebackendservice.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcebackendservice.go @@ -4,5 +4,5 @@ package integrationserviceenvironmentmanagedapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceBackendService struct { - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcedefinitions.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcedefinitions.go index c2b42e8699a..ceef761b3ee 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcedefinitions.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcedefinitions.go @@ -4,6 +4,6 @@ package integrationserviceenvironmentmanagedapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceDefinitions struct { - ModifiedSwaggerUrl *string `json:"modifiedSwaggerUrl,omitempty"` - OriginalSwaggerUrl *string `json:"originalSwaggerUrl,omitempty"` + ModifiedSwaggerURL *string `json:"modifiedSwaggerUrl,omitempty"` + OriginalSwaggerURL *string `json:"originalSwaggerUrl,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcegeneralinformation.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcegeneralinformation.go index eab824c0423..434fccc1627 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcegeneralinformation.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_apiresourcegeneralinformation.go @@ -6,8 +6,8 @@ package integrationserviceenvironmentmanagedapis type ApiResourceGeneralInformation struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` ReleaseTag *string `json:"releaseTag,omitempty"` - TermsOfUseUrl *string `json:"termsOfUseUrl,omitempty"` + TermsOfUseURL *string `json:"termsOfUseUrl,omitempty"` Tier *ApiTier `json:"tier,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_integrationserviceenvironmentmanagedapiproperties.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_integrationserviceenvironmentmanagedapiproperties.go index ab86621b66c..acc21e0a999 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_integrationserviceenvironmentmanagedapiproperties.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_integrationserviceenvironmentmanagedapiproperties.go @@ -4,7 +4,7 @@ package integrationserviceenvironmentmanagedapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type IntegrationServiceEnvironmentManagedApiProperties struct { - ApiDefinitionUrl *string `json:"apiDefinitionUrl,omitempty"` + ApiDefinitionURL *string `json:"apiDefinitionUrl,omitempty"` ApiDefinitions *ApiResourceDefinitions `json:"apiDefinitions,omitempty"` BackendService *ApiResourceBackendService `json:"backendService,omitempty"` Capabilities *[]string `json:"capabilities,omitempty"` @@ -17,5 +17,5 @@ type IntegrationServiceEnvironmentManagedApiProperties struct { Name *string `json:"name,omitempty"` Policies *ApiResourcePolicies `json:"policies,omitempty"` ProvisioningState *WorkflowProvisioningState `json:"provisioningState,omitempty"` - RuntimeUrls *[]string `json:"runtimeUrls,omitempty"` + RuntimeURLs *[]string `json:"runtimeUrls,omitempty"` } diff --git a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_swaggerschema.go b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_swaggerschema.go index c582acbc7f9..22706825459 100644 --- a/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_swaggerschema.go +++ b/resource-manager/logic/2019-05-01/integrationserviceenvironmentmanagedapis/model_swaggerschema.go @@ -16,7 +16,7 @@ type SwaggerSchema struct { Items *SwaggerSchema `json:"items,omitempty"` MaxProperties *int64 `json:"maxProperties,omitempty"` MinProperties *int64 `json:"minProperties,omitempty"` - NotificationUrlExtension *bool `json:"notificationUrlExtension,omitempty"` + NotificationURLExtension *bool `json:"notificationUrlExtension,omitempty"` Properties *map[string]SwaggerSchema `json:"properties,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` Ref *string `json:"ref,omitempty"` diff --git a/resource-manager/logic/2019-05-01/workflowrunactions/README.md b/resource-manager/logic/2019-05-01/workflowrunactions/README.md index 73ee1260983..3cf4e5b0e92 100644 --- a/resource-manager/logic/2019-05-01/workflowrunactions/README.md +++ b/resource-manager/logic/2019-05-01/workflowrunactions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowrunactions.NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName", "runName", "actionName", "scopeRepetitionName") read, err := client.CopeRepetitionsGet(ctx, id) if err != nil { diff --git a/resource-manager/logic/2019-05-01/workflowrunactions/id_scoperepetition.go b/resource-manager/logic/2019-05-01/workflowrunactions/id_scoperepetition.go index ac60e5a2e59..7e26bda12f1 100644 --- a/resource-manager/logic/2019-05-01/workflowrunactions/id_scoperepetition.go +++ b/resource-manager/logic/2019-05-01/workflowrunactions/id_scoperepetition.go @@ -139,7 +139,7 @@ func (id ScopeRepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticActions", "actions", "actions"), resourceids.UserSpecifiedSegment("actionName", "actionName"), resourceids.StaticSegment("staticScopeRepetitions", "scopeRepetitions", "scopeRepetitions"), - resourceids.UserSpecifiedSegment("scopeRepetitionName", "repetitionName"), + resourceids.UserSpecifiedSegment("scopeRepetitionName", "scopeRepetitionName"), } } diff --git a/resource-manager/logic/2019-05-01/workflowrunactions/id_scoperepetition_test.go b/resource-manager/logic/2019-05-01/workflowrunactions/id_scoperepetition_test.go index 9f397dfae8c..9a29330300d 100644 --- a/resource-manager/logic/2019-05-01/workflowrunactions/id_scoperepetition_test.go +++ b/resource-manager/logic/2019-05-01/workflowrunactions/id_scoperepetition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScopeRepetitionId{} func TestNewScopeRepetitionID(t *testing.T) { - id := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName", "runName", "actionName", "repetitionName") + id := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName", "runName", "actionName", "scopeRepetitionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,14 +34,14 @@ func TestNewScopeRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ActionName'", id.ActionName, "actionName") } - if id.ScopeRepetitionName != "repetitionName" { - t.Fatalf("Expected %q but got %q for Segment 'ScopeRepetitionName'", id.ScopeRepetitionName, "repetitionName") + if id.ScopeRepetitionName != "scopeRepetitionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScopeRepetitionName'", id.ScopeRepetitionName, "scopeRepetitionName") } } func TestFormatScopeRepetitionID(t *testing.T) { - actual := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName", "runName", "actionName", "repetitionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName" + actual := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName", "runName", "actionName", "scopeRepetitionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -125,19 +125,19 @@ func TestParseScopeRepetitionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", - ScopeRepetitionName: "repetitionName", + ScopeRepetitionName: "scopeRepetitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName/extra", Error: true, }, } @@ -326,36 +326,36 @@ func TestParseScopeRepetitionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", - ScopeRepetitionName: "repetitionName", + ScopeRepetitionName: "scopeRepetitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/sCoPeRePeTiTiOnNaMe", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", - ScopeRepetitionName: "rEpEtItIoNnAmE", + ScopeRepetitionName: "sCoPeRePeTiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/rEpEtItIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/sCoPeRePeTiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/logic/2019-05-01/workflows/README.md b/resource-manager/logic/2019-05-01/workflows/README.md index 896e49a55d6..1dc7e973ab2 100644 --- a/resource-manager/logic/2019-05-01/workflows/README.md +++ b/resource-manager/logic/2019-05-01/workflows/README.md @@ -161,18 +161,18 @@ for _, item := range items { ``` -### Example Usage: `WorkflowsClient.ListCallbackUrl` +### Example Usage: `WorkflowsClient.ListCallbackURL` ```go ctx := context.TODO() id := workflows.NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName") -payload := workflows.GetCallbackUrlParameters{ +payload := workflows.GetCallbackURLParameters{ // ... } -read, err := client.ListCallbackUrl(ctx, id, payload) +read, err := client.ListCallbackURL(ctx, id, payload) if err != nil { // handle the error } @@ -256,7 +256,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflows.NewLocationWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "workflowName") +id := workflows.NewLocationWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "workflowName") payload := workflows.Workflow{ // ... diff --git a/resource-manager/logic/2019-05-01/workflows/id_locationworkflow.go b/resource-manager/logic/2019-05-01/workflows/id_locationworkflow.go index dc3dd96331a..50b44e91546 100644 --- a/resource-manager/logic/2019-05-01/workflows/id_locationworkflow.go +++ b/resource-manager/logic/2019-05-01/workflows/id_locationworkflow.go @@ -121,7 +121,7 @@ func (id LocationWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftLogic", "Microsoft.Logic", "Microsoft.Logic"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticWorkflows", "workflows", "workflows"), resourceids.UserSpecifiedSegment("workflowName", "workflowName"), } diff --git a/resource-manager/logic/2019-05-01/workflows/id_locationworkflow_test.go b/resource-manager/logic/2019-05-01/workflows/id_locationworkflow_test.go index 8362f6a5cde..ecccaf96d3d 100644 --- a/resource-manager/logic/2019-05-01/workflows/id_locationworkflow_test.go +++ b/resource-manager/logic/2019-05-01/workflows/id_locationworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocationWorkflowId{} func TestNewLocationWorkflowID(t *testing.T) { - id := NewLocationWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "workflowName") + id := NewLocationWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewLocationWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewLocationWorkflowID(t *testing.T) { } func TestFormatLocationWorkflowID(t *testing.T) { - actual := NewLocationWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location/workflows/workflowName" + actual := NewLocationWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLocationWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName/workflows/workflowName", Expected: &LocationWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName/workflows/workflowName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLocationWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/lOcAtIoNs/lOcAtIoN/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/lOcAtIoNs/lOcAtIoNnAmE/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName/workflows/workflowName", Expected: &LocationWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/location/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logic/locations/locationName/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/lOcAtIoNs/lOcAtIoN/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/lOcAtIoNs/lOcAtIoNnAmE/wOrKfLoWs/wOrKfLoWnAmE", Expected: &LocationWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/lOcAtIoNs/lOcAtIoN/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgIc/lOcAtIoNs/lOcAtIoNnAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/logic/2019-05-01/workflows/method_listcallbackurl.go b/resource-manager/logic/2019-05-01/workflows/method_listcallbackurl.go index c9be2ecc554..2a206206474 100644 --- a/resource-manager/logic/2019-05-01/workflows/method_listcallbackurl.go +++ b/resource-manager/logic/2019-05-01/workflows/method_listcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListCallbackUrlOperationResponse struct { +type ListCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListCallbackUrl ... -func (c WorkflowsClient) ListCallbackUrl(ctx context.Context, id WorkflowId, input GetCallbackUrlParameters) (result ListCallbackUrlOperationResponse, err error) { +// ListCallbackURL ... +func (c WorkflowsClient) ListCallbackURL(ctx context.Context, id WorkflowId, input GetCallbackURLParameters) (result ListCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -48,7 +48,7 @@ func (c WorkflowsClient) ListCallbackUrl(ctx context.Context, id WorkflowId, inp return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/workflows/model_getcallbackurlparameters.go b/resource-manager/logic/2019-05-01/workflows/model_getcallbackurlparameters.go index 13ebb143331..79d9991caba 100644 --- a/resource-manager/logic/2019-05-01/workflows/model_getcallbackurlparameters.go +++ b/resource-manager/logic/2019-05-01/workflows/model_getcallbackurlparameters.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetCallbackUrlParameters struct { +type GetCallbackURLParameters struct { KeyType *KeyType `json:"keyType,omitempty"` NotAfter *string `json:"notAfter,omitempty"` } -func (o *GetCallbackUrlParameters) GetNotAfterAsTime() (*time.Time, error) { +func (o *GetCallbackURLParameters) GetNotAfterAsTime() (*time.Time, error) { if o.NotAfter == nil { return nil, nil } return dates.ParseAsFormat(o.NotAfter, "2006-01-02T15:04:05Z07:00") } -func (o *GetCallbackUrlParameters) SetNotAfterAsTime(input time.Time) { +func (o *GetCallbackURLParameters) SetNotAfterAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.NotAfter = &formatted } diff --git a/resource-manager/logic/2019-05-01/workflows/model_workflowtriggercallbackurl.go b/resource-manager/logic/2019-05-01/workflows/model_workflowtriggercallbackurl.go index 4b5d876494a..919ea72b391 100644 --- a/resource-manager/logic/2019-05-01/workflows/model_workflowtriggercallbackurl.go +++ b/resource-manager/logic/2019-05-01/workflows/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package workflows // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/logic/2019-05-01/workflows/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/logic/2019-05-01/workflows/model_workflowtriggerlistcallbackurlqueries.go index b79c9069d94..9558f7d20dd 100644 --- a/resource-manager/logic/2019-05-01/workflows/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/logic/2019-05-01/workflows/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package workflows // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/logic/2019-05-01/workflowtriggers/README.md b/resource-manager/logic/2019-05-01/workflowtriggers/README.md index 56228454a82..0371fb12a7b 100644 --- a/resource-manager/logic/2019-05-01/workflowtriggers/README.md +++ b/resource-manager/logic/2019-05-01/workflowtriggers/README.md @@ -69,13 +69,13 @@ for _, item := range items { ``` -### Example Usage: `WorkflowTriggersClient.ListCallbackUrl` +### Example Usage: `WorkflowTriggersClient.ListCallbackURL` ```go ctx := context.TODO() id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName", "triggerName") -read, err := client.ListCallbackUrl(ctx, id) +read, err := client.ListCallbackURL(ctx, id) if err != nil { // handle the error } @@ -138,18 +138,18 @@ if model := read.Model; model != nil { ``` -### Example Usage: `WorkflowTriggersClient.WorkflowVersionTriggersListCallbackUrl` +### Example Usage: `WorkflowTriggersClient.WorkflowVersionTriggersListCallbackURL` ```go ctx := context.TODO() id := workflowtriggers.NewVersionTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workflowName", "versionId", "triggerName") -payload := workflowtriggers.GetCallbackUrlParameters{ +payload := workflowtriggers.GetCallbackURLParameters{ // ... } -read, err := client.WorkflowVersionTriggersListCallbackUrl(ctx, id, payload) +read, err := client.WorkflowVersionTriggersListCallbackURL(ctx, id, payload) if err != nil { // handle the error } diff --git a/resource-manager/logic/2019-05-01/workflowtriggers/method_listcallbackurl.go b/resource-manager/logic/2019-05-01/workflowtriggers/method_listcallbackurl.go index 7e44f7f9763..4fa4045250d 100644 --- a/resource-manager/logic/2019-05-01/workflowtriggers/method_listcallbackurl.go +++ b/resource-manager/logic/2019-05-01/workflowtriggers/method_listcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListCallbackUrlOperationResponse struct { +type ListCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListCallbackUrl ... -func (c WorkflowTriggersClient) ListCallbackUrl(ctx context.Context, id TriggerId) (result ListCallbackUrlOperationResponse, err error) { +// ListCallbackURL ... +func (c WorkflowTriggersClient) ListCallbackURL(ctx context.Context, id TriggerId) (result ListCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c WorkflowTriggersClient) ListCallbackUrl(ctx context.Context, id TriggerI return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/workflowtriggers/method_workflowversiontriggerslistcallbackurl.go b/resource-manager/logic/2019-05-01/workflowtriggers/method_workflowversiontriggerslistcallbackurl.go index 2405dbab3c5..e9437397c9b 100644 --- a/resource-manager/logic/2019-05-01/workflowtriggers/method_workflowversiontriggerslistcallbackurl.go +++ b/resource-manager/logic/2019-05-01/workflowtriggers/method_workflowversiontriggerslistcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowVersionTriggersListCallbackUrlOperationResponse struct { +type WorkflowVersionTriggersListCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// WorkflowVersionTriggersListCallbackUrl ... -func (c WorkflowTriggersClient) WorkflowVersionTriggersListCallbackUrl(ctx context.Context, id VersionTriggerId, input GetCallbackUrlParameters) (result WorkflowVersionTriggersListCallbackUrlOperationResponse, err error) { +// WorkflowVersionTriggersListCallbackURL ... +func (c WorkflowTriggersClient) WorkflowVersionTriggersListCallbackURL(ctx context.Context, id VersionTriggerId, input GetCallbackURLParameters) (result WorkflowVersionTriggersListCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -48,7 +48,7 @@ func (c WorkflowTriggersClient) WorkflowVersionTriggersListCallbackUrl(ctx conte return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/logic/2019-05-01/workflowtriggers/model_getcallbackurlparameters.go b/resource-manager/logic/2019-05-01/workflowtriggers/model_getcallbackurlparameters.go index 8614e9abf17..0dd6b247cfa 100644 --- a/resource-manager/logic/2019-05-01/workflowtriggers/model_getcallbackurlparameters.go +++ b/resource-manager/logic/2019-05-01/workflowtriggers/model_getcallbackurlparameters.go @@ -9,19 +9,19 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetCallbackUrlParameters struct { +type GetCallbackURLParameters struct { KeyType *KeyType `json:"keyType,omitempty"` NotAfter *string `json:"notAfter,omitempty"` } -func (o *GetCallbackUrlParameters) GetNotAfterAsTime() (*time.Time, error) { +func (o *GetCallbackURLParameters) GetNotAfterAsTime() (*time.Time, error) { if o.NotAfter == nil { return nil, nil } return dates.ParseAsFormat(o.NotAfter, "2006-01-02T15:04:05Z07:00") } -func (o *GetCallbackUrlParameters) SetNotAfterAsTime(input time.Time) { +func (o *GetCallbackURLParameters) SetNotAfterAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.NotAfter = &formatted } diff --git a/resource-manager/logic/2019-05-01/workflowtriggers/model_workflowtriggercallbackurl.go b/resource-manager/logic/2019-05-01/workflowtriggers/model_workflowtriggercallbackurl.go index fd5a9082bd7..710a39b43aa 100644 --- a/resource-manager/logic/2019-05-01/workflowtriggers/model_workflowtriggercallbackurl.go +++ b/resource-manager/logic/2019-05-01/workflowtriggers/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package workflowtriggers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/logic/2019-05-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/logic/2019-05-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go index cc3b231968b..f4e969fd7ab 100644 --- a/resource-manager/logic/2019-05-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/logic/2019-05-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package workflowtriggers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/logz/2020-10-01/monitors/model_logzorganizationproperties.go b/resource-manager/logz/2020-10-01/monitors/model_logzorganizationproperties.go index 10f84fcdcc3..df896c926b6 100644 --- a/resource-manager/logz/2020-10-01/monitors/model_logzorganizationproperties.go +++ b/resource-manager/logz/2020-10-01/monitors/model_logzorganizationproperties.go @@ -7,5 +7,5 @@ type LogzOrganizationProperties struct { CompanyName *string `json:"companyName,omitempty"` EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` Id *string `json:"id,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/logz/2020-10-01/singlesignon/README.md b/resource-manager/logz/2020-10-01/singlesignon/README.md index 4ba3aadc357..f580e03df5d 100644 --- a/resource-manager/logz/2020-10-01/singlesignon/README.md +++ b/resource-manager/logz/2020-10-01/singlesignon/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") payload := singlesignon.LogzSingleSignOnResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") +id := singlesignon.NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/logz/2020-10-01/singlesignon/id_singlesignonconfiguration.go b/resource-manager/logz/2020-10-01/singlesignon/id_singlesignonconfiguration.go index 302a958225f..e6b77023bb3 100644 --- a/resource-manager/logz/2020-10-01/singlesignon/id_singlesignonconfiguration.go +++ b/resource-manager/logz/2020-10-01/singlesignon/id_singlesignonconfiguration.go @@ -123,7 +123,7 @@ func (id SingleSignOnConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticSingleSignOnConfigurations", "singleSignOnConfigurations", "singleSignOnConfigurations"), - resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("singleSignOnConfigurationName", "singleSignOnConfigurationName"), } } diff --git a/resource-manager/logz/2020-10-01/singlesignon/id_singlesignonconfiguration_test.go b/resource-manager/logz/2020-10-01/singlesignon/id_singlesignonconfiguration_test.go index e3241876ccb..29525909523 100644 --- a/resource-manager/logz/2020-10-01/singlesignon/id_singlesignonconfiguration_test.go +++ b/resource-manager/logz/2020-10-01/singlesignon/id_singlesignonconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SingleSignOnConfigurationId{} func TestNewSingleSignOnConfigurationID(t *testing.T) { - id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName") + id := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSingleSignOnConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.SingleSignOnConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "configurationName") + if id.SingleSignOnConfigurationName != "singleSignOnConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SingleSignOnConfigurationName'", id.SingleSignOnConfigurationName, "singleSignOnConfigurationName") } } func TestFormatSingleSignOnConfigurationID(t *testing.T) { - actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/configurationName" + actual := NewSingleSignOnConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "singleSignOnConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSingleSignOnConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSingleSignOnConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - SingleSignOnConfigurationName: "configurationName", + SingleSignOnConfigurationName: "singleSignOnConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/singleSignOnConfigurations/singleSignOnConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe", Expected: &SingleSignOnConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - SingleSignOnConfigurationName: "cOnFiGuRaTiOnNaMe", + SingleSignOnConfigurationName: "sInGlEsIgNoNcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/sInGlEsIgNoNcOnFiGuRaTiOnS/sInGlEsIgNoNcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/logz/2020-10-01/singlesignon/model_logzsinglesignonproperties.go b/resource-manager/logz/2020-10-01/singlesignon/model_logzsinglesignonproperties.go index ab9b4bc89b6..8f5004adb0f 100644 --- a/resource-manager/logz/2020-10-01/singlesignon/model_logzsinglesignonproperties.go +++ b/resource-manager/logz/2020-10-01/singlesignon/model_logzsinglesignonproperties.go @@ -7,5 +7,5 @@ type LogzSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/logz/2020-10-01/subaccount/README.md b/resource-manager/logz/2020-10-01/subaccount/README.md index 16552426fc4..64b3329b6a9 100644 --- a/resource-manager/logz/2020-10-01/subaccount/README.md +++ b/resource-manager/logz/2020-10-01/subaccount/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") payload := subaccount.LogzMonitorResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") // alternatively `client.ListMonitoredResources(ctx, id)` can be used to do batched pagination items, err := client.ListMonitoredResourcesComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := subaccount.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") payload := subaccount.LogzMonitorResourceUpdateParameters{ // ... diff --git a/resource-manager/logz/2020-10-01/subaccount/id_account.go b/resource-manager/logz/2020-10-01/subaccount/id_account.go index d4b0c0f6cb1..9d6d7837918 100644 --- a/resource-manager/logz/2020-10-01/subaccount/id_account.go +++ b/resource-manager/logz/2020-10-01/subaccount/id_account.go @@ -123,7 +123,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), - resourceids.UserSpecifiedSegment("accountName", "subAccountName"), + resourceids.UserSpecifiedSegment("accountName", "accountName"), } } diff --git a/resource-manager/logz/2020-10-01/subaccount/id_account_test.go b/resource-manager/logz/2020-10-01/subaccount/id_account_test.go index b24f8f73f7d..09fb0943699 100644 --- a/resource-manager/logz/2020-10-01/subaccount/id_account_test.go +++ b/resource-manager/logz/2020-10-01/subaccount/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.AccountName != "subAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "subAccountName") + if id.AccountName != "accountName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountName") } } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - AccountName: "subAccountName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - AccountName: "subAccountName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - AccountName: "sUbAcCoUnTnAmE", + AccountName: "aCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/logz/2020-10-01/subaccount/model_logzorganizationproperties.go b/resource-manager/logz/2020-10-01/subaccount/model_logzorganizationproperties.go index 34e13496e83..bfbdb0cbc93 100644 --- a/resource-manager/logz/2020-10-01/subaccount/model_logzorganizationproperties.go +++ b/resource-manager/logz/2020-10-01/subaccount/model_logzorganizationproperties.go @@ -7,5 +7,5 @@ type LogzOrganizationProperties struct { CompanyName *string `json:"companyName,omitempty"` EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` Id *string `json:"id,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/logz/2020-10-01/tagrules/README.md b/resource-manager/logz/2020-10-01/tagrules/README.md index bab95c6a875..bce8907750c 100644 --- a/resource-manager/logz/2020-10-01/tagrules/README.md +++ b/resource-manager/logz/2020-10-01/tagrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.MonitoringTagRules{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := tagrules.NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName", "ruleSetName") +id := tagrules.NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName", "tagRuleName") payload := tagrules.MonitoringTagRules{ // ... @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tagrules.NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName", "ruleSetName") +id := tagrules.NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName", "tagRuleName") read, err := client.SubAccountTagRulesDelete(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tagrules.NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName", "ruleSetName") +id := tagrules.NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName", "tagRuleName") read, err := client.SubAccountTagRulesGet(ctx, id) if err != nil { @@ -147,7 +147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tagrules.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := tagrules.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") // alternatively `client.SubAccountTagRulesList(ctx, id)` can be used to do batched pagination items, err := client.SubAccountTagRulesListComplete(ctx, id) diff --git a/resource-manager/logz/2020-10-01/tagrules/id_account.go b/resource-manager/logz/2020-10-01/tagrules/id_account.go index 2b49b937520..36c88bd99d6 100644 --- a/resource-manager/logz/2020-10-01/tagrules/id_account.go +++ b/resource-manager/logz/2020-10-01/tagrules/id_account.go @@ -123,7 +123,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), - resourceids.UserSpecifiedSegment("accountName", "subAccountName"), + resourceids.UserSpecifiedSegment("accountName", "accountName"), } } diff --git a/resource-manager/logz/2020-10-01/tagrules/id_account_test.go b/resource-manager/logz/2020-10-01/tagrules/id_account_test.go index dc2409228c8..d0ff486ad34 100644 --- a/resource-manager/logz/2020-10-01/tagrules/id_account_test.go +++ b/resource-manager/logz/2020-10-01/tagrules/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.AccountName != "subAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "subAccountName") + if id.AccountName != "accountName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountName") } } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - AccountName: "subAccountName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - AccountName: "subAccountName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - AccountName: "sUbAcCoUnTnAmE", + AccountName: "aCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/logz/2020-10-01/tagrules/id_accounttagrule.go b/resource-manager/logz/2020-10-01/tagrules/id_accounttagrule.go index c8ff02da7e2..9e0182692dc 100644 --- a/resource-manager/logz/2020-10-01/tagrules/id_accounttagrule.go +++ b/resource-manager/logz/2020-10-01/tagrules/id_accounttagrule.go @@ -129,9 +129,9 @@ func (id AccountTagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), - resourceids.UserSpecifiedSegment("accountName", "subAccountName"), + resourceids.UserSpecifiedSegment("accountName", "accountName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/logz/2020-10-01/tagrules/id_accounttagrule_test.go b/resource-manager/logz/2020-10-01/tagrules/id_accounttagrule_test.go index 919d18270e9..77ea386733a 100644 --- a/resource-manager/logz/2020-10-01/tagrules/id_accounttagrule_test.go +++ b/resource-manager/logz/2020-10-01/tagrules/id_accounttagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountTagRuleId{} func TestNewAccountTagRuleID(t *testing.T) { - id := NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName", "ruleSetName") + id := NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewAccountTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.AccountName != "subAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "subAccountName") + if id.AccountName != "accountName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatAccountTagRuleID(t *testing.T) { - actual := NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/tagRules/ruleSetName" + actual := NewAccountTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseAccountTagRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/tagRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/tagRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/tagRules/tagRuleName", Expected: &AccountTagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - AccountName: "subAccountName", - TagRuleName: "ruleSetName", + AccountName: "accountName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/tagRules/tagRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseAccountTagRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/tagRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/tagRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE/tAgRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe/tAgRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/tagRules/tagRuleName", Expected: &AccountTagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - AccountName: "subAccountName", - TagRuleName: "ruleSetName", + AccountName: "accountName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &AccountTagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - AccountName: "sUbAcCoUnTnAmE", - TagRuleName: "rUlEsEtNaMe", + AccountName: "aCcOuNtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/logz/2020-10-01/tagrules/id_tagrule.go b/resource-manager/logz/2020-10-01/tagrules/id_tagrule.go index 2e275ad8900..88465496384 100644 --- a/resource-manager/logz/2020-10-01/tagrules/id_tagrule.go +++ b/resource-manager/logz/2020-10-01/tagrules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/logz/2020-10-01/tagrules/id_tagrule_test.go b/resource-manager/logz/2020-10-01/tagrules/id_tagrule_test.go index faba6cdc24d..24ad4c79ca0 100644 --- a/resource-manager/logz/2020-10-01/tagrules/id_tagrule_test.go +++ b/resource-manager/logz/2020-10-01/tagrules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/logz/2020-10-01/vmhost/README.md b/resource-manager/logz/2020-10-01/vmhost/README.md index f5d20907fbe..e2600254e78 100644 --- a/resource-manager/logz/2020-10-01/vmhost/README.md +++ b/resource-manager/logz/2020-10-01/vmhost/README.md @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vmhost.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := vmhost.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") payload := vmhost.VMHostUpdateRequest{ // ... @@ -101,7 +101,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vmhost.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := vmhost.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") // alternatively `client.SubAccountListVMHosts(ctx, id)` can be used to do batched pagination items, err := client.SubAccountListVMHostsComplete(ctx, id) @@ -118,7 +118,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vmhost.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") +id := vmhost.NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") read, err := client.SubAccountVMHostPayload(ctx, id) if err != nil { diff --git a/resource-manager/logz/2020-10-01/vmhost/id_account.go b/resource-manager/logz/2020-10-01/vmhost/id_account.go index 97d4a20ea34..3fe8bdcc52a 100644 --- a/resource-manager/logz/2020-10-01/vmhost/id_account.go +++ b/resource-manager/logz/2020-10-01/vmhost/id_account.go @@ -123,7 +123,7 @@ func (id AccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticAccounts", "accounts", "accounts"), - resourceids.UserSpecifiedSegment("accountName", "subAccountName"), + resourceids.UserSpecifiedSegment("accountName", "accountName"), } } diff --git a/resource-manager/logz/2020-10-01/vmhost/id_account_test.go b/resource-manager/logz/2020-10-01/vmhost/id_account_test.go index 1178775f8e5..f2653f3ae62 100644 --- a/resource-manager/logz/2020-10-01/vmhost/id_account_test.go +++ b/resource-manager/logz/2020-10-01/vmhost/id_account_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccountId{} func TestNewAccountID(t *testing.T) { - id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName") + id := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.AccountName != "subAccountName" { - t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "subAccountName") + if id.AccountName != "accountName" { + t.Fatalf("Expected %q but got %q for Segment 'AccountName'", id.AccountName, "accountName") } } func TestFormatAccountID(t *testing.T) { - actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "subAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName" + actual := NewAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "accountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - AccountName: "subAccountName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - AccountName: "subAccountName", + AccountName: "accountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/subAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Logz/monitors/monitorName/accounts/accountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe", Expected: &AccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - AccountName: "sUbAcCoUnTnAmE", + AccountName: "aCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/sUbAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lOgZ/mOnItOrS/mOnItOrNaMe/aCcOuNtS/aCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/README.md b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/README.md index 7b48106d4e5..7a661a9293f 100644 --- a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName") payload := batchdeployment.BatchDeploymentTrackedResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchdeployment.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := batchdeployment.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName") // alternatively `client.List(ctx, id, batchdeployment.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, batchdeployment.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := batchdeployment.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName") payload := batchdeployment.PartialBatchDeploymentPartialMinimalTrackedResourceWithProperties{ // ... diff --git a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_batchendpoint.go b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_batchendpoint.go index d61c74c9d87..7ea4a76b10e 100644 --- a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_batchendpoint.go +++ b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_batchendpoint.go @@ -123,7 +123,7 @@ func (id BatchEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticBatchEndpoints", "batchEndpoints", "batchEndpoints"), - resourceids.UserSpecifiedSegment("batchEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("batchEndpointName", "batchEndpointName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_batchendpoint_test.go b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_batchendpoint_test.go index 260c1e6f3a3..b8105f503c8 100644 --- a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_batchendpoint_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_batchendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchEndpointId{} func TestNewBatchEndpointID(t *testing.T) { - id := NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") + id := NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBatchEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.BatchEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchEndpointName'", id.BatchEndpointName, "endpointName") + if id.BatchEndpointName != "batchEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchEndpointName'", id.BatchEndpointName, "batchEndpointName") } } func TestFormatBatchEndpointID(t *testing.T) { - actual := NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName" + actual := NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBatchEndpointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName", Expected: &BatchEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - BatchEndpointName: "endpointName", + BatchEndpointName: "batchEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBatchEndpointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName", Expected: &BatchEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - BatchEndpointName: "endpointName", + BatchEndpointName: "batchEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/bAtChEnDpOiNtNaMe", Expected: &BatchEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - BatchEndpointName: "eNdPoInTnAmE", + BatchEndpointName: "bAtChEnDpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/eNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/bAtChEnDpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_deployment.go b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_deployment.go index 29339abb221..4a91c959a5c 100644 --- a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_deployment.go +++ b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_deployment.go @@ -129,7 +129,7 @@ func (id DeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticBatchEndpoints", "batchEndpoints", "batchEndpoints"), - resourceids.UserSpecifiedSegment("batchEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("batchEndpointName", "batchEndpointName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), resourceids.UserSpecifiedSegment("deploymentName", "deploymentName"), } diff --git a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_deployment_test.go b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_deployment_test.go index cbf6584b0be..1ddb6202666 100644 --- a/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_deployment_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/batchdeployment/id_deployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeploymentId{} func TestNewDeploymentID(t *testing.T) { - id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") + id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.BatchEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchEndpointName'", id.BatchEndpointName, "endpointName") + if id.BatchEndpointName != "batchEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchEndpointName'", id.BatchEndpointName, "batchEndpointName") } if id.DeploymentName != "deploymentName" { @@ -36,8 +36,8 @@ func TestNewDeploymentID(t *testing.T) { } func TestFormatDeploymentID(t *testing.T) { - actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/deployments/deploymentName" + actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/deployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - BatchEndpointName: "endpointName", + BatchEndpointName: "batchEndpointName", DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/deployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/deployments/deploymentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/bAtChEnDpOiNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/eNdPoInTnAmE/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/bAtChEnDpOiNtNaMe/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/deployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - BatchEndpointName: "endpointName", + BatchEndpointName: "batchEndpointName", DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/deployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/eNdPoInTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/bAtChEnDpOiNtNaMe/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - BatchEndpointName: "eNdPoInTnAmE", + BatchEndpointName: "bAtChEnDpOiNtNaMe", DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/eNdPoInTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/bAtChEnDpOiNtNaMe/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/batchendpoint/README.md b/resource-manager/machinelearningservices/2024-04-01/batchendpoint/README.md index f887107732a..f85a8852b27 100644 --- a/resource-manager/machinelearningservices/2024-04-01/batchendpoint/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/batchendpoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName") payload := batchendpoint.BatchEndpointTrackedResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -102,7 +102,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := batchendpoint.NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName") payload := batchendpoint.PartialMinimalTrackedResourceWithIdentity{ // ... diff --git a/resource-manager/machinelearningservices/2024-04-01/batchendpoint/id_batchendpoint.go b/resource-manager/machinelearningservices/2024-04-01/batchendpoint/id_batchendpoint.go index f411bf3fc07..1f4b1aeaee8 100644 --- a/resource-manager/machinelearningservices/2024-04-01/batchendpoint/id_batchendpoint.go +++ b/resource-manager/machinelearningservices/2024-04-01/batchendpoint/id_batchendpoint.go @@ -123,7 +123,7 @@ func (id BatchEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticBatchEndpoints", "batchEndpoints", "batchEndpoints"), - resourceids.UserSpecifiedSegment("batchEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("batchEndpointName", "batchEndpointName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/batchendpoint/id_batchendpoint_test.go b/resource-manager/machinelearningservices/2024-04-01/batchendpoint/id_batchendpoint_test.go index 5dfdd8ec9be..35647bc9baa 100644 --- a/resource-manager/machinelearningservices/2024-04-01/batchendpoint/id_batchendpoint_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/batchendpoint/id_batchendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BatchEndpointId{} func TestNewBatchEndpointID(t *testing.T) { - id := NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") + id := NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBatchEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.BatchEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'BatchEndpointName'", id.BatchEndpointName, "endpointName") + if id.BatchEndpointName != "batchEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'BatchEndpointName'", id.BatchEndpointName, "batchEndpointName") } } func TestFormatBatchEndpointID(t *testing.T) { - actual := NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName" + actual := NewBatchEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "batchEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBatchEndpointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName", Expected: &BatchEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - BatchEndpointName: "endpointName", + BatchEndpointName: "batchEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBatchEndpointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName", Expected: &BatchEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - BatchEndpointName: "endpointName", + BatchEndpointName: "batchEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/batchEndpoints/batchEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/bAtChEnDpOiNtNaMe", Expected: &BatchEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - BatchEndpointName: "eNdPoInTnAmE", + BatchEndpointName: "bAtChEnDpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/eNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/bAtChEnDpOiNtS/bAtChEnDpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/codecontainer/README.md b/resource-manager/machinelearningservices/2024-04-01/codecontainer/README.md index 7e2d83ea13a..4042a8d574a 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codecontainer/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/codecontainer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := codecontainer.NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := codecontainer.NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName") payload := codecontainer.CodeContainerResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := codecontainer.NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := codecontainer.NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := codecontainer.NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := codecontainer.NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/codecontainer/id_code.go b/resource-manager/machinelearningservices/2024-04-01/codecontainer/id_code.go index 282880235b6..c833044c6f5 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codecontainer/id_code.go +++ b/resource-manager/machinelearningservices/2024-04-01/codecontainer/id_code.go @@ -123,7 +123,7 @@ func (id CodeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticCodes", "codes", "codes"), - resourceids.UserSpecifiedSegment("codeName", "name"), + resourceids.UserSpecifiedSegment("codeName", "codeName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/codecontainer/id_code_test.go b/resource-manager/machinelearningservices/2024-04-01/codecontainer/id_code_test.go index 8921f2efd6d..4dca6bc0255 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codecontainer/id_code_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/codecontainer/id_code_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CodeId{} func TestNewCodeID(t *testing.T) { - id := NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewCodeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.CodeName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CodeName'", id.CodeName, "name") + if id.CodeName != "codeName" { + t.Fatalf("Expected %q but got %q for Segment 'CodeName'", id.CodeName, "codeName") } } func TestFormatCodeID(t *testing.T) { - actual := NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name" + actual := NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseCodeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName", Expected: &CodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - CodeName: "name", + CodeName: "codeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseCodeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName", Expected: &CodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - CodeName: "name", + CodeName: "codeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/cOdEnAmE", Expected: &CodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - CodeName: "nAmE", + CodeName: "cOdEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/cOdEnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/codeversion/README.md b/resource-manager/machinelearningservices/2024-04-01/codeversion/README.md index 1f3e0ae5283..7070e3459be 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codeversion/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/codeversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName", "versionName") payload := codeversion.PendingUploadRequestDto{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName", "versionName") payload := codeversion.CodeVersionResource{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := codeversion.NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := codeversion.NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName") // alternatively `client.List(ctx, id, codeversion.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, codeversion.DefaultListOperationOptions()) @@ -115,7 +115,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := codeversion.NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName", "versionName") payload := codeversion.DestinationAsset{ // ... @@ -132,7 +132,7 @@ if err := client.PublishThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := codeversion.NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "version") +id := codeversion.NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "versionName") payload := codeversion.PendingUploadRequestDto{ // ... @@ -153,7 +153,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := codeversion.NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "version") +id := codeversion.NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "versionName") payload := codeversion.CodeVersionResource{ // ... @@ -170,7 +170,7 @@ if err := client.RegistryCodeVersionsCreateOrUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := codeversion.NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "version") +id := codeversion.NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "versionName") if err := client.RegistryCodeVersionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -182,7 +182,7 @@ if err := client.RegistryCodeVersionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := codeversion.NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "version") +id := codeversion.NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "versionName") read, err := client.RegistryCodeVersionsGet(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_code.go b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_code.go index 0ad1cfc92db..46a99295c50 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_code.go +++ b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_code.go @@ -123,7 +123,7 @@ func (id CodeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticCodes", "codes", "codes"), - resourceids.UserSpecifiedSegment("codeName", "name"), + resourceids.UserSpecifiedSegment("codeName", "codeName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_code_test.go b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_code_test.go index 31aaa787dc6..c354037e3b1 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_code_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_code_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CodeId{} func TestNewCodeID(t *testing.T) { - id := NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewCodeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.CodeName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CodeName'", id.CodeName, "name") + if id.CodeName != "codeName" { + t.Fatalf("Expected %q but got %q for Segment 'CodeName'", id.CodeName, "codeName") } } func TestFormatCodeID(t *testing.T) { - actual := NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name" + actual := NewCodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseCodeID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName", Expected: &CodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - CodeName: "name", + CodeName: "codeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseCodeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName", Expected: &CodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - CodeName: "name", + CodeName: "codeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/cOdEnAmE", Expected: &CodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - CodeName: "nAmE", + CodeName: "cOdEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/cOdEnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_codeversion.go b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_codeversion.go index 8e8325f1193..41c90c25163 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_codeversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_codeversion.go @@ -129,9 +129,9 @@ func (id CodeVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticCodes", "codes", "codes"), - resourceids.UserSpecifiedSegment("codeName", "name"), + resourceids.UserSpecifiedSegment("codeName", "codeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_codeversion_test.go b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_codeversion_test.go index c30aacc0470..9297b040b54 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_codeversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_codeversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CodeVersionId{} func TestNewCodeVersionID(t *testing.T) { - id := NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") + id := NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewCodeVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.CodeName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CodeName'", id.CodeName, "name") + if id.CodeName != "codeName" { + t.Fatalf("Expected %q but got %q for Segment 'CodeName'", id.CodeName, "codeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatCodeVersionID(t *testing.T) { - actual := NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/versions/version" + actual := NewCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "codeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseCodeVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/versions/versionName", Expected: &CodeVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - CodeName: "name", - VersionName: "version", + CodeName: "codeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseCodeVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/cOdEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/cOdEnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/versions/versionName", Expected: &CodeVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - CodeName: "name", - VersionName: "version", + CodeName: "codeName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/codes/codeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/cOdEnAmE/vErSiOnS/vErSiOnNaMe", Expected: &CodeVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - CodeName: "nAmE", - VersionName: "vErSiOn", + CodeName: "cOdEnAmE", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOdEs/cOdEnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_registrycodeversion.go b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_registrycodeversion.go index c0984c12755..3421e5d9c28 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_registrycodeversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_registrycodeversion.go @@ -131,7 +131,7 @@ func (id RegistryCodeVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticCodes", "codes", "codes"), resourceids.UserSpecifiedSegment("codeName", "codeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_registrycodeversion_test.go b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_registrycodeversion_test.go index 33880c8b048..57f62f11822 100644 --- a/resource-manager/machinelearningservices/2024-04-01/codeversion/id_registrycodeversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/codeversion/id_registrycodeversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegistryCodeVersionId{} func TestNewRegistryCodeVersionID(t *testing.T) { - id := NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "version") + id := NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRegistryCodeVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'CodeName'", id.CodeName, "codeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatRegistryCodeVersionID(t *testing.T) { - actual := NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/version" + actual := NewRegistryCodeVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "codeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseRegistryCodeVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/versionName", Expected: &RegistryCodeVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", CodeName: "codeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/versionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseRegistryCodeVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/versionName", Expected: &RegistryCodeVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", CodeName: "codeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/codes/codeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/cOdEs/cOdEnAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/cOdEs/cOdEnAmE/vErSiOnS/vErSiOnNaMe", Expected: &RegistryCodeVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", CodeName: "cOdEnAmE", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/cOdEs/cOdEnAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/cOdEs/cOdEnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/componentcontainer/README.md b/resource-manager/machinelearningservices/2024-04-01/componentcontainer/README.md index 3fa863c48ea..e7d3dca4837 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentcontainer/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/componentcontainer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentcontainer.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := componentcontainer.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName") payload := componentcontainer.ComponentContainerResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentcontainer.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := componentcontainer.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentcontainer.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := componentcontainer.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/componentcontainer/id_component.go b/resource-manager/machinelearningservices/2024-04-01/componentcontainer/id_component.go index a40fea97fe5..1d52cada1f3 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentcontainer/id_component.go +++ b/resource-manager/machinelearningservices/2024-04-01/componentcontainer/id_component.go @@ -123,7 +123,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "name"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/componentcontainer/id_component_test.go b/resource-manager/machinelearningservices/2024-04-01/componentcontainer/id_component_test.go index 1fe7e7c6dda..ced62f6bf74 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentcontainer/id_component_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/componentcontainer/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.ComponentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "name") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ComponentName: "name", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ComponentName: "name", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - ComponentName: "nAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/componentversion/README.md b/resource-manager/machinelearningservices/2024-04-01/componentversion/README.md index e1ba74e5b88..951119a9b8b 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentversion/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/componentversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := componentversion.NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := componentversion.NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName", "versionName") payload := componentversion.ComponentVersionResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentversion.NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := componentversion.NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentversion.NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := componentversion.NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := componentversion.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := componentversion.NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName") // alternatively `client.List(ctx, id, componentversion.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, componentversion.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := componentversion.NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := componentversion.NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName", "versionName") payload := componentversion.DestinationAsset{ // ... @@ -111,7 +111,7 @@ if err := client.PublishThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := componentversion.NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "version") +id := componentversion.NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "versionName") payload := componentversion.ComponentVersionResource{ // ... @@ -128,7 +128,7 @@ if err := client.RegistryComponentVersionsCreateOrUpdateThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := componentversion.NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "version") +id := componentversion.NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "versionName") if err := client.RegistryComponentVersionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -140,7 +140,7 @@ if err := client.RegistryComponentVersionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := componentversion.NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "version") +id := componentversion.NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "versionName") read, err := client.RegistryComponentVersionsGet(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_component.go b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_component.go index cad857c10d3..1acfc154380 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_component.go +++ b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_component.go @@ -123,7 +123,7 @@ func (id ComponentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "name"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_component_test.go b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_component_test.go index edc7f8a85b7..785f551e285 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_component_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_component_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentId{} func TestNewComponentID(t *testing.T) { - id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewComponentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.ComponentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "name") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } } func TestFormatComponentID(t *testing.T) { - actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name" + actual := NewComponentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseComponentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ComponentName: "name", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseComponentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ComponentName: "name", + ComponentName: "componentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/cOmPoNeNtNaMe", Expected: &ComponentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - ComponentName: "nAmE", + ComponentName: "cOmPoNeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/cOmPoNeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_componentversion.go b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_componentversion.go index d3ce0547d1a..fe328b0eb88 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_componentversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_componentversion.go @@ -129,9 +129,9 @@ func (id ComponentVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticComponents", "components", "components"), - resourceids.UserSpecifiedSegment("componentName", "name"), + resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_componentversion_test.go b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_componentversion_test.go index 25f16530fbb..7a5e302c908 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_componentversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_componentversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ComponentVersionId{} func TestNewComponentVersionID(t *testing.T) { - id := NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") + id := NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewComponentVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.ComponentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "name") + if id.ComponentName != "componentName" { + t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatComponentVersionID(t *testing.T) { - actual := NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/versions/version" + actual := NewComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "componentName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseComponentVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/versions/versionName", Expected: &ComponentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ComponentName: "name", - VersionName: "version", + ComponentName: "componentName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseComponentVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/cOmPoNeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/cOmPoNeNtNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/versions/versionName", Expected: &ComponentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ComponentName: "name", - VersionName: "version", + ComponentName: "componentName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/components/componentName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/cOmPoNeNtNaMe/vErSiOnS/vErSiOnNaMe", Expected: &ComponentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - ComponentName: "nAmE", - VersionName: "vErSiOn", + ComponentName: "cOmPoNeNtNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/cOmPoNeNtS/cOmPoNeNtNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_registrycomponentversion.go b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_registrycomponentversion.go index 40c255d6339..15794ca31bf 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_registrycomponentversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_registrycomponentversion.go @@ -131,7 +131,7 @@ func (id RegistryComponentVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticComponents", "components", "components"), resourceids.UserSpecifiedSegment("componentName", "componentName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_registrycomponentversion_test.go b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_registrycomponentversion_test.go index 99318b04fd4..0675fd8a5f1 100644 --- a/resource-manager/machinelearningservices/2024-04-01/componentversion/id_registrycomponentversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/componentversion/id_registrycomponentversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegistryComponentVersionId{} func TestNewRegistryComponentVersionID(t *testing.T) { - id := NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "version") + id := NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRegistryComponentVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ComponentName'", id.ComponentName, "componentName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatRegistryComponentVersionID(t *testing.T) { - actual := NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/version" + actual := NewRegistryComponentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "componentName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseRegistryComponentVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/versionName", Expected: &RegistryComponentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", ComponentName: "componentName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/versionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseRegistryComponentVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/versionName", Expected: &RegistryComponentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", ComponentName: "componentName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/components/componentName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/cOmPoNeNtS/cOmPoNeNtNaMe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/cOmPoNeNtS/cOmPoNeNtNaMe/vErSiOnS/vErSiOnNaMe", Expected: &RegistryComponentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", ComponentName: "cOmPoNeNtNaMe", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/cOmPoNeNtS/cOmPoNeNtNaMe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/cOmPoNeNtS/cOmPoNeNtNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/datacontainer/README.md b/resource-manager/machinelearningservices/2024-04-01/datacontainer/README.md index cfe163cc5aa..a5ce7deb6e5 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datacontainer/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/datacontainer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datacontainer.NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := datacontainer.NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName") payload := datacontainer.DataContainerResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := datacontainer.NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := datacontainer.NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := datacontainer.NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := datacontainer.NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/datacontainer/id_workspacedata.go b/resource-manager/machinelearningservices/2024-04-01/datacontainer/id_workspacedata.go index cac53d8ad33..ff312e3029b 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datacontainer/id_workspacedata.go +++ b/resource-manager/machinelearningservices/2024-04-01/datacontainer/id_workspacedata.go @@ -123,7 +123,7 @@ func (id WorkspaceDataId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticData", "data", "data"), - resourceids.UserSpecifiedSegment("dataName", "name"), + resourceids.UserSpecifiedSegment("dataName", "dataName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/datacontainer/id_workspacedata_test.go b/resource-manager/machinelearningservices/2024-04-01/datacontainer/id_workspacedata_test.go index 69ec26adcc9..00aed403507 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datacontainer/id_workspacedata_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/datacontainer/id_workspacedata_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspaceDataId{} func TestNewWorkspaceDataID(t *testing.T) { - id := NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspaceDataID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.DataName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "name") + if id.DataName != "dataName" { + t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "dataName") } } func TestFormatWorkspaceDataID(t *testing.T) { - actual := NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name" + actual := NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspaceDataID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName", Expected: &WorkspaceDataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DataName: "name", + DataName: "dataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspaceDataIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName", Expected: &WorkspaceDataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DataName: "name", + DataName: "dataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/dAtAnAmE", Expected: &WorkspaceDataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - DataName: "nAmE", + DataName: "dAtAnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/dAtAnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/README.md b/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/README.md index b8924262f5d..a1b1b967008 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datacontainerregistry.NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name") +id := datacontainerregistry.NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName") payload := datacontainerregistry.DataContainerResource{ // ... @@ -41,7 +41,7 @@ if err := client.RegistryDataContainersCreateOrUpdateThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := datacontainerregistry.NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name") +id := datacontainerregistry.NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName") if err := client.RegistryDataContainersDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.RegistryDataContainersDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datacontainerregistry.NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name") +id := datacontainerregistry.NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName") read, err := client.RegistryDataContainersGet(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/id_data.go b/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/id_data.go index 85a95c8b493..e13d4b92d60 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/id_data.go +++ b/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/id_data.go @@ -123,7 +123,7 @@ func (id DataId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticData", "data", "data"), - resourceids.UserSpecifiedSegment("dataName", "name"), + resourceids.UserSpecifiedSegment("dataName", "dataName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/id_data_test.go b/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/id_data_test.go index e093c101aa6..c53928bc31b 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/id_data_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/datacontainerregistry/id_data_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataId{} func TestNewDataID(t *testing.T) { - id := NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name") + id := NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDataID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.DataName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "name") + if id.DataName != "dataName" { + t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "dataName") } } func TestFormatDataID(t *testing.T) { - actual := NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name" + actual := NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDataID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName", Expected: &DataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - DataName: "name", + DataName: "dataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDataIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName", Expected: &DataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - DataName: "name", + DataName: "dataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/dAtAnAmE", Expected: &DataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - DataName: "nAmE", + DataName: "dAtAnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/dAtAnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/datareference/README.md b/resource-manager/machinelearningservices/2024-04-01/datareference/README.md index 67a4c136450..55f5eafcf51 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datareference/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/datareference/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datareference.NewDataReferenceVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version") +id := datareference.NewDataReferenceVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataReferenceName", "versionName") payload := datareference.GetBlobReferenceSASRequestDto{ // ... diff --git a/resource-manager/machinelearningservices/2024-04-01/datareference/id_datareferenceversion.go b/resource-manager/machinelearningservices/2024-04-01/datareference/id_datareferenceversion.go index 18d9d7e1327..9531cf77ad5 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datareference/id_datareferenceversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/datareference/id_datareferenceversion.go @@ -129,9 +129,9 @@ func (id DataReferenceVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticDataReferences", "dataReferences", "dataReferences"), - resourceids.UserSpecifiedSegment("dataReferenceName", "name"), + resourceids.UserSpecifiedSegment("dataReferenceName", "dataReferenceName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/datareference/id_datareferenceversion_test.go b/resource-manager/machinelearningservices/2024-04-01/datareference/id_datareferenceversion_test.go index 01641669e51..6609c084ebc 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datareference/id_datareferenceversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/datareference/id_datareferenceversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataReferenceVersionId{} func TestNewDataReferenceVersionID(t *testing.T) { - id := NewDataReferenceVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version") + id := NewDataReferenceVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataReferenceName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewDataReferenceVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.DataReferenceName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DataReferenceName'", id.DataReferenceName, "name") + if id.DataReferenceName != "dataReferenceName" { + t.Fatalf("Expected %q but got %q for Segment 'DataReferenceName'", id.DataReferenceName, "dataReferenceName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatDataReferenceVersionID(t *testing.T) { - actual := NewDataReferenceVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name/versions/version" + actual := NewDataReferenceVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataReferenceName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDataReferenceVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName/versions/versionName", Expected: &DataReferenceVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - DataReferenceName: "name", - VersionName: "version", + DataReferenceName: "dataReferenceName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDataReferenceVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtArEfErEnCeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtArEfErEnCeS/dAtArEfErEnCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtArEfErEnCeS/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtArEfErEnCeS/dAtArEfErEnCeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName/versions/versionName", Expected: &DataReferenceVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - DataReferenceName: "name", - VersionName: "version", + DataReferenceName: "dataReferenceName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/dataReferences/dataReferenceName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtArEfErEnCeS/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtArEfErEnCeS/dAtArEfErEnCeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &DataReferenceVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - DataReferenceName: "nAmE", - VersionName: "vErSiOn", + DataReferenceName: "dAtArEfErEnCeNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtArEfErEnCeS/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtArEfErEnCeS/dAtArEfErEnCeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/datastore/README.md b/resource-manager/machinelearningservices/2024-04-01/datastore/README.md index f244218f221..d7786128c23 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datastore/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/datastore/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datastore.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := datastore.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataStoreName") payload := datastore.DatastoreResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := datastore.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := datastore.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataStoreName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := datastore.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := datastore.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataStoreName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := datastore.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := datastore.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataStoreName") read, err := client.ListSecrets(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/datastore/id_datastore.go b/resource-manager/machinelearningservices/2024-04-01/datastore/id_datastore.go index 313f559219b..1e813d33069 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datastore/id_datastore.go +++ b/resource-manager/machinelearningservices/2024-04-01/datastore/id_datastore.go @@ -123,7 +123,7 @@ func (id DataStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticDataStores", "dataStores", "dataStores"), - resourceids.UserSpecifiedSegment("dataStoreName", "name"), + resourceids.UserSpecifiedSegment("dataStoreName", "dataStoreName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/datastore/id_datastore_test.go b/resource-manager/machinelearningservices/2024-04-01/datastore/id_datastore_test.go index 0e15bffecdf..9a8ffedc957 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datastore/id_datastore_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/datastore/id_datastore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataStoreId{} func TestNewDataStoreID(t *testing.T) { - id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDataStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.DataStoreName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "name") + if id.DataStoreName != "dataStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "dataStoreName") } } func TestFormatDataStoreID(t *testing.T) { - actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/name" + actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/dataStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDataStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DataStoreName: "name", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/dataStoreName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDataStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DataStoreName: "name", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/dataStores/dataStoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtAsToReS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtAsToReS/dAtAsToReNaMe", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - DataStoreName: "nAmE", + DataStoreName: "dAtAsToReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtAsToReS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtAsToReS/dAtAsToReNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/datastore/model_certificatedatastorecredentials.go b/resource-manager/machinelearningservices/2024-04-01/datastore/model_certificatedatastorecredentials.go index 1ebce41484c..58e11c2fd76 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datastore/model_certificatedatastorecredentials.go +++ b/resource-manager/machinelearningservices/2024-04-01/datastore/model_certificatedatastorecredentials.go @@ -11,9 +11,9 @@ import ( var _ DatastoreCredentials = CertificateDatastoreCredentials{} type CertificateDatastoreCredentials struct { - AuthorityUrl *string `json:"authorityUrl,omitempty"` + AuthorityURL *string `json:"authorityUrl,omitempty"` ClientId string `json:"clientId"` - ResourceUrl *string `json:"resourceUrl,omitempty"` + ResourceURL *string `json:"resourceUrl,omitempty"` Secrets CertificateDatastoreSecrets `json:"secrets"` TenantId string `json:"tenantId"` Thumbprint string `json:"thumbprint"` diff --git a/resource-manager/machinelearningservices/2024-04-01/datastore/model_serviceprincipaldatastorecredentials.go b/resource-manager/machinelearningservices/2024-04-01/datastore/model_serviceprincipaldatastorecredentials.go index 1e38e43f119..d53386d94ae 100644 --- a/resource-manager/machinelearningservices/2024-04-01/datastore/model_serviceprincipaldatastorecredentials.go +++ b/resource-manager/machinelearningservices/2024-04-01/datastore/model_serviceprincipaldatastorecredentials.go @@ -11,9 +11,9 @@ import ( var _ DatastoreCredentials = ServicePrincipalDatastoreCredentials{} type ServicePrincipalDatastoreCredentials struct { - AuthorityUrl *string `json:"authorityUrl,omitempty"` + AuthorityURL *string `json:"authorityUrl,omitempty"` ClientId string `json:"clientId"` - ResourceUrl *string `json:"resourceUrl,omitempty"` + ResourceURL *string `json:"resourceUrl,omitempty"` Secrets ServicePrincipalDatastoreSecrets `json:"secrets"` TenantId string `json:"tenantId"` diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversion/README.md b/resource-manager/machinelearningservices/2024-04-01/dataversion/README.md index b52d448878e..c03cd5b0790 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversion/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/dataversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dataversion.NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := dataversion.NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName", "versionName") payload := dataversion.DataVersionBaseResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dataversion.NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := dataversion.NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dataversion.NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := dataversion.NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dataversion.NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := dataversion.NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName") // alternatively `client.List(ctx, id, dataversion.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, dataversion.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := dataversion.NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := dataversion.NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName", "versionName") payload := dataversion.DestinationAsset{ // ... diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversion/id_dataversion.go b/resource-manager/machinelearningservices/2024-04-01/dataversion/id_dataversion.go index a5012fc01a6..e9c96cb9cc2 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversion/id_dataversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/dataversion/id_dataversion.go @@ -129,9 +129,9 @@ func (id DataVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticData", "data", "data"), - resourceids.UserSpecifiedSegment("dataName", "name"), + resourceids.UserSpecifiedSegment("dataName", "dataName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversion/id_dataversion_test.go b/resource-manager/machinelearningservices/2024-04-01/dataversion/id_dataversion_test.go index 7896c501d80..50f9cfa71a9 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversion/id_dataversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/dataversion/id_dataversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataVersionId{} func TestNewDataVersionID(t *testing.T) { - id := NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") + id := NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewDataVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.DataName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "name") + if id.DataName != "dataName" { + t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "dataName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatDataVersionID(t *testing.T) { - actual := NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/versions/version" + actual := NewDataVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDataVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/versions/versionName", Expected: &DataVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DataName: "name", - VersionName: "version", + DataName: "dataName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDataVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/dAtAnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/dAtAnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/versions/versionName", Expected: &DataVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DataName: "name", - VersionName: "version", + DataName: "dataName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/dAtAnAmE/vErSiOnS/vErSiOnNaMe", Expected: &DataVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - DataName: "nAmE", - VersionName: "vErSiOn", + DataName: "dAtAnAmE", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/dAtAnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversion/id_workspacedata.go b/resource-manager/machinelearningservices/2024-04-01/dataversion/id_workspacedata.go index e01b0cfc22b..dcc5a656eea 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversion/id_workspacedata.go +++ b/resource-manager/machinelearningservices/2024-04-01/dataversion/id_workspacedata.go @@ -123,7 +123,7 @@ func (id WorkspaceDataId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticData", "data", "data"), - resourceids.UserSpecifiedSegment("dataName", "name"), + resourceids.UserSpecifiedSegment("dataName", "dataName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversion/id_workspacedata_test.go b/resource-manager/machinelearningservices/2024-04-01/dataversion/id_workspacedata_test.go index a40d22d985d..11cccd4e6f6 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversion/id_workspacedata_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/dataversion/id_workspacedata_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkspaceDataId{} func TestNewWorkspaceDataID(t *testing.T) { - id := NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWorkspaceDataID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.DataName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "name") + if id.DataName != "dataName" { + t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "dataName") } } func TestFormatWorkspaceDataID(t *testing.T) { - actual := NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name" + actual := NewWorkspaceDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dataName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWorkspaceDataID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName", Expected: &WorkspaceDataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DataName: "name", + DataName: "dataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWorkspaceDataIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName", Expected: &WorkspaceDataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DataName: "name", + DataName: "dataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/data/dataName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/dAtAnAmE", Expected: &WorkspaceDataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - DataName: "nAmE", + DataName: "dAtAnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/dAtA/dAtAnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/README.md b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/README.md index a9c3300d5a1..6724f33c75a 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dataversionregistry.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version") +id := dataversionregistry.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName", "versionName") payload := dataversionregistry.PendingUploadRequestDto{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dataversionregistry.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version") +id := dataversionregistry.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName", "versionName") payload := dataversionregistry.DataVersionBaseResource{ // ... @@ -62,7 +62,7 @@ if err := client.RegistryDataVersionsCreateOrUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := dataversionregistry.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version") +id := dataversionregistry.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName", "versionName") if err := client.RegistryDataVersionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -74,7 +74,7 @@ if err := client.RegistryDataVersionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := dataversionregistry.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version") +id := dataversionregistry.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName", "versionName") read, err := client.RegistryDataVersionsGet(ctx, id) if err != nil { @@ -90,7 +90,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dataversionregistry.NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name") +id := dataversionregistry.NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName") // alternatively `client.RegistryDataVersionsList(ctx, id, dataversionregistry.DefaultRegistryDataVersionsListOperationOptions())` can be used to do batched pagination items, err := client.RegistryDataVersionsListComplete(ctx, id, dataversionregistry.DefaultRegistryDataVersionsListOperationOptions()) diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_data.go b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_data.go index c2ea9abf8df..5d54702dfe2 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_data.go +++ b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_data.go @@ -123,7 +123,7 @@ func (id DataId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticData", "data", "data"), - resourceids.UserSpecifiedSegment("dataName", "name"), + resourceids.UserSpecifiedSegment("dataName", "dataName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_data_test.go b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_data_test.go index 7a925d06a5e..4dfc01596eb 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_data_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_data_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataId{} func TestNewDataID(t *testing.T) { - id := NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name") + id := NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDataID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.DataName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "name") + if id.DataName != "dataName" { + t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "dataName") } } func TestFormatDataID(t *testing.T) { - actual := NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name" + actual := NewDataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDataID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName", Expected: &DataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - DataName: "name", + DataName: "dataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDataIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName", Expected: &DataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - DataName: "name", + DataName: "dataName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/dAtAnAmE", Expected: &DataId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - DataName: "nAmE", + DataName: "dAtAnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/dAtAnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_version.go b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_version.go index fc8517807a8..ca59eb9aee0 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_version.go +++ b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_version.go @@ -129,9 +129,9 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRegistries", "registries", "registries"), resourceids.UserSpecifiedSegment("registryName", "registryName"), resourceids.StaticSegment("staticData", "data", "data"), - resourceids.UserSpecifiedSegment("dataName", "name"), + resourceids.UserSpecifiedSegment("dataName", "dataName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_version_test.go b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_version_test.go index 9da083718f2..53d1845af90 100644 --- a/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_version_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/dataversionregistry/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RegistryName'", id.RegistryName, "registryName") } - if id.DataName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "name") + if id.DataName != "dataName" { + t.Fatalf("Expected %q but got %q for Segment 'DataName'", id.DataName, "dataName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "dataName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - DataName: "name", - VersionName: "version", + DataName: "dataName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/dAtAnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/dAtAnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", - DataName: "name", - VersionName: "version", + DataName: "dataName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/data/dataName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/dAtAnAmE/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", - DataName: "nAmE", - VersionName: "vErSiOn", + DataName: "dAtAnAmE", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/dAtA/dAtAnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/README.md b/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/README.md index e5516090a7c..e21ca000843 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := environmentcontainer.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := environmentcontainer.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName") payload := environmentcontainer.EnvironmentContainerResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := environmentcontainer.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := environmentcontainer.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := environmentcontainer.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := environmentcontainer.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/id_environment.go b/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/id_environment.go index a3ed07080bf..31458129d5d 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/id_environment.go +++ b/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/id_environment.go @@ -123,7 +123,7 @@ func (id EnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), - resourceids.UserSpecifiedSegment("environmentName", "name"), + resourceids.UserSpecifiedSegment("environmentName", "environmentName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/id_environment_test.go b/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/id_environment_test.go index 4e8af6c9dc1..c8633ca6192 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/id_environment_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/environmentcontainer/id_environment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EnvironmentId{} func TestNewEnvironmentID(t *testing.T) { - id := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.EnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "name") + if id.EnvironmentName != "environmentName" { + t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "environmentName") } } func TestFormatEnvironmentID(t *testing.T) { - actual := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name" + actual := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - EnvironmentName: "name", + EnvironmentName: "environmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - EnvironmentName: "name", + EnvironmentName: "environmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/eNvIrOnMeNtNaMe", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - EnvironmentName: "nAmE", + EnvironmentName: "eNvIrOnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentversion/README.md b/resource-manager/machinelearningservices/2024-04-01/environmentversion/README.md index 34f203b6e24..6bdc457d646 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentversion/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/environmentversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := environmentversion.NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := environmentversion.NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName", "versionName") payload := environmentversion.EnvironmentVersionResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := environmentversion.NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := environmentversion.NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := environmentversion.NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := environmentversion.NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := environmentversion.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := environmentversion.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName") // alternatively `client.List(ctx, id, environmentversion.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, environmentversion.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := environmentversion.NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := environmentversion.NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName", "versionName") payload := environmentversion.DestinationAsset{ // ... @@ -111,7 +111,7 @@ if err := client.PublishThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := environmentversion.NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "version") +id := environmentversion.NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "versionName") payload := environmentversion.EnvironmentVersionResource{ // ... @@ -128,7 +128,7 @@ if err := client.RegistryEnvironmentVersionsCreateOrUpdateThenPoll(ctx, id, payl ```go ctx := context.TODO() -id := environmentversion.NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "version") +id := environmentversion.NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "versionName") if err := client.RegistryEnvironmentVersionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -140,7 +140,7 @@ if err := client.RegistryEnvironmentVersionsDeleteThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := environmentversion.NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "version") +id := environmentversion.NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "versionName") read, err := client.RegistryEnvironmentVersionsGet(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environment.go b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environment.go index c61119005ec..2d0575da32b 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environment.go +++ b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environment.go @@ -123,7 +123,7 @@ func (id EnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), - resourceids.UserSpecifiedSegment("environmentName", "name"), + resourceids.UserSpecifiedSegment("environmentName", "environmentName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environment_test.go b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environment_test.go index 5a6f3c933ff..e4c30775c5d 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environment_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EnvironmentId{} func TestNewEnvironmentID(t *testing.T) { - id := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.EnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "name") + if id.EnvironmentName != "environmentName" { + t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "environmentName") } } func TestFormatEnvironmentID(t *testing.T) { - actual := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name" + actual := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - EnvironmentName: "name", + EnvironmentName: "environmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - EnvironmentName: "name", + EnvironmentName: "environmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/eNvIrOnMeNtNaMe", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - EnvironmentName: "nAmE", + EnvironmentName: "eNvIrOnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environmentversion.go b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environmentversion.go index 3d1930a4c6b..9e4e6dee046 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environmentversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environmentversion.go @@ -129,9 +129,9 @@ func (id EnvironmentVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), - resourceids.UserSpecifiedSegment("environmentName", "name"), + resourceids.UserSpecifiedSegment("environmentName", "environmentName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environmentversion_test.go b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environmentversion_test.go index 590a2467cdf..6226c5e992b 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environmentversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_environmentversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EnvironmentVersionId{} func TestNewEnvironmentVersionID(t *testing.T) { - id := NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") + id := NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewEnvironmentVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.EnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "name") + if id.EnvironmentName != "environmentName" { + t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "environmentName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatEnvironmentVersionID(t *testing.T) { - actual := NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/versions/version" + actual := NewEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "environmentName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseEnvironmentVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/versions/versionName", Expected: &EnvironmentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - EnvironmentName: "name", - VersionName: "version", + EnvironmentName: "environmentName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseEnvironmentVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/eNvIrOnMeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/versions/versionName", Expected: &EnvironmentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - EnvironmentName: "name", - VersionName: "version", + EnvironmentName: "environmentName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/environments/environmentName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/vErSiOnS/vErSiOnNaMe", Expected: &EnvironmentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - EnvironmentName: "nAmE", - VersionName: "vErSiOn", + EnvironmentName: "eNvIrOnMeNtNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_registryenvironmentversion.go b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_registryenvironmentversion.go index 09f8fa4d829..0740cbb7dc1 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_registryenvironmentversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_registryenvironmentversion.go @@ -131,7 +131,7 @@ func (id RegistryEnvironmentVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticEnvironments", "environments", "environments"), resourceids.UserSpecifiedSegment("environmentName", "environmentName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_registryenvironmentversion_test.go b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_registryenvironmentversion_test.go index 86622f9e35b..07c56b6d583 100644 --- a/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_registryenvironmentversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/environmentversion/id_registryenvironmentversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegistryEnvironmentVersionId{} func TestNewRegistryEnvironmentVersionID(t *testing.T) { - id := NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "version") + id := NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRegistryEnvironmentVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'EnvironmentName'", id.EnvironmentName, "environmentName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatRegistryEnvironmentVersionID(t *testing.T) { - actual := NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/version" + actual := NewRegistryEnvironmentVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "environmentName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseRegistryEnvironmentVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/versionName", Expected: &RegistryEnvironmentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", EnvironmentName: "environmentName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/versionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseRegistryEnvironmentVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/versionName", Expected: &RegistryEnvironmentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", EnvironmentName: "environmentName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/environments/environmentName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/vErSiOnS/vErSiOnNaMe", Expected: &RegistryEnvironmentVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", EnvironmentName: "eNvIrOnMeNtNaMe", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/eNvIrOnMeNtS/eNvIrOnMeNtNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/feature/README.md b/resource-manager/machinelearningservices/2024-04-01/feature/README.md index 5e648db9265..23285bc5534 100644 --- a/resource-manager/machinelearningservices/2024-04-01/feature/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/feature/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := feature.NewFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featuresetName", "featuresetVersion", "featureName") +id := feature.NewFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName", "featureName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := feature.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := feature.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName") // alternatively `client.List(ctx, id, feature.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, feature.DefaultListOperationOptions()) diff --git a/resource-manager/machinelearningservices/2024-04-01/feature/id_feature.go b/resource-manager/machinelearningservices/2024-04-01/feature/id_feature.go index 9e1f663bc29..b3fda6a17a7 100644 --- a/resource-manager/machinelearningservices/2024-04-01/feature/id_feature.go +++ b/resource-manager/machinelearningservices/2024-04-01/feature/id_feature.go @@ -135,9 +135,9 @@ func (id FeatureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFeatureSets", "featureSets", "featureSets"), - resourceids.UserSpecifiedSegment("featureSetName", "featuresetName"), + resourceids.UserSpecifiedSegment("featureSetName", "featureSetName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "featuresetVersion"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), resourceids.StaticSegment("staticFeatures", "features", "features"), resourceids.UserSpecifiedSegment("featureName", "featureName"), } diff --git a/resource-manager/machinelearningservices/2024-04-01/feature/id_feature_test.go b/resource-manager/machinelearningservices/2024-04-01/feature/id_feature_test.go index ce4aaa76913..f5430de3a64 100644 --- a/resource-manager/machinelearningservices/2024-04-01/feature/id_feature_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/feature/id_feature_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FeatureId{} func TestNewFeatureID(t *testing.T) { - id := NewFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featuresetName", "featuresetVersion", "featureName") + id := NewFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName", "featureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewFeatureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FeatureSetName != "featuresetName" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "featuresetName") + if id.FeatureSetName != "featureSetName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "featureSetName") } - if id.VersionName != "featuresetVersion" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "featuresetVersion") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } if id.FeatureName != "featureName" { @@ -40,8 +40,8 @@ func TestNewFeatureID(t *testing.T) { } func TestFormatFeatureID(t *testing.T) { - actual := NewFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featuresetName", "featuresetVersion", "featureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion/features/featureName" + actual := NewFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName", "featureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/features/featureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseFeatureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion/features", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/features", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion/features/featureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/features/featureName", Expected: &FeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "featuresetName", - VersionName: "featuresetVersion", + FeatureSetName: "featureSetName", + VersionName: "versionName", FeatureName: "featureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion/features/featureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/features/featureName/extra", Error: true, }, } @@ -286,7 +286,7 @@ func TestParseFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Error: true, }, { @@ -296,7 +296,7 @@ func TestParseFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions", Error: true, }, { @@ -306,56 +306,56 @@ func TestParseFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/fEaTuReSeTvErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/vErSiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion/features", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/features", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/fEaTuReSeTvErSiOn/fEaTuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/vErSiOnNaMe/fEaTuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion/features/featureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/features/featureName", Expected: &FeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "featuresetName", - VersionName: "featuresetVersion", + FeatureSetName: "featureSetName", + VersionName: "versionName", FeatureName: "featureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featuresetName/versions/featuresetVersion/features/featureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/features/featureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/fEaTuReSeTvErSiOn/fEaTuReS/fEaTuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/vErSiOnNaMe/fEaTuReS/fEaTuReNaMe", Expected: &FeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", FeatureSetName: "fEaTuReSeTnAmE", - VersionName: "fEaTuReSeTvErSiOn", + VersionName: "vErSiOnNaMe", FeatureName: "fEaTuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/fEaTuReSeTvErSiOn/fEaTuReS/fEaTuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/vErSiOnNaMe/fEaTuReS/fEaTuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/feature/id_featuresetversion.go b/resource-manager/machinelearningservices/2024-04-01/feature/id_featuresetversion.go index 5a7cd2bd4dc..37f9435f851 100644 --- a/resource-manager/machinelearningservices/2024-04-01/feature/id_featuresetversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/feature/id_featuresetversion.go @@ -129,9 +129,9 @@ func (id FeatureSetVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFeatureSets", "featureSets", "featureSets"), - resourceids.UserSpecifiedSegment("featureSetName", "name"), + resourceids.UserSpecifiedSegment("featureSetName", "featureSetName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/feature/id_featuresetversion_test.go b/resource-manager/machinelearningservices/2024-04-01/feature/id_featuresetversion_test.go index 2a9cb57ebc9..d52eb59e90e 100644 --- a/resource-manager/machinelearningservices/2024-04-01/feature/id_featuresetversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/feature/id_featuresetversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FeatureSetVersionId{} func TestNewFeatureSetVersionID(t *testing.T) { - id := NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") + id := NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewFeatureSetVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FeatureSetName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "name") + if id.FeatureSetName != "featureSetName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "featureSetName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatFeatureSetVersionID(t *testing.T) { - actual := NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version" + actual := NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseFeatureSetVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName", Expected: &FeatureSetVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "name", - VersionName: "version", + FeatureSetName: "featureSetName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseFeatureSetVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName", Expected: &FeatureSetVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "name", - VersionName: "version", + FeatureSetName: "featureSetName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/vErSiOnNaMe", Expected: &FeatureSetVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - FeatureSetName: "nAmE", - VersionName: "vErSiOn", + FeatureSetName: "fEaTuReSeTnAmE", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/README.md b/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/README.md index 072a0575191..a2a851fe8bd 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresetcontainer.NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := featuresetcontainer.NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName") payload := featuresetcontainer.FeaturesetContainerResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := featuresetcontainer.NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := featuresetcontainer.NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := featuresetcontainer.NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := featuresetcontainer.NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName") read, err := client.GetEntity(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/id_featureset.go b/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/id_featureset.go index 8f5d7fb1eab..9bee8c98789 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/id_featureset.go +++ b/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/id_featureset.go @@ -123,7 +123,7 @@ func (id FeatureSetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFeatureSets", "featureSets", "featureSets"), - resourceids.UserSpecifiedSegment("featureSetName", "name"), + resourceids.UserSpecifiedSegment("featureSetName", "featureSetName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/id_featureset_test.go b/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/id_featureset_test.go index d459a67027d..1f9ab1ad79c 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/id_featureset_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/featuresetcontainer/id_featureset_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FeatureSetId{} func TestNewFeatureSetID(t *testing.T) { - id := NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewFeatureSetID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FeatureSetName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "name") + if id.FeatureSetName != "featureSetName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "featureSetName") } } func TestFormatFeatureSetID(t *testing.T) { - actual := NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name" + actual := NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseFeatureSetID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Expected: &FeatureSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "name", + FeatureSetName: "featureSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseFeatureSetIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Expected: &FeatureSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "name", + FeatureSetName: "featureSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE", Expected: &FeatureSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - FeatureSetName: "nAmE", + FeatureSetName: "fEaTuReSeTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/README.md b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/README.md index a5a3a8c5b8f..b080cd12524 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresetversion.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := featuresetversion.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName") payload := featuresetversion.FeaturesetVersionBackfillRequest{ // ... @@ -41,7 +41,7 @@ if err := client.BackfillThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := featuresetversion.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := featuresetversion.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName") payload := featuresetversion.FeaturesetVersionResource{ // ... @@ -58,7 +58,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := featuresetversion.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := featuresetversion.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := featuresetversion.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := featuresetversion.NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := featuresetversion.NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := featuresetversion.NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName") // alternatively `client.List(ctx, id, featuresetversion.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, featuresetversion.DefaultListOperationOptions()) diff --git a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featureset.go b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featureset.go index b4e6c3db0f3..cd587d73402 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featureset.go +++ b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featureset.go @@ -123,7 +123,7 @@ func (id FeatureSetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFeatureSets", "featureSets", "featureSets"), - resourceids.UserSpecifiedSegment("featureSetName", "name"), + resourceids.UserSpecifiedSegment("featureSetName", "featureSetName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featureset_test.go b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featureset_test.go index 767acb15424..944ba4198f3 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featureset_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featureset_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FeatureSetId{} func TestNewFeatureSetID(t *testing.T) { - id := NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewFeatureSetID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FeatureSetName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "name") + if id.FeatureSetName != "featureSetName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "featureSetName") } } func TestFormatFeatureSetID(t *testing.T) { - actual := NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name" + actual := NewFeatureSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseFeatureSetID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Expected: &FeatureSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "name", + FeatureSetName: "featureSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseFeatureSetIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Expected: &FeatureSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "name", + FeatureSetName: "featureSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE", Expected: &FeatureSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - FeatureSetName: "nAmE", + FeatureSetName: "fEaTuReSeTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featuresetversion.go b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featuresetversion.go index 0b4f64d4fb4..5c58da85b49 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featuresetversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featuresetversion.go @@ -129,9 +129,9 @@ func (id FeatureSetVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFeatureSets", "featureSets", "featureSets"), - resourceids.UserSpecifiedSegment("featureSetName", "name"), + resourceids.UserSpecifiedSegment("featureSetName", "featureSetName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featuresetversion_test.go b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featuresetversion_test.go index e376ce7d3b3..f9ca5df75e0 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featuresetversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/featuresetversion/id_featuresetversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FeatureSetVersionId{} func TestNewFeatureSetVersionID(t *testing.T) { - id := NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") + id := NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewFeatureSetVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FeatureSetName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "name") + if id.FeatureSetName != "featureSetName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureSetName'", id.FeatureSetName, "featureSetName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatFeatureSetVersionID(t *testing.T) { - actual := NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version" + actual := NewFeatureSetVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureSetName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseFeatureSetVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName", Expected: &FeatureSetVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "name", - VersionName: "version", + FeatureSetName: "featureSetName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseFeatureSetVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName", Expected: &FeatureSetVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureSetName: "name", - VersionName: "version", + FeatureSetName: "featureSetName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureSets/featureSetName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/vErSiOnNaMe", Expected: &FeatureSetVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - FeatureSetName: "nAmE", - VersionName: "vErSiOn", + FeatureSetName: "fEaTuReSeTnAmE", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReSeTs/fEaTuReSeTnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/README.md b/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/README.md index 2b3d2bf2172..b82861abf22 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featurestoreentitycontainer.NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := featurestoreentitycontainer.NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName") payload := featurestoreentitycontainer.FeaturestoreEntityContainerResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := featurestoreentitycontainer.NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := featurestoreentitycontainer.NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := featurestoreentitycontainer.NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := featurestoreentitycontainer.NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName") read, err := client.GetEntity(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/id_featurestoreentity.go b/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/id_featurestoreentity.go index 75fdfaf2e29..3fdbe1b064d 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/id_featurestoreentity.go +++ b/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/id_featurestoreentity.go @@ -123,7 +123,7 @@ func (id FeatureStoreEntityId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFeatureStoreEntities", "featureStoreEntities", "featureStoreEntities"), - resourceids.UserSpecifiedSegment("featureStoreEntityName", "name"), + resourceids.UserSpecifiedSegment("featureStoreEntityName", "featureStoreEntityName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/id_featurestoreentity_test.go b/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/id_featurestoreentity_test.go index 2f6280235f0..e4325a1d721 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/id_featurestoreentity_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/featurestoreentitycontainer/id_featurestoreentity_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FeatureStoreEntityId{} func TestNewFeatureStoreEntityID(t *testing.T) { - id := NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewFeatureStoreEntityID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FeatureStoreEntityName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureStoreEntityName'", id.FeatureStoreEntityName, "name") + if id.FeatureStoreEntityName != "featureStoreEntityName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureStoreEntityName'", id.FeatureStoreEntityName, "featureStoreEntityName") } } func TestFormatFeatureStoreEntityID(t *testing.T) { - actual := NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name" + actual := NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseFeatureStoreEntityID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName", Expected: &FeatureStoreEntityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureStoreEntityName: "name", + FeatureStoreEntityName: "featureStoreEntityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseFeatureStoreEntityIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName", Expected: &FeatureStoreEntityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureStoreEntityName: "name", + FeatureStoreEntityName: "featureStoreEntityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/fEaTuReStOrEeNtItYnAmE", Expected: &FeatureStoreEntityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - FeatureStoreEntityName: "nAmE", + FeatureStoreEntityName: "fEaTuReStOrEeNtItYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/fEaTuReStOrEeNtItYnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/README.md b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/README.md index efc80dbb2a9..b2e0c30b15a 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featurestoreentityversion.NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := featurestoreentityversion.NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName", "versionName") payload := featurestoreentityversion.FeaturestoreEntityVersionResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := featurestoreentityversion.NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := featurestoreentityversion.NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := featurestoreentityversion.NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := featurestoreentityversion.NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := featurestoreentityversion.NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := featurestoreentityversion.NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName") // alternatively `client.List(ctx, id, featurestoreentityversion.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, featurestoreentityversion.DefaultListOperationOptions()) diff --git a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentity.go b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentity.go index e9f4b4942d3..e9e51c9f425 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentity.go +++ b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentity.go @@ -123,7 +123,7 @@ func (id FeatureStoreEntityId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFeatureStoreEntities", "featureStoreEntities", "featureStoreEntities"), - resourceids.UserSpecifiedSegment("featureStoreEntityName", "name"), + resourceids.UserSpecifiedSegment("featureStoreEntityName", "featureStoreEntityName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentity_test.go b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentity_test.go index cec0efa3d47..e7e27fcd80c 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentity_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentity_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FeatureStoreEntityId{} func TestNewFeatureStoreEntityID(t *testing.T) { - id := NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewFeatureStoreEntityID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FeatureStoreEntityName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureStoreEntityName'", id.FeatureStoreEntityName, "name") + if id.FeatureStoreEntityName != "featureStoreEntityName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureStoreEntityName'", id.FeatureStoreEntityName, "featureStoreEntityName") } } func TestFormatFeatureStoreEntityID(t *testing.T) { - actual := NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name" + actual := NewFeatureStoreEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseFeatureStoreEntityID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName", Expected: &FeatureStoreEntityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureStoreEntityName: "name", + FeatureStoreEntityName: "featureStoreEntityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseFeatureStoreEntityIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName", Expected: &FeatureStoreEntityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureStoreEntityName: "name", + FeatureStoreEntityName: "featureStoreEntityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/fEaTuReStOrEeNtItYnAmE", Expected: &FeatureStoreEntityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - FeatureStoreEntityName: "nAmE", + FeatureStoreEntityName: "fEaTuReStOrEeNtItYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/fEaTuReStOrEeNtItYnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentityversion.go b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentityversion.go index 31d56ee36fc..66adaecc8d4 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentityversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentityversion.go @@ -129,9 +129,9 @@ func (id FeatureStoreEntityVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFeatureStoreEntities", "featureStoreEntities", "featureStoreEntities"), - resourceids.UserSpecifiedSegment("featureStoreEntityName", "name"), + resourceids.UserSpecifiedSegment("featureStoreEntityName", "featureStoreEntityName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentityversion_test.go b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentityversion_test.go index 5dc5d90ebbe..34c73e777f8 100644 --- a/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentityversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/featurestoreentityversion/id_featurestoreentityversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FeatureStoreEntityVersionId{} func TestNewFeatureStoreEntityVersionID(t *testing.T) { - id := NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") + id := NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewFeatureStoreEntityVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FeatureStoreEntityName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureStoreEntityName'", id.FeatureStoreEntityName, "name") + if id.FeatureStoreEntityName != "featureStoreEntityName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureStoreEntityName'", id.FeatureStoreEntityName, "featureStoreEntityName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatFeatureStoreEntityVersionID(t *testing.T) { - actual := NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/versions/version" + actual := NewFeatureStoreEntityVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "featureStoreEntityName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseFeatureStoreEntityVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/versions/versionName", Expected: &FeatureStoreEntityVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureStoreEntityName: "name", - VersionName: "version", + FeatureStoreEntityName: "featureStoreEntityName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseFeatureStoreEntityVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/fEaTuReStOrEeNtItYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/fEaTuReStOrEeNtItYnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/versions/versionName", Expected: &FeatureStoreEntityVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FeatureStoreEntityName: "name", - VersionName: "version", + FeatureStoreEntityName: "featureStoreEntityName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/featureStoreEntities/featureStoreEntityName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/fEaTuReStOrEeNtItYnAmE/vErSiOnS/vErSiOnNaMe", Expected: &FeatureStoreEntityVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - FeatureStoreEntityName: "nAmE", - VersionName: "vErSiOn", + FeatureStoreEntityName: "fEaTuReStOrEeNtItYnAmE", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/fEaTuReStOrEeNtItIeS/fEaTuReStOrEeNtItYnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/job/README.md b/resource-manager/machinelearningservices/2024-04-01/job/README.md index 6220729fa07..7b10a56a576 100644 --- a/resource-manager/machinelearningservices/2024-04-01/job/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/job/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "id") +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "jobName") if err := client.CancelThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "id") +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "jobName") payload := job.JobBaseResource{ // ... @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "id") +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "jobName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -69,7 +69,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "id") +id := job.NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "jobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/job/id_job.go b/resource-manager/machinelearningservices/2024-04-01/job/id_job.go index 9754f2160ee..50d7fa227e1 100644 --- a/resource-manager/machinelearningservices/2024-04-01/job/id_job.go +++ b/resource-manager/machinelearningservices/2024-04-01/job/id_job.go @@ -123,7 +123,7 @@ func (id JobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticJobs", "jobs", "jobs"), - resourceids.UserSpecifiedSegment("jobName", "id"), + resourceids.UserSpecifiedSegment("jobName", "jobName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/job/id_job_test.go b/resource-manager/machinelearningservices/2024-04-01/job/id_job_test.go index 44976e57878..452ce4f41f5 100644 --- a/resource-manager/machinelearningservices/2024-04-01/job/id_job_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/job/id_job_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &JobId{} func TestNewJobID(t *testing.T) { - id := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "id") + id := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "jobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.JobName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "id") + if id.JobName != "jobName" { + t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } } func TestFormatJobID(t *testing.T) { - actual := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/id" + actual := NewJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "jobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/jobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/jobName", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - JobName: "id", + JobName: "jobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/jobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/jobName", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - JobName: "id", + JobName: "jobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/jobs/jobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/jObS/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/jObS/jObNaMe", Expected: &JobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - JobName: "iD", + JobName: "jObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/jObS/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/jObS/jObNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/machinelearningcomputes/model_databricksproperties.go b/resource-manager/machinelearningservices/2024-04-01/machinelearningcomputes/model_databricksproperties.go index 9a390a9c79c..20bf4a99606 100644 --- a/resource-manager/machinelearningservices/2024-04-01/machinelearningcomputes/model_databricksproperties.go +++ b/resource-manager/machinelearningservices/2024-04-01/machinelearningcomputes/model_databricksproperties.go @@ -5,5 +5,5 @@ package machinelearningcomputes type DatabricksProperties struct { DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` - WorkspaceUrl *string `json:"workspaceUrl,omitempty"` + WorkspaceURL *string `json:"workspaceUrl,omitempty"` } diff --git a/resource-manager/machinelearningservices/2024-04-01/managednetwork/README.md b/resource-manager/machinelearningservices/2024-04-01/managednetwork/README.md index da44ce50775..5c7c9360fe3 100644 --- a/resource-manager/machinelearningservices/2024-04-01/managednetwork/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/managednetwork/README.md @@ -41,7 +41,7 @@ if err := client.ProvisionsProvisionManagedNetworkThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := managednetwork.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName") +id := managednetwork.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "outboundRuleName") payload := managednetwork.OutboundRuleBasicResource{ // ... @@ -58,7 +58,7 @@ if err := client.SettingsRuleCreateOrUpdateThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := managednetwork.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName") +id := managednetwork.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "outboundRuleName") if err := client.SettingsRuleDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.SettingsRuleDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managednetwork.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName") +id := managednetwork.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "outboundRuleName") read, err := client.SettingsRuleGet(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/managednetwork/id_outboundrule.go b/resource-manager/machinelearningservices/2024-04-01/managednetwork/id_outboundrule.go index 658d97b95f4..16202df94be 100644 --- a/resource-manager/machinelearningservices/2024-04-01/managednetwork/id_outboundrule.go +++ b/resource-manager/machinelearningservices/2024-04-01/managednetwork/id_outboundrule.go @@ -123,7 +123,7 @@ func (id OutboundRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticOutboundRules", "outboundRules", "outboundRules"), - resourceids.UserSpecifiedSegment("outboundRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("outboundRuleName", "outboundRuleName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/managednetwork/id_outboundrule_test.go b/resource-manager/machinelearningservices/2024-04-01/managednetwork/id_outboundrule_test.go index 678f40a1779..6529777f0f1 100644 --- a/resource-manager/machinelearningservices/2024-04-01/managednetwork/id_outboundrule_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/managednetwork/id_outboundrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OutboundRuleId{} func TestNewOutboundRuleID(t *testing.T) { - id := NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName") + id := NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "outboundRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOutboundRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OutboundRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'OutboundRuleName'", id.OutboundRuleName, "ruleName") + if id.OutboundRuleName != "outboundRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'OutboundRuleName'", id.OutboundRuleName, "outboundRuleName") } } func TestFormatOutboundRuleID(t *testing.T) { - actual := NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/ruleName" + actual := NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "outboundRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/outboundRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOutboundRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/outboundRuleName", Expected: &OutboundRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OutboundRuleName: "ruleName", + OutboundRuleName: "outboundRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/outboundRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOutboundRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/outboundRuleName", Expected: &OutboundRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OutboundRuleName: "ruleName", + OutboundRuleName: "outboundRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/outboundRules/outboundRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oUtBoUnDrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oUtBoUnDrUlEs/oUtBoUnDrUlEnAmE", Expected: &OutboundRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OutboundRuleName: "rUlEnAmE", + OutboundRuleName: "oUtBoUnDrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oUtBoUnDrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oUtBoUnDrUlEs/oUtBoUnDrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/README.md b/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/README.md index aa18e277bfd..dcd4cb7c514 100644 --- a/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := marketplacesubscription.NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := marketplacesubscription.NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "marketplaceSubscriptionName") payload := marketplacesubscription.MarketplaceSubscriptionResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := marketplacesubscription.NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := marketplacesubscription.NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "marketplaceSubscriptionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := marketplacesubscription.NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := marketplacesubscription.NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "marketplaceSubscriptionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/id_marketplacesubscription.go b/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/id_marketplacesubscription.go index 33926ed9335..aec46394760 100644 --- a/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/id_marketplacesubscription.go +++ b/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/id_marketplacesubscription.go @@ -123,7 +123,7 @@ func (id MarketplaceSubscriptionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticMarketplaceSubscriptions", "marketplaceSubscriptions", "marketplaceSubscriptions"), - resourceids.UserSpecifiedSegment("marketplaceSubscriptionName", "name"), + resourceids.UserSpecifiedSegment("marketplaceSubscriptionName", "marketplaceSubscriptionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/id_marketplacesubscription_test.go b/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/id_marketplacesubscription_test.go index 2b75c8e86c0..edbe4ef916f 100644 --- a/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/id_marketplacesubscription_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/marketplacesubscription/id_marketplacesubscription_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MarketplaceSubscriptionId{} func TestNewMarketplaceSubscriptionID(t *testing.T) { - id := NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "marketplaceSubscriptionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewMarketplaceSubscriptionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.MarketplaceSubscriptionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'MarketplaceSubscriptionName'", id.MarketplaceSubscriptionName, "name") + if id.MarketplaceSubscriptionName != "marketplaceSubscriptionName" { + t.Fatalf("Expected %q but got %q for Segment 'MarketplaceSubscriptionName'", id.MarketplaceSubscriptionName, "marketplaceSubscriptionName") } } func TestFormatMarketplaceSubscriptionID(t *testing.T) { - actual := NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/name" + actual := NewMarketplaceSubscriptionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "marketplaceSubscriptionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/marketplaceSubscriptionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseMarketplaceSubscriptionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/marketplaceSubscriptionName", Expected: &MarketplaceSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - MarketplaceSubscriptionName: "name", + MarketplaceSubscriptionName: "marketplaceSubscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/marketplaceSubscriptionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseMarketplaceSubscriptionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/marketplaceSubscriptionName", Expected: &MarketplaceSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - MarketplaceSubscriptionName: "name", + MarketplaceSubscriptionName: "marketplaceSubscriptionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/marketplaceSubscriptions/marketplaceSubscriptionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mArKeTpLaCeSuBsCrIpTiOnS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mArKeTpLaCeSuBsCrIpTiOnS/mArKeTpLaCeSuBsCrIpTiOnNaMe", Expected: &MarketplaceSubscriptionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - MarketplaceSubscriptionName: "nAmE", + MarketplaceSubscriptionName: "mArKeTpLaCeSuBsCrIpTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mArKeTpLaCeSuBsCrIpTiOnS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mArKeTpLaCeSuBsCrIpTiOnS/mArKeTpLaCeSuBsCrIpTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/modelcontainer/README.md b/resource-manager/machinelearningservices/2024-04-01/modelcontainer/README.md index 468aae5b526..f4d89982948 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelcontainer/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/modelcontainer/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := modelcontainer.NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := modelcontainer.NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName") payload := modelcontainer.ModelContainerResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := modelcontainer.NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := modelcontainer.NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := modelcontainer.NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := modelcontainer.NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/modelcontainer/id_model.go b/resource-manager/machinelearningservices/2024-04-01/modelcontainer/id_model.go index abfcc35b678..02e2f9da703 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelcontainer/id_model.go +++ b/resource-manager/machinelearningservices/2024-04-01/modelcontainer/id_model.go @@ -123,7 +123,7 @@ func (id ModelId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticModels", "models", "models"), - resourceids.UserSpecifiedSegment("modelName", "name"), + resourceids.UserSpecifiedSegment("modelName", "modelName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/modelcontainer/id_model_test.go b/resource-manager/machinelearningservices/2024-04-01/modelcontainer/id_model_test.go index 0f66eeba246..017d0116d1a 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelcontainer/id_model_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/modelcontainer/id_model_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModelId{} func TestNewModelID(t *testing.T) { - id := NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewModelID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.ModelName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ModelName'", id.ModelName, "name") + if id.ModelName != "modelName" { + t.Fatalf("Expected %q but got %q for Segment 'ModelName'", id.ModelName, "modelName") } } func TestFormatModelID(t *testing.T) { - actual := NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name" + actual := NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseModelID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName", Expected: &ModelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ModelName: "name", + ModelName: "modelName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseModelIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName", Expected: &ModelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ModelName: "name", + ModelName: "modelName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/mOdElNaMe", Expected: &ModelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - ModelName: "nAmE", + ModelName: "mOdElNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/mOdElNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/modelversion/README.md b/resource-manager/machinelearningservices/2024-04-01/modelversion/README.md index 832a0db8f5a..c47e622520f 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelversion/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/modelversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := modelversion.NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := modelversion.NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName", "versionName") payload := modelversion.ModelVersionResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := modelversion.NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := modelversion.NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := modelversion.NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := modelversion.NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := modelversion.NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := modelversion.NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName") // alternatively `client.List(ctx, id, modelversion.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, modelversion.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := modelversion.NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") +id := modelversion.NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName", "versionName") payload := modelversion.DestinationAsset{ // ... @@ -111,7 +111,7 @@ if err := client.PublishThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := modelversion.NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "version") +id := modelversion.NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "versionName") payload := modelversion.PendingUploadRequestDto{ // ... @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := modelversion.NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "version") +id := modelversion.NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "versionName") payload := modelversion.ModelVersionResource{ // ... @@ -149,7 +149,7 @@ if err := client.RegistryModelVersionsCreateOrUpdateThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := modelversion.NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "version") +id := modelversion.NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "versionName") if err := client.RegistryModelVersionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -161,7 +161,7 @@ if err := client.RegistryModelVersionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := modelversion.NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "version") +id := modelversion.NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "versionName") read, err := client.RegistryModelVersionsGet(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_model.go b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_model.go index 01b0d8ec03a..80b17552f6f 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_model.go +++ b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_model.go @@ -123,7 +123,7 @@ func (id ModelId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticModels", "models", "models"), - resourceids.UserSpecifiedSegment("modelName", "name"), + resourceids.UserSpecifiedSegment("modelName", "modelName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_model_test.go b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_model_test.go index 3aa868aadd3..1c10ef24e95 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_model_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_model_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModelId{} func TestNewModelID(t *testing.T) { - id := NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewModelID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.ModelName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ModelName'", id.ModelName, "name") + if id.ModelName != "modelName" { + t.Fatalf("Expected %q but got %q for Segment 'ModelName'", id.ModelName, "modelName") } } func TestFormatModelID(t *testing.T) { - actual := NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name" + actual := NewModelID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseModelID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName", Expected: &ModelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ModelName: "name", + ModelName: "modelName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseModelIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName", Expected: &ModelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ModelName: "name", + ModelName: "modelName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/mOdElNaMe", Expected: &ModelId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - ModelName: "nAmE", + ModelName: "mOdElNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/mOdElNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_modelversion.go b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_modelversion.go index 00fd9de1150..a2539016486 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_modelversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_modelversion.go @@ -129,9 +129,9 @@ func (id ModelVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticModels", "models", "models"), - resourceids.UserSpecifiedSegment("modelName", "name"), + resourceids.UserSpecifiedSegment("modelName", "modelName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_modelversion_test.go b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_modelversion_test.go index 6b5a1b15172..ed52275cff8 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_modelversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_modelversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModelVersionId{} func TestNewModelVersionID(t *testing.T) { - id := NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version") + id := NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewModelVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.ModelName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ModelName'", id.ModelName, "name") + if id.ModelName != "modelName" { + t.Fatalf("Expected %q but got %q for Segment 'ModelName'", id.ModelName, "modelName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatModelVersionID(t *testing.T) { - actual := NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/versions/version" + actual := NewModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "modelName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseModelVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/versions/versionName", Expected: &ModelVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ModelName: "name", - VersionName: "version", + ModelName: "modelName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/versions/versionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseModelVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/mOdElNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/nAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/mOdElNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/versions/versionName", Expected: &ModelVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ModelName: "name", - VersionName: "version", + ModelName: "modelName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/name/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/models/modelName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/nAmE/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/mOdElNaMe/vErSiOnS/vErSiOnNaMe", Expected: &ModelVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - ModelName: "nAmE", - VersionName: "vErSiOn", + ModelName: "mOdElNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/nAmE/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/mOdElS/mOdElNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_registrymodelversion.go b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_registrymodelversion.go index c8d262b140c..44882f79336 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_registrymodelversion.go +++ b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_registrymodelversion.go @@ -131,7 +131,7 @@ func (id RegistryModelVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticModels", "models", "models"), resourceids.UserSpecifiedSegment("modelName", "modelName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_registrymodelversion_test.go b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_registrymodelversion_test.go index 6d23a5d3aa1..6cad867d5d9 100644 --- a/resource-manager/machinelearningservices/2024-04-01/modelversion/id_registrymodelversion_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/modelversion/id_registrymodelversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegistryModelVersionId{} func TestNewRegistryModelVersionID(t *testing.T) { - id := NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "version") + id := NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRegistryModelVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ModelName'", id.ModelName, "modelName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatRegistryModelVersionID(t *testing.T) { - actual := NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/version" + actual := NewRegistryModelVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryName", "modelName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseRegistryModelVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/versionName", Expected: &RegistryModelVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", ModelName: "modelName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/versionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseRegistryModelVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/versionName", Expected: &RegistryModelVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RegistryName: "registryName", ModelName: "modelName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/registries/registryName/models/modelName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/mOdElS/mOdElNaMe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/mOdElS/mOdElNaMe/vErSiOnS/vErSiOnNaMe", Expected: &RegistryModelVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RegistryName: "rEgIsTrYnAmE", ModelName: "mOdElNaMe", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/mOdElS/mOdElNaMe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/rEgIsTrIeS/rEgIsTrYnAmE/mOdElS/mOdElNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/README.md b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/README.md index 732793d6995..6e2b4bf2b41 100644 --- a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName", "deploymentName") payload := onlinedeployment.OnlineDeploymentTrackedResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName", "deploymentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName", "deploymentName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName", "deploymentName") payload := onlinedeployment.DeploymentLogsRequest{ // ... @@ -90,7 +90,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := onlinedeployment.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := onlinedeployment.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") // alternatively `client.List(ctx, id, onlinedeployment.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, onlinedeployment.DefaultListOperationOptions()) @@ -107,7 +107,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName", "deploymentName") // alternatively `client.ListSkus(ctx, id, onlinedeployment.DefaultListSkusOperationOptions())` can be used to do batched pagination items, err := client.ListSkusComplete(ctx, id, onlinedeployment.DefaultListSkusOperationOptions()) @@ -124,7 +124,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") +id := onlinedeployment.NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName", "deploymentName") payload := onlinedeployment.PartialMinimalTrackedResourceWithSku{ // ... diff --git a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpoint.go b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpoint.go index 256f1cabe9a..df56bd7d9ca 100644 --- a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpoint.go +++ b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpoint.go @@ -123,7 +123,7 @@ func (id OnlineEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticOnlineEndpoints", "onlineEndpoints", "onlineEndpoints"), - resourceids.UserSpecifiedSegment("onlineEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("onlineEndpointName", "onlineEndpointName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpoint_test.go b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpoint_test.go index bfd89b8d972..100042f00e0 100644 --- a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpoint_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OnlineEndpointId{} func TestNewOnlineEndpointID(t *testing.T) { - id := NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") + id := NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOnlineEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OnlineEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'OnlineEndpointName'", id.OnlineEndpointName, "endpointName") + if id.OnlineEndpointName != "onlineEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'OnlineEndpointName'", id.OnlineEndpointName, "onlineEndpointName") } } func TestFormatOnlineEndpointID(t *testing.T) { - actual := NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName" + actual := NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOnlineEndpointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName", Expected: &OnlineEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnlineEndpointName: "endpointName", + OnlineEndpointName: "onlineEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOnlineEndpointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName", Expected: &OnlineEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnlineEndpointName: "endpointName", + OnlineEndpointName: "onlineEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/oNlInEeNdPoInTnAmE", Expected: &OnlineEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OnlineEndpointName: "eNdPoInTnAmE", + OnlineEndpointName: "oNlInEeNdPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/eNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/oNlInEeNdPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpointdeployment.go b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpointdeployment.go index bd74459beb7..386acc10d5e 100644 --- a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpointdeployment.go +++ b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpointdeployment.go @@ -129,7 +129,7 @@ func (id OnlineEndpointDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticOnlineEndpoints", "onlineEndpoints", "onlineEndpoints"), - resourceids.UserSpecifiedSegment("onlineEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("onlineEndpointName", "onlineEndpointName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), resourceids.UserSpecifiedSegment("deploymentName", "deploymentName"), } diff --git a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpointdeployment_test.go b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpointdeployment_test.go index 1bd4d1b4a9b..e856ed49885 100644 --- a/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpointdeployment_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/onlinedeployment/id_onlineendpointdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OnlineEndpointDeploymentId{} func TestNewOnlineEndpointDeploymentID(t *testing.T) { - id := NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName") + id := NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewOnlineEndpointDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OnlineEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'OnlineEndpointName'", id.OnlineEndpointName, "endpointName") + if id.OnlineEndpointName != "onlineEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'OnlineEndpointName'", id.OnlineEndpointName, "onlineEndpointName") } if id.DeploymentName != "deploymentName" { @@ -36,8 +36,8 @@ func TestNewOnlineEndpointDeploymentID(t *testing.T) { } func TestFormatOnlineEndpointDeploymentID(t *testing.T) { - actual := NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/deployments/deploymentName" + actual := NewOnlineEndpointDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseOnlineEndpointDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/deployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/deployments/deploymentName", Expected: &OnlineEndpointDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnlineEndpointName: "endpointName", + OnlineEndpointName: "onlineEndpointName", DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/deployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/deployments/deploymentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseOnlineEndpointDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/oNlInEeNdPoInTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/eNdPoInTnAmE/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/oNlInEeNdPoInTnAmE/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/deployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/deployments/deploymentName", Expected: &OnlineEndpointDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnlineEndpointName: "endpointName", + OnlineEndpointName: "onlineEndpointName", DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/deployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/eNdPoInTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/oNlInEeNdPoInTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &OnlineEndpointDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OnlineEndpointName: "eNdPoInTnAmE", + OnlineEndpointName: "oNlInEeNdPoInTnAmE", DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/eNdPoInTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/oNlInEeNdPoInTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/README.md b/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/README.md index 3823074d7bb..11c9a47fffc 100644 --- a/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") payload := onlineendpoint.OnlineEndpointTrackedResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") read, err := client.GetToken(ctx, id) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -118,7 +118,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") payload := onlineendpoint.RegenerateEndpointKeysRequest{ // ... @@ -135,7 +135,7 @@ if err := client.RegenerateKeysThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") +id := onlineendpoint.NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") payload := onlineendpoint.PartialMinimalTrackedResourceWithIdentity{ // ... diff --git a/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/id_onlineendpoint.go b/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/id_onlineendpoint.go index 7480479c628..d8ee2313500 100644 --- a/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/id_onlineendpoint.go +++ b/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/id_onlineendpoint.go @@ -123,7 +123,7 @@ func (id OnlineEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticOnlineEndpoints", "onlineEndpoints", "onlineEndpoints"), - resourceids.UserSpecifiedSegment("onlineEndpointName", "endpointName"), + resourceids.UserSpecifiedSegment("onlineEndpointName", "onlineEndpointName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/id_onlineendpoint_test.go b/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/id_onlineendpoint_test.go index f440938d3ac..54092b9e77d 100644 --- a/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/id_onlineendpoint_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/onlineendpoint/id_onlineendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OnlineEndpointId{} func TestNewOnlineEndpointID(t *testing.T) { - id := NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName") + id := NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOnlineEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OnlineEndpointName != "endpointName" { - t.Fatalf("Expected %q but got %q for Segment 'OnlineEndpointName'", id.OnlineEndpointName, "endpointName") + if id.OnlineEndpointName != "onlineEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'OnlineEndpointName'", id.OnlineEndpointName, "onlineEndpointName") } } func TestFormatOnlineEndpointID(t *testing.T) { - actual := NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "endpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName" + actual := NewOnlineEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onlineEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOnlineEndpointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName", Expected: &OnlineEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnlineEndpointName: "endpointName", + OnlineEndpointName: "onlineEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOnlineEndpointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName", Expected: &OnlineEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnlineEndpointName: "endpointName", + OnlineEndpointName: "onlineEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/onlineEndpoints/onlineEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/oNlInEeNdPoInTnAmE", Expected: &OnlineEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OnlineEndpointName: "eNdPoInTnAmE", + OnlineEndpointName: "oNlInEeNdPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/eNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/oNlInEeNdPoInTs/oNlInEeNdPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/operationalizationclusters/model_databricksproperties.go b/resource-manager/machinelearningservices/2024-04-01/operationalizationclusters/model_databricksproperties.go index 73512cc453a..ebb94d4ce85 100644 --- a/resource-manager/machinelearningservices/2024-04-01/operationalizationclusters/model_databricksproperties.go +++ b/resource-manager/machinelearningservices/2024-04-01/operationalizationclusters/model_databricksproperties.go @@ -5,5 +5,5 @@ package operationalizationclusters type DatabricksProperties struct { DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` - WorkspaceUrl *string `json:"workspaceUrl,omitempty"` + WorkspaceURL *string `json:"workspaceUrl,omitempty"` } diff --git a/resource-manager/machinelearningservices/2024-04-01/quota/README.md b/resource-manager/machinelearningservices/2024-04-01/quota/README.md index 7fe8a0c6b1f..51f5298196e 100644 --- a/resource-manager/machinelearningservices/2024-04-01/quota/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/quota/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := quota.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := quota.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := quota.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := quota.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := quota.QuotaUpdateParameters{ // ... diff --git a/resource-manager/machinelearningservices/2024-04-01/quota/id_location.go b/resource-manager/machinelearningservices/2024-04-01/quota/id_location.go index 7d2a6e4a241..dc72f0e3fbd 100644 --- a/resource-manager/machinelearningservices/2024-04-01/quota/id_location.go +++ b/resource-manager/machinelearningservices/2024-04-01/quota/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMachineLearningServices", "Microsoft.MachineLearningServices", "Microsoft.MachineLearningServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/quota/id_location_test.go b/resource-manager/machinelearningservices/2024-04-01/quota/id_location_test.go index 5780f44fbc8..2103a9601c0 100644 --- a/resource-manager/machinelearningservices/2024-04-01/quota/id_location_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/quota/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/registrymanagement/model_registry.go b/resource-manager/machinelearningservices/2024-04-01/registrymanagement/model_registry.go index 53795dc21d9..1ab99c930bc 100644 --- a/resource-manager/machinelearningservices/2024-04-01/registrymanagement/model_registry.go +++ b/resource-manager/machinelearningservices/2024-04-01/registrymanagement/model_registry.go @@ -4,7 +4,7 @@ package registrymanagement // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Registry struct { - DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + DiscoveryURL *string `json:"discoveryUrl,omitempty"` IntellectualPropertyPublisher *string `json:"intellectualPropertyPublisher,omitempty"` ManagedResourceGroup *ArmResourceId `json:"managedResourceGroup,omitempty"` MlFlowRegistryUri *string `json:"mlFlowRegistryUri,omitempty"` diff --git a/resource-manager/machinelearningservices/2024-04-01/schedule/README.md b/resource-manager/machinelearningservices/2024-04-01/schedule/README.md index ee1ac6d1b14..6b7108c09ac 100644 --- a/resource-manager/machinelearningservices/2024-04-01/schedule/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/schedule/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "scheduleName") payload := schedule.ScheduleResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "scheduleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "scheduleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/schedule/id_schedule.go b/resource-manager/machinelearningservices/2024-04-01/schedule/id_schedule.go index c1c2b6f4015..51f5110b9d5 100644 --- a/resource-manager/machinelearningservices/2024-04-01/schedule/id_schedule.go +++ b/resource-manager/machinelearningservices/2024-04-01/schedule/id_schedule.go @@ -123,7 +123,7 @@ func (id ScheduleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticSchedules", "schedules", "schedules"), - resourceids.UserSpecifiedSegment("scheduleName", "name"), + resourceids.UserSpecifiedSegment("scheduleName", "scheduleName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/schedule/id_schedule_test.go b/resource-manager/machinelearningservices/2024-04-01/schedule/id_schedule_test.go index 8a4e42268d2..26f0dac2a3a 100644 --- a/resource-manager/machinelearningservices/2024-04-01/schedule/id_schedule_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/schedule/id_schedule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScheduleId{} func TestNewScheduleID(t *testing.T) { - id := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "scheduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewScheduleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.ScheduleName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "name") + if id.ScheduleName != "scheduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "scheduleName") } } func TestFormatScheduleID(t *testing.T) { - actual := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/name" + actual := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "scheduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/scheduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseScheduleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/scheduleName", Expected: &ScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/scheduleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseScheduleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/scheduleName", Expected: &ScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ScheduleName: "name", + ScheduleName: "scheduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/schedules/scheduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/sChEdUlEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/sChEdUlEs/sChEdUlEnAmE", Expected: &ScheduleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - ScheduleName: "nAmE", + ScheduleName: "sChEdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/sChEdUlEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/sChEdUlEs/sChEdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/README.md b/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/README.md index 3355452d17b..9c5e3f7e922 100644 --- a/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "serverlessEndpointName") payload := serverlessendpoint.ServerlessEndpointTrackedResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "serverlessEndpointName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "serverlessEndpointName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "serverlessEndpointName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -102,7 +102,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "serverlessEndpointName") payload := serverlessendpoint.RegenerateEndpointKeysRequest{ // ... @@ -119,7 +119,7 @@ if err := client.RegenerateKeysThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := serverlessendpoint.NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "serverlessEndpointName") payload := serverlessendpoint.PartialMinimalTrackedResourceWithSkuAndIdentity{ // ... diff --git a/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/id_serverlessendpoint.go b/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/id_serverlessendpoint.go index aeeec0a9699..4f875f4cddd 100644 --- a/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/id_serverlessendpoint.go +++ b/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/id_serverlessendpoint.go @@ -123,7 +123,7 @@ func (id ServerlessEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticServerlessEndpoints", "serverlessEndpoints", "serverlessEndpoints"), - resourceids.UserSpecifiedSegment("serverlessEndpointName", "name"), + resourceids.UserSpecifiedSegment("serverlessEndpointName", "serverlessEndpointName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/id_serverlessendpoint_test.go b/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/id_serverlessendpoint_test.go index ab4d3f07ede..c1f4a1e2e52 100644 --- a/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/id_serverlessendpoint_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/serverlessendpoint/id_serverlessendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerlessEndpointId{} func TestNewServerlessEndpointID(t *testing.T) { - id := NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "serverlessEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewServerlessEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.ServerlessEndpointName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerlessEndpointName'", id.ServerlessEndpointName, "name") + if id.ServerlessEndpointName != "serverlessEndpointName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerlessEndpointName'", id.ServerlessEndpointName, "serverlessEndpointName") } } func TestFormatServerlessEndpointID(t *testing.T) { - actual := NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/name" + actual := NewServerlessEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "serverlessEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/serverlessEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseServerlessEndpointID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/serverlessEndpointName", Expected: &ServerlessEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ServerlessEndpointName: "name", + ServerlessEndpointName: "serverlessEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/serverlessEndpointName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseServerlessEndpointIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/serverlessEndpointName", Expected: &ServerlessEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - ServerlessEndpointName: "name", + ServerlessEndpointName: "serverlessEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MachineLearningServices/workspaces/workspaceName/serverlessEndpoints/serverlessEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/sErVeRlEsSeNdPoInTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/sErVeRlEsSeNdPoInTs/sErVeRlEsSeNdPoInTnAmE", Expected: &ServerlessEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - ServerlessEndpointName: "nAmE", + ServerlessEndpointName: "sErVeRlEsSeNdPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/sErVeRlEsSeNdPoInTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/wOrKsPaCeS/wOrKsPaCeNaMe/sErVeRlEsSeNdPoInTs/sErVeRlEsSeNdPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/v2workspaceconnectionresource/model_workspaceconnectionoauth2.go b/resource-manager/machinelearningservices/2024-04-01/v2workspaceconnectionresource/model_workspaceconnectionoauth2.go index d593285d0c6..91542858e88 100644 --- a/resource-manager/machinelearningservices/2024-04-01/v2workspaceconnectionresource/model_workspaceconnectionoauth2.go +++ b/resource-manager/machinelearningservices/2024-04-01/v2workspaceconnectionresource/model_workspaceconnectionoauth2.go @@ -4,7 +4,7 @@ package v2workspaceconnectionresource // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WorkspaceConnectionOAuth2 struct { - AuthUrl *string `json:"authUrl,omitempty"` + AuthURL *string `json:"authUrl,omitempty"` ClientId *string `json:"clientId,omitempty"` ClientSecret *string `json:"clientSecret,omitempty"` DeveloperToken *string `json:"developerToken,omitempty"` diff --git a/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/README.md b/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/README.md index 9445500e4f3..5c4b7d79601 100644 --- a/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/README.md +++ b/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := virtualmachinesizes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/id_location.go b/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/id_location.go index 259cf90a1cd..b556359201a 100644 --- a/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/id_location.go +++ b/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMachineLearningServices", "Microsoft.MachineLearningServices", "Microsoft.MachineLearningServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/id_location_test.go b/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/id_location_test.go index df69ce751b6..1a82ed39871 100644 --- a/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/id_location_test.go +++ b/resource-manager/machinelearningservices/2024-04-01/virtualmachinesizes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MachineLearningServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAcHiNeLeArNiNgSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/machinelearningservices/2024-04-01/workspaces/model_workspaceproperties.go b/resource-manager/machinelearningservices/2024-04-01/workspaces/model_workspaceproperties.go index 1ea5f543d51..70a1204bf20 100644 --- a/resource-manager/machinelearningservices/2024-04-01/workspaces/model_workspaceproperties.go +++ b/resource-manager/machinelearningservices/2024-04-01/workspaces/model_workspaceproperties.go @@ -9,7 +9,7 @@ type WorkspaceProperties struct { AssociatedWorkspaces *[]string `json:"associatedWorkspaces,omitempty"` ContainerRegistry *string `json:"containerRegistry,omitempty"` Description *string `json:"description,omitempty"` - DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + DiscoveryURL *string `json:"discoveryUrl,omitempty"` EnableDataIsolation *bool `json:"enableDataIsolation,omitempty"` Encryption *EncryptionProperty `json:"encryption,omitempty"` FeatureStoreSettings *FeatureStoreSettings `json:"featureStoreSettings,omitempty"` diff --git a/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/README.md b/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/README.md index 744882bfb6b..fb1d89680d6 100644 --- a/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/README.md +++ b/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "maintenanceConfigurationName") payload := maintenanceconfigurations.MaintenanceConfiguration{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "maintenanceConfigurationName") read, err := client.Delete(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "maintenanceConfigurationName") read, err := client.Get(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "maintenanceConfigurationName") payload := maintenanceconfigurations.MaintenanceConfiguration{ // ... diff --git a/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/id_maintenanceconfiguration.go b/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/id_maintenanceconfiguration.go index 41abfe52ae6..73392c030c8 100644 --- a/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/id_maintenanceconfiguration.go +++ b/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/id_maintenanceconfiguration.go @@ -115,7 +115,7 @@ func (id MaintenanceConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMaintenance", "Microsoft.Maintenance", "Microsoft.Maintenance"), resourceids.StaticSegment("staticMaintenanceConfigurations", "maintenanceConfigurations", "maintenanceConfigurations"), - resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "resourceName"), + resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "maintenanceConfigurationName"), } } diff --git a/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go b/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go index 98485ec4e42..dcc872804a1 100644 --- a/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go +++ b/resource-manager/maintenance/2023-04-01/maintenanceconfigurations/id_maintenanceconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MaintenanceConfigurationId{} func TestNewMaintenanceConfigurationID(t *testing.T) { - id := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "maintenanceConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewMaintenanceConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MaintenanceConfigurationName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "resourceName") + if id.MaintenanceConfigurationName != "maintenanceConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "maintenanceConfigurationName") } } func TestFormatMaintenanceConfigurationID(t *testing.T) { - actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/resourceName" + actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "maintenanceConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseMaintenanceConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationName", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MaintenanceConfigurationName: "resourceName", + MaintenanceConfigurationName: "maintenanceConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseMaintenanceConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationName", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MaintenanceConfigurationName: "resourceName", + MaintenanceConfigurationName: "maintenanceConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/mAiNtEnAnCeCoNfIgUrAtIoNs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNnAmE", Expected: &MaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MaintenanceConfigurationName: "rEsOuRcEnAmE", + MaintenanceConfigurationName: "mAiNtEnAnCeCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/mAiNtEnAnCeCoNfIgUrAtIoNs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/README.md b/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/README.md index 6cb458043e5..89f9bbc1960 100644 --- a/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/README.md +++ b/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := publicmaintenanceconfigurations.NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "resourceName") +id := publicmaintenanceconfigurations.NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "publicMaintenanceConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration.go b/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration.go index 26a9943e0e4..e4da70d63e4 100644 --- a/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration.go +++ b/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration.go @@ -107,7 +107,7 @@ func (id PublicMaintenanceConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMaintenance", "Microsoft.Maintenance", "Microsoft.Maintenance"), resourceids.StaticSegment("staticPublicMaintenanceConfigurations", "publicMaintenanceConfigurations", "publicMaintenanceConfigurations"), - resourceids.UserSpecifiedSegment("publicMaintenanceConfigurationName", "resourceName"), + resourceids.UserSpecifiedSegment("publicMaintenanceConfigurationName", "publicMaintenanceConfigurationName"), } } diff --git a/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration_test.go b/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration_test.go index 1df0137d9c0..a39065a61da 100644 --- a/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration_test.go +++ b/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &PublicMaintenanceConfigurationId{} func TestNewPublicMaintenanceConfigurationID(t *testing.T) { - id := NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "resourceName") + id := NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "publicMaintenanceConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.PublicMaintenanceConfigurationName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'PublicMaintenanceConfigurationName'", id.PublicMaintenanceConfigurationName, "resourceName") + if id.PublicMaintenanceConfigurationName != "publicMaintenanceConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'PublicMaintenanceConfigurationName'", id.PublicMaintenanceConfigurationName, "publicMaintenanceConfigurationName") } } func TestFormatPublicMaintenanceConfigurationID(t *testing.T) { - actual := NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/resourceName" + actual := NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "publicMaintenanceConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParsePublicMaintenanceConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationName", Expected: &PublicMaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PublicMaintenanceConfigurationName: "resourceName", + PublicMaintenanceConfigurationName: "publicMaintenanceConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParsePublicMaintenanceConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationName", Expected: &PublicMaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PublicMaintenanceConfigurationName: "resourceName", + PublicMaintenanceConfigurationName: "publicMaintenanceConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNs/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNnAmE", Expected: &PublicMaintenanceConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PublicMaintenanceConfigurationName: "rEsOuRcEnAmE", + PublicMaintenanceConfigurationName: "pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNs/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/managedapplications/2019-07-01/applications/model_applicationpackagesupporturls.go b/resource-manager/managedapplications/2019-07-01/applications/model_applicationpackagesupporturls.go index 91a12da36f8..fbf8e41da43 100644 --- a/resource-manager/managedapplications/2019-07-01/applications/model_applicationpackagesupporturls.go +++ b/resource-manager/managedapplications/2019-07-01/applications/model_applicationpackagesupporturls.go @@ -3,7 +3,7 @@ package applications // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationPackageSupportUrls struct { +type ApplicationPackageSupportURLs struct { GovernmentCloud *string `json:"governmentCloud,omitempty"` PublicAzure *string `json:"publicAzure,omitempty"` } diff --git a/resource-manager/managedapplications/2019-07-01/applications/model_applicationproperties.go b/resource-manager/managedapplications/2019-07-01/applications/model_applicationproperties.go index be19835b7e4..6f6aa17bca2 100644 --- a/resource-manager/managedapplications/2019-07-01/applications/model_applicationproperties.go +++ b/resource-manager/managedapplications/2019-07-01/applications/model_applicationproperties.go @@ -17,6 +17,6 @@ type ApplicationProperties struct { Parameters *interface{} `json:"parameters,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublisherTenantId *string `json:"publisherTenantId,omitempty"` - SupportUrls *ApplicationPackageSupportUrls `json:"supportUrls,omitempty"` + SupportURLs *ApplicationPackageSupportURLs `json:"supportUrls,omitempty"` UpdatedBy *ApplicationClientDetails `json:"updatedBy,omitempty"` } diff --git a/resource-manager/managedapplications/2021-07-01/applications/model_applicationpackagesupporturls.go b/resource-manager/managedapplications/2021-07-01/applications/model_applicationpackagesupporturls.go index 91a12da36f8..fbf8e41da43 100644 --- a/resource-manager/managedapplications/2021-07-01/applications/model_applicationpackagesupporturls.go +++ b/resource-manager/managedapplications/2021-07-01/applications/model_applicationpackagesupporturls.go @@ -3,7 +3,7 @@ package applications // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationPackageSupportUrls struct { +type ApplicationPackageSupportURLs struct { GovernmentCloud *string `json:"governmentCloud,omitempty"` PublicAzure *string `json:"publicAzure,omitempty"` } diff --git a/resource-manager/managedapplications/2021-07-01/applications/model_applicationproperties.go b/resource-manager/managedapplications/2021-07-01/applications/model_applicationproperties.go index be19835b7e4..6f6aa17bca2 100644 --- a/resource-manager/managedapplications/2021-07-01/applications/model_applicationproperties.go +++ b/resource-manager/managedapplications/2021-07-01/applications/model_applicationproperties.go @@ -17,6 +17,6 @@ type ApplicationProperties struct { Parameters *interface{} `json:"parameters,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` PublisherTenantId *string `json:"publisherTenantId,omitempty"` - SupportUrls *ApplicationPackageSupportUrls `json:"supportUrls,omitempty"` + SupportURLs *ApplicationPackageSupportURLs `json:"supportUrls,omitempty"` UpdatedBy *ApplicationClientDetails `json:"updatedBy,omitempty"` } diff --git a/resource-manager/managedidentity/2023-01-31/managedidentities/README.md b/resource-manager/managedidentity/2023-01-31/managedidentities/README.md index 12995e21ae0..24ba744c282 100644 --- a/resource-manager/managedidentity/2023-01-31/managedidentities/README.md +++ b/resource-manager/managedidentity/2023-01-31/managedidentities/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedidentities.NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "federatedIdentityCredentialResourceName") +id := managedidentities.NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "userAssignedIdentityName", "federatedIdentityCredentialName") payload := managedidentities.FederatedIdentityCredential{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedidentities.NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "federatedIdentityCredentialResourceName") +id := managedidentities.NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "userAssignedIdentityName", "federatedIdentityCredentialName") read, err := client.FederatedIdentityCredentialsDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedidentities.NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "federatedIdentityCredentialResourceName") +id := managedidentities.NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "userAssignedIdentityName", "federatedIdentityCredentialName") read, err := client.FederatedIdentityCredentialsGet(ctx, id) if err != nil { diff --git a/resource-manager/managedidentity/2023-01-31/managedidentities/id_federatedidentitycredential.go b/resource-manager/managedidentity/2023-01-31/managedidentities/id_federatedidentitycredential.go index 54bd535f187..489ac28fed7 100644 --- a/resource-manager/managedidentity/2023-01-31/managedidentities/id_federatedidentitycredential.go +++ b/resource-manager/managedidentity/2023-01-31/managedidentities/id_federatedidentitycredential.go @@ -121,9 +121,9 @@ func (id FederatedIdentityCredentialId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftManagedIdentity", "Microsoft.ManagedIdentity", "Microsoft.ManagedIdentity"), resourceids.StaticSegment("staticUserAssignedIdentities", "userAssignedIdentities", "userAssignedIdentities"), - resourceids.UserSpecifiedSegment("userAssignedIdentityName", "resourceName"), + resourceids.UserSpecifiedSegment("userAssignedIdentityName", "userAssignedIdentityName"), resourceids.StaticSegment("staticFederatedIdentityCredentials", "federatedIdentityCredentials", "federatedIdentityCredentials"), - resourceids.UserSpecifiedSegment("federatedIdentityCredentialName", "federatedIdentityCredentialResourceName"), + resourceids.UserSpecifiedSegment("federatedIdentityCredentialName", "federatedIdentityCredentialName"), } } diff --git a/resource-manager/managedidentity/2023-01-31/managedidentities/id_federatedidentitycredential_test.go b/resource-manager/managedidentity/2023-01-31/managedidentities/id_federatedidentitycredential_test.go index b5792b151e5..c7f261afc83 100644 --- a/resource-manager/managedidentity/2023-01-31/managedidentities/id_federatedidentitycredential_test.go +++ b/resource-manager/managedidentity/2023-01-31/managedidentities/id_federatedidentitycredential_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FederatedIdentityCredentialId{} func TestNewFederatedIdentityCredentialID(t *testing.T) { - id := NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "federatedIdentityCredentialResourceName") + id := NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "userAssignedIdentityName", "federatedIdentityCredentialName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewFederatedIdentityCredentialID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.UserAssignedIdentityName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'UserAssignedIdentityName'", id.UserAssignedIdentityName, "resourceName") + if id.UserAssignedIdentityName != "userAssignedIdentityName" { + t.Fatalf("Expected %q but got %q for Segment 'UserAssignedIdentityName'", id.UserAssignedIdentityName, "userAssignedIdentityName") } - if id.FederatedIdentityCredentialName != "federatedIdentityCredentialResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'FederatedIdentityCredentialName'", id.FederatedIdentityCredentialName, "federatedIdentityCredentialResourceName") + if id.FederatedIdentityCredentialName != "federatedIdentityCredentialName" { + t.Fatalf("Expected %q but got %q for Segment 'FederatedIdentityCredentialName'", id.FederatedIdentityCredentialName, "federatedIdentityCredentialName") } } func TestFormatFederatedIdentityCredentialID(t *testing.T) { - actual := NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "federatedIdentityCredentialResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName/federatedIdentityCredentials/federatedIdentityCredentialResourceName" + actual := NewFederatedIdentityCredentialID("12345678-1234-9876-4563-123456789012", "example-resource-group", "userAssignedIdentityName", "federatedIdentityCredentialName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName/federatedIdentityCredentials/federatedIdentityCredentialName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFederatedIdentityCredentialID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName/federatedIdentityCredentials", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName/federatedIdentityCredentials", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName/federatedIdentityCredentials/federatedIdentityCredentialResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName/federatedIdentityCredentials/federatedIdentityCredentialName", Expected: &FederatedIdentityCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - UserAssignedIdentityName: "resourceName", - FederatedIdentityCredentialName: "federatedIdentityCredentialResourceName", + UserAssignedIdentityName: "userAssignedIdentityName", + FederatedIdentityCredentialName: "federatedIdentityCredentialName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName/federatedIdentityCredentials/federatedIdentityCredentialResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName/federatedIdentityCredentials/federatedIdentityCredentialName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFederatedIdentityCredentialIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAnAgEdIdEnTiTy/uSeRaSsIgNeDiDeNtItIeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAnAgEdIdEnTiTy/uSeRaSsIgNeDiDeNtItIeS/uSeRaSsIgNeDiDeNtItYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName/federatedIdentityCredentials", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName/federatedIdentityCredentials", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAnAgEdIdEnTiTy/uSeRaSsIgNeDiDeNtItIeS/rEsOuRcEnAmE/fEdErAtEdIdEnTiTyCrEdEnTiAlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAnAgEdIdEnTiTy/uSeRaSsIgNeDiDeNtItIeS/uSeRaSsIgNeDiDeNtItYnAmE/fEdErAtEdIdEnTiTyCrEdEnTiAlS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName/federatedIdentityCredentials/federatedIdentityCredentialResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName/federatedIdentityCredentials/federatedIdentityCredentialName", Expected: &FederatedIdentityCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - UserAssignedIdentityName: "resourceName", - FederatedIdentityCredentialName: "federatedIdentityCredentialResourceName", + UserAssignedIdentityName: "userAssignedIdentityName", + FederatedIdentityCredentialName: "federatedIdentityCredentialName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName/federatedIdentityCredentials/federatedIdentityCredentialResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName/federatedIdentityCredentials/federatedIdentityCredentialName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAnAgEdIdEnTiTy/uSeRaSsIgNeDiDeNtItIeS/rEsOuRcEnAmE/fEdErAtEdIdEnTiTyCrEdEnTiAlS/fEdErAtEdIdEnTiTyCrEdEnTiAlReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAnAgEdIdEnTiTy/uSeRaSsIgNeDiDeNtItIeS/uSeRaSsIgNeDiDeNtItYnAmE/fEdErAtEdIdEnTiTyCrEdEnTiAlS/fEdErAtEdIdEnTiTyCrEdEnTiAlNaMe", Expected: &FederatedIdentityCredentialId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - UserAssignedIdentityName: "rEsOuRcEnAmE", - FederatedIdentityCredentialName: "fEdErAtEdIdEnTiTyCrEdEnTiAlReSoUrCeNaMe", + UserAssignedIdentityName: "uSeRaSsIgNeDiDeNtItYnAmE", + FederatedIdentityCredentialName: "fEdErAtEdIdEnTiTyCrEdEnTiAlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAnAgEdIdEnTiTy/uSeRaSsIgNeDiDeNtItIeS/rEsOuRcEnAmE/fEdErAtEdIdEnTiTyCrEdEnTiAlS/fEdErAtEdIdEnTiTyCrEdEnTiAlReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAnAgEdIdEnTiTy/uSeRaSsIgNeDiDeNtItIeS/uSeRaSsIgNeDiDeNtItYnAmE/fEdErAtEdIdEnTiTyCrEdEnTiAlS/fEdErAtEdIdEnTiTyCrEdEnTiAlNaMe/extra", Error: true, }, } diff --git a/resource-manager/managedidentity/2023-01-31/managedidentities/model_systemassignedidentityproperties.go b/resource-manager/managedidentity/2023-01-31/managedidentities/model_systemassignedidentityproperties.go index ce9255da48b..b4dc874c1e4 100644 --- a/resource-manager/managedidentity/2023-01-31/managedidentities/model_systemassignedidentityproperties.go +++ b/resource-manager/managedidentity/2023-01-31/managedidentities/model_systemassignedidentityproperties.go @@ -5,7 +5,7 @@ package managedidentities type SystemAssignedIdentityProperties struct { ClientId *string `json:"clientId,omitempty"` - ClientSecretUrl *string `json:"clientSecretUrl,omitempty"` + ClientSecretURL *string `json:"clientSecretUrl,omitempty"` PrincipalId *string `json:"principalId,omitempty"` TenantId *string `json:"tenantId,omitempty"` } diff --git a/resource-manager/maps/2023-06-01/accounts/model_customermanagedkeyencryption.go b/resource-manager/maps/2023-06-01/accounts/model_customermanagedkeyencryption.go index 130140178d2..88fcb5dad2e 100644 --- a/resource-manager/maps/2023-06-01/accounts/model_customermanagedkeyencryption.go +++ b/resource-manager/maps/2023-06-01/accounts/model_customermanagedkeyencryption.go @@ -5,5 +5,5 @@ package accounts type CustomerManagedKeyEncryption struct { KeyEncryptionKeyIdentity *CustomerManagedKeyEncryptionKeyEncryptionKeyIdentity `json:"keyEncryptionKeyIdentity,omitempty"` - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/mariadb/2018-06-01/privatelinkresources/README.md b/resource-manager/mariadb/2018-06-01/privatelinkresources/README.md index b403b8bd502..ebeb06ba4df 100644 --- a/resource-manager/mariadb/2018-06-01/privatelinkresources/README.md +++ b/resource-manager/mariadb/2018-06-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/mariadb/2018-06-01/privatelinkresources/id_privatelinkresource.go b/resource-manager/mariadb/2018-06-01/privatelinkresources/id_privatelinkresource.go index 2c7ae529fee..da79132fb82 100644 --- a/resource-manager/mariadb/2018-06-01/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/mariadb/2018-06-01/privatelinkresources/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticServers", "servers", "servers"), resourceids.UserSpecifiedSegment("serverName", "serverName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/mariadb/2018-06-01/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/mariadb/2018-06-01/privatelinkresources/id_privatelinkresource_test.go index 361980e2c7d..be434519937 100644 --- a/resource-manager/mariadb/2018-06-01/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/mariadb/2018-06-01/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServerName'", id.ServerName, "serverName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMariaDB/servers/serverName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMaRiAdB/sErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMaRiAdB/sErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMaRiAdB/sErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMaRiAdB/sErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/hypervcluster/README.md b/resource-manager/migrate/2020-01-01/hypervcluster/README.md index 6a000e46968..97813a72121 100644 --- a/resource-manager/migrate/2020-01-01/hypervcluster/README.md +++ b/resource-manager/migrate/2020-01-01/hypervcluster/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervcluster.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervcluster.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllClustersInSite(ctx, id, hypervcluster.DefaultGetAllClustersInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllClustersInSiteComplete(ctx, id, hypervcluster.DefaultGetAllClustersInSiteOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := hypervcluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "clusterName") +id := hypervcluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "clusterName") read, err := client.GetCluster(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervcluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "clusterName") +id := hypervcluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "clusterName") payload := hypervcluster.HyperVCluster{ // ... diff --git a/resource-manager/migrate/2020-01-01/hypervcluster/id_cluster.go b/resource-manager/migrate/2020-01-01/hypervcluster/id_cluster.go index 5256febed28..24fb10b7ef2 100644 --- a/resource-manager/migrate/2020-01-01/hypervcluster/id_cluster.go +++ b/resource-manager/migrate/2020-01-01/hypervcluster/id_cluster.go @@ -121,7 +121,7 @@ func (id ClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), resourceids.StaticSegment("staticClusters", "clusters", "clusters"), resourceids.UserSpecifiedSegment("clusterName", "clusterName"), } diff --git a/resource-manager/migrate/2020-01-01/hypervcluster/id_cluster_test.go b/resource-manager/migrate/2020-01-01/hypervcluster/id_cluster_test.go index 332ad632101..50ed894fb99 100644 --- a/resource-manager/migrate/2020-01-01/hypervcluster/id_cluster_test.go +++ b/resource-manager/migrate/2020-01-01/hypervcluster/id_cluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ClusterId{} func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "clusterName") + id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "clusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } if id.ClusterName != "clusterName" { @@ -32,8 +32,8 @@ func TestNewClusterID(t *testing.T) { } func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName" + actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "clusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseClusterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName", Expected: &ClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", ClusterName: "clusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseClusterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/cLuStErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/cLuStErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName", Expected: &ClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", ClusterName: "clusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/cLuStErS/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/cLuStErS/cLuStErNaMe", Expected: &ClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", ClusterName: "cLuStErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/cLuStErS/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/cLuStErS/cLuStErNaMe/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/hypervcluster/id_hypervsite.go b/resource-manager/migrate/2020-01-01/hypervcluster/id_hypervsite.go index cd12ce7dc83..5dc2ffcebc9 100644 --- a/resource-manager/migrate/2020-01-01/hypervcluster/id_hypervsite.go +++ b/resource-manager/migrate/2020-01-01/hypervcluster/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/hypervcluster/id_hypervsite_test.go b/resource-manager/migrate/2020-01-01/hypervcluster/id_hypervsite_test.go index 5bf30c65cac..cb84d960686 100644 --- a/resource-manager/migrate/2020-01-01/hypervcluster/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-01-01/hypervcluster/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/hypervhost/README.md b/resource-manager/migrate/2020-01-01/hypervhost/README.md index 2fc8cc80a74..780befbdbb2 100644 --- a/resource-manager/migrate/2020-01-01/hypervhost/README.md +++ b/resource-manager/migrate/2020-01-01/hypervhost/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervhost.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervhost.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllHostsInSite(ctx, id, hypervhost.DefaultGetAllHostsInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllHostsInSiteComplete(ctx, id, hypervhost.DefaultGetAllHostsInSiteOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := hypervhost.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostName") +id := hypervhost.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "hostName") read, err := client.GetHost(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervhost.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostName") +id := hypervhost.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "hostName") payload := hypervhost.HyperVHost{ // ... diff --git a/resource-manager/migrate/2020-01-01/hypervhost/id_host.go b/resource-manager/migrate/2020-01-01/hypervhost/id_host.go index c6e8fc77b8f..8cf5f5ff70a 100644 --- a/resource-manager/migrate/2020-01-01/hypervhost/id_host.go +++ b/resource-manager/migrate/2020-01-01/hypervhost/id_host.go @@ -121,7 +121,7 @@ func (id HostId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), resourceids.StaticSegment("staticHosts", "hosts", "hosts"), resourceids.UserSpecifiedSegment("hostName", "hostName"), } diff --git a/resource-manager/migrate/2020-01-01/hypervhost/id_host_test.go b/resource-manager/migrate/2020-01-01/hypervhost/id_host_test.go index d4df75d2b89..bb6b856d2d6 100644 --- a/resource-manager/migrate/2020-01-01/hypervhost/id_host_test.go +++ b/resource-manager/migrate/2020-01-01/hypervhost/id_host_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostId{} func TestNewHostID(t *testing.T) { - id := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostName") + id := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "hostName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHostID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } if id.HostName != "hostName" { @@ -32,8 +32,8 @@ func TestNewHostID(t *testing.T) { } func TestFormatHostID(t *testing.T) { - actual := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName" + actual := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "hostName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName", Expected: &HostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", HostName: "hostName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/hOsTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/hOsTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName", Expected: &HostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", HostName: "hostName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/hOsTs/hOsTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/hOsTs/hOsTnAmE", Expected: &HostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", HostName: "hOsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/hOsTs/hOsTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/hOsTs/hOsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/hypervhost/id_hypervsite.go b/resource-manager/migrate/2020-01-01/hypervhost/id_hypervsite.go index 1c0838b8b80..d28ced9af7d 100644 --- a/resource-manager/migrate/2020-01-01/hypervhost/id_hypervsite.go +++ b/resource-manager/migrate/2020-01-01/hypervhost/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/hypervhost/id_hypervsite_test.go b/resource-manager/migrate/2020-01-01/hypervhost/id_hypervsite_test.go index 98f2f83be6b..5c23d3435d0 100644 --- a/resource-manager/migrate/2020-01-01/hypervhost/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-01-01/hypervhost/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/hypervjobs/README.md b/resource-manager/migrate/2020-01-01/hypervjobs/README.md index baefccd1566..551e8e786e5 100644 --- a/resource-manager/migrate/2020-01-01/hypervjobs/README.md +++ b/resource-manager/migrate/2020-01-01/hypervjobs/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervjobs.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervjobs.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllJobsInSite(ctx, id)` can be used to do batched pagination items, err := client.GetAllJobsInSiteComplete(ctx, id) diff --git a/resource-manager/migrate/2020-01-01/hypervjobs/id_hypervsite.go b/resource-manager/migrate/2020-01-01/hypervjobs/id_hypervsite.go index 9701b6a06f8..28f787329d0 100644 --- a/resource-manager/migrate/2020-01-01/hypervjobs/id_hypervsite.go +++ b/resource-manager/migrate/2020-01-01/hypervjobs/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/hypervjobs/id_hypervsite_test.go b/resource-manager/migrate/2020-01-01/hypervjobs/id_hypervsite_test.go index 677b63f1e11..991b55e6889 100644 --- a/resource-manager/migrate/2020-01-01/hypervjobs/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-01-01/hypervjobs/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/hypervmachines/README.md b/resource-manager/migrate/2020-01-01/hypervmachines/README.md index 51c1f62d58a..fb1f34c17e1 100644 --- a/resource-manager/migrate/2020-01-01/hypervmachines/README.md +++ b/resource-manager/migrate/2020-01-01/hypervmachines/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervmachines.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervmachines.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllMachinesInSite(ctx, id, hypervmachines.DefaultGetAllMachinesInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllMachinesInSiteComplete(ctx, id, hypervmachines.DefaultGetAllMachinesInSiteOperationOptions()) diff --git a/resource-manager/migrate/2020-01-01/hypervmachines/id_hypervsite.go b/resource-manager/migrate/2020-01-01/hypervmachines/id_hypervsite.go index ff00ac06d3d..4998d3c3334 100644 --- a/resource-manager/migrate/2020-01-01/hypervmachines/id_hypervsite.go +++ b/resource-manager/migrate/2020-01-01/hypervmachines/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/hypervmachines/id_hypervsite_test.go b/resource-manager/migrate/2020-01-01/hypervmachines/id_hypervsite_test.go index 33f0a759c9d..d73fe94735d 100644 --- a/resource-manager/migrate/2020-01-01/hypervmachines/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-01-01/hypervmachines/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/hypervrunasaccounts/README.md b/resource-manager/migrate/2020-01-01/hypervrunasaccounts/README.md index 7056401ac1a..a09e3bc4e0e 100644 --- a/resource-manager/migrate/2020-01-01/hypervrunasaccounts/README.md +++ b/resource-manager/migrate/2020-01-01/hypervrunasaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervrunasaccounts.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervrunasaccounts.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllRunAsAccountsInSite(ctx, id)` can be used to do batched pagination items, err := client.GetAllRunAsAccountsInSiteComplete(ctx, id) diff --git a/resource-manager/migrate/2020-01-01/hypervrunasaccounts/id_hypervsite.go b/resource-manager/migrate/2020-01-01/hypervrunasaccounts/id_hypervsite.go index 23775eeaf5d..49d71bdad83 100644 --- a/resource-manager/migrate/2020-01-01/hypervrunasaccounts/id_hypervsite.go +++ b/resource-manager/migrate/2020-01-01/hypervrunasaccounts/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/hypervrunasaccounts/id_hypervsite_test.go b/resource-manager/migrate/2020-01-01/hypervrunasaccounts/id_hypervsite_test.go index 123d8631387..bfcff37a581 100644 --- a/resource-manager/migrate/2020-01-01/hypervrunasaccounts/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-01-01/hypervrunasaccounts/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/hypervsites/README.md b/resource-manager/migrate/2020-01-01/hypervsites/README.md index 83a6edaa1c8..6ab442258e9 100644 --- a/resource-manager/migrate/2020-01-01/hypervsites/README.md +++ b/resource-manager/migrate/2020-01-01/hypervsites/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") read, err := client.DeleteSite(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") read, err := client.GetSite(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetSiteHealthSummary(ctx, id)` can be used to do batched pagination items, err := client.GetSiteHealthSummaryComplete(ctx, id) @@ -73,7 +73,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") read, err := client.GetSiteUsage(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") payload := hypervsites.HyperVSite{ // ... @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") payload := hypervsites.HyperVSite{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") read, err := client.RefreshSite(ctx, id) if err != nil { diff --git a/resource-manager/migrate/2020-01-01/hypervsites/id_hypervsite.go b/resource-manager/migrate/2020-01-01/hypervsites/id_hypervsite.go index a5d94db5c27..6e108346ef5 100644 --- a/resource-manager/migrate/2020-01-01/hypervsites/id_hypervsite.go +++ b/resource-manager/migrate/2020-01-01/hypervsites/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/hypervsites/id_hypervsite_test.go b/resource-manager/migrate/2020-01-01/hypervsites/id_hypervsite_test.go index 900c5405ba3..316b70072da 100644 --- a/resource-manager/migrate/2020-01-01/hypervsites/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-01-01/hypervsites/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/jobs/README.md b/resource-manager/migrate/2020-01-01/jobs/README.md index a5bdb5f0f53..defa23c34e2 100644 --- a/resource-manager/migrate/2020-01-01/jobs/README.md +++ b/resource-manager/migrate/2020-01-01/jobs/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobs.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := jobs.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetAllJobsInSite(ctx, id)` can be used to do batched pagination items, err := client.GetAllJobsInSiteComplete(ctx, id) diff --git a/resource-manager/migrate/2020-01-01/jobs/id_vmwaresite.go b/resource-manager/migrate/2020-01-01/jobs/id_vmwaresite.go index fd0575f5fa0..690a0b2ef8a 100644 --- a/resource-manager/migrate/2020-01-01/jobs/id_vmwaresite.go +++ b/resource-manager/migrate/2020-01-01/jobs/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/jobs/id_vmwaresite_test.go b/resource-manager/migrate/2020-01-01/jobs/id_vmwaresite_test.go index a79bee662a5..0556a3908c6 100644 --- a/resource-manager/migrate/2020-01-01/jobs/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-01-01/jobs/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/machines/README.md b/resource-manager/migrate/2020-01-01/machines/README.md index f2a55d5ae70..2c158bd0088 100644 --- a/resource-manager/migrate/2020-01-01/machines/README.md +++ b/resource-manager/migrate/2020-01-01/machines/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := machines.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := machines.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetAllMachinesInSite(ctx, id, machines.DefaultGetAllMachinesInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllMachinesInSiteComplete(ctx, id, machines.DefaultGetAllMachinesInSiteOperationOptions()) diff --git a/resource-manager/migrate/2020-01-01/machines/id_vmwaresite.go b/resource-manager/migrate/2020-01-01/machines/id_vmwaresite.go index b131d3565b6..56030e3431a 100644 --- a/resource-manager/migrate/2020-01-01/machines/id_vmwaresite.go +++ b/resource-manager/migrate/2020-01-01/machines/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/machines/id_vmwaresite_test.go b/resource-manager/migrate/2020-01-01/machines/id_vmwaresite_test.go index 772d5d5c385..4890e719f40 100644 --- a/resource-manager/migrate/2020-01-01/machines/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-01-01/machines/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/runasaccounts/README.md b/resource-manager/migrate/2020-01-01/runasaccounts/README.md index 65ee7ae50c9..338fce1c8f8 100644 --- a/resource-manager/migrate/2020-01-01/runasaccounts/README.md +++ b/resource-manager/migrate/2020-01-01/runasaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := runasaccounts.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := runasaccounts.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetAllRunAsAccountsInSite(ctx, id)` can be used to do batched pagination items, err := client.GetAllRunAsAccountsInSiteComplete(ctx, id) diff --git a/resource-manager/migrate/2020-01-01/runasaccounts/id_vmwaresite.go b/resource-manager/migrate/2020-01-01/runasaccounts/id_vmwaresite.go index 0a5d3977b1d..163dc6ce40e 100644 --- a/resource-manager/migrate/2020-01-01/runasaccounts/id_vmwaresite.go +++ b/resource-manager/migrate/2020-01-01/runasaccounts/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/runasaccounts/id_vmwaresite_test.go b/resource-manager/migrate/2020-01-01/runasaccounts/id_vmwaresite_test.go index fd815bdc2ab..b3e2ac25d63 100644 --- a/resource-manager/migrate/2020-01-01/runasaccounts/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-01-01/runasaccounts/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/sites/README.md b/resource-manager/migrate/2020-01-01/sites/README.md index 55ef7244eae..1c647a7b2f6 100644 --- a/resource-manager/migrate/2020-01-01/sites/README.md +++ b/resource-manager/migrate/2020-01-01/sites/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") read, err := client.DeleteSite(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") read, err := client.GetSite(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetSiteHealthSummary(ctx, id)` can be used to do batched pagination items, err := client.GetSiteHealthSummaryComplete(ctx, id) @@ -73,7 +73,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") read, err := client.GetSiteUsage(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") payload := sites.VMwareSite{ // ... @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") payload := sites.VMwareSite{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") read, err := client.RefreshSite(ctx, id) if err != nil { diff --git a/resource-manager/migrate/2020-01-01/sites/id_vmwaresite.go b/resource-manager/migrate/2020-01-01/sites/id_vmwaresite.go index fddc73763a3..31c6ae894d7 100644 --- a/resource-manager/migrate/2020-01-01/sites/id_vmwaresite.go +++ b/resource-manager/migrate/2020-01-01/sites/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/sites/id_vmwaresite_test.go b/resource-manager/migrate/2020-01-01/sites/id_vmwaresite_test.go index 405fbbbdca5..ab9d7f1b3ec 100644 --- a/resource-manager/migrate/2020-01-01/sites/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-01-01/sites/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/vcenter/README.md b/resource-manager/migrate/2020-01-01/vcenter/README.md index 22778499c67..45e207783bb 100644 --- a/resource-manager/migrate/2020-01-01/vcenter/README.md +++ b/resource-manager/migrate/2020-01-01/vcenter/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName") +id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName") read, err := client.DeleteVCenter(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vcenter.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := vcenter.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetAllVCentersInSite(ctx, id, vcenter.DefaultGetAllVCentersInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllVCentersInSiteComplete(ctx, id, vcenter.DefaultGetAllVCentersInSiteOperationOptions()) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName") +id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName") read, err := client.GetVCenter(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName") +id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName") payload := vcenter.VCenter{ // ... diff --git a/resource-manager/migrate/2020-01-01/vcenter/id_vcenter.go b/resource-manager/migrate/2020-01-01/vcenter/id_vcenter.go index 16b8d511e4d..abb17ccf7ad 100644 --- a/resource-manager/migrate/2020-01-01/vcenter/id_vcenter.go +++ b/resource-manager/migrate/2020-01-01/vcenter/id_vcenter.go @@ -121,9 +121,9 @@ func (id VCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), } } diff --git a/resource-manager/migrate/2020-01-01/vcenter/id_vcenter_test.go b/resource-manager/migrate/2020-01-01/vcenter/id_vcenter_test.go index b44fbf09a5d..0dfcf42e114 100644 --- a/resource-manager/migrate/2020-01-01/vcenter/id_vcenter_test.go +++ b/resource-manager/migrate/2020-01-01/vcenter/id_vcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VCenterId{} func TestNewVCenterID(t *testing.T) { - id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName") + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewVCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } } func TestFormatVCenterID(t *testing.T) { - actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName" + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", - VCenterName: "vcenterName", + VmwareSiteName: "vmwareSiteName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/vCeNtErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/vCeNtErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", - VCenterName: "vcenterName", + VmwareSiteName: "vmwareSiteName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/vCeNtErS/vCeNtErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/vCeNtErS/vCeNtErNaMe", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", VCenterName: "vCeNtErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/vCeNtErS/vCeNtErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/vCeNtErS/vCeNtErNaMe/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-01-01/vcenter/id_vmwaresite.go b/resource-manager/migrate/2020-01-01/vcenter/id_vmwaresite.go index 2bef8739b92..fe65e2dcaf9 100644 --- a/resource-manager/migrate/2020-01-01/vcenter/id_vmwaresite.go +++ b/resource-manager/migrate/2020-01-01/vcenter/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-01-01/vcenter/id_vmwaresite_test.go b/resource-manager/migrate/2020-01-01/vcenter/id_vmwaresite_test.go index bebb43e110d..ad90eb96c9b 100644 --- a/resource-manager/migrate/2020-01-01/vcenter/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-01-01/vcenter/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/hypervcluster/README.md b/resource-manager/migrate/2020-07-07/hypervcluster/README.md index 41ff9ac1d9d..83e54f33d55 100644 --- a/resource-manager/migrate/2020-07-07/hypervcluster/README.md +++ b/resource-manager/migrate/2020-07-07/hypervcluster/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervcluster.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervcluster.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllClustersInSite(ctx, id, hypervcluster.DefaultGetAllClustersInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllClustersInSiteComplete(ctx, id, hypervcluster.DefaultGetAllClustersInSiteOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := hypervcluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "clusterName") +id := hypervcluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "clusterName") read, err := client.GetCluster(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervcluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "clusterName") +id := hypervcluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "clusterName") payload := hypervcluster.HyperVCluster{ // ... diff --git a/resource-manager/migrate/2020-07-07/hypervcluster/id_cluster.go b/resource-manager/migrate/2020-07-07/hypervcluster/id_cluster.go index 5256febed28..24fb10b7ef2 100644 --- a/resource-manager/migrate/2020-07-07/hypervcluster/id_cluster.go +++ b/resource-manager/migrate/2020-07-07/hypervcluster/id_cluster.go @@ -121,7 +121,7 @@ func (id ClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), resourceids.StaticSegment("staticClusters", "clusters", "clusters"), resourceids.UserSpecifiedSegment("clusterName", "clusterName"), } diff --git a/resource-manager/migrate/2020-07-07/hypervcluster/id_cluster_test.go b/resource-manager/migrate/2020-07-07/hypervcluster/id_cluster_test.go index 332ad632101..50ed894fb99 100644 --- a/resource-manager/migrate/2020-07-07/hypervcluster/id_cluster_test.go +++ b/resource-manager/migrate/2020-07-07/hypervcluster/id_cluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ClusterId{} func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "clusterName") + id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "clusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } if id.ClusterName != "clusterName" { @@ -32,8 +32,8 @@ func TestNewClusterID(t *testing.T) { } func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName" + actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "clusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseClusterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName", Expected: &ClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", ClusterName: "clusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseClusterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/cLuStErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/cLuStErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName", Expected: &ClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", ClusterName: "clusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/clusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/clusters/clusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/cLuStErS/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/cLuStErS/cLuStErNaMe", Expected: &ClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", ClusterName: "cLuStErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/cLuStErS/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/cLuStErS/cLuStErNaMe/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/hypervcluster/id_hypervsite.go b/resource-manager/migrate/2020-07-07/hypervcluster/id_hypervsite.go index cd12ce7dc83..5dc2ffcebc9 100644 --- a/resource-manager/migrate/2020-07-07/hypervcluster/id_hypervsite.go +++ b/resource-manager/migrate/2020-07-07/hypervcluster/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/hypervcluster/id_hypervsite_test.go b/resource-manager/migrate/2020-07-07/hypervcluster/id_hypervsite_test.go index 5bf30c65cac..cb84d960686 100644 --- a/resource-manager/migrate/2020-07-07/hypervcluster/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-07-07/hypervcluster/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/hypervhost/README.md b/resource-manager/migrate/2020-07-07/hypervhost/README.md index 0481ddb3529..a4da840b08e 100644 --- a/resource-manager/migrate/2020-07-07/hypervhost/README.md +++ b/resource-manager/migrate/2020-07-07/hypervhost/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervhost.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervhost.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllHostsInSite(ctx, id, hypervhost.DefaultGetAllHostsInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllHostsInSiteComplete(ctx, id, hypervhost.DefaultGetAllHostsInSiteOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := hypervhost.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostName") +id := hypervhost.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "hostName") read, err := client.GetHost(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervhost.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostName") +id := hypervhost.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "hostName") payload := hypervhost.HyperVHost{ // ... diff --git a/resource-manager/migrate/2020-07-07/hypervhost/id_host.go b/resource-manager/migrate/2020-07-07/hypervhost/id_host.go index c6e8fc77b8f..8cf5f5ff70a 100644 --- a/resource-manager/migrate/2020-07-07/hypervhost/id_host.go +++ b/resource-manager/migrate/2020-07-07/hypervhost/id_host.go @@ -121,7 +121,7 @@ func (id HostId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), resourceids.StaticSegment("staticHosts", "hosts", "hosts"), resourceids.UserSpecifiedSegment("hostName", "hostName"), } diff --git a/resource-manager/migrate/2020-07-07/hypervhost/id_host_test.go b/resource-manager/migrate/2020-07-07/hypervhost/id_host_test.go index d4df75d2b89..bb6b856d2d6 100644 --- a/resource-manager/migrate/2020-07-07/hypervhost/id_host_test.go +++ b/resource-manager/migrate/2020-07-07/hypervhost/id_host_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostId{} func TestNewHostID(t *testing.T) { - id := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostName") + id := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "hostName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHostID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } if id.HostName != "hostName" { @@ -32,8 +32,8 @@ func TestNewHostID(t *testing.T) { } func TestFormatHostID(t *testing.T) { - actual := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName" + actual := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName", "hostName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName", Expected: &HostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", HostName: "hostName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/hOsTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/hOsTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName", Expected: &HostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", HostName: "hostName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/hosts/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/hosts/hostName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/hOsTs/hOsTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/hOsTs/hOsTnAmE", Expected: &HostId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", HostName: "hOsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/hOsTs/hOsTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/hOsTs/hOsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/hypervhost/id_hypervsite.go b/resource-manager/migrate/2020-07-07/hypervhost/id_hypervsite.go index 1c0838b8b80..d28ced9af7d 100644 --- a/resource-manager/migrate/2020-07-07/hypervhost/id_hypervsite.go +++ b/resource-manager/migrate/2020-07-07/hypervhost/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/hypervhost/id_hypervsite_test.go b/resource-manager/migrate/2020-07-07/hypervhost/id_hypervsite_test.go index 98f2f83be6b..5c23d3435d0 100644 --- a/resource-manager/migrate/2020-07-07/hypervhost/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-07-07/hypervhost/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/hypervjobs/README.md b/resource-manager/migrate/2020-07-07/hypervjobs/README.md index aa7f9b408a4..a6182a394ac 100644 --- a/resource-manager/migrate/2020-07-07/hypervjobs/README.md +++ b/resource-manager/migrate/2020-07-07/hypervjobs/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervjobs.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervjobs.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllJobsInSite(ctx, id)` can be used to do batched pagination items, err := client.GetAllJobsInSiteComplete(ctx, id) diff --git a/resource-manager/migrate/2020-07-07/hypervjobs/id_hypervsite.go b/resource-manager/migrate/2020-07-07/hypervjobs/id_hypervsite.go index 9701b6a06f8..28f787329d0 100644 --- a/resource-manager/migrate/2020-07-07/hypervjobs/id_hypervsite.go +++ b/resource-manager/migrate/2020-07-07/hypervjobs/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/hypervjobs/id_hypervsite_test.go b/resource-manager/migrate/2020-07-07/hypervjobs/id_hypervsite_test.go index 677b63f1e11..991b55e6889 100644 --- a/resource-manager/migrate/2020-07-07/hypervjobs/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-07-07/hypervjobs/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/hypervmachines/README.md b/resource-manager/migrate/2020-07-07/hypervmachines/README.md index 6b49655c763..96905397fc3 100644 --- a/resource-manager/migrate/2020-07-07/hypervmachines/README.md +++ b/resource-manager/migrate/2020-07-07/hypervmachines/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervmachines.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervmachines.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllMachinesInSite(ctx, id, hypervmachines.DefaultGetAllMachinesInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllMachinesInSiteComplete(ctx, id, hypervmachines.DefaultGetAllMachinesInSiteOperationOptions()) diff --git a/resource-manager/migrate/2020-07-07/hypervmachines/id_hypervsite.go b/resource-manager/migrate/2020-07-07/hypervmachines/id_hypervsite.go index ff00ac06d3d..4998d3c3334 100644 --- a/resource-manager/migrate/2020-07-07/hypervmachines/id_hypervsite.go +++ b/resource-manager/migrate/2020-07-07/hypervmachines/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/hypervmachines/id_hypervsite_test.go b/resource-manager/migrate/2020-07-07/hypervmachines/id_hypervsite_test.go index 33f0a759c9d..d73fe94735d 100644 --- a/resource-manager/migrate/2020-07-07/hypervmachines/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-07-07/hypervmachines/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/hypervrunasaccounts/README.md b/resource-manager/migrate/2020-07-07/hypervrunasaccounts/README.md index 9a5689f0990..c2250109e0b 100644 --- a/resource-manager/migrate/2020-07-07/hypervrunasaccounts/README.md +++ b/resource-manager/migrate/2020-07-07/hypervrunasaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervrunasaccounts.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervrunasaccounts.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetAllRunAsAccountsInSite(ctx, id)` can be used to do batched pagination items, err := client.GetAllRunAsAccountsInSiteComplete(ctx, id) diff --git a/resource-manager/migrate/2020-07-07/hypervrunasaccounts/id_hypervsite.go b/resource-manager/migrate/2020-07-07/hypervrunasaccounts/id_hypervsite.go index 23775eeaf5d..49d71bdad83 100644 --- a/resource-manager/migrate/2020-07-07/hypervrunasaccounts/id_hypervsite.go +++ b/resource-manager/migrate/2020-07-07/hypervrunasaccounts/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/hypervrunasaccounts/id_hypervsite_test.go b/resource-manager/migrate/2020-07-07/hypervrunasaccounts/id_hypervsite_test.go index 123d8631387..bfcff37a581 100644 --- a/resource-manager/migrate/2020-07-07/hypervrunasaccounts/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-07-07/hypervrunasaccounts/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/hypervsites/README.md b/resource-manager/migrate/2020-07-07/hypervsites/README.md index 249652dd35a..8fad28d2cd4 100644 --- a/resource-manager/migrate/2020-07-07/hypervsites/README.md +++ b/resource-manager/migrate/2020-07-07/hypervsites/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") read, err := client.DeleteSite(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") read, err := client.GetSite(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") // alternatively `client.GetSiteHealthSummary(ctx, id)` can be used to do batched pagination items, err := client.GetSiteHealthSummaryComplete(ctx, id) @@ -73,7 +73,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") read, err := client.GetSiteUsage(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") payload := hypervsites.HyperVSite{ // ... @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") payload := hypervsites.HyperVSite{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := hypervsites.NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") read, err := client.RefreshSite(ctx, id) if err != nil { diff --git a/resource-manager/migrate/2020-07-07/hypervsites/id_hypervsite.go b/resource-manager/migrate/2020-07-07/hypervsites/id_hypervsite.go index a5d94db5c27..6e108346ef5 100644 --- a/resource-manager/migrate/2020-07-07/hypervsites/id_hypervsite.go +++ b/resource-manager/migrate/2020-07-07/hypervsites/id_hypervsite.go @@ -115,7 +115,7 @@ func (id HyperVSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticHyperVSites", "hyperVSites", "hyperVSites"), - resourceids.UserSpecifiedSegment("hyperVSiteName", "siteName"), + resourceids.UserSpecifiedSegment("hyperVSiteName", "hyperVSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/hypervsites/id_hypervsite_test.go b/resource-manager/migrate/2020-07-07/hypervsites/id_hypervsite_test.go index 900c5405ba3..316b70072da 100644 --- a/resource-manager/migrate/2020-07-07/hypervsites/id_hypervsite_test.go +++ b/resource-manager/migrate/2020-07-07/hypervsites/id_hypervsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HyperVSiteId{} func TestNewHyperVSiteID(t *testing.T) { - id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewHyperVSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HyperVSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "siteName") + if id.HyperVSiteName != "hyperVSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'HyperVSiteName'", id.HyperVSiteName, "hyperVSiteName") } } func TestFormatHyperVSiteID(t *testing.T) { - actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName" + actual := NewHyperVSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hyperVSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseHyperVSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseHyperVSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HyperVSiteName: "siteName", + HyperVSiteName: "hyperVSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/hyperVSites/hyperVSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE", Expected: &HyperVSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HyperVSiteName: "sItEnAmE", + HyperVSiteName: "hYpErVsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/hYpErVsItEs/hYpErVsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/jobs/README.md b/resource-manager/migrate/2020-07-07/jobs/README.md index 7f0bb04dcfa..8150d7d07ff 100644 --- a/resource-manager/migrate/2020-07-07/jobs/README.md +++ b/resource-manager/migrate/2020-07-07/jobs/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobs.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := jobs.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetAllJobsInSite(ctx, id)` can be used to do batched pagination items, err := client.GetAllJobsInSiteComplete(ctx, id) diff --git a/resource-manager/migrate/2020-07-07/jobs/id_vmwaresite.go b/resource-manager/migrate/2020-07-07/jobs/id_vmwaresite.go index fd0575f5fa0..690a0b2ef8a 100644 --- a/resource-manager/migrate/2020-07-07/jobs/id_vmwaresite.go +++ b/resource-manager/migrate/2020-07-07/jobs/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/jobs/id_vmwaresite_test.go b/resource-manager/migrate/2020-07-07/jobs/id_vmwaresite_test.go index a79bee662a5..0556a3908c6 100644 --- a/resource-manager/migrate/2020-07-07/jobs/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-07-07/jobs/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/machines/README.md b/resource-manager/migrate/2020-07-07/machines/README.md index 09ca2019a87..8be7b857d6c 100644 --- a/resource-manager/migrate/2020-07-07/machines/README.md +++ b/resource-manager/migrate/2020-07-07/machines/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := machines.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := machines.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetAllMachinesInSite(ctx, id, machines.DefaultGetAllMachinesInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllMachinesInSiteComplete(ctx, id, machines.DefaultGetAllMachinesInSiteOperationOptions()) diff --git a/resource-manager/migrate/2020-07-07/machines/id_vmwaresite.go b/resource-manager/migrate/2020-07-07/machines/id_vmwaresite.go index b131d3565b6..56030e3431a 100644 --- a/resource-manager/migrate/2020-07-07/machines/id_vmwaresite.go +++ b/resource-manager/migrate/2020-07-07/machines/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/machines/id_vmwaresite_test.go b/resource-manager/migrate/2020-07-07/machines/id_vmwaresite_test.go index 772d5d5c385..4890e719f40 100644 --- a/resource-manager/migrate/2020-07-07/machines/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-07-07/machines/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/mastersites/README.md b/resource-manager/migrate/2020-07-07/mastersites/README.md index 6ca6e2a7053..1f3ee900202 100644 --- a/resource-manager/migrate/2020-07-07/mastersites/README.md +++ b/resource-manager/migrate/2020-07-07/mastersites/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mastersites.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := mastersites.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") read, err := client.DeleteSite(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mastersites.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := mastersites.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") read, err := client.GetSite(ctx, id) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := mastersites.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := mastersites.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") payload := mastersites.MasterSite{ // ... @@ -112,7 +112,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := mastersites.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := mastersites.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") payload := mastersites.MasterSite{ // ... diff --git a/resource-manager/migrate/2020-07-07/mastersites/id_mastersite.go b/resource-manager/migrate/2020-07-07/mastersites/id_mastersite.go index cd0f8a7e2d5..4ef2476fdcc 100644 --- a/resource-manager/migrate/2020-07-07/mastersites/id_mastersite.go +++ b/resource-manager/migrate/2020-07-07/mastersites/id_mastersite.go @@ -115,7 +115,7 @@ func (id MasterSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticMasterSites", "masterSites", "masterSites"), - resourceids.UserSpecifiedSegment("masterSiteName", "siteName"), + resourceids.UserSpecifiedSegment("masterSiteName", "masterSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/mastersites/id_mastersite_test.go b/resource-manager/migrate/2020-07-07/mastersites/id_mastersite_test.go index b251820ac79..42cf66fc0d6 100644 --- a/resource-manager/migrate/2020-07-07/mastersites/id_mastersite_test.go +++ b/resource-manager/migrate/2020-07-07/mastersites/id_mastersite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MasterSiteId{} func TestNewMasterSiteID(t *testing.T) { - id := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewMasterSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MasterSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "siteName") + if id.MasterSiteName != "masterSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "masterSiteName") } } func TestFormatMasterSiteID(t *testing.T) { - actual := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName" + actual := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseMasterSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", + MasterSiteName: "masterSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseMasterSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", + MasterSiteName: "masterSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MasterSiteName: "sItEnAmE", + MasterSiteName: "mAsTeRsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/privateendpointconnection/README.md b/resource-manager/migrate/2020-07-07/privateendpointconnection/README.md index 6c4b3b864dc..1b218abea9f 100644 --- a/resource-manager/migrate/2020-07-07/privateendpointconnection/README.md +++ b/resource-manager/migrate/2020-07-07/privateendpointconnection/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "peConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName", "privateEndpointConnectionName") read, err := client.DeletePrivateEndpointConnection(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "peConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnection.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := privateendpointconnection.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") // alternatively `client.GetPrivateEndpointConnections(ctx, id)` can be used to do batched pagination items, err := client.GetPrivateEndpointConnectionsComplete(ctx, id) @@ -73,7 +73,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "peConnectionName") +id := privateendpointconnection.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName", "privateEndpointConnectionName") payload := privateendpointconnection.PrivateEndpointConnection{ // ... diff --git a/resource-manager/migrate/2020-07-07/privateendpointconnection/id_mastersite.go b/resource-manager/migrate/2020-07-07/privateendpointconnection/id_mastersite.go index 30b61daa975..7245c93be72 100644 --- a/resource-manager/migrate/2020-07-07/privateendpointconnection/id_mastersite.go +++ b/resource-manager/migrate/2020-07-07/privateendpointconnection/id_mastersite.go @@ -115,7 +115,7 @@ func (id MasterSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticMasterSites", "masterSites", "masterSites"), - resourceids.UserSpecifiedSegment("masterSiteName", "siteName"), + resourceids.UserSpecifiedSegment("masterSiteName", "masterSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/privateendpointconnection/id_mastersite_test.go b/resource-manager/migrate/2020-07-07/privateendpointconnection/id_mastersite_test.go index adf4645b522..27fd71177ce 100644 --- a/resource-manager/migrate/2020-07-07/privateendpointconnection/id_mastersite_test.go +++ b/resource-manager/migrate/2020-07-07/privateendpointconnection/id_mastersite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MasterSiteId{} func TestNewMasterSiteID(t *testing.T) { - id := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewMasterSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MasterSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "siteName") + if id.MasterSiteName != "masterSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "masterSiteName") } } func TestFormatMasterSiteID(t *testing.T) { - actual := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName" + actual := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseMasterSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", + MasterSiteName: "masterSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseMasterSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", + MasterSiteName: "masterSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MasterSiteName: "sItEnAmE", + MasterSiteName: "mAsTeRsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/privateendpointconnection/id_privateendpointconnection.go b/resource-manager/migrate/2020-07-07/privateendpointconnection/id_privateendpointconnection.go index a5dfcf35046..125b2f4e6c3 100644 --- a/resource-manager/migrate/2020-07-07/privateendpointconnection/id_privateendpointconnection.go +++ b/resource-manager/migrate/2020-07-07/privateendpointconnection/id_privateendpointconnection.go @@ -121,9 +121,9 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticMasterSites", "masterSites", "masterSites"), - resourceids.UserSpecifiedSegment("masterSiteName", "siteName"), + resourceids.UserSpecifiedSegment("masterSiteName", "masterSiteName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "peConnectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/migrate/2020-07-07/privateendpointconnection/id_privateendpointconnection_test.go b/resource-manager/migrate/2020-07-07/privateendpointconnection/id_privateendpointconnection_test.go index ddd36384ba0..f499234db03 100644 --- a/resource-manager/migrate/2020-07-07/privateendpointconnection/id_privateendpointconnection_test.go +++ b/resource-manager/migrate/2020-07-07/privateendpointconnection/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "peConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MasterSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "siteName") + if id.MasterSiteName != "masterSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "masterSiteName") } - if id.PrivateEndpointConnectionName != "peConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "peConnectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "peConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateEndpointConnections/peConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", - PrivateEndpointConnectionName: "peConnectionName", + MasterSiteName: "masterSiteName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", - PrivateEndpointConnectionName: "peConnectionName", + MasterSiteName: "masterSiteName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MasterSiteName: "sItEnAmE", - PrivateEndpointConnectionName: "pEcOnNeCtIoNnAmE", + MasterSiteName: "mAsTeRsItEnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/privatelinkresources/README.md b/resource-manager/migrate/2020-07-07/privatelinkresources/README.md index cd16df3653c..ab85c749318 100644 --- a/resource-manager/migrate/2020-07-07/privatelinkresources/README.md +++ b/resource-manager/migrate/2020-07-07/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateLinkResourceName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName", "privateLinkResourceName") read, err := client.GetPrivateLinkResource(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := privatelinkresources.NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") // alternatively `client.GetPrivateLinkResources(ctx, id)` can be used to do batched pagination items, err := client.GetPrivateLinkResourcesComplete(ctx, id) diff --git a/resource-manager/migrate/2020-07-07/privatelinkresources/id_mastersite.go b/resource-manager/migrate/2020-07-07/privatelinkresources/id_mastersite.go index 18ebc112ba6..c0e964868c1 100644 --- a/resource-manager/migrate/2020-07-07/privatelinkresources/id_mastersite.go +++ b/resource-manager/migrate/2020-07-07/privatelinkresources/id_mastersite.go @@ -115,7 +115,7 @@ func (id MasterSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticMasterSites", "masterSites", "masterSites"), - resourceids.UserSpecifiedSegment("masterSiteName", "siteName"), + resourceids.UserSpecifiedSegment("masterSiteName", "masterSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/privatelinkresources/id_mastersite_test.go b/resource-manager/migrate/2020-07-07/privatelinkresources/id_mastersite_test.go index 800cac724ae..a3796bec612 100644 --- a/resource-manager/migrate/2020-07-07/privatelinkresources/id_mastersite_test.go +++ b/resource-manager/migrate/2020-07-07/privatelinkresources/id_mastersite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MasterSiteId{} func TestNewMasterSiteID(t *testing.T) { - id := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewMasterSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MasterSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "siteName") + if id.MasterSiteName != "masterSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "masterSiteName") } } func TestFormatMasterSiteID(t *testing.T) { - actual := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName" + actual := NewMasterSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseMasterSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", + MasterSiteName: "masterSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseMasterSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", + MasterSiteName: "masterSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE", Expected: &MasterSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MasterSiteName: "sItEnAmE", + MasterSiteName: "mAsTeRsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/privatelinkresources/id_privatelinkresource.go b/resource-manager/migrate/2020-07-07/privatelinkresources/id_privatelinkresource.go index caba38650cc..b5d0b610584 100644 --- a/resource-manager/migrate/2020-07-07/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/migrate/2020-07-07/privatelinkresources/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticMasterSites", "masterSites", "masterSites"), - resourceids.UserSpecifiedSegment("masterSiteName", "siteName"), + resourceids.UserSpecifiedSegment("masterSiteName", "masterSiteName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } diff --git a/resource-manager/migrate/2020-07-07/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/migrate/2020-07-07/privatelinkresources/id_privatelinkresource_test.go index d218b20a5c8..9eb1a778f3d 100644 --- a/resource-manager/migrate/2020-07-07/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/migrate/2020-07-07/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateLinkResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.MasterSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "siteName") + if id.MasterSiteName != "masterSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'MasterSiteName'", id.MasterSiteName, "masterSiteName") } if id.PrivateLinkResourceName != "privateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateLinkResources/privateLinkResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "masterSiteName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", + MasterSiteName: "masterSiteName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - MasterSiteName: "siteName", + MasterSiteName: "masterSiteName", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/siteName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/masterSites/masterSiteName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MasterSiteName: "sItEnAmE", + MasterSiteName: "mAsTeRsItEnAmE", PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/sItEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/mAsTeRsItEs/mAsTeRsItEnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/runasaccounts/README.md b/resource-manager/migrate/2020-07-07/runasaccounts/README.md index 3d8018968ea..f17b7d5846a 100644 --- a/resource-manager/migrate/2020-07-07/runasaccounts/README.md +++ b/resource-manager/migrate/2020-07-07/runasaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := runasaccounts.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := runasaccounts.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetAllRunAsAccountsInSite(ctx, id)` can be used to do batched pagination items, err := client.GetAllRunAsAccountsInSiteComplete(ctx, id) diff --git a/resource-manager/migrate/2020-07-07/runasaccounts/id_vmwaresite.go b/resource-manager/migrate/2020-07-07/runasaccounts/id_vmwaresite.go index 0a5d3977b1d..163dc6ce40e 100644 --- a/resource-manager/migrate/2020-07-07/runasaccounts/id_vmwaresite.go +++ b/resource-manager/migrate/2020-07-07/runasaccounts/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/runasaccounts/id_vmwaresite_test.go b/resource-manager/migrate/2020-07-07/runasaccounts/id_vmwaresite_test.go index fd815bdc2ab..b3e2ac25d63 100644 --- a/resource-manager/migrate/2020-07-07/runasaccounts/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-07-07/runasaccounts/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/sites/README.md b/resource-manager/migrate/2020-07-07/sites/README.md index 846417a2df3..89e19dc89a6 100644 --- a/resource-manager/migrate/2020-07-07/sites/README.md +++ b/resource-manager/migrate/2020-07-07/sites/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") read, err := client.DeleteSite(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") read, err := client.GetSite(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetSiteHealthSummary(ctx, id)` can be used to do batched pagination items, err := client.GetSiteHealthSummaryComplete(ctx, id) @@ -73,7 +73,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") read, err := client.GetSiteUsage(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") payload := sites.VMwareSite{ // ... @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") payload := sites.VMwareSite{ // ... @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := sites.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") read, err := client.RefreshSite(ctx, id) if err != nil { diff --git a/resource-manager/migrate/2020-07-07/sites/id_vmwaresite.go b/resource-manager/migrate/2020-07-07/sites/id_vmwaresite.go index fddc73763a3..31c6ae894d7 100644 --- a/resource-manager/migrate/2020-07-07/sites/id_vmwaresite.go +++ b/resource-manager/migrate/2020-07-07/sites/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/sites/id_vmwaresite_test.go b/resource-manager/migrate/2020-07-07/sites/id_vmwaresite_test.go index 405fbbbdca5..ab9d7f1b3ec 100644 --- a/resource-manager/migrate/2020-07-07/sites/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-07-07/sites/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/vcenter/README.md b/resource-manager/migrate/2020-07-07/vcenter/README.md index 12553595244..3b455c2ce67 100644 --- a/resource-manager/migrate/2020-07-07/vcenter/README.md +++ b/resource-manager/migrate/2020-07-07/vcenter/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName") +id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName") read, err := client.DeleteVCenter(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vcenter.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") +id := vcenter.NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") // alternatively `client.GetAllVCentersInSite(ctx, id, vcenter.DefaultGetAllVCentersInSiteOperationOptions())` can be used to do batched pagination items, err := client.GetAllVCentersInSiteComplete(ctx, id, vcenter.DefaultGetAllVCentersInSiteOperationOptions()) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName") +id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName") read, err := client.GetVCenter(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName") +id := vcenter.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName") payload := vcenter.VCenter{ // ... diff --git a/resource-manager/migrate/2020-07-07/vcenter/id_vcenter.go b/resource-manager/migrate/2020-07-07/vcenter/id_vcenter.go index 16b8d511e4d..abb17ccf7ad 100644 --- a/resource-manager/migrate/2020-07-07/vcenter/id_vcenter.go +++ b/resource-manager/migrate/2020-07-07/vcenter/id_vcenter.go @@ -121,9 +121,9 @@ func (id VCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), - resourceids.UserSpecifiedSegment("vCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterName"), } } diff --git a/resource-manager/migrate/2020-07-07/vcenter/id_vcenter_test.go b/resource-manager/migrate/2020-07-07/vcenter/id_vcenter_test.go index b44fbf09a5d..0dfcf42e114 100644 --- a/resource-manager/migrate/2020-07-07/vcenter/id_vcenter_test.go +++ b/resource-manager/migrate/2020-07-07/vcenter/id_vcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VCenterId{} func TestNewVCenterID(t *testing.T) { - id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName") + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewVCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } - if id.VCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vcenterName") + if id.VCenterName != "vCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterName") } } func TestFormatVCenterID(t *testing.T) { - actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName" + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName", "vCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", - VCenterName: "vcenterName", + VmwareSiteName: "vmwareSiteName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/vCeNtErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/vCeNtErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", - VCenterName: "vcenterName", + VmwareSiteName: "vmwareSiteName", + VCenterName: "vCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/vCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/vCenters/vCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/vCeNtErS/vCeNtErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/vCeNtErS/vCeNtErNaMe", Expected: &VCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", VCenterName: "vCeNtErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/vCeNtErS/vCeNtErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/vCeNtErS/vCeNtErNaMe/extra", Error: true, }, } diff --git a/resource-manager/migrate/2020-07-07/vcenter/id_vmwaresite.go b/resource-manager/migrate/2020-07-07/vcenter/id_vmwaresite.go index 2bef8739b92..fe65e2dcaf9 100644 --- a/resource-manager/migrate/2020-07-07/vcenter/id_vmwaresite.go +++ b/resource-manager/migrate/2020-07-07/vcenter/id_vmwaresite.go @@ -115,7 +115,7 @@ func (id VMwareSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftOffAzure", "Microsoft.OffAzure", "Microsoft.OffAzure"), resourceids.StaticSegment("staticVmwareSites", "vmwareSites", "vmwareSites"), - resourceids.UserSpecifiedSegment("vmwareSiteName", "siteName"), + resourceids.UserSpecifiedSegment("vmwareSiteName", "vmwareSiteName"), } } diff --git a/resource-manager/migrate/2020-07-07/vcenter/id_vmwaresite_test.go b/resource-manager/migrate/2020-07-07/vcenter/id_vmwaresite_test.go index bebb43e110d..ad90eb96c9b 100644 --- a/resource-manager/migrate/2020-07-07/vcenter/id_vmwaresite_test.go +++ b/resource-manager/migrate/2020-07-07/vcenter/id_vmwaresite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VMwareSiteId{} func TestNewVMwareSiteID(t *testing.T) { - id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName") + id := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVMwareSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VmwareSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "siteName") + if id.VmwareSiteName != "vmwareSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VmwareSiteName'", id.VmwareSiteName, "vmwareSiteName") } } func TestFormatVMwareSiteID(t *testing.T) { - actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName" + actual := NewVMwareSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmwareSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVMwareSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVMwareSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VmwareSiteName: "siteName", + VmwareSiteName: "vmwareSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OffAzure/vmwareSites/vmwareSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE", Expected: &VMwareSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VmwareSiteName: "sItEnAmE", + VmwareSiteName: "vMwArEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oFfAzUrE/vMwArEsItEs/vMwArEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mixedreality/2021-01-01/key/README.md b/resource-manager/mixedreality/2021-01-01/key/README.md index 7228126d6f8..cf3e957aa75 100644 --- a/resource-manager/mixedreality/2021-01-01/key/README.md +++ b/resource-manager/mixedreality/2021-01-01/key/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := key.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := key.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") read, err := client.RemoteRenderingAccountsListKeys(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := key.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := key.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") payload := key.AccountKeyRegenerateRequest{ // ... @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := key.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := key.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") read, err := client.SpatialAnchorsAccountsListKeys(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := key.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := key.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") payload := key.AccountKeyRegenerateRequest{ // ... diff --git a/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount.go b/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount.go index 6e65bde4a4e..e9f8cd8d3d7 100644 --- a/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount.go +++ b/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount.go @@ -115,7 +115,7 @@ func (id RemoteRenderingAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), resourceids.StaticSegment("staticRemoteRenderingAccounts", "remoteRenderingAccounts", "remoteRenderingAccounts"), - resourceids.UserSpecifiedSegment("remoteRenderingAccountName", "accountName"), + resourceids.UserSpecifiedSegment("remoteRenderingAccountName", "remoteRenderingAccountName"), } } diff --git a/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount_test.go b/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount_test.go index be476bf9cc4..8a5b61d9e4c 100644 --- a/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount_test.go +++ b/resource-manager/mixedreality/2021-01-01/key/id_remoterenderingaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RemoteRenderingAccountId{} func TestNewRemoteRenderingAccountID(t *testing.T) { - id := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRemoteRenderingAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RemoteRenderingAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'RemoteRenderingAccountName'", id.RemoteRenderingAccountName, "accountName") + if id.RemoteRenderingAccountName != "remoteRenderingAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'RemoteRenderingAccountName'", id.RemoteRenderingAccountName, "remoteRenderingAccountName") } } func TestFormatRemoteRenderingAccountID(t *testing.T) { - actual := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName" + actual := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRemoteRenderingAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", Expected: &RemoteRenderingAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "accountName", + RemoteRenderingAccountName: "remoteRenderingAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRemoteRenderingAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", Expected: &RemoteRenderingAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "accountName", + RemoteRenderingAccountName: "remoteRenderingAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE", Expected: &RemoteRenderingAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RemoteRenderingAccountName: "aCcOuNtNaMe", + RemoteRenderingAccountName: "rEmOtErEnDeRiNgAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount.go b/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount.go index d7f0ee352b6..85075afc865 100644 --- a/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount.go +++ b/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount.go @@ -115,7 +115,7 @@ func (id SpatialAnchorsAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), resourceids.StaticSegment("staticSpatialAnchorsAccounts", "spatialAnchorsAccounts", "spatialAnchorsAccounts"), - resourceids.UserSpecifiedSegment("spatialAnchorsAccountName", "accountName"), + resourceids.UserSpecifiedSegment("spatialAnchorsAccountName", "spatialAnchorsAccountName"), } } diff --git a/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount_test.go b/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount_test.go index 2431f6b9e3d..b0f9c8131c7 100644 --- a/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount_test.go +++ b/resource-manager/mixedreality/2021-01-01/key/id_spatialanchorsaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SpatialAnchorsAccountId{} func TestNewSpatialAnchorsAccountID(t *testing.T) { - id := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewSpatialAnchorsAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpatialAnchorsAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'SpatialAnchorsAccountName'", id.SpatialAnchorsAccountName, "accountName") + if id.SpatialAnchorsAccountName != "spatialAnchorsAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'SpatialAnchorsAccountName'", id.SpatialAnchorsAccountName, "spatialAnchorsAccountName") } } func TestFormatSpatialAnchorsAccountID(t *testing.T) { - actual := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName" + actual := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseSpatialAnchorsAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName", Expected: &SpatialAnchorsAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpatialAnchorsAccountName: "accountName", + SpatialAnchorsAccountName: "spatialAnchorsAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseSpatialAnchorsAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName", Expected: &SpatialAnchorsAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpatialAnchorsAccountName: "accountName", + SpatialAnchorsAccountName: "spatialAnchorsAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/sPaTiAlAnChOrSaCcOuNtNaMe", Expected: &SpatialAnchorsAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpatialAnchorsAccountName: "aCcOuNtNaMe", + SpatialAnchorsAccountName: "sPaTiAlAnChOrSaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/sPaTiAlAnChOrSaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/mixedreality/2021-01-01/proxy/README.md b/resource-manager/mixedreality/2021-01-01/proxy/README.md index c9adb60c3fa..e0784366281 100644 --- a/resource-manager/mixedreality/2021-01-01/proxy/README.md +++ b/resource-manager/mixedreality/2021-01-01/proxy/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := proxy.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := proxy.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := proxy.CheckNameAvailabilityRequest{ // ... diff --git a/resource-manager/mixedreality/2021-01-01/proxy/id_location.go b/resource-manager/mixedreality/2021-01-01/proxy/id_location.go index dee48f08b92..66ee4faa862 100644 --- a/resource-manager/mixedreality/2021-01-01/proxy/id_location.go +++ b/resource-manager/mixedreality/2021-01-01/proxy/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/mixedreality/2021-01-01/proxy/id_location_test.go b/resource-manager/mixedreality/2021-01-01/proxy/id_location_test.go index 5dce589d0b2..b8f94aa21f4 100644 --- a/resource-manager/mixedreality/2021-01-01/proxy/id_location_test.go +++ b/resource-manager/mixedreality/2021-01-01/proxy/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MixedReality/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/mixedreality/2021-01-01/resource/README.md b/resource-manager/mixedreality/2021-01-01/resource/README.md index ca9d9d8d4bc..90cf810cda9 100644 --- a/resource-manager/mixedreality/2021-01-01/resource/README.md +++ b/resource-manager/mixedreality/2021-01-01/resource/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") payload := resource.RemoteRenderingAccount{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") read, err := client.RemoteRenderingAccountsDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") read, err := client.RemoteRenderingAccountsGet(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := resource.NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") payload := resource.RemoteRenderingAccount{ // ... @@ -133,7 +133,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") payload := resource.SpatialAnchorsAccount{ // ... @@ -154,7 +154,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") read, err := client.SpatialAnchorsAccountsDelete(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") read, err := client.SpatialAnchorsAccountsGet(ctx, id) if err != nil { @@ -220,7 +220,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := resource.NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") payload := resource.SpatialAnchorsAccount{ // ... diff --git a/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount.go b/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount.go index a73af37c809..7573ded1718 100644 --- a/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount.go +++ b/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount.go @@ -115,7 +115,7 @@ func (id RemoteRenderingAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), resourceids.StaticSegment("staticRemoteRenderingAccounts", "remoteRenderingAccounts", "remoteRenderingAccounts"), - resourceids.UserSpecifiedSegment("remoteRenderingAccountName", "accountName"), + resourceids.UserSpecifiedSegment("remoteRenderingAccountName", "remoteRenderingAccountName"), } } diff --git a/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount_test.go b/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount_test.go index 2034ad351a2..dde33490d8e 100644 --- a/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount_test.go +++ b/resource-manager/mixedreality/2021-01-01/resource/id_remoterenderingaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RemoteRenderingAccountId{} func TestNewRemoteRenderingAccountID(t *testing.T) { - id := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRemoteRenderingAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RemoteRenderingAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'RemoteRenderingAccountName'", id.RemoteRenderingAccountName, "accountName") + if id.RemoteRenderingAccountName != "remoteRenderingAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'RemoteRenderingAccountName'", id.RemoteRenderingAccountName, "remoteRenderingAccountName") } } func TestFormatRemoteRenderingAccountID(t *testing.T) { - actual := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName" + actual := NewRemoteRenderingAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "remoteRenderingAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRemoteRenderingAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", Expected: &RemoteRenderingAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "accountName", + RemoteRenderingAccountName: "remoteRenderingAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRemoteRenderingAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName", Expected: &RemoteRenderingAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RemoteRenderingAccountName: "accountName", + RemoteRenderingAccountName: "remoteRenderingAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/remoteRenderingAccounts/remoteRenderingAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE", Expected: &RemoteRenderingAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RemoteRenderingAccountName: "aCcOuNtNaMe", + RemoteRenderingAccountName: "rEmOtErEnDeRiNgAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/rEmOtErEnDeRiNgAcCoUnTs/rEmOtErEnDeRiNgAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount.go b/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount.go index 4441257efd7..a0f747252cb 100644 --- a/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount.go +++ b/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount.go @@ -115,7 +115,7 @@ func (id SpatialAnchorsAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMixedReality", "Microsoft.MixedReality", "Microsoft.MixedReality"), resourceids.StaticSegment("staticSpatialAnchorsAccounts", "spatialAnchorsAccounts", "spatialAnchorsAccounts"), - resourceids.UserSpecifiedSegment("spatialAnchorsAccountName", "accountName"), + resourceids.UserSpecifiedSegment("spatialAnchorsAccountName", "spatialAnchorsAccountName"), } } diff --git a/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount_test.go b/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount_test.go index f453ef0678f..7bad3f0cf37 100644 --- a/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount_test.go +++ b/resource-manager/mixedreality/2021-01-01/resource/id_spatialanchorsaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SpatialAnchorsAccountId{} func TestNewSpatialAnchorsAccountID(t *testing.T) { - id := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewSpatialAnchorsAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SpatialAnchorsAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'SpatialAnchorsAccountName'", id.SpatialAnchorsAccountName, "accountName") + if id.SpatialAnchorsAccountName != "spatialAnchorsAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'SpatialAnchorsAccountName'", id.SpatialAnchorsAccountName, "spatialAnchorsAccountName") } } func TestFormatSpatialAnchorsAccountID(t *testing.T) { - actual := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName" + actual := NewSpatialAnchorsAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "spatialAnchorsAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseSpatialAnchorsAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName", Expected: &SpatialAnchorsAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpatialAnchorsAccountName: "accountName", + SpatialAnchorsAccountName: "spatialAnchorsAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseSpatialAnchorsAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName", Expected: &SpatialAnchorsAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SpatialAnchorsAccountName: "accountName", + SpatialAnchorsAccountName: "spatialAnchorsAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.MixedReality/spatialAnchorsAccounts/spatialAnchorsAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/sPaTiAlAnChOrSaCcOuNtNaMe", Expected: &SpatialAnchorsAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SpatialAnchorsAccountName: "aCcOuNtNaMe", + SpatialAnchorsAccountName: "sPaTiAlAnChOrSaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mIxEdReAlItY/sPaTiAlAnChOrSaCcOuNtS/sPaTiAlAnChOrSaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplane/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplane/model_httpsservercertificate.go index be8a65a3fd5..22f99cba4bb 100644 --- a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplane/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplane/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go index 7016c998d90..4baf53e9837 100644 --- a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go +++ b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go @@ -4,5 +4,5 @@ package packetcorecontrolplanecollectdiagnosticspackage // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PacketCoreControlPlaneCollectDiagnosticsPackage struct { - StorageAccountBlobUrl string `json:"storageAccountBlobUrl"` + StorageAccountBlobURL string `json:"storageAccountBlobUrl"` } diff --git a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplanes/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplanes/model_httpsservercertificate.go index f541aa9fb6e..b25fbac8ce5 100644 --- a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplanes/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplanes/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/README.md b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/README.md index 1b1c51b58a5..1a3ec578396 100644 --- a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/README.md +++ b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("versionName") +id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go index d57c91e21ab..96b94c3d064 100644 --- a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go @@ -99,7 +99,7 @@ func (id PacketCoreControlPlaneVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go index c20f914d15f..e8041edbaf0 100644 --- a/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2022-11-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &PacketCoreControlPlaneVersionId{} func TestNewPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewPacketCoreControlPlaneVersionID("versionName") + id := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewPacketCoreControlPlaneVersionID("versionName").ID() - expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName").ID() + expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParsePacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParsePacketCoreControlPlaneVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2022-11-01/simgroup/model_keyvaultkey.go b/resource-manager/mobilenetwork/2022-11-01/simgroup/model_keyvaultkey.go index 679efab87d3..2e1e7511d51 100644 --- a/resource-manager/mobilenetwork/2022-11-01/simgroup/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2022-11-01/simgroup/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroup // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2022-11-01/simgroups/model_keyvaultkey.go b/resource-manager/mobilenetwork/2022-11-01/simgroups/model_keyvaultkey.go index 445fb38c548..890744d9485 100644 --- a/resource-manager/mobilenetwork/2022-11-01/simgroups/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2022-11-01/simgroups/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroups // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go index fef0d2bca43..37d2dc38289 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go @@ -4,5 +4,5 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DiagnosticsUploadConfiguration struct { - StorageAccountContainerUrl string `json:"storageAccountContainerUrl"` + StorageAccountContainerURL string `json:"storageAccountContainerUrl"` } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplane/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplane/model_httpsservercertificate.go index be8a65a3fd5..22f99cba4bb 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplane/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplane/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go index 7016c998d90..4baf53e9837 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go @@ -4,5 +4,5 @@ package packetcorecontrolplanecollectdiagnosticspackage // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PacketCoreControlPlaneCollectDiagnosticsPackage struct { - StorageAccountBlobUrl string `json:"storageAccountBlobUrl"` + StorageAccountBlobURL string `json:"storageAccountBlobUrl"` } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go index 7f971c9a784..7a783a42243 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go @@ -4,5 +4,5 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DiagnosticsUploadConfiguration struct { - StorageAccountContainerUrl string `json:"storageAccountContainerUrl"` + StorageAccountContainerURL string `json:"storageAccountContainerUrl"` } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanes/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanes/model_httpsservercertificate.go index f541aa9fb6e..b25fbac8ce5 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanes/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplanes/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/README.md b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/README.md index 2d910a74e21..8740edfd2b9 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/README.md +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("versionName") +id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName") +id := packetcorecontrolplaneversion.NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName") read, err := client.GetBySubscription(ctx, id) if err != nil { diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go index d57c91e21ab..96b94c3d064 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go @@ -99,7 +99,7 @@ func (id PacketCoreControlPlaneVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go index c20f914d15f..e8041edbaf0 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &PacketCoreControlPlaneVersionId{} func TestNewPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewPacketCoreControlPlaneVersionID("versionName") + id := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewPacketCoreControlPlaneVersionID("versionName").ID() - expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName").ID() + expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParsePacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParsePacketCoreControlPlaneVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go index 1c07513540c..0d071db021c 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go @@ -107,7 +107,7 @@ func (id ProviderPacketCoreControlPlaneVersionId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go index 5e3f1d98b9c..698fdf86a45 100644 --- a/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2023-06-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderPacketCoreControlPlaneVersionId{} func TestNewProviderPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName") + id := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatProviderPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderPacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderPacketCoreControlPlaneVersionIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2023-06-01/simgroup/model_keyvaultkey.go b/resource-manager/mobilenetwork/2023-06-01/simgroup/model_keyvaultkey.go index 679efab87d3..2e1e7511d51 100644 --- a/resource-manager/mobilenetwork/2023-06-01/simgroup/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2023-06-01/simgroup/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroup // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2023-06-01/simgroups/model_keyvaultkey.go b/resource-manager/mobilenetwork/2023-06-01/simgroups/model_keyvaultkey.go index 445fb38c548..890744d9485 100644 --- a/resource-manager/mobilenetwork/2023-06-01/simgroups/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2023-06-01/simgroups/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroups // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go index fef0d2bca43..37d2dc38289 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go @@ -4,5 +4,5 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DiagnosticsUploadConfiguration struct { - StorageAccountContainerUrl string `json:"storageAccountContainerUrl"` + StorageAccountContainerURL string `json:"storageAccountContainerUrl"` } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplane/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplane/model_httpsservercertificate.go index be8a65a3fd5..22f99cba4bb 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplane/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplane/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go index 7016c998d90..4baf53e9837 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go @@ -4,5 +4,5 @@ package packetcorecontrolplanecollectdiagnosticspackage // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PacketCoreControlPlaneCollectDiagnosticsPackage struct { - StorageAccountBlobUrl string `json:"storageAccountBlobUrl"` + StorageAccountBlobURL string `json:"storageAccountBlobUrl"` } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go index 7f971c9a784..7a783a42243 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go @@ -4,5 +4,5 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DiagnosticsUploadConfiguration struct { - StorageAccountContainerUrl string `json:"storageAccountContainerUrl"` + StorageAccountContainerURL string `json:"storageAccountContainerUrl"` } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanes/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanes/model_httpsservercertificate.go index f541aa9fb6e..b25fbac8ce5 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanes/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplanes/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/README.md b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/README.md index 7d50ff8ecfe..776a06339cc 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/README.md +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("versionName") +id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName") +id := packetcorecontrolplaneversion.NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName") read, err := client.GetBySubscription(ctx, id) if err != nil { diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go index d57c91e21ab..96b94c3d064 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go @@ -99,7 +99,7 @@ func (id PacketCoreControlPlaneVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go index c20f914d15f..e8041edbaf0 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &PacketCoreControlPlaneVersionId{} func TestNewPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewPacketCoreControlPlaneVersionID("versionName") + id := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewPacketCoreControlPlaneVersionID("versionName").ID() - expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName").ID() + expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParsePacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParsePacketCoreControlPlaneVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go index 1c07513540c..0d071db021c 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go @@ -107,7 +107,7 @@ func (id ProviderPacketCoreControlPlaneVersionId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go index 5e3f1d98b9c..698fdf86a45 100644 --- a/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2023-09-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderPacketCoreControlPlaneVersionId{} func TestNewProviderPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName") + id := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatProviderPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderPacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderPacketCoreControlPlaneVersionIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2023-09-01/simgroup/model_keyvaultkey.go b/resource-manager/mobilenetwork/2023-09-01/simgroup/model_keyvaultkey.go index 679efab87d3..2e1e7511d51 100644 --- a/resource-manager/mobilenetwork/2023-09-01/simgroup/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2023-09-01/simgroup/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroup // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2023-09-01/simgroups/model_keyvaultkey.go b/resource-manager/mobilenetwork/2023-09-01/simgroups/model_keyvaultkey.go index 445fb38c548..890744d9485 100644 --- a/resource-manager/mobilenetwork/2023-09-01/simgroups/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2023-09-01/simgroups/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroups // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go index fef0d2bca43..37d2dc38289 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go @@ -4,5 +4,5 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DiagnosticsUploadConfiguration struct { - StorageAccountContainerUrl string `json:"storageAccountContainerUrl"` + StorageAccountContainerURL string `json:"storageAccountContainerUrl"` } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplane/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplane/model_httpsservercertificate.go index be8a65a3fd5..22f99cba4bb 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplane/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplane/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go index 7016c998d90..4baf53e9837 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go @@ -4,5 +4,5 @@ package packetcorecontrolplanecollectdiagnosticspackage // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PacketCoreControlPlaneCollectDiagnosticsPackage struct { - StorageAccountBlobUrl string `json:"storageAccountBlobUrl"` + StorageAccountBlobURL string `json:"storageAccountBlobUrl"` } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go index 7f971c9a784..7a783a42243 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go @@ -4,5 +4,5 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DiagnosticsUploadConfiguration struct { - StorageAccountContainerUrl string `json:"storageAccountContainerUrl"` + StorageAccountContainerURL string `json:"storageAccountContainerUrl"` } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanes/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanes/model_httpsservercertificate.go index f541aa9fb6e..b25fbac8ce5 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanes/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplanes/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/README.md b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/README.md index b577269c133..c0fc9171c64 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/README.md +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("versionName") +id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName") +id := packetcorecontrolplaneversion.NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName") read, err := client.GetBySubscription(ctx, id) if err != nil { diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go index d57c91e21ab..96b94c3d064 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go @@ -99,7 +99,7 @@ func (id PacketCoreControlPlaneVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go index c20f914d15f..e8041edbaf0 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &PacketCoreControlPlaneVersionId{} func TestNewPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewPacketCoreControlPlaneVersionID("versionName") + id := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewPacketCoreControlPlaneVersionID("versionName").ID() - expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName").ID() + expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParsePacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParsePacketCoreControlPlaneVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go index 1c07513540c..0d071db021c 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go @@ -107,7 +107,7 @@ func (id ProviderPacketCoreControlPlaneVersionId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go index 5e3f1d98b9c..698fdf86a45 100644 --- a/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2024-02-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderPacketCoreControlPlaneVersionId{} func TestNewProviderPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName") + id := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatProviderPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderPacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderPacketCoreControlPlaneVersionIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2024-02-01/simgroup/model_keyvaultkey.go b/resource-manager/mobilenetwork/2024-02-01/simgroup/model_keyvaultkey.go index 679efab87d3..2e1e7511d51 100644 --- a/resource-manager/mobilenetwork/2024-02-01/simgroup/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2024-02-01/simgroup/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroup // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-02-01/simgroups/model_keyvaultkey.go b/resource-manager/mobilenetwork/2024-02-01/simgroups/model_keyvaultkey.go index 445fb38c548..890744d9485 100644 --- a/resource-manager/mobilenetwork/2024-02-01/simgroups/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2024-02-01/simgroups/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroups // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-04-01/mobilenetworks/model_keyvaultkey.go b/resource-manager/mobilenetwork/2024-04-01/mobilenetworks/model_keyvaultkey.go index 07c51fddd92..f38630a9780 100644 --- a/resource-manager/mobilenetwork/2024-04-01/mobilenetworks/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2024-04-01/mobilenetworks/model_keyvaultkey.go @@ -4,5 +4,5 @@ package mobilenetworks // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go index fef0d2bca43..37d2dc38289 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplane/model_diagnosticsuploadconfiguration.go @@ -4,5 +4,5 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DiagnosticsUploadConfiguration struct { - StorageAccountContainerUrl string `json:"storageAccountContainerUrl"` + StorageAccountContainerURL string `json:"storageAccountContainerUrl"` } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplane/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplane/model_httpsservercertificate.go index be8a65a3fd5..22f99cba4bb 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplane/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplane/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplane // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go index 7016c998d90..4baf53e9837 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanecollectdiagnosticspackage/model_packetcorecontrolplanecollectdiagnosticspackage.go @@ -4,5 +4,5 @@ package packetcorecontrolplanecollectdiagnosticspackage // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PacketCoreControlPlaneCollectDiagnosticsPackage struct { - StorageAccountBlobUrl string `json:"storageAccountBlobUrl"` + StorageAccountBlobURL string `json:"storageAccountBlobUrl"` } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go index 7f971c9a784..7a783a42243 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanes/model_diagnosticsuploadconfiguration.go @@ -4,5 +4,5 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DiagnosticsUploadConfiguration struct { - StorageAccountContainerUrl string `json:"storageAccountContainerUrl"` + StorageAccountContainerURL string `json:"storageAccountContainerUrl"` } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanes/model_httpsservercertificate.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanes/model_httpsservercertificate.go index f541aa9fb6e..b25fbac8ce5 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanes/model_httpsservercertificate.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplanes/model_httpsservercertificate.go @@ -4,6 +4,6 @@ package packetcorecontrolplanes // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type HTTPSServerCertificate struct { - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` Provisioning *CertificateProvisioning `json:"provisioning,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/README.md b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/README.md index e8b666b139a..0e30ada9aec 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/README.md +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("versionName") +id := packetcorecontrolplaneversion.NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := packetcorecontrolplaneversion.NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName") +id := packetcorecontrolplaneversion.NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName") read, err := client.GetBySubscription(ctx, id) if err != nil { diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go index d57c91e21ab..96b94c3d064 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion.go @@ -99,7 +99,7 @@ func (id PacketCoreControlPlaneVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go index c20f914d15f..e8041edbaf0 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_packetcorecontrolplaneversion_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &PacketCoreControlPlaneVersionId{} func TestNewPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewPacketCoreControlPlaneVersionID("versionName") + id := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName") - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewPacketCoreControlPlaneVersionID("versionName").ID() - expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewPacketCoreControlPlaneVersionID("packetCoreControlPlaneVersionName").ID() + expected := "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParsePacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParsePacketCoreControlPlaneVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &PacketCoreControlPlaneVersionId{ - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go index 1c07513540c..0d071db021c 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion.go @@ -107,7 +107,7 @@ func (id ProviderPacketCoreControlPlaneVersionId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMobileNetwork", "Microsoft.MobileNetwork", "Microsoft.MobileNetwork"), resourceids.StaticSegment("staticPacketCoreControlPlaneVersions", "packetCoreControlPlaneVersions", "packetCoreControlPlaneVersions"), - resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "versionName"), + resourceids.UserSpecifiedSegment("packetCoreControlPlaneVersionName", "packetCoreControlPlaneVersionName"), } } diff --git a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go index 5e3f1d98b9c..698fdf86a45 100644 --- a/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go +++ b/resource-manager/mobilenetwork/2024-04-01/packetcorecontrolplaneversion/id_providerpacketcorecontrolplaneversion_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderPacketCoreControlPlaneVersionId{} func TestNewProviderPacketCoreControlPlaneVersionID(t *testing.T) { - id := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName") + id := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.PacketCoreControlPlaneVersionName != "versionName" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "versionName") + if id.PacketCoreControlPlaneVersionName != "packetCoreControlPlaneVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'PacketCoreControlPlaneVersionName'", id.PacketCoreControlPlaneVersionName, "packetCoreControlPlaneVersionName") } } func TestFormatProviderPacketCoreControlPlaneVersionID(t *testing.T) { - actual := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "versionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName" + actual := NewProviderPacketCoreControlPlaneVersionID("12345678-1234-9876-4563-123456789012", "packetCoreControlPlaneVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderPacketCoreControlPlaneVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderPacketCoreControlPlaneVersionIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "versionName", + PacketCoreControlPlaneVersionName: "packetCoreControlPlaneVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/versionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/packetCoreControlPlaneVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", Expected: &ProviderPacketCoreControlPlaneVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PacketCoreControlPlaneVersionName: "vErSiOnNaMe", + PacketCoreControlPlaneVersionName: "pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/vErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mObIlEnEtWoRk/pAcKeTcOrEcOnTrOlPlAnEvErSiOnS/pAcKeTcOrEcOnTrOlPlAnEvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mobilenetwork/2024-04-01/simgroup/model_keyvaultkey.go b/resource-manager/mobilenetwork/2024-04-01/simgroup/model_keyvaultkey.go index 679efab87d3..2e1e7511d51 100644 --- a/resource-manager/mobilenetwork/2024-04-01/simgroup/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2024-04-01/simgroup/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroup // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mobilenetwork/2024-04-01/simgroups/model_keyvaultkey.go b/resource-manager/mobilenetwork/2024-04-01/simgroups/model_keyvaultkey.go index 445fb38c548..890744d9485 100644 --- a/resource-manager/mobilenetwork/2024-04-01/simgroups/model_keyvaultkey.go +++ b/resource-manager/mobilenetwork/2024-04-01/simgroups/model_keyvaultkey.go @@ -4,5 +4,5 @@ package simgroups // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKey struct { - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` } diff --git a/resource-manager/mongocluster/2024-07-01/mongoclusters/README.md b/resource-manager/mongocluster/2024-07-01/mongoclusters/README.md index a7621655744..d103a70de62 100644 --- a/resource-manager/mongocluster/2024-07-01/mongoclusters/README.md +++ b/resource-manager/mongocluster/2024-07-01/mongoclusters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := mongoclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := mongoclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := mongoclusters.CheckNameAvailabilityRequest{ // ... diff --git a/resource-manager/mongocluster/2024-07-01/mongoclusters/id_location.go b/resource-manager/mongocluster/2024-07-01/mongoclusters/id_location.go index 636c2b2e606..175236f7292 100644 --- a/resource-manager/mongocluster/2024-07-01/mongoclusters/id_location.go +++ b/resource-manager/mongocluster/2024-07-01/mongoclusters/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDocumentDB", "Microsoft.DocumentDB", "Microsoft.DocumentDB"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/mongocluster/2024-07-01/mongoclusters/id_location_test.go b/resource-manager/mongocluster/2024-07-01/mongoclusters/id_location_test.go index fce1c980ad2..35ba2cc9608 100644 --- a/resource-manager/mongocluster/2024-07-01/mongoclusters/id_location_test.go +++ b/resource-manager/mongocluster/2024-07-01/mongoclusters/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DocumentDB/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOcUmEnTdB/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/backups/README.md b/resource-manager/mysql/2021-05-01/backups/README.md index c7dfeeab1bd..a5711dc1146 100644 --- a/resource-manager/mysql/2021-05-01/backups/README.md +++ b/resource-manager/mysql/2021-05-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2021-05-01/backups/id_backup.go b/resource-manager/mysql/2021-05-01/backups/id_backup.go index 3192cb962bb..faa1058f8a8 100644 --- a/resource-manager/mysql/2021-05-01/backups/id_backup.go +++ b/resource-manager/mysql/2021-05-01/backups/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupName", "backupName"), } diff --git a/resource-manager/mysql/2021-05-01/backups/id_backup_test.go b/resource-manager/mysql/2021-05-01/backups/id_backup_test.go index 5175ea860f4..f008d399c27 100644 --- a/resource-manager/mysql/2021-05-01/backups/id_backup_test.go +++ b/resource-manager/mysql/2021-05-01/backups/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.BackupName != "backupName" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", BackupName: "bAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/backups/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/backups/id_flexibleserver.go index d1f503cc0a8..cf29629de53 100644 --- a/resource-manager/mysql/2021-05-01/backups/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/backups/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/backups/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/backups/id_flexibleserver_test.go index c4d120fbab7..688cf6fe2d1 100644 --- a/resource-manager/mysql/2021-05-01/backups/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/backups/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/configurations/README.md b/resource-manager/mysql/2021-05-01/configurations/README.md index aa8f1f89ed3..c063fd6394b 100644 --- a/resource-manager/mysql/2021-05-01/configurations/README.md +++ b/resource-manager/mysql/2021-05-01/configurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := configurations.ConfigurationListForBatchUpdate{ // ... @@ -46,7 +46,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") read, err := client.Get(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -79,7 +79,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... diff --git a/resource-manager/mysql/2021-05-01/configurations/id_configuration.go b/resource-manager/mysql/2021-05-01/configurations/id_configuration.go index 8441d67c7d2..361ec24b535 100644 --- a/resource-manager/mysql/2021-05-01/configurations/id_configuration.go +++ b/resource-manager/mysql/2021-05-01/configurations/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/mysql/2021-05-01/configurations/id_configuration_test.go b/resource-manager/mysql/2021-05-01/configurations/id_configuration_test.go index f6d8dc525ef..8db28cfe455 100644 --- a/resource-manager/mysql/2021-05-01/configurations/id_configuration_test.go +++ b/resource-manager/mysql/2021-05-01/configurations/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/configurations/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/configurations/id_flexibleserver.go index 2fff44f5642..837c7caaa28 100644 --- a/resource-manager/mysql/2021-05-01/configurations/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/configurations/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/configurations/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/configurations/id_flexibleserver_test.go index 983af0ec7e3..dd7caf14178 100644 --- a/resource-manager/mysql/2021-05-01/configurations/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/configurations/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/databases/README.md b/resource-manager/mysql/2021-05-01/databases/README.md index 7720adaffe9..eff4c71222d 100644 --- a/resource-manager/mysql/2021-05-01/databases/README.md +++ b/resource-manager/mysql/2021-05-01/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2021-05-01/databases/id_database.go b/resource-manager/mysql/2021-05-01/databases/id_database.go index d79759ccff2..a200a22a72e 100644 --- a/resource-manager/mysql/2021-05-01/databases/id_database.go +++ b/resource-manager/mysql/2021-05-01/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/mysql/2021-05-01/databases/id_database_test.go b/resource-manager/mysql/2021-05-01/databases/id_database_test.go index be4e1a6478f..e8ec5c23016 100644 --- a/resource-manager/mysql/2021-05-01/databases/id_database_test.go +++ b/resource-manager/mysql/2021-05-01/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/databases/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/databases/id_flexibleserver.go index 9dfa737db7a..faca988d1b4 100644 --- a/resource-manager/mysql/2021-05-01/databases/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/databases/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/databases/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/databases/id_flexibleserver_test.go index 0613193ab4b..53db47a245e 100644 --- a/resource-manager/mysql/2021-05-01/databases/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/databases/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/firewallrules/README.md b/resource-manager/mysql/2021-05-01/firewallrules/README.md index 3ce5d3d8975..0f6f88b4d92 100644 --- a/resource-manager/mysql/2021-05-01/firewallrules/README.md +++ b/resource-manager/mysql/2021-05-01/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") payload := firewallrules.FirewallRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2021-05-01/firewallrules/id_firewallrule.go b/resource-manager/mysql/2021-05-01/firewallrules/id_firewallrule.go index 33457c8f62c..68d8bb47466 100644 --- a/resource-manager/mysql/2021-05-01/firewallrules/id_firewallrule.go +++ b/resource-manager/mysql/2021-05-01/firewallrules/id_firewallrule.go @@ -121,7 +121,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } diff --git a/resource-manager/mysql/2021-05-01/firewallrules/id_firewallrule_test.go b/resource-manager/mysql/2021-05-01/firewallrules/id_firewallrule_test.go index a797d8edfb5..c65e0772d0e 100644 --- a/resource-manager/mysql/2021-05-01/firewallrules/id_firewallrule_test.go +++ b/resource-manager/mysql/2021-05-01/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.FirewallRuleName != "firewallRuleName" { @@ -32,8 +32,8 @@ func TestNewFirewallRuleID(t *testing.T) { } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/firewallrules/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/firewallrules/id_flexibleserver.go index a6099b7c691..a530ac6a6e7 100644 --- a/resource-manager/mysql/2021-05-01/firewallrules/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/firewallrules/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/firewallrules/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/firewallrules/id_flexibleserver_test.go index f6acd3d8d71..f6db78f6aac 100644 --- a/resource-manager/mysql/2021-05-01/firewallrules/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/firewallrules/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/serverfailover/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/serverfailover/id_flexibleserver.go index 31747281562..993540a3f60 100644 --- a/resource-manager/mysql/2021-05-01/serverfailover/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/serverfailover/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/serverfailover/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/serverfailover/id_flexibleserver_test.go index a9e14e19ccf..a178dd8c939 100644 --- a/resource-manager/mysql/2021-05-01/serverfailover/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/serverfailover/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/serverrestart/README.md b/resource-manager/mysql/2021-05-01/serverrestart/README.md index 25cc29c64fa..158f93a3ee0 100644 --- a/resource-manager/mysql/2021-05-01/serverrestart/README.md +++ b/resource-manager/mysql/2021-05-01/serverrestart/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := serverrestart.ServerRestartParameter{ // ... diff --git a/resource-manager/mysql/2021-05-01/serverrestart/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/serverrestart/id_flexibleserver.go index 5a317805c52..0580793487d 100644 --- a/resource-manager/mysql/2021-05-01/serverrestart/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/serverrestart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/serverrestart/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/serverrestart/id_flexibleserver_test.go index 50f0c98bc72..2f7b7940af3 100644 --- a/resource-manager/mysql/2021-05-01/serverrestart/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/serverrestart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/servers/README.md b/resource-manager/mysql/2021-05-01/servers/README.md index 14affbc0106..c84dfbbd1c0 100644 --- a/resource-manager/mysql/2021-05-01/servers/README.md +++ b/resource-manager/mysql/2021-05-01/servers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.Server{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ReplicasListByServer(ctx, id)` can be used to do batched pagination items, err := client.ReplicasListByServerComplete(ctx, id) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.ServerForUpdate{ // ... diff --git a/resource-manager/mysql/2021-05-01/servers/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/servers/id_flexibleserver.go index 39a75b17c44..d5665b483c6 100644 --- a/resource-manager/mysql/2021-05-01/servers/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/servers/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/servers/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/servers/id_flexibleserver_test.go index 6353b8f6f29..3158e0239bf 100644 --- a/resource-manager/mysql/2021-05-01/servers/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/servers/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/serverstart/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/serverstart/id_flexibleserver.go index 5335a9839d6..b060bc64300 100644 --- a/resource-manager/mysql/2021-05-01/serverstart/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/serverstart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/serverstart/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/serverstart/id_flexibleserver_test.go index 2686bad1259..f460d9a8ada 100644 --- a/resource-manager/mysql/2021-05-01/serverstart/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/serverstart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-05-01/serverstop/id_flexibleserver.go b/resource-manager/mysql/2021-05-01/serverstop/id_flexibleserver.go index ef096b1ec1e..765e6c5435f 100644 --- a/resource-manager/mysql/2021-05-01/serverstop/id_flexibleserver.go +++ b/resource-manager/mysql/2021-05-01/serverstop/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-05-01/serverstop/id_flexibleserver_test.go b/resource-manager/mysql/2021-05-01/serverstop/id_flexibleserver_test.go index 9a9e6374c33..9d3e763f884 100644 --- a/resource-manager/mysql/2021-05-01/serverstop/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-05-01/serverstop/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/azureadadministrators/README.md b/resource-manager/mysql/2021-12-01-preview/azureadadministrators/README.md index e8c5438c1f7..57a21d44ec3 100644 --- a/resource-manager/mysql/2021-12-01-preview/azureadadministrators/README.md +++ b/resource-manager/mysql/2021-12-01-preview/azureadadministrators/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := azureadadministrators.AzureADAdministrator{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2021-12-01-preview/azureadadministrators/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/azureadadministrators/id_flexibleserver.go index 685c4b35cc3..8ebbfe35a10 100644 --- a/resource-manager/mysql/2021-12-01-preview/azureadadministrators/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/azureadadministrators/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/azureadadministrators/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/azureadadministrators/id_flexibleserver_test.go index 0a1845d25ab..077829ddba0 100644 --- a/resource-manager/mysql/2021-12-01-preview/azureadadministrators/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/azureadadministrators/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/backups/README.md b/resource-manager/mysql/2021-12-01-preview/backups/README.md index 75800bb5be5..a51df3ce174 100644 --- a/resource-manager/mysql/2021-12-01-preview/backups/README.md +++ b/resource-manager/mysql/2021-12-01-preview/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Put(ctx, id) if err != nil { diff --git a/resource-manager/mysql/2021-12-01-preview/backups/id_backup.go b/resource-manager/mysql/2021-12-01-preview/backups/id_backup.go index 3192cb962bb..faa1058f8a8 100644 --- a/resource-manager/mysql/2021-12-01-preview/backups/id_backup.go +++ b/resource-manager/mysql/2021-12-01-preview/backups/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupName", "backupName"), } diff --git a/resource-manager/mysql/2021-12-01-preview/backups/id_backup_test.go b/resource-manager/mysql/2021-12-01-preview/backups/id_backup_test.go index 5175ea860f4..f008d399c27 100644 --- a/resource-manager/mysql/2021-12-01-preview/backups/id_backup_test.go +++ b/resource-manager/mysql/2021-12-01-preview/backups/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.BackupName != "backupName" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", BackupName: "bAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/backups/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/backups/id_flexibleserver.go index d1f503cc0a8..cf29629de53 100644 --- a/resource-manager/mysql/2021-12-01-preview/backups/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/backups/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/backups/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/backups/id_flexibleserver_test.go index c4d120fbab7..688cf6fe2d1 100644 --- a/resource-manager/mysql/2021-12-01-preview/backups/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/backups/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/configurations/README.md b/resource-manager/mysql/2021-12-01-preview/configurations/README.md index 494b181b140..2a7646f1f28 100644 --- a/resource-manager/mysql/2021-12-01-preview/configurations/README.md +++ b/resource-manager/mysql/2021-12-01-preview/configurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := configurations.ConfigurationListForBatchUpdate{ // ... @@ -46,7 +46,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") read, err := client.Get(ctx, id) if err != nil { @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id, configurations.DefaultListByServerOperationOptions())` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id, configurations.DefaultListByServerOperationOptions()) @@ -96,7 +96,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... diff --git a/resource-manager/mysql/2021-12-01-preview/configurations/id_configuration.go b/resource-manager/mysql/2021-12-01-preview/configurations/id_configuration.go index 8441d67c7d2..361ec24b535 100644 --- a/resource-manager/mysql/2021-12-01-preview/configurations/id_configuration.go +++ b/resource-manager/mysql/2021-12-01-preview/configurations/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/mysql/2021-12-01-preview/configurations/id_configuration_test.go b/resource-manager/mysql/2021-12-01-preview/configurations/id_configuration_test.go index f6d8dc525ef..8db28cfe455 100644 --- a/resource-manager/mysql/2021-12-01-preview/configurations/id_configuration_test.go +++ b/resource-manager/mysql/2021-12-01-preview/configurations/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/configurations/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/configurations/id_flexibleserver.go index 2fff44f5642..837c7caaa28 100644 --- a/resource-manager/mysql/2021-12-01-preview/configurations/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/configurations/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/configurations/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/configurations/id_flexibleserver_test.go index 983af0ec7e3..dd7caf14178 100644 --- a/resource-manager/mysql/2021-12-01-preview/configurations/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/configurations/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/databases/README.md b/resource-manager/mysql/2021-12-01-preview/databases/README.md index 0486e022c54..0b5a67875c5 100644 --- a/resource-manager/mysql/2021-12-01-preview/databases/README.md +++ b/resource-manager/mysql/2021-12-01-preview/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2021-12-01-preview/databases/id_database.go b/resource-manager/mysql/2021-12-01-preview/databases/id_database.go index d79759ccff2..a200a22a72e 100644 --- a/resource-manager/mysql/2021-12-01-preview/databases/id_database.go +++ b/resource-manager/mysql/2021-12-01-preview/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/mysql/2021-12-01-preview/databases/id_database_test.go b/resource-manager/mysql/2021-12-01-preview/databases/id_database_test.go index be4e1a6478f..e8ec5c23016 100644 --- a/resource-manager/mysql/2021-12-01-preview/databases/id_database_test.go +++ b/resource-manager/mysql/2021-12-01-preview/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/databases/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/databases/id_flexibleserver.go index 9dfa737db7a..faca988d1b4 100644 --- a/resource-manager/mysql/2021-12-01-preview/databases/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/databases/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/databases/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/databases/id_flexibleserver_test.go index 0613193ab4b..53db47a245e 100644 --- a/resource-manager/mysql/2021-12-01-preview/databases/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/databases/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/firewallrules/README.md b/resource-manager/mysql/2021-12-01-preview/firewallrules/README.md index b5506c9f394..f40e0084c24 100644 --- a/resource-manager/mysql/2021-12-01-preview/firewallrules/README.md +++ b/resource-manager/mysql/2021-12-01-preview/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") payload := firewallrules.FirewallRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2021-12-01-preview/firewallrules/id_firewallrule.go b/resource-manager/mysql/2021-12-01-preview/firewallrules/id_firewallrule.go index 33457c8f62c..68d8bb47466 100644 --- a/resource-manager/mysql/2021-12-01-preview/firewallrules/id_firewallrule.go +++ b/resource-manager/mysql/2021-12-01-preview/firewallrules/id_firewallrule.go @@ -121,7 +121,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } diff --git a/resource-manager/mysql/2021-12-01-preview/firewallrules/id_firewallrule_test.go b/resource-manager/mysql/2021-12-01-preview/firewallrules/id_firewallrule_test.go index a797d8edfb5..c65e0772d0e 100644 --- a/resource-manager/mysql/2021-12-01-preview/firewallrules/id_firewallrule_test.go +++ b/resource-manager/mysql/2021-12-01-preview/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.FirewallRuleName != "firewallRuleName" { @@ -32,8 +32,8 @@ func TestNewFirewallRuleID(t *testing.T) { } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/firewallrules/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/firewallrules/id_flexibleserver.go index a6099b7c691..a530ac6a6e7 100644 --- a/resource-manager/mysql/2021-12-01-preview/firewallrules/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/firewallrules/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/firewallrules/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/firewallrules/id_flexibleserver_test.go index f6acd3d8d71..f6db78f6aac 100644 --- a/resource-manager/mysql/2021-12-01-preview/firewallrules/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/firewallrules/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/logfiles/README.md b/resource-manager/mysql/2021-12-01-preview/logfiles/README.md index cf2022174ba..61e3e0c882e 100644 --- a/resource-manager/mysql/2021-12-01-preview/logfiles/README.md +++ b/resource-manager/mysql/2021-12-01-preview/logfiles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := logfiles.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := logfiles.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2021-12-01-preview/logfiles/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/logfiles/id_flexibleserver.go index 2a25635c95a..d31d42785b1 100644 --- a/resource-manager/mysql/2021-12-01-preview/logfiles/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/logfiles/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/logfiles/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/logfiles/id_flexibleserver_test.go index fa679d026c4..c95eaa58fc5 100644 --- a/resource-manager/mysql/2021-12-01-preview/logfiles/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/logfiles/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/serverfailover/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/serverfailover/id_flexibleserver.go index 31747281562..993540a3f60 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverfailover/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/serverfailover/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/serverfailover/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/serverfailover/id_flexibleserver_test.go index a9e14e19ccf..a178dd8c939 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverfailover/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/serverfailover/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/serverrestart/README.md b/resource-manager/mysql/2021-12-01-preview/serverrestart/README.md index 373f29339da..c5a58ea7b57 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverrestart/README.md +++ b/resource-manager/mysql/2021-12-01-preview/serverrestart/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := serverrestart.ServerRestartParameter{ // ... diff --git a/resource-manager/mysql/2021-12-01-preview/serverrestart/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/serverrestart/id_flexibleserver.go index 5a317805c52..0580793487d 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverrestart/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/serverrestart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/serverrestart/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/serverrestart/id_flexibleserver_test.go index 50f0c98bc72..2f7b7940af3 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverrestart/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/serverrestart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/servers/README.md b/resource-manager/mysql/2021-12-01-preview/servers/README.md index 00f69d8afa7..14a53f3006c 100644 --- a/resource-manager/mysql/2021-12-01-preview/servers/README.md +++ b/resource-manager/mysql/2021-12-01-preview/servers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.Server{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ReplicasListByServer(ctx, id)` can be used to do batched pagination items, err := client.ReplicasListByServerComplete(ctx, id) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.ServerForUpdate{ // ... diff --git a/resource-manager/mysql/2021-12-01-preview/servers/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/servers/id_flexibleserver.go index 39a75b17c44..d5665b483c6 100644 --- a/resource-manager/mysql/2021-12-01-preview/servers/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/servers/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/servers/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/servers/id_flexibleserver_test.go index 6353b8f6f29..3158e0239bf 100644 --- a/resource-manager/mysql/2021-12-01-preview/servers/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/servers/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/serverstart/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/serverstart/id_flexibleserver.go index 5335a9839d6..b060bc64300 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverstart/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/serverstart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/serverstart/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/serverstart/id_flexibleserver_test.go index 2686bad1259..f460d9a8ada 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverstart/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/serverstart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2021-12-01-preview/serverstop/id_flexibleserver.go b/resource-manager/mysql/2021-12-01-preview/serverstop/id_flexibleserver.go index ef096b1ec1e..765e6c5435f 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverstop/id_flexibleserver.go +++ b/resource-manager/mysql/2021-12-01-preview/serverstop/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2021-12-01-preview/serverstop/id_flexibleserver_test.go b/resource-manager/mysql/2021-12-01-preview/serverstop/id_flexibleserver_test.go index 9a9e6374c33..9d3e763f884 100644 --- a/resource-manager/mysql/2021-12-01-preview/serverstop/id_flexibleserver_test.go +++ b/resource-manager/mysql/2021-12-01-preview/serverstop/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/azureadadministrators/README.md b/resource-manager/mysql/2022-01-01/azureadadministrators/README.md index 78cfcc73381..4ce55790929 100644 --- a/resource-manager/mysql/2022-01-01/azureadadministrators/README.md +++ b/resource-manager/mysql/2022-01-01/azureadadministrators/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := azureadadministrators.AzureADAdministrator{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2022-01-01/azureadadministrators/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/azureadadministrators/id_flexibleserver.go index 685c4b35cc3..8ebbfe35a10 100644 --- a/resource-manager/mysql/2022-01-01/azureadadministrators/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/azureadadministrators/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/azureadadministrators/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/azureadadministrators/id_flexibleserver_test.go index 0a1845d25ab..077829ddba0 100644 --- a/resource-manager/mysql/2022-01-01/azureadadministrators/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/azureadadministrators/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/backups/README.md b/resource-manager/mysql/2022-01-01/backups/README.md index a114f1808ba..bde20684900 100644 --- a/resource-manager/mysql/2022-01-01/backups/README.md +++ b/resource-manager/mysql/2022-01-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Put(ctx, id) if err != nil { diff --git a/resource-manager/mysql/2022-01-01/backups/id_backup.go b/resource-manager/mysql/2022-01-01/backups/id_backup.go index 3192cb962bb..faa1058f8a8 100644 --- a/resource-manager/mysql/2022-01-01/backups/id_backup.go +++ b/resource-manager/mysql/2022-01-01/backups/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupName", "backupName"), } diff --git a/resource-manager/mysql/2022-01-01/backups/id_backup_test.go b/resource-manager/mysql/2022-01-01/backups/id_backup_test.go index 5175ea860f4..f008d399c27 100644 --- a/resource-manager/mysql/2022-01-01/backups/id_backup_test.go +++ b/resource-manager/mysql/2022-01-01/backups/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.BackupName != "backupName" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", BackupName: "bAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/backups/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/backups/id_flexibleserver.go index d1f503cc0a8..cf29629de53 100644 --- a/resource-manager/mysql/2022-01-01/backups/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/backups/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/backups/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/backups/id_flexibleserver_test.go index c4d120fbab7..688cf6fe2d1 100644 --- a/resource-manager/mysql/2022-01-01/backups/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/backups/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/configurations/README.md b/resource-manager/mysql/2022-01-01/configurations/README.md index e23e1e28114..5f120d1257c 100644 --- a/resource-manager/mysql/2022-01-01/configurations/README.md +++ b/resource-manager/mysql/2022-01-01/configurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := configurations.ConfigurationListForBatchUpdate{ // ... @@ -46,7 +46,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") read, err := client.Get(ctx, id) if err != nil { @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id, configurations.DefaultListByServerOperationOptions())` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id, configurations.DefaultListByServerOperationOptions()) @@ -96,7 +96,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... diff --git a/resource-manager/mysql/2022-01-01/configurations/id_configuration.go b/resource-manager/mysql/2022-01-01/configurations/id_configuration.go index 8441d67c7d2..361ec24b535 100644 --- a/resource-manager/mysql/2022-01-01/configurations/id_configuration.go +++ b/resource-manager/mysql/2022-01-01/configurations/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/mysql/2022-01-01/configurations/id_configuration_test.go b/resource-manager/mysql/2022-01-01/configurations/id_configuration_test.go index f6d8dc525ef..8db28cfe455 100644 --- a/resource-manager/mysql/2022-01-01/configurations/id_configuration_test.go +++ b/resource-manager/mysql/2022-01-01/configurations/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/configurations/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/configurations/id_flexibleserver.go index 2fff44f5642..837c7caaa28 100644 --- a/resource-manager/mysql/2022-01-01/configurations/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/configurations/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/configurations/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/configurations/id_flexibleserver_test.go index 983af0ec7e3..dd7caf14178 100644 --- a/resource-manager/mysql/2022-01-01/configurations/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/configurations/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/databases/README.md b/resource-manager/mysql/2022-01-01/databases/README.md index b578d1ef93b..c09e800f36b 100644 --- a/resource-manager/mysql/2022-01-01/databases/README.md +++ b/resource-manager/mysql/2022-01-01/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2022-01-01/databases/id_database.go b/resource-manager/mysql/2022-01-01/databases/id_database.go index d79759ccff2..a200a22a72e 100644 --- a/resource-manager/mysql/2022-01-01/databases/id_database.go +++ b/resource-manager/mysql/2022-01-01/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/mysql/2022-01-01/databases/id_database_test.go b/resource-manager/mysql/2022-01-01/databases/id_database_test.go index be4e1a6478f..e8ec5c23016 100644 --- a/resource-manager/mysql/2022-01-01/databases/id_database_test.go +++ b/resource-manager/mysql/2022-01-01/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/databases/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/databases/id_flexibleserver.go index 9dfa737db7a..faca988d1b4 100644 --- a/resource-manager/mysql/2022-01-01/databases/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/databases/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/databases/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/databases/id_flexibleserver_test.go index 0613193ab4b..53db47a245e 100644 --- a/resource-manager/mysql/2022-01-01/databases/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/databases/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/firewallrules/README.md b/resource-manager/mysql/2022-01-01/firewallrules/README.md index e30ea814d90..ed31f4108ed 100644 --- a/resource-manager/mysql/2022-01-01/firewallrules/README.md +++ b/resource-manager/mysql/2022-01-01/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") payload := firewallrules.FirewallRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2022-01-01/firewallrules/id_firewallrule.go b/resource-manager/mysql/2022-01-01/firewallrules/id_firewallrule.go index 33457c8f62c..68d8bb47466 100644 --- a/resource-manager/mysql/2022-01-01/firewallrules/id_firewallrule.go +++ b/resource-manager/mysql/2022-01-01/firewallrules/id_firewallrule.go @@ -121,7 +121,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } diff --git a/resource-manager/mysql/2022-01-01/firewallrules/id_firewallrule_test.go b/resource-manager/mysql/2022-01-01/firewallrules/id_firewallrule_test.go index a797d8edfb5..c65e0772d0e 100644 --- a/resource-manager/mysql/2022-01-01/firewallrules/id_firewallrule_test.go +++ b/resource-manager/mysql/2022-01-01/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.FirewallRuleName != "firewallRuleName" { @@ -32,8 +32,8 @@ func TestNewFirewallRuleID(t *testing.T) { } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/firewallrules/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/firewallrules/id_flexibleserver.go index a6099b7c691..a530ac6a6e7 100644 --- a/resource-manager/mysql/2022-01-01/firewallrules/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/firewallrules/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/firewallrules/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/firewallrules/id_flexibleserver_test.go index f6acd3d8d71..f6db78f6aac 100644 --- a/resource-manager/mysql/2022-01-01/firewallrules/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/firewallrules/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/logfiles/README.md b/resource-manager/mysql/2022-01-01/logfiles/README.md index 3f039896f33..ca63e6b18ba 100644 --- a/resource-manager/mysql/2022-01-01/logfiles/README.md +++ b/resource-manager/mysql/2022-01-01/logfiles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := logfiles.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := logfiles.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2022-01-01/logfiles/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/logfiles/id_flexibleserver.go index 2a25635c95a..d31d42785b1 100644 --- a/resource-manager/mysql/2022-01-01/logfiles/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/logfiles/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/logfiles/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/logfiles/id_flexibleserver_test.go index fa679d026c4..c95eaa58fc5 100644 --- a/resource-manager/mysql/2022-01-01/logfiles/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/logfiles/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/serverfailover/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/serverfailover/id_flexibleserver.go index 31747281562..993540a3f60 100644 --- a/resource-manager/mysql/2022-01-01/serverfailover/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/serverfailover/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/serverfailover/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/serverfailover/id_flexibleserver_test.go index a9e14e19ccf..a178dd8c939 100644 --- a/resource-manager/mysql/2022-01-01/serverfailover/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/serverfailover/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/serverrestart/README.md b/resource-manager/mysql/2022-01-01/serverrestart/README.md index c24f2e9c8f5..7f82a46480a 100644 --- a/resource-manager/mysql/2022-01-01/serverrestart/README.md +++ b/resource-manager/mysql/2022-01-01/serverrestart/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := serverrestart.ServerRestartParameter{ // ... diff --git a/resource-manager/mysql/2022-01-01/serverrestart/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/serverrestart/id_flexibleserver.go index 5a317805c52..0580793487d 100644 --- a/resource-manager/mysql/2022-01-01/serverrestart/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/serverrestart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/serverrestart/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/serverrestart/id_flexibleserver_test.go index 50f0c98bc72..2f7b7940af3 100644 --- a/resource-manager/mysql/2022-01-01/serverrestart/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/serverrestart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/servers/README.md b/resource-manager/mysql/2022-01-01/servers/README.md index a718022b462..236480b5f42 100644 --- a/resource-manager/mysql/2022-01-01/servers/README.md +++ b/resource-manager/mysql/2022-01-01/servers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.Server{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ReplicasListByServer(ctx, id)` can be used to do batched pagination items, err := client.ReplicasListByServerComplete(ctx, id) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.ServerForUpdate{ // ... diff --git a/resource-manager/mysql/2022-01-01/servers/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/servers/id_flexibleserver.go index 39a75b17c44..d5665b483c6 100644 --- a/resource-manager/mysql/2022-01-01/servers/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/servers/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/servers/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/servers/id_flexibleserver_test.go index 6353b8f6f29..3158e0239bf 100644 --- a/resource-manager/mysql/2022-01-01/servers/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/servers/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/serverstart/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/serverstart/id_flexibleserver.go index 5335a9839d6..b060bc64300 100644 --- a/resource-manager/mysql/2022-01-01/serverstart/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/serverstart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/serverstart/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/serverstart/id_flexibleserver_test.go index 2686bad1259..f460d9a8ada 100644 --- a/resource-manager/mysql/2022-01-01/serverstart/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/serverstart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2022-01-01/serverstop/id_flexibleserver.go b/resource-manager/mysql/2022-01-01/serverstop/id_flexibleserver.go index ef096b1ec1e..765e6c5435f 100644 --- a/resource-manager/mysql/2022-01-01/serverstop/id_flexibleserver.go +++ b/resource-manager/mysql/2022-01-01/serverstop/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2022-01-01/serverstop/id_flexibleserver_test.go b/resource-manager/mysql/2022-01-01/serverstop/id_flexibleserver_test.go index 9a9e6374c33..9d3e763f884 100644 --- a/resource-manager/mysql/2022-01-01/serverstop/id_flexibleserver_test.go +++ b/resource-manager/mysql/2022-01-01/serverstop/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/README.md b/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/README.md index 7195347ffc8..b86e3f54f11 100644 --- a/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/README.md +++ b/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := advancedthreatprotectionsettings.AdvancedThreatProtectionForUpdate{ // ... @@ -74,7 +74,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := advancedthreatprotectionsettings.AdvancedThreatProtection{ // ... diff --git a/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/id_flexibleserver.go index b7a83f2f2a4..297e4313c40 100644 --- a/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/id_flexibleserver_test.go index 3db7057482c..85c94774609 100644 --- a/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/advancedthreatprotectionsettings/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/azureadadministrators/README.md b/resource-manager/mysql/2023-12-30/azureadadministrators/README.md index 60f860d576e..8966006a9d4 100644 --- a/resource-manager/mysql/2023-12-30/azureadadministrators/README.md +++ b/resource-manager/mysql/2023-12-30/azureadadministrators/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := azureadadministrators.AzureADAdministrator{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := azureadadministrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2023-12-30/azureadadministrators/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/azureadadministrators/id_flexibleserver.go index 685c4b35cc3..8ebbfe35a10 100644 --- a/resource-manager/mysql/2023-12-30/azureadadministrators/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/azureadadministrators/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/azureadadministrators/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/azureadadministrators/id_flexibleserver_test.go index 0a1845d25ab..077829ddba0 100644 --- a/resource-manager/mysql/2023-12-30/azureadadministrators/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/azureadadministrators/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/backupandexport/README.md b/resource-manager/mysql/2023-12-30/backupandexport/README.md index 9e3da68e8d6..ce1926f2707 100644 --- a/resource-manager/mysql/2023-12-30/backupandexport/README.md +++ b/resource-manager/mysql/2023-12-30/backupandexport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupandexport.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backupandexport.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := backupandexport.BackupAndExportRequest{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backupandexport.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backupandexport.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.ValidateBackup(ctx, id) if err != nil { diff --git a/resource-manager/mysql/2023-12-30/backupandexport/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/backupandexport/id_flexibleserver.go index 88c8d491230..593e5b51902 100644 --- a/resource-manager/mysql/2023-12-30/backupandexport/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/backupandexport/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/backupandexport/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/backupandexport/id_flexibleserver_test.go index c71bd421479..6635c99f30c 100644 --- a/resource-manager/mysql/2023-12-30/backupandexport/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/backupandexport/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/backupandexport/model_backupstoredetails.go b/resource-manager/mysql/2023-12-30/backupandexport/model_backupstoredetails.go index 8523e65b4d4..a0b53ecf6f9 100644 --- a/resource-manager/mysql/2023-12-30/backupandexport/model_backupstoredetails.go +++ b/resource-manager/mysql/2023-12-30/backupandexport/model_backupstoredetails.go @@ -3,6 +3,7 @@ package backupandexport import ( "encoding/json" "fmt" + "strings" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,6 +53,14 @@ func UnmarshalBackupStoreDetailsImplementation(input []byte) (BackupStoreDetails value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "FullBackupStoreDetails") { + var out FullBackupStoreDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FullBackupStoreDetails: %+v", err) + } + return out, nil + } + var parent BaseBackupStoreDetailsImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseBackupStoreDetailsImpl: %+v", err) diff --git a/resource-manager/mysql/2023-12-30/backupandexport/model_fullbackupstoredetails.go b/resource-manager/mysql/2023-12-30/backupandexport/model_fullbackupstoredetails.go new file mode 100644 index 00000000000..fa77f912673 --- /dev/null +++ b/resource-manager/mysql/2023-12-30/backupandexport/model_fullbackupstoredetails.go @@ -0,0 +1,50 @@ +package backupandexport + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ BackupStoreDetails = FullBackupStoreDetails{} + +type FullBackupStoreDetails struct { + SasUriList []string `json:"sasUriList"` + + // Fields inherited from BackupStoreDetails + + ObjectType string `json:"objectType"` +} + +func (s FullBackupStoreDetails) BackupStoreDetails() BaseBackupStoreDetailsImpl { + return BaseBackupStoreDetailsImpl{ + ObjectType: s.ObjectType, + } +} + +var _ json.Marshaler = FullBackupStoreDetails{} + +func (s FullBackupStoreDetails) MarshalJSON() ([]byte, error) { + type wrapper FullBackupStoreDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FullBackupStoreDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FullBackupStoreDetails: %+v", err) + } + + decoded["objectType"] = "FullBackupStoreDetails" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FullBackupStoreDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/mysql/2023-12-30/backups/README.md b/resource-manager/mysql/2023-12-30/backups/README.md index d49b6e99565..1e812cff92d 100644 --- a/resource-manager/mysql/2023-12-30/backups/README.md +++ b/resource-manager/mysql/2023-12-30/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Put(ctx, id) if err != nil { diff --git a/resource-manager/mysql/2023-12-30/backups/id_backup.go b/resource-manager/mysql/2023-12-30/backups/id_backup.go index 3192cb962bb..faa1058f8a8 100644 --- a/resource-manager/mysql/2023-12-30/backups/id_backup.go +++ b/resource-manager/mysql/2023-12-30/backups/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupName", "backupName"), } diff --git a/resource-manager/mysql/2023-12-30/backups/id_backup_test.go b/resource-manager/mysql/2023-12-30/backups/id_backup_test.go index 5175ea860f4..f008d399c27 100644 --- a/resource-manager/mysql/2023-12-30/backups/id_backup_test.go +++ b/resource-manager/mysql/2023-12-30/backups/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.BackupName != "backupName" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", BackupName: "bAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/backups/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/backups/id_flexibleserver.go index d1f503cc0a8..cf29629de53 100644 --- a/resource-manager/mysql/2023-12-30/backups/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/backups/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/backups/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/backups/id_flexibleserver_test.go index c4d120fbab7..688cf6fe2d1 100644 --- a/resource-manager/mysql/2023-12-30/backups/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/backups/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/backupsv2/README.md b/resource-manager/mysql/2023-12-30/backupsv2/README.md index f821267cb65..2e60466b8d8 100644 --- a/resource-manager/mysql/2023-12-30/backupsv2/README.md +++ b/resource-manager/mysql/2023-12-30/backupsv2/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupsv2.NewBackupsV2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backupsv2.NewBackupsV2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupsV2Name") payload := backupsv2.ServerBackupV2{ // ... @@ -41,7 +41,7 @@ if err := client.LongRunningBackupCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backupsv2.NewBackupsV2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backupsv2.NewBackupsV2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupsV2Name") read, err := client.LongRunningBackupsGet(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backupsv2.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backupsv2.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.LongRunningBackupsList(ctx, id)` can be used to do batched pagination items, err := client.LongRunningBackupsListComplete(ctx, id) diff --git a/resource-manager/mysql/2023-12-30/backupsv2/id_backupsv2.go b/resource-manager/mysql/2023-12-30/backupsv2/id_backupsv2.go index 58cc04a65ad..e50e063e140 100644 --- a/resource-manager/mysql/2023-12-30/backupsv2/id_backupsv2.go +++ b/resource-manager/mysql/2023-12-30/backupsv2/id_backupsv2.go @@ -121,9 +121,9 @@ func (id BackupsV2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticBackupsV2", "backupsV2", "backupsV2"), - resourceids.UserSpecifiedSegment("backupsV2Name", "backupName"), + resourceids.UserSpecifiedSegment("backupsV2Name", "backupsV2Name"), } } diff --git a/resource-manager/mysql/2023-12-30/backupsv2/id_backupsv2_test.go b/resource-manager/mysql/2023-12-30/backupsv2/id_backupsv2_test.go index 595503ad3d0..6de06710ede 100644 --- a/resource-manager/mysql/2023-12-30/backupsv2/id_backupsv2_test.go +++ b/resource-manager/mysql/2023-12-30/backupsv2/id_backupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupsV2Id{} func TestNewBackupsV2ID(t *testing.T) { - id := NewBackupsV2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") + id := NewBackupsV2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupsV2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewBackupsV2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } - if id.BackupsV2Name != "backupName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupsV2Name'", id.BackupsV2Name, "backupName") + if id.BackupsV2Name != "backupsV2Name" { + t.Fatalf("Expected %q but got %q for Segment 'BackupsV2Name'", id.BackupsV2Name, "backupsV2Name") } } func TestFormatBackupsV2ID(t *testing.T) { - actual := NewBackupsV2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backupsV2/backupName" + actual := NewBackupsV2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupsV2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backupsV2/backupsV2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupsV2ID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backupsV2", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backupsV2", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backupsV2/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backupsV2/backupsV2Name", Expected: &BackupsV2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", - BackupsV2Name: "backupName", + FlexibleServerName: "flexibleServerName", + BackupsV2Name: "backupsV2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backupsV2/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backupsV2/backupsV2Name/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupsV2IDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backupsV2", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backupsV2", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPsV2", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPsV2", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backupsV2/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backupsV2/backupsV2Name", Expected: &BackupsV2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", - BackupsV2Name: "backupName", + FlexibleServerName: "flexibleServerName", + BackupsV2Name: "backupsV2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/backupsV2/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/backupsV2/backupsV2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPsV2/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPsV2/bAcKuPsV2NaMe", Expected: &BackupsV2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", - BackupsV2Name: "bAcKuPnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", + BackupsV2Name: "bAcKuPsV2NaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPsV2/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPsV2/bAcKuPsV2NaMe/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/backupsv2/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/backupsv2/id_flexibleserver.go index ec6f017289a..9c1e371a991 100644 --- a/resource-manager/mysql/2023-12-30/backupsv2/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/backupsv2/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/backupsv2/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/backupsv2/id_flexibleserver_test.go index cd29511e24b..01d7e659470 100644 --- a/resource-manager/mysql/2023-12-30/backupsv2/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/backupsv2/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/configurations/README.md b/resource-manager/mysql/2023-12-30/configurations/README.md index 1a1697536a9..e07b3ad20b1 100644 --- a/resource-manager/mysql/2023-12-30/configurations/README.md +++ b/resource-manager/mysql/2023-12-30/configurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := configurations.ConfigurationListForBatchUpdate{ // ... @@ -46,7 +46,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") read, err := client.Get(ctx, id) if err != nil { @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id, configurations.DefaultListByServerOperationOptions())` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id, configurations.DefaultListByServerOperationOptions()) @@ -96,7 +96,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... diff --git a/resource-manager/mysql/2023-12-30/configurations/id_configuration.go b/resource-manager/mysql/2023-12-30/configurations/id_configuration.go index 8441d67c7d2..361ec24b535 100644 --- a/resource-manager/mysql/2023-12-30/configurations/id_configuration.go +++ b/resource-manager/mysql/2023-12-30/configurations/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/mysql/2023-12-30/configurations/id_configuration_test.go b/resource-manager/mysql/2023-12-30/configurations/id_configuration_test.go index f6d8dc525ef..8db28cfe455 100644 --- a/resource-manager/mysql/2023-12-30/configurations/id_configuration_test.go +++ b/resource-manager/mysql/2023-12-30/configurations/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/configurations/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/configurations/id_flexibleserver.go index 2fff44f5642..837c7caaa28 100644 --- a/resource-manager/mysql/2023-12-30/configurations/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/configurations/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/configurations/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/configurations/id_flexibleserver_test.go index 983af0ec7e3..dd7caf14178 100644 --- a/resource-manager/mysql/2023-12-30/configurations/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/configurations/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/databases/README.md b/resource-manager/mysql/2023-12-30/databases/README.md index 44242c1b42a..2e5068bf3ea 100644 --- a/resource-manager/mysql/2023-12-30/databases/README.md +++ b/resource-manager/mysql/2023-12-30/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2023-12-30/databases/id_database.go b/resource-manager/mysql/2023-12-30/databases/id_database.go index d79759ccff2..a200a22a72e 100644 --- a/resource-manager/mysql/2023-12-30/databases/id_database.go +++ b/resource-manager/mysql/2023-12-30/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/mysql/2023-12-30/databases/id_database_test.go b/resource-manager/mysql/2023-12-30/databases/id_database_test.go index be4e1a6478f..e8ec5c23016 100644 --- a/resource-manager/mysql/2023-12-30/databases/id_database_test.go +++ b/resource-manager/mysql/2023-12-30/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/databases/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/databases/id_flexibleserver.go index 9dfa737db7a..faca988d1b4 100644 --- a/resource-manager/mysql/2023-12-30/databases/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/databases/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/databases/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/databases/id_flexibleserver_test.go index 0613193ab4b..53db47a245e 100644 --- a/resource-manager/mysql/2023-12-30/databases/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/databases/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/firewallrules/README.md b/resource-manager/mysql/2023-12-30/firewallrules/README.md index 9667a6fea73..f7cb0f81568 100644 --- a/resource-manager/mysql/2023-12-30/firewallrules/README.md +++ b/resource-manager/mysql/2023-12-30/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") payload := firewallrules.FirewallRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2023-12-30/firewallrules/id_firewallrule.go b/resource-manager/mysql/2023-12-30/firewallrules/id_firewallrule.go index 33457c8f62c..68d8bb47466 100644 --- a/resource-manager/mysql/2023-12-30/firewallrules/id_firewallrule.go +++ b/resource-manager/mysql/2023-12-30/firewallrules/id_firewallrule.go @@ -121,7 +121,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } diff --git a/resource-manager/mysql/2023-12-30/firewallrules/id_firewallrule_test.go b/resource-manager/mysql/2023-12-30/firewallrules/id_firewallrule_test.go index a797d8edfb5..c65e0772d0e 100644 --- a/resource-manager/mysql/2023-12-30/firewallrules/id_firewallrule_test.go +++ b/resource-manager/mysql/2023-12-30/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.FirewallRuleName != "firewallRuleName" { @@ -32,8 +32,8 @@ func TestNewFirewallRuleID(t *testing.T) { } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/firewallrules/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/firewallrules/id_flexibleserver.go index a6099b7c691..a530ac6a6e7 100644 --- a/resource-manager/mysql/2023-12-30/firewallrules/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/firewallrules/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/firewallrules/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/firewallrules/id_flexibleserver_test.go index f6acd3d8d71..f6db78f6aac 100644 --- a/resource-manager/mysql/2023-12-30/firewallrules/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/firewallrules/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/logfiles/README.md b/resource-manager/mysql/2023-12-30/logfiles/README.md index 638f1c570aa..61382d47f89 100644 --- a/resource-manager/mysql/2023-12-30/logfiles/README.md +++ b/resource-manager/mysql/2023-12-30/logfiles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := logfiles.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := logfiles.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/mysql/2023-12-30/logfiles/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/logfiles/id_flexibleserver.go index 2a25635c95a..d31d42785b1 100644 --- a/resource-manager/mysql/2023-12-30/logfiles/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/logfiles/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/logfiles/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/logfiles/id_flexibleserver_test.go index fa679d026c4..c95eaa58fc5 100644 --- a/resource-manager/mysql/2023-12-30/logfiles/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/logfiles/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/maintenances/README.md b/resource-manager/mysql/2023-12-30/maintenances/README.md index 95bc5a4bc50..b68e36f7b70 100644 --- a/resource-manager/mysql/2023-12-30/maintenances/README.md +++ b/resource-manager/mysql/2023-12-30/maintenances/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := maintenances.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := maintenances.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := maintenances.NewMaintenanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "maintenanceName") +id := maintenances.NewMaintenanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "maintenanceName") read, err := client.Read(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := maintenances.NewMaintenanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "maintenanceName") +id := maintenances.NewMaintenanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "maintenanceName") payload := maintenances.MaintenanceUpdate{ // ... diff --git a/resource-manager/mysql/2023-12-30/maintenances/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/maintenances/id_flexibleserver.go index ab4c09d4e37..ef2adbe3118 100644 --- a/resource-manager/mysql/2023-12-30/maintenances/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/maintenances/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/maintenances/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/maintenances/id_flexibleserver_test.go index 9615b29cb0e..f4383b46dfc 100644 --- a/resource-manager/mysql/2023-12-30/maintenances/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/maintenances/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/maintenances/id_maintenance.go b/resource-manager/mysql/2023-12-30/maintenances/id_maintenance.go index d551fee5fe9..0d3dd77afc8 100644 --- a/resource-manager/mysql/2023-12-30/maintenances/id_maintenance.go +++ b/resource-manager/mysql/2023-12-30/maintenances/id_maintenance.go @@ -121,7 +121,7 @@ func (id MaintenanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticMaintenances", "maintenances", "maintenances"), resourceids.UserSpecifiedSegment("maintenanceName", "maintenanceName"), } diff --git a/resource-manager/mysql/2023-12-30/maintenances/id_maintenance_test.go b/resource-manager/mysql/2023-12-30/maintenances/id_maintenance_test.go index 557f87370dd..dbcf27ac46c 100644 --- a/resource-manager/mysql/2023-12-30/maintenances/id_maintenance_test.go +++ b/resource-manager/mysql/2023-12-30/maintenances/id_maintenance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MaintenanceId{} func TestNewMaintenanceID(t *testing.T) { - id := NewMaintenanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "maintenanceName") + id := NewMaintenanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "maintenanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMaintenanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.MaintenanceName != "maintenanceName" { @@ -32,8 +32,8 @@ func TestNewMaintenanceID(t *testing.T) { } func TestFormatMaintenanceID(t *testing.T) { - actual := NewMaintenanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "maintenanceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/maintenances/maintenanceName" + actual := NewMaintenanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "maintenanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/maintenances/maintenanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMaintenanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/maintenances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/maintenances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/maintenances/maintenanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/maintenances/maintenanceName", Expected: &MaintenanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", MaintenanceName: "maintenanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/maintenances/maintenanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/maintenances/maintenanceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMaintenanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/maintenances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/maintenances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/mAiNtEnAnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/mAiNtEnAnCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/maintenances/maintenanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/maintenances/maintenanceName", Expected: &MaintenanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", MaintenanceName: "maintenanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/maintenances/maintenanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/maintenances/maintenanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/mAiNtEnAnCeS/mAiNtEnAnCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/mAiNtEnAnCeS/mAiNtEnAnCeNaMe", Expected: &MaintenanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", MaintenanceName: "mAiNtEnAnCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/mAiNtEnAnCeS/mAiNtEnAnCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/mAiNtEnAnCeS/mAiNtEnAnCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/operationprogress/model_backupandexportresponsetype.go b/resource-manager/mysql/2023-12-30/operationprogress/model_backupandexportresponsetype.go new file mode 100644 index 00000000000..5516c74b03c --- /dev/null +++ b/resource-manager/mysql/2023-12-30/operationprogress/model_backupandexportresponsetype.go @@ -0,0 +1,52 @@ +package operationprogress + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ OperationProgressResponseType = BackupAndExportResponseType{} + +type BackupAndExportResponseType struct { + BackupMetadata *string `json:"backupMetadata,omitempty"` + DataTransferredInBytes *int64 `json:"dataTransferredInBytes,omitempty"` + DatasourceSizeInBytes *int64 `json:"datasourceSizeInBytes,omitempty"` + + // Fields inherited from OperationProgressResponseType + + ObjectType ObjectType `json:"objectType"` +} + +func (s BackupAndExportResponseType) OperationProgressResponseType() BaseOperationProgressResponseTypeImpl { + return BaseOperationProgressResponseTypeImpl{ + ObjectType: s.ObjectType, + } +} + +var _ json.Marshaler = BackupAndExportResponseType{} + +func (s BackupAndExportResponseType) MarshalJSON() ([]byte, error) { + type wrapper BackupAndExportResponseType + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling BackupAndExportResponseType: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling BackupAndExportResponseType: %+v", err) + } + + decoded["objectType"] = "BackupAndExportResponse" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling BackupAndExportResponseType: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/mysql/2023-12-30/operationprogress/model_importfromstorageresponsetype.go b/resource-manager/mysql/2023-12-30/operationprogress/model_importfromstorageresponsetype.go new file mode 100644 index 00000000000..c5030525131 --- /dev/null +++ b/resource-manager/mysql/2023-12-30/operationprogress/model_importfromstorageresponsetype.go @@ -0,0 +1,50 @@ +package operationprogress + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ OperationProgressResponseType = ImportFromStorageResponseType{} + +type ImportFromStorageResponseType struct { + EstimatedCompletionTime *string `json:"estimatedCompletionTime,omitempty"` + + // Fields inherited from OperationProgressResponseType + + ObjectType ObjectType `json:"objectType"` +} + +func (s ImportFromStorageResponseType) OperationProgressResponseType() BaseOperationProgressResponseTypeImpl { + return BaseOperationProgressResponseTypeImpl{ + ObjectType: s.ObjectType, + } +} + +var _ json.Marshaler = ImportFromStorageResponseType{} + +func (s ImportFromStorageResponseType) MarshalJSON() ([]byte, error) { + type wrapper ImportFromStorageResponseType + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ImportFromStorageResponseType: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ImportFromStorageResponseType: %+v", err) + } + + decoded["objectType"] = "ImportFromStorageResponse" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ImportFromStorageResponseType: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/mysql/2023-12-30/operationprogress/model_operationprogressresponsetype.go b/resource-manager/mysql/2023-12-30/operationprogress/model_operationprogressresponsetype.go index b4807e9706f..b13d561439f 100644 --- a/resource-manager/mysql/2023-12-30/operationprogress/model_operationprogressresponsetype.go +++ b/resource-manager/mysql/2023-12-30/operationprogress/model_operationprogressresponsetype.go @@ -1,8 +1,83 @@ package operationprogress +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type OperationProgressResponseType struct { +type OperationProgressResponseType interface { + OperationProgressResponseType() BaseOperationProgressResponseTypeImpl +} + +var _ OperationProgressResponseType = BaseOperationProgressResponseTypeImpl{} + +type BaseOperationProgressResponseTypeImpl struct { ObjectType ObjectType `json:"objectType"` } + +func (s BaseOperationProgressResponseTypeImpl) OperationProgressResponseType() BaseOperationProgressResponseTypeImpl { + return s +} + +var _ OperationProgressResponseType = RawOperationProgressResponseTypeImpl{} + +// RawOperationProgressResponseTypeImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawOperationProgressResponseTypeImpl struct { + operationProgressResponseType BaseOperationProgressResponseTypeImpl + Type string + Values map[string]interface{} +} + +func (s RawOperationProgressResponseTypeImpl) OperationProgressResponseType() BaseOperationProgressResponseTypeImpl { + return s.operationProgressResponseType +} + +func UnmarshalOperationProgressResponseTypeImplementation(input []byte) (OperationProgressResponseType, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling OperationProgressResponseType into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["objectType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "BackupAndExportResponse") { + var out BackupAndExportResponseType + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into BackupAndExportResponseType: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ImportFromStorageResponse") { + var out ImportFromStorageResponseType + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ImportFromStorageResponseType: %+v", err) + } + return out, nil + } + + var parent BaseOperationProgressResponseTypeImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseOperationProgressResponseTypeImpl: %+v", err) + } + + return RawOperationProgressResponseTypeImpl{ + operationProgressResponseType: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/mysql/2023-12-30/operationprogress/model_operationprogressresult.go b/resource-manager/mysql/2023-12-30/operationprogress/model_operationprogressresult.go index a6d84293081..7ced0bd73bd 100644 --- a/resource-manager/mysql/2023-12-30/operationprogress/model_operationprogressresult.go +++ b/resource-manager/mysql/2023-12-30/operationprogress/model_operationprogressresult.go @@ -1,6 +1,8 @@ package operationprogress import ( + "encoding/json" + "fmt" "time" "github.com/hashicorp/go-azure-helpers/lang/dates" @@ -10,16 +12,16 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type OperationProgressResult struct { - EndTime *string `json:"endTime,omitempty"` - Error *ErrorDetail `json:"error,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Operations *[]OperationStatusResult `json:"operations,omitempty"` - PercentComplete *float64 `json:"percentComplete,omitempty"` - Properties *OperationProgressResponseType `json:"properties,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status string `json:"status"` + EndTime *string `json:"endTime,omitempty"` + Error *ErrorDetail `json:"error,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Operations *[]OperationStatusResult `json:"operations,omitempty"` + PercentComplete *float64 `json:"percentComplete,omitempty"` + Properties OperationProgressResponseType `json:"properties"` + ResourceId *string `json:"resourceId,omitempty"` + StartTime *string `json:"startTime,omitempty"` + Status string `json:"status"` } func (o *OperationProgressResult) GetEndTimeAsTime() (*time.Time, error) { @@ -45,3 +47,47 @@ func (o *OperationProgressResult) SetStartTimeAsTime(input time.Time) { formatted := input.Format("2006-01-02T15:04:05Z07:00") o.StartTime = &formatted } + +var _ json.Unmarshaler = &OperationProgressResult{} + +func (s *OperationProgressResult) UnmarshalJSON(bytes []byte) error { + var decoded struct { + EndTime *string `json:"endTime,omitempty"` + Error *ErrorDetail `json:"error,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Operations *[]OperationStatusResult `json:"operations,omitempty"` + PercentComplete *float64 `json:"percentComplete,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + StartTime *string `json:"startTime,omitempty"` + Status string `json:"status"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.EndTime = decoded.EndTime + s.Error = decoded.Error + s.Id = decoded.Id + s.Name = decoded.Name + s.Operations = decoded.Operations + s.PercentComplete = decoded.PercentComplete + s.ResourceId = decoded.ResourceId + s.StartTime = decoded.StartTime + s.Status = decoded.Status + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling OperationProgressResult into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalOperationProgressResponseTypeImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'OperationProgressResult': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/resource-manager/mysql/2023-12-30/serverfailover/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/serverfailover/id_flexibleserver.go index 31747281562..993540a3f60 100644 --- a/resource-manager/mysql/2023-12-30/serverfailover/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/serverfailover/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/serverfailover/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/serverfailover/id_flexibleserver_test.go index a9e14e19ccf..a178dd8c939 100644 --- a/resource-manager/mysql/2023-12-30/serverfailover/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/serverfailover/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/servermigration/README.md b/resource-manager/mysql/2023-12-30/servermigration/README.md index db657be209c..830493a827f 100644 --- a/resource-manager/mysql/2023-12-30/servermigration/README.md +++ b/resource-manager/mysql/2023-12-30/servermigration/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servermigration.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servermigration.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.ServersMigrationCutoverMigrationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/mysql/2023-12-30/servermigration/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/servermigration/id_flexibleserver.go index 126a9bf94f3..f104ff96c6f 100644 --- a/resource-manager/mysql/2023-12-30/servermigration/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/servermigration/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/servermigration/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/servermigration/id_flexibleserver_test.go index 285aee1d8b1..1619333e8bd 100644 --- a/resource-manager/mysql/2023-12-30/servermigration/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/servermigration/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/servermigration/model_importsourceproperties.go b/resource-manager/mysql/2023-12-30/servermigration/model_importsourceproperties.go index 2a0063d5455..ad49643c4ec 100644 --- a/resource-manager/mysql/2023-12-30/servermigration/model_importsourceproperties.go +++ b/resource-manager/mysql/2023-12-30/servermigration/model_importsourceproperties.go @@ -7,5 +7,5 @@ type ImportSourceProperties struct { DataDirPath *string `json:"dataDirPath,omitempty"` SasToken *string `json:"sasToken,omitempty"` StorageType *ImportSourceStorageType `json:"storageType,omitempty"` - StorageUrl *string `json:"storageUrl,omitempty"` + StorageURL *string `json:"storageUrl,omitempty"` } diff --git a/resource-manager/mysql/2023-12-30/serverresetgtid/README.md b/resource-manager/mysql/2023-12-30/serverresetgtid/README.md index 9d4dd42c4dc..8405dcdb32a 100644 --- a/resource-manager/mysql/2023-12-30/serverresetgtid/README.md +++ b/resource-manager/mysql/2023-12-30/serverresetgtid/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverresetgtid.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := serverresetgtid.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := serverresetgtid.ServerGtidSetParameter{ // ... diff --git a/resource-manager/mysql/2023-12-30/serverresetgtid/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/serverresetgtid/id_flexibleserver.go index d94b553d1f7..eb008ff9207 100644 --- a/resource-manager/mysql/2023-12-30/serverresetgtid/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/serverresetgtid/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/serverresetgtid/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/serverresetgtid/id_flexibleserver_test.go index 2e94a1926ba..d940edc21af 100644 --- a/resource-manager/mysql/2023-12-30/serverresetgtid/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/serverresetgtid/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/serverrestart/README.md b/resource-manager/mysql/2023-12-30/serverrestart/README.md index b60e37d0e85..e78ab1e1db7 100644 --- a/resource-manager/mysql/2023-12-30/serverrestart/README.md +++ b/resource-manager/mysql/2023-12-30/serverrestart/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := serverrestart.ServerRestartParameter{ // ... diff --git a/resource-manager/mysql/2023-12-30/serverrestart/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/serverrestart/id_flexibleserver.go index 5a317805c52..0580793487d 100644 --- a/resource-manager/mysql/2023-12-30/serverrestart/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/serverrestart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/serverrestart/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/serverrestart/id_flexibleserver_test.go index 50f0c98bc72..2f7b7940af3 100644 --- a/resource-manager/mysql/2023-12-30/serverrestart/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/serverrestart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/servers/README.md b/resource-manager/mysql/2023-12-30/servers/README.md index 190c7b62bf7..eb881cff0eb 100644 --- a/resource-manager/mysql/2023-12-30/servers/README.md +++ b/resource-manager/mysql/2023-12-30/servers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.Server{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ReplicasListByServer(ctx, id)` can be used to do batched pagination items, err := client.ReplicasListByServerComplete(ctx, id) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.ServerForUpdate{ // ... diff --git a/resource-manager/mysql/2023-12-30/servers/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/servers/id_flexibleserver.go index 39a75b17c44..d5665b483c6 100644 --- a/resource-manager/mysql/2023-12-30/servers/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/servers/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/servers/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/servers/id_flexibleserver_test.go index 6353b8f6f29..3158e0239bf 100644 --- a/resource-manager/mysql/2023-12-30/servers/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/servers/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/servers/model_importsourceproperties.go b/resource-manager/mysql/2023-12-30/servers/model_importsourceproperties.go index 21d53830c28..69269b6707f 100644 --- a/resource-manager/mysql/2023-12-30/servers/model_importsourceproperties.go +++ b/resource-manager/mysql/2023-12-30/servers/model_importsourceproperties.go @@ -7,5 +7,5 @@ type ImportSourceProperties struct { DataDirPath *string `json:"dataDirPath,omitempty"` SasToken *string `json:"sasToken,omitempty"` StorageType *ImportSourceStorageType `json:"storageType,omitempty"` - StorageUrl *string `json:"storageUrl,omitempty"` + StorageURL *string `json:"storageUrl,omitempty"` } diff --git a/resource-manager/mysql/2023-12-30/serverstart/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/serverstart/id_flexibleserver.go index 5335a9839d6..b060bc64300 100644 --- a/resource-manager/mysql/2023-12-30/serverstart/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/serverstart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/serverstart/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/serverstart/id_flexibleserver_test.go index 2686bad1259..f460d9a8ada 100644 --- a/resource-manager/mysql/2023-12-30/serverstart/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/serverstart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/serverstop/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/serverstop/id_flexibleserver.go index ef096b1ec1e..765e6c5435f 100644 --- a/resource-manager/mysql/2023-12-30/serverstop/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/serverstop/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/serverstop/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/serverstop/id_flexibleserver_test.go index 9a9e6374c33..9d3e763f884 100644 --- a/resource-manager/mysql/2023-12-30/serverstop/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/serverstop/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/README.md b/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/README.md index a317775aba9..b73dcb83a3e 100644 --- a/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/README.md +++ b/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servervalidateestimatehighavailability.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servervalidateestimatehighavailability.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servervalidateestimatehighavailability.HighAvailabilityValidationEstimation{ // ... diff --git a/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/id_flexibleserver.go b/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/id_flexibleserver.go index 1095da6cf81..5a04720a124 100644 --- a/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/id_flexibleserver.go +++ b/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforMySQL", "Microsoft.DBforMySQL", "Microsoft.DBforMySQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/id_flexibleserver_test.go b/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/id_flexibleserver_test.go index 361bde79aeb..26dda0e2a7c 100644 --- a/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/id_flexibleserver_test.go +++ b/resource-manager/mysql/2023-12-30/servervalidateestimatehighavailability/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforMySQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrMySqL/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/backuppolicy/README.md b/resource-manager/netapp/2023-05-01/backuppolicy/README.md index 45b93be3d05..cd680045cb8 100644 --- a/resource-manager/netapp/2023-05-01/backuppolicy/README.md +++ b/resource-manager/netapp/2023-05-01/backuppolicy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") payload := backuppolicy.BackupPolicy{ // ... @@ -41,7 +41,7 @@ if err := client.BackupPoliciesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") read, err := client.BackupPoliciesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.BackupPoliciesList(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") payload := backuppolicy.BackupPolicyPatch{ // ... diff --git a/resource-manager/netapp/2023-05-01/backuppolicy/id_backuppolicy.go b/resource-manager/netapp/2023-05-01/backuppolicy/id_backuppolicy.go index 20a4fb7fa7d..7e2cd95f210 100644 --- a/resource-manager/netapp/2023-05-01/backuppolicy/id_backuppolicy.go +++ b/resource-manager/netapp/2023-05-01/backuppolicy/id_backuppolicy.go @@ -121,7 +121,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } diff --git a/resource-manager/netapp/2023-05-01/backuppolicy/id_backuppolicy_test.go b/resource-manager/netapp/2023-05-01/backuppolicy/id_backuppolicy_test.go index 8fc9ee76db7..39877320168 100644 --- a/resource-manager/netapp/2023-05-01/backuppolicy/id_backuppolicy_test.go +++ b/resource-manager/netapp/2023-05-01/backuppolicy/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupPolicyName != "backupPolicyName" { @@ -32,8 +32,8 @@ func TestNewBackupPolicyID(t *testing.T) { } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/backuppolicy/id_netappaccount.go b/resource-manager/netapp/2023-05-01/backuppolicy/id_netappaccount.go index 171fea3e381..b10e89e1ad1 100644 --- a/resource-manager/netapp/2023-05-01/backuppolicy/id_netappaccount.go +++ b/resource-manager/netapp/2023-05-01/backuppolicy/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-05-01/backuppolicy/id_netappaccount_test.go b/resource-manager/netapp/2023-05-01/backuppolicy/id_netappaccount_test.go index 39611256a73..455b109bb39 100644 --- a/resource-manager/netapp/2023-05-01/backuppolicy/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-05-01/backuppolicy/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/capacitypools/README.md b/resource-manager/netapp/2023-05-01/capacitypools/README.md index 11b7945e9ed..e6cf8336b62 100644 --- a/resource-manager/netapp/2023-05-01/capacitypools/README.md +++ b/resource-manager/netapp/2023-05-01/capacitypools/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") payload := capacitypools.CapacityPool{ // ... @@ -41,7 +41,7 @@ if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") read, err := client.PoolsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") // alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination items, err := client.PoolsListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") payload := capacitypools.CapacityPoolPatch{ // ... diff --git a/resource-manager/netapp/2023-05-01/capacitypools/id_capacitypool.go b/resource-manager/netapp/2023-05-01/capacitypools/id_capacitypool.go index 5f54bf96057..0e041090dd4 100644 --- a/resource-manager/netapp/2023-05-01/capacitypools/id_capacitypool.go +++ b/resource-manager/netapp/2023-05-01/capacitypools/id_capacitypool.go @@ -121,9 +121,9 @@ func (id CapacityPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), } } diff --git a/resource-manager/netapp/2023-05-01/capacitypools/id_capacitypool_test.go b/resource-manager/netapp/2023-05-01/capacitypools/id_capacitypool_test.go index e19faa4852d..6bfc38a792d 100644 --- a/resource-manager/netapp/2023-05-01/capacitypools/id_capacitypool_test.go +++ b/resource-manager/netapp/2023-05-01/capacitypools/id_capacitypool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityPoolId{} func TestNewCapacityPoolID(t *testing.T) { - id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCapacityPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } } func TestFormatCapacityPoolID(t *testing.T) { - actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName" + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCapacityPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCapacityPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/capacitypools/id_netappaccount.go b/resource-manager/netapp/2023-05-01/capacitypools/id_netappaccount.go index 0a3b033027e..58a09e2952e 100644 --- a/resource-manager/netapp/2023-05-01/capacitypools/id_netappaccount.go +++ b/resource-manager/netapp/2023-05-01/capacitypools/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-05-01/capacitypools/id_netappaccount_test.go b/resource-manager/netapp/2023-05-01/capacitypools/id_netappaccount_test.go index 7a337eb7048..91d9bae2f9f 100644 --- a/resource-manager/netapp/2023-05-01/capacitypools/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-05-01/capacitypools/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/filelocks/README.md b/resource-manager/netapp/2023-05-01/filelocks/README.md index 871fbc8ea62..f1686fd0807 100644 --- a/resource-manager/netapp/2023-05-01/filelocks/README.md +++ b/resource-manager/netapp/2023-05-01/filelocks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := filelocks.BreakFileLocksRequest{ // ... diff --git a/resource-manager/netapp/2023-05-01/filelocks/id_volume.go b/resource-manager/netapp/2023-05-01/filelocks/id_volume.go index 1bc8b7d703a..660324eb77b 100644 --- a/resource-manager/netapp/2023-05-01/filelocks/id_volume.go +++ b/resource-manager/netapp/2023-05-01/filelocks/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/filelocks/id_volume_test.go b/resource-manager/netapp/2023-05-01/filelocks/id_volume_test.go index 53c183e76a9..1ae0d4861ac 100644 --- a/resource-manager/netapp/2023-05-01/filelocks/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/filelocks/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/groupidlistforldapuser/README.md b/resource-manager/netapp/2023-05-01/groupidlistforldapuser/README.md index 56525b3591a..11dec28e0c0 100644 --- a/resource-manager/netapp/2023-05-01/groupidlistforldapuser/README.md +++ b/resource-manager/netapp/2023-05-01/groupidlistforldapuser/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := groupidlistforldapuser.GetGroupIdListForLDAPUserRequest{ // ... diff --git a/resource-manager/netapp/2023-05-01/groupidlistforldapuser/id_volume.go b/resource-manager/netapp/2023-05-01/groupidlistforldapuser/id_volume.go index 343367eda42..597c3e852ab 100644 --- a/resource-manager/netapp/2023-05-01/groupidlistforldapuser/id_volume.go +++ b/resource-manager/netapp/2023-05-01/groupidlistforldapuser/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/groupidlistforldapuser/id_volume_test.go b/resource-manager/netapp/2023-05-01/groupidlistforldapuser/id_volume_test.go index 613e3ba7e8b..ad956e12e12 100644 --- a/resource-manager/netapp/2023-05-01/groupidlistforldapuser/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/groupidlistforldapuser/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/netappaccounts/README.md b/resource-manager/netapp/2023-05-01/netappaccounts/README.md index 6db578f170e..c5c5f992701 100644 --- a/resource-manager/netapp/2023-05-01/netappaccounts/README.md +++ b/resource-manager/netapp/2023-05-01/netappaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := netappaccounts.NetAppAccount{ // ... @@ -42,7 +42,7 @@ if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.AccountsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := netappaccounts.NetAppAccountPatch{ // ... diff --git a/resource-manager/netapp/2023-05-01/netappaccounts/id_netappaccount.go b/resource-manager/netapp/2023-05-01/netappaccounts/id_netappaccount.go index a551456fc35..e49b1665e3b 100644 --- a/resource-manager/netapp/2023-05-01/netappaccounts/id_netappaccount.go +++ b/resource-manager/netapp/2023-05-01/netappaccounts/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-05-01/netappaccounts/id_netappaccount_test.go b/resource-manager/netapp/2023-05-01/netappaccounts/id_netappaccount_test.go index f103b75d288..ef0ce3e4636 100644 --- a/resource-manager/netapp/2023-05-01/netappaccounts/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-05-01/netappaccounts/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/netappresource/README.md b/resource-manager/netapp/2023-05-01/netappresource/README.md index e80c949f529..998c7021b02 100644 --- a/resource-manager/netapp/2023-05-01/netappresource/README.md +++ b/resource-manager/netapp/2023-05-01/netappresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.FilePathAvailabilityRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.ResourceNameAvailabilityRequest{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.QuotaAvailabilityRequest{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.QueryNetworkSiblingSetRequest{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.QueryRegionInfo(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName") +id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName") read, err := client.QuotaLimitsGet(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.QuotaLimitsList(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.UpdateNetworkSiblingSetRequest{ // ... diff --git a/resource-manager/netapp/2023-05-01/netappresource/id_location.go b/resource-manager/netapp/2023-05-01/netappresource/id_location.go index ce496afe734..7f5f70c69df 100644 --- a/resource-manager/netapp/2023-05-01/netappresource/id_location.go +++ b/resource-manager/netapp/2023-05-01/netappresource/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/netapp/2023-05-01/netappresource/id_location_test.go b/resource-manager/netapp/2023-05-01/netappresource/id_location_test.go index f37ef0bd41e..6e374aa4ecb 100644 --- a/resource-manager/netapp/2023-05-01/netappresource/id_location_test.go +++ b/resource-manager/netapp/2023-05-01/netappresource/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/netappresource/id_quotalimit.go b/resource-manager/netapp/2023-05-01/netappresource/id_quotalimit.go index d4a65d40520..b35ac4de378 100644 --- a/resource-manager/netapp/2023-05-01/netappresource/id_quotalimit.go +++ b/resource-manager/netapp/2023-05-01/netappresource/id_quotalimit.go @@ -113,7 +113,7 @@ func (id QuotaLimitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticQuotaLimits", "quotaLimits", "quotaLimits"), resourceids.UserSpecifiedSegment("quotaLimitName", "quotaLimitName"), } diff --git a/resource-manager/netapp/2023-05-01/netappresource/id_quotalimit_test.go b/resource-manager/netapp/2023-05-01/netappresource/id_quotalimit_test.go index e3a0299b8ae..3d154522c0a 100644 --- a/resource-manager/netapp/2023-05-01/netappresource/id_quotalimit_test.go +++ b/resource-manager/netapp/2023-05-01/netappresource/id_quotalimit_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &QuotaLimitId{} func TestNewQuotaLimitID(t *testing.T) { - id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName") + id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.QuotaLimitName != "quotaLimitName" { @@ -28,8 +28,8 @@ func TestNewQuotaLimitID(t *testing.T) { } func TestFormatQuotaLimitID(t *testing.T) { - actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName" + actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseQuotaLimitID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", QuotaLimitName: "quotaLimitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseQuotaLimitIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", QuotaLimitName: "quotaLimitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs/qUoTaLiMiTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs/qUoTaLiMiTnAmE", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", QuotaLimitName: "qUoTaLiMiTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs/qUoTaLiMiTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs/qUoTaLiMiTnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/poolchange/README.md b/resource-manager/netapp/2023-05-01/poolchange/README.md index b9cae70d756..b8577dbb9b6 100644 --- a/resource-manager/netapp/2023-05-01/poolchange/README.md +++ b/resource-manager/netapp/2023-05-01/poolchange/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := poolchange.PoolChangeRequest{ // ... diff --git a/resource-manager/netapp/2023-05-01/poolchange/id_volume.go b/resource-manager/netapp/2023-05-01/poolchange/id_volume.go index f4189a2d706..db883b5bdcb 100644 --- a/resource-manager/netapp/2023-05-01/poolchange/id_volume.go +++ b/resource-manager/netapp/2023-05-01/poolchange/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/poolchange/id_volume_test.go b/resource-manager/netapp/2023-05-01/poolchange/id_volume_test.go index 49b57227550..85f31b29d70 100644 --- a/resource-manager/netapp/2023-05-01/poolchange/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/poolchange/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/resetcifspassword/id_volume.go b/resource-manager/netapp/2023-05-01/resetcifspassword/id_volume.go index 965a410354b..c5a2844bb7b 100644 --- a/resource-manager/netapp/2023-05-01/resetcifspassword/id_volume.go +++ b/resource-manager/netapp/2023-05-01/resetcifspassword/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/resetcifspassword/id_volume_test.go b/resource-manager/netapp/2023-05-01/resetcifspassword/id_volume_test.go index 4bdb1e229ac..0b3b2133026 100644 --- a/resource-manager/netapp/2023-05-01/resetcifspassword/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/resetcifspassword/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/restore/README.md b/resource-manager/netapp/2023-05-01/restore/README.md index e80370d0a1f..212b4c4bba0 100644 --- a/resource-manager/netapp/2023-05-01/restore/README.md +++ b/resource-manager/netapp/2023-05-01/restore/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.BackupsGetVolumeRestoreStatus(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-05-01/restore/id_volume.go b/resource-manager/netapp/2023-05-01/restore/id_volume.go index 6944bf94a87..9e76588a555 100644 --- a/resource-manager/netapp/2023-05-01/restore/id_volume.go +++ b/resource-manager/netapp/2023-05-01/restore/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/restore/id_volume_test.go b/resource-manager/netapp/2023-05-01/restore/id_volume_test.go index 12722b5829a..7762bc57cb4 100644 --- a/resource-manager/netapp/2023-05-01/restore/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/restore/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/snapshotpolicy/README.md b/resource-manager/netapp/2023-05-01/snapshotpolicy/README.md index 5f0a41f261b..ce7bccd2bc3 100644 --- a/resource-manager/netapp/2023-05-01/snapshotpolicy/README.md +++ b/resource-manager/netapp/2023-05-01/snapshotpolicy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") payload := snapshotpolicy.SnapshotPolicy{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") read, err := client.SnapshotPoliciesGet(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.SnapshotPoliciesList(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") payload := snapshotpolicy.SnapshotPolicyPatch{ // ... diff --git a/resource-manager/netapp/2023-05-01/snapshotpolicy/id_netappaccount.go b/resource-manager/netapp/2023-05-01/snapshotpolicy/id_netappaccount.go index 2a04383c0de..14deafbb222 100644 --- a/resource-manager/netapp/2023-05-01/snapshotpolicy/id_netappaccount.go +++ b/resource-manager/netapp/2023-05-01/snapshotpolicy/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-05-01/snapshotpolicy/id_netappaccount_test.go b/resource-manager/netapp/2023-05-01/snapshotpolicy/id_netappaccount_test.go index c0601bb3a54..37ac2f7a327 100644 --- a/resource-manager/netapp/2023-05-01/snapshotpolicy/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-05-01/snapshotpolicy/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/snapshotpolicy/id_snapshotpolicy.go b/resource-manager/netapp/2023-05-01/snapshotpolicy/id_snapshotpolicy.go index 4db1ae3a00d..0f5ca81ebc0 100644 --- a/resource-manager/netapp/2023-05-01/snapshotpolicy/id_snapshotpolicy.go +++ b/resource-manager/netapp/2023-05-01/snapshotpolicy/id_snapshotpolicy.go @@ -121,7 +121,7 @@ func (id SnapshotPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyName"), } diff --git a/resource-manager/netapp/2023-05-01/snapshotpolicy/id_snapshotpolicy_test.go b/resource-manager/netapp/2023-05-01/snapshotpolicy/id_snapshotpolicy_test.go index 5151bfdfc6a..47db3863892 100644 --- a/resource-manager/netapp/2023-05-01/snapshotpolicy/id_snapshotpolicy_test.go +++ b/resource-manager/netapp/2023-05-01/snapshotpolicy/id_snapshotpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotPolicyId{} func TestNewSnapshotPolicyID(t *testing.T) { - id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.SnapshotPolicyName != "snapshotPolicyName" { @@ -32,8 +32,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { } func TestFormatSnapshotPolicyID(t *testing.T) { - actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName" + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", SnapshotPolicyName: "sNaPsHoTpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/README.md b/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/README.md index ace4be570c3..e182a6a157b 100644 --- a/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/README.md +++ b/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") read, err := client.SnapshotPoliciesListVolumes(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/id_snapshotpolicy.go b/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/id_snapshotpolicy.go index 6bf4b598a83..c366a171e15 100644 --- a/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/id_snapshotpolicy.go +++ b/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/id_snapshotpolicy.go @@ -121,7 +121,7 @@ func (id SnapshotPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyName"), } diff --git a/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go b/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go index 1b469bc2282..8dad1f1572b 100644 --- a/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go +++ b/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotPolicyId{} func TestNewSnapshotPolicyID(t *testing.T) { - id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.SnapshotPolicyName != "snapshotPolicyName" { @@ -32,8 +32,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { } func TestFormatSnapshotPolicyID(t *testing.T) { - actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName" + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", SnapshotPolicyName: "sNaPsHoTpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/snapshots/README.md b/resource-manager/netapp/2023-05-01/snapshots/README.md index 70685196b4a..b28bdd0a5d2 100644 --- a/resource-manager/netapp/2023-05-01/snapshots/README.md +++ b/resource-manager/netapp/2023-05-01/snapshots/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") payload := snapshots.Snapshot{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.List(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") payload := snapshots.SnapshotRestoreFiles{ // ... @@ -102,7 +102,7 @@ if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") var payload interface{} if err := client.UpdateThenPoll(ctx, id, payload); err != nil { diff --git a/resource-manager/netapp/2023-05-01/snapshots/id_snapshot.go b/resource-manager/netapp/2023-05-01/snapshots/id_snapshot.go index bb9f92dd3d8..2fe36d4f5a9 100644 --- a/resource-manager/netapp/2023-05-01/snapshots/id_snapshot.go +++ b/resource-manager/netapp/2023-05-01/snapshots/id_snapshot.go @@ -133,9 +133,9 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/netapp/2023-05-01/snapshots/id_snapshot_test.go b/resource-manager/netapp/2023-05-01/snapshots/id_snapshot_test.go index bf07ef37b3f..1aae8e6ed5c 100644 --- a/resource-manager/netapp/2023-05-01/snapshots/id_snapshot_test.go +++ b/resource-manager/netapp/2023-05-01/snapshots/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -40,8 +40,8 @@ func TestNewSnapshotID(t *testing.T) { } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", SnapshotName: "sNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/snapshots/id_volume.go b/resource-manager/netapp/2023-05-01/snapshots/id_volume.go index 3c7c80a660d..dcd1ab5e98b 100644 --- a/resource-manager/netapp/2023-05-01/snapshots/id_volume.go +++ b/resource-manager/netapp/2023-05-01/snapshots/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/snapshots/id_volume_test.go b/resource-manager/netapp/2023-05-01/snapshots/id_volume_test.go index 4179bacaad9..010624ba420 100644 --- a/resource-manager/netapp/2023-05-01/snapshots/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/snapshots/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/subvolumes/README.md b/resource-manager/netapp/2023-05-01/subvolumes/README.md index fd94ad790fe..b92ae044951 100644 --- a/resource-manager/netapp/2023-05-01/subvolumes/README.md +++ b/resource-manager/netapp/2023-05-01/subvolumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") payload := subvolumes.SubvolumeInfo{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if err := client.GetMetadataThenPoll(ctx, id); err != nil { // handle the error @@ -81,7 +81,7 @@ if err := client.GetMetadataThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") // alternatively `client.ListByVolume(ctx, id)` can be used to do batched pagination items, err := client.ListByVolumeComplete(ctx, id) @@ -98,7 +98,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") payload := subvolumes.SubvolumePatchRequest{ // ... diff --git a/resource-manager/netapp/2023-05-01/subvolumes/id_subvolume.go b/resource-manager/netapp/2023-05-01/subvolumes/id_subvolume.go index 67d0d1b4c05..d9ceec6f9e6 100644 --- a/resource-manager/netapp/2023-05-01/subvolumes/id_subvolume.go +++ b/resource-manager/netapp/2023-05-01/subvolumes/id_subvolume.go @@ -133,13 +133,13 @@ func (id SubVolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticSubVolumes", "subVolumes", "subVolumes"), - resourceids.UserSpecifiedSegment("subVolumeName", "subvolumeName"), + resourceids.UserSpecifiedSegment("subVolumeName", "subVolumeName"), } } diff --git a/resource-manager/netapp/2023-05-01/subvolumes/id_subvolume_test.go b/resource-manager/netapp/2023-05-01/subvolumes/id_subvolume_test.go index 086c5a8e4fd..c427629eb5d 100644 --- a/resource-manager/netapp/2023-05-01/subvolumes/id_subvolume_test.go +++ b/resource-manager/netapp/2023-05-01/subvolumes/id_subvolume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SubVolumeId{} func TestNewSubVolumeID(t *testing.T) { - id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") + id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewSubVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeName") } - if id.SubVolumeName != "subvolumeName" { - t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subvolumeName") + if id.SubVolumeName != "subVolumeName" { + t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subVolumeName") } } func TestFormatSubVolumeID(t *testing.T) { - actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName" + actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSubVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", - SubVolumeName: "subvolumeName", + SubVolumeName: "subVolumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSubVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", - SubVolumeName: "subvolumeName", + SubVolumeName: "subVolumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", SubVolumeName: "sUbVoLuMeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/subvolumes/id_volume.go b/resource-manager/netapp/2023-05-01/subvolumes/id_volume.go index 8ed26a30d21..1b621f47327 100644 --- a/resource-manager/netapp/2023-05-01/subvolumes/id_volume.go +++ b/resource-manager/netapp/2023-05-01/subvolumes/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/subvolumes/id_volume_test.go b/resource-manager/netapp/2023-05-01/subvolumes/id_volume_test.go index 5c6f5f7253b..31c7ff8fe02 100644 --- a/resource-manager/netapp/2023-05-01/subvolumes/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/subvolumes/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumegroups/README.md b/resource-manager/netapp/2023-05-01/volumegroups/README.md index b9770840b54..358b4d71101 100644 --- a/resource-manager/netapp/2023-05-01/volumegroups/README.md +++ b/resource-manager/netapp/2023-05-01/volumegroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") payload := volumegroups.VolumeGroupDetails{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.ListByNetAppAccount(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-05-01/volumegroups/id_netappaccount.go b/resource-manager/netapp/2023-05-01/volumegroups/id_netappaccount.go index 11b871e68f6..b76f8ad025d 100644 --- a/resource-manager/netapp/2023-05-01/volumegroups/id_netappaccount.go +++ b/resource-manager/netapp/2023-05-01/volumegroups/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-05-01/volumegroups/id_netappaccount_test.go b/resource-manager/netapp/2023-05-01/volumegroups/id_netappaccount_test.go index f3423437a45..ea57dfac8fc 100644 --- a/resource-manager/netapp/2023-05-01/volumegroups/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-05-01/volumegroups/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumegroups/id_volumegroup.go b/resource-manager/netapp/2023-05-01/volumegroups/id_volumegroup.go index 16d7214529e..2fbfb2b2133 100644 --- a/resource-manager/netapp/2023-05-01/volumegroups/id_volumegroup.go +++ b/resource-manager/netapp/2023-05-01/volumegroups/id_volumegroup.go @@ -121,7 +121,7 @@ func (id VolumeGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupName"), } diff --git a/resource-manager/netapp/2023-05-01/volumegroups/id_volumegroup_test.go b/resource-manager/netapp/2023-05-01/volumegroups/id_volumegroup_test.go index 2ec1015141c..9a1dd20a884 100644 --- a/resource-manager/netapp/2023-05-01/volumegroups/id_volumegroup_test.go +++ b/resource-manager/netapp/2023-05-01/volumegroups/id_volumegroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeGroupId{} func TestNewVolumeGroupID(t *testing.T) { - id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") + id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVolumeGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.VolumeGroupName != "volumeGroupName" { @@ -32,8 +32,8 @@ func TestNewVolumeGroupID(t *testing.T) { } func TestFormatVolumeGroupID(t *testing.T) { - actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName" + actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVolumeGroupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", VolumeGroupName: "volumeGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVolumeGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", VolumeGroupName: "volumeGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", VolumeGroupName: "vOlUmEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumequotarules/README.md b/resource-manager/netapp/2023-05-01/volumequotarules/README.md index 204d799cc75..0298eff3040 100644 --- a/resource-manager/netapp/2023-05-01/volumequotarules/README.md +++ b/resource-manager/netapp/2023-05-01/volumequotarules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") payload := volumequotarules.VolumeQuotaRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.ListByVolume(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") payload := volumequotarules.VolumeQuotaRulePatch{ // ... diff --git a/resource-manager/netapp/2023-05-01/volumequotarules/id_volume.go b/resource-manager/netapp/2023-05-01/volumequotarules/id_volume.go index 149860704d1..f3aab9f00df 100644 --- a/resource-manager/netapp/2023-05-01/volumequotarules/id_volume.go +++ b/resource-manager/netapp/2023-05-01/volumequotarules/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/volumequotarules/id_volume_test.go b/resource-manager/netapp/2023-05-01/volumequotarules/id_volume_test.go index 34ce0b19c6a..c0acc543f9f 100644 --- a/resource-manager/netapp/2023-05-01/volumequotarules/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/volumequotarules/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumequotarules/id_volumequotarule.go b/resource-manager/netapp/2023-05-01/volumequotarules/id_volumequotarule.go index 0884c5a5035..9007e1468ae 100644 --- a/resource-manager/netapp/2023-05-01/volumequotarules/id_volumequotarule.go +++ b/resource-manager/netapp/2023-05-01/volumequotarules/id_volumequotarule.go @@ -133,9 +133,9 @@ func (id VolumeQuotaRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticVolumeQuotaRules", "volumeQuotaRules", "volumeQuotaRules"), diff --git a/resource-manager/netapp/2023-05-01/volumequotarules/id_volumequotarule_test.go b/resource-manager/netapp/2023-05-01/volumequotarules/id_volumequotarule_test.go index 35b6e35e74d..3b3ee84e25f 100644 --- a/resource-manager/netapp/2023-05-01/volumequotarules/id_volumequotarule_test.go +++ b/resource-manager/netapp/2023-05-01/volumequotarules/id_volumequotarule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeQuotaRuleId{} func TestNewVolumeQuotaRuleID(t *testing.T) { - id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") + id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeQuotaRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -40,8 +40,8 @@ func TestNewVolumeQuotaRuleID(t *testing.T) { } func TestFormatVolumeQuotaRuleID(t *testing.T) { - actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName" + actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseVolumeQuotaRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", VolumeQuotaRuleName: "volumeQuotaRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseVolumeQuotaRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", VolumeQuotaRuleName: "volumeQuotaRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", VolumeQuotaRuleName: "vOlUmEqUoTaRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumes/README.md b/resource-manager/netapp/2023-05-01/volumes/README.md index afb2cf79ad9..c26acb94610 100644 --- a/resource-manager/netapp/2023-05-01/volumes/README.md +++ b/resource-manager/netapp/2023-05-01/volumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumes.Volume{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions() ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumes.VolumePatch{ // ... diff --git a/resource-manager/netapp/2023-05-01/volumes/id_capacitypool.go b/resource-manager/netapp/2023-05-01/volumes/id_capacitypool.go index e667d5a5691..4a5cb95b3e2 100644 --- a/resource-manager/netapp/2023-05-01/volumes/id_capacitypool.go +++ b/resource-manager/netapp/2023-05-01/volumes/id_capacitypool.go @@ -121,9 +121,9 @@ func (id CapacityPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), } } diff --git a/resource-manager/netapp/2023-05-01/volumes/id_capacitypool_test.go b/resource-manager/netapp/2023-05-01/volumes/id_capacitypool_test.go index a247ffa7040..c84c57d8196 100644 --- a/resource-manager/netapp/2023-05-01/volumes/id_capacitypool_test.go +++ b/resource-manager/netapp/2023-05-01/volumes/id_capacitypool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityPoolId{} func TestNewCapacityPoolID(t *testing.T) { - id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCapacityPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } } func TestFormatCapacityPoolID(t *testing.T) { - actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName" + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCapacityPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCapacityPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumes/id_volume.go b/resource-manager/netapp/2023-05-01/volumes/id_volume.go index a41faa0cf26..9335df28621 100644 --- a/resource-manager/netapp/2023-05-01/volumes/id_volume.go +++ b/resource-manager/netapp/2023-05-01/volumes/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/volumes/id_volume_test.go b/resource-manager/netapp/2023-05-01/volumes/id_volume_test.go index e4d721e4299..a08cc9318a1 100644 --- a/resource-manager/netapp/2023-05-01/volumes/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/volumes/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumesrelocation/README.md b/resource-manager/netapp/2023-05-01/volumesrelocation/README.md index d205a6334c0..4ddc201f3f5 100644 --- a/resource-manager/netapp/2023-05-01/volumesrelocation/README.md +++ b/resource-manager/netapp/2023-05-01/volumesrelocation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesrelocation.RelocateVolumeRequest{ // ... @@ -53,7 +53,7 @@ if err := client.VolumesRelocateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesRevertRelocationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/netapp/2023-05-01/volumesrelocation/id_volume.go b/resource-manager/netapp/2023-05-01/volumesrelocation/id_volume.go index a2dc8db451a..113162da6d7 100644 --- a/resource-manager/netapp/2023-05-01/volumesrelocation/id_volume.go +++ b/resource-manager/netapp/2023-05-01/volumesrelocation/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/volumesrelocation/id_volume_test.go b/resource-manager/netapp/2023-05-01/volumesrelocation/id_volume_test.go index 81640dbd2c8..6a87e3c4d06 100644 --- a/resource-manager/netapp/2023-05-01/volumesrelocation/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/volumesrelocation/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumesreplication/README.md b/resource-manager/netapp/2023-05-01/volumesreplication/README.md index 256ba642bbc..c6f7f129e36 100644 --- a/resource-manager/netapp/2023-05-01/volumesreplication/README.md +++ b/resource-manager/netapp/2023-05-01/volumesreplication/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.AuthorizeRequest{ // ... @@ -41,7 +41,7 @@ if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.BreakReplicationRequest{ // ... @@ -58,7 +58,7 @@ if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.VolumesListReplications(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.ReestablishReplicationRequest{ // ... @@ -115,7 +115,7 @@ if err := client.VolumesReestablishReplicationThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.VolumesReplicationStatus(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/netapp/2023-05-01/volumesreplication/id_volume.go b/resource-manager/netapp/2023-05-01/volumesreplication/id_volume.go index d5cd1a7bb6b..f4997248ba1 100644 --- a/resource-manager/netapp/2023-05-01/volumesreplication/id_volume.go +++ b/resource-manager/netapp/2023-05-01/volumesreplication/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/volumesreplication/id_volume_test.go b/resource-manager/netapp/2023-05-01/volumesreplication/id_volume_test.go index 482df2f378c..51db68a7df6 100644 --- a/resource-manager/netapp/2023-05-01/volumesreplication/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/volumesreplication/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-05-01/volumesrevert/README.md b/resource-manager/netapp/2023-05-01/volumesrevert/README.md index 54bfeb44cab..d7bdb1415a6 100644 --- a/resource-manager/netapp/2023-05-01/volumesrevert/README.md +++ b/resource-manager/netapp/2023-05-01/volumesrevert/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesrevert.VolumeRevert{ // ... diff --git a/resource-manager/netapp/2023-05-01/volumesrevert/id_volume.go b/resource-manager/netapp/2023-05-01/volumesrevert/id_volume.go index a8685593a26..e61cfcfca50 100644 --- a/resource-manager/netapp/2023-05-01/volumesrevert/id_volume.go +++ b/resource-manager/netapp/2023-05-01/volumesrevert/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-05-01/volumesrevert/id_volume_test.go b/resource-manager/netapp/2023-05-01/volumesrevert/id_volume_test.go index c7514e428c8..f26bf43ecc3 100644 --- a/resource-manager/netapp/2023-05-01/volumesrevert/id_volume_test.go +++ b/resource-manager/netapp/2023-05-01/volumesrevert/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/backuppolicy/README.md b/resource-manager/netapp/2023-07-01/backuppolicy/README.md index 27bdfbd8366..50594e83a31 100644 --- a/resource-manager/netapp/2023-07-01/backuppolicy/README.md +++ b/resource-manager/netapp/2023-07-01/backuppolicy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") payload := backuppolicy.BackupPolicy{ // ... @@ -41,7 +41,7 @@ if err := client.BackupPoliciesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") read, err := client.BackupPoliciesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.BackupPoliciesList(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") payload := backuppolicy.BackupPolicyPatch{ // ... diff --git a/resource-manager/netapp/2023-07-01/backuppolicy/id_backuppolicy.go b/resource-manager/netapp/2023-07-01/backuppolicy/id_backuppolicy.go index 20a4fb7fa7d..7e2cd95f210 100644 --- a/resource-manager/netapp/2023-07-01/backuppolicy/id_backuppolicy.go +++ b/resource-manager/netapp/2023-07-01/backuppolicy/id_backuppolicy.go @@ -121,7 +121,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } diff --git a/resource-manager/netapp/2023-07-01/backuppolicy/id_backuppolicy_test.go b/resource-manager/netapp/2023-07-01/backuppolicy/id_backuppolicy_test.go index 8fc9ee76db7..39877320168 100644 --- a/resource-manager/netapp/2023-07-01/backuppolicy/id_backuppolicy_test.go +++ b/resource-manager/netapp/2023-07-01/backuppolicy/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupPolicyName != "backupPolicyName" { @@ -32,8 +32,8 @@ func TestNewBackupPolicyID(t *testing.T) { } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/backuppolicy/id_netappaccount.go b/resource-manager/netapp/2023-07-01/backuppolicy/id_netappaccount.go index 171fea3e381..b10e89e1ad1 100644 --- a/resource-manager/netapp/2023-07-01/backuppolicy/id_netappaccount.go +++ b/resource-manager/netapp/2023-07-01/backuppolicy/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-07-01/backuppolicy/id_netappaccount_test.go b/resource-manager/netapp/2023-07-01/backuppolicy/id_netappaccount_test.go index 39611256a73..455b109bb39 100644 --- a/resource-manager/netapp/2023-07-01/backuppolicy/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-07-01/backuppolicy/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/capacitypools/README.md b/resource-manager/netapp/2023-07-01/capacitypools/README.md index 65083bb6a09..1a097256fdd 100644 --- a/resource-manager/netapp/2023-07-01/capacitypools/README.md +++ b/resource-manager/netapp/2023-07-01/capacitypools/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") payload := capacitypools.CapacityPool{ // ... @@ -41,7 +41,7 @@ if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") read, err := client.PoolsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") // alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination items, err := client.PoolsListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") payload := capacitypools.CapacityPoolPatch{ // ... diff --git a/resource-manager/netapp/2023-07-01/capacitypools/id_capacitypool.go b/resource-manager/netapp/2023-07-01/capacitypools/id_capacitypool.go index 5f54bf96057..0e041090dd4 100644 --- a/resource-manager/netapp/2023-07-01/capacitypools/id_capacitypool.go +++ b/resource-manager/netapp/2023-07-01/capacitypools/id_capacitypool.go @@ -121,9 +121,9 @@ func (id CapacityPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), } } diff --git a/resource-manager/netapp/2023-07-01/capacitypools/id_capacitypool_test.go b/resource-manager/netapp/2023-07-01/capacitypools/id_capacitypool_test.go index e19faa4852d..6bfc38a792d 100644 --- a/resource-manager/netapp/2023-07-01/capacitypools/id_capacitypool_test.go +++ b/resource-manager/netapp/2023-07-01/capacitypools/id_capacitypool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityPoolId{} func TestNewCapacityPoolID(t *testing.T) { - id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCapacityPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } } func TestFormatCapacityPoolID(t *testing.T) { - actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName" + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCapacityPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCapacityPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/capacitypools/id_netappaccount.go b/resource-manager/netapp/2023-07-01/capacitypools/id_netappaccount.go index 0a3b033027e..58a09e2952e 100644 --- a/resource-manager/netapp/2023-07-01/capacitypools/id_netappaccount.go +++ b/resource-manager/netapp/2023-07-01/capacitypools/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-07-01/capacitypools/id_netappaccount_test.go b/resource-manager/netapp/2023-07-01/capacitypools/id_netappaccount_test.go index 7a337eb7048..91d9bae2f9f 100644 --- a/resource-manager/netapp/2023-07-01/capacitypools/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-07-01/capacitypools/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/filelocks/README.md b/resource-manager/netapp/2023-07-01/filelocks/README.md index 69944f4f206..b1dbc27466c 100644 --- a/resource-manager/netapp/2023-07-01/filelocks/README.md +++ b/resource-manager/netapp/2023-07-01/filelocks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := filelocks.BreakFileLocksRequest{ // ... diff --git a/resource-manager/netapp/2023-07-01/filelocks/id_volume.go b/resource-manager/netapp/2023-07-01/filelocks/id_volume.go index 1bc8b7d703a..660324eb77b 100644 --- a/resource-manager/netapp/2023-07-01/filelocks/id_volume.go +++ b/resource-manager/netapp/2023-07-01/filelocks/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/filelocks/id_volume_test.go b/resource-manager/netapp/2023-07-01/filelocks/id_volume_test.go index 53c183e76a9..1ae0d4861ac 100644 --- a/resource-manager/netapp/2023-07-01/filelocks/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/filelocks/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/groupidlistforldapuser/README.md b/resource-manager/netapp/2023-07-01/groupidlistforldapuser/README.md index 7fecefb4402..60d5dbc8617 100644 --- a/resource-manager/netapp/2023-07-01/groupidlistforldapuser/README.md +++ b/resource-manager/netapp/2023-07-01/groupidlistforldapuser/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := groupidlistforldapuser.GetGroupIdListForLDAPUserRequest{ // ... diff --git a/resource-manager/netapp/2023-07-01/groupidlistforldapuser/id_volume.go b/resource-manager/netapp/2023-07-01/groupidlistforldapuser/id_volume.go index 343367eda42..597c3e852ab 100644 --- a/resource-manager/netapp/2023-07-01/groupidlistforldapuser/id_volume.go +++ b/resource-manager/netapp/2023-07-01/groupidlistforldapuser/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/groupidlistforldapuser/id_volume_test.go b/resource-manager/netapp/2023-07-01/groupidlistforldapuser/id_volume_test.go index 613e3ba7e8b..ad956e12e12 100644 --- a/resource-manager/netapp/2023-07-01/groupidlistforldapuser/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/groupidlistforldapuser/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/netappaccounts/README.md b/resource-manager/netapp/2023-07-01/netappaccounts/README.md index e34f908a334..eb19addefb5 100644 --- a/resource-manager/netapp/2023-07-01/netappaccounts/README.md +++ b/resource-manager/netapp/2023-07-01/netappaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := netappaccounts.NetAppAccount{ // ... @@ -42,7 +42,7 @@ if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.AccountsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := netappaccounts.NetAppAccountPatch{ // ... diff --git a/resource-manager/netapp/2023-07-01/netappaccounts/id_netappaccount.go b/resource-manager/netapp/2023-07-01/netappaccounts/id_netappaccount.go index a551456fc35..e49b1665e3b 100644 --- a/resource-manager/netapp/2023-07-01/netappaccounts/id_netappaccount.go +++ b/resource-manager/netapp/2023-07-01/netappaccounts/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-07-01/netappaccounts/id_netappaccount_test.go b/resource-manager/netapp/2023-07-01/netappaccounts/id_netappaccount_test.go index f103b75d288..ef0ce3e4636 100644 --- a/resource-manager/netapp/2023-07-01/netappaccounts/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-07-01/netappaccounts/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/netappresource/README.md b/resource-manager/netapp/2023-07-01/netappresource/README.md index f90cd5096c9..4cc602df2db 100644 --- a/resource-manager/netapp/2023-07-01/netappresource/README.md +++ b/resource-manager/netapp/2023-07-01/netappresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.FilePathAvailabilityRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.ResourceNameAvailabilityRequest{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.QuotaAvailabilityRequest{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.QueryNetworkSiblingSetRequest{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.QueryRegionInfo(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName") +id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName") read, err := client.QuotaLimitsGet(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.QuotaLimitsList(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.UpdateNetworkSiblingSetRequest{ // ... diff --git a/resource-manager/netapp/2023-07-01/netappresource/id_location.go b/resource-manager/netapp/2023-07-01/netappresource/id_location.go index ce496afe734..7f5f70c69df 100644 --- a/resource-manager/netapp/2023-07-01/netappresource/id_location.go +++ b/resource-manager/netapp/2023-07-01/netappresource/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/netapp/2023-07-01/netappresource/id_location_test.go b/resource-manager/netapp/2023-07-01/netappresource/id_location_test.go index f37ef0bd41e..6e374aa4ecb 100644 --- a/resource-manager/netapp/2023-07-01/netappresource/id_location_test.go +++ b/resource-manager/netapp/2023-07-01/netappresource/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/netappresource/id_quotalimit.go b/resource-manager/netapp/2023-07-01/netappresource/id_quotalimit.go index d4a65d40520..b35ac4de378 100644 --- a/resource-manager/netapp/2023-07-01/netappresource/id_quotalimit.go +++ b/resource-manager/netapp/2023-07-01/netappresource/id_quotalimit.go @@ -113,7 +113,7 @@ func (id QuotaLimitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticQuotaLimits", "quotaLimits", "quotaLimits"), resourceids.UserSpecifiedSegment("quotaLimitName", "quotaLimitName"), } diff --git a/resource-manager/netapp/2023-07-01/netappresource/id_quotalimit_test.go b/resource-manager/netapp/2023-07-01/netappresource/id_quotalimit_test.go index e3a0299b8ae..3d154522c0a 100644 --- a/resource-manager/netapp/2023-07-01/netappresource/id_quotalimit_test.go +++ b/resource-manager/netapp/2023-07-01/netappresource/id_quotalimit_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &QuotaLimitId{} func TestNewQuotaLimitID(t *testing.T) { - id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName") + id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.QuotaLimitName != "quotaLimitName" { @@ -28,8 +28,8 @@ func TestNewQuotaLimitID(t *testing.T) { } func TestFormatQuotaLimitID(t *testing.T) { - actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName" + actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseQuotaLimitID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", QuotaLimitName: "quotaLimitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseQuotaLimitIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", QuotaLimitName: "quotaLimitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs/qUoTaLiMiTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs/qUoTaLiMiTnAmE", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", QuotaLimitName: "qUoTaLiMiTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs/qUoTaLiMiTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs/qUoTaLiMiTnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/poolchange/README.md b/resource-manager/netapp/2023-07-01/poolchange/README.md index b5ccd7e1c9e..150dfe3ead7 100644 --- a/resource-manager/netapp/2023-07-01/poolchange/README.md +++ b/resource-manager/netapp/2023-07-01/poolchange/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := poolchange.PoolChangeRequest{ // ... diff --git a/resource-manager/netapp/2023-07-01/poolchange/id_volume.go b/resource-manager/netapp/2023-07-01/poolchange/id_volume.go index f4189a2d706..db883b5bdcb 100644 --- a/resource-manager/netapp/2023-07-01/poolchange/id_volume.go +++ b/resource-manager/netapp/2023-07-01/poolchange/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/poolchange/id_volume_test.go b/resource-manager/netapp/2023-07-01/poolchange/id_volume_test.go index 49b57227550..85f31b29d70 100644 --- a/resource-manager/netapp/2023-07-01/poolchange/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/poolchange/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/resetcifspassword/id_volume.go b/resource-manager/netapp/2023-07-01/resetcifspassword/id_volume.go index 965a410354b..c5a2844bb7b 100644 --- a/resource-manager/netapp/2023-07-01/resetcifspassword/id_volume.go +++ b/resource-manager/netapp/2023-07-01/resetcifspassword/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/resetcifspassword/id_volume_test.go b/resource-manager/netapp/2023-07-01/resetcifspassword/id_volume_test.go index 4bdb1e229ac..0b3b2133026 100644 --- a/resource-manager/netapp/2023-07-01/resetcifspassword/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/resetcifspassword/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/restore/README.md b/resource-manager/netapp/2023-07-01/restore/README.md index 5ce5d2eaeac..c50d0db9c99 100644 --- a/resource-manager/netapp/2023-07-01/restore/README.md +++ b/resource-manager/netapp/2023-07-01/restore/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.BackupsGetVolumeRestoreStatus(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-07-01/restore/id_volume.go b/resource-manager/netapp/2023-07-01/restore/id_volume.go index 6944bf94a87..9e76588a555 100644 --- a/resource-manager/netapp/2023-07-01/restore/id_volume.go +++ b/resource-manager/netapp/2023-07-01/restore/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/restore/id_volume_test.go b/resource-manager/netapp/2023-07-01/restore/id_volume_test.go index 12722b5829a..7762bc57cb4 100644 --- a/resource-manager/netapp/2023-07-01/restore/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/restore/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/snapshotpolicy/README.md b/resource-manager/netapp/2023-07-01/snapshotpolicy/README.md index 6f9eae978d8..d40ebd35c9c 100644 --- a/resource-manager/netapp/2023-07-01/snapshotpolicy/README.md +++ b/resource-manager/netapp/2023-07-01/snapshotpolicy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") payload := snapshotpolicy.SnapshotPolicy{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") read, err := client.SnapshotPoliciesGet(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.SnapshotPoliciesList(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") payload := snapshotpolicy.SnapshotPolicyPatch{ // ... diff --git a/resource-manager/netapp/2023-07-01/snapshotpolicy/id_netappaccount.go b/resource-manager/netapp/2023-07-01/snapshotpolicy/id_netappaccount.go index 2a04383c0de..14deafbb222 100644 --- a/resource-manager/netapp/2023-07-01/snapshotpolicy/id_netappaccount.go +++ b/resource-manager/netapp/2023-07-01/snapshotpolicy/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-07-01/snapshotpolicy/id_netappaccount_test.go b/resource-manager/netapp/2023-07-01/snapshotpolicy/id_netappaccount_test.go index c0601bb3a54..37ac2f7a327 100644 --- a/resource-manager/netapp/2023-07-01/snapshotpolicy/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-07-01/snapshotpolicy/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/snapshotpolicy/id_snapshotpolicy.go b/resource-manager/netapp/2023-07-01/snapshotpolicy/id_snapshotpolicy.go index 4db1ae3a00d..0f5ca81ebc0 100644 --- a/resource-manager/netapp/2023-07-01/snapshotpolicy/id_snapshotpolicy.go +++ b/resource-manager/netapp/2023-07-01/snapshotpolicy/id_snapshotpolicy.go @@ -121,7 +121,7 @@ func (id SnapshotPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyName"), } diff --git a/resource-manager/netapp/2023-07-01/snapshotpolicy/id_snapshotpolicy_test.go b/resource-manager/netapp/2023-07-01/snapshotpolicy/id_snapshotpolicy_test.go index 5151bfdfc6a..47db3863892 100644 --- a/resource-manager/netapp/2023-07-01/snapshotpolicy/id_snapshotpolicy_test.go +++ b/resource-manager/netapp/2023-07-01/snapshotpolicy/id_snapshotpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotPolicyId{} func TestNewSnapshotPolicyID(t *testing.T) { - id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.SnapshotPolicyName != "snapshotPolicyName" { @@ -32,8 +32,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { } func TestFormatSnapshotPolicyID(t *testing.T) { - actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName" + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", SnapshotPolicyName: "sNaPsHoTpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/README.md b/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/README.md index 56269e752b6..14565160d53 100644 --- a/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/README.md +++ b/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") read, err := client.SnapshotPoliciesListVolumes(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/id_snapshotpolicy.go b/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/id_snapshotpolicy.go index 6bf4b598a83..c366a171e15 100644 --- a/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/id_snapshotpolicy.go +++ b/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/id_snapshotpolicy.go @@ -121,7 +121,7 @@ func (id SnapshotPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyName"), } diff --git a/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go b/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go index 1b469bc2282..8dad1f1572b 100644 --- a/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go +++ b/resource-manager/netapp/2023-07-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotPolicyId{} func TestNewSnapshotPolicyID(t *testing.T) { - id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.SnapshotPolicyName != "snapshotPolicyName" { @@ -32,8 +32,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { } func TestFormatSnapshotPolicyID(t *testing.T) { - actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName" + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", SnapshotPolicyName: "sNaPsHoTpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/snapshots/README.md b/resource-manager/netapp/2023-07-01/snapshots/README.md index 96d363af95f..23a429ded88 100644 --- a/resource-manager/netapp/2023-07-01/snapshots/README.md +++ b/resource-manager/netapp/2023-07-01/snapshots/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") payload := snapshots.Snapshot{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.List(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") payload := snapshots.SnapshotRestoreFiles{ // ... @@ -102,7 +102,7 @@ if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") var payload interface{} if err := client.UpdateThenPoll(ctx, id, payload); err != nil { diff --git a/resource-manager/netapp/2023-07-01/snapshots/id_snapshot.go b/resource-manager/netapp/2023-07-01/snapshots/id_snapshot.go index bb9f92dd3d8..2fe36d4f5a9 100644 --- a/resource-manager/netapp/2023-07-01/snapshots/id_snapshot.go +++ b/resource-manager/netapp/2023-07-01/snapshots/id_snapshot.go @@ -133,9 +133,9 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/netapp/2023-07-01/snapshots/id_snapshot_test.go b/resource-manager/netapp/2023-07-01/snapshots/id_snapshot_test.go index bf07ef37b3f..1aae8e6ed5c 100644 --- a/resource-manager/netapp/2023-07-01/snapshots/id_snapshot_test.go +++ b/resource-manager/netapp/2023-07-01/snapshots/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -40,8 +40,8 @@ func TestNewSnapshotID(t *testing.T) { } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", SnapshotName: "sNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/snapshots/id_volume.go b/resource-manager/netapp/2023-07-01/snapshots/id_volume.go index 3c7c80a660d..dcd1ab5e98b 100644 --- a/resource-manager/netapp/2023-07-01/snapshots/id_volume.go +++ b/resource-manager/netapp/2023-07-01/snapshots/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/snapshots/id_volume_test.go b/resource-manager/netapp/2023-07-01/snapshots/id_volume_test.go index 4179bacaad9..010624ba420 100644 --- a/resource-manager/netapp/2023-07-01/snapshots/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/snapshots/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/subvolumes/README.md b/resource-manager/netapp/2023-07-01/subvolumes/README.md index b1cb5893032..c1edbd38e22 100644 --- a/resource-manager/netapp/2023-07-01/subvolumes/README.md +++ b/resource-manager/netapp/2023-07-01/subvolumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") payload := subvolumes.SubvolumeInfo{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if err := client.GetMetadataThenPoll(ctx, id); err != nil { // handle the error @@ -81,7 +81,7 @@ if err := client.GetMetadataThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") // alternatively `client.ListByVolume(ctx, id)` can be used to do batched pagination items, err := client.ListByVolumeComplete(ctx, id) @@ -98,7 +98,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") payload := subvolumes.SubvolumePatchRequest{ // ... diff --git a/resource-manager/netapp/2023-07-01/subvolumes/id_subvolume.go b/resource-manager/netapp/2023-07-01/subvolumes/id_subvolume.go index 67d0d1b4c05..d9ceec6f9e6 100644 --- a/resource-manager/netapp/2023-07-01/subvolumes/id_subvolume.go +++ b/resource-manager/netapp/2023-07-01/subvolumes/id_subvolume.go @@ -133,13 +133,13 @@ func (id SubVolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticSubVolumes", "subVolumes", "subVolumes"), - resourceids.UserSpecifiedSegment("subVolumeName", "subvolumeName"), + resourceids.UserSpecifiedSegment("subVolumeName", "subVolumeName"), } } diff --git a/resource-manager/netapp/2023-07-01/subvolumes/id_subvolume_test.go b/resource-manager/netapp/2023-07-01/subvolumes/id_subvolume_test.go index 086c5a8e4fd..c427629eb5d 100644 --- a/resource-manager/netapp/2023-07-01/subvolumes/id_subvolume_test.go +++ b/resource-manager/netapp/2023-07-01/subvolumes/id_subvolume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SubVolumeId{} func TestNewSubVolumeID(t *testing.T) { - id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") + id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewSubVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeName") } - if id.SubVolumeName != "subvolumeName" { - t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subvolumeName") + if id.SubVolumeName != "subVolumeName" { + t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subVolumeName") } } func TestFormatSubVolumeID(t *testing.T) { - actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName" + actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSubVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", - SubVolumeName: "subvolumeName", + SubVolumeName: "subVolumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSubVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", - SubVolumeName: "subvolumeName", + SubVolumeName: "subVolumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", SubVolumeName: "sUbVoLuMeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/subvolumes/id_volume.go b/resource-manager/netapp/2023-07-01/subvolumes/id_volume.go index 8ed26a30d21..1b621f47327 100644 --- a/resource-manager/netapp/2023-07-01/subvolumes/id_volume.go +++ b/resource-manager/netapp/2023-07-01/subvolumes/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/subvolumes/id_volume_test.go b/resource-manager/netapp/2023-07-01/subvolumes/id_volume_test.go index 5c6f5f7253b..31c7ff8fe02 100644 --- a/resource-manager/netapp/2023-07-01/subvolumes/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/subvolumes/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumegroups/README.md b/resource-manager/netapp/2023-07-01/volumegroups/README.md index 2bbe12dc595..1fe07bebd61 100644 --- a/resource-manager/netapp/2023-07-01/volumegroups/README.md +++ b/resource-manager/netapp/2023-07-01/volumegroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") payload := volumegroups.VolumeGroupDetails{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.ListByNetAppAccount(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-07-01/volumegroups/id_netappaccount.go b/resource-manager/netapp/2023-07-01/volumegroups/id_netappaccount.go index 11b871e68f6..b76f8ad025d 100644 --- a/resource-manager/netapp/2023-07-01/volumegroups/id_netappaccount.go +++ b/resource-manager/netapp/2023-07-01/volumegroups/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-07-01/volumegroups/id_netappaccount_test.go b/resource-manager/netapp/2023-07-01/volumegroups/id_netappaccount_test.go index f3423437a45..ea57dfac8fc 100644 --- a/resource-manager/netapp/2023-07-01/volumegroups/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-07-01/volumegroups/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumegroups/id_volumegroup.go b/resource-manager/netapp/2023-07-01/volumegroups/id_volumegroup.go index 16d7214529e..2fbfb2b2133 100644 --- a/resource-manager/netapp/2023-07-01/volumegroups/id_volumegroup.go +++ b/resource-manager/netapp/2023-07-01/volumegroups/id_volumegroup.go @@ -121,7 +121,7 @@ func (id VolumeGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupName"), } diff --git a/resource-manager/netapp/2023-07-01/volumegroups/id_volumegroup_test.go b/resource-manager/netapp/2023-07-01/volumegroups/id_volumegroup_test.go index 2ec1015141c..9a1dd20a884 100644 --- a/resource-manager/netapp/2023-07-01/volumegroups/id_volumegroup_test.go +++ b/resource-manager/netapp/2023-07-01/volumegroups/id_volumegroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeGroupId{} func TestNewVolumeGroupID(t *testing.T) { - id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") + id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVolumeGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.VolumeGroupName != "volumeGroupName" { @@ -32,8 +32,8 @@ func TestNewVolumeGroupID(t *testing.T) { } func TestFormatVolumeGroupID(t *testing.T) { - actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName" + actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVolumeGroupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", VolumeGroupName: "volumeGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVolumeGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", VolumeGroupName: "volumeGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", VolumeGroupName: "vOlUmEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumequotarules/README.md b/resource-manager/netapp/2023-07-01/volumequotarules/README.md index 9ba589b40bb..d4fb532df98 100644 --- a/resource-manager/netapp/2023-07-01/volumequotarules/README.md +++ b/resource-manager/netapp/2023-07-01/volumequotarules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") payload := volumequotarules.VolumeQuotaRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.ListByVolume(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") payload := volumequotarules.VolumeQuotaRulePatch{ // ... diff --git a/resource-manager/netapp/2023-07-01/volumequotarules/id_volume.go b/resource-manager/netapp/2023-07-01/volumequotarules/id_volume.go index 149860704d1..f3aab9f00df 100644 --- a/resource-manager/netapp/2023-07-01/volumequotarules/id_volume.go +++ b/resource-manager/netapp/2023-07-01/volumequotarules/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/volumequotarules/id_volume_test.go b/resource-manager/netapp/2023-07-01/volumequotarules/id_volume_test.go index 34ce0b19c6a..c0acc543f9f 100644 --- a/resource-manager/netapp/2023-07-01/volumequotarules/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/volumequotarules/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumequotarules/id_volumequotarule.go b/resource-manager/netapp/2023-07-01/volumequotarules/id_volumequotarule.go index 0884c5a5035..9007e1468ae 100644 --- a/resource-manager/netapp/2023-07-01/volumequotarules/id_volumequotarule.go +++ b/resource-manager/netapp/2023-07-01/volumequotarules/id_volumequotarule.go @@ -133,9 +133,9 @@ func (id VolumeQuotaRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticVolumeQuotaRules", "volumeQuotaRules", "volumeQuotaRules"), diff --git a/resource-manager/netapp/2023-07-01/volumequotarules/id_volumequotarule_test.go b/resource-manager/netapp/2023-07-01/volumequotarules/id_volumequotarule_test.go index 35b6e35e74d..3b3ee84e25f 100644 --- a/resource-manager/netapp/2023-07-01/volumequotarules/id_volumequotarule_test.go +++ b/resource-manager/netapp/2023-07-01/volumequotarules/id_volumequotarule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeQuotaRuleId{} func TestNewVolumeQuotaRuleID(t *testing.T) { - id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") + id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeQuotaRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -40,8 +40,8 @@ func TestNewVolumeQuotaRuleID(t *testing.T) { } func TestFormatVolumeQuotaRuleID(t *testing.T) { - actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName" + actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseVolumeQuotaRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", VolumeQuotaRuleName: "volumeQuotaRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseVolumeQuotaRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", VolumeQuotaRuleName: "volumeQuotaRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", VolumeQuotaRuleName: "vOlUmEqUoTaRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumes/README.md b/resource-manager/netapp/2023-07-01/volumes/README.md index d7a1092719b..add9d2dddfe 100644 --- a/resource-manager/netapp/2023-07-01/volumes/README.md +++ b/resource-manager/netapp/2023-07-01/volumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumes.Volume{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions() ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumes.VolumePatch{ // ... diff --git a/resource-manager/netapp/2023-07-01/volumes/id_capacitypool.go b/resource-manager/netapp/2023-07-01/volumes/id_capacitypool.go index e667d5a5691..4a5cb95b3e2 100644 --- a/resource-manager/netapp/2023-07-01/volumes/id_capacitypool.go +++ b/resource-manager/netapp/2023-07-01/volumes/id_capacitypool.go @@ -121,9 +121,9 @@ func (id CapacityPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), } } diff --git a/resource-manager/netapp/2023-07-01/volumes/id_capacitypool_test.go b/resource-manager/netapp/2023-07-01/volumes/id_capacitypool_test.go index a247ffa7040..c84c57d8196 100644 --- a/resource-manager/netapp/2023-07-01/volumes/id_capacitypool_test.go +++ b/resource-manager/netapp/2023-07-01/volumes/id_capacitypool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityPoolId{} func TestNewCapacityPoolID(t *testing.T) { - id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCapacityPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } } func TestFormatCapacityPoolID(t *testing.T) { - actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName" + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCapacityPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCapacityPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumes/id_volume.go b/resource-manager/netapp/2023-07-01/volumes/id_volume.go index a41faa0cf26..9335df28621 100644 --- a/resource-manager/netapp/2023-07-01/volumes/id_volume.go +++ b/resource-manager/netapp/2023-07-01/volumes/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/volumes/id_volume_test.go b/resource-manager/netapp/2023-07-01/volumes/id_volume_test.go index e4d721e4299..a08cc9318a1 100644 --- a/resource-manager/netapp/2023-07-01/volumes/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/volumes/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumesrelocation/README.md b/resource-manager/netapp/2023-07-01/volumesrelocation/README.md index 48276fb3121..18322a44373 100644 --- a/resource-manager/netapp/2023-07-01/volumesrelocation/README.md +++ b/resource-manager/netapp/2023-07-01/volumesrelocation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesrelocation.RelocateVolumeRequest{ // ... @@ -53,7 +53,7 @@ if err := client.VolumesRelocateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesRevertRelocationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/netapp/2023-07-01/volumesrelocation/id_volume.go b/resource-manager/netapp/2023-07-01/volumesrelocation/id_volume.go index a2dc8db451a..113162da6d7 100644 --- a/resource-manager/netapp/2023-07-01/volumesrelocation/id_volume.go +++ b/resource-manager/netapp/2023-07-01/volumesrelocation/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/volumesrelocation/id_volume_test.go b/resource-manager/netapp/2023-07-01/volumesrelocation/id_volume_test.go index 81640dbd2c8..6a87e3c4d06 100644 --- a/resource-manager/netapp/2023-07-01/volumesrelocation/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/volumesrelocation/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumesreplication/README.md b/resource-manager/netapp/2023-07-01/volumesreplication/README.md index b69ea304e8e..2aa368bbe58 100644 --- a/resource-manager/netapp/2023-07-01/volumesreplication/README.md +++ b/resource-manager/netapp/2023-07-01/volumesreplication/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.AuthorizeRequest{ // ... @@ -41,7 +41,7 @@ if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.BreakReplicationRequest{ // ... @@ -58,7 +58,7 @@ if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.VolumesListReplications(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.ReestablishReplicationRequest{ // ... @@ -115,7 +115,7 @@ if err := client.VolumesReestablishReplicationThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.VolumesReplicationStatus(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/netapp/2023-07-01/volumesreplication/id_volume.go b/resource-manager/netapp/2023-07-01/volumesreplication/id_volume.go index d5cd1a7bb6b..f4997248ba1 100644 --- a/resource-manager/netapp/2023-07-01/volumesreplication/id_volume.go +++ b/resource-manager/netapp/2023-07-01/volumesreplication/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/volumesreplication/id_volume_test.go b/resource-manager/netapp/2023-07-01/volumesreplication/id_volume_test.go index 482df2f378c..51db68a7df6 100644 --- a/resource-manager/netapp/2023-07-01/volumesreplication/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/volumesreplication/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-07-01/volumesrevert/README.md b/resource-manager/netapp/2023-07-01/volumesrevert/README.md index ea286261e43..8e6e978a401 100644 --- a/resource-manager/netapp/2023-07-01/volumesrevert/README.md +++ b/resource-manager/netapp/2023-07-01/volumesrevert/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesrevert.VolumeRevert{ // ... diff --git a/resource-manager/netapp/2023-07-01/volumesrevert/id_volume.go b/resource-manager/netapp/2023-07-01/volumesrevert/id_volume.go index a8685593a26..e61cfcfca50 100644 --- a/resource-manager/netapp/2023-07-01/volumesrevert/id_volume.go +++ b/resource-manager/netapp/2023-07-01/volumesrevert/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-07-01/volumesrevert/id_volume_test.go b/resource-manager/netapp/2023-07-01/volumesrevert/id_volume_test.go index c7514e428c8..f26bf43ecc3 100644 --- a/resource-manager/netapp/2023-07-01/volumesrevert/id_volume_test.go +++ b/resource-manager/netapp/2023-07-01/volumesrevert/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/README.md b/resource-manager/netapp/2023-11-01/backuppolicy/README.md index 550891c55bf..26aabef91f0 100644 --- a/resource-manager/netapp/2023-11-01/backuppolicy/README.md +++ b/resource-manager/netapp/2023-11-01/backuppolicy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") payload := backuppolicy.BackupPolicy{ // ... @@ -41,7 +41,7 @@ if err := client.BackupPoliciesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") read, err := client.BackupPoliciesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.BackupPoliciesList(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") payload := backuppolicy.BackupPolicyPatch{ // ... diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy.go b/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy.go index 20a4fb7fa7d..7e2cd95f210 100644 --- a/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy.go +++ b/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy.go @@ -121,7 +121,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy_test.go b/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy_test.go index 8fc9ee76db7..39877320168 100644 --- a/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy_test.go +++ b/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupPolicyName != "backupPolicyName" { @@ -32,8 +32,8 @@ func TestNewBackupPolicyID(t *testing.T) { } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount.go b/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount.go index 171fea3e381..b10e89e1ad1 100644 --- a/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount.go +++ b/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount_test.go index 39611256a73..455b109bb39 100644 --- a/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/backups/README.md b/resource-manager/netapp/2023-11-01/backups/README.md index e1f93fcb493..ee414f92447 100644 --- a/resource-manager/netapp/2023-11-01/backups/README.md +++ b/resource-manager/netapp/2023-11-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") payload := backups.Backup{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.GetLatestStatus(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backups.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") // alternatively `client.ListByVault(ctx, id, backups.DefaultListByVaultOperationOptions())` can be used to do batched pagination items, err := client.ListByVaultComplete(ctx, id, backups.DefaultListByVaultOperationOptions()) @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := backups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := backups.BackupsMigrationRequest{ // ... @@ -119,7 +119,7 @@ if err := client.UnderAccountMigrateBackupsThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") payload := backups.BackupRestoreFiles{ // ... @@ -136,7 +136,7 @@ if err := client.UnderBackupVaultRestoreFilesThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := backups.BackupsMigrationRequest{ // ... @@ -153,7 +153,7 @@ if err := client.UnderVolumeMigrateBackupsThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") payload := backups.BackupPatch{ // ... diff --git a/resource-manager/netapp/2023-11-01/backups/id_backup.go b/resource-manager/netapp/2023-11-01/backups/id_backup.go index 152e8b94c80..06aacd5f5b5 100644 --- a/resource-manager/netapp/2023-11-01/backups/id_backup.go +++ b/resource-manager/netapp/2023-11-01/backups/id_backup.go @@ -127,7 +127,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), diff --git a/resource-manager/netapp/2023-11-01/backups/id_backup_test.go b/resource-manager/netapp/2023-11-01/backups/id_backup_test.go index c216cb4676d..02c2ee418cc 100644 --- a/resource-manager/netapp/2023-11-01/backups/id_backup_test.go +++ b/resource-manager/netapp/2023-11-01/backups/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupVaultName != "backupVaultName" { @@ -36,8 +36,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs/bAcKuPnAmE", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupVaultName: "bAcKuPvAuLtNaMe", BackupName: "bAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs/bAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/backups/id_backupvault.go b/resource-manager/netapp/2023-11-01/backups/id_backupvault.go index 2d6907386af..779adf353ca 100644 --- a/resource-manager/netapp/2023-11-01/backups/id_backupvault.go +++ b/resource-manager/netapp/2023-11-01/backups/id_backupvault.go @@ -121,7 +121,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } diff --git a/resource-manager/netapp/2023-11-01/backups/id_backupvault_test.go b/resource-manager/netapp/2023-11-01/backups/id_backupvault_test.go index 2d14a53b024..1601bd44bc7 100644 --- a/resource-manager/netapp/2023-11-01/backups/id_backupvault_test.go +++ b/resource-manager/netapp/2023-11-01/backups/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupVaultName != "backupVaultName" { @@ -32,8 +32,8 @@ func TestNewBackupVaultID(t *testing.T) { } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/backups/id_netappaccount.go b/resource-manager/netapp/2023-11-01/backups/id_netappaccount.go index c2943e4d090..516c7ff3911 100644 --- a/resource-manager/netapp/2023-11-01/backups/id_netappaccount.go +++ b/resource-manager/netapp/2023-11-01/backups/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-11-01/backups/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/backups/id_netappaccount_test.go index ecb7d1fab48..18f86cc0302 100644 --- a/resource-manager/netapp/2023-11-01/backups/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-11-01/backups/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/backups/id_volume.go b/resource-manager/netapp/2023-11-01/backups/id_volume.go index fbe9872d155..68f2aee4179 100644 --- a/resource-manager/netapp/2023-11-01/backups/id_volume.go +++ b/resource-manager/netapp/2023-11-01/backups/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/backups/id_volume_test.go b/resource-manager/netapp/2023-11-01/backups/id_volume_test.go index 0c40f8bf1b1..8f1a2ec3f88 100644 --- a/resource-manager/netapp/2023-11-01/backups/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/backups/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/backupvaults/README.md b/resource-manager/netapp/2023-11-01/backupvaults/README.md index 9dd4f603e96..0418318cc1f 100644 --- a/resource-manager/netapp/2023-11-01/backupvaults/README.md +++ b/resource-manager/netapp/2023-11-01/backupvaults/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") payload := backupvaults.BackupVault{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backupvaults.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := backupvaults.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") // alternatively `client.ListByNetAppAccount(ctx, id)` can be used to do batched pagination items, err := client.ListByNetAppAccountComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") payload := backupvaults.BackupVaultPatch{ // ... diff --git a/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault.go b/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault.go index 308491d2c9a..84c03165062 100644 --- a/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault.go +++ b/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault.go @@ -121,7 +121,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } diff --git a/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault_test.go b/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault_test.go index 7bf44cad2eb..2a77aec3df2 100644 --- a/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault_test.go +++ b/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupVaultName != "backupVaultName" { @@ -32,8 +32,8 @@ func TestNewBackupVaultID(t *testing.T) { } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount.go b/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount.go index 69069fa7196..203dcf207ec 100644 --- a/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount.go +++ b/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount_test.go index 17f20e37685..151b0b66fb7 100644 --- a/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/capacitypools/README.md b/resource-manager/netapp/2023-11-01/capacitypools/README.md index bcc0cd3e5fe..698fc5d8d0a 100644 --- a/resource-manager/netapp/2023-11-01/capacitypools/README.md +++ b/resource-manager/netapp/2023-11-01/capacitypools/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") payload := capacitypools.CapacityPool{ // ... @@ -41,7 +41,7 @@ if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") read, err := client.PoolsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") // alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination items, err := client.PoolsListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") payload := capacitypools.CapacityPoolPatch{ // ... diff --git a/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool.go b/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool.go index 5f54bf96057..0e041090dd4 100644 --- a/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool.go +++ b/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool.go @@ -121,9 +121,9 @@ func (id CapacityPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), } } diff --git a/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool_test.go b/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool_test.go index e19faa4852d..6bfc38a792d 100644 --- a/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool_test.go +++ b/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityPoolId{} func TestNewCapacityPoolID(t *testing.T) { - id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCapacityPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } } func TestFormatCapacityPoolID(t *testing.T) { - actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName" + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCapacityPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCapacityPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount.go b/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount.go index 0a3b033027e..58a09e2952e 100644 --- a/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount.go +++ b/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount_test.go index 7a337eb7048..91d9bae2f9f 100644 --- a/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/filelocks/README.md b/resource-manager/netapp/2023-11-01/filelocks/README.md index 965d7a644f2..4fa4f4d262d 100644 --- a/resource-manager/netapp/2023-11-01/filelocks/README.md +++ b/resource-manager/netapp/2023-11-01/filelocks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := filelocks.BreakFileLocksRequest{ // ... diff --git a/resource-manager/netapp/2023-11-01/filelocks/id_volume.go b/resource-manager/netapp/2023-11-01/filelocks/id_volume.go index 1bc8b7d703a..660324eb77b 100644 --- a/resource-manager/netapp/2023-11-01/filelocks/id_volume.go +++ b/resource-manager/netapp/2023-11-01/filelocks/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/filelocks/id_volume_test.go b/resource-manager/netapp/2023-11-01/filelocks/id_volume_test.go index 53c183e76a9..1ae0d4861ac 100644 --- a/resource-manager/netapp/2023-11-01/filelocks/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/filelocks/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/README.md b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/README.md index 54092d5bc95..7b6e62c5657 100644 --- a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/README.md +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := groupidlistforldapuser.GetGroupIdListForLDAPUserRequest{ // ... diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume.go index 343367eda42..597c3e852ab 100644 --- a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume.go +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume_test.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume_test.go index 613e3ba7e8b..ad956e12e12 100644 --- a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/README.md b/resource-manager/netapp/2023-11-01/netappaccounts/README.md index 519c096b8c2..392a53bd22c 100644 --- a/resource-manager/netapp/2023-11-01/netappaccounts/README.md +++ b/resource-manager/netapp/2023-11-01/netappaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := netappaccounts.NetAppAccount{ // ... @@ -42,7 +42,7 @@ if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.AccountsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := netappaccounts.NetAppAccountPatch{ // ... diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount.go b/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount.go index a551456fc35..e49b1665e3b 100644 --- a/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount.go +++ b/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount_test.go index f103b75d288..ef0ce3e4636 100644 --- a/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/netappresource/README.md b/resource-manager/netapp/2023-11-01/netappresource/README.md index 137d5128808..beaae4b0407 100644 --- a/resource-manager/netapp/2023-11-01/netappresource/README.md +++ b/resource-manager/netapp/2023-11-01/netappresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.FilePathAvailabilityRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.ResourceNameAvailabilityRequest{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.QuotaAvailabilityRequest{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.QueryNetworkSiblingSetRequest{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.QueryRegionInfo(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName") +id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName") read, err := client.QuotaLimitsGet(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.QuotaLimitsList(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RegionInfosGet(ctx, id) if err != nil { @@ -172,7 +172,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.RegionInfosList(ctx, id)` can be used to do batched pagination items, err := client.RegionInfosListComplete(ctx, id) @@ -189,7 +189,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.UpdateNetworkSiblingSetRequest{ // ... diff --git a/resource-manager/netapp/2023-11-01/netappresource/id_location.go b/resource-manager/netapp/2023-11-01/netappresource/id_location.go index ce496afe734..7f5f70c69df 100644 --- a/resource-manager/netapp/2023-11-01/netappresource/id_location.go +++ b/resource-manager/netapp/2023-11-01/netappresource/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/netapp/2023-11-01/netappresource/id_location_test.go b/resource-manager/netapp/2023-11-01/netappresource/id_location_test.go index f37ef0bd41e..6e374aa4ecb 100644 --- a/resource-manager/netapp/2023-11-01/netappresource/id_location_test.go +++ b/resource-manager/netapp/2023-11-01/netappresource/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit.go b/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit.go index d4a65d40520..b35ac4de378 100644 --- a/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit.go +++ b/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit.go @@ -113,7 +113,7 @@ func (id QuotaLimitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticQuotaLimits", "quotaLimits", "quotaLimits"), resourceids.UserSpecifiedSegment("quotaLimitName", "quotaLimitName"), } diff --git a/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit_test.go b/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit_test.go index e3a0299b8ae..3d154522c0a 100644 --- a/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit_test.go +++ b/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &QuotaLimitId{} func TestNewQuotaLimitID(t *testing.T) { - id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName") + id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.QuotaLimitName != "quotaLimitName" { @@ -28,8 +28,8 @@ func TestNewQuotaLimitID(t *testing.T) { } func TestFormatQuotaLimitID(t *testing.T) { - actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName" + actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseQuotaLimitID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", QuotaLimitName: "quotaLimitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseQuotaLimitIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", QuotaLimitName: "quotaLimitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs/qUoTaLiMiTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs/qUoTaLiMiTnAmE", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", QuotaLimitName: "qUoTaLiMiTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs/qUoTaLiMiTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs/qUoTaLiMiTnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/poolchange/README.md b/resource-manager/netapp/2023-11-01/poolchange/README.md index 7550337868a..425a3bf48cf 100644 --- a/resource-manager/netapp/2023-11-01/poolchange/README.md +++ b/resource-manager/netapp/2023-11-01/poolchange/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := poolchange.PoolChangeRequest{ // ... diff --git a/resource-manager/netapp/2023-11-01/poolchange/id_volume.go b/resource-manager/netapp/2023-11-01/poolchange/id_volume.go index f4189a2d706..db883b5bdcb 100644 --- a/resource-manager/netapp/2023-11-01/poolchange/id_volume.go +++ b/resource-manager/netapp/2023-11-01/poolchange/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/poolchange/id_volume_test.go b/resource-manager/netapp/2023-11-01/poolchange/id_volume_test.go index 49b57227550..85f31b29d70 100644 --- a/resource-manager/netapp/2023-11-01/poolchange/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/poolchange/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume.go b/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume.go index 965a410354b..c5a2844bb7b 100644 --- a/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume.go +++ b/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume_test.go b/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume_test.go index 4bdb1e229ac..0b3b2133026 100644 --- a/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/restore/README.md b/resource-manager/netapp/2023-11-01/restore/README.md index 8896b20ec97..e58757442a9 100644 --- a/resource-manager/netapp/2023-11-01/restore/README.md +++ b/resource-manager/netapp/2023-11-01/restore/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.BackupsGetVolumeLatestRestoreStatus(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-11-01/restore/id_volume.go b/resource-manager/netapp/2023-11-01/restore/id_volume.go index 6944bf94a87..9e76588a555 100644 --- a/resource-manager/netapp/2023-11-01/restore/id_volume.go +++ b/resource-manager/netapp/2023-11-01/restore/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/restore/id_volume_test.go b/resource-manager/netapp/2023-11-01/restore/id_volume_test.go index 12722b5829a..7762bc57cb4 100644 --- a/resource-manager/netapp/2023-11-01/restore/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/restore/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/README.md b/resource-manager/netapp/2023-11-01/snapshotpolicy/README.md index 4a917ba97ba..c13a016989b 100644 --- a/resource-manager/netapp/2023-11-01/snapshotpolicy/README.md +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") payload := snapshotpolicy.SnapshotPolicy{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") read, err := client.SnapshotPoliciesGet(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.SnapshotPoliciesList(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") payload := snapshotpolicy.SnapshotPolicyPatch{ // ... diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount.go index 2a04383c0de..14deafbb222 100644 --- a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount.go +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount_test.go index c0601bb3a54..37ac2f7a327 100644 --- a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy.go index 4db1ae3a00d..0f5ca81ebc0 100644 --- a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy.go +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy.go @@ -121,7 +121,7 @@ func (id SnapshotPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyName"), } diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy_test.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy_test.go index 5151bfdfc6a..47db3863892 100644 --- a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy_test.go +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotPolicyId{} func TestNewSnapshotPolicyID(t *testing.T) { - id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.SnapshotPolicyName != "snapshotPolicyName" { @@ -32,8 +32,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { } func TestFormatSnapshotPolicyID(t *testing.T) { - actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName" + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", SnapshotPolicyName: "sNaPsHoTpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/README.md b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/README.md index 340481d20cb..ad552f551ae 100644 --- a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/README.md +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") read, err := client.SnapshotPoliciesListVolumes(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy.go index 6bf4b598a83..c366a171e15 100644 --- a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy.go +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy.go @@ -121,7 +121,7 @@ func (id SnapshotPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyName"), } diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go index 1b469bc2282..8dad1f1572b 100644 --- a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotPolicyId{} func TestNewSnapshotPolicyID(t *testing.T) { - id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.SnapshotPolicyName != "snapshotPolicyName" { @@ -32,8 +32,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { } func TestFormatSnapshotPolicyID(t *testing.T) { - actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName" + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", SnapshotPolicyName: "sNaPsHoTpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/snapshots/README.md b/resource-manager/netapp/2023-11-01/snapshots/README.md index d52b449e6d4..ee4ceba7ac5 100644 --- a/resource-manager/netapp/2023-11-01/snapshots/README.md +++ b/resource-manager/netapp/2023-11-01/snapshots/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") payload := snapshots.Snapshot{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.List(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") payload := snapshots.SnapshotRestoreFiles{ // ... @@ -102,7 +102,7 @@ if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") var payload interface{} if err := client.UpdateThenPoll(ctx, id, payload); err != nil { diff --git a/resource-manager/netapp/2023-11-01/snapshots/id_snapshot.go b/resource-manager/netapp/2023-11-01/snapshots/id_snapshot.go index bb9f92dd3d8..2fe36d4f5a9 100644 --- a/resource-manager/netapp/2023-11-01/snapshots/id_snapshot.go +++ b/resource-manager/netapp/2023-11-01/snapshots/id_snapshot.go @@ -133,9 +133,9 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/netapp/2023-11-01/snapshots/id_snapshot_test.go b/resource-manager/netapp/2023-11-01/snapshots/id_snapshot_test.go index bf07ef37b3f..1aae8e6ed5c 100644 --- a/resource-manager/netapp/2023-11-01/snapshots/id_snapshot_test.go +++ b/resource-manager/netapp/2023-11-01/snapshots/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -40,8 +40,8 @@ func TestNewSnapshotID(t *testing.T) { } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", SnapshotName: "sNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/snapshots/id_volume.go b/resource-manager/netapp/2023-11-01/snapshots/id_volume.go index 3c7c80a660d..dcd1ab5e98b 100644 --- a/resource-manager/netapp/2023-11-01/snapshots/id_volume.go +++ b/resource-manager/netapp/2023-11-01/snapshots/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/snapshots/id_volume_test.go b/resource-manager/netapp/2023-11-01/snapshots/id_volume_test.go index 4179bacaad9..010624ba420 100644 --- a/resource-manager/netapp/2023-11-01/snapshots/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/snapshots/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/subvolumes/README.md b/resource-manager/netapp/2023-11-01/subvolumes/README.md index bc5850aa20b..06579ffc32f 100644 --- a/resource-manager/netapp/2023-11-01/subvolumes/README.md +++ b/resource-manager/netapp/2023-11-01/subvolumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") payload := subvolumes.SubvolumeInfo{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if err := client.GetMetadataThenPoll(ctx, id); err != nil { // handle the error @@ -81,7 +81,7 @@ if err := client.GetMetadataThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") // alternatively `client.ListByVolume(ctx, id)` can be used to do batched pagination items, err := client.ListByVolumeComplete(ctx, id) @@ -98,7 +98,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") payload := subvolumes.SubvolumePatchRequest{ // ... diff --git a/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume.go b/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume.go index 67d0d1b4c05..d9ceec6f9e6 100644 --- a/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume.go +++ b/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume.go @@ -133,13 +133,13 @@ func (id SubVolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticSubVolumes", "subVolumes", "subVolumes"), - resourceids.UserSpecifiedSegment("subVolumeName", "subvolumeName"), + resourceids.UserSpecifiedSegment("subVolumeName", "subVolumeName"), } } diff --git a/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume_test.go b/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume_test.go index 086c5a8e4fd..c427629eb5d 100644 --- a/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume_test.go +++ b/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SubVolumeId{} func TestNewSubVolumeID(t *testing.T) { - id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") + id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewSubVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeName") } - if id.SubVolumeName != "subvolumeName" { - t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subvolumeName") + if id.SubVolumeName != "subVolumeName" { + t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subVolumeName") } } func TestFormatSubVolumeID(t *testing.T) { - actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName" + actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSubVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", - SubVolumeName: "subvolumeName", + SubVolumeName: "subVolumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSubVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", - SubVolumeName: "subvolumeName", + SubVolumeName: "subVolumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", SubVolumeName: "sUbVoLuMeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/subvolumes/id_volume.go b/resource-manager/netapp/2023-11-01/subvolumes/id_volume.go index 8ed26a30d21..1b621f47327 100644 --- a/resource-manager/netapp/2023-11-01/subvolumes/id_volume.go +++ b/resource-manager/netapp/2023-11-01/subvolumes/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/subvolumes/id_volume_test.go b/resource-manager/netapp/2023-11-01/subvolumes/id_volume_test.go index 5c6f5f7253b..31c7ff8fe02 100644 --- a/resource-manager/netapp/2023-11-01/subvolumes/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/subvolumes/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumegroups/README.md b/resource-manager/netapp/2023-11-01/volumegroups/README.md index 38da7faea8c..8954b317250 100644 --- a/resource-manager/netapp/2023-11-01/volumegroups/README.md +++ b/resource-manager/netapp/2023-11-01/volumegroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") payload := volumegroups.VolumeGroupDetails{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.ListByNetAppAccount(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount.go b/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount.go index 11b871e68f6..b76f8ad025d 100644 --- a/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount.go +++ b/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount_test.go index f3423437a45..ea57dfac8fc 100644 --- a/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount_test.go +++ b/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup.go b/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup.go index 16d7214529e..2fbfb2b2133 100644 --- a/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup.go +++ b/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup.go @@ -121,7 +121,7 @@ func (id VolumeGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupName"), } diff --git a/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup_test.go b/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup_test.go index 2ec1015141c..9a1dd20a884 100644 --- a/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup_test.go +++ b/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeGroupId{} func TestNewVolumeGroupID(t *testing.T) { - id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") + id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVolumeGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.VolumeGroupName != "volumeGroupName" { @@ -32,8 +32,8 @@ func TestNewVolumeGroupID(t *testing.T) { } func TestFormatVolumeGroupID(t *testing.T) { - actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName" + actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVolumeGroupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", VolumeGroupName: "volumeGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVolumeGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", VolumeGroupName: "volumeGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", VolumeGroupName: "vOlUmEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/README.md b/resource-manager/netapp/2023-11-01/volumequotarules/README.md index 78520444aa3..ddea9d169a6 100644 --- a/resource-manager/netapp/2023-11-01/volumequotarules/README.md +++ b/resource-manager/netapp/2023-11-01/volumequotarules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") payload := volumequotarules.VolumeQuotaRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.ListByVolume(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") payload := volumequotarules.VolumeQuotaRulePatch{ // ... diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/id_volume.go b/resource-manager/netapp/2023-11-01/volumequotarules/id_volume.go index 149860704d1..f3aab9f00df 100644 --- a/resource-manager/netapp/2023-11-01/volumequotarules/id_volume.go +++ b/resource-manager/netapp/2023-11-01/volumequotarules/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumequotarules/id_volume_test.go index 34ce0b19c6a..c0acc543f9f 100644 --- a/resource-manager/netapp/2023-11-01/volumequotarules/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/volumequotarules/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule.go b/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule.go index 0884c5a5035..9007e1468ae 100644 --- a/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule.go +++ b/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule.go @@ -133,9 +133,9 @@ func (id VolumeQuotaRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticVolumeQuotaRules", "volumeQuotaRules", "volumeQuotaRules"), diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule_test.go b/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule_test.go index 35b6e35e74d..3b3ee84e25f 100644 --- a/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule_test.go +++ b/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeQuotaRuleId{} func TestNewVolumeQuotaRuleID(t *testing.T) { - id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") + id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeQuotaRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -40,8 +40,8 @@ func TestNewVolumeQuotaRuleID(t *testing.T) { } func TestFormatVolumeQuotaRuleID(t *testing.T) { - actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName" + actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseVolumeQuotaRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", VolumeQuotaRuleName: "volumeQuotaRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseVolumeQuotaRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", VolumeQuotaRuleName: "volumeQuotaRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", VolumeQuotaRuleName: "vOlUmEqUoTaRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumes/README.md b/resource-manager/netapp/2023-11-01/volumes/README.md index 719d66ff03a..34be00eae1a 100644 --- a/resource-manager/netapp/2023-11-01/volumes/README.md +++ b/resource-manager/netapp/2023-11-01/volumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumes.Volume{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions() ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumes.VolumePatch{ // ... diff --git a/resource-manager/netapp/2023-11-01/volumes/id_capacitypool.go b/resource-manager/netapp/2023-11-01/volumes/id_capacitypool.go index e667d5a5691..4a5cb95b3e2 100644 --- a/resource-manager/netapp/2023-11-01/volumes/id_capacitypool.go +++ b/resource-manager/netapp/2023-11-01/volumes/id_capacitypool.go @@ -121,9 +121,9 @@ func (id CapacityPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), } } diff --git a/resource-manager/netapp/2023-11-01/volumes/id_capacitypool_test.go b/resource-manager/netapp/2023-11-01/volumes/id_capacitypool_test.go index a247ffa7040..c84c57d8196 100644 --- a/resource-manager/netapp/2023-11-01/volumes/id_capacitypool_test.go +++ b/resource-manager/netapp/2023-11-01/volumes/id_capacitypool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityPoolId{} func TestNewCapacityPoolID(t *testing.T) { - id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCapacityPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } } func TestFormatCapacityPoolID(t *testing.T) { - actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName" + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCapacityPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCapacityPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumes/id_volume.go b/resource-manager/netapp/2023-11-01/volumes/id_volume.go index a41faa0cf26..9335df28621 100644 --- a/resource-manager/netapp/2023-11-01/volumes/id_volume.go +++ b/resource-manager/netapp/2023-11-01/volumes/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/volumes/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumes/id_volume_test.go index e4d721e4299..a08cc9318a1 100644 --- a/resource-manager/netapp/2023-11-01/volumes/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/volumes/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/README.md b/resource-manager/netapp/2023-11-01/volumesrelocation/README.md index c05281de3e6..0d024d7ce8b 100644 --- a/resource-manager/netapp/2023-11-01/volumesrelocation/README.md +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesrelocation.RelocateVolumeRequest{ // ... @@ -53,7 +53,7 @@ if err := client.VolumesRelocateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesRevertRelocationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume.go b/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume.go index a2dc8db451a..113162da6d7 100644 --- a/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume.go +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume_test.go index 81640dbd2c8..6a87e3c4d06 100644 --- a/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/README.md b/resource-manager/netapp/2023-11-01/volumesreplication/README.md index c92dd8f7e42..4ba45d9e069 100644 --- a/resource-manager/netapp/2023-11-01/volumesreplication/README.md +++ b/resource-manager/netapp/2023-11-01/volumesreplication/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.AuthorizeRequest{ // ... @@ -41,7 +41,7 @@ if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.BreakReplicationRequest{ // ... @@ -58,7 +58,7 @@ if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.VolumesListReplications(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.ReestablishReplicationRequest{ // ... @@ -115,7 +115,7 @@ if err := client.VolumesReestablishReplicationThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.VolumesReplicationStatus(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/id_volume.go b/resource-manager/netapp/2023-11-01/volumesreplication/id_volume.go index d5cd1a7bb6b..f4997248ba1 100644 --- a/resource-manager/netapp/2023-11-01/volumesreplication/id_volume.go +++ b/resource-manager/netapp/2023-11-01/volumesreplication/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumesreplication/id_volume_test.go index 482df2f378c..51db68a7df6 100644 --- a/resource-manager/netapp/2023-11-01/volumesreplication/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/volumesreplication/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/README.md b/resource-manager/netapp/2023-11-01/volumesrevert/README.md index f6438512528..7a5715ea64f 100644 --- a/resource-manager/netapp/2023-11-01/volumesrevert/README.md +++ b/resource-manager/netapp/2023-11-01/volumesrevert/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesrevert.VolumeRevert{ // ... diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/id_volume.go b/resource-manager/netapp/2023-11-01/volumesrevert/id_volume.go index a8685593a26..e61cfcfca50 100644 --- a/resource-manager/netapp/2023-11-01/volumesrevert/id_volume.go +++ b/resource-manager/netapp/2023-11-01/volumesrevert/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumesrevert/id_volume_test.go index c7514e428c8..f26bf43ecc3 100644 --- a/resource-manager/netapp/2023-11-01/volumesrevert/id_volume_test.go +++ b/resource-manager/netapp/2023-11-01/volumesrevert/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/backuppolicy/README.md b/resource-manager/netapp/2024-03-01/backuppolicy/README.md index d468feec79a..2d3e5eda766 100644 --- a/resource-manager/netapp/2024-03-01/backuppolicy/README.md +++ b/resource-manager/netapp/2024-03-01/backuppolicy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") payload := backuppolicy.BackupPolicy{ // ... @@ -41,7 +41,7 @@ if err := client.BackupPoliciesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") read, err := client.BackupPoliciesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.BackupPoliciesList(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") payload := backuppolicy.BackupPolicyPatch{ // ... diff --git a/resource-manager/netapp/2024-03-01/backuppolicy/id_backuppolicy.go b/resource-manager/netapp/2024-03-01/backuppolicy/id_backuppolicy.go index 20a4fb7fa7d..7e2cd95f210 100644 --- a/resource-manager/netapp/2024-03-01/backuppolicy/id_backuppolicy.go +++ b/resource-manager/netapp/2024-03-01/backuppolicy/id_backuppolicy.go @@ -121,7 +121,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } diff --git a/resource-manager/netapp/2024-03-01/backuppolicy/id_backuppolicy_test.go b/resource-manager/netapp/2024-03-01/backuppolicy/id_backuppolicy_test.go index 8fc9ee76db7..39877320168 100644 --- a/resource-manager/netapp/2024-03-01/backuppolicy/id_backuppolicy_test.go +++ b/resource-manager/netapp/2024-03-01/backuppolicy/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupPolicyName != "backupPolicyName" { @@ -32,8 +32,8 @@ func TestNewBackupPolicyID(t *testing.T) { } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupPolicies/backupPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/backuppolicy/id_netappaccount.go b/resource-manager/netapp/2024-03-01/backuppolicy/id_netappaccount.go index 171fea3e381..b10e89e1ad1 100644 --- a/resource-manager/netapp/2024-03-01/backuppolicy/id_netappaccount.go +++ b/resource-manager/netapp/2024-03-01/backuppolicy/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2024-03-01/backuppolicy/id_netappaccount_test.go b/resource-manager/netapp/2024-03-01/backuppolicy/id_netappaccount_test.go index 39611256a73..455b109bb39 100644 --- a/resource-manager/netapp/2024-03-01/backuppolicy/id_netappaccount_test.go +++ b/resource-manager/netapp/2024-03-01/backuppolicy/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/backups/README.md b/resource-manager/netapp/2024-03-01/backups/README.md index 6404d7a88b7..be38f5d3e72 100644 --- a/resource-manager/netapp/2024-03-01/backups/README.md +++ b/resource-manager/netapp/2024-03-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") payload := backups.Backup{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.GetLatestStatus(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backups.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") // alternatively `client.ListByVault(ctx, id, backups.DefaultListByVaultOperationOptions())` can be used to do batched pagination items, err := client.ListByVaultComplete(ctx, id, backups.DefaultListByVaultOperationOptions()) @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := backups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := backups.BackupsMigrationRequest{ // ... @@ -119,7 +119,7 @@ if err := client.UnderAccountMigrateBackupsThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") payload := backups.BackupRestoreFiles{ // ... @@ -136,7 +136,7 @@ if err := client.UnderBackupVaultRestoreFilesThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := backups.BackupsMigrationRequest{ // ... @@ -153,7 +153,7 @@ if err := client.UnderVolumeMigrateBackupsThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") payload := backups.BackupPatch{ // ... diff --git a/resource-manager/netapp/2024-03-01/backups/id_backup.go b/resource-manager/netapp/2024-03-01/backups/id_backup.go index 152e8b94c80..06aacd5f5b5 100644 --- a/resource-manager/netapp/2024-03-01/backups/id_backup.go +++ b/resource-manager/netapp/2024-03-01/backups/id_backup.go @@ -127,7 +127,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), diff --git a/resource-manager/netapp/2024-03-01/backups/id_backup_test.go b/resource-manager/netapp/2024-03-01/backups/id_backup_test.go index c216cb4676d..02c2ee418cc 100644 --- a/resource-manager/netapp/2024-03-01/backups/id_backup_test.go +++ b/resource-manager/netapp/2024-03-01/backups/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupVaultName != "backupVaultName" { @@ -36,8 +36,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName", "backupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/backups/backupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs/bAcKuPnAmE", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupVaultName: "bAcKuPvAuLtNaMe", BackupName: "bAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/bAcKuPs/bAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/backups/id_backupvault.go b/resource-manager/netapp/2024-03-01/backups/id_backupvault.go index 2d6907386af..779adf353ca 100644 --- a/resource-manager/netapp/2024-03-01/backups/id_backupvault.go +++ b/resource-manager/netapp/2024-03-01/backups/id_backupvault.go @@ -121,7 +121,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } diff --git a/resource-manager/netapp/2024-03-01/backups/id_backupvault_test.go b/resource-manager/netapp/2024-03-01/backups/id_backupvault_test.go index 2d14a53b024..1601bd44bc7 100644 --- a/resource-manager/netapp/2024-03-01/backups/id_backupvault_test.go +++ b/resource-manager/netapp/2024-03-01/backups/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupVaultName != "backupVaultName" { @@ -32,8 +32,8 @@ func TestNewBackupVaultID(t *testing.T) { } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/backups/id_netappaccount.go b/resource-manager/netapp/2024-03-01/backups/id_netappaccount.go index c2943e4d090..516c7ff3911 100644 --- a/resource-manager/netapp/2024-03-01/backups/id_netappaccount.go +++ b/resource-manager/netapp/2024-03-01/backups/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2024-03-01/backups/id_netappaccount_test.go b/resource-manager/netapp/2024-03-01/backups/id_netappaccount_test.go index ecb7d1fab48..18f86cc0302 100644 --- a/resource-manager/netapp/2024-03-01/backups/id_netappaccount_test.go +++ b/resource-manager/netapp/2024-03-01/backups/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/backups/id_volume.go b/resource-manager/netapp/2024-03-01/backups/id_volume.go index fbe9872d155..68f2aee4179 100644 --- a/resource-manager/netapp/2024-03-01/backups/id_volume.go +++ b/resource-manager/netapp/2024-03-01/backups/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/backups/id_volume_test.go b/resource-manager/netapp/2024-03-01/backups/id_volume_test.go index 0c40f8bf1b1..8f1a2ec3f88 100644 --- a/resource-manager/netapp/2024-03-01/backups/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/backups/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/backupvaults/README.md b/resource-manager/netapp/2024-03-01/backupvaults/README.md index ebeb2c3e6fb..9bc1ae14b5d 100644 --- a/resource-manager/netapp/2024-03-01/backupvaults/README.md +++ b/resource-manager/netapp/2024-03-01/backupvaults/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") payload := backupvaults.BackupVault{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backupvaults.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := backupvaults.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") // alternatively `client.ListByNetAppAccount(ctx, id)` can be used to do batched pagination items, err := client.ListByNetAppAccountComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") payload := backupvaults.BackupVaultPatch{ // ... diff --git a/resource-manager/netapp/2024-03-01/backupvaults/id_backupvault.go b/resource-manager/netapp/2024-03-01/backupvaults/id_backupvault.go index 308491d2c9a..84c03165062 100644 --- a/resource-manager/netapp/2024-03-01/backupvaults/id_backupvault.go +++ b/resource-manager/netapp/2024-03-01/backupvaults/id_backupvault.go @@ -121,7 +121,7 @@ func (id BackupVaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultName"), } diff --git a/resource-manager/netapp/2024-03-01/backupvaults/id_backupvault_test.go b/resource-manager/netapp/2024-03-01/backupvaults/id_backupvault_test.go index 7bf44cad2eb..2a77aec3df2 100644 --- a/resource-manager/netapp/2024-03-01/backupvaults/id_backupvault_test.go +++ b/resource-manager/netapp/2024-03-01/backupvaults/id_backupvault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupVaultId{} func TestNewBackupVaultID(t *testing.T) { - id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName") + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.BackupVaultName != "backupVaultName" { @@ -32,8 +32,8 @@ func TestNewBackupVaultID(t *testing.T) { } func TestFormatBackupVaultID(t *testing.T) { - actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "backupVaultName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName" + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "backupVaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupVaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupVaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", BackupVaultName: "backupVaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/backupVaults/backupVaultName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/backupVaults/backupVaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe", Expected: &BackupVaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", BackupVaultName: "bAcKuPvAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/bAcKuPvAuLtS/bAcKuPvAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/backupvaults/id_netappaccount.go b/resource-manager/netapp/2024-03-01/backupvaults/id_netappaccount.go index 69069fa7196..203dcf207ec 100644 --- a/resource-manager/netapp/2024-03-01/backupvaults/id_netappaccount.go +++ b/resource-manager/netapp/2024-03-01/backupvaults/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2024-03-01/backupvaults/id_netappaccount_test.go b/resource-manager/netapp/2024-03-01/backupvaults/id_netappaccount_test.go index 17f20e37685..151b0b66fb7 100644 --- a/resource-manager/netapp/2024-03-01/backupvaults/id_netappaccount_test.go +++ b/resource-manager/netapp/2024-03-01/backupvaults/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/capacitypools/README.md b/resource-manager/netapp/2024-03-01/capacitypools/README.md index bc022dc04da..333457abfce 100644 --- a/resource-manager/netapp/2024-03-01/capacitypools/README.md +++ b/resource-manager/netapp/2024-03-01/capacitypools/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") payload := capacitypools.CapacityPool{ // ... @@ -41,7 +41,7 @@ if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") read, err := client.PoolsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") // alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination items, err := client.PoolsListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") payload := capacitypools.CapacityPoolPatch{ // ... diff --git a/resource-manager/netapp/2024-03-01/capacitypools/id_capacitypool.go b/resource-manager/netapp/2024-03-01/capacitypools/id_capacitypool.go index 5f54bf96057..0e041090dd4 100644 --- a/resource-manager/netapp/2024-03-01/capacitypools/id_capacitypool.go +++ b/resource-manager/netapp/2024-03-01/capacitypools/id_capacitypool.go @@ -121,9 +121,9 @@ func (id CapacityPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), } } diff --git a/resource-manager/netapp/2024-03-01/capacitypools/id_capacitypool_test.go b/resource-manager/netapp/2024-03-01/capacitypools/id_capacitypool_test.go index e19faa4852d..6bfc38a792d 100644 --- a/resource-manager/netapp/2024-03-01/capacitypools/id_capacitypool_test.go +++ b/resource-manager/netapp/2024-03-01/capacitypools/id_capacitypool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityPoolId{} func TestNewCapacityPoolID(t *testing.T) { - id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCapacityPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } } func TestFormatCapacityPoolID(t *testing.T) { - actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName" + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCapacityPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCapacityPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/capacitypools/id_netappaccount.go b/resource-manager/netapp/2024-03-01/capacitypools/id_netappaccount.go index 0a3b033027e..58a09e2952e 100644 --- a/resource-manager/netapp/2024-03-01/capacitypools/id_netappaccount.go +++ b/resource-manager/netapp/2024-03-01/capacitypools/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2024-03-01/capacitypools/id_netappaccount_test.go b/resource-manager/netapp/2024-03-01/capacitypools/id_netappaccount_test.go index 7a337eb7048..91d9bae2f9f 100644 --- a/resource-manager/netapp/2024-03-01/capacitypools/id_netappaccount_test.go +++ b/resource-manager/netapp/2024-03-01/capacitypools/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/filelocks/README.md b/resource-manager/netapp/2024-03-01/filelocks/README.md index e0be0292dd2..8fa4ab1907c 100644 --- a/resource-manager/netapp/2024-03-01/filelocks/README.md +++ b/resource-manager/netapp/2024-03-01/filelocks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := filelocks.BreakFileLocksRequest{ // ... diff --git a/resource-manager/netapp/2024-03-01/filelocks/id_volume.go b/resource-manager/netapp/2024-03-01/filelocks/id_volume.go index 1bc8b7d703a..660324eb77b 100644 --- a/resource-manager/netapp/2024-03-01/filelocks/id_volume.go +++ b/resource-manager/netapp/2024-03-01/filelocks/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/filelocks/id_volume_test.go b/resource-manager/netapp/2024-03-01/filelocks/id_volume_test.go index 53c183e76a9..1ae0d4861ac 100644 --- a/resource-manager/netapp/2024-03-01/filelocks/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/filelocks/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/groupidlistforldapuser/README.md b/resource-manager/netapp/2024-03-01/groupidlistforldapuser/README.md index 7e6c0a4d5ed..3765faac4cf 100644 --- a/resource-manager/netapp/2024-03-01/groupidlistforldapuser/README.md +++ b/resource-manager/netapp/2024-03-01/groupidlistforldapuser/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := groupidlistforldapuser.GetGroupIdListForLDAPUserRequest{ // ... diff --git a/resource-manager/netapp/2024-03-01/groupidlistforldapuser/id_volume.go b/resource-manager/netapp/2024-03-01/groupidlistforldapuser/id_volume.go index 343367eda42..597c3e852ab 100644 --- a/resource-manager/netapp/2024-03-01/groupidlistforldapuser/id_volume.go +++ b/resource-manager/netapp/2024-03-01/groupidlistforldapuser/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/groupidlistforldapuser/id_volume_test.go b/resource-manager/netapp/2024-03-01/groupidlistforldapuser/id_volume_test.go index 613e3ba7e8b..ad956e12e12 100644 --- a/resource-manager/netapp/2024-03-01/groupidlistforldapuser/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/groupidlistforldapuser/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/netappaccounts/README.md b/resource-manager/netapp/2024-03-01/netappaccounts/README.md index da31a179b5c..00896a21f6e 100644 --- a/resource-manager/netapp/2024-03-01/netappaccounts/README.md +++ b/resource-manager/netapp/2024-03-01/netappaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := netappaccounts.NetAppAccount{ // ... @@ -42,7 +42,7 @@ if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.AccountsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") payload := netappaccounts.NetAppAccountPatch{ // ... diff --git a/resource-manager/netapp/2024-03-01/netappaccounts/id_netappaccount.go b/resource-manager/netapp/2024-03-01/netappaccounts/id_netappaccount.go index a551456fc35..e49b1665e3b 100644 --- a/resource-manager/netapp/2024-03-01/netappaccounts/id_netappaccount.go +++ b/resource-manager/netapp/2024-03-01/netappaccounts/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2024-03-01/netappaccounts/id_netappaccount_test.go b/resource-manager/netapp/2024-03-01/netappaccounts/id_netappaccount_test.go index f103b75d288..ef0ce3e4636 100644 --- a/resource-manager/netapp/2024-03-01/netappaccounts/id_netappaccount_test.go +++ b/resource-manager/netapp/2024-03-01/netappaccounts/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/netappresource/README.md b/resource-manager/netapp/2024-03-01/netappresource/README.md index 635dca8638f..df1cce285d2 100644 --- a/resource-manager/netapp/2024-03-01/netappresource/README.md +++ b/resource-manager/netapp/2024-03-01/netappresource/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.FilePathAvailabilityRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.ResourceNameAvailabilityRequest{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.QuotaAvailabilityRequest{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.QueryNetworkSiblingSetRequest{ // ... @@ -108,7 +108,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.QueryRegionInfo(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName") +id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName") read, err := client.QuotaLimitsGet(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.QuotaLimitsList(ctx, id) if err != nil { @@ -156,7 +156,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.RegionInfosGet(ctx, id) if err != nil { @@ -172,7 +172,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.RegionInfosList(ctx, id)` can be used to do batched pagination items, err := client.RegionInfosListComplete(ctx, id) @@ -189,7 +189,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := netappresource.UpdateNetworkSiblingSetRequest{ // ... diff --git a/resource-manager/netapp/2024-03-01/netappresource/id_location.go b/resource-manager/netapp/2024-03-01/netappresource/id_location.go index ce496afe734..7f5f70c69df 100644 --- a/resource-manager/netapp/2024-03-01/netappresource/id_location.go +++ b/resource-manager/netapp/2024-03-01/netappresource/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/netapp/2024-03-01/netappresource/id_location_test.go b/resource-manager/netapp/2024-03-01/netappresource/id_location_test.go index f37ef0bd41e..6e374aa4ecb 100644 --- a/resource-manager/netapp/2024-03-01/netappresource/id_location_test.go +++ b/resource-manager/netapp/2024-03-01/netappresource/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/netappresource/id_quotalimit.go b/resource-manager/netapp/2024-03-01/netappresource/id_quotalimit.go index d4a65d40520..b35ac4de378 100644 --- a/resource-manager/netapp/2024-03-01/netappresource/id_quotalimit.go +++ b/resource-manager/netapp/2024-03-01/netappresource/id_quotalimit.go @@ -113,7 +113,7 @@ func (id QuotaLimitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticQuotaLimits", "quotaLimits", "quotaLimits"), resourceids.UserSpecifiedSegment("quotaLimitName", "quotaLimitName"), } diff --git a/resource-manager/netapp/2024-03-01/netappresource/id_quotalimit_test.go b/resource-manager/netapp/2024-03-01/netappresource/id_quotalimit_test.go index e3a0299b8ae..3d154522c0a 100644 --- a/resource-manager/netapp/2024-03-01/netappresource/id_quotalimit_test.go +++ b/resource-manager/netapp/2024-03-01/netappresource/id_quotalimit_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &QuotaLimitId{} func TestNewQuotaLimitID(t *testing.T) { - id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName") + id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.QuotaLimitName != "quotaLimitName" { @@ -28,8 +28,8 @@ func TestNewQuotaLimitID(t *testing.T) { } func TestFormatQuotaLimitID(t *testing.T) { - actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "location", "quotaLimitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName" + actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationName", "quotaLimitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseQuotaLimitID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", QuotaLimitName: "quotaLimitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseQuotaLimitIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", QuotaLimitName: "quotaLimitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/location/quotaLimits/quotaLimitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationName/quotaLimits/quotaLimitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs/qUoTaLiMiTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs/qUoTaLiMiTnAmE", Expected: &QuotaLimitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", QuotaLimitName: "qUoTaLiMiTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoN/qUoTaLiMiTs/qUoTaLiMiTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNnAmE/qUoTaLiMiTs/qUoTaLiMiTnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/poolchange/README.md b/resource-manager/netapp/2024-03-01/poolchange/README.md index cf47d4318c5..01e079ff66b 100644 --- a/resource-manager/netapp/2024-03-01/poolchange/README.md +++ b/resource-manager/netapp/2024-03-01/poolchange/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := poolchange.PoolChangeRequest{ // ... diff --git a/resource-manager/netapp/2024-03-01/poolchange/id_volume.go b/resource-manager/netapp/2024-03-01/poolchange/id_volume.go index f4189a2d706..db883b5bdcb 100644 --- a/resource-manager/netapp/2024-03-01/poolchange/id_volume.go +++ b/resource-manager/netapp/2024-03-01/poolchange/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/poolchange/id_volume_test.go b/resource-manager/netapp/2024-03-01/poolchange/id_volume_test.go index 49b57227550..85f31b29d70 100644 --- a/resource-manager/netapp/2024-03-01/poolchange/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/poolchange/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/resetcifspassword/id_volume.go b/resource-manager/netapp/2024-03-01/resetcifspassword/id_volume.go index 965a410354b..c5a2844bb7b 100644 --- a/resource-manager/netapp/2024-03-01/resetcifspassword/id_volume.go +++ b/resource-manager/netapp/2024-03-01/resetcifspassword/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/resetcifspassword/id_volume_test.go b/resource-manager/netapp/2024-03-01/resetcifspassword/id_volume_test.go index 4bdb1e229ac..0b3b2133026 100644 --- a/resource-manager/netapp/2024-03-01/resetcifspassword/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/resetcifspassword/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/restore/README.md b/resource-manager/netapp/2024-03-01/restore/README.md index 64c1652e013..0a543caac3d 100644 --- a/resource-manager/netapp/2024-03-01/restore/README.md +++ b/resource-manager/netapp/2024-03-01/restore/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.BackupsGetVolumeLatestRestoreStatus(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2024-03-01/restore/id_volume.go b/resource-manager/netapp/2024-03-01/restore/id_volume.go index 6944bf94a87..9e76588a555 100644 --- a/resource-manager/netapp/2024-03-01/restore/id_volume.go +++ b/resource-manager/netapp/2024-03-01/restore/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/restore/id_volume_test.go b/resource-manager/netapp/2024-03-01/restore/id_volume_test.go index 12722b5829a..7762bc57cb4 100644 --- a/resource-manager/netapp/2024-03-01/restore/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/restore/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/snapshotpolicy/README.md b/resource-manager/netapp/2024-03-01/snapshotpolicy/README.md index 1e026591f23..e3b1ebd141a 100644 --- a/resource-manager/netapp/2024-03-01/snapshotpolicy/README.md +++ b/resource-manager/netapp/2024-03-01/snapshotpolicy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") payload := snapshotpolicy.SnapshotPolicy{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") read, err := client.SnapshotPoliciesGet(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.SnapshotPoliciesList(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") payload := snapshotpolicy.SnapshotPolicyPatch{ // ... diff --git a/resource-manager/netapp/2024-03-01/snapshotpolicy/id_netappaccount.go b/resource-manager/netapp/2024-03-01/snapshotpolicy/id_netappaccount.go index 2a04383c0de..14deafbb222 100644 --- a/resource-manager/netapp/2024-03-01/snapshotpolicy/id_netappaccount.go +++ b/resource-manager/netapp/2024-03-01/snapshotpolicy/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2024-03-01/snapshotpolicy/id_netappaccount_test.go b/resource-manager/netapp/2024-03-01/snapshotpolicy/id_netappaccount_test.go index c0601bb3a54..37ac2f7a327 100644 --- a/resource-manager/netapp/2024-03-01/snapshotpolicy/id_netappaccount_test.go +++ b/resource-manager/netapp/2024-03-01/snapshotpolicy/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/snapshotpolicy/id_snapshotpolicy.go b/resource-manager/netapp/2024-03-01/snapshotpolicy/id_snapshotpolicy.go index 4db1ae3a00d..0f5ca81ebc0 100644 --- a/resource-manager/netapp/2024-03-01/snapshotpolicy/id_snapshotpolicy.go +++ b/resource-manager/netapp/2024-03-01/snapshotpolicy/id_snapshotpolicy.go @@ -121,7 +121,7 @@ func (id SnapshotPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyName"), } diff --git a/resource-manager/netapp/2024-03-01/snapshotpolicy/id_snapshotpolicy_test.go b/resource-manager/netapp/2024-03-01/snapshotpolicy/id_snapshotpolicy_test.go index 5151bfdfc6a..47db3863892 100644 --- a/resource-manager/netapp/2024-03-01/snapshotpolicy/id_snapshotpolicy_test.go +++ b/resource-manager/netapp/2024-03-01/snapshotpolicy/id_snapshotpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotPolicyId{} func TestNewSnapshotPolicyID(t *testing.T) { - id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.SnapshotPolicyName != "snapshotPolicyName" { @@ -32,8 +32,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { } func TestFormatSnapshotPolicyID(t *testing.T) { - actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName" + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", SnapshotPolicyName: "sNaPsHoTpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/README.md b/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/README.md index 5a71489e23f..aa9b3018474 100644 --- a/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/README.md +++ b/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") +id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") read, err := client.SnapshotPoliciesListVolumes(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/id_snapshotpolicy.go b/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/id_snapshotpolicy.go index 6bf4b598a83..c366a171e15 100644 --- a/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/id_snapshotpolicy.go +++ b/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/id_snapshotpolicy.go @@ -121,7 +121,7 @@ func (id SnapshotPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyName"), } diff --git a/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go b/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go index 1b469bc2282..8dad1f1572b 100644 --- a/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go +++ b/resource-manager/netapp/2024-03-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotPolicyId{} func TestNewSnapshotPolicyID(t *testing.T) { - id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName") + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.SnapshotPolicyName != "snapshotPolicyName" { @@ -32,8 +32,8 @@ func TestNewSnapshotPolicyID(t *testing.T) { } func TestFormatSnapshotPolicyID(t *testing.T) { - actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "snapshotPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName" + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "snapshotPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSnapshotPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", SnapshotPolicyName: "snapshotPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/snapshotPolicies/snapshotPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/snapshotPolicies/snapshotPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE", Expected: &SnapshotPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", SnapshotPolicyName: "sNaPsHoTpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/snapshots/README.md b/resource-manager/netapp/2024-03-01/snapshots/README.md index 1631644a272..528d345277b 100644 --- a/resource-manager/netapp/2024-03-01/snapshots/README.md +++ b/resource-manager/netapp/2024-03-01/snapshots/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") payload := snapshots.Snapshot{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.List(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") payload := snapshots.SnapshotRestoreFiles{ // ... @@ -102,7 +102,7 @@ if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") var payload interface{} if err := client.UpdateThenPoll(ctx, id, payload); err != nil { diff --git a/resource-manager/netapp/2024-03-01/snapshots/id_snapshot.go b/resource-manager/netapp/2024-03-01/snapshots/id_snapshot.go index bb9f92dd3d8..2fe36d4f5a9 100644 --- a/resource-manager/netapp/2024-03-01/snapshots/id_snapshot.go +++ b/resource-manager/netapp/2024-03-01/snapshots/id_snapshot.go @@ -133,9 +133,9 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/netapp/2024-03-01/snapshots/id_snapshot_test.go b/resource-manager/netapp/2024-03-01/snapshots/id_snapshot_test.go index bf07ef37b3f..1aae8e6ed5c 100644 --- a/resource-manager/netapp/2024-03-01/snapshots/id_snapshot_test.go +++ b/resource-manager/netapp/2024-03-01/snapshots/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -40,8 +40,8 @@ func TestNewSnapshotID(t *testing.T) { } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "snapshotName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "snapshotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", SnapshotName: "snapshotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/snapshots/snapshotName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/snapshots/snapshotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", SnapshotName: "sNaPsHoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sNaPsHoTs/sNaPsHoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/snapshots/id_volume.go b/resource-manager/netapp/2024-03-01/snapshots/id_volume.go index 3c7c80a660d..dcd1ab5e98b 100644 --- a/resource-manager/netapp/2024-03-01/snapshots/id_volume.go +++ b/resource-manager/netapp/2024-03-01/snapshots/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/snapshots/id_volume_test.go b/resource-manager/netapp/2024-03-01/snapshots/id_volume_test.go index 4179bacaad9..010624ba420 100644 --- a/resource-manager/netapp/2024-03-01/snapshots/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/snapshots/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/subvolumes/README.md b/resource-manager/netapp/2024-03-01/subvolumes/README.md index 9322c906119..64390de3e07 100644 --- a/resource-manager/netapp/2024-03-01/subvolumes/README.md +++ b/resource-manager/netapp/2024-03-01/subvolumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") payload := subvolumes.SubvolumeInfo{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if err := client.GetMetadataThenPoll(ctx, id); err != nil { // handle the error @@ -81,7 +81,7 @@ if err := client.GetMetadataThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") // alternatively `client.ListByVolume(ctx, id)` can be used to do batched pagination items, err := client.ListByVolumeComplete(ctx, id) @@ -98,7 +98,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") payload := subvolumes.SubvolumePatchRequest{ // ... diff --git a/resource-manager/netapp/2024-03-01/subvolumes/id_subvolume.go b/resource-manager/netapp/2024-03-01/subvolumes/id_subvolume.go index 67d0d1b4c05..d9ceec6f9e6 100644 --- a/resource-manager/netapp/2024-03-01/subvolumes/id_subvolume.go +++ b/resource-manager/netapp/2024-03-01/subvolumes/id_subvolume.go @@ -133,13 +133,13 @@ func (id SubVolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticSubVolumes", "subVolumes", "subVolumes"), - resourceids.UserSpecifiedSegment("subVolumeName", "subvolumeName"), + resourceids.UserSpecifiedSegment("subVolumeName", "subVolumeName"), } } diff --git a/resource-manager/netapp/2024-03-01/subvolumes/id_subvolume_test.go b/resource-manager/netapp/2024-03-01/subvolumes/id_subvolume_test.go index 086c5a8e4fd..c427629eb5d 100644 --- a/resource-manager/netapp/2024-03-01/subvolumes/id_subvolume_test.go +++ b/resource-manager/netapp/2024-03-01/subvolumes/id_subvolume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SubVolumeId{} func TestNewSubVolumeID(t *testing.T) { - id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName") + id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewSubVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeName") } - if id.SubVolumeName != "subvolumeName" { - t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subvolumeName") + if id.SubVolumeName != "subVolumeName" { + t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subVolumeName") } } func TestFormatSubVolumeID(t *testing.T) { - actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "subvolumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName" + actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "subVolumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSubVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", - SubVolumeName: "subvolumeName", + SubVolumeName: "subVolumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSubVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", - SubVolumeName: "subvolumeName", + SubVolumeName: "subVolumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/subVolumes/subvolumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/subVolumes/subVolumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe", Expected: &SubVolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", SubVolumeName: "sUbVoLuMeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/sUbVoLuMeS/sUbVoLuMeNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/subvolumes/id_volume.go b/resource-manager/netapp/2024-03-01/subvolumes/id_volume.go index 8ed26a30d21..1b621f47327 100644 --- a/resource-manager/netapp/2024-03-01/subvolumes/id_volume.go +++ b/resource-manager/netapp/2024-03-01/subvolumes/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/subvolumes/id_volume_test.go b/resource-manager/netapp/2024-03-01/subvolumes/id_volume_test.go index 5c6f5f7253b..31c7ff8fe02 100644 --- a/resource-manager/netapp/2024-03-01/subvolumes/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/subvolumes/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumegroups/README.md b/resource-manager/netapp/2024-03-01/volumegroups/README.md index 4f207121020..4dceebb836e 100644 --- a/resource-manager/netapp/2024-03-01/volumegroups/README.md +++ b/resource-manager/netapp/2024-03-01/volumegroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") payload := volumegroups.VolumeGroupDetails{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") read, err := client.ListByNetAppAccount(ctx, id) if err != nil { diff --git a/resource-manager/netapp/2024-03-01/volumegroups/id_netappaccount.go b/resource-manager/netapp/2024-03-01/volumegroups/id_netappaccount.go index 11b871e68f6..b76f8ad025d 100644 --- a/resource-manager/netapp/2024-03-01/volumegroups/id_netappaccount.go +++ b/resource-manager/netapp/2024-03-01/volumegroups/id_netappaccount.go @@ -115,7 +115,7 @@ func (id NetAppAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), } } diff --git a/resource-manager/netapp/2024-03-01/volumegroups/id_netappaccount_test.go b/resource-manager/netapp/2024-03-01/volumegroups/id_netappaccount_test.go index f3423437a45..ea57dfac8fc 100644 --- a/resource-manager/netapp/2024-03-01/volumegroups/id_netappaccount_test.go +++ b/resource-manager/netapp/2024-03-01/volumegroups/id_netappaccount_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetAppAccountId{} func TestNewNetAppAccountID(t *testing.T) { - id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNetAppAccountID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } } func TestFormatNetAppAccountID(t *testing.T) { - actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName" + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNetAppAccountID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNetAppAccountIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Expected: &NetAppAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumegroups/id_volumegroup.go b/resource-manager/netapp/2024-03-01/volumegroups/id_volumegroup.go index 16d7214529e..2fbfb2b2133 100644 --- a/resource-manager/netapp/2024-03-01/volumegroups/id_volumegroup.go +++ b/resource-manager/netapp/2024-03-01/volumegroups/id_volumegroup.go @@ -121,7 +121,7 @@ func (id VolumeGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupName"), } diff --git a/resource-manager/netapp/2024-03-01/volumegroups/id_volumegroup_test.go b/resource-manager/netapp/2024-03-01/volumegroups/id_volumegroup_test.go index 2ec1015141c..9a1dd20a884 100644 --- a/resource-manager/netapp/2024-03-01/volumegroups/id_volumegroup_test.go +++ b/resource-manager/netapp/2024-03-01/volumegroups/id_volumegroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeGroupId{} func TestNewVolumeGroupID(t *testing.T) { - id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName") + id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVolumeGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } if id.VolumeGroupName != "volumeGroupName" { @@ -32,8 +32,8 @@ func TestNewVolumeGroupID(t *testing.T) { } func TestFormatVolumeGroupID(t *testing.T) { - actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "volumeGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName" + actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "volumeGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVolumeGroupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", VolumeGroupName: "volumeGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVolumeGroupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", + NetAppAccountName: "netAppAccountName", VolumeGroupName: "volumeGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/volumeGroups/volumeGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/volumeGroups/volumeGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe", Expected: &VolumeGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", + NetAppAccountName: "nEtApPaCcOuNtNaMe", VolumeGroupName: "vOlUmEgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/vOlUmEgRoUpS/vOlUmEgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumequotarules/README.md b/resource-manager/netapp/2024-03-01/volumequotarules/README.md index cdaabf3c0f1..7f2b7139307 100644 --- a/resource-manager/netapp/2024-03-01/volumequotarules/README.md +++ b/resource-manager/netapp/2024-03-01/volumequotarules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") payload := volumequotarules.VolumeQuotaRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.ListByVolume(ctx, id) if err != nil { @@ -85,7 +85,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") payload := volumequotarules.VolumeQuotaRulePatch{ // ... diff --git a/resource-manager/netapp/2024-03-01/volumequotarules/id_volume.go b/resource-manager/netapp/2024-03-01/volumequotarules/id_volume.go index 149860704d1..f3aab9f00df 100644 --- a/resource-manager/netapp/2024-03-01/volumequotarules/id_volume.go +++ b/resource-manager/netapp/2024-03-01/volumequotarules/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/volumequotarules/id_volume_test.go b/resource-manager/netapp/2024-03-01/volumequotarules/id_volume_test.go index 34ce0b19c6a..c0acc543f9f 100644 --- a/resource-manager/netapp/2024-03-01/volumequotarules/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/volumequotarules/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumequotarules/id_volumequotarule.go b/resource-manager/netapp/2024-03-01/volumequotarules/id_volumequotarule.go index 0884c5a5035..9007e1468ae 100644 --- a/resource-manager/netapp/2024-03-01/volumequotarules/id_volumequotarule.go +++ b/resource-manager/netapp/2024-03-01/volumequotarules/id_volumequotarule.go @@ -133,9 +133,9 @@ func (id VolumeQuotaRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), resourceids.StaticSegment("staticVolumeQuotaRules", "volumeQuotaRules", "volumeQuotaRules"), diff --git a/resource-manager/netapp/2024-03-01/volumequotarules/id_volumequotarule_test.go b/resource-manager/netapp/2024-03-01/volumequotarules/id_volumequotarule_test.go index 35b6e35e74d..3b3ee84e25f 100644 --- a/resource-manager/netapp/2024-03-01/volumequotarules/id_volumequotarule_test.go +++ b/resource-manager/netapp/2024-03-01/volumequotarules/id_volumequotarule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeQuotaRuleId{} func TestNewVolumeQuotaRuleID(t *testing.T) { - id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName") + id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeQuotaRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -40,8 +40,8 @@ func TestNewVolumeQuotaRuleID(t *testing.T) { } func TestFormatVolumeQuotaRuleID(t *testing.T) { - actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName", "volumeQuotaRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName" + actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName", "volumeQuotaRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseVolumeQuotaRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", VolumeQuotaRuleName: "volumeQuotaRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseVolumeQuotaRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", VolumeQuotaRuleName: "volumeQuotaRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/volumeQuotaRules/volumeQuotaRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe", Expected: &VolumeQuotaRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", VolumeQuotaRuleName: "vOlUmEqUoTaRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumes/README.md b/resource-manager/netapp/2024-03-01/volumes/README.md index 2548e495a34..6112def4515 100644 --- a/resource-manager/netapp/2024-03-01/volumes/README.md +++ b/resource-manager/netapp/2024-03-01/volumes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumes.Volume{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions() ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") +id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumes.VolumePatch{ // ... diff --git a/resource-manager/netapp/2024-03-01/volumes/id_capacitypool.go b/resource-manager/netapp/2024-03-01/volumes/id_capacitypool.go index e667d5a5691..4a5cb95b3e2 100644 --- a/resource-manager/netapp/2024-03-01/volumes/id_capacitypool.go +++ b/resource-manager/netapp/2024-03-01/volumes/id_capacitypool.go @@ -121,9 +121,9 @@ func (id CapacityPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), } } diff --git a/resource-manager/netapp/2024-03-01/volumes/id_capacitypool_test.go b/resource-manager/netapp/2024-03-01/volumes/id_capacitypool_test.go index a247ffa7040..c84c57d8196 100644 --- a/resource-manager/netapp/2024-03-01/volumes/id_capacitypool_test.go +++ b/resource-manager/netapp/2024-03-01/volumes/id_capacitypool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityPoolId{} func TestNewCapacityPoolID(t *testing.T) { - id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName") + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCapacityPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } } func TestFormatCapacityPoolID(t *testing.T) { - actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName" + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCapacityPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCapacityPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Expected: &CapacityPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumes/id_volume.go b/resource-manager/netapp/2024-03-01/volumes/id_volume.go index a41faa0cf26..9335df28621 100644 --- a/resource-manager/netapp/2024-03-01/volumes/id_volume.go +++ b/resource-manager/netapp/2024-03-01/volumes/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/volumes/id_volume_test.go b/resource-manager/netapp/2024-03-01/volumes/id_volume_test.go index e4d721e4299..a08cc9318a1 100644 --- a/resource-manager/netapp/2024-03-01/volumes/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/volumes/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumesrelocation/README.md b/resource-manager/netapp/2024-03-01/volumesrelocation/README.md index ca34ddbb62a..d8e63e30772 100644 --- a/resource-manager/netapp/2024-03-01/volumesrelocation/README.md +++ b/resource-manager/netapp/2024-03-01/volumesrelocation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesrelocation.RelocateVolumeRequest{ // ... @@ -53,7 +53,7 @@ if err := client.VolumesRelocateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesRevertRelocationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/netapp/2024-03-01/volumesrelocation/id_volume.go b/resource-manager/netapp/2024-03-01/volumesrelocation/id_volume.go index a2dc8db451a..113162da6d7 100644 --- a/resource-manager/netapp/2024-03-01/volumesrelocation/id_volume.go +++ b/resource-manager/netapp/2024-03-01/volumesrelocation/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/volumesrelocation/id_volume_test.go b/resource-manager/netapp/2024-03-01/volumesrelocation/id_volume_test.go index 81640dbd2c8..6a87e3c4d06 100644 --- a/resource-manager/netapp/2024-03-01/volumesrelocation/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/volumesrelocation/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumesreplication/README.md b/resource-manager/netapp/2024-03-01/volumesreplication/README.md index aacb5916af5..29bdb10cf01 100644 --- a/resource-manager/netapp/2024-03-01/volumesreplication/README.md +++ b/resource-manager/netapp/2024-03-01/volumesreplication/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.AuthorizeRequest{ // ... @@ -41,7 +41,7 @@ if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.BreakReplicationRequest{ // ... @@ -58,7 +58,7 @@ if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.VolumesListReplications(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesreplication.ReestablishReplicationRequest{ // ... @@ -115,7 +115,7 @@ if err := client.VolumesReestablishReplicationThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") read, err := client.VolumesReplicationStatus(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/netapp/2024-03-01/volumesreplication/id_volume.go b/resource-manager/netapp/2024-03-01/volumesreplication/id_volume.go index d5cd1a7bb6b..f4997248ba1 100644 --- a/resource-manager/netapp/2024-03-01/volumesreplication/id_volume.go +++ b/resource-manager/netapp/2024-03-01/volumesreplication/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/volumesreplication/id_volume_test.go b/resource-manager/netapp/2024-03-01/volumesreplication/id_volume_test.go index 482df2f378c..51db68a7df6 100644 --- a/resource-manager/netapp/2024-03-01/volumesreplication/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/volumesreplication/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/netapp/2024-03-01/volumesrevert/README.md b/resource-manager/netapp/2024-03-01/volumesrevert/README.md index cc9b88a833e..56c3323d10f 100644 --- a/resource-manager/netapp/2024-03-01/volumesrevert/README.md +++ b/resource-manager/netapp/2024-03-01/volumesrevert/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") +id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") payload := volumesrevert.VolumeRevert{ // ... diff --git a/resource-manager/netapp/2024-03-01/volumesrevert/id_volume.go b/resource-manager/netapp/2024-03-01/volumesrevert/id_volume.go index a8685593a26..e61cfcfca50 100644 --- a/resource-manager/netapp/2024-03-01/volumesrevert/id_volume.go +++ b/resource-manager/netapp/2024-03-01/volumesrevert/id_volume.go @@ -127,9 +127,9 @@ func (id VolumeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), - resourceids.UserSpecifiedSegment("netAppAccountName", "accountName"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountName"), resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), - resourceids.UserSpecifiedSegment("capacityPoolName", "poolName"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolName"), resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), resourceids.UserSpecifiedSegment("volumeName", "volumeName"), } diff --git a/resource-manager/netapp/2024-03-01/volumesrevert/id_volume_test.go b/resource-manager/netapp/2024-03-01/volumesrevert/id_volume_test.go index c7514e428c8..f26bf43ecc3 100644 --- a/resource-manager/netapp/2024-03-01/volumesrevert/id_volume_test.go +++ b/resource-manager/netapp/2024-03-01/volumesrevert/id_volume_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VolumeId{} func TestNewVolumeID(t *testing.T) { - id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName") + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVolumeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NetAppAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "accountName") + if id.NetAppAccountName != "netAppAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountName") } - if id.CapacityPoolName != "poolName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "poolName") + if id.CapacityPoolName != "capacityPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolName") } if id.VolumeName != "volumeName" { @@ -36,8 +36,8 @@ func TestNewVolumeID(t *testing.T) { } func TestFormatVolumeID(t *testing.T) { - actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "poolName", "volumeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName" + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountName", "capacityPoolName", "volumeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVolumeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVolumeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NetAppAccountName: "accountName", - CapacityPoolName: "poolName", + NetAppAccountName: "netAppAccountName", + CapacityPoolName: "capacityPoolName", VolumeName: "volumeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/accountName/capacityPools/poolName/volumes/volumeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountName/capacityPools/capacityPoolName/volumes/volumeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE", Expected: &VolumeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetAppAccountName: "aCcOuNtNaMe", - CapacityPoolName: "pOoLnAmE", + NetAppAccountName: "nEtApPaCcOuNtNaMe", + CapacityPoolName: "cApAcItYpOoLnAmE", VolumeName: "vOlUmEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/aCcOuNtNaMe/cApAcItYpOoLs/pOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtNaMe/cApAcItYpOoLs/cApAcItYpOoLnAmE/vOlUmEs/vOlUmEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/adminrulecollections/README.md b/resource-manager/network/2023-09-01/adminrulecollections/README.md index d9cf3647d51..6af216eacf3 100644 --- a/resource-manager/network/2023-09-01/adminrulecollections/README.md +++ b/resource-manager/network/2023-09-01/adminrulecollections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") payload := adminrulecollections.AdminRuleCollection{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOpera ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") // alternatively `client.List(ctx, id, adminrulecollections.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, adminrulecollections.DefaultListOperationOptions()) diff --git a/resource-manager/network/2023-09-01/adminrulecollections/id_rulecollection.go b/resource-manager/network/2023-09-01/adminrulecollections/id_rulecollection.go index da27349f55a..a7cd76bd8fc 100644 --- a/resource-manager/network/2023-09-01/adminrulecollections/id_rulecollection.go +++ b/resource-manager/network/2023-09-01/adminrulecollections/id_rulecollection.go @@ -129,7 +129,7 @@ func (id RuleCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2023-09-01/adminrulecollections/id_rulecollection_test.go b/resource-manager/network/2023-09-01/adminrulecollections/id_rulecollection_test.go index 151c5f3abf0..0b385a407c1 100644 --- a/resource-manager/network/2023-09-01/adminrulecollections/id_rulecollection_test.go +++ b/resource-manager/network/2023-09-01/adminrulecollections/id_rulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionId{} func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewRuleCollectionID(t *testing.T) { } func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRuleCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/adminrulecollections/id_securityadminconfiguration.go b/resource-manager/network/2023-09-01/adminrulecollections/id_securityadminconfiguration.go index 314559846aa..193fa95d9b5 100644 --- a/resource-manager/network/2023-09-01/adminrulecollections/id_securityadminconfiguration.go +++ b/resource-manager/network/2023-09-01/adminrulecollections/id_securityadminconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityAdminConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), } } diff --git a/resource-manager/network/2023-09-01/adminrulecollections/id_securityadminconfiguration_test.go b/resource-manager/network/2023-09-01/adminrulecollections/id_securityadminconfiguration_test.go index 7e368c4f9ca..aa4f07d225f 100644 --- a/resource-manager/network/2023-09-01/adminrulecollections/id_securityadminconfiguration_test.go +++ b/resource-manager/network/2023-09-01/adminrulecollections/id_securityadminconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityAdminConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } } func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName" + actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityAdminConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/adminrules/README.md b/resource-manager/network/2023-09-01/adminrules/README.md index 727c29dd753..b844aae6945 100644 --- a/resource-manager/network/2023-09-01/adminrules/README.md +++ b/resource-manager/network/2023-09-01/adminrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") payload := adminrules.BaseAdminRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOption ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/adminrules/id_rule.go b/resource-manager/network/2023-09-01/adminrules/id_rule.go index 028cb6ac27d..80c294a2cdd 100644 --- a/resource-manager/network/2023-09-01/adminrules/id_rule.go +++ b/resource-manager/network/2023-09-01/adminrules/id_rule.go @@ -135,7 +135,7 @@ func (id RuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), resourceids.StaticSegment("staticRules", "rules", "rules"), diff --git a/resource-manager/network/2023-09-01/adminrules/id_rule_test.go b/resource-manager/network/2023-09-01/adminrules/id_rule_test.go index c4b791947dc..a9939471a62 100644 --- a/resource-manager/network/2023-09-01/adminrules/id_rule_test.go +++ b/resource-manager/network/2023-09-01/adminrules/id_rule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleId{} func TestNewRuleID(t *testing.T) { - id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") + id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -40,8 +40,8 @@ func TestNewRuleID(t *testing.T) { } func TestFormatRuleID(t *testing.T) { - actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName" + actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", RuleName: "rUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/adminrules/id_rulecollection.go b/resource-manager/network/2023-09-01/adminrules/id_rulecollection.go index b621d89f9ed..4f7c635ec89 100644 --- a/resource-manager/network/2023-09-01/adminrules/id_rulecollection.go +++ b/resource-manager/network/2023-09-01/adminrules/id_rulecollection.go @@ -129,7 +129,7 @@ func (id RuleCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2023-09-01/adminrules/id_rulecollection_test.go b/resource-manager/network/2023-09-01/adminrules/id_rulecollection_test.go index 7fcf8dc4da2..b470a67ca68 100644 --- a/resource-manager/network/2023-09-01/adminrules/id_rulecollection_test.go +++ b/resource-manager/network/2023-09-01/adminrules/id_rulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionId{} func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewRuleCollectionID(t *testing.T) { } func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRuleCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/README.md b/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/README.md index e179cb09579..ad32ab1638c 100644 --- a/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/README.md +++ b/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") payload := applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnection{ // ... diff --git a/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go index 56c45d49082..5fdf773f215 100644 --- a/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go +++ b/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go @@ -123,7 +123,7 @@ func (id ApplicationGatewayPrivateEndpointConnectionId) Segments() []resourceids resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go b/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go index d78d158b401..41f023a4a31 100644 --- a/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go +++ b/resource-manager/network/2023-09-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationGatewayPrivateEndpointConnectionId{} func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") + id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayName") } - if id.PrivateEndpointConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "connectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName" + actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ApplicationGatewayName: "applicationGatewayName", - PrivateEndpointConnectionName: "connectionName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(t *test }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ApplicationGatewayName: "applicationGatewayName", - PrivateEndpointConnectionName: "connectionName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYnAmE", - PrivateEndpointConnectionName: "cOnNeCtIoNnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewaycustomerror.go b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewaycustomerror.go index 532de5a8e93..8b0e5fb8d20 100644 --- a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewaycustomerror.go +++ b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewaycustomerror.go @@ -4,6 +4,6 @@ package applicationgateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` } diff --git a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewaypropertiesformat.go index 1332febd49d..4e54c939bcb 100644 --- a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewaypropertiesformat.go +++ b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewaypropertiesformat.go @@ -38,6 +38,6 @@ type ApplicationGatewayPropertiesFormat struct { SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + UrlPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` } diff --git a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go index 07b97214f7f..b629d49b411 100644 --- a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go @@ -10,6 +10,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` } diff --git a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go index 02be2e1f37b..c46a7bd6d6c 100644 --- a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go +++ b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go @@ -6,5 +6,5 @@ package applicationgateways type ApplicationGatewayRewriteRuleActionSet struct { RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` + UrlConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` } diff --git a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlconfiguration.go index 18491c35f12..9c77d1808a2 100644 --- a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlconfiguration.go +++ b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlconfiguration.go @@ -3,7 +3,7 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlConfiguration struct { +type ApplicationGatewayURLConfiguration struct { ModifiedPath *string `json:"modifiedPath,omitempty"` ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` Reroute *bool `json:"reroute,omitempty"` diff --git a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlpathmap.go b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlpathmap.go index 5fc06877578..9ca546cb957 100644 --- a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlpathmap.go +++ b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlpathmap.go @@ -3,10 +3,10 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMap struct { +type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` + Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go index ef8e7e8e02f..9c00ae43cdf 100644 --- a/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go +++ b/resource-manager/network/2023-09-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go @@ -3,7 +3,7 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMapPropertiesFormat struct { +type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` diff --git a/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/README.md b/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/README.md index f5da5d1b649..9c324e15dd1 100644 --- a/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/README.md +++ b/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.DefaultGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.Get(ctx, id)` can be used to do batched pagination items, err := client.GetComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/id_location.go b/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/id_location.go index 38c2aa68f21..3d179e08bf0 100644 --- a/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/id_location.go +++ b/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/id_location_test.go b/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/id_location_test.go index abfa53672eb..3989d8a5132 100644 --- a/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/id_location_test.go +++ b/resource-manager/network/2023-09-01/applicationgatewaywafdynamicmanifests/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/availabledelegations/README.md b/resource-manager/network/2023-09-01/availabledelegations/README.md index 6c0dfe2675a..54c6637bc5f 100644 --- a/resource-manager/network/2023-09-01/availabledelegations/README.md +++ b/resource-manager/network/2023-09-01/availabledelegations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailableDelegationsList(ctx, id)` can be used to do batched pagination items, err := client.AvailableDelegationsListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.AvailableResourceGroupDelegationsList(ctx, id)` can be used to do batched pagination items, err := client.AvailableResourceGroupDelegationsListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/availabledelegations/id_location.go b/resource-manager/network/2023-09-01/availabledelegations/id_location.go index e4d894a6089..e6387e4fdeb 100644 --- a/resource-manager/network/2023-09-01/availabledelegations/id_location.go +++ b/resource-manager/network/2023-09-01/availabledelegations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/availabledelegations/id_location_test.go b/resource-manager/network/2023-09-01/availabledelegations/id_location_test.go index 8bb71a50adb..8d0352c08ff 100644 --- a/resource-manager/network/2023-09-01/availabledelegations/id_location_test.go +++ b/resource-manager/network/2023-09-01/availabledelegations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/availabledelegations/id_providerlocation.go b/resource-manager/network/2023-09-01/availabledelegations/id_providerlocation.go index 26af2ff9777..1e3b30f4431 100644 --- a/resource-manager/network/2023-09-01/availabledelegations/id_providerlocation.go +++ b/resource-manager/network/2023-09-01/availabledelegations/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/availabledelegations/id_providerlocation_test.go b/resource-manager/network/2023-09-01/availabledelegations/id_providerlocation_test.go index d3dea3d3895..e24c8def247 100644 --- a/resource-manager/network/2023-09-01/availabledelegations/id_providerlocation_test.go +++ b/resource-manager/network/2023-09-01/availabledelegations/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/availableservicealiases/README.md b/resource-manager/network/2023-09-01/availableservicealiases/README.md index e373f246268..e3e45f6f9b5 100644 --- a/resource-manager/network/2023-09-01/availableservicealiases/README.md +++ b/resource-manager/network/2023-09-01/availableservicealiases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListByResourceGroupComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/availableservicealiases/id_location.go b/resource-manager/network/2023-09-01/availableservicealiases/id_location.go index 65846cc20dd..b531d5a4bb7 100644 --- a/resource-manager/network/2023-09-01/availableservicealiases/id_location.go +++ b/resource-manager/network/2023-09-01/availableservicealiases/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/availableservicealiases/id_location_test.go b/resource-manager/network/2023-09-01/availableservicealiases/id_location_test.go index 8fdfbdee89e..995b5cfad7f 100644 --- a/resource-manager/network/2023-09-01/availableservicealiases/id_location_test.go +++ b/resource-manager/network/2023-09-01/availableservicealiases/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/availableservicealiases/id_providerlocation.go b/resource-manager/network/2023-09-01/availableservicealiases/id_providerlocation.go index 653b48ba912..6c961f76bc1 100644 --- a/resource-manager/network/2023-09-01/availableservicealiases/id_providerlocation.go +++ b/resource-manager/network/2023-09-01/availableservicealiases/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/availableservicealiases/id_providerlocation_test.go b/resource-manager/network/2023-09-01/availableservicealiases/id_providerlocation_test.go index 8b2be520bef..d6526faaf37 100644 --- a/resource-manager/network/2023-09-01/availableservicealiases/id_providerlocation_test.go +++ b/resource-manager/network/2023-09-01/availableservicealiases/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go b/resource-manager/network/2023-09-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go index c0c639f2390..a664e348c2a 100644 --- a/resource-manager/network/2023-09-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go +++ b/resource-manager/network/2023-09-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go @@ -10,5 +10,5 @@ type FirewallPacketCaptureParametersFormat struct { Flags *[]AzureFirewallPacketCaptureFlags `json:"flags,omitempty"` NumberOfPacketsToCapture *int64 `json:"numberOfPacketsToCapture,omitempty"` Protocol *AzureFirewallNetworkRuleProtocol `json:"protocol,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-09-01/checkdnsavailabilities/README.md b/resource-manager/network/2023-09-01/checkdnsavailabilities/README.md index eb778bd6bfc..a49fe3a6a36 100644 --- a/resource-manager/network/2023-09-01/checkdnsavailabilities/README.md +++ b/resource-manager/network/2023-09-01/checkdnsavailabilities/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.CheckDnsNameAvailability(ctx, id, checkdnsavailabilities.DefaultCheckDnsNameAvailabilityOperationOptions()) if err != nil { diff --git a/resource-manager/network/2023-09-01/checkdnsavailabilities/id_location.go b/resource-manager/network/2023-09-01/checkdnsavailabilities/id_location.go index 054cfdb305a..e9c60b3adaf 100644 --- a/resource-manager/network/2023-09-01/checkdnsavailabilities/id_location.go +++ b/resource-manager/network/2023-09-01/checkdnsavailabilities/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/checkdnsavailabilities/id_location_test.go b/resource-manager/network/2023-09-01/checkdnsavailabilities/id_location_test.go index 8b2e43d72d1..7d13e412f40 100644 --- a/resource-manager/network/2023-09-01/checkdnsavailabilities/id_location_test.go +++ b/resource-manager/network/2023-09-01/checkdnsavailabilities/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/connectivityconfigurations/README.md b/resource-manager/network/2023-09-01/connectivityconfigurations/README.md index 678700ab2b9..611edaa32db 100644 --- a/resource-manager/network/2023-09-01/connectivityconfigurations/README.md +++ b/resource-manager/network/2023-09-01/connectivityconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") payload := connectivityconfigurations.ConnectivityConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDelet ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/connectivityconfigurations/id_connectivityconfiguration.go b/resource-manager/network/2023-09-01/connectivityconfigurations/id_connectivityconfiguration.go index 49a4ba3aaf0..d062db15f4f 100644 --- a/resource-manager/network/2023-09-01/connectivityconfigurations/id_connectivityconfiguration.go +++ b/resource-manager/network/2023-09-01/connectivityconfigurations/id_connectivityconfiguration.go @@ -123,7 +123,7 @@ func (id ConnectivityConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticConnectivityConfigurations", "connectivityConfigurations", "connectivityConfigurations"), - resourceids.UserSpecifiedSegment("connectivityConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("connectivityConfigurationName", "connectivityConfigurationName"), } } diff --git a/resource-manager/network/2023-09-01/connectivityconfigurations/id_connectivityconfiguration_test.go b/resource-manager/network/2023-09-01/connectivityconfigurations/id_connectivityconfiguration_test.go index 524d8385688..62733e7673b 100644 --- a/resource-manager/network/2023-09-01/connectivityconfigurations/id_connectivityconfiguration_test.go +++ b/resource-manager/network/2023-09-01/connectivityconfigurations/id_connectivityconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectivityConfigurationId{} func TestNewConnectivityConfigurationID(t *testing.T) { - id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewConnectivityConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.ConnectivityConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "configurationName") + if id.ConnectivityConfigurationName != "connectivityConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "connectivityConfigurationName") } } func TestFormatConnectivityConfigurationID(t *testing.T) { - actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName" + actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseConnectivityConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - ConnectivityConfigurationName: "configurationName", + ConnectivityConfigurationName: "connectivityConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseConnectivityConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - ConnectivityConfigurationName: "configurationName", + ConnectivityConfigurationName: "connectivityConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnNaMe", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - ConnectivityConfigurationName: "cOnFiGuRaTiOnNaMe", + ConnectivityConfigurationName: "cOnNeCtIvItYcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/customipprefixes/README.md b/resource-manager/network/2023-09-01/customipprefixes/README.md index 4c289ad9742..b782ba17462 100644 --- a/resource-manager/network/2023-09-01/customipprefixes/README.md +++ b/resource-manager/network/2023-09-01/customipprefixes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") payload := customipprefixes.CustomIPPrefix{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") read, err := client.Get(ctx, id, customipprefixes.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") payload := customipprefixes.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/customipprefixes/id_customipprefix.go b/resource-manager/network/2023-09-01/customipprefixes/id_customipprefix.go index a41316cfa68..bca85243003 100644 --- a/resource-manager/network/2023-09-01/customipprefixes/id_customipprefix.go +++ b/resource-manager/network/2023-09-01/customipprefixes/id_customipprefix.go @@ -115,7 +115,7 @@ func (id CustomIPPrefixId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticCustomIPPrefixes", "customIPPrefixes", "customIPPrefixes"), - resourceids.UserSpecifiedSegment("customIPPrefixName", "customIpPrefixName"), + resourceids.UserSpecifiedSegment("customIPPrefixName", "customIPPrefixName"), } } diff --git a/resource-manager/network/2023-09-01/customipprefixes/id_customipprefix_test.go b/resource-manager/network/2023-09-01/customipprefixes/id_customipprefix_test.go index 2503a2c56e8..dfd6b48155e 100644 --- a/resource-manager/network/2023-09-01/customipprefixes/id_customipprefix_test.go +++ b/resource-manager/network/2023-09-01/customipprefixes/id_customipprefix_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomIPPrefixId{} func TestNewCustomIPPrefixID(t *testing.T) { - id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") + id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCustomIPPrefixID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CustomIPPrefixName != "customIpPrefixName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIpPrefixName") + if id.CustomIPPrefixName != "customIPPrefixName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIPPrefixName") } } func TestFormatCustomIPPrefixID(t *testing.T) { - actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName" + actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCustomIPPrefixID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName", Expected: &CustomIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIpPrefixName", + CustomIPPrefixName: "customIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCustomIPPrefixIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName", Expected: &CustomIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIpPrefixName", + CustomIPPrefixName: "customIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName/extra", Error: true, }, { diff --git a/resource-manager/network/2023-09-01/endpointservices/README.md b/resource-manager/network/2023-09-01/endpointservices/README.md index 99c19eca69d..c67ec398e18 100644 --- a/resource-manager/network/2023-09-01/endpointservices/README.md +++ b/resource-manager/network/2023-09-01/endpointservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailableEndpointServicesList(ctx, id)` can be used to do batched pagination items, err := client.AvailableEndpointServicesListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/endpointservices/id_location.go b/resource-manager/network/2023-09-01/endpointservices/id_location.go index f2b06140acf..18eaa8353af 100644 --- a/resource-manager/network/2023-09-01/endpointservices/id_location.go +++ b/resource-manager/network/2023-09-01/endpointservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/endpointservices/id_location_test.go b/resource-manager/network/2023-09-01/endpointservices/id_location_test.go index e31df0936ae..0213283041f 100644 --- a/resource-manager/network/2023-09-01/endpointservices/id_location_test.go +++ b/resource-manager/network/2023-09-01/endpointservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitarptable/README.md b/resource-manager/network/2023-09-01/expressroutecircuitarptable/README.md index da42b138c4e..73188e3c417 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitarptable/README.md +++ b/resource-manager/network/2023-09-01/expressroutecircuitarptable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName") // alternatively `client.ExpressRouteCircuitsListArpTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListArpTableComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecircuitarptable/id_arptable.go b/resource-manager/network/2023-09-01/expressroutecircuitarptable/id_arptable.go index 0f33d89bfd9..d35a8eadadf 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitarptable/id_arptable.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitarptable/id_arptable.go @@ -127,11 +127,11 @@ func (id ArpTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "devicePath"), + resourceids.UserSpecifiedSegment("arpTableName", "arpTableName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitarptable/id_arptable_test.go b/resource-manager/network/2023-09-01/expressroutecircuitarptable/id_arptable_test.go index 11dd82c0c88..66d3e99f02e 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitarptable/id_arptable_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitarptable/id_arptable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArpTableId{} func TestNewArpTableID(t *testing.T) { - id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewArpTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.ArpTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "devicePath") + if id.ArpTableName != "arpTableName" { + t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableName") } } func TestFormatArpTableID(t *testing.T) { - actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath" + actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseArpTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseArpTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - ArpTableName: "dEvIcEpAtH", + ArpTableName: "aRpTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/README.md b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/README.md index c5254c4ea8f..056247f1222 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/README.md +++ b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_authorization.go b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_authorization.go index b8b16a2153d..9da101d4a62 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_authorization.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_authorization.go @@ -121,7 +121,7 @@ func (id AuthorizationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), resourceids.UserSpecifiedSegment("authorizationName", "authorizationName"), } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_authorization_test.go b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_authorization_test.go index ed6668508eb..60d0dbacbe5 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_authorization_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_authorization_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthorizationId{} func TestNewAuthorizationID(t *testing.T) { - id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") + id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAuthorizationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.AuthorizationName != "authorizationName" { @@ -32,8 +32,8 @@ func TestNewAuthorizationID(t *testing.T) { } func TestFormatAuthorizationID(t *testing.T) { - actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName" + actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAuthorizationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", AuthorizationName: "authorizationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAuthorizationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", AuthorizationName: "authorizationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", AuthorizationName: "aUtHoRiZaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_expressroutecircuit.go b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_expressroutecircuit.go index 7626fffc08c..210f0ae6366 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_expressroutecircuit.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go index 20b47ec6190..3bd47c1b205 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitconnections/README.md b/resource-manager/network/2023-09-01/expressroutecircuitconnections/README.md index e8804c2335b..0a7ae7f5dc3 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitconnections/README.md +++ b/resource-manager/network/2023-09-01/expressroutecircuitconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecircuitconnections/id_peeringconnection.go b/resource-manager/network/2023-09-01/expressroutecircuitconnections/id_peeringconnection.go index 7c1fb7730b7..07c1226d200 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitconnections/id_peeringconnection.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitconnections/id_peeringconnection.go @@ -127,7 +127,7 @@ func (id PeeringConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticConnections", "connections", "connections"), diff --git a/resource-manager/network/2023-09-01/expressroutecircuitconnections/id_peeringconnection_test.go b/resource-manager/network/2023-09-01/expressroutecircuitconnections/id_peeringconnection_test.go index 39d2aafacfa..f1e786ac3d2 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitconnections/id_peeringconnection_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitconnections/id_peeringconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringConnectionId{} func TestNewPeeringConnectionID(t *testing.T) { - id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") + id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPeeringConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { @@ -36,8 +36,8 @@ func TestNewPeeringConnectionID(t *testing.T) { } func TestFormatPeeringConnectionID(t *testing.T) { - actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName" + actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitpeerings/README.md b/resource-manager/network/2023-09-01/expressroutecircuitpeerings/README.md index 2f19066e193..64c63b0d8d1 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitpeerings/README.md +++ b/resource-manager/network/2023-09-01/expressroutecircuitpeerings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecircuitpeerings/id_expressroutecircuit.go b/resource-manager/network/2023-09-01/expressroutecircuitpeerings/id_expressroutecircuit.go index d901b679f33..02a14699ffa 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitpeerings/id_expressroutecircuit.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitpeerings/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go b/resource-manager/network/2023-09-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go index 1edc4454ed9..9d893b6392d 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitroutestable/README.md b/resource-manager/network/2023-09-01/expressroutecircuitroutestable/README.md index 217f513a76c..602d547e5e2 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitroutestable/README.md +++ b/resource-manager/network/2023-09-01/expressroutecircuitroutestable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName") // alternatively `client.ExpressRouteCircuitsListRoutesTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListRoutesTableComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecircuitroutestable/id_peeringroutetable.go b/resource-manager/network/2023-09-01/expressroutecircuitroutestable/id_peeringroutetable.go index d929441f379..8971fb87e03 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitroutestable/id_peeringroutetable.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitroutestable/id_peeringroutetable.go @@ -127,11 +127,11 @@ func (id PeeringRouteTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTableName", "routeTableName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitroutestable/id_peeringroutetable_test.go b/resource-manager/network/2023-09-01/expressroutecircuitroutestable/id_peeringroutetable_test.go index 154e92f43fb..620bbfff69e 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitroutestable/id_peeringroutetable_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitroutestable/id_peeringroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringRouteTableId{} func TestNewPeeringRouteTableID(t *testing.T) { - id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "devicePath") + if id.RouteTableName != "routeTableName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableName") } } func TestFormatPeeringRouteTableID(t *testing.T) { - actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath" + actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringRouteTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringRouteTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - RouteTableName: "dEvIcEpAtH", + RouteTableName: "rOuTeTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/README.md b/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/README.md index 6e8aaf8de9e..9545bcebf06 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/README.md +++ b/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName") // alternatively `client.ExpressRouteCircuitsListRoutesTableSummary(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListRoutesTableSummaryComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/id_routetablessummary.go b/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/id_routetablessummary.go index 93753595743..90ea354df62 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/id_routetablessummary.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/id_routetablessummary.go @@ -127,11 +127,11 @@ func (id RouteTablesSummaryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go b/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go index b1c58fed640..2c78aaf0378 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteTablesSummaryId{} func TestNewRouteTablesSummaryID(t *testing.T) { - id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewRouteTablesSummaryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTablesSummaryName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "devicePath") + if id.RouteTablesSummaryName != "routeTablesSummaryName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryName") } } func TestFormatRouteTablesSummaryID(t *testing.T) { - actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath" + actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRouteTablesSummaryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRouteTablesSummaryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - RouteTablesSummaryName: "dEvIcEpAtH", + RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuits/README.md b/resource-manager/network/2023-09-01/expressroutecircuits/README.md index 0fcaed4c83f..3ebeb102a3e 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuits/README.md +++ b/resource-manager/network/2023-09-01/expressroutecircuits/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") payload := expressroutecircuits.ExpressRouteCircuit{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") payload := expressroutecircuits.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/expressroutecircuits/id_expressroutecircuit.go b/resource-manager/network/2023-09-01/expressroutecircuits/id_expressroutecircuit.go index d3a73edd48a..7c3ebaafe98 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuits/id_expressroutecircuit.go +++ b/resource-manager/network/2023-09-01/expressroutecircuits/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecircuits/id_expressroutecircuit_test.go b/resource-manager/network/2023-09-01/expressroutecircuits/id_expressroutecircuit_test.go index 3c4a66b65e7..de1beeca125 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuits/id_expressroutecircuit_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuits/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitstats/README.md b/resource-manager/network/2023-09-01/expressroutecircuitstats/README.md index 55ada497a6b..daa800e6ba0 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitstats/README.md +++ b/resource-manager/network/2023-09-01/expressroutecircuitstats/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") read, err := client.ExpressRouteCircuitsGetPeeringStats(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") read, err := client.ExpressRouteCircuitsGetStats(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/expressroutecircuitstats/id_expressroutecircuit.go b/resource-manager/network/2023-09-01/expressroutecircuitstats/id_expressroutecircuit.go index 38c9ef16c4a..0eba5b9c251 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitstats/id_expressroutecircuit.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitstats/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecircuitstats/id_expressroutecircuit_test.go b/resource-manager/network/2023-09-01/expressroutecircuitstats/id_expressroutecircuit_test.go index 883c9a15547..288e8caf55e 100644 --- a/resource-manager/network/2023-09-01/expressroutecircuitstats/id_expressroutecircuit_test.go +++ b/resource-manager/network/2023-09-01/expressroutecircuitstats/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressrouteconnections/README.md b/resource-manager/network/2023-09-01/expressrouteconnections/README.md index b2f39bc768f..f024cdf4d80 100644 --- a/resource-manager/network/2023-09-01/expressrouteconnections/README.md +++ b/resource-manager/network/2023-09-01/expressrouteconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") payload := expressrouteconnections.ExpressRouteConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/expressrouteconnections/id_expressrouteconnection.go b/resource-manager/network/2023-09-01/expressrouteconnections/id_expressrouteconnection.go index 971a1ebe796..2cf6021fe08 100644 --- a/resource-manager/network/2023-09-01/expressrouteconnections/id_expressrouteconnection.go +++ b/resource-manager/network/2023-09-01/expressrouteconnections/id_expressrouteconnection.go @@ -123,7 +123,7 @@ func (id ExpressRouteConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayName"), resourceids.StaticSegment("staticExpressRouteConnections", "expressRouteConnections", "expressRouteConnections"), - resourceids.UserSpecifiedSegment("expressRouteConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("expressRouteConnectionName", "expressRouteConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/expressrouteconnections/id_expressrouteconnection_test.go b/resource-manager/network/2023-09-01/expressrouteconnections/id_expressrouteconnection_test.go index 4416a9058fc..dd3b75e24af 100644 --- a/resource-manager/network/2023-09-01/expressrouteconnections/id_expressrouteconnection_test.go +++ b/resource-manager/network/2023-09-01/expressrouteconnections/id_expressrouteconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteConnectionId{} func TestNewExpressRouteConnectionID(t *testing.T) { - id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") + id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExpressRouteConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayName") } - if id.ExpressRouteConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "connectionName") + if id.ExpressRouteConnectionName != "expressRouteConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "expressRouteConnectionName") } } func TestFormatExpressRouteConnectionID(t *testing.T) { - actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName" + actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExpressRouteConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ExpressRouteGatewayName: "expressRouteGatewayName", - ExpressRouteConnectionName: "connectionName", + ExpressRouteConnectionName: "expressRouteConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExpressRouteConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ExpressRouteGatewayName: "expressRouteGatewayName", - ExpressRouteConnectionName: "connectionName", + ExpressRouteConnectionName: "expressRouteConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNnAmE", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyNaMe", - ExpressRouteConnectionName: "cOnNeCtIoNnAmE", + ExpressRouteConnectionName: "eXpReSsRoUtEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/README.md b/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/README.md index 365138afc6f..3cfa77db99a 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/README.md +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName") // alternatively `client.ExpressRouteCrossConnectionsListArpTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListArpTableComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/id_peeringarptable.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/id_peeringarptable.go index 0589efdc27b..f37ffb9dda2 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/id_peeringarptable.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/id_peeringarptable.go @@ -127,11 +127,11 @@ func (id PeeringArpTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "devicePath"), + resourceids.UserSpecifiedSegment("arpTableName", "arpTableName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go index 7a56ebe2b11..1d31f05cc7a 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringArpTableId{} func TestNewPeeringArpTableID(t *testing.T) { - id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringArpTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.ArpTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "devicePath") + if id.ArpTableName != "arpTableName" { + t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableName") } } func TestFormatPeeringArpTableID(t *testing.T) { - actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath" + actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringArpTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringArpTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - ArpTableName: "dEvIcEpAtH", + ArpTableName: "aRpTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/README.md b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/README.md index ef563c8ad03..f6a95ae8365 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/README.md +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") payload := expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeering{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go index 0971af25620..890e4e7d24b 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go @@ -115,7 +115,7 @@ func (id ExpressRouteCrossConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go index 2019f0104a6..33465dd597a 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") + id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCrossConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } } func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName" + actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCrossConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_peering.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_peering.go index 83a9563a48d..c3ee06da4dc 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_peering.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_peering.go @@ -121,7 +121,7 @@ func (id PeeringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_peering_test.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_peering_test.go index 57de6e64b02..ac47382755d 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_peering_test.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionpeerings/id_peering_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringId{} func TestNewPeeringID(t *testing.T) { - id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") + id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPeeringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { @@ -32,8 +32,8 @@ func TestNewPeeringID(t *testing.T) { } func TestFormatPeeringID(t *testing.T) { - actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName" + actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePeeringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePeeringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/README.md b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/README.md index 64efad89423..af5389efa30 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/README.md +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName") // alternatively `client.ExpressRouteCrossConnectionsListRoutesTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListRoutesTableComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go index b6d27ada378..29491001fbf 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go @@ -127,11 +127,11 @@ func (id ExpressRouteCrossConnectionPeeringRouteTableId) Segments() []resourceid resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTableName", "routeTableName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go index 35e27084ce7..2dd58fa2973 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionPeeringRouteTableId{} func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "devicePath") + if id.RouteTableName != "routeTableName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableName") } } func TestFormatExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath" + actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(t *tes }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - RouteTableName: "dEvIcEpAtH", + RouteTableName: "rOuTeTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/README.md b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/README.md index 8a6aa7380fb..e7ca1d8c2c1 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/README.md +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName") // alternatively `client.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListRoutesTableSummaryComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go index df854619ed9..1d3631cb982 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go @@ -127,11 +127,11 @@ func (id PeeringRouteTablesSummaryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go index 361ebbceb19..6d2bdf44468 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringRouteTablesSummaryId{} func TestNewPeeringRouteTablesSummaryID(t *testing.T) { - id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringRouteTablesSummaryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTablesSummaryName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "devicePath") + if id.RouteTablesSummaryName != "routeTablesSummaryName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryName") } } func TestFormatPeeringRouteTablesSummaryID(t *testing.T) { - actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath" + actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringRouteTablesSummaryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringRouteTablesSummaryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - RouteTablesSummaryName: "dEvIcEpAtH", + RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnections/README.md b/resource-manager/network/2023-09-01/expressroutecrossconnections/README.md index d1c5acfd2d6..ecb7d463bcf 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnections/README.md +++ b/resource-manager/network/2023-09-01/expressroutecrossconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") payload := expressroutecrossconnections.ExpressRouteCrossConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -92,7 +92,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") payload := expressroutecrossconnections.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnections/id_expressroutecrossconnection.go b/resource-manager/network/2023-09-01/expressroutecrossconnections/id_expressroutecrossconnection.go index dcaf8883d78..10dc03f9c00 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnections/id_expressroutecrossconnection.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnections/id_expressroutecrossconnection.go @@ -115,7 +115,7 @@ func (id ExpressRouteCrossConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go b/resource-manager/network/2023-09-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go index 620034d43a3..11f11c44f51 100644 --- a/resource-manager/network/2023-09-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go +++ b/resource-manager/network/2023-09-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") + id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCrossConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } } func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName" + actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCrossConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressrouteportslocations/README.md b/resource-manager/network/2023-09-01/expressrouteportslocations/README.md index abe5756cd43..c94f5a51813 100644 --- a/resource-manager/network/2023-09-01/expressrouteportslocations/README.md +++ b/resource-manager/network/2023-09-01/expressrouteportslocations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName") +id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/expressrouteportslocations/id_expressrouteportslocation.go b/resource-manager/network/2023-09-01/expressrouteportslocations/id_expressrouteportslocation.go index 73fe725b0df..d8025eb5937 100644 --- a/resource-manager/network/2023-09-01/expressrouteportslocations/id_expressrouteportslocation.go +++ b/resource-manager/network/2023-09-01/expressrouteportslocations/id_expressrouteportslocation.go @@ -107,7 +107,7 @@ func (id ExpressRoutePortsLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRoutePortsLocations", "expressRoutePortsLocations", "expressRoutePortsLocations"), - resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "locationName"), + resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "expressRoutePortsLocationName"), } } diff --git a/resource-manager/network/2023-09-01/expressrouteportslocations/id_expressrouteportslocation_test.go b/resource-manager/network/2023-09-01/expressrouteportslocations/id_expressrouteportslocation_test.go index 44398dc0c7e..693718559ff 100644 --- a/resource-manager/network/2023-09-01/expressrouteportslocations/id_expressrouteportslocation_test.go +++ b/resource-manager/network/2023-09-01/expressrouteportslocations/id_expressrouteportslocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ExpressRoutePortsLocationId{} func TestNewExpressRoutePortsLocationID(t *testing.T) { - id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName") + id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ExpressRoutePortsLocationName != "locationName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "locationName") + if id.ExpressRoutePortsLocationName != "expressRoutePortsLocationName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "expressRoutePortsLocationName") } } func TestFormatExpressRoutePortsLocationID(t *testing.T) { - actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName" + actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseExpressRoutePortsLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "locationName", + ExpressRoutePortsLocationName: "expressRoutePortsLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseExpressRoutePortsLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "locationName", + ExpressRoutePortsLocationName: "expressRoutePortsLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/lOcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnNaMe", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "lOcAtIoNnAmE", + ExpressRoutePortsLocationName: "eXpReSsRoUtEpOrTsLoCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/lOcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/expressrouteproviderports/README.md b/resource-manager/network/2023-09-01/expressrouteproviderports/README.md index 8c0c7af7201..7810a31f76c 100644 --- a/resource-manager/network/2023-09-01/expressrouteproviderports/README.md +++ b/resource-manager/network/2023-09-01/expressrouteproviderports/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport") +id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName") read, err := client.ExpressRouteProviderPort(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/expressrouteproviderports/id_expressrouteproviderport.go b/resource-manager/network/2023-09-01/expressrouteproviderports/id_expressrouteproviderport.go index 866b4c25f4f..142c36fee12 100644 --- a/resource-manager/network/2023-09-01/expressrouteproviderports/id_expressrouteproviderport.go +++ b/resource-manager/network/2023-09-01/expressrouteproviderports/id_expressrouteproviderport.go @@ -107,7 +107,7 @@ func (id ExpressRouteProviderPortId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteProviderPorts", "expressRouteProviderPorts", "expressRouteProviderPorts"), - resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "providerport"), + resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "expressRouteProviderPortName"), } } diff --git a/resource-manager/network/2023-09-01/expressrouteproviderports/id_expressrouteproviderport_test.go b/resource-manager/network/2023-09-01/expressrouteproviderports/id_expressrouteproviderport_test.go index 980dfd0f387..04d9684f23d 100644 --- a/resource-manager/network/2023-09-01/expressrouteproviderports/id_expressrouteproviderport_test.go +++ b/resource-manager/network/2023-09-01/expressrouteproviderports/id_expressrouteproviderport_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ExpressRouteProviderPortId{} func TestNewExpressRouteProviderPortID(t *testing.T) { - id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport") + id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ExpressRouteProviderPortName != "providerport" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "providerport") + if id.ExpressRouteProviderPortName != "expressRouteProviderPortName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "expressRouteProviderPortName") } } func TestFormatExpressRouteProviderPortID(t *testing.T) { - actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport" + actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseExpressRouteProviderPortID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "providerport", + ExpressRouteProviderPortName: "expressRouteProviderPortName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseExpressRouteProviderPortIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "providerport", + ExpressRouteProviderPortName: "expressRouteProviderPortName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/pRoViDeRpOrT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTnAmE", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "pRoViDeRpOrT", + ExpressRouteProviderPortName: "eXpReSsRoUtEpRoViDeRpOrTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/pRoViDeRpOrT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/firewallpolicyrulecollectiongroups/model_applicationrule.go b/resource-manager/network/2023-09-01/firewallpolicyrulecollectiongroups/model_applicationrule.go index 00f2de60a64..1684b7ab31b 100644 --- a/resource-manager/network/2023-09-01/firewallpolicyrulecollectiongroups/model_applicationrule.go +++ b/resource-manager/network/2023-09-01/firewallpolicyrulecollectiongroups/model_applicationrule.go @@ -18,7 +18,7 @@ type ApplicationRule struct { SourceAddresses *[]string `json:"sourceAddresses,omitempty"` SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` + TargetURLs *[]string `json:"targetUrls,omitempty"` TerminateTLS *bool `json:"terminateTLS,omitempty"` WebCategories *[]string `json:"webCategories,omitempty"` diff --git a/resource-manager/network/2023-09-01/ipgroups/README.md b/resource-manager/network/2023-09-01/ipgroups/README.md index 6f13e6be0bb..c799f0cb076 100644 --- a/resource-manager/network/2023-09-01/ipgroups/README.md +++ b/resource-manager/network/2023-09-01/ipgroups/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") payload := ipgroups.IPGroup{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") read, err := client.Get(ctx, id, ipgroups.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") payload := ipgroups.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/ipgroups/id_ipgroup.go b/resource-manager/network/2023-09-01/ipgroups/id_ipgroup.go index 255122bcafc..441c7301b56 100644 --- a/resource-manager/network/2023-09-01/ipgroups/id_ipgroup.go +++ b/resource-manager/network/2023-09-01/ipgroups/id_ipgroup.go @@ -115,7 +115,7 @@ func (id IPGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticIpGroups", "ipGroups", "ipGroups"), - resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupsName"), + resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupName"), } } diff --git a/resource-manager/network/2023-09-01/ipgroups/id_ipgroup_test.go b/resource-manager/network/2023-09-01/ipgroups/id_ipgroup_test.go index 0dee23413e1..e590c1f6bc7 100644 --- a/resource-manager/network/2023-09-01/ipgroups/id_ipgroup_test.go +++ b/resource-manager/network/2023-09-01/ipgroups/id_ipgroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IPGroupId{} func TestNewIPGroupID(t *testing.T) { - id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") + id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewIPGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.IpGroupName != "ipGroupsName" { - t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupsName") + if id.IpGroupName != "ipGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupName") } } func TestFormatIPGroupID(t *testing.T) { - actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName" + actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseIPGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupsName", + IpGroupName: "ipGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseIPGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupsName", + IpGroupName: "ipGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpNaMe", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IpGroupName: "iPgRoUpSnAmE", + IpGroupName: "iPgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/loadbalancers/README.md b/resource-manager/network/2023-09-01/loadbalancers/README.md index 6402babb502..6b508aefea4 100644 --- a/resource-manager/network/2023-09-01/loadbalancers/README.md +++ b/resource-manager/network/2023-09-01/loadbalancers/README.md @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName") +id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName") payload := loadbalancers.QueryInboundNatRulePortMappingRequest{ // ... @@ -394,7 +394,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName") +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName") payload := loadbalancers.MigrateLoadBalancerToIPBasedRequest{ // ... @@ -415,7 +415,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loadbalancers.LoadBalancerVipSwapRequest{ // ... diff --git a/resource-manager/network/2023-09-01/loadbalancers/id_backendaddresspool.go b/resource-manager/network/2023-09-01/loadbalancers/id_backendaddresspool.go index 8ed580c9198..9984348c234 100644 --- a/resource-manager/network/2023-09-01/loadbalancers/id_backendaddresspool.go +++ b/resource-manager/network/2023-09-01/loadbalancers/id_backendaddresspool.go @@ -117,13 +117,13 @@ func (id BackendAddressPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerName"), resourceids.StaticSegment("staticBackendAddressPools", "backendAddressPools", "backendAddressPools"), - resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendPoolName"), + resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendAddressPoolName"), } } diff --git a/resource-manager/network/2023-09-01/loadbalancers/id_backendaddresspool_test.go b/resource-manager/network/2023-09-01/loadbalancers/id_backendaddresspool_test.go index 3a2671f5985..b8334fde60c 100644 --- a/resource-manager/network/2023-09-01/loadbalancers/id_backendaddresspool_test.go +++ b/resource-manager/network/2023-09-01/loadbalancers/id_backendaddresspool_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &BackendAddressPoolId{} func TestNewBackendAddressPoolID(t *testing.T) { - id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName") + id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.LoadBalancerName != "loadBalancerName" { t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerName") } - if id.BackendAddressPoolName != "backendPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendPoolName") + if id.BackendAddressPoolName != "backendAddressPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendAddressPoolName") } } func TestFormatBackendAddressPoolID(t *testing.T) { - actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName" + actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseBackendAddressPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", - BackendAddressPoolName: "backendPoolName", + BackendAddressPoolName: "backendAddressPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseBackendAddressPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", - BackendAddressPoolName: "backendPoolName", + BackendAddressPoolName: "backendAddressPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLnAmE", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", LoadBalancerName: "lOaDbAlAnCeRnAmE", - BackendAddressPoolName: "bAcKeNdPoOlNaMe", + BackendAddressPoolName: "bAcKeNdAdDrEsSpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/loadbalancers/id_loadbalancer.go b/resource-manager/network/2023-09-01/loadbalancers/id_loadbalancer.go index ef69db4bf71..61207d17d8d 100644 --- a/resource-manager/network/2023-09-01/loadbalancers/id_loadbalancer.go +++ b/resource-manager/network/2023-09-01/loadbalancers/id_loadbalancer.go @@ -111,7 +111,7 @@ func (id LoadBalancerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), diff --git a/resource-manager/network/2023-09-01/loadbalancers/id_loadbalancer_test.go b/resource-manager/network/2023-09-01/loadbalancers/id_loadbalancer_test.go index 25fcce5b649..5e02836d140 100644 --- a/resource-manager/network/2023-09-01/loadbalancers/id_loadbalancer_test.go +++ b/resource-manager/network/2023-09-01/loadbalancers/id_loadbalancer_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LoadBalancerId{} func TestNewLoadBalancerID(t *testing.T) { - id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName") + id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.LoadBalancerName != "loadBalancerName" { @@ -28,8 +28,8 @@ func TestNewLoadBalancerID(t *testing.T) { } func TestFormatLoadBalancerID(t *testing.T) { - actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName" + actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseLoadBalancerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseLoadBalancerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", LoadBalancerName: "lOaDbAlAnCeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/loadbalancers/id_location.go b/resource-manager/network/2023-09-01/loadbalancers/id_location.go index 06ff0a743e6..b6cfa4c67ba 100644 --- a/resource-manager/network/2023-09-01/loadbalancers/id_location.go +++ b/resource-manager/network/2023-09-01/loadbalancers/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/loadbalancers/id_location_test.go b/resource-manager/network/2023-09-01/loadbalancers/id_location_test.go index 97e523fbcc4..c15a4a4b124 100644 --- a/resource-manager/network/2023-09-01/loadbalancers/id_location_test.go +++ b/resource-manager/network/2023-09-01/loadbalancers/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/networkinterfaces/README.md b/resource-manager/network/2023-09-01/networkinterfaces/README.md index 2f87bb7d3c2..e20db244bef 100644 --- a/resource-manager/network/2023-09-01/networkinterfaces/README.md +++ b/resource-manager/network/2023-09-01/networkinterfaces/README.md @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName") +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName") read, err := client.GetVirtualMachineScaleSetIPConfiguration(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions()) if err != nil { @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName") +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName") read, err := client.GetVirtualMachineScaleSetNetworkInterface(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions()) if err != nil { @@ -220,7 +220,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName") +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName") // alternatively `client.ListVirtualMachineScaleSetIPConfigurations(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions())` can be used to do batched pagination items, err := client.ListVirtualMachineScaleSetIPConfigurationsComplete(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions()) @@ -254,7 +254,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex") +id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName") // alternatively `client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id)` can be used to do batched pagination items, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx, id) @@ -317,6 +317,35 @@ for _, item := range items { ``` +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsCreateOrUpdate` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceName", "tapConfigurationName") + +payload := networkinterfaces.NetworkInterfaceTapConfiguration{ + // ... +} + + +if err := client.NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsDelete` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceName", "tapConfigurationName") + +if err := client.NetworkInterfaceTapConfigurationsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + ### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsGet` ```go diff --git a/resource-manager/network/2023-09-01/networkinterfaces/id_virtualmachine.go b/resource-manager/network/2023-09-01/networkinterfaces/id_virtualmachine.go index 3e8bac23fd1..ad24ef16d81 100644 --- a/resource-manager/network/2023-09-01/networkinterfaces/id_virtualmachine.go +++ b/resource-manager/network/2023-09-01/networkinterfaces/id_virtualmachine.go @@ -123,7 +123,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "virtualmachineIndex"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/network/2023-09-01/networkinterfaces/id_virtualmachine_test.go b/resource-manager/network/2023-09-01/networkinterfaces/id_virtualmachine_test.go index 612c4ecdd69..cb6aa2f9476 100644 --- a/resource-manager/network/2023-09-01/networkinterfaces/id_virtualmachine_test.go +++ b/resource-manager/network/2023-09-01/networkinterfaces/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.VirtualMachineName != "virtualmachineIndex" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualmachineIndex") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - VirtualMachineName: "virtualmachineIndex", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - VirtualMachineName: "virtualmachineIndex", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEiNdEx", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - VirtualMachineName: "vIrTuAlMaChInEiNdEx", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEiNdEx/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go b/resource-manager/network/2023-09-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go new file mode 100644 index 00000000000..fcece2ea104 --- /dev/null +++ b/resource-manager/network/2023-09-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go @@ -0,0 +1,75 @@ +package networkinterfaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceTapConfigurationsCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *NetworkInterfaceTapConfiguration +} + +// NetworkInterfaceTapConfigurationsCreateOrUpdate ... +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsCreateOrUpdate(ctx context.Context, id TapConfigurationId, input NetworkInterfaceTapConfiguration) (result NetworkInterfaceTapConfigurationsCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll performs NetworkInterfaceTapConfigurationsCreateOrUpdate then polls until it's completed +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll(ctx context.Context, id TapConfigurationId, input NetworkInterfaceTapConfiguration) error { + result, err := c.NetworkInterfaceTapConfigurationsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing NetworkInterfaceTapConfigurationsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after NetworkInterfaceTapConfigurationsCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2023-09-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go b/resource-manager/network/2023-09-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go new file mode 100644 index 00000000000..263815906b2 --- /dev/null +++ b/resource-manager/network/2023-09-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go @@ -0,0 +1,71 @@ +package networkinterfaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceTapConfigurationsDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// NetworkInterfaceTapConfigurationsDelete ... +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsDelete(ctx context.Context, id TapConfigurationId) (result NetworkInterfaceTapConfigurationsDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// NetworkInterfaceTapConfigurationsDeleteThenPoll performs NetworkInterfaceTapConfigurationsDelete then polls until it's completed +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsDeleteThenPoll(ctx context.Context, id TapConfigurationId) error { + result, err := c.NetworkInterfaceTapConfigurationsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing NetworkInterfaceTapConfigurationsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after NetworkInterfaceTapConfigurationsDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2023-09-01/networkvirtualappliances/README.md b/resource-manager/network/2023-09-01/networkvirtualappliances/README.md index 39f0082cec6..1868416a9ab 100644 --- a/resource-manager/network/2023-09-01/networkvirtualappliances/README.md +++ b/resource-manager/network/2023-09-01/networkvirtualappliances/README.md @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") +id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") payload := networkvirtualappliances.InboundSecurityRule{ // ... diff --git a/resource-manager/network/2023-09-01/networkvirtualappliances/id_inboundsecurityrule.go b/resource-manager/network/2023-09-01/networkvirtualappliances/id_inboundsecurityrule.go index d59b8c173b5..4da7242be6d 100644 --- a/resource-manager/network/2023-09-01/networkvirtualappliances/id_inboundsecurityrule.go +++ b/resource-manager/network/2023-09-01/networkvirtualappliances/id_inboundsecurityrule.go @@ -123,7 +123,7 @@ func (id InboundSecurityRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticInboundSecurityRules", "inboundSecurityRules", "inboundSecurityRules"), - resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "ruleCollectionName"), + resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "inboundSecurityRuleName"), } } diff --git a/resource-manager/network/2023-09-01/networkvirtualappliances/id_inboundsecurityrule_test.go b/resource-manager/network/2023-09-01/networkvirtualappliances/id_inboundsecurityrule_test.go index a4a396742df..b953b2aa90d 100644 --- a/resource-manager/network/2023-09-01/networkvirtualappliances/id_inboundsecurityrule_test.go +++ b/resource-manager/network/2023-09-01/networkvirtualappliances/id_inboundsecurityrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InboundSecurityRuleId{} func TestNewInboundSecurityRuleID(t *testing.T) { - id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") + id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewInboundSecurityRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.InboundSecurityRuleName != "ruleCollectionName" { - t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "ruleCollectionName") + if id.InboundSecurityRuleName != "inboundSecurityRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "inboundSecurityRuleName") } } func TestFormatInboundSecurityRuleID(t *testing.T) { - actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName" + actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseInboundSecurityRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - InboundSecurityRuleName: "ruleCollectionName", + InboundSecurityRuleName: "inboundSecurityRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseInboundSecurityRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - InboundSecurityRuleName: "ruleCollectionName", + InboundSecurityRuleName: "inboundSecurityRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeNaMe", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - InboundSecurityRuleName: "rUlEcOlLeCtIoNnAmE", + InboundSecurityRuleName: "iNbOuNdSeCuRiTyRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/p2svpngateways/README.md b/resource-manager/network/2023-09-01/p2svpngateways/README.md index 01f5779c134..cd2a74b0497 100644 --- a/resource-manager/network/2023-09-01/p2svpngateways/README.md +++ b/resource-manager/network/2023-09-01/p2svpngateways/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnConnectionRequest{ // ... @@ -42,7 +42,7 @@ if err := client.DisconnectP2sVpnConnectionsThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnProfileParameters{ // ... @@ -59,7 +59,7 @@ if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnConnectionHealthRequest{ // ... @@ -88,7 +88,7 @@ if err := client.GetP2sVpnConnectionHealthDetailedThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.ResetThenPoll(ctx, id); err != nil { // handle the error @@ -100,7 +100,7 @@ if err := client.ResetThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/p2svpngateways/model_p2svpnconnectionhealth.go b/resource-manager/network/2023-09-01/p2svpngateways/model_p2svpnconnectionhealth.go index 42b227bbf63..d7e951d0d0a 100644 --- a/resource-manager/network/2023-09-01/p2svpngateways/model_p2svpnconnectionhealth.go +++ b/resource-manager/network/2023-09-01/p2svpngateways/model_p2svpnconnectionhealth.go @@ -4,5 +4,5 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type P2SVpnConnectionHealth struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-09-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go b/resource-manager/network/2023-09-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go index d0cd806bd05..cb5094a7b15 100644 --- a/resource-manager/network/2023-09-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go +++ b/resource-manager/network/2023-09-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go @@ -4,6 +4,6 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type P2SVpnConnectionHealthRequest struct { - OutputBlobSasUrl *string `json:"outputBlobSasUrl,omitempty"` + OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"` } diff --git a/resource-manager/network/2023-09-01/p2svpngateways/model_vpnprofileresponse.go b/resource-manager/network/2023-09-01/p2svpngateways/model_vpnprofileresponse.go index 55f4d81d16c..3d26db7265b 100644 --- a/resource-manager/network/2023-09-01/p2svpngateways/model_vpnprofileresponse.go +++ b/resource-manager/network/2023-09-01/p2svpngateways/model_vpnprofileresponse.go @@ -4,5 +4,5 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` } diff --git a/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/README.md b/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/README.md index f3186014210..0afad552343 100644 --- a/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/README.md +++ b/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/id_peerconnection.go b/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/id_peerconnection.go index 4c26579b339..4819211effd 100644 --- a/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/id_peerconnection.go +++ b/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/id_peerconnection.go @@ -127,11 +127,11 @@ func (id PeerConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticPeerConnections", "peerConnections", "peerConnections"), - resourceids.UserSpecifiedSegment("peerConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("peerConnectionName", "peerConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/id_peerconnection_test.go b/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/id_peerconnection_test.go index a6434909377..578fee6fb85 100644 --- a/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/id_peerconnection_test.go +++ b/resource-manager/network/2023-09-01/peerexpressroutecircuitconnections/id_peerconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeerConnectionId{} func TestNewPeerConnectionID(t *testing.T) { - id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") + id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeerConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.PeerConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "connectionName") + if id.PeerConnectionName != "peerConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "peerConnectionName") } } func TestFormatPeerConnectionID(t *testing.T) { - actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName" + actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeerConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - PeerConnectionName: "connectionName", + PeerConnectionName: "peerConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeerConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - PeerConnectionName: "connectionName", + PeerConnectionName: "peerConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNnAmE", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - PeerConnectionName: "cOnNeCtIoNnAmE", + PeerConnectionName: "pEeRcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/privateendpoints/README.md b/resource-manager/network/2023-09-01/privateendpoints/README.md index e11e6c0452b..befc8707e8f 100644 --- a/resource-manager/network/2023-09-01/privateendpoints/README.md +++ b/resource-manager/network/2023-09-01/privateendpoints/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id) @@ -42,7 +42,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/privateendpoints/id_location.go b/resource-manager/network/2023-09-01/privateendpoints/id_location.go index f90051a6725..77d85ed86a2 100644 --- a/resource-manager/network/2023-09-01/privateendpoints/id_location.go +++ b/resource-manager/network/2023-09-01/privateendpoints/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/privateendpoints/id_location_test.go b/resource-manager/network/2023-09-01/privateendpoints/id_location_test.go index de6ecb243b3..aff4982b728 100644 --- a/resource-manager/network/2023-09-01/privateendpoints/id_location_test.go +++ b/resource-manager/network/2023-09-01/privateendpoints/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/privateendpoints/id_providerlocation.go b/resource-manager/network/2023-09-01/privateendpoints/id_providerlocation.go index cb389eabe34..5bf08d4e861 100644 --- a/resource-manager/network/2023-09-01/privateendpoints/id_providerlocation.go +++ b/resource-manager/network/2023-09-01/privateendpoints/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/privateendpoints/id_providerlocation_test.go b/resource-manager/network/2023-09-01/privateendpoints/id_providerlocation_test.go index 17c34f07818..ddd96efab6c 100644 --- a/resource-manager/network/2023-09-01/privateendpoints/id_providerlocation_test.go +++ b/resource-manager/network/2023-09-01/privateendpoints/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/privatelinkservices/README.md b/resource-manager/network/2023-09-01/privatelinkservices/README.md index 218d497c2f6..d10379ff858 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/README.md +++ b/resource-manager/network/2023-09-01/privatelinkservices/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ // ... @@ -42,7 +42,7 @@ if err := client.CheckPrivateLinkServiceVisibilityThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ // ... @@ -59,7 +59,7 @@ if err := client.CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx, i ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") payload := privatelinkservices.PrivateLinkService{ // ... @@ -76,7 +76,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -88,7 +88,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -100,7 +100,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") read, err := client.Get(ctx, id, privatelinkservices.DefaultGetOperationOptions()) if err != nil { @@ -116,7 +116,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id, privatelinkservices.DefaultGetPrivateEndpointConnectionOperationOptions()) if err != nil { @@ -149,7 +149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListAutoApprovedPrivateLinkServices(ctx, id)` can be used to do batched pagination items, err := client.ListAutoApprovedPrivateLinkServicesComplete(ctx, id) @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx, id) @@ -200,7 +200,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") // alternatively `client.ListPrivateEndpointConnections(ctx, id)` can be used to do batched pagination items, err := client.ListPrivateEndpointConnectionsComplete(ctx, id) @@ -217,7 +217,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") payload := privatelinkservices.PrivateEndpointConnection{ // ... diff --git a/resource-manager/network/2023-09-01/privatelinkservices/id_location.go b/resource-manager/network/2023-09-01/privatelinkservices/id_location.go index c2338e0d7ee..ad61efbce7f 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/id_location.go +++ b/resource-manager/network/2023-09-01/privatelinkservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/privatelinkservices/id_location_test.go b/resource-manager/network/2023-09-01/privatelinkservices/id_location_test.go index c7b93b9c65d..56fdbbb4ab0 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/id_location_test.go +++ b/resource-manager/network/2023-09-01/privatelinkservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/privatelinkservices/id_privateendpointconnection.go b/resource-manager/network/2023-09-01/privatelinkservices/id_privateendpointconnection.go index 0bb8766006b..3f1f439928b 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/id_privateendpointconnection.go +++ b/resource-manager/network/2023-09-01/privatelinkservices/id_privateendpointconnection.go @@ -121,9 +121,9 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "peConnectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/privatelinkservices/id_privateendpointconnection_test.go b/resource-manager/network/2023-09-01/privatelinkservices/id_privateendpointconnection_test.go index e82d28f6306..b76fddc6e1b 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/id_privateendpointconnection_test.go +++ b/resource-manager/network/2023-09-01/privatelinkservices/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "serviceName") + if id.PrivateLinkServiceName != "privateLinkServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceName") } - if id.PrivateEndpointConnectionName != "peConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "peConnectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", - PrivateEndpointConnectionName: "peConnectionName", + PrivateLinkServiceName: "privateLinkServiceName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", - PrivateEndpointConnectionName: "peConnectionName", + PrivateLinkServiceName: "privateLinkServiceName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "sErViCeNaMe", - PrivateEndpointConnectionName: "pEcOnNeCtIoNnAmE", + PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/privatelinkservices/id_privatelinkservice.go b/resource-manager/network/2023-09-01/privatelinkservices/id_privatelinkservice.go index c093bc5f0e7..d691d1eded6 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/id_privatelinkservice.go +++ b/resource-manager/network/2023-09-01/privatelinkservices/id_privatelinkservice.go @@ -115,7 +115,7 @@ func (id PrivateLinkServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceName"), } } diff --git a/resource-manager/network/2023-09-01/privatelinkservices/id_privatelinkservice_test.go b/resource-manager/network/2023-09-01/privatelinkservices/id_privatelinkservice_test.go index 43aa7b6b80a..bccc5172aaf 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/id_privatelinkservice_test.go +++ b/resource-manager/network/2023-09-01/privatelinkservices/id_privatelinkservice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkServiceId{} func TestNewPrivateLinkServiceID(t *testing.T) { - id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") + id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "serviceName") + if id.PrivateLinkServiceName != "privateLinkServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceName") } } func TestFormatPrivateLinkServiceID(t *testing.T) { - actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName" + actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", + PrivateLinkServiceName: "privateLinkServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", + PrivateLinkServiceName: "privateLinkServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "sErViCeNaMe", + PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/privatelinkservices/id_providerlocation.go b/resource-manager/network/2023-09-01/privatelinkservices/id_providerlocation.go index 929b9472fbc..706ab2680a9 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/id_providerlocation.go +++ b/resource-manager/network/2023-09-01/privatelinkservices/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/privatelinkservices/id_providerlocation_test.go b/resource-manager/network/2023-09-01/privatelinkservices/id_providerlocation_test.go index 77653638cf4..1565dd828b1 100644 --- a/resource-manager/network/2023-09-01/privatelinkservices/id_providerlocation_test.go +++ b/resource-manager/network/2023-09-01/privatelinkservices/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/publicipaddresses/README.md b/resource-manager/network/2023-09-01/publicipaddresses/README.md index 746d3130773..14f52418c01 100644 --- a/resource-manager/network/2023-09-01/publicipaddresses/README.md +++ b/resource-manager/network/2023-09-01/publicipaddresses/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") payload := publicipaddresses.PublicIPAddress{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") read, err := client.Get(ctx, id, publicipaddresses.DefaultGetOperationOptions()) if err != nil { @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") payload := publicipaddresses.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/publicipprefixes/README.md b/resource-manager/network/2023-09-01/publicipprefixes/README.md index 868769238ed..d94ade2a53c 100644 --- a/resource-manager/network/2023-09-01/publicipprefixes/README.md +++ b/resource-manager/network/2023-09-01/publicipprefixes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") payload := publicipprefixes.PublicIPPrefix{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") payload := publicipprefixes.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix.go b/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix.go index ba849d0aad0..35801814a57 100644 --- a/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix.go +++ b/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix.go @@ -115,7 +115,7 @@ func (id PublicIPPrefixId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPublicIPPrefixes", "publicIPPrefixes", "publicIPPrefixes"), - resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIpPrefixName"), + resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIPPrefixName"), } } diff --git a/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix_test.go b/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix_test.go index c19356dcda1..267591b6714 100644 --- a/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix_test.go +++ b/resource-manager/network/2023-09-01/publicipprefixes/id_publicipprefix_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PublicIPPrefixId{} func TestNewPublicIPPrefixID(t *testing.T) { - id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") + id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPublicIPPrefixID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PublicIPPrefixName != "publicIpPrefixName" { - t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIpPrefixName") + if id.PublicIPPrefixName != "publicIPPrefixName" { + t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIPPrefixName") } } func TestFormatPublicIPPrefixID(t *testing.T) { - actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName" + actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePublicIPPrefixID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName", Expected: &PublicIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIpPrefixName", + PublicIPPrefixName: "publicIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParsePublicIPPrefixIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName", Expected: &PublicIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIpPrefixName", + PublicIPPrefixName: "publicIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName/extra", Error: true, }, { diff --git a/resource-manager/network/2023-09-01/routefilterrules/README.md b/resource-manager/network/2023-09-01/routefilterrules/README.md index c3c4bf4b6b3..527ea66ec5b 100644 --- a/resource-manager/network/2023-09-01/routefilterrules/README.md +++ b/resource-manager/network/2023-09-01/routefilterrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") payload := routefilterrules.RouteFilterRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/routefilterrules/id_routefilterrule.go b/resource-manager/network/2023-09-01/routefilterrules/id_routefilterrule.go index 120d8a966e0..d06e7791dfc 100644 --- a/resource-manager/network/2023-09-01/routefilterrules/id_routefilterrule.go +++ b/resource-manager/network/2023-09-01/routefilterrules/id_routefilterrule.go @@ -123,7 +123,7 @@ func (id RouteFilterRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterName"), resourceids.StaticSegment("staticRouteFilterRules", "routeFilterRules", "routeFilterRules"), - resourceids.UserSpecifiedSegment("routeFilterRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("routeFilterRuleName", "routeFilterRuleName"), } } diff --git a/resource-manager/network/2023-09-01/routefilterrules/id_routefilterrule_test.go b/resource-manager/network/2023-09-01/routefilterrules/id_routefilterrule_test.go index b0d5daed59a..4a52969db44 100644 --- a/resource-manager/network/2023-09-01/routefilterrules/id_routefilterrule_test.go +++ b/resource-manager/network/2023-09-01/routefilterrules/id_routefilterrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteFilterRuleId{} func TestNewRouteFilterRuleID(t *testing.T) { - id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") + id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRouteFilterRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterName") } - if id.RouteFilterRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "ruleName") + if id.RouteFilterRuleName != "routeFilterRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "routeFilterRuleName") } } func TestFormatRouteFilterRuleID(t *testing.T) { - actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName" + actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRouteFilterRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RouteFilterName: "routeFilterName", - RouteFilterRuleName: "ruleName", + RouteFilterRuleName: "routeFilterRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRouteFilterRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RouteFilterName: "routeFilterName", - RouteFilterRuleName: "ruleName", + RouteFilterRuleName: "routeFilterRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeNaMe", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RouteFilterName: "rOuTeFiLtErNaMe", - RouteFilterRuleName: "rUlEnAmE", + RouteFilterRuleName: "rOuTeFiLtErRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/securityadminconfigurations/README.md b/resource-manager/network/2023-09-01/securityadminconfigurations/README.md index fa602ac01ba..8c4c17ef7d5 100644 --- a/resource-manager/network/2023-09-01/securityadminconfigurations/README.md +++ b/resource-manager/network/2023-09-01/securityadminconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") payload := securityadminconfigurations.SecurityAdminConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDele ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/securityadminconfigurations/id_securityadminconfiguration.go b/resource-manager/network/2023-09-01/securityadminconfigurations/id_securityadminconfiguration.go index 30b23886bf3..070ef0fa83e 100644 --- a/resource-manager/network/2023-09-01/securityadminconfigurations/id_securityadminconfiguration.go +++ b/resource-manager/network/2023-09-01/securityadminconfigurations/id_securityadminconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityAdminConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), } } diff --git a/resource-manager/network/2023-09-01/securityadminconfigurations/id_securityadminconfiguration_test.go b/resource-manager/network/2023-09-01/securityadminconfigurations/id_securityadminconfiguration_test.go index 2e644cd781d..66fc3677b11 100644 --- a/resource-manager/network/2023-09-01/securityadminconfigurations/id_securityadminconfiguration_test.go +++ b/resource-manager/network/2023-09-01/securityadminconfigurations/id_securityadminconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityAdminConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } } func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName" + actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityAdminConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/servicetags/README.md b/resource-manager/network/2023-09-01/servicetags/README.md index 69639ec0a61..ae8d4818878 100644 --- a/resource-manager/network/2023-09-01/servicetags/README.md +++ b/resource-manager/network/2023-09-01/servicetags/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ServiceTagInformationList(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions())` can be used to do batched pagination items, err := client.ServiceTagInformationListComplete(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ServiceTagsList(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/servicetags/id_location.go b/resource-manager/network/2023-09-01/servicetags/id_location.go index 82d35d1f77c..5040a3f420a 100644 --- a/resource-manager/network/2023-09-01/servicetags/id_location.go +++ b/resource-manager/network/2023-09-01/servicetags/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/servicetags/id_location_test.go b/resource-manager/network/2023-09-01/servicetags/id_location_test.go index bb87f65c1d0..003c4b42ddf 100644 --- a/resource-manager/network/2023-09-01/servicetags/id_location_test.go +++ b/resource-manager/network/2023-09-01/servicetags/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/usages/README.md b/resource-manager/network/2023-09-01/usages/README.md index f4e936020ab..ca3cfa8acb7 100644 --- a/resource-manager/network/2023-09-01/usages/README.md +++ b/resource-manager/network/2023-09-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/usages/id_location.go b/resource-manager/network/2023-09-01/usages/id_location.go index 2fe99ba303b..5f505126c1e 100644 --- a/resource-manager/network/2023-09-01/usages/id_location.go +++ b/resource-manager/network/2023-09-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-09-01/usages/id_location_test.go b/resource-manager/network/2023-09-01/usages/id_location_test.go index b3c8d46ad6a..8b2dce92bff 100644 --- a/resource-manager/network/2023-09-01/usages/id_location_test.go +++ b/resource-manager/network/2023-09-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/vipswap/README.md b/resource-manager/network/2023-09-01/vipswap/README.md index 6fb66252863..4eb1a808132 100644 --- a/resource-manager/network/2023-09-01/vipswap/README.md +++ b/resource-manager/network/2023-09-01/vipswap/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") payload := vipswap.SwapResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/vipswap/id_cloudservice.go b/resource-manager/network/2023-09-01/vipswap/id_cloudservice.go index 0b7dd65e3bd..93c12d9c01d 100644 --- a/resource-manager/network/2023-09-01/vipswap/id_cloudservice.go +++ b/resource-manager/network/2023-09-01/vipswap/id_cloudservice.go @@ -111,11 +111,11 @@ func (id CloudServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceName"), } } diff --git a/resource-manager/network/2023-09-01/vipswap/id_cloudservice_test.go b/resource-manager/network/2023-09-01/vipswap/id_cloudservice_test.go index ffca7a5d07d..4bc26e07dc5 100644 --- a/resource-manager/network/2023-09-01/vipswap/id_cloudservice_test.go +++ b/resource-manager/network/2023-09-01/vipswap/id_cloudservice_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CloudServiceId{} func TestNewCloudServiceID(t *testing.T) { - id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") + id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } - if id.CloudServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "resourceName") + if id.CloudServiceName != "cloudServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceName") } } func TestFormatCloudServiceID(t *testing.T) { - actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName" + actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseCloudServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", - CloudServiceName: "resourceName", + ResourceGroupName: "resourceGroupName", + CloudServiceName: "cloudServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseCloudServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", - CloudServiceName: "resourceName", + ResourceGroupName: "resourceGroupName", + CloudServiceName: "cloudServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEnAmE", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", - CloudServiceName: "rEsOuRcEnAmE", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", + CloudServiceName: "cLoUdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualappliancesites/README.md b/resource-manager/network/2023-09-01/virtualappliancesites/README.md index 50e1b969af9..30cdb7478bd 100644 --- a/resource-manager/network/2023-09-01/virtualappliancesites/README.md +++ b/resource-manager/network/2023-09-01/virtualappliancesites/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") payload := virtualappliancesites.VirtualApplianceSite{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/virtualappliancesites/id_virtualappliancesite.go b/resource-manager/network/2023-09-01/virtualappliancesites/id_virtualappliancesite.go index 87e626d1b0c..592f4f47427 100644 --- a/resource-manager/network/2023-09-01/virtualappliancesites/id_virtualappliancesite.go +++ b/resource-manager/network/2023-09-01/virtualappliancesites/id_virtualappliancesite.go @@ -123,7 +123,7 @@ func (id VirtualApplianceSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticVirtualApplianceSites", "virtualApplianceSites", "virtualApplianceSites"), - resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "siteName"), + resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "virtualApplianceSiteName"), } } diff --git a/resource-manager/network/2023-09-01/virtualappliancesites/id_virtualappliancesite_test.go b/resource-manager/network/2023-09-01/virtualappliancesites/id_virtualappliancesite_test.go index ffff3d499f0..672639aa072 100644 --- a/resource-manager/network/2023-09-01/virtualappliancesites/id_virtualappliancesite_test.go +++ b/resource-manager/network/2023-09-01/virtualappliancesites/id_virtualappliancesite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualApplianceSiteId{} func TestNewVirtualApplianceSiteID(t *testing.T) { - id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") + id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualApplianceSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.VirtualApplianceSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "siteName") + if id.VirtualApplianceSiteName != "virtualApplianceSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "virtualApplianceSiteName") } } func TestFormatVirtualApplianceSiteID(t *testing.T) { - actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName" + actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualApplianceSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - VirtualApplianceSiteName: "siteName", + VirtualApplianceSiteName: "virtualApplianceSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualApplianceSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - VirtualApplianceSiteName: "siteName", + VirtualApplianceSiteName: "virtualApplianceSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEnAmE", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - VirtualApplianceSiteName: "sItEnAmE", + VirtualApplianceSiteName: "vIrTuAlApPlIaNcEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualapplianceskus/README.md b/resource-manager/network/2023-09-01/virtualapplianceskus/README.md index 065099d41d8..32424e88739 100644 --- a/resource-manager/network/2023-09-01/virtualapplianceskus/README.md +++ b/resource-manager/network/2023-09-01/virtualapplianceskus/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName") +id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/virtualapplianceskus/id_networkvirtualappliancesku.go b/resource-manager/network/2023-09-01/virtualapplianceskus/id_networkvirtualappliancesku.go index 46855c565e3..5eb920193a9 100644 --- a/resource-manager/network/2023-09-01/virtualapplianceskus/id_networkvirtualappliancesku.go +++ b/resource-manager/network/2023-09-01/virtualapplianceskus/id_networkvirtualappliancesku.go @@ -107,7 +107,7 @@ func (id NetworkVirtualApplianceSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticNetworkVirtualApplianceSkus", "networkVirtualApplianceSkus", "networkVirtualApplianceSkus"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "skuName"), + resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "networkVirtualApplianceSkuName"), } } diff --git a/resource-manager/network/2023-09-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go b/resource-manager/network/2023-09-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go index 6901430cd2e..7ca3e924a1e 100644 --- a/resource-manager/network/2023-09-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go +++ b/resource-manager/network/2023-09-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &NetworkVirtualApplianceSkuId{} func TestNewNetworkVirtualApplianceSkuID(t *testing.T) { - id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName") + id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.NetworkVirtualApplianceSkuName != "skuName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "skuName") + if id.NetworkVirtualApplianceSkuName != "networkVirtualApplianceSkuName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "networkVirtualApplianceSkuName") } } func TestFormatNetworkVirtualApplianceSkuID(t *testing.T) { - actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName" + actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseNetworkVirtualApplianceSkuID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "skuName", + NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseNetworkVirtualApplianceSkuIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "skuName", + NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/sKuNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUnAmE", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "sKuNaMe", + NetworkVirtualApplianceSkuName: "nEtWoRkViRtUaLaPpLiAnCeSkUnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/sKuNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/README.md b/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/README.md index 6b4e04031c1..4f22d25d7af 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/README.md +++ b/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.GetIkeSasThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.GetIkeSasThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") read, err := client.GetSharedKey(ctx, id) if err != nil { @@ -115,7 +115,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.ResetConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -127,7 +127,7 @@ if err := client.ResetConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{ // ... @@ -144,7 +144,7 @@ if err := client.ResetSharedKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.ConnectionSharedKey{ // ... @@ -161,7 +161,7 @@ if err := client.SetSharedKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{ // ... @@ -178,7 +178,7 @@ if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{ // ... @@ -195,7 +195,7 @@ if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/id_connection.go b/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/id_connection.go index fcc51d5666b..25fa92d5238 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/id_connection.go +++ b/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/id_connection.go @@ -115,7 +115,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "virtualNetworkGatewayConnectionName"), + resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } } diff --git a/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/id_connection_test.go b/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/id_connection_test.go index 19029d7c27e..271fc3c17bd 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/id_connection_test.go +++ b/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectionName != "virtualNetworkGatewayConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "virtualNetworkGatewayConnectionName") + if id.ConnectionName != "connectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionName") } } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go index e7481a70176..34b83087000 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go +++ b/resource-manager/network/2023-09-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go @@ -4,5 +4,5 @@ package virtualnetworkgatewayconnections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-09-01/virtualnetworkgateways/README.md b/resource-manager/network/2023-09-01/virtualnetworkgateways/README.md index 3b56105a6bd..8bf5380fe02 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgateways/README.md +++ b/resource-manager/network/2023-09-01/virtualnetworkgateways/README.md @@ -153,13 +153,13 @@ if err := client.GetLearnedRoutesThenPoll(ctx, id); err != nil { ``` -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageUrl` +### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageURL` ```go ctx := context.TODO() id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayName") -if err := client.GetVpnProfilePackageUrlThenPoll(ctx, id); err != nil { +if err := client.GetVpnProfilePackageURLThenPoll(ctx, id); err != nil { // handle the error } ``` @@ -397,7 +397,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgateways.VpnDeviceScriptParameters{ // ... diff --git a/resource-manager/network/2023-09-01/virtualnetworkgateways/id_connection.go b/resource-manager/network/2023-09-01/virtualnetworkgateways/id_connection.go index fb0eb751b39..7e0a849bdfd 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgateways/id_connection.go +++ b/resource-manager/network/2023-09-01/virtualnetworkgateways/id_connection.go @@ -115,7 +115,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "virtualNetworkGatewayConnectionName"), + resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } } diff --git a/resource-manager/network/2023-09-01/virtualnetworkgateways/id_connection_test.go b/resource-manager/network/2023-09-01/virtualnetworkgateways/id_connection_test.go index 255ca4bbb2c..f523578a93d 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgateways/id_connection_test.go +++ b/resource-manager/network/2023-09-01/virtualnetworkgateways/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectionName != "virtualNetworkGatewayConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "virtualNetworkGatewayConnectionName") + if id.ConnectionName != "connectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionName") } } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go b/resource-manager/network/2023-09-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go index c247730a0c5..e814c6eff38 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go +++ b/resource-manager/network/2023-09-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go @@ -14,15 +14,15 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetVpnProfilePackageUrlOperationResponse struct { +type GetVpnProfilePackageURLOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData Model *string } -// GetVpnProfilePackageUrl ... -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageUrlOperationResponse, err error) { +// GetVpnProfilePackageURL ... +func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -56,15 +56,15 @@ func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Contex return } -// GetVpnProfilePackageUrlThenPoll performs GetVpnProfilePackageUrl then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrlThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnProfilePackageUrl(ctx, id) +// GetVpnProfilePackageURLThenPoll performs GetVpnProfilePackageURL then polls until it's completed +func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageURLThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { + result, err := c.GetVpnProfilePackageURL(ctx, id) if err != nil { - return fmt.Errorf("performing GetVpnProfilePackageUrl: %+v", err) + return fmt.Errorf("performing GetVpnProfilePackageURL: %+v", err) } if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnProfilePackageUrl: %+v", err) + return fmt.Errorf("polling after GetVpnProfilePackageURL: %+v", err) } return nil diff --git a/resource-manager/network/2023-09-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2023-09-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go index 091426a3451..25f6fba8d55 100644 --- a/resource-manager/network/2023-09-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go +++ b/resource-manager/network/2023-09-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go @@ -4,5 +4,5 @@ package virtualnetworkgateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-09-01/virtualnetworktap/README.md b/resource-manager/network/2023-09-01/virtualnetworktap/README.md index 0bd2bfe001a..e8825540394 100644 --- a/resource-manager/network/2023-09-01/virtualnetworktap/README.md +++ b/resource-manager/network/2023-09-01/virtualnetworktap/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") payload := virtualnetworktap.VirtualNetworkTap{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") payload := virtualnetworktap.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/virtualnetworktap/id_virtualnetworktap.go b/resource-manager/network/2023-09-01/virtualnetworktap/id_virtualnetworktap.go index 87f32e385ac..48bd4716023 100644 --- a/resource-manager/network/2023-09-01/virtualnetworktap/id_virtualnetworktap.go +++ b/resource-manager/network/2023-09-01/virtualnetworktap/id_virtualnetworktap.go @@ -115,7 +115,7 @@ func (id VirtualNetworkTapId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVirtualNetworkTaps", "virtualNetworkTaps", "virtualNetworkTaps"), - resourceids.UserSpecifiedSegment("virtualNetworkTapName", "tapName"), + resourceids.UserSpecifiedSegment("virtualNetworkTapName", "virtualNetworkTapName"), } } diff --git a/resource-manager/network/2023-09-01/virtualnetworktap/id_virtualnetworktap_test.go b/resource-manager/network/2023-09-01/virtualnetworktap/id_virtualnetworktap_test.go index 638e22fc419..614dfaaf5fd 100644 --- a/resource-manager/network/2023-09-01/virtualnetworktap/id_virtualnetworktap_test.go +++ b/resource-manager/network/2023-09-01/virtualnetworktap/id_virtualnetworktap_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkTapId{} func TestNewVirtualNetworkTapID(t *testing.T) { - id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") + id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualNetworkTapID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualNetworkTapName != "tapName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "tapName") + if id.VirtualNetworkTapName != "virtualNetworkTapName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "virtualNetworkTapName") } } func TestFormatVirtualNetworkTapID(t *testing.T) { - actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName" + actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualNetworkTapID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "tapName", + VirtualNetworkTapName: "virtualNetworkTapName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualNetworkTapIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "tapName", + VirtualNetworkTapName: "virtualNetworkTapName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/tApNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApNaMe", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkTapName: "tApNaMe", + VirtualNetworkTapName: "vIrTuAlNeTwOrKtApNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/tApNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualwans/README.md b/resource-manager/network/2023-09-01/virtualwans/README.md index f3ae8b4c71e..b24173418ab 100644 --- a/resource-manager/network/2023-09-01/virtualwans/README.md +++ b/resource-manager/network/2023-09-01/virtualwans/README.md @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.VirtualWanVpnProfileParameters{ // ... @@ -104,7 +104,7 @@ if err := client.GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx, ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") payload := virtualwans.HubRouteTable{ // ... @@ -121,7 +121,7 @@ if err := client.HubRouteTablesCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -133,7 +133,7 @@ if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") read, err := client.HubRouteTablesGet(ctx, id) if err != nil { @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") payload := virtualwans.HubVirtualNetworkConnection{ // ... @@ -183,7 +183,7 @@ if err := client.HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -195,7 +195,7 @@ if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") read, err := client.HubVirtualNetworkConnectionsGet(ctx, id) if err != nil { @@ -228,7 +228,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") payload := virtualwans.VpnGatewayNatRule{ // ... @@ -245,7 +245,7 @@ if err := client.NatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -257,7 +257,7 @@ if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") read, err := client.NatRulesGet(ctx, id) if err != nil { @@ -273,7 +273,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") // alternatively `client.NatRulesListByVpnGateway(ctx, id)` can be used to do batched pagination items, err := client.NatRulesListByVpnGatewayComplete(ctx, id) @@ -290,7 +290,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") payload := virtualwans.NetworkVirtualApplianceConnection{ // ... @@ -307,7 +307,7 @@ if err := client.NetworkVirtualApplianceConnectionsCreateOrUpdateThenPoll(ctx, i ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -319,7 +319,7 @@ if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") read, err := client.NetworkVirtualApplianceConnectionsGet(ctx, id) if err != nil { @@ -352,7 +352,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := virtualwans.P2SVpnGateway{ // ... @@ -369,7 +369,7 @@ if err := client.P2sVpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -381,7 +381,7 @@ if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") read, err := client.P2sVpnGatewaysGet(ctx, id) if err != nil { @@ -555,7 +555,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") read, err := client.SupportedSecurityProviders(ctx, id) if err != nil { @@ -571,7 +571,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.TagsObject{ // ... @@ -592,7 +592,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") payload := virtualwans.BgpConnection{ // ... @@ -609,7 +609,7 @@ if err := client.VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -621,7 +621,7 @@ if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") read, err := client.VirtualHubBgpConnectionGet(ctx, id) if err != nil { @@ -654,7 +654,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); err != nil { // handle the error @@ -666,7 +666,7 @@ if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err != nil { // handle the error @@ -678,7 +678,7 @@ if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") payload := virtualwans.HubIPConfiguration{ // ... @@ -695,7 +695,7 @@ if err := client.VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -707,7 +707,7 @@ if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") read, err := client.VirtualHubIPConfigurationGet(ctx, id) if err != nil { @@ -953,7 +953,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.VirtualWAN{ // ... @@ -970,7 +970,7 @@ if err := client.VirtualWansCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -982,7 +982,7 @@ if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") read, err := client.VirtualWansGet(ctx, id) if err != nil { @@ -1032,7 +1032,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnection{ // ... @@ -1049,7 +1049,7 @@ if err := client.VpnConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1061,7 +1061,7 @@ if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") read, err := client.VpnConnectionsGet(ctx, id) if err != nil { @@ -1077,7 +1077,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") // alternatively `client.VpnConnectionsListByVpnGateway(ctx, id)` can be used to do batched pagination items, err := client.VpnConnectionsListByVpnGatewayComplete(ctx, id) @@ -1094,7 +1094,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnectionPacketCaptureStartParameters{ // ... @@ -1111,7 +1111,7 @@ if err := client.VpnConnectionsStartPacketCaptureThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnectionPacketCaptureStopParameters{ // ... @@ -1128,7 +1128,7 @@ if err := client.VpnConnectionsStopPacketCaptureThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := virtualwans.VpnGateway{ // ... @@ -1145,7 +1145,7 @@ if err := client.VpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1157,7 +1157,7 @@ if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") read, err := client.VpnGatewaysGet(ctx, id) if err != nil { @@ -1207,7 +1207,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { // handle the error @@ -1219,7 +1219,7 @@ if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") // alternatively `client.VpnLinkConnectionsListByVpnConnection(ctx, id)` can be used to do batched pagination items, err := client.VpnLinkConnectionsListByVpnConnectionComplete(ctx, id) @@ -1236,7 +1236,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if err := client.VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx, id); err != nil { // handle the error @@ -1327,7 +1327,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") read, err := client.VpnSiteLinkConnectionsGet(ctx, id) if err != nil { @@ -1376,7 +1376,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.GetVpnSitesConfigurationRequest{ // ... diff --git a/resource-manager/network/2023-09-01/virtualwans/id_hubroutetable.go b/resource-manager/network/2023-09-01/virtualwans/id_hubroutetable.go index 5c93c30fb69..12d932e8523 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_hubroutetable.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_hubroutetable.go @@ -123,7 +123,7 @@ func (id HubRouteTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubName"), resourceids.StaticSegment("staticHubRouteTables", "hubRouteTables", "hubRouteTables"), - resourceids.UserSpecifiedSegment("hubRouteTableName", "routeTableName"), + resourceids.UserSpecifiedSegment("hubRouteTableName", "hubRouteTableName"), } } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_hubroutetable_test.go b/resource-manager/network/2023-09-01/virtualwans/id_hubroutetable_test.go index 7432f35dfa8..68d653182ed 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_hubroutetable_test.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_hubroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubRouteTableId{} func TestNewHubRouteTableID(t *testing.T) { - id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") + id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHubRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubName") } - if id.HubRouteTableName != "routeTableName" { - t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "routeTableName") + if id.HubRouteTableName != "hubRouteTableName" { + t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "hubRouteTableName") } } func TestFormatHubRouteTableID(t *testing.T) { - actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName" + actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHubRouteTableID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubRouteTableName: "routeTableName", + HubRouteTableName: "hubRouteTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHubRouteTableIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubRouteTableName: "routeTableName", + HubRouteTableName: "hubRouteTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/rOuTeTaBlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/hUbRoUtEtAbLeNaMe", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualHubName: "vIrTuAlHuBnAmE", - HubRouteTableName: "rOuTeTaBlEnAmE", + HubRouteTableName: "hUbRoUtEtAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/rOuTeTaBlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/hUbRoUtEtAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_hubvirtualnetworkconnection.go b/resource-manager/network/2023-09-01/virtualwans/id_hubvirtualnetworkconnection.go index 3db347a9c76..17eee4937eb 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_hubvirtualnetworkconnection.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_hubvirtualnetworkconnection.go @@ -123,7 +123,7 @@ func (id HubVirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubName"), resourceids.StaticSegment("staticHubVirtualNetworkConnections", "hubVirtualNetworkConnections", "hubVirtualNetworkConnections"), - resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "hubVirtualNetworkConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_hubvirtualnetworkconnection_test.go b/resource-manager/network/2023-09-01/virtualwans/id_hubvirtualnetworkconnection_test.go index 1dc09c40461..fcfebd848f0 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_hubvirtualnetworkconnection_test.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_hubvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubVirtualNetworkConnectionId{} func TestNewHubVirtualNetworkConnectionID(t *testing.T) { - id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") + id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHubVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubName") } - if id.HubVirtualNetworkConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "connectionName") + if id.HubVirtualNetworkConnectionName != "hubVirtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "hubVirtualNetworkConnectionName") } } func TestFormatHubVirtualNetworkConnectionID(t *testing.T) { - actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName" + actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHubVirtualNetworkConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubVirtualNetworkConnectionName: "connectionName", + HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHubVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubVirtualNetworkConnectionName: "connectionName", + HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualHubName: "vIrTuAlHuBnAmE", - HubVirtualNetworkConnectionName: "cOnNeCtIoNnAmE", + HubVirtualNetworkConnectionName: "hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_natrule.go b/resource-manager/network/2023-09-01/virtualwans/id_natrule.go index 5441dc04ec9..ab096bb8e61 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_natrule.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_natrule.go @@ -121,7 +121,7 @@ func (id NatRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticNatRules", "natRules", "natRules"), resourceids.UserSpecifiedSegment("natRuleName", "natRuleName"), } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_natrule_test.go b/resource-manager/network/2023-09-01/virtualwans/id_natrule_test.go index 9cc9a07875a..0b0048431d8 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_natrule_test.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_natrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NatRuleId{} func TestNewNatRuleID(t *testing.T) { - id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") + id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNatRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } if id.NatRuleName != "natRuleName" { @@ -32,8 +32,8 @@ func TestNewNatRuleID(t *testing.T) { } func TestFormatNatRuleID(t *testing.T) { - actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName" + actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNatRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", NatRuleName: "natRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNatRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", NatRuleName: "natRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS/nAtRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS/nAtRuLeNaMe", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", NatRuleName: "nAtRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS/nAtRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS/nAtRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_networkvirtualapplianceconnection.go b/resource-manager/network/2023-09-01/virtualwans/id_networkvirtualapplianceconnection.go index eea1f6b9dd2..fbbc66efaec 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_networkvirtualapplianceconnection.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_networkvirtualapplianceconnection.go @@ -123,7 +123,7 @@ func (id NetworkVirtualApplianceConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticNetworkVirtualApplianceConnections", "networkVirtualApplianceConnections", "networkVirtualApplianceConnections"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "networkVirtualApplianceConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_networkvirtualapplianceconnection_test.go b/resource-manager/network/2023-09-01/virtualwans/id_networkvirtualapplianceconnection_test.go index b9686058751..e467eaa75a2 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_networkvirtualapplianceconnection_test.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_networkvirtualapplianceconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkVirtualApplianceConnectionId{} func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { - id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") + id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.NetworkVirtualApplianceConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "connectionName") + if id.NetworkVirtualApplianceConnectionName != "networkVirtualApplianceConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "networkVirtualApplianceConnectionName") } } func TestFormatNetworkVirtualApplianceConnectionID(t *testing.T) { - actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName" + actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNetworkVirtualApplianceConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - NetworkVirtualApplianceConnectionName: "connectionName", + NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNetworkVirtualApplianceConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - NetworkVirtualApplianceConnectionName: "connectionName", + NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - NetworkVirtualApplianceConnectionName: "cOnNeCtIoNnAmE", + NetworkVirtualApplianceConnectionName: "nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_virtualwan.go b/resource-manager/network/2023-09-01/virtualwans/id_virtualwan.go index 7ba33187730..fa94d154c26 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_virtualwan.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_virtualwan.go @@ -115,7 +115,7 @@ func (id VirtualWANId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVirtualWans", "virtualWans", "virtualWans"), - resourceids.UserSpecifiedSegment("virtualWanName", "virtualWANName"), + resourceids.UserSpecifiedSegment("virtualWanName", "virtualWanName"), } } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_virtualwan_test.go b/resource-manager/network/2023-09-01/virtualwans/id_virtualwan_test.go index 0fb34067d23..b07670d82b4 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_virtualwan_test.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_virtualwan_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualWANId{} func TestNewVirtualWANID(t *testing.T) { - id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") + id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualWANID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualWanName != "virtualWANName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWANName") + if id.VirtualWanName != "virtualWanName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWanName") } } func TestFormatVirtualWANID(t *testing.T) { - actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName" + actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualWANID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName", Expected: &VirtualWANId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWANName", + VirtualWanName: "virtualWanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVirtualWANIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName", Expected: &VirtualWANId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWANName", + VirtualWanName: "virtualWanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName/extra", Error: true, }, { diff --git a/resource-manager/network/2023-09-01/virtualwans/id_vpngateway.go b/resource-manager/network/2023-09-01/virtualwans/id_vpngateway.go index 0ba0e40f11c..4aac85c0d13 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_vpngateway.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_vpngateway.go @@ -115,7 +115,7 @@ func (id VpnGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), } } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_vpngateway_test.go b/resource-manager/network/2023-09-01/virtualwans/id_vpngateway_test.go index b5d1b5de3a0..c7406d1fb5a 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_vpngateway_test.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_vpngateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnGatewayId{} func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") + id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVpnGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } } func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName" + actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVpnGatewayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVpnGatewayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_vpnlinkconnection.go b/resource-manager/network/2023-09-01/virtualwans/id_vpnlinkconnection.go index 6ee7f540d57..98326bfe842 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_vpnlinkconnection.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_vpnlinkconnection.go @@ -127,11 +127,11 @@ func (id VpnLinkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionName"), resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "linkConnectionName"), + resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/virtualwans/id_vpnlinkconnection_test.go b/resource-manager/network/2023-09-01/virtualwans/id_vpnlinkconnection_test.go index eb904ad1498..98ddb202383 100644 --- a/resource-manager/network/2023-09-01/virtualwans/id_vpnlinkconnection_test.go +++ b/resource-manager/network/2023-09-01/virtualwans/id_vpnlinkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnLinkConnectionId{} func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") + id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVpnLinkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } - if id.VpnConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "connectionName") + if id.VpnConnectionName != "vpnConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionName") } - if id.VpnLinkConnectionName != "linkConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "linkConnectionName") + if id.VpnLinkConnectionName != "vpnLinkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionName") } } func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName" + actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVpnLinkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", - VpnConnectionName: "cOnNeCtIoNnAmE", - VpnLinkConnectionName: "lInKcOnNeCtIoNnAmE", + VpnGatewayName: "vPnGaTeWaYnAmE", + VpnConnectionName: "vPnCoNnEcTiOnNaMe", + VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/virtualwans/model_getvpnsitesconfigurationrequest.go b/resource-manager/network/2023-09-01/virtualwans/model_getvpnsitesconfigurationrequest.go index 0dd233101ce..cd349d0cb2f 100644 --- a/resource-manager/network/2023-09-01/virtualwans/model_getvpnsitesconfigurationrequest.go +++ b/resource-manager/network/2023-09-01/virtualwans/model_getvpnsitesconfigurationrequest.go @@ -4,6 +4,6 @@ package virtualwans // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type GetVpnSitesConfigurationRequest struct { - OutputBlobSasUrl string `json:"outputBlobSasUrl"` + OutputBlobSasURL string `json:"outputBlobSasUrl"` VpnSites *[]string `json:"vpnSites,omitempty"` } diff --git a/resource-manager/network/2023-09-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go b/resource-manager/network/2023-09-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go index de501375c21..a2a50d9eb92 100644 --- a/resource-manager/network/2023-09-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go +++ b/resource-manager/network/2023-09-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go @@ -5,5 +5,5 @@ package virtualwans type VpnConnectionPacketCaptureStopParameters struct { LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-09-01/virtualwans/model_vpnprofileresponse.go b/resource-manager/network/2023-09-01/virtualwans/model_vpnprofileresponse.go index a96c942841c..ed24cd4584e 100644 --- a/resource-manager/network/2023-09-01/virtualwans/model_vpnprofileresponse.go +++ b/resource-manager/network/2023-09-01/virtualwans/model_vpnprofileresponse.go @@ -4,5 +4,5 @@ package virtualwans // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` } diff --git a/resource-manager/network/2023-09-01/vmsspublicipaddresses/README.md b/resource-manager/network/2023-09-01/vmsspublicipaddresses/README.md index dd0f0ba80e5..7574f6a1c8a 100644 --- a/resource-manager/network/2023-09-01/vmsspublicipaddresses/README.md +++ b/resource-manager/network/2023-09-01/vmsspublicipaddresses/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName", "publicIpAddressName") +id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName", "publicIPAddressName") read, err := client.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx, id, vmsspublicipaddresses.DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions()) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName") +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName") // alternatively `client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id)` can be used to do batched pagination items, err := client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx, id) diff --git a/resource-manager/network/2023-09-01/vpngateways/README.md b/resource-manager/network/2023-09-01/vpngateways/README.md index bafb8b3ae11..03ca196d91e 100644 --- a/resource-manager/network/2023-09-01/vpngateways/README.md +++ b/resource-manager/network/2023-09-01/vpngateways/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions()); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.VpnGatewayPacketCaptureStartParameters{ // ... @@ -53,7 +53,7 @@ if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.VpnGatewayPacketCaptureStopParameters{ // ... @@ -70,7 +70,7 @@ if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.TagsObject{ // ... diff --git a/resource-manager/network/2023-09-01/vpngateways/id_vpngateway.go b/resource-manager/network/2023-09-01/vpngateways/id_vpngateway.go index 52e05b7b7b8..220d3ffa7b3 100644 --- a/resource-manager/network/2023-09-01/vpngateways/id_vpngateway.go +++ b/resource-manager/network/2023-09-01/vpngateways/id_vpngateway.go @@ -115,7 +115,7 @@ func (id VpnGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), } } diff --git a/resource-manager/network/2023-09-01/vpngateways/id_vpngateway_test.go b/resource-manager/network/2023-09-01/vpngateways/id_vpngateway_test.go index f2707bf53e6..c9c4abcd122 100644 --- a/resource-manager/network/2023-09-01/vpngateways/id_vpngateway_test.go +++ b/resource-manager/network/2023-09-01/vpngateways/id_vpngateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnGatewayId{} func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") + id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVpnGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } } func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName" + actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVpnGatewayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVpnGatewayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go b/resource-manager/network/2023-09-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go index ca9fe7cf71d..95998f06000 100644 --- a/resource-manager/network/2023-09-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go +++ b/resource-manager/network/2023-09-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go @@ -4,5 +4,5 @@ package vpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnGatewayPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-09-01/vpnlinkconnections/id_vpnlinkconnection.go b/resource-manager/network/2023-09-01/vpnlinkconnections/id_vpnlinkconnection.go index 33a950d143f..986725e2fc1 100644 --- a/resource-manager/network/2023-09-01/vpnlinkconnections/id_vpnlinkconnection.go +++ b/resource-manager/network/2023-09-01/vpnlinkconnections/id_vpnlinkconnection.go @@ -127,11 +127,11 @@ func (id VpnLinkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionName"), resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "linkConnectionName"), + resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionName"), } } diff --git a/resource-manager/network/2023-09-01/vpnlinkconnections/id_vpnlinkconnection_test.go b/resource-manager/network/2023-09-01/vpnlinkconnections/id_vpnlinkconnection_test.go index c6f966d4d10..59a74f2f8ea 100644 --- a/resource-manager/network/2023-09-01/vpnlinkconnections/id_vpnlinkconnection_test.go +++ b/resource-manager/network/2023-09-01/vpnlinkconnections/id_vpnlinkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnLinkConnectionId{} func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") + id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVpnLinkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } - if id.VpnConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "connectionName") + if id.VpnConnectionName != "vpnConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionName") } - if id.VpnLinkConnectionName != "linkConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "linkConnectionName") + if id.VpnLinkConnectionName != "vpnLinkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionName") } } func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName" + actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVpnLinkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", - VpnConnectionName: "cOnNeCtIoNnAmE", - VpnLinkConnectionName: "lInKcOnNeCtIoNnAmE", + VpnGatewayName: "vPnGaTeWaYnAmE", + VpnConnectionName: "vPnCoNnEcTiOnNaMe", + VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/README.md b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/README.md index b9d49b8b139..437e8d59170 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/README.md +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/constants.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/constants.go index d3dec778589..0dc1c5358ca 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/constants.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/constants.go @@ -2804,9 +2804,9 @@ const ( WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" + WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" + WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" - WebApplicationFirewallTransformUrlDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformUrlEncode WebApplicationFirewallTransform = "UrlEncode" ) func PossibleValuesForWebApplicationFirewallTransform() []string { @@ -2815,9 +2815,9 @@ func PossibleValuesForWebApplicationFirewallTransform() []string { string(WebApplicationFirewallTransformLowercase), string(WebApplicationFirewallTransformRemoveNulls), string(WebApplicationFirewallTransformTrim), + string(WebApplicationFirewallTransformURLDecode), + string(WebApplicationFirewallTransformURLEncode), string(WebApplicationFirewallTransformUppercase), - string(WebApplicationFirewallTransformUrlDecode), - string(WebApplicationFirewallTransformUrlEncode), } } @@ -2840,9 +2840,9 @@ func parseWebApplicationFirewallTransform(input string) (*WebApplicationFirewall "lowercase": WebApplicationFirewallTransformLowercase, "removenulls": WebApplicationFirewallTransformRemoveNulls, "trim": WebApplicationFirewallTransformTrim, + "urldecode": WebApplicationFirewallTransformURLDecode, + "urlencode": WebApplicationFirewallTransformURLEncode, "uppercase": WebApplicationFirewallTransformUppercase, - "urldecode": WebApplicationFirewallTransformUrlDecode, - "urlencode": WebApplicationFirewallTransformUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go index 0a49b366bfc..3004461fd8a 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go @@ -115,7 +115,7 @@ func (id ApplicationGatewayWebApplicationFirewallPolicyId) Segments() []resource resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticApplicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "applicationGatewayWebApplicationFirewallPolicyName"), } } diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go index c2ea316bba5..205d73da565 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationGatewayWebApplicationFirewallPolicyId{} func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ApplicationGatewayWebApplicationFirewallPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "policyName") + if id.ApplicationGatewayWebApplicationFirewallPolicyName != "applicationGatewayWebApplicationFirewallPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "applicationGatewayWebApplicationFirewallPolicyName") } } func TestFormatApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName" + actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "policyName", + ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(t *t }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "policyName", + ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayWebApplicationFirewallPolicyName: "pOlIcYnAmE", + ApplicationGatewayWebApplicationFirewallPolicyName: "aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go index 82f3501791c..b1f6dd22b0d 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go @@ -4,6 +4,6 @@ package webapplicationfirewallpolicies // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` } diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go index f4f485b405b..6cdbb059a1b 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go @@ -38,6 +38,6 @@ type ApplicationGatewayPropertiesFormat struct { SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + UrlPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` } diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go index 7808c57c7f7..6103c017cb4 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go @@ -10,6 +10,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` } diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go index ed418b0d4a5..18cc34e55af 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go @@ -6,5 +6,5 @@ package webapplicationfirewallpolicies type ApplicationGatewayRewriteRuleActionSet struct { RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` + UrlConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` } diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go index 03021e43980..c6de0fdbc1b 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go @@ -3,7 +3,7 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlConfiguration struct { +type ApplicationGatewayURLConfiguration struct { ModifiedPath *string `json:"modifiedPath,omitempty"` ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` Reroute *bool `json:"reroute,omitempty"` diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go index 57b9cac7aa3..96a3dc6d985 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go @@ -3,10 +3,10 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMap struct { +type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` + Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go index e69ae8cbde4..e02847a3fd9 100644 --- a/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go +++ b/resource-manager/network/2023-09-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go @@ -3,7 +3,7 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMapPropertiesFormat struct { +type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` diff --git a/resource-manager/network/2023-09-01/webcategories/README.md b/resource-manager/network/2023-09-01/webcategories/README.md index 8c37d8cc290..c99d42ba567 100644 --- a/resource-manager/network/2023-09-01/webcategories/README.md +++ b/resource-manager/network/2023-09-01/webcategories/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name") +id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName") read, err := client.Get(ctx, id, webcategories.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/network/2023-09-01/webcategories/id_azurewebcategory.go b/resource-manager/network/2023-09-01/webcategories/id_azurewebcategory.go index 5971766dc63..9e7d76c94f2 100644 --- a/resource-manager/network/2023-09-01/webcategories/id_azurewebcategory.go +++ b/resource-manager/network/2023-09-01/webcategories/id_azurewebcategory.go @@ -107,7 +107,7 @@ func (id AzureWebCategoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticAzureWebCategories", "azureWebCategories", "azureWebCategories"), - resourceids.UserSpecifiedSegment("azureWebCategoryName", "name"), + resourceids.UserSpecifiedSegment("azureWebCategoryName", "azureWebCategoryName"), } } diff --git a/resource-manager/network/2023-09-01/webcategories/id_azurewebcategory_test.go b/resource-manager/network/2023-09-01/webcategories/id_azurewebcategory_test.go index a6e5d9ec9de..08826593ed1 100644 --- a/resource-manager/network/2023-09-01/webcategories/id_azurewebcategory_test.go +++ b/resource-manager/network/2023-09-01/webcategories/id_azurewebcategory_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &AzureWebCategoryId{} func TestNewAzureWebCategoryID(t *testing.T) { - id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name") + id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.AzureWebCategoryName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "name") + if id.AzureWebCategoryName != "azureWebCategoryName" { + t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "azureWebCategoryName") } } func TestFormatAzureWebCategoryID(t *testing.T) { - actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name" + actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseAzureWebCategoryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "name", + AzureWebCategoryName: "azureWebCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseAzureWebCategoryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "name", + AzureWebCategoryName: "azureWebCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYnAmE", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "nAmE", + AzureWebCategoryName: "aZuReWeBcAtEgOrYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/adminrulecollections/README.md b/resource-manager/network/2023-11-01/adminrulecollections/README.md index a54921a3feb..347f5625085 100644 --- a/resource-manager/network/2023-11-01/adminrulecollections/README.md +++ b/resource-manager/network/2023-11-01/adminrulecollections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") payload := adminrulecollections.AdminRuleCollection{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOpera ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") // alternatively `client.List(ctx, id, adminrulecollections.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, adminrulecollections.DefaultListOperationOptions()) diff --git a/resource-manager/network/2023-11-01/adminrulecollections/id_rulecollection.go b/resource-manager/network/2023-11-01/adminrulecollections/id_rulecollection.go index da27349f55a..a7cd76bd8fc 100644 --- a/resource-manager/network/2023-11-01/adminrulecollections/id_rulecollection.go +++ b/resource-manager/network/2023-11-01/adminrulecollections/id_rulecollection.go @@ -129,7 +129,7 @@ func (id RuleCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2023-11-01/adminrulecollections/id_rulecollection_test.go b/resource-manager/network/2023-11-01/adminrulecollections/id_rulecollection_test.go index 151c5f3abf0..0b385a407c1 100644 --- a/resource-manager/network/2023-11-01/adminrulecollections/id_rulecollection_test.go +++ b/resource-manager/network/2023-11-01/adminrulecollections/id_rulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionId{} func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewRuleCollectionID(t *testing.T) { } func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRuleCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/adminrulecollections/id_securityadminconfiguration.go b/resource-manager/network/2023-11-01/adminrulecollections/id_securityadminconfiguration.go index 314559846aa..193fa95d9b5 100644 --- a/resource-manager/network/2023-11-01/adminrulecollections/id_securityadminconfiguration.go +++ b/resource-manager/network/2023-11-01/adminrulecollections/id_securityadminconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityAdminConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), } } diff --git a/resource-manager/network/2023-11-01/adminrulecollections/id_securityadminconfiguration_test.go b/resource-manager/network/2023-11-01/adminrulecollections/id_securityadminconfiguration_test.go index 7e368c4f9ca..aa4f07d225f 100644 --- a/resource-manager/network/2023-11-01/adminrulecollections/id_securityadminconfiguration_test.go +++ b/resource-manager/network/2023-11-01/adminrulecollections/id_securityadminconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityAdminConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } } func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName" + actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityAdminConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/adminrules/README.md b/resource-manager/network/2023-11-01/adminrules/README.md index fe07dab3ad7..74a2336bded 100644 --- a/resource-manager/network/2023-11-01/adminrules/README.md +++ b/resource-manager/network/2023-11-01/adminrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") payload := adminrules.BaseAdminRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOption ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/adminrules/id_rule.go b/resource-manager/network/2023-11-01/adminrules/id_rule.go index 028cb6ac27d..80c294a2cdd 100644 --- a/resource-manager/network/2023-11-01/adminrules/id_rule.go +++ b/resource-manager/network/2023-11-01/adminrules/id_rule.go @@ -135,7 +135,7 @@ func (id RuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), resourceids.StaticSegment("staticRules", "rules", "rules"), diff --git a/resource-manager/network/2023-11-01/adminrules/id_rule_test.go b/resource-manager/network/2023-11-01/adminrules/id_rule_test.go index c4b791947dc..a9939471a62 100644 --- a/resource-manager/network/2023-11-01/adminrules/id_rule_test.go +++ b/resource-manager/network/2023-11-01/adminrules/id_rule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleId{} func TestNewRuleID(t *testing.T) { - id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") + id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -40,8 +40,8 @@ func TestNewRuleID(t *testing.T) { } func TestFormatRuleID(t *testing.T) { - actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName" + actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", RuleName: "rUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/adminrules/id_rulecollection.go b/resource-manager/network/2023-11-01/adminrules/id_rulecollection.go index b621d89f9ed..4f7c635ec89 100644 --- a/resource-manager/network/2023-11-01/adminrules/id_rulecollection.go +++ b/resource-manager/network/2023-11-01/adminrules/id_rulecollection.go @@ -129,7 +129,7 @@ func (id RuleCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2023-11-01/adminrules/id_rulecollection_test.go b/resource-manager/network/2023-11-01/adminrules/id_rulecollection_test.go index 7fcf8dc4da2..b470a67ca68 100644 --- a/resource-manager/network/2023-11-01/adminrules/id_rulecollection_test.go +++ b/resource-manager/network/2023-11-01/adminrules/id_rulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionId{} func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewRuleCollectionID(t *testing.T) { } func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRuleCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/README.md b/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/README.md index a3385ee718e..6446e85ef61 100644 --- a/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/README.md +++ b/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") payload := applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnection{ // ... diff --git a/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go index 56c45d49082..5fdf773f215 100644 --- a/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go +++ b/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go @@ -123,7 +123,7 @@ func (id ApplicationGatewayPrivateEndpointConnectionId) Segments() []resourceids resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go b/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go index d78d158b401..41f023a4a31 100644 --- a/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go +++ b/resource-manager/network/2023-11-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationGatewayPrivateEndpointConnectionId{} func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") + id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayName") } - if id.PrivateEndpointConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "connectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName" + actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ApplicationGatewayName: "applicationGatewayName", - PrivateEndpointConnectionName: "connectionName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(t *test }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ApplicationGatewayName: "applicationGatewayName", - PrivateEndpointConnectionName: "connectionName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYnAmE", - PrivateEndpointConnectionName: "cOnNeCtIoNnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewaycustomerror.go b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewaycustomerror.go index 532de5a8e93..8b0e5fb8d20 100644 --- a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewaycustomerror.go +++ b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewaycustomerror.go @@ -4,6 +4,6 @@ package applicationgateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` } diff --git a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewaypropertiesformat.go index 1332febd49d..4e54c939bcb 100644 --- a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewaypropertiesformat.go +++ b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewaypropertiesformat.go @@ -38,6 +38,6 @@ type ApplicationGatewayPropertiesFormat struct { SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + UrlPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` } diff --git a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go index 07b97214f7f..b629d49b411 100644 --- a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go @@ -10,6 +10,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` } diff --git a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go index 02be2e1f37b..c46a7bd6d6c 100644 --- a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go +++ b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go @@ -6,5 +6,5 @@ package applicationgateways type ApplicationGatewayRewriteRuleActionSet struct { RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` + UrlConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` } diff --git a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlconfiguration.go index 18491c35f12..9c77d1808a2 100644 --- a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlconfiguration.go +++ b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlconfiguration.go @@ -3,7 +3,7 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlConfiguration struct { +type ApplicationGatewayURLConfiguration struct { ModifiedPath *string `json:"modifiedPath,omitempty"` ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` Reroute *bool `json:"reroute,omitempty"` diff --git a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlpathmap.go b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlpathmap.go index 5fc06877578..9ca546cb957 100644 --- a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlpathmap.go +++ b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlpathmap.go @@ -3,10 +3,10 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMap struct { +type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` + Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go index ef8e7e8e02f..9c00ae43cdf 100644 --- a/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go +++ b/resource-manager/network/2023-11-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go @@ -3,7 +3,7 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMapPropertiesFormat struct { +type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` diff --git a/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/README.md b/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/README.md index d00c76532c4..6fdb959e2d8 100644 --- a/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/README.md +++ b/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.DefaultGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.Get(ctx, id)` can be used to do batched pagination items, err := client.GetComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/id_location.go b/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/id_location.go index 38c2aa68f21..3d179e08bf0 100644 --- a/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/id_location.go +++ b/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/id_location_test.go b/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/id_location_test.go index abfa53672eb..3989d8a5132 100644 --- a/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/id_location_test.go +++ b/resource-manager/network/2023-11-01/applicationgatewaywafdynamicmanifests/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/availabledelegations/README.md b/resource-manager/network/2023-11-01/availabledelegations/README.md index 465d0ed0ba5..f5e22d4c56e 100644 --- a/resource-manager/network/2023-11-01/availabledelegations/README.md +++ b/resource-manager/network/2023-11-01/availabledelegations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailableDelegationsList(ctx, id)` can be used to do batched pagination items, err := client.AvailableDelegationsListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.AvailableResourceGroupDelegationsList(ctx, id)` can be used to do batched pagination items, err := client.AvailableResourceGroupDelegationsListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/availabledelegations/id_location.go b/resource-manager/network/2023-11-01/availabledelegations/id_location.go index e4d894a6089..e6387e4fdeb 100644 --- a/resource-manager/network/2023-11-01/availabledelegations/id_location.go +++ b/resource-manager/network/2023-11-01/availabledelegations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/availabledelegations/id_location_test.go b/resource-manager/network/2023-11-01/availabledelegations/id_location_test.go index 8bb71a50adb..8d0352c08ff 100644 --- a/resource-manager/network/2023-11-01/availabledelegations/id_location_test.go +++ b/resource-manager/network/2023-11-01/availabledelegations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/availabledelegations/id_providerlocation.go b/resource-manager/network/2023-11-01/availabledelegations/id_providerlocation.go index 26af2ff9777..1e3b30f4431 100644 --- a/resource-manager/network/2023-11-01/availabledelegations/id_providerlocation.go +++ b/resource-manager/network/2023-11-01/availabledelegations/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/availabledelegations/id_providerlocation_test.go b/resource-manager/network/2023-11-01/availabledelegations/id_providerlocation_test.go index d3dea3d3895..e24c8def247 100644 --- a/resource-manager/network/2023-11-01/availabledelegations/id_providerlocation_test.go +++ b/resource-manager/network/2023-11-01/availabledelegations/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/availableservicealiases/README.md b/resource-manager/network/2023-11-01/availableservicealiases/README.md index 357d038a238..6608e57b9fa 100644 --- a/resource-manager/network/2023-11-01/availableservicealiases/README.md +++ b/resource-manager/network/2023-11-01/availableservicealiases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListByResourceGroupComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/availableservicealiases/id_location.go b/resource-manager/network/2023-11-01/availableservicealiases/id_location.go index 65846cc20dd..b531d5a4bb7 100644 --- a/resource-manager/network/2023-11-01/availableservicealiases/id_location.go +++ b/resource-manager/network/2023-11-01/availableservicealiases/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/availableservicealiases/id_location_test.go b/resource-manager/network/2023-11-01/availableservicealiases/id_location_test.go index 8fdfbdee89e..995b5cfad7f 100644 --- a/resource-manager/network/2023-11-01/availableservicealiases/id_location_test.go +++ b/resource-manager/network/2023-11-01/availableservicealiases/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/availableservicealiases/id_providerlocation.go b/resource-manager/network/2023-11-01/availableservicealiases/id_providerlocation.go index 653b48ba912..6c961f76bc1 100644 --- a/resource-manager/network/2023-11-01/availableservicealiases/id_providerlocation.go +++ b/resource-manager/network/2023-11-01/availableservicealiases/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/availableservicealiases/id_providerlocation_test.go b/resource-manager/network/2023-11-01/availableservicealiases/id_providerlocation_test.go index 8b2be520bef..d6526faaf37 100644 --- a/resource-manager/network/2023-11-01/availableservicealiases/id_providerlocation_test.go +++ b/resource-manager/network/2023-11-01/availableservicealiases/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go b/resource-manager/network/2023-11-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go index c0c639f2390..a664e348c2a 100644 --- a/resource-manager/network/2023-11-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go +++ b/resource-manager/network/2023-11-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go @@ -10,5 +10,5 @@ type FirewallPacketCaptureParametersFormat struct { Flags *[]AzureFirewallPacketCaptureFlags `json:"flags,omitempty"` NumberOfPacketsToCapture *int64 `json:"numberOfPacketsToCapture,omitempty"` Protocol *AzureFirewallNetworkRuleProtocol `json:"protocol,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-11-01/checkdnsavailabilities/README.md b/resource-manager/network/2023-11-01/checkdnsavailabilities/README.md index cc32cdfa1c5..2cdf19f22f6 100644 --- a/resource-manager/network/2023-11-01/checkdnsavailabilities/README.md +++ b/resource-manager/network/2023-11-01/checkdnsavailabilities/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.CheckDnsNameAvailability(ctx, id, checkdnsavailabilities.DefaultCheckDnsNameAvailabilityOperationOptions()) if err != nil { diff --git a/resource-manager/network/2023-11-01/checkdnsavailabilities/id_location.go b/resource-manager/network/2023-11-01/checkdnsavailabilities/id_location.go index 054cfdb305a..e9c60b3adaf 100644 --- a/resource-manager/network/2023-11-01/checkdnsavailabilities/id_location.go +++ b/resource-manager/network/2023-11-01/checkdnsavailabilities/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/checkdnsavailabilities/id_location_test.go b/resource-manager/network/2023-11-01/checkdnsavailabilities/id_location_test.go index 8b2e43d72d1..7d13e412f40 100644 --- a/resource-manager/network/2023-11-01/checkdnsavailabilities/id_location_test.go +++ b/resource-manager/network/2023-11-01/checkdnsavailabilities/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/connectivityconfigurations/README.md b/resource-manager/network/2023-11-01/connectivityconfigurations/README.md index 63fa66a4d9b..8b74b6304d0 100644 --- a/resource-manager/network/2023-11-01/connectivityconfigurations/README.md +++ b/resource-manager/network/2023-11-01/connectivityconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") payload := connectivityconfigurations.ConnectivityConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDelet ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/connectivityconfigurations/id_connectivityconfiguration.go b/resource-manager/network/2023-11-01/connectivityconfigurations/id_connectivityconfiguration.go index 49a4ba3aaf0..d062db15f4f 100644 --- a/resource-manager/network/2023-11-01/connectivityconfigurations/id_connectivityconfiguration.go +++ b/resource-manager/network/2023-11-01/connectivityconfigurations/id_connectivityconfiguration.go @@ -123,7 +123,7 @@ func (id ConnectivityConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticConnectivityConfigurations", "connectivityConfigurations", "connectivityConfigurations"), - resourceids.UserSpecifiedSegment("connectivityConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("connectivityConfigurationName", "connectivityConfigurationName"), } } diff --git a/resource-manager/network/2023-11-01/connectivityconfigurations/id_connectivityconfiguration_test.go b/resource-manager/network/2023-11-01/connectivityconfigurations/id_connectivityconfiguration_test.go index 524d8385688..62733e7673b 100644 --- a/resource-manager/network/2023-11-01/connectivityconfigurations/id_connectivityconfiguration_test.go +++ b/resource-manager/network/2023-11-01/connectivityconfigurations/id_connectivityconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectivityConfigurationId{} func TestNewConnectivityConfigurationID(t *testing.T) { - id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewConnectivityConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.ConnectivityConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "configurationName") + if id.ConnectivityConfigurationName != "connectivityConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "connectivityConfigurationName") } } func TestFormatConnectivityConfigurationID(t *testing.T) { - actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName" + actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseConnectivityConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - ConnectivityConfigurationName: "configurationName", + ConnectivityConfigurationName: "connectivityConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseConnectivityConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - ConnectivityConfigurationName: "configurationName", + ConnectivityConfigurationName: "connectivityConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnNaMe", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - ConnectivityConfigurationName: "cOnFiGuRaTiOnNaMe", + ConnectivityConfigurationName: "cOnNeCtIvItYcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/customipprefixes/README.md b/resource-manager/network/2023-11-01/customipprefixes/README.md index 3997e559c6f..2be5a240d71 100644 --- a/resource-manager/network/2023-11-01/customipprefixes/README.md +++ b/resource-manager/network/2023-11-01/customipprefixes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") payload := customipprefixes.CustomIPPrefix{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") read, err := client.Get(ctx, id, customipprefixes.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") payload := customipprefixes.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/customipprefixes/id_customipprefix.go b/resource-manager/network/2023-11-01/customipprefixes/id_customipprefix.go index a41316cfa68..bca85243003 100644 --- a/resource-manager/network/2023-11-01/customipprefixes/id_customipprefix.go +++ b/resource-manager/network/2023-11-01/customipprefixes/id_customipprefix.go @@ -115,7 +115,7 @@ func (id CustomIPPrefixId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticCustomIPPrefixes", "customIPPrefixes", "customIPPrefixes"), - resourceids.UserSpecifiedSegment("customIPPrefixName", "customIpPrefixName"), + resourceids.UserSpecifiedSegment("customIPPrefixName", "customIPPrefixName"), } } diff --git a/resource-manager/network/2023-11-01/customipprefixes/id_customipprefix_test.go b/resource-manager/network/2023-11-01/customipprefixes/id_customipprefix_test.go index 2503a2c56e8..dfd6b48155e 100644 --- a/resource-manager/network/2023-11-01/customipprefixes/id_customipprefix_test.go +++ b/resource-manager/network/2023-11-01/customipprefixes/id_customipprefix_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomIPPrefixId{} func TestNewCustomIPPrefixID(t *testing.T) { - id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") + id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCustomIPPrefixID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CustomIPPrefixName != "customIpPrefixName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIpPrefixName") + if id.CustomIPPrefixName != "customIPPrefixName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIPPrefixName") } } func TestFormatCustomIPPrefixID(t *testing.T) { - actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName" + actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCustomIPPrefixID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName", Expected: &CustomIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIpPrefixName", + CustomIPPrefixName: "customIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCustomIPPrefixIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName", Expected: &CustomIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIpPrefixName", + CustomIPPrefixName: "customIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName/extra", Error: true, }, { diff --git a/resource-manager/network/2023-11-01/endpointservices/README.md b/resource-manager/network/2023-11-01/endpointservices/README.md index 63abca9937a..f2d59a07105 100644 --- a/resource-manager/network/2023-11-01/endpointservices/README.md +++ b/resource-manager/network/2023-11-01/endpointservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailableEndpointServicesList(ctx, id)` can be used to do batched pagination items, err := client.AvailableEndpointServicesListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/endpointservices/id_location.go b/resource-manager/network/2023-11-01/endpointservices/id_location.go index f2b06140acf..18eaa8353af 100644 --- a/resource-manager/network/2023-11-01/endpointservices/id_location.go +++ b/resource-manager/network/2023-11-01/endpointservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/endpointservices/id_location_test.go b/resource-manager/network/2023-11-01/endpointservices/id_location_test.go index e31df0936ae..0213283041f 100644 --- a/resource-manager/network/2023-11-01/endpointservices/id_location_test.go +++ b/resource-manager/network/2023-11-01/endpointservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitarptable/README.md b/resource-manager/network/2023-11-01/expressroutecircuitarptable/README.md index b62ebd11e6c..472ca59abc5 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitarptable/README.md +++ b/resource-manager/network/2023-11-01/expressroutecircuitarptable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName") // alternatively `client.ExpressRouteCircuitsListArpTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListArpTableComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecircuitarptable/id_arptable.go b/resource-manager/network/2023-11-01/expressroutecircuitarptable/id_arptable.go index 0f33d89bfd9..d35a8eadadf 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitarptable/id_arptable.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitarptable/id_arptable.go @@ -127,11 +127,11 @@ func (id ArpTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "devicePath"), + resourceids.UserSpecifiedSegment("arpTableName", "arpTableName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitarptable/id_arptable_test.go b/resource-manager/network/2023-11-01/expressroutecircuitarptable/id_arptable_test.go index 11dd82c0c88..66d3e99f02e 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitarptable/id_arptable_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitarptable/id_arptable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArpTableId{} func TestNewArpTableID(t *testing.T) { - id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewArpTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.ArpTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "devicePath") + if id.ArpTableName != "arpTableName" { + t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableName") } } func TestFormatArpTableID(t *testing.T) { - actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath" + actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseArpTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseArpTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - ArpTableName: "dEvIcEpAtH", + ArpTableName: "aRpTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/README.md b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/README.md index 6c83970d0a6..3ea0a3cc9a4 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/README.md +++ b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_authorization.go b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_authorization.go index b8b16a2153d..9da101d4a62 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_authorization.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_authorization.go @@ -121,7 +121,7 @@ func (id AuthorizationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), resourceids.UserSpecifiedSegment("authorizationName", "authorizationName"), } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_authorization_test.go b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_authorization_test.go index ed6668508eb..60d0dbacbe5 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_authorization_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_authorization_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthorizationId{} func TestNewAuthorizationID(t *testing.T) { - id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") + id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAuthorizationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.AuthorizationName != "authorizationName" { @@ -32,8 +32,8 @@ func TestNewAuthorizationID(t *testing.T) { } func TestFormatAuthorizationID(t *testing.T) { - actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName" + actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAuthorizationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", AuthorizationName: "authorizationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAuthorizationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", AuthorizationName: "authorizationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", AuthorizationName: "aUtHoRiZaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_expressroutecircuit.go b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_expressroutecircuit.go index 7626fffc08c..210f0ae6366 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_expressroutecircuit.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go index 20b47ec6190..3bd47c1b205 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitconnections/README.md b/resource-manager/network/2023-11-01/expressroutecircuitconnections/README.md index 1a126f3dba5..b99d394292e 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitconnections/README.md +++ b/resource-manager/network/2023-11-01/expressroutecircuitconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecircuitconnections/id_peeringconnection.go b/resource-manager/network/2023-11-01/expressroutecircuitconnections/id_peeringconnection.go index 7c1fb7730b7..07c1226d200 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitconnections/id_peeringconnection.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitconnections/id_peeringconnection.go @@ -127,7 +127,7 @@ func (id PeeringConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticConnections", "connections", "connections"), diff --git a/resource-manager/network/2023-11-01/expressroutecircuitconnections/id_peeringconnection_test.go b/resource-manager/network/2023-11-01/expressroutecircuitconnections/id_peeringconnection_test.go index 39d2aafacfa..f1e786ac3d2 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitconnections/id_peeringconnection_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitconnections/id_peeringconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringConnectionId{} func TestNewPeeringConnectionID(t *testing.T) { - id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") + id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPeeringConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { @@ -36,8 +36,8 @@ func TestNewPeeringConnectionID(t *testing.T) { } func TestFormatPeeringConnectionID(t *testing.T) { - actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName" + actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitpeerings/README.md b/resource-manager/network/2023-11-01/expressroutecircuitpeerings/README.md index eb6be299277..4e66d37cbea 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitpeerings/README.md +++ b/resource-manager/network/2023-11-01/expressroutecircuitpeerings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecircuitpeerings/id_expressroutecircuit.go b/resource-manager/network/2023-11-01/expressroutecircuitpeerings/id_expressroutecircuit.go index d901b679f33..02a14699ffa 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitpeerings/id_expressroutecircuit.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitpeerings/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go b/resource-manager/network/2023-11-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go index 1edc4454ed9..9d893b6392d 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitroutestable/README.md b/resource-manager/network/2023-11-01/expressroutecircuitroutestable/README.md index a421dfe8f20..c5c56807c03 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitroutestable/README.md +++ b/resource-manager/network/2023-11-01/expressroutecircuitroutestable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName") // alternatively `client.ExpressRouteCircuitsListRoutesTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListRoutesTableComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecircuitroutestable/id_peeringroutetable.go b/resource-manager/network/2023-11-01/expressroutecircuitroutestable/id_peeringroutetable.go index d929441f379..8971fb87e03 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitroutestable/id_peeringroutetable.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitroutestable/id_peeringroutetable.go @@ -127,11 +127,11 @@ func (id PeeringRouteTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTableName", "routeTableName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitroutestable/id_peeringroutetable_test.go b/resource-manager/network/2023-11-01/expressroutecircuitroutestable/id_peeringroutetable_test.go index 154e92f43fb..620bbfff69e 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitroutestable/id_peeringroutetable_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitroutestable/id_peeringroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringRouteTableId{} func TestNewPeeringRouteTableID(t *testing.T) { - id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "devicePath") + if id.RouteTableName != "routeTableName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableName") } } func TestFormatPeeringRouteTableID(t *testing.T) { - actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath" + actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringRouteTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringRouteTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - RouteTableName: "dEvIcEpAtH", + RouteTableName: "rOuTeTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/README.md b/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/README.md index d9c47555f45..0f9b0429cea 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/README.md +++ b/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName") // alternatively `client.ExpressRouteCircuitsListRoutesTableSummary(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListRoutesTableSummaryComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/id_routetablessummary.go b/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/id_routetablessummary.go index 93753595743..90ea354df62 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/id_routetablessummary.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/id_routetablessummary.go @@ -127,11 +127,11 @@ func (id RouteTablesSummaryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go b/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go index b1c58fed640..2c78aaf0378 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteTablesSummaryId{} func TestNewRouteTablesSummaryID(t *testing.T) { - id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewRouteTablesSummaryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTablesSummaryName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "devicePath") + if id.RouteTablesSummaryName != "routeTablesSummaryName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryName") } } func TestFormatRouteTablesSummaryID(t *testing.T) { - actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath" + actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRouteTablesSummaryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRouteTablesSummaryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - RouteTablesSummaryName: "dEvIcEpAtH", + RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuits/README.md b/resource-manager/network/2023-11-01/expressroutecircuits/README.md index 076a3e224fb..754b3aecd19 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuits/README.md +++ b/resource-manager/network/2023-11-01/expressroutecircuits/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") payload := expressroutecircuits.ExpressRouteCircuit{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") payload := expressroutecircuits.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/expressroutecircuits/id_expressroutecircuit.go b/resource-manager/network/2023-11-01/expressroutecircuits/id_expressroutecircuit.go index d3a73edd48a..7c3ebaafe98 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuits/id_expressroutecircuit.go +++ b/resource-manager/network/2023-11-01/expressroutecircuits/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecircuits/id_expressroutecircuit_test.go b/resource-manager/network/2023-11-01/expressroutecircuits/id_expressroutecircuit_test.go index 3c4a66b65e7..de1beeca125 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuits/id_expressroutecircuit_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuits/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitstats/README.md b/resource-manager/network/2023-11-01/expressroutecircuitstats/README.md index 5487180a279..ef073b6c2d3 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitstats/README.md +++ b/resource-manager/network/2023-11-01/expressroutecircuitstats/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") read, err := client.ExpressRouteCircuitsGetPeeringStats(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") read, err := client.ExpressRouteCircuitsGetStats(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/expressroutecircuitstats/id_expressroutecircuit.go b/resource-manager/network/2023-11-01/expressroutecircuitstats/id_expressroutecircuit.go index 38c9ef16c4a..0eba5b9c251 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitstats/id_expressroutecircuit.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitstats/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecircuitstats/id_expressroutecircuit_test.go b/resource-manager/network/2023-11-01/expressroutecircuitstats/id_expressroutecircuit_test.go index 883c9a15547..288e8caf55e 100644 --- a/resource-manager/network/2023-11-01/expressroutecircuitstats/id_expressroutecircuit_test.go +++ b/resource-manager/network/2023-11-01/expressroutecircuitstats/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressrouteconnections/README.md b/resource-manager/network/2023-11-01/expressrouteconnections/README.md index bcd03cf4776..b445eedd9dc 100644 --- a/resource-manager/network/2023-11-01/expressrouteconnections/README.md +++ b/resource-manager/network/2023-11-01/expressrouteconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") payload := expressrouteconnections.ExpressRouteConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/expressrouteconnections/id_expressrouteconnection.go b/resource-manager/network/2023-11-01/expressrouteconnections/id_expressrouteconnection.go index 971a1ebe796..2cf6021fe08 100644 --- a/resource-manager/network/2023-11-01/expressrouteconnections/id_expressrouteconnection.go +++ b/resource-manager/network/2023-11-01/expressrouteconnections/id_expressrouteconnection.go @@ -123,7 +123,7 @@ func (id ExpressRouteConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayName"), resourceids.StaticSegment("staticExpressRouteConnections", "expressRouteConnections", "expressRouteConnections"), - resourceids.UserSpecifiedSegment("expressRouteConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("expressRouteConnectionName", "expressRouteConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/expressrouteconnections/id_expressrouteconnection_test.go b/resource-manager/network/2023-11-01/expressrouteconnections/id_expressrouteconnection_test.go index 4416a9058fc..dd3b75e24af 100644 --- a/resource-manager/network/2023-11-01/expressrouteconnections/id_expressrouteconnection_test.go +++ b/resource-manager/network/2023-11-01/expressrouteconnections/id_expressrouteconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteConnectionId{} func TestNewExpressRouteConnectionID(t *testing.T) { - id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") + id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExpressRouteConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayName") } - if id.ExpressRouteConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "connectionName") + if id.ExpressRouteConnectionName != "expressRouteConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "expressRouteConnectionName") } } func TestFormatExpressRouteConnectionID(t *testing.T) { - actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName" + actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExpressRouteConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ExpressRouteGatewayName: "expressRouteGatewayName", - ExpressRouteConnectionName: "connectionName", + ExpressRouteConnectionName: "expressRouteConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExpressRouteConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ExpressRouteGatewayName: "expressRouteGatewayName", - ExpressRouteConnectionName: "connectionName", + ExpressRouteConnectionName: "expressRouteConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNnAmE", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyNaMe", - ExpressRouteConnectionName: "cOnNeCtIoNnAmE", + ExpressRouteConnectionName: "eXpReSsRoUtEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/README.md b/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/README.md index 8dc68b4ebf8..5c5ac716f04 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/README.md +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName") // alternatively `client.ExpressRouteCrossConnectionsListArpTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListArpTableComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/id_peeringarptable.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/id_peeringarptable.go index 0589efdc27b..f37ffb9dda2 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/id_peeringarptable.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/id_peeringarptable.go @@ -127,11 +127,11 @@ func (id PeeringArpTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "devicePath"), + resourceids.UserSpecifiedSegment("arpTableName", "arpTableName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go index 7a56ebe2b11..1d31f05cc7a 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringArpTableId{} func TestNewPeeringArpTableID(t *testing.T) { - id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringArpTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.ArpTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "devicePath") + if id.ArpTableName != "arpTableName" { + t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableName") } } func TestFormatPeeringArpTableID(t *testing.T) { - actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath" + actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringArpTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringArpTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - ArpTableName: "dEvIcEpAtH", + ArpTableName: "aRpTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/README.md b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/README.md index d7c75b7ca44..1aa20c96e1f 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/README.md +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") payload := expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeering{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go index 0971af25620..890e4e7d24b 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go @@ -115,7 +115,7 @@ func (id ExpressRouteCrossConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go index 2019f0104a6..33465dd597a 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") + id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCrossConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } } func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName" + actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCrossConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_peering.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_peering.go index 83a9563a48d..c3ee06da4dc 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_peering.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_peering.go @@ -121,7 +121,7 @@ func (id PeeringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_peering_test.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_peering_test.go index 57de6e64b02..ac47382755d 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_peering_test.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionpeerings/id_peering_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringId{} func TestNewPeeringID(t *testing.T) { - id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") + id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPeeringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { @@ -32,8 +32,8 @@ func TestNewPeeringID(t *testing.T) { } func TestFormatPeeringID(t *testing.T) { - actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName" + actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePeeringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePeeringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/README.md b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/README.md index e6ceccee07a..ec4ead84ac6 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/README.md +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName") // alternatively `client.ExpressRouteCrossConnectionsListRoutesTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListRoutesTableComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go index b6d27ada378..29491001fbf 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go @@ -127,11 +127,11 @@ func (id ExpressRouteCrossConnectionPeeringRouteTableId) Segments() []resourceid resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTableName", "routeTableName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go index 35e27084ce7..2dd58fa2973 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionPeeringRouteTableId{} func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "devicePath") + if id.RouteTableName != "routeTableName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableName") } } func TestFormatExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath" + actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(t *tes }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - RouteTableName: "dEvIcEpAtH", + RouteTableName: "rOuTeTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/README.md b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/README.md index a6c40702c9f..50f45e5b332 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/README.md +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName") // alternatively `client.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListRoutesTableSummaryComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go index df854619ed9..1d3631cb982 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go @@ -127,11 +127,11 @@ func (id PeeringRouteTablesSummaryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go index 361ebbceb19..6d2bdf44468 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringRouteTablesSummaryId{} func TestNewPeeringRouteTablesSummaryID(t *testing.T) { - id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringRouteTablesSummaryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTablesSummaryName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "devicePath") + if id.RouteTablesSummaryName != "routeTablesSummaryName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryName") } } func TestFormatPeeringRouteTablesSummaryID(t *testing.T) { - actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath" + actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringRouteTablesSummaryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringRouteTablesSummaryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - RouteTablesSummaryName: "dEvIcEpAtH", + RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnections/README.md b/resource-manager/network/2023-11-01/expressroutecrossconnections/README.md index edbc9f79b6b..3d5e128b46b 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnections/README.md +++ b/resource-manager/network/2023-11-01/expressroutecrossconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") payload := expressroutecrossconnections.ExpressRouteCrossConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -92,7 +92,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") payload := expressroutecrossconnections.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnections/id_expressroutecrossconnection.go b/resource-manager/network/2023-11-01/expressroutecrossconnections/id_expressroutecrossconnection.go index dcaf8883d78..10dc03f9c00 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnections/id_expressroutecrossconnection.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnections/id_expressroutecrossconnection.go @@ -115,7 +115,7 @@ func (id ExpressRouteCrossConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go b/resource-manager/network/2023-11-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go index 620034d43a3..11f11c44f51 100644 --- a/resource-manager/network/2023-11-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go +++ b/resource-manager/network/2023-11-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") + id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCrossConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } } func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName" + actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCrossConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressrouteportslocations/README.md b/resource-manager/network/2023-11-01/expressrouteportslocations/README.md index 5f4322ed2e7..e0c809ccc07 100644 --- a/resource-manager/network/2023-11-01/expressrouteportslocations/README.md +++ b/resource-manager/network/2023-11-01/expressrouteportslocations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName") +id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/expressrouteportslocations/id_expressrouteportslocation.go b/resource-manager/network/2023-11-01/expressrouteportslocations/id_expressrouteportslocation.go index 73fe725b0df..d8025eb5937 100644 --- a/resource-manager/network/2023-11-01/expressrouteportslocations/id_expressrouteportslocation.go +++ b/resource-manager/network/2023-11-01/expressrouteportslocations/id_expressrouteportslocation.go @@ -107,7 +107,7 @@ func (id ExpressRoutePortsLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRoutePortsLocations", "expressRoutePortsLocations", "expressRoutePortsLocations"), - resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "locationName"), + resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "expressRoutePortsLocationName"), } } diff --git a/resource-manager/network/2023-11-01/expressrouteportslocations/id_expressrouteportslocation_test.go b/resource-manager/network/2023-11-01/expressrouteportslocations/id_expressrouteportslocation_test.go index 44398dc0c7e..693718559ff 100644 --- a/resource-manager/network/2023-11-01/expressrouteportslocations/id_expressrouteportslocation_test.go +++ b/resource-manager/network/2023-11-01/expressrouteportslocations/id_expressrouteportslocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ExpressRoutePortsLocationId{} func TestNewExpressRoutePortsLocationID(t *testing.T) { - id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName") + id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ExpressRoutePortsLocationName != "locationName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "locationName") + if id.ExpressRoutePortsLocationName != "expressRoutePortsLocationName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "expressRoutePortsLocationName") } } func TestFormatExpressRoutePortsLocationID(t *testing.T) { - actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName" + actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseExpressRoutePortsLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "locationName", + ExpressRoutePortsLocationName: "expressRoutePortsLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseExpressRoutePortsLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "locationName", + ExpressRoutePortsLocationName: "expressRoutePortsLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/lOcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnNaMe", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "lOcAtIoNnAmE", + ExpressRoutePortsLocationName: "eXpReSsRoUtEpOrTsLoCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/lOcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/expressrouteproviderports/README.md b/resource-manager/network/2023-11-01/expressrouteproviderports/README.md index e19d28b36b3..ae8eb0787a2 100644 --- a/resource-manager/network/2023-11-01/expressrouteproviderports/README.md +++ b/resource-manager/network/2023-11-01/expressrouteproviderports/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport") +id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName") read, err := client.ExpressRouteProviderPort(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/expressrouteproviderports/id_expressrouteproviderport.go b/resource-manager/network/2023-11-01/expressrouteproviderports/id_expressrouteproviderport.go index 866b4c25f4f..142c36fee12 100644 --- a/resource-manager/network/2023-11-01/expressrouteproviderports/id_expressrouteproviderport.go +++ b/resource-manager/network/2023-11-01/expressrouteproviderports/id_expressrouteproviderport.go @@ -107,7 +107,7 @@ func (id ExpressRouteProviderPortId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteProviderPorts", "expressRouteProviderPorts", "expressRouteProviderPorts"), - resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "providerport"), + resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "expressRouteProviderPortName"), } } diff --git a/resource-manager/network/2023-11-01/expressrouteproviderports/id_expressrouteproviderport_test.go b/resource-manager/network/2023-11-01/expressrouteproviderports/id_expressrouteproviderport_test.go index 980dfd0f387..04d9684f23d 100644 --- a/resource-manager/network/2023-11-01/expressrouteproviderports/id_expressrouteproviderport_test.go +++ b/resource-manager/network/2023-11-01/expressrouteproviderports/id_expressrouteproviderport_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ExpressRouteProviderPortId{} func TestNewExpressRouteProviderPortID(t *testing.T) { - id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport") + id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ExpressRouteProviderPortName != "providerport" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "providerport") + if id.ExpressRouteProviderPortName != "expressRouteProviderPortName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "expressRouteProviderPortName") } } func TestFormatExpressRouteProviderPortID(t *testing.T) { - actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport" + actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseExpressRouteProviderPortID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "providerport", + ExpressRouteProviderPortName: "expressRouteProviderPortName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseExpressRouteProviderPortIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "providerport", + ExpressRouteProviderPortName: "expressRouteProviderPortName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/pRoViDeRpOrT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTnAmE", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "pRoViDeRpOrT", + ExpressRouteProviderPortName: "eXpReSsRoUtEpRoViDeRpOrTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/pRoViDeRpOrT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/firewallpolicies/model_applicationrule.go b/resource-manager/network/2023-11-01/firewallpolicies/model_applicationrule.go index f7d2f0c3f47..151ed288bae 100644 --- a/resource-manager/network/2023-11-01/firewallpolicies/model_applicationrule.go +++ b/resource-manager/network/2023-11-01/firewallpolicies/model_applicationrule.go @@ -18,7 +18,7 @@ type ApplicationRule struct { SourceAddresses *[]string `json:"sourceAddresses,omitempty"` SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` + TargetURLs *[]string `json:"targetUrls,omitempty"` TerminateTLS *bool `json:"terminateTLS,omitempty"` WebCategories *[]string `json:"webCategories,omitempty"` diff --git a/resource-manager/network/2023-11-01/firewallpolicyrulecollectiongroups/model_applicationrule.go b/resource-manager/network/2023-11-01/firewallpolicyrulecollectiongroups/model_applicationrule.go index 00f2de60a64..1684b7ab31b 100644 --- a/resource-manager/network/2023-11-01/firewallpolicyrulecollectiongroups/model_applicationrule.go +++ b/resource-manager/network/2023-11-01/firewallpolicyrulecollectiongroups/model_applicationrule.go @@ -18,7 +18,7 @@ type ApplicationRule struct { SourceAddresses *[]string `json:"sourceAddresses,omitempty"` SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` + TargetURLs *[]string `json:"targetUrls,omitempty"` TerminateTLS *bool `json:"terminateTLS,omitempty"` WebCategories *[]string `json:"webCategories,omitempty"` diff --git a/resource-manager/network/2023-11-01/ipgroups/README.md b/resource-manager/network/2023-11-01/ipgroups/README.md index 9a98c35e77f..ed40ba5f194 100644 --- a/resource-manager/network/2023-11-01/ipgroups/README.md +++ b/resource-manager/network/2023-11-01/ipgroups/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") payload := ipgroups.IPGroup{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") read, err := client.Get(ctx, id, ipgroups.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") payload := ipgroups.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/ipgroups/id_ipgroup.go b/resource-manager/network/2023-11-01/ipgroups/id_ipgroup.go index 255122bcafc..441c7301b56 100644 --- a/resource-manager/network/2023-11-01/ipgroups/id_ipgroup.go +++ b/resource-manager/network/2023-11-01/ipgroups/id_ipgroup.go @@ -115,7 +115,7 @@ func (id IPGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticIpGroups", "ipGroups", "ipGroups"), - resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupsName"), + resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupName"), } } diff --git a/resource-manager/network/2023-11-01/ipgroups/id_ipgroup_test.go b/resource-manager/network/2023-11-01/ipgroups/id_ipgroup_test.go index 0dee23413e1..e590c1f6bc7 100644 --- a/resource-manager/network/2023-11-01/ipgroups/id_ipgroup_test.go +++ b/resource-manager/network/2023-11-01/ipgroups/id_ipgroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IPGroupId{} func TestNewIPGroupID(t *testing.T) { - id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") + id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewIPGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.IpGroupName != "ipGroupsName" { - t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupsName") + if id.IpGroupName != "ipGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupName") } } func TestFormatIPGroupID(t *testing.T) { - actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName" + actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseIPGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupsName", + IpGroupName: "ipGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseIPGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupsName", + IpGroupName: "ipGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpNaMe", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IpGroupName: "iPgRoUpSnAmE", + IpGroupName: "iPgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/loadbalancers/README.md b/resource-manager/network/2023-11-01/loadbalancers/README.md index 55cb0e1893b..2810b580a18 100644 --- a/resource-manager/network/2023-11-01/loadbalancers/README.md +++ b/resource-manager/network/2023-11-01/loadbalancers/README.md @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName") +id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName") payload := loadbalancers.QueryInboundNatRulePortMappingRequest{ // ... @@ -394,7 +394,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName") +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName") payload := loadbalancers.MigrateLoadBalancerToIPBasedRequest{ // ... @@ -415,7 +415,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loadbalancers.LoadBalancerVipSwapRequest{ // ... diff --git a/resource-manager/network/2023-11-01/loadbalancers/id_backendaddresspool.go b/resource-manager/network/2023-11-01/loadbalancers/id_backendaddresspool.go index 8ed580c9198..9984348c234 100644 --- a/resource-manager/network/2023-11-01/loadbalancers/id_backendaddresspool.go +++ b/resource-manager/network/2023-11-01/loadbalancers/id_backendaddresspool.go @@ -117,13 +117,13 @@ func (id BackendAddressPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerName"), resourceids.StaticSegment("staticBackendAddressPools", "backendAddressPools", "backendAddressPools"), - resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendPoolName"), + resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendAddressPoolName"), } } diff --git a/resource-manager/network/2023-11-01/loadbalancers/id_backendaddresspool_test.go b/resource-manager/network/2023-11-01/loadbalancers/id_backendaddresspool_test.go index 3a2671f5985..b8334fde60c 100644 --- a/resource-manager/network/2023-11-01/loadbalancers/id_backendaddresspool_test.go +++ b/resource-manager/network/2023-11-01/loadbalancers/id_backendaddresspool_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &BackendAddressPoolId{} func TestNewBackendAddressPoolID(t *testing.T) { - id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName") + id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.LoadBalancerName != "loadBalancerName" { t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerName") } - if id.BackendAddressPoolName != "backendPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendPoolName") + if id.BackendAddressPoolName != "backendAddressPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendAddressPoolName") } } func TestFormatBackendAddressPoolID(t *testing.T) { - actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName" + actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseBackendAddressPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", - BackendAddressPoolName: "backendPoolName", + BackendAddressPoolName: "backendAddressPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseBackendAddressPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", - BackendAddressPoolName: "backendPoolName", + BackendAddressPoolName: "backendAddressPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLnAmE", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", LoadBalancerName: "lOaDbAlAnCeRnAmE", - BackendAddressPoolName: "bAcKeNdPoOlNaMe", + BackendAddressPoolName: "bAcKeNdAdDrEsSpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/loadbalancers/id_loadbalancer.go b/resource-manager/network/2023-11-01/loadbalancers/id_loadbalancer.go index ef69db4bf71..61207d17d8d 100644 --- a/resource-manager/network/2023-11-01/loadbalancers/id_loadbalancer.go +++ b/resource-manager/network/2023-11-01/loadbalancers/id_loadbalancer.go @@ -111,7 +111,7 @@ func (id LoadBalancerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), diff --git a/resource-manager/network/2023-11-01/loadbalancers/id_loadbalancer_test.go b/resource-manager/network/2023-11-01/loadbalancers/id_loadbalancer_test.go index 25fcce5b649..5e02836d140 100644 --- a/resource-manager/network/2023-11-01/loadbalancers/id_loadbalancer_test.go +++ b/resource-manager/network/2023-11-01/loadbalancers/id_loadbalancer_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LoadBalancerId{} func TestNewLoadBalancerID(t *testing.T) { - id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName") + id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.LoadBalancerName != "loadBalancerName" { @@ -28,8 +28,8 @@ func TestNewLoadBalancerID(t *testing.T) { } func TestFormatLoadBalancerID(t *testing.T) { - actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName" + actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseLoadBalancerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseLoadBalancerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", LoadBalancerName: "lOaDbAlAnCeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/loadbalancers/id_location.go b/resource-manager/network/2023-11-01/loadbalancers/id_location.go index 06ff0a743e6..b6cfa4c67ba 100644 --- a/resource-manager/network/2023-11-01/loadbalancers/id_location.go +++ b/resource-manager/network/2023-11-01/loadbalancers/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/loadbalancers/id_location_test.go b/resource-manager/network/2023-11-01/loadbalancers/id_location_test.go index 97e523fbcc4..c15a4a4b124 100644 --- a/resource-manager/network/2023-11-01/loadbalancers/id_location_test.go +++ b/resource-manager/network/2023-11-01/loadbalancers/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/networkinterfaces/README.md b/resource-manager/network/2023-11-01/networkinterfaces/README.md index a798e54ade5..b5dc59ad712 100644 --- a/resource-manager/network/2023-11-01/networkinterfaces/README.md +++ b/resource-manager/network/2023-11-01/networkinterfaces/README.md @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName") +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName") read, err := client.GetVirtualMachineScaleSetIPConfiguration(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions()) if err != nil { @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName") +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName") read, err := client.GetVirtualMachineScaleSetNetworkInterface(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions()) if err != nil { @@ -220,7 +220,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName") +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName") // alternatively `client.ListVirtualMachineScaleSetIPConfigurations(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions())` can be used to do batched pagination items, err := client.ListVirtualMachineScaleSetIPConfigurationsComplete(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions()) @@ -254,7 +254,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex") +id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName") // alternatively `client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id)` can be used to do batched pagination items, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx, id) @@ -317,6 +317,35 @@ for _, item := range items { ``` +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsCreateOrUpdate` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceName", "tapConfigurationName") + +payload := networkinterfaces.NetworkInterfaceTapConfiguration{ + // ... +} + + +if err := client.NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsDelete` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceName", "tapConfigurationName") + +if err := client.NetworkInterfaceTapConfigurationsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + ### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsGet` ```go diff --git a/resource-manager/network/2023-11-01/networkinterfaces/id_virtualmachine.go b/resource-manager/network/2023-11-01/networkinterfaces/id_virtualmachine.go index 3e8bac23fd1..ad24ef16d81 100644 --- a/resource-manager/network/2023-11-01/networkinterfaces/id_virtualmachine.go +++ b/resource-manager/network/2023-11-01/networkinterfaces/id_virtualmachine.go @@ -123,7 +123,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "virtualmachineIndex"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/network/2023-11-01/networkinterfaces/id_virtualmachine_test.go b/resource-manager/network/2023-11-01/networkinterfaces/id_virtualmachine_test.go index 612c4ecdd69..cb6aa2f9476 100644 --- a/resource-manager/network/2023-11-01/networkinterfaces/id_virtualmachine_test.go +++ b/resource-manager/network/2023-11-01/networkinterfaces/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.VirtualMachineName != "virtualmachineIndex" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualmachineIndex") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - VirtualMachineName: "virtualmachineIndex", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - VirtualMachineName: "virtualmachineIndex", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEiNdEx", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - VirtualMachineName: "vIrTuAlMaChInEiNdEx", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEiNdEx/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go b/resource-manager/network/2023-11-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go new file mode 100644 index 00000000000..fcece2ea104 --- /dev/null +++ b/resource-manager/network/2023-11-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go @@ -0,0 +1,75 @@ +package networkinterfaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceTapConfigurationsCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *NetworkInterfaceTapConfiguration +} + +// NetworkInterfaceTapConfigurationsCreateOrUpdate ... +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsCreateOrUpdate(ctx context.Context, id TapConfigurationId, input NetworkInterfaceTapConfiguration) (result NetworkInterfaceTapConfigurationsCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll performs NetworkInterfaceTapConfigurationsCreateOrUpdate then polls until it's completed +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll(ctx context.Context, id TapConfigurationId, input NetworkInterfaceTapConfiguration) error { + result, err := c.NetworkInterfaceTapConfigurationsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing NetworkInterfaceTapConfigurationsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after NetworkInterfaceTapConfigurationsCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2023-11-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go b/resource-manager/network/2023-11-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go new file mode 100644 index 00000000000..263815906b2 --- /dev/null +++ b/resource-manager/network/2023-11-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go @@ -0,0 +1,71 @@ +package networkinterfaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceTapConfigurationsDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// NetworkInterfaceTapConfigurationsDelete ... +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsDelete(ctx context.Context, id TapConfigurationId) (result NetworkInterfaceTapConfigurationsDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// NetworkInterfaceTapConfigurationsDeleteThenPoll performs NetworkInterfaceTapConfigurationsDelete then polls until it's completed +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsDeleteThenPoll(ctx context.Context, id TapConfigurationId) error { + result, err := c.NetworkInterfaceTapConfigurationsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing NetworkInterfaceTapConfigurationsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after NetworkInterfaceTapConfigurationsDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2023-11-01/networkvirtualappliances/README.md b/resource-manager/network/2023-11-01/networkvirtualappliances/README.md index 1b456a5a7d1..9997da971d2 100644 --- a/resource-manager/network/2023-11-01/networkvirtualappliances/README.md +++ b/resource-manager/network/2023-11-01/networkvirtualappliances/README.md @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") +id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") payload := networkvirtualappliances.InboundSecurityRule{ // ... diff --git a/resource-manager/network/2023-11-01/networkvirtualappliances/id_inboundsecurityrule.go b/resource-manager/network/2023-11-01/networkvirtualappliances/id_inboundsecurityrule.go index d59b8c173b5..4da7242be6d 100644 --- a/resource-manager/network/2023-11-01/networkvirtualappliances/id_inboundsecurityrule.go +++ b/resource-manager/network/2023-11-01/networkvirtualappliances/id_inboundsecurityrule.go @@ -123,7 +123,7 @@ func (id InboundSecurityRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticInboundSecurityRules", "inboundSecurityRules", "inboundSecurityRules"), - resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "ruleCollectionName"), + resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "inboundSecurityRuleName"), } } diff --git a/resource-manager/network/2023-11-01/networkvirtualappliances/id_inboundsecurityrule_test.go b/resource-manager/network/2023-11-01/networkvirtualappliances/id_inboundsecurityrule_test.go index a4a396742df..b953b2aa90d 100644 --- a/resource-manager/network/2023-11-01/networkvirtualappliances/id_inboundsecurityrule_test.go +++ b/resource-manager/network/2023-11-01/networkvirtualappliances/id_inboundsecurityrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InboundSecurityRuleId{} func TestNewInboundSecurityRuleID(t *testing.T) { - id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") + id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewInboundSecurityRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.InboundSecurityRuleName != "ruleCollectionName" { - t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "ruleCollectionName") + if id.InboundSecurityRuleName != "inboundSecurityRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "inboundSecurityRuleName") } } func TestFormatInboundSecurityRuleID(t *testing.T) { - actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName" + actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseInboundSecurityRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - InboundSecurityRuleName: "ruleCollectionName", + InboundSecurityRuleName: "inboundSecurityRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseInboundSecurityRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - InboundSecurityRuleName: "ruleCollectionName", + InboundSecurityRuleName: "inboundSecurityRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeNaMe", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - InboundSecurityRuleName: "rUlEcOlLeCtIoNnAmE", + InboundSecurityRuleName: "iNbOuNdSeCuRiTyRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/p2svpngateways/README.md b/resource-manager/network/2023-11-01/p2svpngateways/README.md index 49155d7e1f8..d7147011640 100644 --- a/resource-manager/network/2023-11-01/p2svpngateways/README.md +++ b/resource-manager/network/2023-11-01/p2svpngateways/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnConnectionRequest{ // ... @@ -42,7 +42,7 @@ if err := client.DisconnectP2sVpnConnectionsThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnProfileParameters{ // ... @@ -59,7 +59,7 @@ if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnConnectionHealthRequest{ // ... @@ -88,7 +88,7 @@ if err := client.GetP2sVpnConnectionHealthDetailedThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.ResetThenPoll(ctx, id); err != nil { // handle the error @@ -100,7 +100,7 @@ if err := client.ResetThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/p2svpngateways/model_p2svpnconnectionhealth.go b/resource-manager/network/2023-11-01/p2svpngateways/model_p2svpnconnectionhealth.go index 42b227bbf63..d7e951d0d0a 100644 --- a/resource-manager/network/2023-11-01/p2svpngateways/model_p2svpnconnectionhealth.go +++ b/resource-manager/network/2023-11-01/p2svpngateways/model_p2svpnconnectionhealth.go @@ -4,5 +4,5 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type P2SVpnConnectionHealth struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-11-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go b/resource-manager/network/2023-11-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go index d0cd806bd05..cb5094a7b15 100644 --- a/resource-manager/network/2023-11-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go +++ b/resource-manager/network/2023-11-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go @@ -4,6 +4,6 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type P2SVpnConnectionHealthRequest struct { - OutputBlobSasUrl *string `json:"outputBlobSasUrl,omitempty"` + OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"` } diff --git a/resource-manager/network/2023-11-01/p2svpngateways/model_vpnprofileresponse.go b/resource-manager/network/2023-11-01/p2svpngateways/model_vpnprofileresponse.go index 55f4d81d16c..3d26db7265b 100644 --- a/resource-manager/network/2023-11-01/p2svpngateways/model_vpnprofileresponse.go +++ b/resource-manager/network/2023-11-01/p2svpngateways/model_vpnprofileresponse.go @@ -4,5 +4,5 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` } diff --git a/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/README.md b/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/README.md index 94f0e333f1e..6c724acb780 100644 --- a/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/README.md +++ b/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/id_peerconnection.go b/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/id_peerconnection.go index 4c26579b339..4819211effd 100644 --- a/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/id_peerconnection.go +++ b/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/id_peerconnection.go @@ -127,11 +127,11 @@ func (id PeerConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticPeerConnections", "peerConnections", "peerConnections"), - resourceids.UserSpecifiedSegment("peerConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("peerConnectionName", "peerConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/id_peerconnection_test.go b/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/id_peerconnection_test.go index a6434909377..578fee6fb85 100644 --- a/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/id_peerconnection_test.go +++ b/resource-manager/network/2023-11-01/peerexpressroutecircuitconnections/id_peerconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeerConnectionId{} func TestNewPeerConnectionID(t *testing.T) { - id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") + id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeerConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.PeerConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "connectionName") + if id.PeerConnectionName != "peerConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "peerConnectionName") } } func TestFormatPeerConnectionID(t *testing.T) { - actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName" + actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeerConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - PeerConnectionName: "connectionName", + PeerConnectionName: "peerConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeerConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - PeerConnectionName: "connectionName", + PeerConnectionName: "peerConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNnAmE", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - PeerConnectionName: "cOnNeCtIoNnAmE", + PeerConnectionName: "pEeRcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/privateendpoints/README.md b/resource-manager/network/2023-11-01/privateendpoints/README.md index c60ca548bcb..2fe169fa105 100644 --- a/resource-manager/network/2023-11-01/privateendpoints/README.md +++ b/resource-manager/network/2023-11-01/privateendpoints/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id) @@ -42,7 +42,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/privateendpoints/id_location.go b/resource-manager/network/2023-11-01/privateendpoints/id_location.go index f90051a6725..77d85ed86a2 100644 --- a/resource-manager/network/2023-11-01/privateendpoints/id_location.go +++ b/resource-manager/network/2023-11-01/privateendpoints/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/privateendpoints/id_location_test.go b/resource-manager/network/2023-11-01/privateendpoints/id_location_test.go index de6ecb243b3..aff4982b728 100644 --- a/resource-manager/network/2023-11-01/privateendpoints/id_location_test.go +++ b/resource-manager/network/2023-11-01/privateendpoints/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/privateendpoints/id_providerlocation.go b/resource-manager/network/2023-11-01/privateendpoints/id_providerlocation.go index cb389eabe34..5bf08d4e861 100644 --- a/resource-manager/network/2023-11-01/privateendpoints/id_providerlocation.go +++ b/resource-manager/network/2023-11-01/privateendpoints/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/privateendpoints/id_providerlocation_test.go b/resource-manager/network/2023-11-01/privateendpoints/id_providerlocation_test.go index 17c34f07818..ddd96efab6c 100644 --- a/resource-manager/network/2023-11-01/privateendpoints/id_providerlocation_test.go +++ b/resource-manager/network/2023-11-01/privateendpoints/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/privatelinkservices/README.md b/resource-manager/network/2023-11-01/privatelinkservices/README.md index e528cdae1a1..3214520f1d1 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/README.md +++ b/resource-manager/network/2023-11-01/privatelinkservices/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ // ... @@ -42,7 +42,7 @@ if err := client.CheckPrivateLinkServiceVisibilityThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ // ... @@ -59,7 +59,7 @@ if err := client.CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx, i ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") payload := privatelinkservices.PrivateLinkService{ // ... @@ -76,7 +76,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -88,7 +88,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -100,7 +100,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") read, err := client.Get(ctx, id, privatelinkservices.DefaultGetOperationOptions()) if err != nil { @@ -116,7 +116,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id, privatelinkservices.DefaultGetPrivateEndpointConnectionOperationOptions()) if err != nil { @@ -149,7 +149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListAutoApprovedPrivateLinkServices(ctx, id)` can be used to do batched pagination items, err := client.ListAutoApprovedPrivateLinkServicesComplete(ctx, id) @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx, id) @@ -200,7 +200,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") // alternatively `client.ListPrivateEndpointConnections(ctx, id)` can be used to do batched pagination items, err := client.ListPrivateEndpointConnectionsComplete(ctx, id) @@ -217,7 +217,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") payload := privatelinkservices.PrivateEndpointConnection{ // ... diff --git a/resource-manager/network/2023-11-01/privatelinkservices/id_location.go b/resource-manager/network/2023-11-01/privatelinkservices/id_location.go index c2338e0d7ee..ad61efbce7f 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/id_location.go +++ b/resource-manager/network/2023-11-01/privatelinkservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/privatelinkservices/id_location_test.go b/resource-manager/network/2023-11-01/privatelinkservices/id_location_test.go index c7b93b9c65d..56fdbbb4ab0 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/id_location_test.go +++ b/resource-manager/network/2023-11-01/privatelinkservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/privatelinkservices/id_privateendpointconnection.go b/resource-manager/network/2023-11-01/privatelinkservices/id_privateendpointconnection.go index 0bb8766006b..3f1f439928b 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/id_privateendpointconnection.go +++ b/resource-manager/network/2023-11-01/privatelinkservices/id_privateendpointconnection.go @@ -121,9 +121,9 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "peConnectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/privatelinkservices/id_privateendpointconnection_test.go b/resource-manager/network/2023-11-01/privatelinkservices/id_privateendpointconnection_test.go index e82d28f6306..b76fddc6e1b 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/id_privateendpointconnection_test.go +++ b/resource-manager/network/2023-11-01/privatelinkservices/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "serviceName") + if id.PrivateLinkServiceName != "privateLinkServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceName") } - if id.PrivateEndpointConnectionName != "peConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "peConnectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", - PrivateEndpointConnectionName: "peConnectionName", + PrivateLinkServiceName: "privateLinkServiceName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", - PrivateEndpointConnectionName: "peConnectionName", + PrivateLinkServiceName: "privateLinkServiceName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "sErViCeNaMe", - PrivateEndpointConnectionName: "pEcOnNeCtIoNnAmE", + PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/privatelinkservices/id_privatelinkservice.go b/resource-manager/network/2023-11-01/privatelinkservices/id_privatelinkservice.go index c093bc5f0e7..d691d1eded6 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/id_privatelinkservice.go +++ b/resource-manager/network/2023-11-01/privatelinkservices/id_privatelinkservice.go @@ -115,7 +115,7 @@ func (id PrivateLinkServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceName"), } } diff --git a/resource-manager/network/2023-11-01/privatelinkservices/id_privatelinkservice_test.go b/resource-manager/network/2023-11-01/privatelinkservices/id_privatelinkservice_test.go index 43aa7b6b80a..bccc5172aaf 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/id_privatelinkservice_test.go +++ b/resource-manager/network/2023-11-01/privatelinkservices/id_privatelinkservice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkServiceId{} func TestNewPrivateLinkServiceID(t *testing.T) { - id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") + id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "serviceName") + if id.PrivateLinkServiceName != "privateLinkServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceName") } } func TestFormatPrivateLinkServiceID(t *testing.T) { - actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName" + actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", + PrivateLinkServiceName: "privateLinkServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", + PrivateLinkServiceName: "privateLinkServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "sErViCeNaMe", + PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/privatelinkservices/id_providerlocation.go b/resource-manager/network/2023-11-01/privatelinkservices/id_providerlocation.go index 929b9472fbc..706ab2680a9 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/id_providerlocation.go +++ b/resource-manager/network/2023-11-01/privatelinkservices/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/privatelinkservices/id_providerlocation_test.go b/resource-manager/network/2023-11-01/privatelinkservices/id_providerlocation_test.go index 77653638cf4..1565dd828b1 100644 --- a/resource-manager/network/2023-11-01/privatelinkservices/id_providerlocation_test.go +++ b/resource-manager/network/2023-11-01/privatelinkservices/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/publicipaddresses/README.md b/resource-manager/network/2023-11-01/publicipaddresses/README.md index 18e8df0d101..bd760f92aeb 100644 --- a/resource-manager/network/2023-11-01/publicipaddresses/README.md +++ b/resource-manager/network/2023-11-01/publicipaddresses/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") payload := publicipaddresses.PublicIPAddress{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") read, err := client.Get(ctx, id, publicipaddresses.DefaultGetOperationOptions()) if err != nil { @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") payload := publicipaddresses.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/publicipprefixes/README.md b/resource-manager/network/2023-11-01/publicipprefixes/README.md index 7463ba6b183..5ebf404dfea 100644 --- a/resource-manager/network/2023-11-01/publicipprefixes/README.md +++ b/resource-manager/network/2023-11-01/publicipprefixes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") payload := publicipprefixes.PublicIPPrefix{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") payload := publicipprefixes.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/publicipprefixes/id_publicipprefix.go b/resource-manager/network/2023-11-01/publicipprefixes/id_publicipprefix.go index ba849d0aad0..35801814a57 100644 --- a/resource-manager/network/2023-11-01/publicipprefixes/id_publicipprefix.go +++ b/resource-manager/network/2023-11-01/publicipprefixes/id_publicipprefix.go @@ -115,7 +115,7 @@ func (id PublicIPPrefixId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPublicIPPrefixes", "publicIPPrefixes", "publicIPPrefixes"), - resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIpPrefixName"), + resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIPPrefixName"), } } diff --git a/resource-manager/network/2023-11-01/publicipprefixes/id_publicipprefix_test.go b/resource-manager/network/2023-11-01/publicipprefixes/id_publicipprefix_test.go index c19356dcda1..267591b6714 100644 --- a/resource-manager/network/2023-11-01/publicipprefixes/id_publicipprefix_test.go +++ b/resource-manager/network/2023-11-01/publicipprefixes/id_publicipprefix_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PublicIPPrefixId{} func TestNewPublicIPPrefixID(t *testing.T) { - id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") + id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPublicIPPrefixID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PublicIPPrefixName != "publicIpPrefixName" { - t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIpPrefixName") + if id.PublicIPPrefixName != "publicIPPrefixName" { + t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIPPrefixName") } } func TestFormatPublicIPPrefixID(t *testing.T) { - actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName" + actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePublicIPPrefixID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName", Expected: &PublicIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIpPrefixName", + PublicIPPrefixName: "publicIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParsePublicIPPrefixIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName", Expected: &PublicIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIpPrefixName", + PublicIPPrefixName: "publicIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName/extra", Error: true, }, { diff --git a/resource-manager/network/2023-11-01/routefilterrules/README.md b/resource-manager/network/2023-11-01/routefilterrules/README.md index fc7bf7a3a0c..15c8d0423ac 100644 --- a/resource-manager/network/2023-11-01/routefilterrules/README.md +++ b/resource-manager/network/2023-11-01/routefilterrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") payload := routefilterrules.RouteFilterRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/routefilterrules/id_routefilterrule.go b/resource-manager/network/2023-11-01/routefilterrules/id_routefilterrule.go index 120d8a966e0..d06e7791dfc 100644 --- a/resource-manager/network/2023-11-01/routefilterrules/id_routefilterrule.go +++ b/resource-manager/network/2023-11-01/routefilterrules/id_routefilterrule.go @@ -123,7 +123,7 @@ func (id RouteFilterRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterName"), resourceids.StaticSegment("staticRouteFilterRules", "routeFilterRules", "routeFilterRules"), - resourceids.UserSpecifiedSegment("routeFilterRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("routeFilterRuleName", "routeFilterRuleName"), } } diff --git a/resource-manager/network/2023-11-01/routefilterrules/id_routefilterrule_test.go b/resource-manager/network/2023-11-01/routefilterrules/id_routefilterrule_test.go index b0d5daed59a..4a52969db44 100644 --- a/resource-manager/network/2023-11-01/routefilterrules/id_routefilterrule_test.go +++ b/resource-manager/network/2023-11-01/routefilterrules/id_routefilterrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteFilterRuleId{} func TestNewRouteFilterRuleID(t *testing.T) { - id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") + id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRouteFilterRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterName") } - if id.RouteFilterRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "ruleName") + if id.RouteFilterRuleName != "routeFilterRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "routeFilterRuleName") } } func TestFormatRouteFilterRuleID(t *testing.T) { - actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName" + actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRouteFilterRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RouteFilterName: "routeFilterName", - RouteFilterRuleName: "ruleName", + RouteFilterRuleName: "routeFilterRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRouteFilterRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RouteFilterName: "routeFilterName", - RouteFilterRuleName: "ruleName", + RouteFilterRuleName: "routeFilterRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeNaMe", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RouteFilterName: "rOuTeFiLtErNaMe", - RouteFilterRuleName: "rUlEnAmE", + RouteFilterRuleName: "rOuTeFiLtErRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/securityadminconfigurations/README.md b/resource-manager/network/2023-11-01/securityadminconfigurations/README.md index 58fbc13cebd..dd44c24e500 100644 --- a/resource-manager/network/2023-11-01/securityadminconfigurations/README.md +++ b/resource-manager/network/2023-11-01/securityadminconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") payload := securityadminconfigurations.SecurityAdminConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDele ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/securityadminconfigurations/id_securityadminconfiguration.go b/resource-manager/network/2023-11-01/securityadminconfigurations/id_securityadminconfiguration.go index 30b23886bf3..070ef0fa83e 100644 --- a/resource-manager/network/2023-11-01/securityadminconfigurations/id_securityadminconfiguration.go +++ b/resource-manager/network/2023-11-01/securityadminconfigurations/id_securityadminconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityAdminConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), } } diff --git a/resource-manager/network/2023-11-01/securityadminconfigurations/id_securityadminconfiguration_test.go b/resource-manager/network/2023-11-01/securityadminconfigurations/id_securityadminconfiguration_test.go index 2e644cd781d..66fc3677b11 100644 --- a/resource-manager/network/2023-11-01/securityadminconfigurations/id_securityadminconfiguration_test.go +++ b/resource-manager/network/2023-11-01/securityadminconfigurations/id_securityadminconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityAdminConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } } func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName" + actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityAdminConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/servicetags/README.md b/resource-manager/network/2023-11-01/servicetags/README.md index c5a0e25fd87..5839bbaed50 100644 --- a/resource-manager/network/2023-11-01/servicetags/README.md +++ b/resource-manager/network/2023-11-01/servicetags/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ServiceTagInformationList(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions())` can be used to do batched pagination items, err := client.ServiceTagInformationListComplete(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ServiceTagsList(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/servicetags/id_location.go b/resource-manager/network/2023-11-01/servicetags/id_location.go index 82d35d1f77c..5040a3f420a 100644 --- a/resource-manager/network/2023-11-01/servicetags/id_location.go +++ b/resource-manager/network/2023-11-01/servicetags/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/servicetags/id_location_test.go b/resource-manager/network/2023-11-01/servicetags/id_location_test.go index bb87f65c1d0..003c4b42ddf 100644 --- a/resource-manager/network/2023-11-01/servicetags/id_location_test.go +++ b/resource-manager/network/2023-11-01/servicetags/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/usages/README.md b/resource-manager/network/2023-11-01/usages/README.md index 557b8ec210b..577a5f5efff 100644 --- a/resource-manager/network/2023-11-01/usages/README.md +++ b/resource-manager/network/2023-11-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/usages/id_location.go b/resource-manager/network/2023-11-01/usages/id_location.go index 2fe99ba303b..5f505126c1e 100644 --- a/resource-manager/network/2023-11-01/usages/id_location.go +++ b/resource-manager/network/2023-11-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2023-11-01/usages/id_location_test.go b/resource-manager/network/2023-11-01/usages/id_location_test.go index b3c8d46ad6a..8b2dce92bff 100644 --- a/resource-manager/network/2023-11-01/usages/id_location_test.go +++ b/resource-manager/network/2023-11-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/vipswap/README.md b/resource-manager/network/2023-11-01/vipswap/README.md index 69ff94255e2..0cfa64fa81a 100644 --- a/resource-manager/network/2023-11-01/vipswap/README.md +++ b/resource-manager/network/2023-11-01/vipswap/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") payload := vipswap.SwapResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/vipswap/id_cloudservice.go b/resource-manager/network/2023-11-01/vipswap/id_cloudservice.go index 0b7dd65e3bd..93c12d9c01d 100644 --- a/resource-manager/network/2023-11-01/vipswap/id_cloudservice.go +++ b/resource-manager/network/2023-11-01/vipswap/id_cloudservice.go @@ -111,11 +111,11 @@ func (id CloudServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceName"), } } diff --git a/resource-manager/network/2023-11-01/vipswap/id_cloudservice_test.go b/resource-manager/network/2023-11-01/vipswap/id_cloudservice_test.go index ffca7a5d07d..4bc26e07dc5 100644 --- a/resource-manager/network/2023-11-01/vipswap/id_cloudservice_test.go +++ b/resource-manager/network/2023-11-01/vipswap/id_cloudservice_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CloudServiceId{} func TestNewCloudServiceID(t *testing.T) { - id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") + id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } - if id.CloudServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "resourceName") + if id.CloudServiceName != "cloudServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceName") } } func TestFormatCloudServiceID(t *testing.T) { - actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName" + actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseCloudServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", - CloudServiceName: "resourceName", + ResourceGroupName: "resourceGroupName", + CloudServiceName: "cloudServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseCloudServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", - CloudServiceName: "resourceName", + ResourceGroupName: "resourceGroupName", + CloudServiceName: "cloudServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEnAmE", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", - CloudServiceName: "rEsOuRcEnAmE", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", + CloudServiceName: "cLoUdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualappliancesites/README.md b/resource-manager/network/2023-11-01/virtualappliancesites/README.md index 1326274a1aa..8b58521ebf5 100644 --- a/resource-manager/network/2023-11-01/virtualappliancesites/README.md +++ b/resource-manager/network/2023-11-01/virtualappliancesites/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") payload := virtualappliancesites.VirtualApplianceSite{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/virtualappliancesites/id_virtualappliancesite.go b/resource-manager/network/2023-11-01/virtualappliancesites/id_virtualappliancesite.go index 87e626d1b0c..592f4f47427 100644 --- a/resource-manager/network/2023-11-01/virtualappliancesites/id_virtualappliancesite.go +++ b/resource-manager/network/2023-11-01/virtualappliancesites/id_virtualappliancesite.go @@ -123,7 +123,7 @@ func (id VirtualApplianceSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticVirtualApplianceSites", "virtualApplianceSites", "virtualApplianceSites"), - resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "siteName"), + resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "virtualApplianceSiteName"), } } diff --git a/resource-manager/network/2023-11-01/virtualappliancesites/id_virtualappliancesite_test.go b/resource-manager/network/2023-11-01/virtualappliancesites/id_virtualappliancesite_test.go index ffff3d499f0..672639aa072 100644 --- a/resource-manager/network/2023-11-01/virtualappliancesites/id_virtualappliancesite_test.go +++ b/resource-manager/network/2023-11-01/virtualappliancesites/id_virtualappliancesite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualApplianceSiteId{} func TestNewVirtualApplianceSiteID(t *testing.T) { - id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") + id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualApplianceSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.VirtualApplianceSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "siteName") + if id.VirtualApplianceSiteName != "virtualApplianceSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "virtualApplianceSiteName") } } func TestFormatVirtualApplianceSiteID(t *testing.T) { - actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName" + actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualApplianceSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - VirtualApplianceSiteName: "siteName", + VirtualApplianceSiteName: "virtualApplianceSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualApplianceSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - VirtualApplianceSiteName: "siteName", + VirtualApplianceSiteName: "virtualApplianceSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEnAmE", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - VirtualApplianceSiteName: "sItEnAmE", + VirtualApplianceSiteName: "vIrTuAlApPlIaNcEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualapplianceskus/README.md b/resource-manager/network/2023-11-01/virtualapplianceskus/README.md index 979887c315e..32b379d0ad3 100644 --- a/resource-manager/network/2023-11-01/virtualapplianceskus/README.md +++ b/resource-manager/network/2023-11-01/virtualapplianceskus/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName") +id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/virtualapplianceskus/id_networkvirtualappliancesku.go b/resource-manager/network/2023-11-01/virtualapplianceskus/id_networkvirtualappliancesku.go index 46855c565e3..5eb920193a9 100644 --- a/resource-manager/network/2023-11-01/virtualapplianceskus/id_networkvirtualappliancesku.go +++ b/resource-manager/network/2023-11-01/virtualapplianceskus/id_networkvirtualappliancesku.go @@ -107,7 +107,7 @@ func (id NetworkVirtualApplianceSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticNetworkVirtualApplianceSkus", "networkVirtualApplianceSkus", "networkVirtualApplianceSkus"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "skuName"), + resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "networkVirtualApplianceSkuName"), } } diff --git a/resource-manager/network/2023-11-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go b/resource-manager/network/2023-11-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go index 6901430cd2e..7ca3e924a1e 100644 --- a/resource-manager/network/2023-11-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go +++ b/resource-manager/network/2023-11-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &NetworkVirtualApplianceSkuId{} func TestNewNetworkVirtualApplianceSkuID(t *testing.T) { - id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName") + id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.NetworkVirtualApplianceSkuName != "skuName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "skuName") + if id.NetworkVirtualApplianceSkuName != "networkVirtualApplianceSkuName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "networkVirtualApplianceSkuName") } } func TestFormatNetworkVirtualApplianceSkuID(t *testing.T) { - actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName" + actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseNetworkVirtualApplianceSkuID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "skuName", + NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseNetworkVirtualApplianceSkuIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "skuName", + NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/sKuNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUnAmE", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "sKuNaMe", + NetworkVirtualApplianceSkuName: "nEtWoRkViRtUaLaPpLiAnCeSkUnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/sKuNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/README.md b/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/README.md index 8a40ef040e4..9f0ee47aed6 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/README.md +++ b/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.GetIkeSasThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.GetIkeSasThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") read, err := client.GetSharedKey(ctx, id) if err != nil { @@ -115,7 +115,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.ResetConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -127,7 +127,7 @@ if err := client.ResetConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{ // ... @@ -144,7 +144,7 @@ if err := client.ResetSharedKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.ConnectionSharedKey{ // ... @@ -161,7 +161,7 @@ if err := client.SetSharedKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{ // ... @@ -178,7 +178,7 @@ if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{ // ... @@ -195,7 +195,7 @@ if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/id_connection.go b/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/id_connection.go index fcc51d5666b..25fa92d5238 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/id_connection.go +++ b/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/id_connection.go @@ -115,7 +115,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "virtualNetworkGatewayConnectionName"), + resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } } diff --git a/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/id_connection_test.go b/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/id_connection_test.go index 19029d7c27e..271fc3c17bd 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/id_connection_test.go +++ b/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectionName != "virtualNetworkGatewayConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "virtualNetworkGatewayConnectionName") + if id.ConnectionName != "connectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionName") } } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go index e7481a70176..34b83087000 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go +++ b/resource-manager/network/2023-11-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go @@ -4,5 +4,5 @@ package virtualnetworkgatewayconnections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-11-01/virtualnetworkgateways/README.md b/resource-manager/network/2023-11-01/virtualnetworkgateways/README.md index 0e7463e6c86..edc1660ccc6 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgateways/README.md +++ b/resource-manager/network/2023-11-01/virtualnetworkgateways/README.md @@ -153,13 +153,13 @@ if err := client.GetLearnedRoutesThenPoll(ctx, id); err != nil { ``` -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageUrl` +### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageURL` ```go ctx := context.TODO() id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayName") -if err := client.GetVpnProfilePackageUrlThenPoll(ctx, id); err != nil { +if err := client.GetVpnProfilePackageURLThenPoll(ctx, id); err != nil { // handle the error } ``` @@ -397,7 +397,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgateways.VpnDeviceScriptParameters{ // ... diff --git a/resource-manager/network/2023-11-01/virtualnetworkgateways/id_connection.go b/resource-manager/network/2023-11-01/virtualnetworkgateways/id_connection.go index fb0eb751b39..7e0a849bdfd 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgateways/id_connection.go +++ b/resource-manager/network/2023-11-01/virtualnetworkgateways/id_connection.go @@ -115,7 +115,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "virtualNetworkGatewayConnectionName"), + resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } } diff --git a/resource-manager/network/2023-11-01/virtualnetworkgateways/id_connection_test.go b/resource-manager/network/2023-11-01/virtualnetworkgateways/id_connection_test.go index 255ca4bbb2c..f523578a93d 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgateways/id_connection_test.go +++ b/resource-manager/network/2023-11-01/virtualnetworkgateways/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectionName != "virtualNetworkGatewayConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "virtualNetworkGatewayConnectionName") + if id.ConnectionName != "connectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionName") } } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go b/resource-manager/network/2023-11-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go index c247730a0c5..e814c6eff38 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go +++ b/resource-manager/network/2023-11-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go @@ -14,15 +14,15 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetVpnProfilePackageUrlOperationResponse struct { +type GetVpnProfilePackageURLOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData Model *string } -// GetVpnProfilePackageUrl ... -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageUrlOperationResponse, err error) { +// GetVpnProfilePackageURL ... +func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -56,15 +56,15 @@ func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Contex return } -// GetVpnProfilePackageUrlThenPoll performs GetVpnProfilePackageUrl then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrlThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnProfilePackageUrl(ctx, id) +// GetVpnProfilePackageURLThenPoll performs GetVpnProfilePackageURL then polls until it's completed +func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageURLThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { + result, err := c.GetVpnProfilePackageURL(ctx, id) if err != nil { - return fmt.Errorf("performing GetVpnProfilePackageUrl: %+v", err) + return fmt.Errorf("performing GetVpnProfilePackageURL: %+v", err) } if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnProfilePackageUrl: %+v", err) + return fmt.Errorf("polling after GetVpnProfilePackageURL: %+v", err) } return nil diff --git a/resource-manager/network/2023-11-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2023-11-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go index 091426a3451..25f6fba8d55 100644 --- a/resource-manager/network/2023-11-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go +++ b/resource-manager/network/2023-11-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go @@ -4,5 +4,5 @@ package virtualnetworkgateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-11-01/virtualnetworktap/README.md b/resource-manager/network/2023-11-01/virtualnetworktap/README.md index 8915c9ef368..979acc87809 100644 --- a/resource-manager/network/2023-11-01/virtualnetworktap/README.md +++ b/resource-manager/network/2023-11-01/virtualnetworktap/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") payload := virtualnetworktap.VirtualNetworkTap{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") payload := virtualnetworktap.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/virtualnetworktap/id_virtualnetworktap.go b/resource-manager/network/2023-11-01/virtualnetworktap/id_virtualnetworktap.go index 87f32e385ac..48bd4716023 100644 --- a/resource-manager/network/2023-11-01/virtualnetworktap/id_virtualnetworktap.go +++ b/resource-manager/network/2023-11-01/virtualnetworktap/id_virtualnetworktap.go @@ -115,7 +115,7 @@ func (id VirtualNetworkTapId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVirtualNetworkTaps", "virtualNetworkTaps", "virtualNetworkTaps"), - resourceids.UserSpecifiedSegment("virtualNetworkTapName", "tapName"), + resourceids.UserSpecifiedSegment("virtualNetworkTapName", "virtualNetworkTapName"), } } diff --git a/resource-manager/network/2023-11-01/virtualnetworktap/id_virtualnetworktap_test.go b/resource-manager/network/2023-11-01/virtualnetworktap/id_virtualnetworktap_test.go index 638e22fc419..614dfaaf5fd 100644 --- a/resource-manager/network/2023-11-01/virtualnetworktap/id_virtualnetworktap_test.go +++ b/resource-manager/network/2023-11-01/virtualnetworktap/id_virtualnetworktap_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkTapId{} func TestNewVirtualNetworkTapID(t *testing.T) { - id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") + id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualNetworkTapID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualNetworkTapName != "tapName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "tapName") + if id.VirtualNetworkTapName != "virtualNetworkTapName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "virtualNetworkTapName") } } func TestFormatVirtualNetworkTapID(t *testing.T) { - actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName" + actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualNetworkTapID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "tapName", + VirtualNetworkTapName: "virtualNetworkTapName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualNetworkTapIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "tapName", + VirtualNetworkTapName: "virtualNetworkTapName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/tApNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApNaMe", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkTapName: "tApNaMe", + VirtualNetworkTapName: "vIrTuAlNeTwOrKtApNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/tApNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualwans/README.md b/resource-manager/network/2023-11-01/virtualwans/README.md index 90dcfb128b9..a8dabfc5a73 100644 --- a/resource-manager/network/2023-11-01/virtualwans/README.md +++ b/resource-manager/network/2023-11-01/virtualwans/README.md @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.VirtualWanVpnProfileParameters{ // ... @@ -104,7 +104,7 @@ if err := client.GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx, ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") payload := virtualwans.HubRouteTable{ // ... @@ -121,7 +121,7 @@ if err := client.HubRouteTablesCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -133,7 +133,7 @@ if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") read, err := client.HubRouteTablesGet(ctx, id) if err != nil { @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") payload := virtualwans.HubVirtualNetworkConnection{ // ... @@ -183,7 +183,7 @@ if err := client.HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -195,7 +195,7 @@ if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") read, err := client.HubVirtualNetworkConnectionsGet(ctx, id) if err != nil { @@ -228,7 +228,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") payload := virtualwans.VpnGatewayNatRule{ // ... @@ -245,7 +245,7 @@ if err := client.NatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -257,7 +257,7 @@ if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") read, err := client.NatRulesGet(ctx, id) if err != nil { @@ -273,7 +273,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") // alternatively `client.NatRulesListByVpnGateway(ctx, id)` can be used to do batched pagination items, err := client.NatRulesListByVpnGatewayComplete(ctx, id) @@ -290,7 +290,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") payload := virtualwans.NetworkVirtualApplianceConnection{ // ... @@ -307,7 +307,7 @@ if err := client.NetworkVirtualApplianceConnectionsCreateOrUpdateThenPoll(ctx, i ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -319,7 +319,7 @@ if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") read, err := client.NetworkVirtualApplianceConnectionsGet(ctx, id) if err != nil { @@ -352,7 +352,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := virtualwans.P2SVpnGateway{ // ... @@ -369,7 +369,7 @@ if err := client.P2sVpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -381,7 +381,7 @@ if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") read, err := client.P2sVpnGatewaysGet(ctx, id) if err != nil { @@ -555,7 +555,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") read, err := client.SupportedSecurityProviders(ctx, id) if err != nil { @@ -571,7 +571,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.TagsObject{ // ... @@ -592,7 +592,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") payload := virtualwans.BgpConnection{ // ... @@ -609,7 +609,7 @@ if err := client.VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -621,7 +621,7 @@ if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") read, err := client.VirtualHubBgpConnectionGet(ctx, id) if err != nil { @@ -654,7 +654,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); err != nil { // handle the error @@ -666,7 +666,7 @@ if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err != nil { // handle the error @@ -678,7 +678,7 @@ if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") payload := virtualwans.HubIPConfiguration{ // ... @@ -695,7 +695,7 @@ if err := client.VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -707,7 +707,7 @@ if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") read, err := client.VirtualHubIPConfigurationGet(ctx, id) if err != nil { @@ -953,7 +953,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.VirtualWAN{ // ... @@ -970,7 +970,7 @@ if err := client.VirtualWansCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -982,7 +982,7 @@ if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") read, err := client.VirtualWansGet(ctx, id) if err != nil { @@ -1032,7 +1032,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnection{ // ... @@ -1049,7 +1049,7 @@ if err := client.VpnConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1061,7 +1061,7 @@ if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") read, err := client.VpnConnectionsGet(ctx, id) if err != nil { @@ -1077,7 +1077,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") // alternatively `client.VpnConnectionsListByVpnGateway(ctx, id)` can be used to do batched pagination items, err := client.VpnConnectionsListByVpnGatewayComplete(ctx, id) @@ -1094,7 +1094,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnectionPacketCaptureStartParameters{ // ... @@ -1111,7 +1111,7 @@ if err := client.VpnConnectionsStartPacketCaptureThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnectionPacketCaptureStopParameters{ // ... @@ -1128,7 +1128,7 @@ if err := client.VpnConnectionsStopPacketCaptureThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := virtualwans.VpnGateway{ // ... @@ -1145,7 +1145,7 @@ if err := client.VpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1157,7 +1157,7 @@ if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") read, err := client.VpnGatewaysGet(ctx, id) if err != nil { @@ -1207,7 +1207,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { // handle the error @@ -1219,7 +1219,7 @@ if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") // alternatively `client.VpnLinkConnectionsListByVpnConnection(ctx, id)` can be used to do batched pagination items, err := client.VpnLinkConnectionsListByVpnConnectionComplete(ctx, id) @@ -1236,7 +1236,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if err := client.VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx, id); err != nil { // handle the error @@ -1327,7 +1327,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") read, err := client.VpnSiteLinkConnectionsGet(ctx, id) if err != nil { @@ -1376,7 +1376,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.GetVpnSitesConfigurationRequest{ // ... diff --git a/resource-manager/network/2023-11-01/virtualwans/id_hubroutetable.go b/resource-manager/network/2023-11-01/virtualwans/id_hubroutetable.go index 5c93c30fb69..12d932e8523 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_hubroutetable.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_hubroutetable.go @@ -123,7 +123,7 @@ func (id HubRouteTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubName"), resourceids.StaticSegment("staticHubRouteTables", "hubRouteTables", "hubRouteTables"), - resourceids.UserSpecifiedSegment("hubRouteTableName", "routeTableName"), + resourceids.UserSpecifiedSegment("hubRouteTableName", "hubRouteTableName"), } } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_hubroutetable_test.go b/resource-manager/network/2023-11-01/virtualwans/id_hubroutetable_test.go index 7432f35dfa8..68d653182ed 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_hubroutetable_test.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_hubroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubRouteTableId{} func TestNewHubRouteTableID(t *testing.T) { - id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") + id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHubRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubName") } - if id.HubRouteTableName != "routeTableName" { - t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "routeTableName") + if id.HubRouteTableName != "hubRouteTableName" { + t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "hubRouteTableName") } } func TestFormatHubRouteTableID(t *testing.T) { - actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName" + actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHubRouteTableID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubRouteTableName: "routeTableName", + HubRouteTableName: "hubRouteTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHubRouteTableIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubRouteTableName: "routeTableName", + HubRouteTableName: "hubRouteTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/rOuTeTaBlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/hUbRoUtEtAbLeNaMe", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualHubName: "vIrTuAlHuBnAmE", - HubRouteTableName: "rOuTeTaBlEnAmE", + HubRouteTableName: "hUbRoUtEtAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/rOuTeTaBlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/hUbRoUtEtAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_hubvirtualnetworkconnection.go b/resource-manager/network/2023-11-01/virtualwans/id_hubvirtualnetworkconnection.go index 3db347a9c76..17eee4937eb 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_hubvirtualnetworkconnection.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_hubvirtualnetworkconnection.go @@ -123,7 +123,7 @@ func (id HubVirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubName"), resourceids.StaticSegment("staticHubVirtualNetworkConnections", "hubVirtualNetworkConnections", "hubVirtualNetworkConnections"), - resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "hubVirtualNetworkConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_hubvirtualnetworkconnection_test.go b/resource-manager/network/2023-11-01/virtualwans/id_hubvirtualnetworkconnection_test.go index 1dc09c40461..fcfebd848f0 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_hubvirtualnetworkconnection_test.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_hubvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubVirtualNetworkConnectionId{} func TestNewHubVirtualNetworkConnectionID(t *testing.T) { - id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") + id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHubVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubName") } - if id.HubVirtualNetworkConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "connectionName") + if id.HubVirtualNetworkConnectionName != "hubVirtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "hubVirtualNetworkConnectionName") } } func TestFormatHubVirtualNetworkConnectionID(t *testing.T) { - actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName" + actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHubVirtualNetworkConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubVirtualNetworkConnectionName: "connectionName", + HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHubVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubVirtualNetworkConnectionName: "connectionName", + HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualHubName: "vIrTuAlHuBnAmE", - HubVirtualNetworkConnectionName: "cOnNeCtIoNnAmE", + HubVirtualNetworkConnectionName: "hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_natrule.go b/resource-manager/network/2023-11-01/virtualwans/id_natrule.go index 5441dc04ec9..ab096bb8e61 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_natrule.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_natrule.go @@ -121,7 +121,7 @@ func (id NatRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticNatRules", "natRules", "natRules"), resourceids.UserSpecifiedSegment("natRuleName", "natRuleName"), } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_natrule_test.go b/resource-manager/network/2023-11-01/virtualwans/id_natrule_test.go index 9cc9a07875a..0b0048431d8 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_natrule_test.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_natrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NatRuleId{} func TestNewNatRuleID(t *testing.T) { - id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") + id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNatRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } if id.NatRuleName != "natRuleName" { @@ -32,8 +32,8 @@ func TestNewNatRuleID(t *testing.T) { } func TestFormatNatRuleID(t *testing.T) { - actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName" + actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNatRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", NatRuleName: "natRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNatRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", NatRuleName: "natRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS/nAtRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS/nAtRuLeNaMe", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", NatRuleName: "nAtRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS/nAtRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS/nAtRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_networkvirtualapplianceconnection.go b/resource-manager/network/2023-11-01/virtualwans/id_networkvirtualapplianceconnection.go index eea1f6b9dd2..fbbc66efaec 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_networkvirtualapplianceconnection.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_networkvirtualapplianceconnection.go @@ -123,7 +123,7 @@ func (id NetworkVirtualApplianceConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticNetworkVirtualApplianceConnections", "networkVirtualApplianceConnections", "networkVirtualApplianceConnections"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "networkVirtualApplianceConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_networkvirtualapplianceconnection_test.go b/resource-manager/network/2023-11-01/virtualwans/id_networkvirtualapplianceconnection_test.go index b9686058751..e467eaa75a2 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_networkvirtualapplianceconnection_test.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_networkvirtualapplianceconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkVirtualApplianceConnectionId{} func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { - id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") + id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.NetworkVirtualApplianceConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "connectionName") + if id.NetworkVirtualApplianceConnectionName != "networkVirtualApplianceConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "networkVirtualApplianceConnectionName") } } func TestFormatNetworkVirtualApplianceConnectionID(t *testing.T) { - actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName" + actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNetworkVirtualApplianceConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - NetworkVirtualApplianceConnectionName: "connectionName", + NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNetworkVirtualApplianceConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - NetworkVirtualApplianceConnectionName: "connectionName", + NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - NetworkVirtualApplianceConnectionName: "cOnNeCtIoNnAmE", + NetworkVirtualApplianceConnectionName: "nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_virtualwan.go b/resource-manager/network/2023-11-01/virtualwans/id_virtualwan.go index 7ba33187730..fa94d154c26 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_virtualwan.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_virtualwan.go @@ -115,7 +115,7 @@ func (id VirtualWANId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVirtualWans", "virtualWans", "virtualWans"), - resourceids.UserSpecifiedSegment("virtualWanName", "virtualWANName"), + resourceids.UserSpecifiedSegment("virtualWanName", "virtualWanName"), } } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_virtualwan_test.go b/resource-manager/network/2023-11-01/virtualwans/id_virtualwan_test.go index 0fb34067d23..b07670d82b4 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_virtualwan_test.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_virtualwan_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualWANId{} func TestNewVirtualWANID(t *testing.T) { - id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") + id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualWANID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualWanName != "virtualWANName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWANName") + if id.VirtualWanName != "virtualWanName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWanName") } } func TestFormatVirtualWANID(t *testing.T) { - actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName" + actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualWANID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName", Expected: &VirtualWANId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWANName", + VirtualWanName: "virtualWanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVirtualWANIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName", Expected: &VirtualWANId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWANName", + VirtualWanName: "virtualWanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName/extra", Error: true, }, { diff --git a/resource-manager/network/2023-11-01/virtualwans/id_vpngateway.go b/resource-manager/network/2023-11-01/virtualwans/id_vpngateway.go index 0ba0e40f11c..4aac85c0d13 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_vpngateway.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_vpngateway.go @@ -115,7 +115,7 @@ func (id VpnGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), } } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_vpngateway_test.go b/resource-manager/network/2023-11-01/virtualwans/id_vpngateway_test.go index b5d1b5de3a0..c7406d1fb5a 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_vpngateway_test.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_vpngateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnGatewayId{} func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") + id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVpnGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } } func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName" + actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVpnGatewayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVpnGatewayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_vpnlinkconnection.go b/resource-manager/network/2023-11-01/virtualwans/id_vpnlinkconnection.go index 6ee7f540d57..98326bfe842 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_vpnlinkconnection.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_vpnlinkconnection.go @@ -127,11 +127,11 @@ func (id VpnLinkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionName"), resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "linkConnectionName"), + resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/virtualwans/id_vpnlinkconnection_test.go b/resource-manager/network/2023-11-01/virtualwans/id_vpnlinkconnection_test.go index eb904ad1498..98ddb202383 100644 --- a/resource-manager/network/2023-11-01/virtualwans/id_vpnlinkconnection_test.go +++ b/resource-manager/network/2023-11-01/virtualwans/id_vpnlinkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnLinkConnectionId{} func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") + id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVpnLinkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } - if id.VpnConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "connectionName") + if id.VpnConnectionName != "vpnConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionName") } - if id.VpnLinkConnectionName != "linkConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "linkConnectionName") + if id.VpnLinkConnectionName != "vpnLinkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionName") } } func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName" + actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVpnLinkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", - VpnConnectionName: "cOnNeCtIoNnAmE", - VpnLinkConnectionName: "lInKcOnNeCtIoNnAmE", + VpnGatewayName: "vPnGaTeWaYnAmE", + VpnConnectionName: "vPnCoNnEcTiOnNaMe", + VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/virtualwans/model_getvpnsitesconfigurationrequest.go b/resource-manager/network/2023-11-01/virtualwans/model_getvpnsitesconfigurationrequest.go index 0dd233101ce..cd349d0cb2f 100644 --- a/resource-manager/network/2023-11-01/virtualwans/model_getvpnsitesconfigurationrequest.go +++ b/resource-manager/network/2023-11-01/virtualwans/model_getvpnsitesconfigurationrequest.go @@ -4,6 +4,6 @@ package virtualwans // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type GetVpnSitesConfigurationRequest struct { - OutputBlobSasUrl string `json:"outputBlobSasUrl"` + OutputBlobSasURL string `json:"outputBlobSasUrl"` VpnSites *[]string `json:"vpnSites,omitempty"` } diff --git a/resource-manager/network/2023-11-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go b/resource-manager/network/2023-11-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go index de501375c21..a2a50d9eb92 100644 --- a/resource-manager/network/2023-11-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go +++ b/resource-manager/network/2023-11-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go @@ -5,5 +5,5 @@ package virtualwans type VpnConnectionPacketCaptureStopParameters struct { LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-11-01/virtualwans/model_vpnprofileresponse.go b/resource-manager/network/2023-11-01/virtualwans/model_vpnprofileresponse.go index a96c942841c..ed24cd4584e 100644 --- a/resource-manager/network/2023-11-01/virtualwans/model_vpnprofileresponse.go +++ b/resource-manager/network/2023-11-01/virtualwans/model_vpnprofileresponse.go @@ -4,5 +4,5 @@ package virtualwans // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` } diff --git a/resource-manager/network/2023-11-01/vmsspublicipaddresses/README.md b/resource-manager/network/2023-11-01/vmsspublicipaddresses/README.md index 084d0659e9f..b8ee7327981 100644 --- a/resource-manager/network/2023-11-01/vmsspublicipaddresses/README.md +++ b/resource-manager/network/2023-11-01/vmsspublicipaddresses/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName", "publicIpAddressName") +id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName", "publicIPAddressName") read, err := client.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx, id, vmsspublicipaddresses.DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions()) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName") +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName") // alternatively `client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id)` can be used to do batched pagination items, err := client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx, id) diff --git a/resource-manager/network/2023-11-01/vpngateways/README.md b/resource-manager/network/2023-11-01/vpngateways/README.md index 60954afe3ca..753bd5728ca 100644 --- a/resource-manager/network/2023-11-01/vpngateways/README.md +++ b/resource-manager/network/2023-11-01/vpngateways/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions()); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.VpnGatewayPacketCaptureStartParameters{ // ... @@ -53,7 +53,7 @@ if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.VpnGatewayPacketCaptureStopParameters{ // ... @@ -70,7 +70,7 @@ if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.TagsObject{ // ... diff --git a/resource-manager/network/2023-11-01/vpngateways/id_vpngateway.go b/resource-manager/network/2023-11-01/vpngateways/id_vpngateway.go index 52e05b7b7b8..220d3ffa7b3 100644 --- a/resource-manager/network/2023-11-01/vpngateways/id_vpngateway.go +++ b/resource-manager/network/2023-11-01/vpngateways/id_vpngateway.go @@ -115,7 +115,7 @@ func (id VpnGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), } } diff --git a/resource-manager/network/2023-11-01/vpngateways/id_vpngateway_test.go b/resource-manager/network/2023-11-01/vpngateways/id_vpngateway_test.go index f2707bf53e6..c9c4abcd122 100644 --- a/resource-manager/network/2023-11-01/vpngateways/id_vpngateway_test.go +++ b/resource-manager/network/2023-11-01/vpngateways/id_vpngateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnGatewayId{} func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") + id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVpnGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } } func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName" + actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVpnGatewayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVpnGatewayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go b/resource-manager/network/2023-11-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go index ca9fe7cf71d..95998f06000 100644 --- a/resource-manager/network/2023-11-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go +++ b/resource-manager/network/2023-11-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go @@ -4,5 +4,5 @@ package vpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnGatewayPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2023-11-01/vpnlinkconnections/id_vpnlinkconnection.go b/resource-manager/network/2023-11-01/vpnlinkconnections/id_vpnlinkconnection.go index 33a950d143f..986725e2fc1 100644 --- a/resource-manager/network/2023-11-01/vpnlinkconnections/id_vpnlinkconnection.go +++ b/resource-manager/network/2023-11-01/vpnlinkconnections/id_vpnlinkconnection.go @@ -127,11 +127,11 @@ func (id VpnLinkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionName"), resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "linkConnectionName"), + resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionName"), } } diff --git a/resource-manager/network/2023-11-01/vpnlinkconnections/id_vpnlinkconnection_test.go b/resource-manager/network/2023-11-01/vpnlinkconnections/id_vpnlinkconnection_test.go index c6f966d4d10..59a74f2f8ea 100644 --- a/resource-manager/network/2023-11-01/vpnlinkconnections/id_vpnlinkconnection_test.go +++ b/resource-manager/network/2023-11-01/vpnlinkconnections/id_vpnlinkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnLinkConnectionId{} func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") + id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVpnLinkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } - if id.VpnConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "connectionName") + if id.VpnConnectionName != "vpnConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionName") } - if id.VpnLinkConnectionName != "linkConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "linkConnectionName") + if id.VpnLinkConnectionName != "vpnLinkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionName") } } func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName" + actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVpnLinkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", - VpnConnectionName: "cOnNeCtIoNnAmE", - VpnLinkConnectionName: "lInKcOnNeCtIoNnAmE", + VpnGatewayName: "vPnGaTeWaYnAmE", + VpnConnectionName: "vPnCoNnEcTiOnNaMe", + VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/README.md b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/README.md index 43c2aeb5e4c..f6b2841c966 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/README.md +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/constants.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/constants.go index dea03cf19c8..4d1afb6d235 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/constants.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/constants.go @@ -2886,9 +2886,9 @@ const ( WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" + WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" + WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" - WebApplicationFirewallTransformUrlDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformUrlEncode WebApplicationFirewallTransform = "UrlEncode" ) func PossibleValuesForWebApplicationFirewallTransform() []string { @@ -2897,9 +2897,9 @@ func PossibleValuesForWebApplicationFirewallTransform() []string { string(WebApplicationFirewallTransformLowercase), string(WebApplicationFirewallTransformRemoveNulls), string(WebApplicationFirewallTransformTrim), + string(WebApplicationFirewallTransformURLDecode), + string(WebApplicationFirewallTransformURLEncode), string(WebApplicationFirewallTransformUppercase), - string(WebApplicationFirewallTransformUrlDecode), - string(WebApplicationFirewallTransformUrlEncode), } } @@ -2922,9 +2922,9 @@ func parseWebApplicationFirewallTransform(input string) (*WebApplicationFirewall "lowercase": WebApplicationFirewallTransformLowercase, "removenulls": WebApplicationFirewallTransformRemoveNulls, "trim": WebApplicationFirewallTransformTrim, + "urldecode": WebApplicationFirewallTransformURLDecode, + "urlencode": WebApplicationFirewallTransformURLEncode, "uppercase": WebApplicationFirewallTransformUppercase, - "urldecode": WebApplicationFirewallTransformUrlDecode, - "urlencode": WebApplicationFirewallTransformUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go index 0a49b366bfc..3004461fd8a 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go @@ -115,7 +115,7 @@ func (id ApplicationGatewayWebApplicationFirewallPolicyId) Segments() []resource resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticApplicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "applicationGatewayWebApplicationFirewallPolicyName"), } } diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go index c2ea316bba5..205d73da565 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationGatewayWebApplicationFirewallPolicyId{} func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ApplicationGatewayWebApplicationFirewallPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "policyName") + if id.ApplicationGatewayWebApplicationFirewallPolicyName != "applicationGatewayWebApplicationFirewallPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "applicationGatewayWebApplicationFirewallPolicyName") } } func TestFormatApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName" + actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "policyName", + ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(t *t }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "policyName", + ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayWebApplicationFirewallPolicyName: "pOlIcYnAmE", + ApplicationGatewayWebApplicationFirewallPolicyName: "aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go index 82f3501791c..b1f6dd22b0d 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go @@ -4,6 +4,6 @@ package webapplicationfirewallpolicies // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` } diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go index f4f485b405b..6cdbb059a1b 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go @@ -38,6 +38,6 @@ type ApplicationGatewayPropertiesFormat struct { SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + UrlPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` } diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go index 7808c57c7f7..6103c017cb4 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go @@ -10,6 +10,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` } diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go index ed418b0d4a5..18cc34e55af 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go @@ -6,5 +6,5 @@ package webapplicationfirewallpolicies type ApplicationGatewayRewriteRuleActionSet struct { RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` + UrlConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` } diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go index 03021e43980..c6de0fdbc1b 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go @@ -3,7 +3,7 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlConfiguration struct { +type ApplicationGatewayURLConfiguration struct { ModifiedPath *string `json:"modifiedPath,omitempty"` ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` Reroute *bool `json:"reroute,omitempty"` diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go index 57b9cac7aa3..96a3dc6d985 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go @@ -3,10 +3,10 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMap struct { +type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` + Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go index e69ae8cbde4..e02847a3fd9 100644 --- a/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go +++ b/resource-manager/network/2023-11-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go @@ -3,7 +3,7 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMapPropertiesFormat struct { +type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` diff --git a/resource-manager/network/2023-11-01/webcategories/README.md b/resource-manager/network/2023-11-01/webcategories/README.md index a026a5ec583..a0506600f83 100644 --- a/resource-manager/network/2023-11-01/webcategories/README.md +++ b/resource-manager/network/2023-11-01/webcategories/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name") +id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName") read, err := client.Get(ctx, id, webcategories.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/network/2023-11-01/webcategories/id_azurewebcategory.go b/resource-manager/network/2023-11-01/webcategories/id_azurewebcategory.go index 5971766dc63..9e7d76c94f2 100644 --- a/resource-manager/network/2023-11-01/webcategories/id_azurewebcategory.go +++ b/resource-manager/network/2023-11-01/webcategories/id_azurewebcategory.go @@ -107,7 +107,7 @@ func (id AzureWebCategoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticAzureWebCategories", "azureWebCategories", "azureWebCategories"), - resourceids.UserSpecifiedSegment("azureWebCategoryName", "name"), + resourceids.UserSpecifiedSegment("azureWebCategoryName", "azureWebCategoryName"), } } diff --git a/resource-manager/network/2023-11-01/webcategories/id_azurewebcategory_test.go b/resource-manager/network/2023-11-01/webcategories/id_azurewebcategory_test.go index a6e5d9ec9de..08826593ed1 100644 --- a/resource-manager/network/2023-11-01/webcategories/id_azurewebcategory_test.go +++ b/resource-manager/network/2023-11-01/webcategories/id_azurewebcategory_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &AzureWebCategoryId{} func TestNewAzureWebCategoryID(t *testing.T) { - id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name") + id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.AzureWebCategoryName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "name") + if id.AzureWebCategoryName != "azureWebCategoryName" { + t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "azureWebCategoryName") } } func TestFormatAzureWebCategoryID(t *testing.T) { - actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name" + actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseAzureWebCategoryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "name", + AzureWebCategoryName: "azureWebCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseAzureWebCategoryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "name", + AzureWebCategoryName: "azureWebCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYnAmE", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "nAmE", + AzureWebCategoryName: "aZuReWeBcAtEgOrYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/adminrulecollections/README.md b/resource-manager/network/2024-01-01/adminrulecollections/README.md index 33478725321..3ec6902371b 100644 --- a/resource-manager/network/2024-01-01/adminrulecollections/README.md +++ b/resource-manager/network/2024-01-01/adminrulecollections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") payload := adminrulecollections.AdminRuleCollection{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOpera ```go ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") // alternatively `client.List(ctx, id, adminrulecollections.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, adminrulecollections.DefaultListOperationOptions()) diff --git a/resource-manager/network/2024-01-01/adminrulecollections/id_rulecollection.go b/resource-manager/network/2024-01-01/adminrulecollections/id_rulecollection.go index da27349f55a..a7cd76bd8fc 100644 --- a/resource-manager/network/2024-01-01/adminrulecollections/id_rulecollection.go +++ b/resource-manager/network/2024-01-01/adminrulecollections/id_rulecollection.go @@ -129,7 +129,7 @@ func (id RuleCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2024-01-01/adminrulecollections/id_rulecollection_test.go b/resource-manager/network/2024-01-01/adminrulecollections/id_rulecollection_test.go index 151c5f3abf0..0b385a407c1 100644 --- a/resource-manager/network/2024-01-01/adminrulecollections/id_rulecollection_test.go +++ b/resource-manager/network/2024-01-01/adminrulecollections/id_rulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionId{} func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewRuleCollectionID(t *testing.T) { } func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRuleCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/adminrulecollections/id_securityadminconfiguration.go b/resource-manager/network/2024-01-01/adminrulecollections/id_securityadminconfiguration.go index 314559846aa..193fa95d9b5 100644 --- a/resource-manager/network/2024-01-01/adminrulecollections/id_securityadminconfiguration.go +++ b/resource-manager/network/2024-01-01/adminrulecollections/id_securityadminconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityAdminConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), } } diff --git a/resource-manager/network/2024-01-01/adminrulecollections/id_securityadminconfiguration_test.go b/resource-manager/network/2024-01-01/adminrulecollections/id_securityadminconfiguration_test.go index 7e368c4f9ca..aa4f07d225f 100644 --- a/resource-manager/network/2024-01-01/adminrulecollections/id_securityadminconfiguration_test.go +++ b/resource-manager/network/2024-01-01/adminrulecollections/id_securityadminconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityAdminConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } } func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName" + actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityAdminConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/adminrules/README.md b/resource-manager/network/2024-01-01/adminrules/README.md index 02f9cfbeac1..b5e4b644d50 100644 --- a/resource-manager/network/2024-01-01/adminrules/README.md +++ b/resource-manager/network/2024-01-01/adminrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") payload := adminrules.BaseAdminRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOption ```go ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/adminrules/id_rule.go b/resource-manager/network/2024-01-01/adminrules/id_rule.go index 028cb6ac27d..80c294a2cdd 100644 --- a/resource-manager/network/2024-01-01/adminrules/id_rule.go +++ b/resource-manager/network/2024-01-01/adminrules/id_rule.go @@ -135,7 +135,7 @@ func (id RuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), resourceids.StaticSegment("staticRules", "rules", "rules"), diff --git a/resource-manager/network/2024-01-01/adminrules/id_rule_test.go b/resource-manager/network/2024-01-01/adminrules/id_rule_test.go index c4b791947dc..a9939471a62 100644 --- a/resource-manager/network/2024-01-01/adminrules/id_rule_test.go +++ b/resource-manager/network/2024-01-01/adminrules/id_rule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleId{} func TestNewRuleID(t *testing.T) { - id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") + id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -40,8 +40,8 @@ func TestNewRuleID(t *testing.T) { } func TestFormatRuleID(t *testing.T) { - actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName" + actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", RuleName: "rUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/adminrules/id_rulecollection.go b/resource-manager/network/2024-01-01/adminrules/id_rulecollection.go index b621d89f9ed..4f7c635ec89 100644 --- a/resource-manager/network/2024-01-01/adminrules/id_rulecollection.go +++ b/resource-manager/network/2024-01-01/adminrules/id_rulecollection.go @@ -129,7 +129,7 @@ func (id RuleCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2024-01-01/adminrules/id_rulecollection_test.go b/resource-manager/network/2024-01-01/adminrules/id_rulecollection_test.go index 7fcf8dc4da2..b470a67ca68 100644 --- a/resource-manager/network/2024-01-01/adminrules/id_rulecollection_test.go +++ b/resource-manager/network/2024-01-01/adminrules/id_rulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionId{} func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewRuleCollectionID(t *testing.T) { } func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRuleCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/README.md b/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/README.md index 97c281f66bb..1d83bc8c091 100644 --- a/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/README.md +++ b/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") payload := applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnection{ // ... diff --git a/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go index 56c45d49082..5fdf773f215 100644 --- a/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go +++ b/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go @@ -123,7 +123,7 @@ func (id ApplicationGatewayPrivateEndpointConnectionId) Segments() []resourceids resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go b/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go index d78d158b401..41f023a4a31 100644 --- a/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go +++ b/resource-manager/network/2024-01-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationGatewayPrivateEndpointConnectionId{} func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") + id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayName") } - if id.PrivateEndpointConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "connectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName" + actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ApplicationGatewayName: "applicationGatewayName", - PrivateEndpointConnectionName: "connectionName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(t *test }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ApplicationGatewayName: "applicationGatewayName", - PrivateEndpointConnectionName: "connectionName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYnAmE", - PrivateEndpointConnectionName: "cOnNeCtIoNnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewaycustomerror.go b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewaycustomerror.go index 532de5a8e93..8b0e5fb8d20 100644 --- a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewaycustomerror.go +++ b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewaycustomerror.go @@ -4,6 +4,6 @@ package applicationgateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` } diff --git a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewaypropertiesformat.go index 1332febd49d..4e54c939bcb 100644 --- a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewaypropertiesformat.go +++ b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewaypropertiesformat.go @@ -38,6 +38,6 @@ type ApplicationGatewayPropertiesFormat struct { SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + UrlPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` } diff --git a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go index 07b97214f7f..b629d49b411 100644 --- a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go @@ -10,6 +10,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` } diff --git a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go index 02be2e1f37b..c46a7bd6d6c 100644 --- a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go +++ b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go @@ -6,5 +6,5 @@ package applicationgateways type ApplicationGatewayRewriteRuleActionSet struct { RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` + UrlConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` } diff --git a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlconfiguration.go index 18491c35f12..9c77d1808a2 100644 --- a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlconfiguration.go +++ b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlconfiguration.go @@ -3,7 +3,7 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlConfiguration struct { +type ApplicationGatewayURLConfiguration struct { ModifiedPath *string `json:"modifiedPath,omitempty"` ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` Reroute *bool `json:"reroute,omitempty"` diff --git a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlpathmap.go b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlpathmap.go index 5fc06877578..9ca546cb957 100644 --- a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlpathmap.go +++ b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlpathmap.go @@ -3,10 +3,10 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMap struct { +type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` + Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go index ef8e7e8e02f..9c00ae43cdf 100644 --- a/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go +++ b/resource-manager/network/2024-01-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go @@ -3,7 +3,7 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMapPropertiesFormat struct { +type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` diff --git a/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/README.md b/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/README.md index 1bce1e7dadc..3c0ab65c94f 100644 --- a/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/README.md +++ b/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.DefaultGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.Get(ctx, id)` can be used to do batched pagination items, err := client.GetComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/id_location.go b/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/id_location.go index 38c2aa68f21..3d179e08bf0 100644 --- a/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/id_location.go +++ b/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/id_location_test.go b/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/id_location_test.go index abfa53672eb..3989d8a5132 100644 --- a/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/id_location_test.go +++ b/resource-manager/network/2024-01-01/applicationgatewaywafdynamicmanifests/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/availabledelegations/README.md b/resource-manager/network/2024-01-01/availabledelegations/README.md index 7518c6721a8..92616d7900f 100644 --- a/resource-manager/network/2024-01-01/availabledelegations/README.md +++ b/resource-manager/network/2024-01-01/availabledelegations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailableDelegationsList(ctx, id)` can be used to do batched pagination items, err := client.AvailableDelegationsListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.AvailableResourceGroupDelegationsList(ctx, id)` can be used to do batched pagination items, err := client.AvailableResourceGroupDelegationsListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/availabledelegations/id_location.go b/resource-manager/network/2024-01-01/availabledelegations/id_location.go index e4d894a6089..e6387e4fdeb 100644 --- a/resource-manager/network/2024-01-01/availabledelegations/id_location.go +++ b/resource-manager/network/2024-01-01/availabledelegations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/availabledelegations/id_location_test.go b/resource-manager/network/2024-01-01/availabledelegations/id_location_test.go index 8bb71a50adb..8d0352c08ff 100644 --- a/resource-manager/network/2024-01-01/availabledelegations/id_location_test.go +++ b/resource-manager/network/2024-01-01/availabledelegations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/availabledelegations/id_providerlocation.go b/resource-manager/network/2024-01-01/availabledelegations/id_providerlocation.go index 26af2ff9777..1e3b30f4431 100644 --- a/resource-manager/network/2024-01-01/availabledelegations/id_providerlocation.go +++ b/resource-manager/network/2024-01-01/availabledelegations/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/availabledelegations/id_providerlocation_test.go b/resource-manager/network/2024-01-01/availabledelegations/id_providerlocation_test.go index d3dea3d3895..e24c8def247 100644 --- a/resource-manager/network/2024-01-01/availabledelegations/id_providerlocation_test.go +++ b/resource-manager/network/2024-01-01/availabledelegations/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/availableservicealiases/README.md b/resource-manager/network/2024-01-01/availableservicealiases/README.md index 0af0dc4571f..595d4aace98 100644 --- a/resource-manager/network/2024-01-01/availableservicealiases/README.md +++ b/resource-manager/network/2024-01-01/availableservicealiases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListByResourceGroupComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/availableservicealiases/id_location.go b/resource-manager/network/2024-01-01/availableservicealiases/id_location.go index 65846cc20dd..b531d5a4bb7 100644 --- a/resource-manager/network/2024-01-01/availableservicealiases/id_location.go +++ b/resource-manager/network/2024-01-01/availableservicealiases/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/availableservicealiases/id_location_test.go b/resource-manager/network/2024-01-01/availableservicealiases/id_location_test.go index 8fdfbdee89e..995b5cfad7f 100644 --- a/resource-manager/network/2024-01-01/availableservicealiases/id_location_test.go +++ b/resource-manager/network/2024-01-01/availableservicealiases/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/availableservicealiases/id_providerlocation.go b/resource-manager/network/2024-01-01/availableservicealiases/id_providerlocation.go index 653b48ba912..6c961f76bc1 100644 --- a/resource-manager/network/2024-01-01/availableservicealiases/id_providerlocation.go +++ b/resource-manager/network/2024-01-01/availableservicealiases/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/availableservicealiases/id_providerlocation_test.go b/resource-manager/network/2024-01-01/availableservicealiases/id_providerlocation_test.go index 8b2be520bef..d6526faaf37 100644 --- a/resource-manager/network/2024-01-01/availableservicealiases/id_providerlocation_test.go +++ b/resource-manager/network/2024-01-01/availableservicealiases/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/azurefirewalls/model_firewallpacketcaptureparameters.go b/resource-manager/network/2024-01-01/azurefirewalls/model_firewallpacketcaptureparameters.go index 4259cab2043..0fab56fc1d5 100644 --- a/resource-manager/network/2024-01-01/azurefirewalls/model_firewallpacketcaptureparameters.go +++ b/resource-manager/network/2024-01-01/azurefirewalls/model_firewallpacketcaptureparameters.go @@ -10,5 +10,5 @@ type FirewallPacketCaptureParameters struct { Flags *[]AzureFirewallPacketCaptureFlags `json:"flags,omitempty"` NumberOfPacketsToCapture *int64 `json:"numberOfPacketsToCapture,omitempty"` Protocol *AzureFirewallNetworkRuleProtocol `json:"protocol,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-01-01/checkdnsavailabilities/README.md b/resource-manager/network/2024-01-01/checkdnsavailabilities/README.md index e3b6076fa30..81b10437756 100644 --- a/resource-manager/network/2024-01-01/checkdnsavailabilities/README.md +++ b/resource-manager/network/2024-01-01/checkdnsavailabilities/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.CheckDnsNameAvailability(ctx, id, checkdnsavailabilities.DefaultCheckDnsNameAvailabilityOperationOptions()) if err != nil { diff --git a/resource-manager/network/2024-01-01/checkdnsavailabilities/id_location.go b/resource-manager/network/2024-01-01/checkdnsavailabilities/id_location.go index 054cfdb305a..e9c60b3adaf 100644 --- a/resource-manager/network/2024-01-01/checkdnsavailabilities/id_location.go +++ b/resource-manager/network/2024-01-01/checkdnsavailabilities/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/checkdnsavailabilities/id_location_test.go b/resource-manager/network/2024-01-01/checkdnsavailabilities/id_location_test.go index 8b2e43d72d1..7d13e412f40 100644 --- a/resource-manager/network/2024-01-01/checkdnsavailabilities/id_location_test.go +++ b/resource-manager/network/2024-01-01/checkdnsavailabilities/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/connectivityconfigurations/README.md b/resource-manager/network/2024-01-01/connectivityconfigurations/README.md index af92379f057..904292d1d9a 100644 --- a/resource-manager/network/2024-01-01/connectivityconfigurations/README.md +++ b/resource-manager/network/2024-01-01/connectivityconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") payload := connectivityconfigurations.ConnectivityConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDelet ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/connectivityconfigurations/id_connectivityconfiguration.go b/resource-manager/network/2024-01-01/connectivityconfigurations/id_connectivityconfiguration.go index 49a4ba3aaf0..d062db15f4f 100644 --- a/resource-manager/network/2024-01-01/connectivityconfigurations/id_connectivityconfiguration.go +++ b/resource-manager/network/2024-01-01/connectivityconfigurations/id_connectivityconfiguration.go @@ -123,7 +123,7 @@ func (id ConnectivityConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticConnectivityConfigurations", "connectivityConfigurations", "connectivityConfigurations"), - resourceids.UserSpecifiedSegment("connectivityConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("connectivityConfigurationName", "connectivityConfigurationName"), } } diff --git a/resource-manager/network/2024-01-01/connectivityconfigurations/id_connectivityconfiguration_test.go b/resource-manager/network/2024-01-01/connectivityconfigurations/id_connectivityconfiguration_test.go index 524d8385688..62733e7673b 100644 --- a/resource-manager/network/2024-01-01/connectivityconfigurations/id_connectivityconfiguration_test.go +++ b/resource-manager/network/2024-01-01/connectivityconfigurations/id_connectivityconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectivityConfigurationId{} func TestNewConnectivityConfigurationID(t *testing.T) { - id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewConnectivityConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.ConnectivityConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "configurationName") + if id.ConnectivityConfigurationName != "connectivityConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "connectivityConfigurationName") } } func TestFormatConnectivityConfigurationID(t *testing.T) { - actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName" + actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseConnectivityConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - ConnectivityConfigurationName: "configurationName", + ConnectivityConfigurationName: "connectivityConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseConnectivityConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - ConnectivityConfigurationName: "configurationName", + ConnectivityConfigurationName: "connectivityConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnNaMe", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - ConnectivityConfigurationName: "cOnFiGuRaTiOnNaMe", + ConnectivityConfigurationName: "cOnNeCtIvItYcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/customipprefixes/README.md b/resource-manager/network/2024-01-01/customipprefixes/README.md index c198cd426a1..0d8a5dc549e 100644 --- a/resource-manager/network/2024-01-01/customipprefixes/README.md +++ b/resource-manager/network/2024-01-01/customipprefixes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") payload := customipprefixes.CustomIPPrefix{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") read, err := client.Get(ctx, id, customipprefixes.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") payload := customipprefixes.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/customipprefixes/id_customipprefix.go b/resource-manager/network/2024-01-01/customipprefixes/id_customipprefix.go index a41316cfa68..bca85243003 100644 --- a/resource-manager/network/2024-01-01/customipprefixes/id_customipprefix.go +++ b/resource-manager/network/2024-01-01/customipprefixes/id_customipprefix.go @@ -115,7 +115,7 @@ func (id CustomIPPrefixId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticCustomIPPrefixes", "customIPPrefixes", "customIPPrefixes"), - resourceids.UserSpecifiedSegment("customIPPrefixName", "customIpPrefixName"), + resourceids.UserSpecifiedSegment("customIPPrefixName", "customIPPrefixName"), } } diff --git a/resource-manager/network/2024-01-01/customipprefixes/id_customipprefix_test.go b/resource-manager/network/2024-01-01/customipprefixes/id_customipprefix_test.go index 2503a2c56e8..dfd6b48155e 100644 --- a/resource-manager/network/2024-01-01/customipprefixes/id_customipprefix_test.go +++ b/resource-manager/network/2024-01-01/customipprefixes/id_customipprefix_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomIPPrefixId{} func TestNewCustomIPPrefixID(t *testing.T) { - id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") + id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCustomIPPrefixID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CustomIPPrefixName != "customIpPrefixName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIpPrefixName") + if id.CustomIPPrefixName != "customIPPrefixName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIPPrefixName") } } func TestFormatCustomIPPrefixID(t *testing.T) { - actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName" + actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCustomIPPrefixID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName", Expected: &CustomIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIpPrefixName", + CustomIPPrefixName: "customIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCustomIPPrefixIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName", Expected: &CustomIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIpPrefixName", + CustomIPPrefixName: "customIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName/extra", Error: true, }, { diff --git a/resource-manager/network/2024-01-01/endpointservices/README.md b/resource-manager/network/2024-01-01/endpointservices/README.md index 4dbb00cd667..ac63c761588 100644 --- a/resource-manager/network/2024-01-01/endpointservices/README.md +++ b/resource-manager/network/2024-01-01/endpointservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailableEndpointServicesList(ctx, id)` can be used to do batched pagination items, err := client.AvailableEndpointServicesListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/endpointservices/id_location.go b/resource-manager/network/2024-01-01/endpointservices/id_location.go index f2b06140acf..18eaa8353af 100644 --- a/resource-manager/network/2024-01-01/endpointservices/id_location.go +++ b/resource-manager/network/2024-01-01/endpointservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/endpointservices/id_location_test.go b/resource-manager/network/2024-01-01/endpointservices/id_location_test.go index e31df0936ae..0213283041f 100644 --- a/resource-manager/network/2024-01-01/endpointservices/id_location_test.go +++ b/resource-manager/network/2024-01-01/endpointservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitarptable/README.md b/resource-manager/network/2024-01-01/expressroutecircuitarptable/README.md index 36e0dc7d7e7..3d622f8d069 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitarptable/README.md +++ b/resource-manager/network/2024-01-01/expressroutecircuitarptable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName") // alternatively `client.ExpressRouteCircuitsListArpTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListArpTableComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecircuitarptable/id_arptable.go b/resource-manager/network/2024-01-01/expressroutecircuitarptable/id_arptable.go index 0f33d89bfd9..d35a8eadadf 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitarptable/id_arptable.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitarptable/id_arptable.go @@ -127,11 +127,11 @@ func (id ArpTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "devicePath"), + resourceids.UserSpecifiedSegment("arpTableName", "arpTableName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitarptable/id_arptable_test.go b/resource-manager/network/2024-01-01/expressroutecircuitarptable/id_arptable_test.go index 11dd82c0c88..66d3e99f02e 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitarptable/id_arptable_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitarptable/id_arptable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArpTableId{} func TestNewArpTableID(t *testing.T) { - id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewArpTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.ArpTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "devicePath") + if id.ArpTableName != "arpTableName" { + t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableName") } } func TestFormatArpTableID(t *testing.T) { - actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath" + actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseArpTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseArpTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - ArpTableName: "dEvIcEpAtH", + ArpTableName: "aRpTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/README.md b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/README.md index 092ea3a822c..1c759bbd4c7 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/README.md +++ b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_authorization.go b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_authorization.go index b8b16a2153d..9da101d4a62 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_authorization.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_authorization.go @@ -121,7 +121,7 @@ func (id AuthorizationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), resourceids.UserSpecifiedSegment("authorizationName", "authorizationName"), } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_authorization_test.go b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_authorization_test.go index ed6668508eb..60d0dbacbe5 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_authorization_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_authorization_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthorizationId{} func TestNewAuthorizationID(t *testing.T) { - id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") + id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAuthorizationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.AuthorizationName != "authorizationName" { @@ -32,8 +32,8 @@ func TestNewAuthorizationID(t *testing.T) { } func TestFormatAuthorizationID(t *testing.T) { - actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName" + actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAuthorizationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", AuthorizationName: "authorizationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAuthorizationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", AuthorizationName: "authorizationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", AuthorizationName: "aUtHoRiZaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_expressroutecircuit.go b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_expressroutecircuit.go index 7626fffc08c..210f0ae6366 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_expressroutecircuit.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go index 20b47ec6190..3bd47c1b205 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitconnections/README.md b/resource-manager/network/2024-01-01/expressroutecircuitconnections/README.md index e9a4a8d9782..9e4e22c757e 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitconnections/README.md +++ b/resource-manager/network/2024-01-01/expressroutecircuitconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecircuitconnections/id_peeringconnection.go b/resource-manager/network/2024-01-01/expressroutecircuitconnections/id_peeringconnection.go index 7c1fb7730b7..07c1226d200 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitconnections/id_peeringconnection.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitconnections/id_peeringconnection.go @@ -127,7 +127,7 @@ func (id PeeringConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticConnections", "connections", "connections"), diff --git a/resource-manager/network/2024-01-01/expressroutecircuitconnections/id_peeringconnection_test.go b/resource-manager/network/2024-01-01/expressroutecircuitconnections/id_peeringconnection_test.go index 39d2aafacfa..f1e786ac3d2 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitconnections/id_peeringconnection_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitconnections/id_peeringconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringConnectionId{} func TestNewPeeringConnectionID(t *testing.T) { - id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") + id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPeeringConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { @@ -36,8 +36,8 @@ func TestNewPeeringConnectionID(t *testing.T) { } func TestFormatPeeringConnectionID(t *testing.T) { - actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName" + actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitpeerings/README.md b/resource-manager/network/2024-01-01/expressroutecircuitpeerings/README.md index caf3d287163..2635a47850d 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitpeerings/README.md +++ b/resource-manager/network/2024-01-01/expressroutecircuitpeerings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecircuitpeerings/id_expressroutecircuit.go b/resource-manager/network/2024-01-01/expressroutecircuitpeerings/id_expressroutecircuit.go index d901b679f33..02a14699ffa 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitpeerings/id_expressroutecircuit.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitpeerings/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go b/resource-manager/network/2024-01-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go index 1edc4454ed9..9d893b6392d 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitroutestable/README.md b/resource-manager/network/2024-01-01/expressroutecircuitroutestable/README.md index b955693a037..3ae7f9b4b7f 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitroutestable/README.md +++ b/resource-manager/network/2024-01-01/expressroutecircuitroutestable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName") // alternatively `client.ExpressRouteCircuitsListRoutesTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListRoutesTableComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecircuitroutestable/id_peeringroutetable.go b/resource-manager/network/2024-01-01/expressroutecircuitroutestable/id_peeringroutetable.go index d929441f379..8971fb87e03 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitroutestable/id_peeringroutetable.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitroutestable/id_peeringroutetable.go @@ -127,11 +127,11 @@ func (id PeeringRouteTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTableName", "routeTableName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitroutestable/id_peeringroutetable_test.go b/resource-manager/network/2024-01-01/expressroutecircuitroutestable/id_peeringroutetable_test.go index 154e92f43fb..620bbfff69e 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitroutestable/id_peeringroutetable_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitroutestable/id_peeringroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringRouteTableId{} func TestNewPeeringRouteTableID(t *testing.T) { - id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "devicePath") + if id.RouteTableName != "routeTableName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableName") } } func TestFormatPeeringRouteTableID(t *testing.T) { - actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath" + actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringRouteTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringRouteTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - RouteTableName: "dEvIcEpAtH", + RouteTableName: "rOuTeTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/README.md b/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/README.md index dcdfa550250..d97c9ad1cb5 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/README.md +++ b/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName") // alternatively `client.ExpressRouteCircuitsListRoutesTableSummary(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListRoutesTableSummaryComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/id_routetablessummary.go b/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/id_routetablessummary.go index 93753595743..90ea354df62 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/id_routetablessummary.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/id_routetablessummary.go @@ -127,11 +127,11 @@ func (id RouteTablesSummaryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go b/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go index b1c58fed640..2c78aaf0378 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteTablesSummaryId{} func TestNewRouteTablesSummaryID(t *testing.T) { - id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewRouteTablesSummaryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTablesSummaryName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "devicePath") + if id.RouteTablesSummaryName != "routeTablesSummaryName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryName") } } func TestFormatRouteTablesSummaryID(t *testing.T) { - actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath" + actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRouteTablesSummaryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRouteTablesSummaryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - RouteTablesSummaryName: "dEvIcEpAtH", + RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuits/README.md b/resource-manager/network/2024-01-01/expressroutecircuits/README.md index 3253a8acdd0..d9955f1eedc 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuits/README.md +++ b/resource-manager/network/2024-01-01/expressroutecircuits/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") payload := expressroutecircuits.ExpressRouteCircuit{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") payload := expressroutecircuits.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/expressroutecircuits/id_expressroutecircuit.go b/resource-manager/network/2024-01-01/expressroutecircuits/id_expressroutecircuit.go index d3a73edd48a..7c3ebaafe98 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuits/id_expressroutecircuit.go +++ b/resource-manager/network/2024-01-01/expressroutecircuits/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecircuits/id_expressroutecircuit_test.go b/resource-manager/network/2024-01-01/expressroutecircuits/id_expressroutecircuit_test.go index 3c4a66b65e7..de1beeca125 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuits/id_expressroutecircuit_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuits/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitstats/README.md b/resource-manager/network/2024-01-01/expressroutecircuitstats/README.md index 27fcf81f3a1..bbd5f0939fb 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitstats/README.md +++ b/resource-manager/network/2024-01-01/expressroutecircuitstats/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") read, err := client.ExpressRouteCircuitsGetPeeringStats(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") read, err := client.ExpressRouteCircuitsGetStats(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/expressroutecircuitstats/id_expressroutecircuit.go b/resource-manager/network/2024-01-01/expressroutecircuitstats/id_expressroutecircuit.go index 38c9ef16c4a..0eba5b9c251 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitstats/id_expressroutecircuit.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitstats/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecircuitstats/id_expressroutecircuit_test.go b/resource-manager/network/2024-01-01/expressroutecircuitstats/id_expressroutecircuit_test.go index 883c9a15547..288e8caf55e 100644 --- a/resource-manager/network/2024-01-01/expressroutecircuitstats/id_expressroutecircuit_test.go +++ b/resource-manager/network/2024-01-01/expressroutecircuitstats/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressrouteconnections/README.md b/resource-manager/network/2024-01-01/expressrouteconnections/README.md index 2ac86b91668..0701489939e 100644 --- a/resource-manager/network/2024-01-01/expressrouteconnections/README.md +++ b/resource-manager/network/2024-01-01/expressrouteconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") payload := expressrouteconnections.ExpressRouteConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/expressrouteconnections/id_expressrouteconnection.go b/resource-manager/network/2024-01-01/expressrouteconnections/id_expressrouteconnection.go index 971a1ebe796..2cf6021fe08 100644 --- a/resource-manager/network/2024-01-01/expressrouteconnections/id_expressrouteconnection.go +++ b/resource-manager/network/2024-01-01/expressrouteconnections/id_expressrouteconnection.go @@ -123,7 +123,7 @@ func (id ExpressRouteConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayName"), resourceids.StaticSegment("staticExpressRouteConnections", "expressRouteConnections", "expressRouteConnections"), - resourceids.UserSpecifiedSegment("expressRouteConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("expressRouteConnectionName", "expressRouteConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/expressrouteconnections/id_expressrouteconnection_test.go b/resource-manager/network/2024-01-01/expressrouteconnections/id_expressrouteconnection_test.go index 4416a9058fc..dd3b75e24af 100644 --- a/resource-manager/network/2024-01-01/expressrouteconnections/id_expressrouteconnection_test.go +++ b/resource-manager/network/2024-01-01/expressrouteconnections/id_expressrouteconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteConnectionId{} func TestNewExpressRouteConnectionID(t *testing.T) { - id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") + id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExpressRouteConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayName") } - if id.ExpressRouteConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "connectionName") + if id.ExpressRouteConnectionName != "expressRouteConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "expressRouteConnectionName") } } func TestFormatExpressRouteConnectionID(t *testing.T) { - actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName" + actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExpressRouteConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ExpressRouteGatewayName: "expressRouteGatewayName", - ExpressRouteConnectionName: "connectionName", + ExpressRouteConnectionName: "expressRouteConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExpressRouteConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ExpressRouteGatewayName: "expressRouteGatewayName", - ExpressRouteConnectionName: "connectionName", + ExpressRouteConnectionName: "expressRouteConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNnAmE", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyNaMe", - ExpressRouteConnectionName: "cOnNeCtIoNnAmE", + ExpressRouteConnectionName: "eXpReSsRoUtEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/README.md b/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/README.md index a0884cb64a1..d44d7b493f2 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/README.md +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName") // alternatively `client.ExpressRouteCrossConnectionsListArpTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListArpTableComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/id_peeringarptable.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/id_peeringarptable.go index 0589efdc27b..f37ffb9dda2 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/id_peeringarptable.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/id_peeringarptable.go @@ -127,11 +127,11 @@ func (id PeeringArpTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "devicePath"), + resourceids.UserSpecifiedSegment("arpTableName", "arpTableName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go index 7a56ebe2b11..1d31f05cc7a 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringArpTableId{} func TestNewPeeringArpTableID(t *testing.T) { - id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringArpTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.ArpTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "devicePath") + if id.ArpTableName != "arpTableName" { + t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableName") } } func TestFormatPeeringArpTableID(t *testing.T) { - actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath" + actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringArpTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringArpTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - ArpTableName: "dEvIcEpAtH", + ArpTableName: "aRpTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/README.md b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/README.md index dae29d03e7a..7490470e61b 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/README.md +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") payload := expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeering{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go index 0971af25620..890e4e7d24b 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go @@ -115,7 +115,7 @@ func (id ExpressRouteCrossConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go index 2019f0104a6..33465dd597a 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") + id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCrossConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } } func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName" + actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCrossConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_peering.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_peering.go index 83a9563a48d..c3ee06da4dc 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_peering.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_peering.go @@ -121,7 +121,7 @@ func (id PeeringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_peering_test.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_peering_test.go index 57de6e64b02..ac47382755d 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_peering_test.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionpeerings/id_peering_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringId{} func TestNewPeeringID(t *testing.T) { - id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") + id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPeeringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { @@ -32,8 +32,8 @@ func TestNewPeeringID(t *testing.T) { } func TestFormatPeeringID(t *testing.T) { - actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName" + actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePeeringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePeeringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/README.md b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/README.md index 4d87ec895ea..a15ca2e7739 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/README.md +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName") // alternatively `client.ExpressRouteCrossConnectionsListRoutesTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListRoutesTableComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go index b6d27ada378..29491001fbf 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go @@ -127,11 +127,11 @@ func (id ExpressRouteCrossConnectionPeeringRouteTableId) Segments() []resourceid resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTableName", "routeTableName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go index 35e27084ce7..2dd58fa2973 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionPeeringRouteTableId{} func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "devicePath") + if id.RouteTableName != "routeTableName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableName") } } func TestFormatExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath" + actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(t *tes }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - RouteTableName: "dEvIcEpAtH", + RouteTableName: "rOuTeTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/README.md b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/README.md index cc9d5e6c30b..3eda4099e9c 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/README.md +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName") // alternatively `client.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListRoutesTableSummaryComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go index df854619ed9..1d3631cb982 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go @@ -127,11 +127,11 @@ func (id PeeringRouteTablesSummaryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go index 361ebbceb19..6d2bdf44468 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringRouteTablesSummaryId{} func TestNewPeeringRouteTablesSummaryID(t *testing.T) { - id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringRouteTablesSummaryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTablesSummaryName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "devicePath") + if id.RouteTablesSummaryName != "routeTablesSummaryName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryName") } } func TestFormatPeeringRouteTablesSummaryID(t *testing.T) { - actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath" + actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringRouteTablesSummaryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringRouteTablesSummaryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - RouteTablesSummaryName: "dEvIcEpAtH", + RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnections/README.md b/resource-manager/network/2024-01-01/expressroutecrossconnections/README.md index 0cb8e7ea990..5dc4f69ddc4 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnections/README.md +++ b/resource-manager/network/2024-01-01/expressroutecrossconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") payload := expressroutecrossconnections.ExpressRouteCrossConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -92,7 +92,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") payload := expressroutecrossconnections.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnections/id_expressroutecrossconnection.go b/resource-manager/network/2024-01-01/expressroutecrossconnections/id_expressroutecrossconnection.go index dcaf8883d78..10dc03f9c00 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnections/id_expressroutecrossconnection.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnections/id_expressroutecrossconnection.go @@ -115,7 +115,7 @@ func (id ExpressRouteCrossConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go b/resource-manager/network/2024-01-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go index 620034d43a3..11f11c44f51 100644 --- a/resource-manager/network/2024-01-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go +++ b/resource-manager/network/2024-01-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") + id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCrossConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } } func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName" + actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCrossConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressrouteportslocations/README.md b/resource-manager/network/2024-01-01/expressrouteportslocations/README.md index ec2d7a1a5ce..273dc93db81 100644 --- a/resource-manager/network/2024-01-01/expressrouteportslocations/README.md +++ b/resource-manager/network/2024-01-01/expressrouteportslocations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName") +id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/expressrouteportslocations/id_expressrouteportslocation.go b/resource-manager/network/2024-01-01/expressrouteportslocations/id_expressrouteportslocation.go index 73fe725b0df..d8025eb5937 100644 --- a/resource-manager/network/2024-01-01/expressrouteportslocations/id_expressrouteportslocation.go +++ b/resource-manager/network/2024-01-01/expressrouteportslocations/id_expressrouteportslocation.go @@ -107,7 +107,7 @@ func (id ExpressRoutePortsLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRoutePortsLocations", "expressRoutePortsLocations", "expressRoutePortsLocations"), - resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "locationName"), + resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "expressRoutePortsLocationName"), } } diff --git a/resource-manager/network/2024-01-01/expressrouteportslocations/id_expressrouteportslocation_test.go b/resource-manager/network/2024-01-01/expressrouteportslocations/id_expressrouteportslocation_test.go index 44398dc0c7e..693718559ff 100644 --- a/resource-manager/network/2024-01-01/expressrouteportslocations/id_expressrouteportslocation_test.go +++ b/resource-manager/network/2024-01-01/expressrouteportslocations/id_expressrouteportslocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ExpressRoutePortsLocationId{} func TestNewExpressRoutePortsLocationID(t *testing.T) { - id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName") + id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ExpressRoutePortsLocationName != "locationName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "locationName") + if id.ExpressRoutePortsLocationName != "expressRoutePortsLocationName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "expressRoutePortsLocationName") } } func TestFormatExpressRoutePortsLocationID(t *testing.T) { - actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName" + actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseExpressRoutePortsLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "locationName", + ExpressRoutePortsLocationName: "expressRoutePortsLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseExpressRoutePortsLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "locationName", + ExpressRoutePortsLocationName: "expressRoutePortsLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/lOcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnNaMe", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "lOcAtIoNnAmE", + ExpressRoutePortsLocationName: "eXpReSsRoUtEpOrTsLoCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/lOcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/expressrouteproviderports/README.md b/resource-manager/network/2024-01-01/expressrouteproviderports/README.md index ca3cb3c9904..b481d7427af 100644 --- a/resource-manager/network/2024-01-01/expressrouteproviderports/README.md +++ b/resource-manager/network/2024-01-01/expressrouteproviderports/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport") +id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName") read, err := client.ExpressRouteProviderPort(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/expressrouteproviderports/id_expressrouteproviderport.go b/resource-manager/network/2024-01-01/expressrouteproviderports/id_expressrouteproviderport.go index 866b4c25f4f..142c36fee12 100644 --- a/resource-manager/network/2024-01-01/expressrouteproviderports/id_expressrouteproviderport.go +++ b/resource-manager/network/2024-01-01/expressrouteproviderports/id_expressrouteproviderport.go @@ -107,7 +107,7 @@ func (id ExpressRouteProviderPortId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteProviderPorts", "expressRouteProviderPorts", "expressRouteProviderPorts"), - resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "providerport"), + resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "expressRouteProviderPortName"), } } diff --git a/resource-manager/network/2024-01-01/expressrouteproviderports/id_expressrouteproviderport_test.go b/resource-manager/network/2024-01-01/expressrouteproviderports/id_expressrouteproviderport_test.go index 980dfd0f387..04d9684f23d 100644 --- a/resource-manager/network/2024-01-01/expressrouteproviderports/id_expressrouteproviderport_test.go +++ b/resource-manager/network/2024-01-01/expressrouteproviderports/id_expressrouteproviderport_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ExpressRouteProviderPortId{} func TestNewExpressRouteProviderPortID(t *testing.T) { - id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport") + id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ExpressRouteProviderPortName != "providerport" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "providerport") + if id.ExpressRouteProviderPortName != "expressRouteProviderPortName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "expressRouteProviderPortName") } } func TestFormatExpressRouteProviderPortID(t *testing.T) { - actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport" + actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseExpressRouteProviderPortID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "providerport", + ExpressRouteProviderPortName: "expressRouteProviderPortName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseExpressRouteProviderPortIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "providerport", + ExpressRouteProviderPortName: "expressRouteProviderPortName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/pRoViDeRpOrT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTnAmE", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "pRoViDeRpOrT", + ExpressRouteProviderPortName: "eXpReSsRoUtEpRoViDeRpOrTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/pRoViDeRpOrT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/firewallpolicies/model_applicationrule.go b/resource-manager/network/2024-01-01/firewallpolicies/model_applicationrule.go index f7d2f0c3f47..151ed288bae 100644 --- a/resource-manager/network/2024-01-01/firewallpolicies/model_applicationrule.go +++ b/resource-manager/network/2024-01-01/firewallpolicies/model_applicationrule.go @@ -18,7 +18,7 @@ type ApplicationRule struct { SourceAddresses *[]string `json:"sourceAddresses,omitempty"` SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` + TargetURLs *[]string `json:"targetUrls,omitempty"` TerminateTLS *bool `json:"terminateTLS,omitempty"` WebCategories *[]string `json:"webCategories,omitempty"` diff --git a/resource-manager/network/2024-01-01/firewallpolicyrulecollectiongroups/model_applicationrule.go b/resource-manager/network/2024-01-01/firewallpolicyrulecollectiongroups/model_applicationrule.go index 00f2de60a64..1684b7ab31b 100644 --- a/resource-manager/network/2024-01-01/firewallpolicyrulecollectiongroups/model_applicationrule.go +++ b/resource-manager/network/2024-01-01/firewallpolicyrulecollectiongroups/model_applicationrule.go @@ -18,7 +18,7 @@ type ApplicationRule struct { SourceAddresses *[]string `json:"sourceAddresses,omitempty"` SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` + TargetURLs *[]string `json:"targetUrls,omitempty"` TerminateTLS *bool `json:"terminateTLS,omitempty"` WebCategories *[]string `json:"webCategories,omitempty"` diff --git a/resource-manager/network/2024-01-01/ipgroups/README.md b/resource-manager/network/2024-01-01/ipgroups/README.md index 70a97fd9bf1..b5e666fa9a4 100644 --- a/resource-manager/network/2024-01-01/ipgroups/README.md +++ b/resource-manager/network/2024-01-01/ipgroups/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") payload := ipgroups.IPGroup{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") read, err := client.Get(ctx, id, ipgroups.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") payload := ipgroups.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/ipgroups/id_ipgroup.go b/resource-manager/network/2024-01-01/ipgroups/id_ipgroup.go index 255122bcafc..441c7301b56 100644 --- a/resource-manager/network/2024-01-01/ipgroups/id_ipgroup.go +++ b/resource-manager/network/2024-01-01/ipgroups/id_ipgroup.go @@ -115,7 +115,7 @@ func (id IPGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticIpGroups", "ipGroups", "ipGroups"), - resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupsName"), + resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupName"), } } diff --git a/resource-manager/network/2024-01-01/ipgroups/id_ipgroup_test.go b/resource-manager/network/2024-01-01/ipgroups/id_ipgroup_test.go index 0dee23413e1..e590c1f6bc7 100644 --- a/resource-manager/network/2024-01-01/ipgroups/id_ipgroup_test.go +++ b/resource-manager/network/2024-01-01/ipgroups/id_ipgroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IPGroupId{} func TestNewIPGroupID(t *testing.T) { - id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") + id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewIPGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.IpGroupName != "ipGroupsName" { - t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupsName") + if id.IpGroupName != "ipGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupName") } } func TestFormatIPGroupID(t *testing.T) { - actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName" + actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseIPGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupsName", + IpGroupName: "ipGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseIPGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupsName", + IpGroupName: "ipGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpNaMe", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IpGroupName: "iPgRoUpSnAmE", + IpGroupName: "iPgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/loadbalancers/README.md b/resource-manager/network/2024-01-01/loadbalancers/README.md index eb2df6be664..48c77bfc3ce 100644 --- a/resource-manager/network/2024-01-01/loadbalancers/README.md +++ b/resource-manager/network/2024-01-01/loadbalancers/README.md @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName") +id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName") payload := loadbalancers.QueryInboundNatRulePortMappingRequest{ // ... @@ -394,7 +394,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName") +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName") payload := loadbalancers.MigrateLoadBalancerToIPBasedRequest{ // ... @@ -415,7 +415,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loadbalancers.LoadBalancerVipSwapRequest{ // ... diff --git a/resource-manager/network/2024-01-01/loadbalancers/id_backendaddresspool.go b/resource-manager/network/2024-01-01/loadbalancers/id_backendaddresspool.go index 8ed580c9198..9984348c234 100644 --- a/resource-manager/network/2024-01-01/loadbalancers/id_backendaddresspool.go +++ b/resource-manager/network/2024-01-01/loadbalancers/id_backendaddresspool.go @@ -117,13 +117,13 @@ func (id BackendAddressPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerName"), resourceids.StaticSegment("staticBackendAddressPools", "backendAddressPools", "backendAddressPools"), - resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendPoolName"), + resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendAddressPoolName"), } } diff --git a/resource-manager/network/2024-01-01/loadbalancers/id_backendaddresspool_test.go b/resource-manager/network/2024-01-01/loadbalancers/id_backendaddresspool_test.go index 3a2671f5985..b8334fde60c 100644 --- a/resource-manager/network/2024-01-01/loadbalancers/id_backendaddresspool_test.go +++ b/resource-manager/network/2024-01-01/loadbalancers/id_backendaddresspool_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &BackendAddressPoolId{} func TestNewBackendAddressPoolID(t *testing.T) { - id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName") + id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.LoadBalancerName != "loadBalancerName" { t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerName") } - if id.BackendAddressPoolName != "backendPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendPoolName") + if id.BackendAddressPoolName != "backendAddressPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendAddressPoolName") } } func TestFormatBackendAddressPoolID(t *testing.T) { - actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName" + actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseBackendAddressPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", - BackendAddressPoolName: "backendPoolName", + BackendAddressPoolName: "backendAddressPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseBackendAddressPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", - BackendAddressPoolName: "backendPoolName", + BackendAddressPoolName: "backendAddressPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLnAmE", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", LoadBalancerName: "lOaDbAlAnCeRnAmE", - BackendAddressPoolName: "bAcKeNdPoOlNaMe", + BackendAddressPoolName: "bAcKeNdAdDrEsSpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/loadbalancers/id_loadbalancer.go b/resource-manager/network/2024-01-01/loadbalancers/id_loadbalancer.go index ef69db4bf71..61207d17d8d 100644 --- a/resource-manager/network/2024-01-01/loadbalancers/id_loadbalancer.go +++ b/resource-manager/network/2024-01-01/loadbalancers/id_loadbalancer.go @@ -111,7 +111,7 @@ func (id LoadBalancerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), diff --git a/resource-manager/network/2024-01-01/loadbalancers/id_loadbalancer_test.go b/resource-manager/network/2024-01-01/loadbalancers/id_loadbalancer_test.go index 25fcce5b649..5e02836d140 100644 --- a/resource-manager/network/2024-01-01/loadbalancers/id_loadbalancer_test.go +++ b/resource-manager/network/2024-01-01/loadbalancers/id_loadbalancer_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LoadBalancerId{} func TestNewLoadBalancerID(t *testing.T) { - id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName") + id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.LoadBalancerName != "loadBalancerName" { @@ -28,8 +28,8 @@ func TestNewLoadBalancerID(t *testing.T) { } func TestFormatLoadBalancerID(t *testing.T) { - actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName" + actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseLoadBalancerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseLoadBalancerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", LoadBalancerName: "lOaDbAlAnCeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/loadbalancers/id_location.go b/resource-manager/network/2024-01-01/loadbalancers/id_location.go index 06ff0a743e6..b6cfa4c67ba 100644 --- a/resource-manager/network/2024-01-01/loadbalancers/id_location.go +++ b/resource-manager/network/2024-01-01/loadbalancers/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/loadbalancers/id_location_test.go b/resource-manager/network/2024-01-01/loadbalancers/id_location_test.go index 97e523fbcc4..c15a4a4b124 100644 --- a/resource-manager/network/2024-01-01/loadbalancers/id_location_test.go +++ b/resource-manager/network/2024-01-01/loadbalancers/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/networkinterfaces/README.md b/resource-manager/network/2024-01-01/networkinterfaces/README.md index 8c38795e15f..88c2cef3ead 100644 --- a/resource-manager/network/2024-01-01/networkinterfaces/README.md +++ b/resource-manager/network/2024-01-01/networkinterfaces/README.md @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName") +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName") read, err := client.GetVirtualMachineScaleSetIPConfiguration(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions()) if err != nil { @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName") +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName") read, err := client.GetVirtualMachineScaleSetNetworkInterface(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions()) if err != nil { @@ -220,7 +220,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName") +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName") // alternatively `client.ListVirtualMachineScaleSetIPConfigurations(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions())` can be used to do batched pagination items, err := client.ListVirtualMachineScaleSetIPConfigurationsComplete(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions()) @@ -254,7 +254,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex") +id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName") // alternatively `client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id)` can be used to do batched pagination items, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx, id) @@ -317,6 +317,35 @@ for _, item := range items { ``` +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsCreateOrUpdate` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceName", "tapConfigurationName") + +payload := networkinterfaces.NetworkInterfaceTapConfiguration{ + // ... +} + + +if err := client.NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsDelete` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceName", "tapConfigurationName") + +if err := client.NetworkInterfaceTapConfigurationsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + ### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsGet` ```go diff --git a/resource-manager/network/2024-01-01/networkinterfaces/id_virtualmachine.go b/resource-manager/network/2024-01-01/networkinterfaces/id_virtualmachine.go index 3e8bac23fd1..ad24ef16d81 100644 --- a/resource-manager/network/2024-01-01/networkinterfaces/id_virtualmachine.go +++ b/resource-manager/network/2024-01-01/networkinterfaces/id_virtualmachine.go @@ -123,7 +123,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "virtualmachineIndex"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/network/2024-01-01/networkinterfaces/id_virtualmachine_test.go b/resource-manager/network/2024-01-01/networkinterfaces/id_virtualmachine_test.go index 612c4ecdd69..cb6aa2f9476 100644 --- a/resource-manager/network/2024-01-01/networkinterfaces/id_virtualmachine_test.go +++ b/resource-manager/network/2024-01-01/networkinterfaces/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.VirtualMachineName != "virtualmachineIndex" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualmachineIndex") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - VirtualMachineName: "virtualmachineIndex", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - VirtualMachineName: "virtualmachineIndex", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEiNdEx", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - VirtualMachineName: "vIrTuAlMaChInEiNdEx", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEiNdEx/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go b/resource-manager/network/2024-01-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go new file mode 100644 index 00000000000..fcece2ea104 --- /dev/null +++ b/resource-manager/network/2024-01-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go @@ -0,0 +1,75 @@ +package networkinterfaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceTapConfigurationsCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *NetworkInterfaceTapConfiguration +} + +// NetworkInterfaceTapConfigurationsCreateOrUpdate ... +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsCreateOrUpdate(ctx context.Context, id TapConfigurationId, input NetworkInterfaceTapConfiguration) (result NetworkInterfaceTapConfigurationsCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll performs NetworkInterfaceTapConfigurationsCreateOrUpdate then polls until it's completed +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll(ctx context.Context, id TapConfigurationId, input NetworkInterfaceTapConfiguration) error { + result, err := c.NetworkInterfaceTapConfigurationsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing NetworkInterfaceTapConfigurationsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after NetworkInterfaceTapConfigurationsCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2024-01-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go b/resource-manager/network/2024-01-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go new file mode 100644 index 00000000000..263815906b2 --- /dev/null +++ b/resource-manager/network/2024-01-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go @@ -0,0 +1,71 @@ +package networkinterfaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceTapConfigurationsDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// NetworkInterfaceTapConfigurationsDelete ... +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsDelete(ctx context.Context, id TapConfigurationId) (result NetworkInterfaceTapConfigurationsDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// NetworkInterfaceTapConfigurationsDeleteThenPoll performs NetworkInterfaceTapConfigurationsDelete then polls until it's completed +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsDeleteThenPoll(ctx context.Context, id TapConfigurationId) error { + result, err := c.NetworkInterfaceTapConfigurationsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing NetworkInterfaceTapConfigurationsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after NetworkInterfaceTapConfigurationsDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2024-01-01/networkvirtualappliances/README.md b/resource-manager/network/2024-01-01/networkvirtualappliances/README.md index 9cc2eac17cf..28d5b32f013 100644 --- a/resource-manager/network/2024-01-01/networkvirtualappliances/README.md +++ b/resource-manager/network/2024-01-01/networkvirtualappliances/README.md @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") +id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") payload := networkvirtualappliances.InboundSecurityRule{ // ... @@ -87,7 +87,7 @@ if err := client.InboundSecurityRuleCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") +id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") read, err := client.InboundSecurityRuleGet(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/networkvirtualappliances/id_inboundsecurityrule.go b/resource-manager/network/2024-01-01/networkvirtualappliances/id_inboundsecurityrule.go index d59b8c173b5..4da7242be6d 100644 --- a/resource-manager/network/2024-01-01/networkvirtualappliances/id_inboundsecurityrule.go +++ b/resource-manager/network/2024-01-01/networkvirtualappliances/id_inboundsecurityrule.go @@ -123,7 +123,7 @@ func (id InboundSecurityRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticInboundSecurityRules", "inboundSecurityRules", "inboundSecurityRules"), - resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "ruleCollectionName"), + resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "inboundSecurityRuleName"), } } diff --git a/resource-manager/network/2024-01-01/networkvirtualappliances/id_inboundsecurityrule_test.go b/resource-manager/network/2024-01-01/networkvirtualappliances/id_inboundsecurityrule_test.go index a4a396742df..b953b2aa90d 100644 --- a/resource-manager/network/2024-01-01/networkvirtualappliances/id_inboundsecurityrule_test.go +++ b/resource-manager/network/2024-01-01/networkvirtualappliances/id_inboundsecurityrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InboundSecurityRuleId{} func TestNewInboundSecurityRuleID(t *testing.T) { - id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") + id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewInboundSecurityRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.InboundSecurityRuleName != "ruleCollectionName" { - t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "ruleCollectionName") + if id.InboundSecurityRuleName != "inboundSecurityRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "inboundSecurityRuleName") } } func TestFormatInboundSecurityRuleID(t *testing.T) { - actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName" + actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseInboundSecurityRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - InboundSecurityRuleName: "ruleCollectionName", + InboundSecurityRuleName: "inboundSecurityRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseInboundSecurityRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - InboundSecurityRuleName: "ruleCollectionName", + InboundSecurityRuleName: "inboundSecurityRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeNaMe", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - InboundSecurityRuleName: "rUlEcOlLeCtIoNnAmE", + InboundSecurityRuleName: "iNbOuNdSeCuRiTyRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/p2svpngateways/README.md b/resource-manager/network/2024-01-01/p2svpngateways/README.md index d2ee967a1ad..d70ddf13600 100644 --- a/resource-manager/network/2024-01-01/p2svpngateways/README.md +++ b/resource-manager/network/2024-01-01/p2svpngateways/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnConnectionRequest{ // ... @@ -42,7 +42,7 @@ if err := client.DisconnectP2sVpnConnectionsThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnProfileParameters{ // ... @@ -59,7 +59,7 @@ if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnConnectionHealthRequest{ // ... @@ -88,7 +88,7 @@ if err := client.GetP2sVpnConnectionHealthDetailedThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.ResetThenPoll(ctx, id); err != nil { // handle the error @@ -100,7 +100,7 @@ if err := client.ResetThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/p2svpngateways/model_p2svpnconnectionhealth.go b/resource-manager/network/2024-01-01/p2svpngateways/model_p2svpnconnectionhealth.go index 42b227bbf63..d7e951d0d0a 100644 --- a/resource-manager/network/2024-01-01/p2svpngateways/model_p2svpnconnectionhealth.go +++ b/resource-manager/network/2024-01-01/p2svpngateways/model_p2svpnconnectionhealth.go @@ -4,5 +4,5 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type P2SVpnConnectionHealth struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-01-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go b/resource-manager/network/2024-01-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go index d0cd806bd05..cb5094a7b15 100644 --- a/resource-manager/network/2024-01-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go +++ b/resource-manager/network/2024-01-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go @@ -4,6 +4,6 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type P2SVpnConnectionHealthRequest struct { - OutputBlobSasUrl *string `json:"outputBlobSasUrl,omitempty"` + OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"` } diff --git a/resource-manager/network/2024-01-01/p2svpngateways/model_vpnprofileresponse.go b/resource-manager/network/2024-01-01/p2svpngateways/model_vpnprofileresponse.go index 55f4d81d16c..3d26db7265b 100644 --- a/resource-manager/network/2024-01-01/p2svpngateways/model_vpnprofileresponse.go +++ b/resource-manager/network/2024-01-01/p2svpngateways/model_vpnprofileresponse.go @@ -4,5 +4,5 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` } diff --git a/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/README.md b/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/README.md index e1e8c80d9bd..1a0d8a4ea9a 100644 --- a/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/README.md +++ b/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/id_peerconnection.go b/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/id_peerconnection.go index 4c26579b339..4819211effd 100644 --- a/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/id_peerconnection.go +++ b/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/id_peerconnection.go @@ -127,11 +127,11 @@ func (id PeerConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticPeerConnections", "peerConnections", "peerConnections"), - resourceids.UserSpecifiedSegment("peerConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("peerConnectionName", "peerConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/id_peerconnection_test.go b/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/id_peerconnection_test.go index a6434909377..578fee6fb85 100644 --- a/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/id_peerconnection_test.go +++ b/resource-manager/network/2024-01-01/peerexpressroutecircuitconnections/id_peerconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeerConnectionId{} func TestNewPeerConnectionID(t *testing.T) { - id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") + id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeerConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.PeerConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "connectionName") + if id.PeerConnectionName != "peerConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "peerConnectionName") } } func TestFormatPeerConnectionID(t *testing.T) { - actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName" + actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeerConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - PeerConnectionName: "connectionName", + PeerConnectionName: "peerConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeerConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - PeerConnectionName: "connectionName", + PeerConnectionName: "peerConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNnAmE", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - PeerConnectionName: "cOnNeCtIoNnAmE", + PeerConnectionName: "pEeRcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/privateendpoints/README.md b/resource-manager/network/2024-01-01/privateendpoints/README.md index 4358d349a85..2523d53bb15 100644 --- a/resource-manager/network/2024-01-01/privateendpoints/README.md +++ b/resource-manager/network/2024-01-01/privateendpoints/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id) @@ -42,7 +42,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/privateendpoints/id_location.go b/resource-manager/network/2024-01-01/privateendpoints/id_location.go index f90051a6725..77d85ed86a2 100644 --- a/resource-manager/network/2024-01-01/privateendpoints/id_location.go +++ b/resource-manager/network/2024-01-01/privateendpoints/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/privateendpoints/id_location_test.go b/resource-manager/network/2024-01-01/privateendpoints/id_location_test.go index de6ecb243b3..aff4982b728 100644 --- a/resource-manager/network/2024-01-01/privateendpoints/id_location_test.go +++ b/resource-manager/network/2024-01-01/privateendpoints/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/privateendpoints/id_providerlocation.go b/resource-manager/network/2024-01-01/privateendpoints/id_providerlocation.go index cb389eabe34..5bf08d4e861 100644 --- a/resource-manager/network/2024-01-01/privateendpoints/id_providerlocation.go +++ b/resource-manager/network/2024-01-01/privateendpoints/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/privateendpoints/id_providerlocation_test.go b/resource-manager/network/2024-01-01/privateendpoints/id_providerlocation_test.go index 17c34f07818..ddd96efab6c 100644 --- a/resource-manager/network/2024-01-01/privateendpoints/id_providerlocation_test.go +++ b/resource-manager/network/2024-01-01/privateendpoints/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/privatelinkservices/README.md b/resource-manager/network/2024-01-01/privatelinkservices/README.md index bf7fd5e0402..5d27f351041 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/README.md +++ b/resource-manager/network/2024-01-01/privatelinkservices/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ // ... @@ -42,7 +42,7 @@ if err := client.CheckPrivateLinkServiceVisibilityThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ // ... @@ -59,7 +59,7 @@ if err := client.CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx, i ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") payload := privatelinkservices.PrivateLinkService{ // ... @@ -76,7 +76,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -88,7 +88,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -100,7 +100,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") read, err := client.Get(ctx, id, privatelinkservices.DefaultGetOperationOptions()) if err != nil { @@ -116,7 +116,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id, privatelinkservices.DefaultGetPrivateEndpointConnectionOperationOptions()) if err != nil { @@ -149,7 +149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListAutoApprovedPrivateLinkServices(ctx, id)` can be used to do batched pagination items, err := client.ListAutoApprovedPrivateLinkServicesComplete(ctx, id) @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx, id) @@ -200,7 +200,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") // alternatively `client.ListPrivateEndpointConnections(ctx, id)` can be used to do batched pagination items, err := client.ListPrivateEndpointConnectionsComplete(ctx, id) @@ -217,7 +217,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") payload := privatelinkservices.PrivateEndpointConnection{ // ... diff --git a/resource-manager/network/2024-01-01/privatelinkservices/id_location.go b/resource-manager/network/2024-01-01/privatelinkservices/id_location.go index c2338e0d7ee..ad61efbce7f 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/id_location.go +++ b/resource-manager/network/2024-01-01/privatelinkservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/privatelinkservices/id_location_test.go b/resource-manager/network/2024-01-01/privatelinkservices/id_location_test.go index c7b93b9c65d..56fdbbb4ab0 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/id_location_test.go +++ b/resource-manager/network/2024-01-01/privatelinkservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/privatelinkservices/id_privateendpointconnection.go b/resource-manager/network/2024-01-01/privatelinkservices/id_privateendpointconnection.go index 0bb8766006b..3f1f439928b 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/id_privateendpointconnection.go +++ b/resource-manager/network/2024-01-01/privatelinkservices/id_privateendpointconnection.go @@ -121,9 +121,9 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "peConnectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/privatelinkservices/id_privateendpointconnection_test.go b/resource-manager/network/2024-01-01/privatelinkservices/id_privateendpointconnection_test.go index e82d28f6306..b76fddc6e1b 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/id_privateendpointconnection_test.go +++ b/resource-manager/network/2024-01-01/privatelinkservices/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "serviceName") + if id.PrivateLinkServiceName != "privateLinkServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceName") } - if id.PrivateEndpointConnectionName != "peConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "peConnectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", - PrivateEndpointConnectionName: "peConnectionName", + PrivateLinkServiceName: "privateLinkServiceName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", - PrivateEndpointConnectionName: "peConnectionName", + PrivateLinkServiceName: "privateLinkServiceName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "sErViCeNaMe", - PrivateEndpointConnectionName: "pEcOnNeCtIoNnAmE", + PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/privatelinkservices/id_privatelinkservice.go b/resource-manager/network/2024-01-01/privatelinkservices/id_privatelinkservice.go index c093bc5f0e7..d691d1eded6 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/id_privatelinkservice.go +++ b/resource-manager/network/2024-01-01/privatelinkservices/id_privatelinkservice.go @@ -115,7 +115,7 @@ func (id PrivateLinkServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceName"), } } diff --git a/resource-manager/network/2024-01-01/privatelinkservices/id_privatelinkservice_test.go b/resource-manager/network/2024-01-01/privatelinkservices/id_privatelinkservice_test.go index 43aa7b6b80a..bccc5172aaf 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/id_privatelinkservice_test.go +++ b/resource-manager/network/2024-01-01/privatelinkservices/id_privatelinkservice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkServiceId{} func TestNewPrivateLinkServiceID(t *testing.T) { - id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") + id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "serviceName") + if id.PrivateLinkServiceName != "privateLinkServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceName") } } func TestFormatPrivateLinkServiceID(t *testing.T) { - actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName" + actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", + PrivateLinkServiceName: "privateLinkServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", + PrivateLinkServiceName: "privateLinkServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "sErViCeNaMe", + PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/privatelinkservices/id_providerlocation.go b/resource-manager/network/2024-01-01/privatelinkservices/id_providerlocation.go index 929b9472fbc..706ab2680a9 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/id_providerlocation.go +++ b/resource-manager/network/2024-01-01/privatelinkservices/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/privatelinkservices/id_providerlocation_test.go b/resource-manager/network/2024-01-01/privatelinkservices/id_providerlocation_test.go index 77653638cf4..1565dd828b1 100644 --- a/resource-manager/network/2024-01-01/privatelinkservices/id_providerlocation_test.go +++ b/resource-manager/network/2024-01-01/privatelinkservices/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/publicipaddresses/README.md b/resource-manager/network/2024-01-01/publicipaddresses/README.md index 13bf49f56cb..b982bc7cb59 100644 --- a/resource-manager/network/2024-01-01/publicipaddresses/README.md +++ b/resource-manager/network/2024-01-01/publicipaddresses/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") payload := publicipaddresses.PublicIPAddress{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") read, err := client.Get(ctx, id, publicipaddresses.DefaultGetOperationOptions()) if err != nil { @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") payload := publicipaddresses.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/publicipprefixes/README.md b/resource-manager/network/2024-01-01/publicipprefixes/README.md index 2857850e019..a7e06d6fdb1 100644 --- a/resource-manager/network/2024-01-01/publicipprefixes/README.md +++ b/resource-manager/network/2024-01-01/publicipprefixes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") payload := publicipprefixes.PublicIPPrefix{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") payload := publicipprefixes.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/publicipprefixes/id_publicipprefix.go b/resource-manager/network/2024-01-01/publicipprefixes/id_publicipprefix.go index ba849d0aad0..35801814a57 100644 --- a/resource-manager/network/2024-01-01/publicipprefixes/id_publicipprefix.go +++ b/resource-manager/network/2024-01-01/publicipprefixes/id_publicipprefix.go @@ -115,7 +115,7 @@ func (id PublicIPPrefixId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPublicIPPrefixes", "publicIPPrefixes", "publicIPPrefixes"), - resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIpPrefixName"), + resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIPPrefixName"), } } diff --git a/resource-manager/network/2024-01-01/publicipprefixes/id_publicipprefix_test.go b/resource-manager/network/2024-01-01/publicipprefixes/id_publicipprefix_test.go index c19356dcda1..267591b6714 100644 --- a/resource-manager/network/2024-01-01/publicipprefixes/id_publicipprefix_test.go +++ b/resource-manager/network/2024-01-01/publicipprefixes/id_publicipprefix_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PublicIPPrefixId{} func TestNewPublicIPPrefixID(t *testing.T) { - id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") + id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPublicIPPrefixID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PublicIPPrefixName != "publicIpPrefixName" { - t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIpPrefixName") + if id.PublicIPPrefixName != "publicIPPrefixName" { + t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIPPrefixName") } } func TestFormatPublicIPPrefixID(t *testing.T) { - actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName" + actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePublicIPPrefixID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName", Expected: &PublicIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIpPrefixName", + PublicIPPrefixName: "publicIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParsePublicIPPrefixIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName", Expected: &PublicIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIpPrefixName", + PublicIPPrefixName: "publicIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName/extra", Error: true, }, { diff --git a/resource-manager/network/2024-01-01/routefilterrules/README.md b/resource-manager/network/2024-01-01/routefilterrules/README.md index 5aa99071306..be8fe4555f6 100644 --- a/resource-manager/network/2024-01-01/routefilterrules/README.md +++ b/resource-manager/network/2024-01-01/routefilterrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") payload := routefilterrules.RouteFilterRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/routefilterrules/id_routefilterrule.go b/resource-manager/network/2024-01-01/routefilterrules/id_routefilterrule.go index 120d8a966e0..d06e7791dfc 100644 --- a/resource-manager/network/2024-01-01/routefilterrules/id_routefilterrule.go +++ b/resource-manager/network/2024-01-01/routefilterrules/id_routefilterrule.go @@ -123,7 +123,7 @@ func (id RouteFilterRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterName"), resourceids.StaticSegment("staticRouteFilterRules", "routeFilterRules", "routeFilterRules"), - resourceids.UserSpecifiedSegment("routeFilterRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("routeFilterRuleName", "routeFilterRuleName"), } } diff --git a/resource-manager/network/2024-01-01/routefilterrules/id_routefilterrule_test.go b/resource-manager/network/2024-01-01/routefilterrules/id_routefilterrule_test.go index b0d5daed59a..4a52969db44 100644 --- a/resource-manager/network/2024-01-01/routefilterrules/id_routefilterrule_test.go +++ b/resource-manager/network/2024-01-01/routefilterrules/id_routefilterrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteFilterRuleId{} func TestNewRouteFilterRuleID(t *testing.T) { - id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") + id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRouteFilterRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterName") } - if id.RouteFilterRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "ruleName") + if id.RouteFilterRuleName != "routeFilterRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "routeFilterRuleName") } } func TestFormatRouteFilterRuleID(t *testing.T) { - actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName" + actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRouteFilterRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RouteFilterName: "routeFilterName", - RouteFilterRuleName: "ruleName", + RouteFilterRuleName: "routeFilterRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRouteFilterRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RouteFilterName: "routeFilterName", - RouteFilterRuleName: "ruleName", + RouteFilterRuleName: "routeFilterRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeNaMe", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RouteFilterName: "rOuTeFiLtErNaMe", - RouteFilterRuleName: "rUlEnAmE", + RouteFilterRuleName: "rOuTeFiLtErRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/securityadminconfigurations/README.md b/resource-manager/network/2024-01-01/securityadminconfigurations/README.md index e054a298148..4fcbf8bab91 100644 --- a/resource-manager/network/2024-01-01/securityadminconfigurations/README.md +++ b/resource-manager/network/2024-01-01/securityadminconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") payload := securityadminconfigurations.SecurityAdminConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDele ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/securityadminconfigurations/id_securityadminconfiguration.go b/resource-manager/network/2024-01-01/securityadminconfigurations/id_securityadminconfiguration.go index 30b23886bf3..070ef0fa83e 100644 --- a/resource-manager/network/2024-01-01/securityadminconfigurations/id_securityadminconfiguration.go +++ b/resource-manager/network/2024-01-01/securityadminconfigurations/id_securityadminconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityAdminConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), } } diff --git a/resource-manager/network/2024-01-01/securityadminconfigurations/id_securityadminconfiguration_test.go b/resource-manager/network/2024-01-01/securityadminconfigurations/id_securityadminconfiguration_test.go index 2e644cd781d..66fc3677b11 100644 --- a/resource-manager/network/2024-01-01/securityadminconfigurations/id_securityadminconfiguration_test.go +++ b/resource-manager/network/2024-01-01/securityadminconfigurations/id_securityadminconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityAdminConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } } func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName" + actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityAdminConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/servicetags/README.md b/resource-manager/network/2024-01-01/servicetags/README.md index 355bf4753c7..62f7855dfee 100644 --- a/resource-manager/network/2024-01-01/servicetags/README.md +++ b/resource-manager/network/2024-01-01/servicetags/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ServiceTagInformationList(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions())` can be used to do batched pagination items, err := client.ServiceTagInformationListComplete(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ServiceTagsList(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/servicetags/id_location.go b/resource-manager/network/2024-01-01/servicetags/id_location.go index 82d35d1f77c..5040a3f420a 100644 --- a/resource-manager/network/2024-01-01/servicetags/id_location.go +++ b/resource-manager/network/2024-01-01/servicetags/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/servicetags/id_location_test.go b/resource-manager/network/2024-01-01/servicetags/id_location_test.go index bb87f65c1d0..003c4b42ddf 100644 --- a/resource-manager/network/2024-01-01/servicetags/id_location_test.go +++ b/resource-manager/network/2024-01-01/servicetags/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/usages/README.md b/resource-manager/network/2024-01-01/usages/README.md index ca4a3235ff4..8643554653e 100644 --- a/resource-manager/network/2024-01-01/usages/README.md +++ b/resource-manager/network/2024-01-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/usages/id_location.go b/resource-manager/network/2024-01-01/usages/id_location.go index 2fe99ba303b..5f505126c1e 100644 --- a/resource-manager/network/2024-01-01/usages/id_location.go +++ b/resource-manager/network/2024-01-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-01-01/usages/id_location_test.go b/resource-manager/network/2024-01-01/usages/id_location_test.go index b3c8d46ad6a..8b2dce92bff 100644 --- a/resource-manager/network/2024-01-01/usages/id_location_test.go +++ b/resource-manager/network/2024-01-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/vipswap/README.md b/resource-manager/network/2024-01-01/vipswap/README.md index a0e2ed61cbd..6889f3ebe00 100644 --- a/resource-manager/network/2024-01-01/vipswap/README.md +++ b/resource-manager/network/2024-01-01/vipswap/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") payload := vipswap.SwapResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/vipswap/id_cloudservice.go b/resource-manager/network/2024-01-01/vipswap/id_cloudservice.go index 0b7dd65e3bd..93c12d9c01d 100644 --- a/resource-manager/network/2024-01-01/vipswap/id_cloudservice.go +++ b/resource-manager/network/2024-01-01/vipswap/id_cloudservice.go @@ -111,11 +111,11 @@ func (id CloudServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceName"), } } diff --git a/resource-manager/network/2024-01-01/vipswap/id_cloudservice_test.go b/resource-manager/network/2024-01-01/vipswap/id_cloudservice_test.go index ffca7a5d07d..4bc26e07dc5 100644 --- a/resource-manager/network/2024-01-01/vipswap/id_cloudservice_test.go +++ b/resource-manager/network/2024-01-01/vipswap/id_cloudservice_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CloudServiceId{} func TestNewCloudServiceID(t *testing.T) { - id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") + id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } - if id.CloudServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "resourceName") + if id.CloudServiceName != "cloudServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceName") } } func TestFormatCloudServiceID(t *testing.T) { - actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName" + actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseCloudServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", - CloudServiceName: "resourceName", + ResourceGroupName: "resourceGroupName", + CloudServiceName: "cloudServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseCloudServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", - CloudServiceName: "resourceName", + ResourceGroupName: "resourceGroupName", + CloudServiceName: "cloudServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEnAmE", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", - CloudServiceName: "rEsOuRcEnAmE", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", + CloudServiceName: "cLoUdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualappliancesites/README.md b/resource-manager/network/2024-01-01/virtualappliancesites/README.md index 184e5997072..d13186d12be 100644 --- a/resource-manager/network/2024-01-01/virtualappliancesites/README.md +++ b/resource-manager/network/2024-01-01/virtualappliancesites/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") payload := virtualappliancesites.VirtualApplianceSite{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/virtualappliancesites/id_virtualappliancesite.go b/resource-manager/network/2024-01-01/virtualappliancesites/id_virtualappliancesite.go index 87e626d1b0c..592f4f47427 100644 --- a/resource-manager/network/2024-01-01/virtualappliancesites/id_virtualappliancesite.go +++ b/resource-manager/network/2024-01-01/virtualappliancesites/id_virtualappliancesite.go @@ -123,7 +123,7 @@ func (id VirtualApplianceSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticVirtualApplianceSites", "virtualApplianceSites", "virtualApplianceSites"), - resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "siteName"), + resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "virtualApplianceSiteName"), } } diff --git a/resource-manager/network/2024-01-01/virtualappliancesites/id_virtualappliancesite_test.go b/resource-manager/network/2024-01-01/virtualappliancesites/id_virtualappliancesite_test.go index ffff3d499f0..672639aa072 100644 --- a/resource-manager/network/2024-01-01/virtualappliancesites/id_virtualappliancesite_test.go +++ b/resource-manager/network/2024-01-01/virtualappliancesites/id_virtualappliancesite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualApplianceSiteId{} func TestNewVirtualApplianceSiteID(t *testing.T) { - id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") + id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualApplianceSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.VirtualApplianceSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "siteName") + if id.VirtualApplianceSiteName != "virtualApplianceSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "virtualApplianceSiteName") } } func TestFormatVirtualApplianceSiteID(t *testing.T) { - actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName" + actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualApplianceSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - VirtualApplianceSiteName: "siteName", + VirtualApplianceSiteName: "virtualApplianceSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualApplianceSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - VirtualApplianceSiteName: "siteName", + VirtualApplianceSiteName: "virtualApplianceSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEnAmE", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - VirtualApplianceSiteName: "sItEnAmE", + VirtualApplianceSiteName: "vIrTuAlApPlIaNcEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualapplianceskus/README.md b/resource-manager/network/2024-01-01/virtualapplianceskus/README.md index d627f20094d..8baaf7cd71e 100644 --- a/resource-manager/network/2024-01-01/virtualapplianceskus/README.md +++ b/resource-manager/network/2024-01-01/virtualapplianceskus/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName") +id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/virtualapplianceskus/id_networkvirtualappliancesku.go b/resource-manager/network/2024-01-01/virtualapplianceskus/id_networkvirtualappliancesku.go index 46855c565e3..5eb920193a9 100644 --- a/resource-manager/network/2024-01-01/virtualapplianceskus/id_networkvirtualappliancesku.go +++ b/resource-manager/network/2024-01-01/virtualapplianceskus/id_networkvirtualappliancesku.go @@ -107,7 +107,7 @@ func (id NetworkVirtualApplianceSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticNetworkVirtualApplianceSkus", "networkVirtualApplianceSkus", "networkVirtualApplianceSkus"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "skuName"), + resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "networkVirtualApplianceSkuName"), } } diff --git a/resource-manager/network/2024-01-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go b/resource-manager/network/2024-01-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go index 6901430cd2e..7ca3e924a1e 100644 --- a/resource-manager/network/2024-01-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go +++ b/resource-manager/network/2024-01-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &NetworkVirtualApplianceSkuId{} func TestNewNetworkVirtualApplianceSkuID(t *testing.T) { - id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName") + id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.NetworkVirtualApplianceSkuName != "skuName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "skuName") + if id.NetworkVirtualApplianceSkuName != "networkVirtualApplianceSkuName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "networkVirtualApplianceSkuName") } } func TestFormatNetworkVirtualApplianceSkuID(t *testing.T) { - actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName" + actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseNetworkVirtualApplianceSkuID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "skuName", + NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseNetworkVirtualApplianceSkuIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "skuName", + NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/sKuNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUnAmE", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "sKuNaMe", + NetworkVirtualApplianceSkuName: "nEtWoRkViRtUaLaPpLiAnCeSkUnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/sKuNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/README.md b/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/README.md index d39ff37d0cf..728a5aba245 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/README.md +++ b/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.GetIkeSasThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.GetIkeSasThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") read, err := client.GetSharedKey(ctx, id) if err != nil { @@ -115,7 +115,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.ResetConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -127,7 +127,7 @@ if err := client.ResetConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{ // ... @@ -144,7 +144,7 @@ if err := client.ResetSharedKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.ConnectionSharedKey{ // ... @@ -161,7 +161,7 @@ if err := client.SetSharedKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{ // ... @@ -178,7 +178,7 @@ if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{ // ... @@ -195,7 +195,7 @@ if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/id_connection.go b/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/id_connection.go index fcc51d5666b..25fa92d5238 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/id_connection.go +++ b/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/id_connection.go @@ -115,7 +115,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "virtualNetworkGatewayConnectionName"), + resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } } diff --git a/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/id_connection_test.go b/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/id_connection_test.go index 19029d7c27e..271fc3c17bd 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/id_connection_test.go +++ b/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectionName != "virtualNetworkGatewayConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "virtualNetworkGatewayConnectionName") + if id.ConnectionName != "connectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionName") } } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go index e7481a70176..34b83087000 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go +++ b/resource-manager/network/2024-01-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go @@ -4,5 +4,5 @@ package virtualnetworkgatewayconnections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-01-01/virtualnetworkgateways/README.md b/resource-manager/network/2024-01-01/virtualnetworkgateways/README.md index 8b58cccfc4c..1f4263cf707 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgateways/README.md +++ b/resource-manager/network/2024-01-01/virtualnetworkgateways/README.md @@ -153,13 +153,13 @@ if err := client.GetLearnedRoutesThenPoll(ctx, id); err != nil { ``` -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageUrl` +### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageURL` ```go ctx := context.TODO() id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayName") -if err := client.GetVpnProfilePackageUrlThenPoll(ctx, id); err != nil { +if err := client.GetVpnProfilePackageURLThenPoll(ctx, id); err != nil { // handle the error } ``` @@ -397,7 +397,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgateways.VpnDeviceScriptParameters{ // ... diff --git a/resource-manager/network/2024-01-01/virtualnetworkgateways/id_connection.go b/resource-manager/network/2024-01-01/virtualnetworkgateways/id_connection.go index fb0eb751b39..7e0a849bdfd 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgateways/id_connection.go +++ b/resource-manager/network/2024-01-01/virtualnetworkgateways/id_connection.go @@ -115,7 +115,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "virtualNetworkGatewayConnectionName"), + resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } } diff --git a/resource-manager/network/2024-01-01/virtualnetworkgateways/id_connection_test.go b/resource-manager/network/2024-01-01/virtualnetworkgateways/id_connection_test.go index 255ca4bbb2c..f523578a93d 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgateways/id_connection_test.go +++ b/resource-manager/network/2024-01-01/virtualnetworkgateways/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectionName != "virtualNetworkGatewayConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "virtualNetworkGatewayConnectionName") + if id.ConnectionName != "connectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionName") } } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go b/resource-manager/network/2024-01-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go index c247730a0c5..e814c6eff38 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go +++ b/resource-manager/network/2024-01-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go @@ -14,15 +14,15 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetVpnProfilePackageUrlOperationResponse struct { +type GetVpnProfilePackageURLOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData Model *string } -// GetVpnProfilePackageUrl ... -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageUrlOperationResponse, err error) { +// GetVpnProfilePackageURL ... +func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -56,15 +56,15 @@ func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Contex return } -// GetVpnProfilePackageUrlThenPoll performs GetVpnProfilePackageUrl then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrlThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnProfilePackageUrl(ctx, id) +// GetVpnProfilePackageURLThenPoll performs GetVpnProfilePackageURL then polls until it's completed +func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageURLThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { + result, err := c.GetVpnProfilePackageURL(ctx, id) if err != nil { - return fmt.Errorf("performing GetVpnProfilePackageUrl: %+v", err) + return fmt.Errorf("performing GetVpnProfilePackageURL: %+v", err) } if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnProfilePackageUrl: %+v", err) + return fmt.Errorf("polling after GetVpnProfilePackageURL: %+v", err) } return nil diff --git a/resource-manager/network/2024-01-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2024-01-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go index 091426a3451..25f6fba8d55 100644 --- a/resource-manager/network/2024-01-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go +++ b/resource-manager/network/2024-01-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go @@ -4,5 +4,5 @@ package virtualnetworkgateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-01-01/virtualnetworktap/README.md b/resource-manager/network/2024-01-01/virtualnetworktap/README.md index 31643a26fe8..be106a3f9da 100644 --- a/resource-manager/network/2024-01-01/virtualnetworktap/README.md +++ b/resource-manager/network/2024-01-01/virtualnetworktap/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") payload := virtualnetworktap.VirtualNetworkTap{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") payload := virtualnetworktap.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/virtualnetworktap/id_virtualnetworktap.go b/resource-manager/network/2024-01-01/virtualnetworktap/id_virtualnetworktap.go index 87f32e385ac..48bd4716023 100644 --- a/resource-manager/network/2024-01-01/virtualnetworktap/id_virtualnetworktap.go +++ b/resource-manager/network/2024-01-01/virtualnetworktap/id_virtualnetworktap.go @@ -115,7 +115,7 @@ func (id VirtualNetworkTapId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVirtualNetworkTaps", "virtualNetworkTaps", "virtualNetworkTaps"), - resourceids.UserSpecifiedSegment("virtualNetworkTapName", "tapName"), + resourceids.UserSpecifiedSegment("virtualNetworkTapName", "virtualNetworkTapName"), } } diff --git a/resource-manager/network/2024-01-01/virtualnetworktap/id_virtualnetworktap_test.go b/resource-manager/network/2024-01-01/virtualnetworktap/id_virtualnetworktap_test.go index 638e22fc419..614dfaaf5fd 100644 --- a/resource-manager/network/2024-01-01/virtualnetworktap/id_virtualnetworktap_test.go +++ b/resource-manager/network/2024-01-01/virtualnetworktap/id_virtualnetworktap_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkTapId{} func TestNewVirtualNetworkTapID(t *testing.T) { - id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") + id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualNetworkTapID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualNetworkTapName != "tapName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "tapName") + if id.VirtualNetworkTapName != "virtualNetworkTapName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "virtualNetworkTapName") } } func TestFormatVirtualNetworkTapID(t *testing.T) { - actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName" + actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualNetworkTapID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "tapName", + VirtualNetworkTapName: "virtualNetworkTapName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualNetworkTapIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "tapName", + VirtualNetworkTapName: "virtualNetworkTapName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/tApNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApNaMe", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkTapName: "tApNaMe", + VirtualNetworkTapName: "vIrTuAlNeTwOrKtApNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/tApNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualwans/README.md b/resource-manager/network/2024-01-01/virtualwans/README.md index cbe64cc8c18..3509b985f42 100644 --- a/resource-manager/network/2024-01-01/virtualwans/README.md +++ b/resource-manager/network/2024-01-01/virtualwans/README.md @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.VirtualWanVpnProfileParameters{ // ... @@ -104,7 +104,7 @@ if err := client.GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx, ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") payload := virtualwans.HubRouteTable{ // ... @@ -121,7 +121,7 @@ if err := client.HubRouteTablesCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -133,7 +133,7 @@ if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") read, err := client.HubRouteTablesGet(ctx, id) if err != nil { @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") payload := virtualwans.HubVirtualNetworkConnection{ // ... @@ -183,7 +183,7 @@ if err := client.HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -195,7 +195,7 @@ if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") read, err := client.HubVirtualNetworkConnectionsGet(ctx, id) if err != nil { @@ -228,7 +228,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") payload := virtualwans.VpnGatewayNatRule{ // ... @@ -245,7 +245,7 @@ if err := client.NatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -257,7 +257,7 @@ if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") read, err := client.NatRulesGet(ctx, id) if err != nil { @@ -273,7 +273,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") // alternatively `client.NatRulesListByVpnGateway(ctx, id)` can be used to do batched pagination items, err := client.NatRulesListByVpnGatewayComplete(ctx, id) @@ -290,7 +290,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") payload := virtualwans.NetworkVirtualApplianceConnection{ // ... @@ -307,7 +307,7 @@ if err := client.NetworkVirtualApplianceConnectionsCreateOrUpdateThenPoll(ctx, i ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -319,7 +319,7 @@ if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") read, err := client.NetworkVirtualApplianceConnectionsGet(ctx, id) if err != nil { @@ -352,7 +352,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := virtualwans.P2SVpnGateway{ // ... @@ -369,7 +369,7 @@ if err := client.P2sVpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -381,7 +381,7 @@ if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") read, err := client.P2sVpnGatewaysGet(ctx, id) if err != nil { @@ -555,7 +555,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") read, err := client.SupportedSecurityProviders(ctx, id) if err != nil { @@ -571,7 +571,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.TagsObject{ // ... @@ -592,7 +592,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") payload := virtualwans.BgpConnection{ // ... @@ -609,7 +609,7 @@ if err := client.VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -621,7 +621,7 @@ if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") read, err := client.VirtualHubBgpConnectionGet(ctx, id) if err != nil { @@ -654,7 +654,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); err != nil { // handle the error @@ -666,7 +666,7 @@ if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err != nil { // handle the error @@ -678,7 +678,7 @@ if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") payload := virtualwans.HubIPConfiguration{ // ... @@ -695,7 +695,7 @@ if err := client.VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -707,7 +707,7 @@ if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") read, err := client.VirtualHubIPConfigurationGet(ctx, id) if err != nil { @@ -953,7 +953,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.VirtualWAN{ // ... @@ -970,7 +970,7 @@ if err := client.VirtualWansCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -982,7 +982,7 @@ if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") read, err := client.VirtualWansGet(ctx, id) if err != nil { @@ -1032,7 +1032,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnection{ // ... @@ -1049,7 +1049,7 @@ if err := client.VpnConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1061,7 +1061,7 @@ if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") read, err := client.VpnConnectionsGet(ctx, id) if err != nil { @@ -1077,7 +1077,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") // alternatively `client.VpnConnectionsListByVpnGateway(ctx, id)` can be used to do batched pagination items, err := client.VpnConnectionsListByVpnGatewayComplete(ctx, id) @@ -1094,7 +1094,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnectionPacketCaptureStartParameters{ // ... @@ -1111,7 +1111,7 @@ if err := client.VpnConnectionsStartPacketCaptureThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnectionPacketCaptureStopParameters{ // ... @@ -1128,7 +1128,7 @@ if err := client.VpnConnectionsStopPacketCaptureThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := virtualwans.VpnGateway{ // ... @@ -1145,7 +1145,7 @@ if err := client.VpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1157,7 +1157,7 @@ if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") read, err := client.VpnGatewaysGet(ctx, id) if err != nil { @@ -1207,7 +1207,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { // handle the error @@ -1219,7 +1219,7 @@ if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") // alternatively `client.VpnLinkConnectionsListByVpnConnection(ctx, id)` can be used to do batched pagination items, err := client.VpnLinkConnectionsListByVpnConnectionComplete(ctx, id) @@ -1236,7 +1236,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if err := client.VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx, id); err != nil { // handle the error @@ -1327,7 +1327,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") read, err := client.VpnSiteLinkConnectionsGet(ctx, id) if err != nil { @@ -1376,7 +1376,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.GetVpnSitesConfigurationRequest{ // ... diff --git a/resource-manager/network/2024-01-01/virtualwans/id_hubroutetable.go b/resource-manager/network/2024-01-01/virtualwans/id_hubroutetable.go index 5c93c30fb69..12d932e8523 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_hubroutetable.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_hubroutetable.go @@ -123,7 +123,7 @@ func (id HubRouteTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubName"), resourceids.StaticSegment("staticHubRouteTables", "hubRouteTables", "hubRouteTables"), - resourceids.UserSpecifiedSegment("hubRouteTableName", "routeTableName"), + resourceids.UserSpecifiedSegment("hubRouteTableName", "hubRouteTableName"), } } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_hubroutetable_test.go b/resource-manager/network/2024-01-01/virtualwans/id_hubroutetable_test.go index 7432f35dfa8..68d653182ed 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_hubroutetable_test.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_hubroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubRouteTableId{} func TestNewHubRouteTableID(t *testing.T) { - id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") + id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHubRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubName") } - if id.HubRouteTableName != "routeTableName" { - t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "routeTableName") + if id.HubRouteTableName != "hubRouteTableName" { + t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "hubRouteTableName") } } func TestFormatHubRouteTableID(t *testing.T) { - actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName" + actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHubRouteTableID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubRouteTableName: "routeTableName", + HubRouteTableName: "hubRouteTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHubRouteTableIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubRouteTableName: "routeTableName", + HubRouteTableName: "hubRouteTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/rOuTeTaBlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/hUbRoUtEtAbLeNaMe", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualHubName: "vIrTuAlHuBnAmE", - HubRouteTableName: "rOuTeTaBlEnAmE", + HubRouteTableName: "hUbRoUtEtAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/rOuTeTaBlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/hUbRoUtEtAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_hubvirtualnetworkconnection.go b/resource-manager/network/2024-01-01/virtualwans/id_hubvirtualnetworkconnection.go index 3db347a9c76..17eee4937eb 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_hubvirtualnetworkconnection.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_hubvirtualnetworkconnection.go @@ -123,7 +123,7 @@ func (id HubVirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubName"), resourceids.StaticSegment("staticHubVirtualNetworkConnections", "hubVirtualNetworkConnections", "hubVirtualNetworkConnections"), - resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "hubVirtualNetworkConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_hubvirtualnetworkconnection_test.go b/resource-manager/network/2024-01-01/virtualwans/id_hubvirtualnetworkconnection_test.go index 1dc09c40461..fcfebd848f0 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_hubvirtualnetworkconnection_test.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_hubvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubVirtualNetworkConnectionId{} func TestNewHubVirtualNetworkConnectionID(t *testing.T) { - id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") + id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHubVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubName") } - if id.HubVirtualNetworkConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "connectionName") + if id.HubVirtualNetworkConnectionName != "hubVirtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "hubVirtualNetworkConnectionName") } } func TestFormatHubVirtualNetworkConnectionID(t *testing.T) { - actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName" + actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHubVirtualNetworkConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubVirtualNetworkConnectionName: "connectionName", + HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHubVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubVirtualNetworkConnectionName: "connectionName", + HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualHubName: "vIrTuAlHuBnAmE", - HubVirtualNetworkConnectionName: "cOnNeCtIoNnAmE", + HubVirtualNetworkConnectionName: "hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_natrule.go b/resource-manager/network/2024-01-01/virtualwans/id_natrule.go index 5441dc04ec9..ab096bb8e61 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_natrule.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_natrule.go @@ -121,7 +121,7 @@ func (id NatRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticNatRules", "natRules", "natRules"), resourceids.UserSpecifiedSegment("natRuleName", "natRuleName"), } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_natrule_test.go b/resource-manager/network/2024-01-01/virtualwans/id_natrule_test.go index 9cc9a07875a..0b0048431d8 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_natrule_test.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_natrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NatRuleId{} func TestNewNatRuleID(t *testing.T) { - id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") + id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNatRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } if id.NatRuleName != "natRuleName" { @@ -32,8 +32,8 @@ func TestNewNatRuleID(t *testing.T) { } func TestFormatNatRuleID(t *testing.T) { - actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName" + actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNatRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", NatRuleName: "natRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNatRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", NatRuleName: "natRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS/nAtRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS/nAtRuLeNaMe", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", NatRuleName: "nAtRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS/nAtRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS/nAtRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_networkvirtualapplianceconnection.go b/resource-manager/network/2024-01-01/virtualwans/id_networkvirtualapplianceconnection.go index eea1f6b9dd2..fbbc66efaec 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_networkvirtualapplianceconnection.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_networkvirtualapplianceconnection.go @@ -123,7 +123,7 @@ func (id NetworkVirtualApplianceConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticNetworkVirtualApplianceConnections", "networkVirtualApplianceConnections", "networkVirtualApplianceConnections"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "networkVirtualApplianceConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_networkvirtualapplianceconnection_test.go b/resource-manager/network/2024-01-01/virtualwans/id_networkvirtualapplianceconnection_test.go index b9686058751..e467eaa75a2 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_networkvirtualapplianceconnection_test.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_networkvirtualapplianceconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkVirtualApplianceConnectionId{} func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { - id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") + id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.NetworkVirtualApplianceConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "connectionName") + if id.NetworkVirtualApplianceConnectionName != "networkVirtualApplianceConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "networkVirtualApplianceConnectionName") } } func TestFormatNetworkVirtualApplianceConnectionID(t *testing.T) { - actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName" + actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNetworkVirtualApplianceConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - NetworkVirtualApplianceConnectionName: "connectionName", + NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNetworkVirtualApplianceConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - NetworkVirtualApplianceConnectionName: "connectionName", + NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - NetworkVirtualApplianceConnectionName: "cOnNeCtIoNnAmE", + NetworkVirtualApplianceConnectionName: "nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_virtualwan.go b/resource-manager/network/2024-01-01/virtualwans/id_virtualwan.go index 7ba33187730..fa94d154c26 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_virtualwan.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_virtualwan.go @@ -115,7 +115,7 @@ func (id VirtualWANId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVirtualWans", "virtualWans", "virtualWans"), - resourceids.UserSpecifiedSegment("virtualWanName", "virtualWANName"), + resourceids.UserSpecifiedSegment("virtualWanName", "virtualWanName"), } } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_virtualwan_test.go b/resource-manager/network/2024-01-01/virtualwans/id_virtualwan_test.go index 0fb34067d23..b07670d82b4 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_virtualwan_test.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_virtualwan_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualWANId{} func TestNewVirtualWANID(t *testing.T) { - id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") + id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualWANID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualWanName != "virtualWANName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWANName") + if id.VirtualWanName != "virtualWanName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWanName") } } func TestFormatVirtualWANID(t *testing.T) { - actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName" + actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualWANID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName", Expected: &VirtualWANId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWANName", + VirtualWanName: "virtualWanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVirtualWANIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName", Expected: &VirtualWANId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWANName", + VirtualWanName: "virtualWanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName/extra", Error: true, }, { diff --git a/resource-manager/network/2024-01-01/virtualwans/id_vpngateway.go b/resource-manager/network/2024-01-01/virtualwans/id_vpngateway.go index 0ba0e40f11c..4aac85c0d13 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_vpngateway.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_vpngateway.go @@ -115,7 +115,7 @@ func (id VpnGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), } } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_vpngateway_test.go b/resource-manager/network/2024-01-01/virtualwans/id_vpngateway_test.go index b5d1b5de3a0..c7406d1fb5a 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_vpngateway_test.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_vpngateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnGatewayId{} func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") + id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVpnGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } } func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName" + actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVpnGatewayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVpnGatewayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_vpnlinkconnection.go b/resource-manager/network/2024-01-01/virtualwans/id_vpnlinkconnection.go index 6ee7f540d57..98326bfe842 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_vpnlinkconnection.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_vpnlinkconnection.go @@ -127,11 +127,11 @@ func (id VpnLinkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionName"), resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "linkConnectionName"), + resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/virtualwans/id_vpnlinkconnection_test.go b/resource-manager/network/2024-01-01/virtualwans/id_vpnlinkconnection_test.go index eb904ad1498..98ddb202383 100644 --- a/resource-manager/network/2024-01-01/virtualwans/id_vpnlinkconnection_test.go +++ b/resource-manager/network/2024-01-01/virtualwans/id_vpnlinkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnLinkConnectionId{} func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") + id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVpnLinkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } - if id.VpnConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "connectionName") + if id.VpnConnectionName != "vpnConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionName") } - if id.VpnLinkConnectionName != "linkConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "linkConnectionName") + if id.VpnLinkConnectionName != "vpnLinkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionName") } } func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName" + actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVpnLinkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", - VpnConnectionName: "cOnNeCtIoNnAmE", - VpnLinkConnectionName: "lInKcOnNeCtIoNnAmE", + VpnGatewayName: "vPnGaTeWaYnAmE", + VpnConnectionName: "vPnCoNnEcTiOnNaMe", + VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/virtualwans/model_getvpnsitesconfigurationrequest.go b/resource-manager/network/2024-01-01/virtualwans/model_getvpnsitesconfigurationrequest.go index 0dd233101ce..cd349d0cb2f 100644 --- a/resource-manager/network/2024-01-01/virtualwans/model_getvpnsitesconfigurationrequest.go +++ b/resource-manager/network/2024-01-01/virtualwans/model_getvpnsitesconfigurationrequest.go @@ -4,6 +4,6 @@ package virtualwans // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type GetVpnSitesConfigurationRequest struct { - OutputBlobSasUrl string `json:"outputBlobSasUrl"` + OutputBlobSasURL string `json:"outputBlobSasUrl"` VpnSites *[]string `json:"vpnSites,omitempty"` } diff --git a/resource-manager/network/2024-01-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go b/resource-manager/network/2024-01-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go index de501375c21..a2a50d9eb92 100644 --- a/resource-manager/network/2024-01-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go +++ b/resource-manager/network/2024-01-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go @@ -5,5 +5,5 @@ package virtualwans type VpnConnectionPacketCaptureStopParameters struct { LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-01-01/virtualwans/model_vpnprofileresponse.go b/resource-manager/network/2024-01-01/virtualwans/model_vpnprofileresponse.go index a96c942841c..ed24cd4584e 100644 --- a/resource-manager/network/2024-01-01/virtualwans/model_vpnprofileresponse.go +++ b/resource-manager/network/2024-01-01/virtualwans/model_vpnprofileresponse.go @@ -4,5 +4,5 @@ package virtualwans // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` } diff --git a/resource-manager/network/2024-01-01/vmsspublicipaddresses/README.md b/resource-manager/network/2024-01-01/vmsspublicipaddresses/README.md index 3ba2e9bd097..3ec590dc3bb 100644 --- a/resource-manager/network/2024-01-01/vmsspublicipaddresses/README.md +++ b/resource-manager/network/2024-01-01/vmsspublicipaddresses/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName", "publicIpAddressName") +id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName", "publicIPAddressName") read, err := client.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx, id, vmsspublicipaddresses.DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions()) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName") +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName") // alternatively `client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id)` can be used to do batched pagination items, err := client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx, id) diff --git a/resource-manager/network/2024-01-01/vpngateways/README.md b/resource-manager/network/2024-01-01/vpngateways/README.md index e47ddd8fcd2..c6c1731a1e1 100644 --- a/resource-manager/network/2024-01-01/vpngateways/README.md +++ b/resource-manager/network/2024-01-01/vpngateways/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions()); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.VpnGatewayPacketCaptureStartParameters{ // ... @@ -53,7 +53,7 @@ if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.VpnGatewayPacketCaptureStopParameters{ // ... @@ -70,7 +70,7 @@ if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.TagsObject{ // ... diff --git a/resource-manager/network/2024-01-01/vpngateways/id_vpngateway.go b/resource-manager/network/2024-01-01/vpngateways/id_vpngateway.go index 52e05b7b7b8..220d3ffa7b3 100644 --- a/resource-manager/network/2024-01-01/vpngateways/id_vpngateway.go +++ b/resource-manager/network/2024-01-01/vpngateways/id_vpngateway.go @@ -115,7 +115,7 @@ func (id VpnGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), } } diff --git a/resource-manager/network/2024-01-01/vpngateways/id_vpngateway_test.go b/resource-manager/network/2024-01-01/vpngateways/id_vpngateway_test.go index f2707bf53e6..c9c4abcd122 100644 --- a/resource-manager/network/2024-01-01/vpngateways/id_vpngateway_test.go +++ b/resource-manager/network/2024-01-01/vpngateways/id_vpngateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnGatewayId{} func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") + id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVpnGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } } func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName" + actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVpnGatewayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVpnGatewayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go b/resource-manager/network/2024-01-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go index ca9fe7cf71d..95998f06000 100644 --- a/resource-manager/network/2024-01-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go +++ b/resource-manager/network/2024-01-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go @@ -4,5 +4,5 @@ package vpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnGatewayPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-01-01/vpnlinkconnections/id_vpnlinkconnection.go b/resource-manager/network/2024-01-01/vpnlinkconnections/id_vpnlinkconnection.go index 33a950d143f..986725e2fc1 100644 --- a/resource-manager/network/2024-01-01/vpnlinkconnections/id_vpnlinkconnection.go +++ b/resource-manager/network/2024-01-01/vpnlinkconnections/id_vpnlinkconnection.go @@ -127,11 +127,11 @@ func (id VpnLinkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionName"), resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "linkConnectionName"), + resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionName"), } } diff --git a/resource-manager/network/2024-01-01/vpnlinkconnections/id_vpnlinkconnection_test.go b/resource-manager/network/2024-01-01/vpnlinkconnections/id_vpnlinkconnection_test.go index c6f966d4d10..59a74f2f8ea 100644 --- a/resource-manager/network/2024-01-01/vpnlinkconnections/id_vpnlinkconnection_test.go +++ b/resource-manager/network/2024-01-01/vpnlinkconnections/id_vpnlinkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnLinkConnectionId{} func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") + id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVpnLinkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } - if id.VpnConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "connectionName") + if id.VpnConnectionName != "vpnConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionName") } - if id.VpnLinkConnectionName != "linkConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "linkConnectionName") + if id.VpnLinkConnectionName != "vpnLinkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionName") } } func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName" + actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVpnLinkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", - VpnConnectionName: "cOnNeCtIoNnAmE", - VpnLinkConnectionName: "lInKcOnNeCtIoNnAmE", + VpnGatewayName: "vPnGaTeWaYnAmE", + VpnConnectionName: "vPnCoNnEcTiOnNaMe", + VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/README.md b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/README.md index ff1a193f842..19e9ce829be 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/README.md +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/constants.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/constants.go index dea03cf19c8..4d1afb6d235 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/constants.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/constants.go @@ -2886,9 +2886,9 @@ const ( WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" + WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" + WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" - WebApplicationFirewallTransformUrlDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformUrlEncode WebApplicationFirewallTransform = "UrlEncode" ) func PossibleValuesForWebApplicationFirewallTransform() []string { @@ -2897,9 +2897,9 @@ func PossibleValuesForWebApplicationFirewallTransform() []string { string(WebApplicationFirewallTransformLowercase), string(WebApplicationFirewallTransformRemoveNulls), string(WebApplicationFirewallTransformTrim), + string(WebApplicationFirewallTransformURLDecode), + string(WebApplicationFirewallTransformURLEncode), string(WebApplicationFirewallTransformUppercase), - string(WebApplicationFirewallTransformUrlDecode), - string(WebApplicationFirewallTransformUrlEncode), } } @@ -2922,9 +2922,9 @@ func parseWebApplicationFirewallTransform(input string) (*WebApplicationFirewall "lowercase": WebApplicationFirewallTransformLowercase, "removenulls": WebApplicationFirewallTransformRemoveNulls, "trim": WebApplicationFirewallTransformTrim, + "urldecode": WebApplicationFirewallTransformURLDecode, + "urlencode": WebApplicationFirewallTransformURLEncode, "uppercase": WebApplicationFirewallTransformUppercase, - "urldecode": WebApplicationFirewallTransformUrlDecode, - "urlencode": WebApplicationFirewallTransformUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go index 0a49b366bfc..3004461fd8a 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go @@ -115,7 +115,7 @@ func (id ApplicationGatewayWebApplicationFirewallPolicyId) Segments() []resource resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticApplicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "applicationGatewayWebApplicationFirewallPolicyName"), } } diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go index c2ea316bba5..205d73da565 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationGatewayWebApplicationFirewallPolicyId{} func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ApplicationGatewayWebApplicationFirewallPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "policyName") + if id.ApplicationGatewayWebApplicationFirewallPolicyName != "applicationGatewayWebApplicationFirewallPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "applicationGatewayWebApplicationFirewallPolicyName") } } func TestFormatApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName" + actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "policyName", + ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(t *t }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "policyName", + ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayWebApplicationFirewallPolicyName: "pOlIcYnAmE", + ApplicationGatewayWebApplicationFirewallPolicyName: "aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go index 82f3501791c..b1f6dd22b0d 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go @@ -4,6 +4,6 @@ package webapplicationfirewallpolicies // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` } diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go index f4f485b405b..6cdbb059a1b 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go @@ -38,6 +38,6 @@ type ApplicationGatewayPropertiesFormat struct { SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + UrlPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` } diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go index 7808c57c7f7..6103c017cb4 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go @@ -10,6 +10,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` } diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go index ed418b0d4a5..18cc34e55af 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go @@ -6,5 +6,5 @@ package webapplicationfirewallpolicies type ApplicationGatewayRewriteRuleActionSet struct { RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` + UrlConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` } diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go index 03021e43980..c6de0fdbc1b 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go @@ -3,7 +3,7 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlConfiguration struct { +type ApplicationGatewayURLConfiguration struct { ModifiedPath *string `json:"modifiedPath,omitempty"` ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` Reroute *bool `json:"reroute,omitempty"` diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go index 57b9cac7aa3..96a3dc6d985 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go @@ -3,10 +3,10 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMap struct { +type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` + Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go index e69ae8cbde4..e02847a3fd9 100644 --- a/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go +++ b/resource-manager/network/2024-01-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go @@ -3,7 +3,7 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMapPropertiesFormat struct { +type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` diff --git a/resource-manager/network/2024-01-01/webcategories/README.md b/resource-manager/network/2024-01-01/webcategories/README.md index be6f395ce25..2b6267348ec 100644 --- a/resource-manager/network/2024-01-01/webcategories/README.md +++ b/resource-manager/network/2024-01-01/webcategories/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name") +id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName") read, err := client.Get(ctx, id, webcategories.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/network/2024-01-01/webcategories/id_azurewebcategory.go b/resource-manager/network/2024-01-01/webcategories/id_azurewebcategory.go index 5971766dc63..9e7d76c94f2 100644 --- a/resource-manager/network/2024-01-01/webcategories/id_azurewebcategory.go +++ b/resource-manager/network/2024-01-01/webcategories/id_azurewebcategory.go @@ -107,7 +107,7 @@ func (id AzureWebCategoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticAzureWebCategories", "azureWebCategories", "azureWebCategories"), - resourceids.UserSpecifiedSegment("azureWebCategoryName", "name"), + resourceids.UserSpecifiedSegment("azureWebCategoryName", "azureWebCategoryName"), } } diff --git a/resource-manager/network/2024-01-01/webcategories/id_azurewebcategory_test.go b/resource-manager/network/2024-01-01/webcategories/id_azurewebcategory_test.go index a6e5d9ec9de..08826593ed1 100644 --- a/resource-manager/network/2024-01-01/webcategories/id_azurewebcategory_test.go +++ b/resource-manager/network/2024-01-01/webcategories/id_azurewebcategory_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &AzureWebCategoryId{} func TestNewAzureWebCategoryID(t *testing.T) { - id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name") + id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.AzureWebCategoryName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "name") + if id.AzureWebCategoryName != "azureWebCategoryName" { + t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "azureWebCategoryName") } } func TestFormatAzureWebCategoryID(t *testing.T) { - actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name" + actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseAzureWebCategoryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "name", + AzureWebCategoryName: "azureWebCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseAzureWebCategoryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "name", + AzureWebCategoryName: "azureWebCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYnAmE", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "nAmE", + AzureWebCategoryName: "aZuReWeBcAtEgOrYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/adminrulecollections/README.md b/resource-manager/network/2024-03-01/adminrulecollections/README.md index cc3fbc43b20..5435c98716e 100644 --- a/resource-manager/network/2024-03-01/adminrulecollections/README.md +++ b/resource-manager/network/2024-03-01/adminrulecollections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") payload := adminrulecollections.AdminRuleCollection{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOpera ```go ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrulecollections.NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") // alternatively `client.List(ctx, id, adminrulecollections.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, adminrulecollections.DefaultListOperationOptions()) diff --git a/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfiguration.go b/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfiguration.go index 314559846aa..193fa95d9b5 100644 --- a/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfiguration.go +++ b/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityAdminConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), } } diff --git a/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfiguration_test.go b/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfiguration_test.go index 7e368c4f9ca..aa4f07d225f 100644 --- a/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfiguration_test.go +++ b/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityAdminConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } } func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName" + actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityAdminConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfigurationrulecollection.go b/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfigurationrulecollection.go index fd514fc0311..543fa58afbe 100644 --- a/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfigurationrulecollection.go +++ b/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfigurationrulecollection.go @@ -129,7 +129,7 @@ func (id SecurityAdminConfigurationRuleCollectionId) Segments() []resourceids.Se resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfigurationrulecollection_test.go b/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfigurationrulecollection_test.go index 2242f1be8b6..ee1465b82db 100644 --- a/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfigurationrulecollection_test.go +++ b/resource-manager/network/2024-03-01/adminrulecollections/id_securityadminconfigurationrulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationRuleCollectionId{} func TestNewSecurityAdminConfigurationRuleCollectionID(t *testing.T) { - id := NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewSecurityAdminConfigurationRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewSecurityAdminConfigurationRuleCollectionID(t *testing.T) { } func TestFormatSecurityAdminConfigurationRuleCollectionID(t *testing.T) { - actual := NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSecurityAdminConfigurationRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &SecurityAdminConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSecurityAdminConfigurationRuleCollectionIDInsensitively(t *testing }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &SecurityAdminConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &SecurityAdminConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/adminrules/README.md b/resource-manager/network/2024-03-01/adminrules/README.md index 7807e4664b0..32b418ffc4e 100644 --- a/resource-manager/network/2024-03-01/adminrules/README.md +++ b/resource-manager/network/2024-03-01/adminrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := adminrules.NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") payload := adminrules.BaseAdminRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrules.NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOption ```go ctx := context.TODO() -id := adminrules.NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := adminrules.NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := adminrules.NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := adminrules.NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollection.go b/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollection.go index 1c4150a5a8d..cc58659b878 100644 --- a/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollection.go +++ b/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollection.go @@ -129,7 +129,7 @@ func (id SecurityAdminConfigurationRuleCollectionId) Segments() []resourceids.Se resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollection_test.go b/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollection_test.go index 20318ec084a..b1132297b80 100644 --- a/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollection_test.go +++ b/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationRuleCollectionId{} func TestNewSecurityAdminConfigurationRuleCollectionID(t *testing.T) { - id := NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewSecurityAdminConfigurationRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewSecurityAdminConfigurationRuleCollectionID(t *testing.T) { } func TestFormatSecurityAdminConfigurationRuleCollectionID(t *testing.T) { - actual := NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewSecurityAdminConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSecurityAdminConfigurationRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &SecurityAdminConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSecurityAdminConfigurationRuleCollectionIDInsensitively(t *testing }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Expected: &SecurityAdminConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &SecurityAdminConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollectionrule.go b/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollectionrule.go index 5cfccaac118..9ff1e96755d 100644 --- a/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollectionrule.go +++ b/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollectionrule.go @@ -135,7 +135,7 @@ func (id SecurityAdminConfigurationRuleCollectionRuleId) Segments() []resourceid resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), resourceids.StaticSegment("staticRules", "rules", "rules"), diff --git a/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollectionrule_test.go b/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollectionrule_test.go index 280b86615f2..5aa722a6158 100644 --- a/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollectionrule_test.go +++ b/resource-manager/network/2024-03-01/adminrules/id_securityadminconfigurationrulecollectionrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationRuleCollectionRuleId{} func TestNewSecurityAdminConfigurationRuleCollectionRuleID(t *testing.T) { - id := NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") + id := NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewSecurityAdminConfigurationRuleCollectionRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -40,8 +40,8 @@ func TestNewSecurityAdminConfigurationRuleCollectionRuleID(t *testing.T) { } func TestFormatSecurityAdminConfigurationRuleCollectionRuleID(t *testing.T) { - actual := NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName" + actual := NewSecurityAdminConfigurationRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName", "ruleCollectionName", "ruleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseSecurityAdminConfigurationRuleCollectionRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &SecurityAdminConfigurationRuleCollectionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseSecurityAdminConfigurationRuleCollectionRuleIDInsensitively(t *tes }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &SecurityAdminConfigurationRuleCollectionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", Expected: &SecurityAdminConfigurationRuleCollectionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", RuleName: "rUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/README.md b/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/README.md index e1ec35688d3..548c490d744 100644 --- a/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/README.md +++ b/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") payload := applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnection{ // ... diff --git a/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go index 56c45d49082..5fdf773f215 100644 --- a/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go +++ b/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go @@ -123,7 +123,7 @@ func (id ApplicationGatewayPrivateEndpointConnectionId) Segments() []resourceids resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go b/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go index d78d158b401..41f023a4a31 100644 --- a/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go +++ b/resource-manager/network/2024-03-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationGatewayPrivateEndpointConnectionId{} func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName") + id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayName") } - if id.PrivateEndpointConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "connectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName" + actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ApplicationGatewayName: "applicationGatewayName", - PrivateEndpointConnectionName: "connectionName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(t *test }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ApplicationGatewayName: "applicationGatewayName", - PrivateEndpointConnectionName: "connectionName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &ApplicationGatewayPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYnAmE", - PrivateEndpointConnectionName: "cOnNeCtIoNnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewaycustomerror.go b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewaycustomerror.go index 532de5a8e93..8b0e5fb8d20 100644 --- a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewaycustomerror.go +++ b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewaycustomerror.go @@ -4,6 +4,6 @@ package applicationgateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` } diff --git a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewaypropertiesformat.go index 1332febd49d..4e54c939bcb 100644 --- a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewaypropertiesformat.go +++ b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewaypropertiesformat.go @@ -38,6 +38,6 @@ type ApplicationGatewayPropertiesFormat struct { SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + UrlPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` } diff --git a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go index 07b97214f7f..b629d49b411 100644 --- a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go @@ -10,6 +10,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` } diff --git a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go index 02be2e1f37b..c46a7bd6d6c 100644 --- a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go +++ b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go @@ -6,5 +6,5 @@ package applicationgateways type ApplicationGatewayRewriteRuleActionSet struct { RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` + UrlConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` } diff --git a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlconfiguration.go index 18491c35f12..9c77d1808a2 100644 --- a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlconfiguration.go +++ b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlconfiguration.go @@ -3,7 +3,7 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlConfiguration struct { +type ApplicationGatewayURLConfiguration struct { ModifiedPath *string `json:"modifiedPath,omitempty"` ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` Reroute *bool `json:"reroute,omitempty"` diff --git a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlpathmap.go b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlpathmap.go index 5fc06877578..9ca546cb957 100644 --- a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlpathmap.go +++ b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlpathmap.go @@ -3,10 +3,10 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMap struct { +type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` + Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go index ef8e7e8e02f..9c00ae43cdf 100644 --- a/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go +++ b/resource-manager/network/2024-03-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go @@ -3,7 +3,7 @@ package applicationgateways // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMapPropertiesFormat struct { +type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` diff --git a/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/README.md b/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/README.md index 7ecb1dee2b8..d3be5076b6b 100644 --- a/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/README.md +++ b/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.DefaultGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.Get(ctx, id)` can be used to do batched pagination items, err := client.GetComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/id_location.go b/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/id_location.go index 38c2aa68f21..3d179e08bf0 100644 --- a/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/id_location.go +++ b/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/id_location_test.go b/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/id_location_test.go index abfa53672eb..3989d8a5132 100644 --- a/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/id_location_test.go +++ b/resource-manager/network/2024-03-01/applicationgatewaywafdynamicmanifests/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/availabledelegations/README.md b/resource-manager/network/2024-03-01/availabledelegations/README.md index 27c302c4f92..d5441dd3d42 100644 --- a/resource-manager/network/2024-03-01/availabledelegations/README.md +++ b/resource-manager/network/2024-03-01/availabledelegations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailableDelegationsList(ctx, id)` can be used to do batched pagination items, err := client.AvailableDelegationsListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.AvailableResourceGroupDelegationsList(ctx, id)` can be used to do batched pagination items, err := client.AvailableResourceGroupDelegationsListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/availabledelegations/id_location.go b/resource-manager/network/2024-03-01/availabledelegations/id_location.go index e4d894a6089..e6387e4fdeb 100644 --- a/resource-manager/network/2024-03-01/availabledelegations/id_location.go +++ b/resource-manager/network/2024-03-01/availabledelegations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/availabledelegations/id_location_test.go b/resource-manager/network/2024-03-01/availabledelegations/id_location_test.go index 8bb71a50adb..8d0352c08ff 100644 --- a/resource-manager/network/2024-03-01/availabledelegations/id_location_test.go +++ b/resource-manager/network/2024-03-01/availabledelegations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/availabledelegations/id_providerlocation.go b/resource-manager/network/2024-03-01/availabledelegations/id_providerlocation.go index 26af2ff9777..1e3b30f4431 100644 --- a/resource-manager/network/2024-03-01/availabledelegations/id_providerlocation.go +++ b/resource-manager/network/2024-03-01/availabledelegations/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/availabledelegations/id_providerlocation_test.go b/resource-manager/network/2024-03-01/availabledelegations/id_providerlocation_test.go index d3dea3d3895..e24c8def247 100644 --- a/resource-manager/network/2024-03-01/availabledelegations/id_providerlocation_test.go +++ b/resource-manager/network/2024-03-01/availabledelegations/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/availableservicealiases/README.md b/resource-manager/network/2024-03-01/availableservicealiases/README.md index e64f954d1de..ad6706a27ce 100644 --- a/resource-manager/network/2024-03-01/availableservicealiases/README.md +++ b/resource-manager/network/2024-03-01/availableservicealiases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListByResourceGroupComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/availableservicealiases/id_location.go b/resource-manager/network/2024-03-01/availableservicealiases/id_location.go index 65846cc20dd..b531d5a4bb7 100644 --- a/resource-manager/network/2024-03-01/availableservicealiases/id_location.go +++ b/resource-manager/network/2024-03-01/availableservicealiases/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/availableservicealiases/id_location_test.go b/resource-manager/network/2024-03-01/availableservicealiases/id_location_test.go index 8fdfbdee89e..995b5cfad7f 100644 --- a/resource-manager/network/2024-03-01/availableservicealiases/id_location_test.go +++ b/resource-manager/network/2024-03-01/availableservicealiases/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/availableservicealiases/id_providerlocation.go b/resource-manager/network/2024-03-01/availableservicealiases/id_providerlocation.go index 653b48ba912..6c961f76bc1 100644 --- a/resource-manager/network/2024-03-01/availableservicealiases/id_providerlocation.go +++ b/resource-manager/network/2024-03-01/availableservicealiases/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/availableservicealiases/id_providerlocation_test.go b/resource-manager/network/2024-03-01/availableservicealiases/id_providerlocation_test.go index 8b2be520bef..d6526faaf37 100644 --- a/resource-manager/network/2024-03-01/availableservicealiases/id_providerlocation_test.go +++ b/resource-manager/network/2024-03-01/availableservicealiases/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/azurefirewalls/model_firewallpacketcaptureparameters.go b/resource-manager/network/2024-03-01/azurefirewalls/model_firewallpacketcaptureparameters.go index 4259cab2043..0fab56fc1d5 100644 --- a/resource-manager/network/2024-03-01/azurefirewalls/model_firewallpacketcaptureparameters.go +++ b/resource-manager/network/2024-03-01/azurefirewalls/model_firewallpacketcaptureparameters.go @@ -10,5 +10,5 @@ type FirewallPacketCaptureParameters struct { Flags *[]AzureFirewallPacketCaptureFlags `json:"flags,omitempty"` NumberOfPacketsToCapture *int64 `json:"numberOfPacketsToCapture,omitempty"` Protocol *AzureFirewallNetworkRuleProtocol `json:"protocol,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-03-01/checkdnsavailabilities/README.md b/resource-manager/network/2024-03-01/checkdnsavailabilities/README.md index d853c2d486f..4bbd3969d50 100644 --- a/resource-manager/network/2024-03-01/checkdnsavailabilities/README.md +++ b/resource-manager/network/2024-03-01/checkdnsavailabilities/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.CheckDnsNameAvailability(ctx, id, checkdnsavailabilities.DefaultCheckDnsNameAvailabilityOperationOptions()) if err != nil { diff --git a/resource-manager/network/2024-03-01/checkdnsavailabilities/id_location.go b/resource-manager/network/2024-03-01/checkdnsavailabilities/id_location.go index 054cfdb305a..e9c60b3adaf 100644 --- a/resource-manager/network/2024-03-01/checkdnsavailabilities/id_location.go +++ b/resource-manager/network/2024-03-01/checkdnsavailabilities/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/checkdnsavailabilities/id_location_test.go b/resource-manager/network/2024-03-01/checkdnsavailabilities/id_location_test.go index 8b2e43d72d1..7d13e412f40 100644 --- a/resource-manager/network/2024-03-01/checkdnsavailabilities/id_location_test.go +++ b/resource-manager/network/2024-03-01/checkdnsavailabilities/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/connectivityconfigurations/README.md b/resource-manager/network/2024-03-01/connectivityconfigurations/README.md index 064a949d21f..9618b373458 100644 --- a/resource-manager/network/2024-03-01/connectivityconfigurations/README.md +++ b/resource-manager/network/2024-03-01/connectivityconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") payload := connectivityconfigurations.ConnectivityConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDelet ```go ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/connectivityconfigurations/id_connectivityconfiguration.go b/resource-manager/network/2024-03-01/connectivityconfigurations/id_connectivityconfiguration.go index 49a4ba3aaf0..d062db15f4f 100644 --- a/resource-manager/network/2024-03-01/connectivityconfigurations/id_connectivityconfiguration.go +++ b/resource-manager/network/2024-03-01/connectivityconfigurations/id_connectivityconfiguration.go @@ -123,7 +123,7 @@ func (id ConnectivityConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticConnectivityConfigurations", "connectivityConfigurations", "connectivityConfigurations"), - resourceids.UserSpecifiedSegment("connectivityConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("connectivityConfigurationName", "connectivityConfigurationName"), } } diff --git a/resource-manager/network/2024-03-01/connectivityconfigurations/id_connectivityconfiguration_test.go b/resource-manager/network/2024-03-01/connectivityconfigurations/id_connectivityconfiguration_test.go index 524d8385688..62733e7673b 100644 --- a/resource-manager/network/2024-03-01/connectivityconfigurations/id_connectivityconfiguration_test.go +++ b/resource-manager/network/2024-03-01/connectivityconfigurations/id_connectivityconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectivityConfigurationId{} func TestNewConnectivityConfigurationID(t *testing.T) { - id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewConnectivityConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.ConnectivityConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "configurationName") + if id.ConnectivityConfigurationName != "connectivityConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "connectivityConfigurationName") } } func TestFormatConnectivityConfigurationID(t *testing.T) { - actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName" + actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "connectivityConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseConnectivityConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - ConnectivityConfigurationName: "configurationName", + ConnectivityConfigurationName: "connectivityConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseConnectivityConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - ConnectivityConfigurationName: "configurationName", + ConnectivityConfigurationName: "connectivityConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/connectivityConfigurations/connectivityConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnNaMe", Expected: &ConnectivityConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - ConnectivityConfigurationName: "cOnFiGuRaTiOnNaMe", + ConnectivityConfigurationName: "cOnNeCtIvItYcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/customipprefixes/README.md b/resource-manager/network/2024-03-01/customipprefixes/README.md index 1d4a66f1161..eef95f2721d 100644 --- a/resource-manager/network/2024-03-01/customipprefixes/README.md +++ b/resource-manager/network/2024-03-01/customipprefixes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") payload := customipprefixes.CustomIPPrefix{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") read, err := client.Get(ctx, id, customipprefixes.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") payload := customipprefixes.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/customipprefixes/id_customipprefix.go b/resource-manager/network/2024-03-01/customipprefixes/id_customipprefix.go index a41316cfa68..bca85243003 100644 --- a/resource-manager/network/2024-03-01/customipprefixes/id_customipprefix.go +++ b/resource-manager/network/2024-03-01/customipprefixes/id_customipprefix.go @@ -115,7 +115,7 @@ func (id CustomIPPrefixId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticCustomIPPrefixes", "customIPPrefixes", "customIPPrefixes"), - resourceids.UserSpecifiedSegment("customIPPrefixName", "customIpPrefixName"), + resourceids.UserSpecifiedSegment("customIPPrefixName", "customIPPrefixName"), } } diff --git a/resource-manager/network/2024-03-01/customipprefixes/id_customipprefix_test.go b/resource-manager/network/2024-03-01/customipprefixes/id_customipprefix_test.go index 2503a2c56e8..dfd6b48155e 100644 --- a/resource-manager/network/2024-03-01/customipprefixes/id_customipprefix_test.go +++ b/resource-manager/network/2024-03-01/customipprefixes/id_customipprefix_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomIPPrefixId{} func TestNewCustomIPPrefixID(t *testing.T) { - id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName") + id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCustomIPPrefixID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CustomIPPrefixName != "customIpPrefixName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIpPrefixName") + if id.CustomIPPrefixName != "customIPPrefixName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIPPrefixName") } } func TestFormatCustomIPPrefixID(t *testing.T) { - actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIpPrefixName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName" + actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCustomIPPrefixID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName", Expected: &CustomIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIpPrefixName", + CustomIPPrefixName: "customIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCustomIPPrefixIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName", Expected: &CustomIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIpPrefixName", + CustomIPPrefixName: "customIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixName/extra", Error: true, }, { diff --git a/resource-manager/network/2024-03-01/endpointservices/README.md b/resource-manager/network/2024-03-01/endpointservices/README.md index d09013f4beb..c3b9dbf7d44 100644 --- a/resource-manager/network/2024-03-01/endpointservices/README.md +++ b/resource-manager/network/2024-03-01/endpointservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailableEndpointServicesList(ctx, id)` can be used to do batched pagination items, err := client.AvailableEndpointServicesListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/endpointservices/id_location.go b/resource-manager/network/2024-03-01/endpointservices/id_location.go index f2b06140acf..18eaa8353af 100644 --- a/resource-manager/network/2024-03-01/endpointservices/id_location.go +++ b/resource-manager/network/2024-03-01/endpointservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/endpointservices/id_location_test.go b/resource-manager/network/2024-03-01/endpointservices/id_location_test.go index e31df0936ae..0213283041f 100644 --- a/resource-manager/network/2024-03-01/endpointservices/id_location_test.go +++ b/resource-manager/network/2024-03-01/endpointservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitarptable/README.md b/resource-manager/network/2024-03-01/expressroutecircuitarptable/README.md index cb90cca9099..a6f98d383ea 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitarptable/README.md +++ b/resource-manager/network/2024-03-01/expressroutecircuitarptable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName") // alternatively `client.ExpressRouteCircuitsListArpTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListArpTableComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecircuitarptable/id_arptable.go b/resource-manager/network/2024-03-01/expressroutecircuitarptable/id_arptable.go index 0f33d89bfd9..d35a8eadadf 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitarptable/id_arptable.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitarptable/id_arptable.go @@ -127,11 +127,11 @@ func (id ArpTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "devicePath"), + resourceids.UserSpecifiedSegment("arpTableName", "arpTableName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitarptable/id_arptable_test.go b/resource-manager/network/2024-03-01/expressroutecircuitarptable/id_arptable_test.go index 11dd82c0c88..66d3e99f02e 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitarptable/id_arptable_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitarptable/id_arptable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ArpTableId{} func TestNewArpTableID(t *testing.T) { - id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewArpTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.ArpTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "devicePath") + if id.ArpTableName != "arpTableName" { + t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableName") } } func TestFormatArpTableID(t *testing.T) { - actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath" + actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "arpTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseArpTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseArpTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE", Expected: &ArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - ArpTableName: "dEvIcEpAtH", + ArpTableName: "aRpTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/README.md b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/README.md index 655cfcc3e0e..f286292f298 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/README.md +++ b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_authorization.go b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_authorization.go index b8b16a2153d..9da101d4a62 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_authorization.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_authorization.go @@ -121,7 +121,7 @@ func (id AuthorizationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), resourceids.UserSpecifiedSegment("authorizationName", "authorizationName"), } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_authorization_test.go b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_authorization_test.go index ed6668508eb..60d0dbacbe5 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_authorization_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_authorization_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthorizationId{} func TestNewAuthorizationID(t *testing.T) { - id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName") + id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAuthorizationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.AuthorizationName != "authorizationName" { @@ -32,8 +32,8 @@ func TestNewAuthorizationID(t *testing.T) { } func TestFormatAuthorizationID(t *testing.T) { - actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "authorizationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName" + actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "authorizationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAuthorizationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", AuthorizationName: "authorizationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAuthorizationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", AuthorizationName: "authorizationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/authorizations/authorizationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/authorizations/authorizationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe", Expected: &AuthorizationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", AuthorizationName: "aUtHoRiZaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_expressroutecircuit.go b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_expressroutecircuit.go index 7626fffc08c..210f0ae6366 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_expressroutecircuit.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go index 20b47ec6190..3bd47c1b205 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitconnections/README.md b/resource-manager/network/2024-03-01/expressroutecircuitconnections/README.md index 03408e3ccc9..e3363bcae8a 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitconnections/README.md +++ b/resource-manager/network/2024-03-01/expressroutecircuitconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecircuitconnections/id_peeringconnection.go b/resource-manager/network/2024-03-01/expressroutecircuitconnections/id_peeringconnection.go index 7c1fb7730b7..07c1226d200 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitconnections/id_peeringconnection.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitconnections/id_peeringconnection.go @@ -127,7 +127,7 @@ func (id PeeringConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticConnections", "connections", "connections"), diff --git a/resource-manager/network/2024-03-01/expressroutecircuitconnections/id_peeringconnection_test.go b/resource-manager/network/2024-03-01/expressroutecircuitconnections/id_peeringconnection_test.go index 39d2aafacfa..f1e786ac3d2 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitconnections/id_peeringconnection_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitconnections/id_peeringconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringConnectionId{} func TestNewPeeringConnectionID(t *testing.T) { - id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") + id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPeeringConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { @@ -36,8 +36,8 @@ func TestNewPeeringConnectionID(t *testing.T) { } func TestFormatPeeringConnectionID(t *testing.T) { - actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName" + actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/connections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &PeeringConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitpeerings/README.md b/resource-manager/network/2024-03-01/expressroutecircuitpeerings/README.md index 4a816276cc4..3fda229eede 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitpeerings/README.md +++ b/resource-manager/network/2024-03-01/expressroutecircuitpeerings/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecircuitpeerings/id_expressroutecircuit.go b/resource-manager/network/2024-03-01/expressroutecircuitpeerings/id_expressroutecircuit.go index d901b679f33..02a14699ffa 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitpeerings/id_expressroutecircuit.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitpeerings/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go b/resource-manager/network/2024-03-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go index 1edc4454ed9..9d893b6392d 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitroutestable/README.md b/resource-manager/network/2024-03-01/expressroutecircuitroutestable/README.md index 6d1877af2ba..af9de300082 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitroutestable/README.md +++ b/resource-manager/network/2024-03-01/expressroutecircuitroutestable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName") // alternatively `client.ExpressRouteCircuitsListRoutesTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListRoutesTableComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecircuitroutestable/id_peeringroutetable.go b/resource-manager/network/2024-03-01/expressroutecircuitroutestable/id_peeringroutetable.go index d929441f379..8971fb87e03 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitroutestable/id_peeringroutetable.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitroutestable/id_peeringroutetable.go @@ -127,11 +127,11 @@ func (id PeeringRouteTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTableName", "routeTableName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitroutestable/id_peeringroutetable_test.go b/resource-manager/network/2024-03-01/expressroutecircuitroutestable/id_peeringroutetable_test.go index 154e92f43fb..620bbfff69e 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitroutestable/id_peeringroutetable_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitroutestable/id_peeringroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringRouteTableId{} func TestNewPeeringRouteTableID(t *testing.T) { - id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "devicePath") + if id.RouteTableName != "routeTableName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableName") } } func TestFormatPeeringRouteTableID(t *testing.T) { - actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath" + actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringRouteTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringRouteTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE", Expected: &PeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - RouteTableName: "dEvIcEpAtH", + RouteTableName: "rOuTeTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/README.md b/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/README.md index 85fb6350039..f753d6c848e 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/README.md +++ b/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") +id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName") // alternatively `client.ExpressRouteCircuitsListRoutesTableSummary(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCircuitsListRoutesTableSummaryComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/id_routetablessummary.go b/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/id_routetablessummary.go index 93753595743..90ea354df62 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/id_routetablessummary.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/id_routetablessummary.go @@ -127,11 +127,11 @@ func (id RouteTablesSummaryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go b/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go index b1c58fed640..2c78aaf0378 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteTablesSummaryId{} func TestNewRouteTablesSummaryID(t *testing.T) { - id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath") + id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewRouteTablesSummaryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTablesSummaryName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "devicePath") + if id.RouteTablesSummaryName != "routeTablesSummaryName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryName") } } func TestFormatRouteTablesSummaryID(t *testing.T) { - actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath" + actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "routeTablesSummaryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRouteTablesSummaryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRouteTablesSummaryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE", Expected: &RouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - RouteTablesSummaryName: "dEvIcEpAtH", + RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuits/README.md b/resource-manager/network/2024-03-01/expressroutecircuits/README.md index a9534c7fe9a..ab510583177 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuits/README.md +++ b/resource-manager/network/2024-03-01/expressroutecircuits/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") payload := expressroutecircuits.ExpressRouteCircuit{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") payload := expressroutecircuits.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/expressroutecircuits/id_expressroutecircuit.go b/resource-manager/network/2024-03-01/expressroutecircuits/id_expressroutecircuit.go index d3a73edd48a..7c3ebaafe98 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuits/id_expressroutecircuit.go +++ b/resource-manager/network/2024-03-01/expressroutecircuits/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecircuits/id_expressroutecircuit_test.go b/resource-manager/network/2024-03-01/expressroutecircuits/id_expressroutecircuit_test.go index 3c4a66b65e7..de1beeca125 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuits/id_expressroutecircuit_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuits/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitstats/README.md b/resource-manager/network/2024-03-01/expressroutecircuitstats/README.md index 0243f128d8e..632ec319993 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitstats/README.md +++ b/resource-manager/network/2024-03-01/expressroutecircuitstats/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") read, err := client.ExpressRouteCircuitsGetPeeringStats(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") +id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") read, err := client.ExpressRouteCircuitsGetStats(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/expressroutecircuitstats/id_expressroutecircuit.go b/resource-manager/network/2024-03-01/expressroutecircuitstats/id_expressroutecircuit.go index 38c9ef16c4a..0eba5b9c251 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitstats/id_expressroutecircuit.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitstats/id_expressroutecircuit.go @@ -115,7 +115,7 @@ func (id ExpressRouteCircuitId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecircuitstats/id_expressroutecircuit_test.go b/resource-manager/network/2024-03-01/expressroutecircuitstats/id_expressroutecircuit_test.go index 883c9a15547..288e8caf55e 100644 --- a/resource-manager/network/2024-03-01/expressroutecircuitstats/id_expressroutecircuit_test.go +++ b/resource-manager/network/2024-03-01/expressroutecircuitstats/id_expressroutecircuit_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCircuitId{} func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName") + id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCircuitID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } } func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName" + actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCircuitID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Expected: &ExpressRouteCircuitId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressrouteconnections/README.md b/resource-manager/network/2024-03-01/expressrouteconnections/README.md index 783ebb99a3f..71b5c305d5c 100644 --- a/resource-manager/network/2024-03-01/expressrouteconnections/README.md +++ b/resource-manager/network/2024-03-01/expressrouteconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") payload := expressrouteconnections.ExpressRouteConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/expressrouteconnections/id_expressrouteconnection.go b/resource-manager/network/2024-03-01/expressrouteconnections/id_expressrouteconnection.go index 971a1ebe796..2cf6021fe08 100644 --- a/resource-manager/network/2024-03-01/expressrouteconnections/id_expressrouteconnection.go +++ b/resource-manager/network/2024-03-01/expressrouteconnections/id_expressrouteconnection.go @@ -123,7 +123,7 @@ func (id ExpressRouteConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayName"), resourceids.StaticSegment("staticExpressRouteConnections", "expressRouteConnections", "expressRouteConnections"), - resourceids.UserSpecifiedSegment("expressRouteConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("expressRouteConnectionName", "expressRouteConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/expressrouteconnections/id_expressrouteconnection_test.go b/resource-manager/network/2024-03-01/expressrouteconnections/id_expressrouteconnection_test.go index 4416a9058fc..dd3b75e24af 100644 --- a/resource-manager/network/2024-03-01/expressrouteconnections/id_expressrouteconnection_test.go +++ b/resource-manager/network/2024-03-01/expressrouteconnections/id_expressrouteconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteConnectionId{} func TestNewExpressRouteConnectionID(t *testing.T) { - id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName") + id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewExpressRouteConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayName") } - if id.ExpressRouteConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "connectionName") + if id.ExpressRouteConnectionName != "expressRouteConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "expressRouteConnectionName") } } func TestFormatExpressRouteConnectionID(t *testing.T) { - actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName" + actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayName", "expressRouteConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseExpressRouteConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ExpressRouteGatewayName: "expressRouteGatewayName", - ExpressRouteConnectionName: "connectionName", + ExpressRouteConnectionName: "expressRouteConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseExpressRouteConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ExpressRouteGatewayName: "expressRouteGatewayName", - ExpressRouteConnectionName: "connectionName", + ExpressRouteConnectionName: "expressRouteConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/expressRouteConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNnAmE", Expected: &ExpressRouteConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyNaMe", - ExpressRouteConnectionName: "cOnNeCtIoNnAmE", + ExpressRouteConnectionName: "eXpReSsRoUtEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyNaMe/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/README.md b/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/README.md index 390b418f770..6b80c80004d 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/README.md +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName") // alternatively `client.ExpressRouteCrossConnectionsListArpTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListArpTableComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/id_peeringarptable.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/id_peeringarptable.go index 0589efdc27b..f37ffb9dda2 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/id_peeringarptable.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/id_peeringarptable.go @@ -127,11 +127,11 @@ func (id PeeringArpTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "devicePath"), + resourceids.UserSpecifiedSegment("arpTableName", "arpTableName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go index 7a56ebe2b11..1d31f05cc7a 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringArpTableId{} func TestNewPeeringArpTableID(t *testing.T) { - id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringArpTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.ArpTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "devicePath") + if id.ArpTableName != "arpTableName" { + t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableName") } } func TestFormatPeeringArpTableID(t *testing.T) { - actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath" + actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "arpTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringArpTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringArpTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - ArpTableName: "devicePath", + ArpTableName: "arpTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/arpTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/arpTables/arpTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE", Expected: &PeeringArpTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - ArpTableName: "dEvIcEpAtH", + ArpTableName: "aRpTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/aRpTaBlEs/aRpTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/README.md b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/README.md index 07dc7cd9049..03c43a6d857 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/README.md +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") payload := expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeering{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go index 0971af25620..890e4e7d24b 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go @@ -115,7 +115,7 @@ func (id ExpressRouteCrossConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go index 2019f0104a6..33465dd597a 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") + id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCrossConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } } func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName" + actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCrossConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_peering.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_peering.go index 83a9563a48d..c3ee06da4dc 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_peering.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_peering.go @@ -121,7 +121,7 @@ func (id PeeringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_peering_test.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_peering_test.go index 57de6e64b02..ac47382755d 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_peering_test.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionpeerings/id_peering_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringId{} func TestNewPeeringID(t *testing.T) { - id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName") + id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPeeringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { @@ -32,8 +32,8 @@ func TestNewPeeringID(t *testing.T) { } func TestFormatPeeringID(t *testing.T) { - actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName" + actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePeeringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePeeringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Expected: &PeeringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/README.md b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/README.md index 1ae1af64c90..5491faf19de 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/README.md +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName") // alternatively `client.ExpressRouteCrossConnectionsListRoutesTable(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListRoutesTableComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go index b6d27ada378..29491001fbf 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go @@ -127,11 +127,11 @@ func (id ExpressRouteCrossConnectionPeeringRouteTableId) Segments() []resourceid resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTableName", "routeTableName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go index 35e27084ce7..2dd58fa2973 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionPeeringRouteTableId{} func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTableName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "devicePath") + if id.RouteTableName != "routeTableName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableName") } } func TestFormatExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath" + actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(t *tes }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTableName: "devicePath", + RouteTableName: "routeTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTables/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTables/routeTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE", Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - RouteTableName: "dEvIcEpAtH", + RouteTableName: "rOuTeTaBlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEs/rOuTeTaBlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/README.md b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/README.md index 82ce31c2299..feb742e6b91 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/README.md +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") +id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName") // alternatively `client.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id)` can be used to do batched pagination items, err := client.ExpressRouteCrossConnectionsListRoutesTableSummaryComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go index df854619ed9..1d3631cb982 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go @@ -127,11 +127,11 @@ func (id PeeringRouteTablesSummaryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "devicePath"), + resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go index 361ebbceb19..6d2bdf44468 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeeringRouteTablesSummaryId{} func TestNewPeeringRouteTablesSummaryID(t *testing.T) { - id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath") + id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeeringRouteTablesSummaryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.RouteTablesSummaryName != "devicePath" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "devicePath") + if id.RouteTablesSummaryName != "routeTablesSummaryName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryName") } } func TestFormatPeeringRouteTablesSummaryID(t *testing.T) { - actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName", "peeringName", "devicePath").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath" + actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName", "peeringName", "routeTablesSummaryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeeringRouteTablesSummaryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeeringRouteTablesSummaryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", PeeringName: "peeringName", - RouteTablesSummaryName: "devicePath", + RouteTablesSummaryName: "routeTablesSummaryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/peerings/peeringName/routeTablesSummary/devicePath/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/peerings/peeringName/routeTablesSummary/routeTablesSummaryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE", Expected: &PeeringRouteTablesSummaryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", PeeringName: "pEeRiNgNaMe", - RouteTablesSummaryName: "dEvIcEpAtH", + RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/dEvIcEpAtH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/pEeRiNgS/pEeRiNgNaMe/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnections/README.md b/resource-manager/network/2024-03-01/expressroutecrossconnections/README.md index 26a801a8ae9..018ffd2a4ec 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnections/README.md +++ b/resource-manager/network/2024-03-01/expressroutecrossconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") payload := expressroutecrossconnections.ExpressRouteCrossConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -92,7 +92,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") payload := expressroutecrossconnections.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnections/id_expressroutecrossconnection.go b/resource-manager/network/2024-03-01/expressroutecrossconnections/id_expressroutecrossconnection.go index dcaf8883d78..10dc03f9c00 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnections/id_expressroutecrossconnection.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnections/id_expressroutecrossconnection.go @@ -115,7 +115,7 @@ func (id ExpressRouteCrossConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "crossConnectionName"), + resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go b/resource-manager/network/2024-03-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go index 620034d43a3..11f11c44f51 100644 --- a/resource-manager/network/2024-03-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go +++ b/resource-manager/network/2024-03-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName") + id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewExpressRouteCrossConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCrossConnectionName != "crossConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "crossConnectionName") + if id.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionName") } } func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "crossConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName" + actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseExpressRouteCrossConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "crossConnectionName", + ExpressRouteCrossConnectionName: "expressRouteCrossConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/crossConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", Expected: &ExpressRouteCrossConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "cRoSsCoNnEcTiOnNaMe", + ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/cRoSsCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressrouteportslocations/README.md b/resource-manager/network/2024-03-01/expressrouteportslocations/README.md index 91476c75cf7..8f2ba153b50 100644 --- a/resource-manager/network/2024-03-01/expressrouteportslocations/README.md +++ b/resource-manager/network/2024-03-01/expressrouteportslocations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName") +id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/expressrouteportslocations/id_expressrouteportslocation.go b/resource-manager/network/2024-03-01/expressrouteportslocations/id_expressrouteportslocation.go index 73fe725b0df..d8025eb5937 100644 --- a/resource-manager/network/2024-03-01/expressrouteportslocations/id_expressrouteportslocation.go +++ b/resource-manager/network/2024-03-01/expressrouteportslocations/id_expressrouteportslocation.go @@ -107,7 +107,7 @@ func (id ExpressRoutePortsLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRoutePortsLocations", "expressRoutePortsLocations", "expressRoutePortsLocations"), - resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "locationName"), + resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "expressRoutePortsLocationName"), } } diff --git a/resource-manager/network/2024-03-01/expressrouteportslocations/id_expressrouteportslocation_test.go b/resource-manager/network/2024-03-01/expressrouteportslocations/id_expressrouteportslocation_test.go index 44398dc0c7e..693718559ff 100644 --- a/resource-manager/network/2024-03-01/expressrouteportslocations/id_expressrouteportslocation_test.go +++ b/resource-manager/network/2024-03-01/expressrouteportslocations/id_expressrouteportslocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ExpressRoutePortsLocationId{} func TestNewExpressRoutePortsLocationID(t *testing.T) { - id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName") + id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ExpressRoutePortsLocationName != "locationName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "locationName") + if id.ExpressRoutePortsLocationName != "expressRoutePortsLocationName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "expressRoutePortsLocationName") } } func TestFormatExpressRoutePortsLocationID(t *testing.T) { - actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName" + actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseExpressRoutePortsLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "locationName", + ExpressRoutePortsLocationName: "expressRoutePortsLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseExpressRoutePortsLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "locationName", + ExpressRoutePortsLocationName: "expressRoutePortsLocationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/locationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/lOcAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnNaMe", Expected: &ExpressRoutePortsLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "lOcAtIoNnAmE", + ExpressRoutePortsLocationName: "eXpReSsRoUtEpOrTsLoCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/lOcAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/expressrouteproviderports/README.md b/resource-manager/network/2024-03-01/expressrouteproviderports/README.md index de6f8cf8339..52166f85979 100644 --- a/resource-manager/network/2024-03-01/expressrouteproviderports/README.md +++ b/resource-manager/network/2024-03-01/expressrouteproviderports/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport") +id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName") read, err := client.ExpressRouteProviderPort(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/expressrouteproviderports/id_expressrouteproviderport.go b/resource-manager/network/2024-03-01/expressrouteproviderports/id_expressrouteproviderport.go index 866b4c25f4f..142c36fee12 100644 --- a/resource-manager/network/2024-03-01/expressrouteproviderports/id_expressrouteproviderport.go +++ b/resource-manager/network/2024-03-01/expressrouteproviderports/id_expressrouteproviderport.go @@ -107,7 +107,7 @@ func (id ExpressRouteProviderPortId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteProviderPorts", "expressRouteProviderPorts", "expressRouteProviderPorts"), - resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "providerport"), + resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "expressRouteProviderPortName"), } } diff --git a/resource-manager/network/2024-03-01/expressrouteproviderports/id_expressrouteproviderport_test.go b/resource-manager/network/2024-03-01/expressrouteproviderports/id_expressrouteproviderport_test.go index 980dfd0f387..04d9684f23d 100644 --- a/resource-manager/network/2024-03-01/expressrouteproviderports/id_expressrouteproviderport_test.go +++ b/resource-manager/network/2024-03-01/expressrouteproviderports/id_expressrouteproviderport_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ExpressRouteProviderPortId{} func TestNewExpressRouteProviderPortID(t *testing.T) { - id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport") + id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ExpressRouteProviderPortName != "providerport" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "providerport") + if id.ExpressRouteProviderPortName != "expressRouteProviderPortName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "expressRouteProviderPortName") } } func TestFormatExpressRouteProviderPortID(t *testing.T) { - actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "providerport").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport" + actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseExpressRouteProviderPortID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "providerport", + ExpressRouteProviderPortName: "expressRouteProviderPortName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseExpressRouteProviderPortIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "providerport", + ExpressRouteProviderPortName: "expressRouteProviderPortName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/providerport/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/pRoViDeRpOrT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTnAmE", Expected: &ExpressRouteProviderPortId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "pRoViDeRpOrT", + ExpressRouteProviderPortName: "eXpReSsRoUtEpRoViDeRpOrTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/pRoViDeRpOrT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/firewallpolicies/model_applicationrule.go b/resource-manager/network/2024-03-01/firewallpolicies/model_applicationrule.go index f7d2f0c3f47..151ed288bae 100644 --- a/resource-manager/network/2024-03-01/firewallpolicies/model_applicationrule.go +++ b/resource-manager/network/2024-03-01/firewallpolicies/model_applicationrule.go @@ -18,7 +18,7 @@ type ApplicationRule struct { SourceAddresses *[]string `json:"sourceAddresses,omitempty"` SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` + TargetURLs *[]string `json:"targetUrls,omitempty"` TerminateTLS *bool `json:"terminateTLS,omitempty"` WebCategories *[]string `json:"webCategories,omitempty"` diff --git a/resource-manager/network/2024-03-01/firewallpolicyrulecollectiongroups/model_applicationrule.go b/resource-manager/network/2024-03-01/firewallpolicyrulecollectiongroups/model_applicationrule.go index 00f2de60a64..1684b7ab31b 100644 --- a/resource-manager/network/2024-03-01/firewallpolicyrulecollectiongroups/model_applicationrule.go +++ b/resource-manager/network/2024-03-01/firewallpolicyrulecollectiongroups/model_applicationrule.go @@ -18,7 +18,7 @@ type ApplicationRule struct { SourceAddresses *[]string `json:"sourceAddresses,omitempty"` SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` + TargetURLs *[]string `json:"targetUrls,omitempty"` TerminateTLS *bool `json:"terminateTLS,omitempty"` WebCategories *[]string `json:"webCategories,omitempty"` diff --git a/resource-manager/network/2024-03-01/ipgroups/README.md b/resource-manager/network/2024-03-01/ipgroups/README.md index 748c105c6e1..4cebe929e9a 100644 --- a/resource-manager/network/2024-03-01/ipgroups/README.md +++ b/resource-manager/network/2024-03-01/ipgroups/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") payload := ipgroups.IPGroup{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") read, err := client.Get(ctx, id, ipgroups.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") payload := ipgroups.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/ipgroups/id_ipgroup.go b/resource-manager/network/2024-03-01/ipgroups/id_ipgroup.go index 255122bcafc..441c7301b56 100644 --- a/resource-manager/network/2024-03-01/ipgroups/id_ipgroup.go +++ b/resource-manager/network/2024-03-01/ipgroups/id_ipgroup.go @@ -115,7 +115,7 @@ func (id IPGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticIpGroups", "ipGroups", "ipGroups"), - resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupsName"), + resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupName"), } } diff --git a/resource-manager/network/2024-03-01/ipgroups/id_ipgroup_test.go b/resource-manager/network/2024-03-01/ipgroups/id_ipgroup_test.go index 0dee23413e1..e590c1f6bc7 100644 --- a/resource-manager/network/2024-03-01/ipgroups/id_ipgroup_test.go +++ b/resource-manager/network/2024-03-01/ipgroups/id_ipgroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IPGroupId{} func TestNewIPGroupID(t *testing.T) { - id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName") + id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewIPGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.IpGroupName != "ipGroupsName" { - t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupsName") + if id.IpGroupName != "ipGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupName") } } func TestFormatIPGroupID(t *testing.T) { - actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName" + actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseIPGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupsName", + IpGroupName: "ipGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseIPGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupsName", + IpGroupName: "ipGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpNaMe", Expected: &IPGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IpGroupName: "iPgRoUpSnAmE", + IpGroupName: "iPgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/loadbalancers/README.md b/resource-manager/network/2024-03-01/loadbalancers/README.md index c8e0bf44fa6..0fb85c891a5 100644 --- a/resource-manager/network/2024-03-01/loadbalancers/README.md +++ b/resource-manager/network/2024-03-01/loadbalancers/README.md @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName") +id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName") payload := loadbalancers.QueryInboundNatRulePortMappingRequest{ // ... @@ -394,7 +394,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName") +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName") payload := loadbalancers.MigrateLoadBalancerToIPBasedRequest{ // ... @@ -415,7 +415,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := loadbalancers.LoadBalancerVipSwapRequest{ // ... diff --git a/resource-manager/network/2024-03-01/loadbalancers/id_backendaddresspool.go b/resource-manager/network/2024-03-01/loadbalancers/id_backendaddresspool.go index 8ed580c9198..9984348c234 100644 --- a/resource-manager/network/2024-03-01/loadbalancers/id_backendaddresspool.go +++ b/resource-manager/network/2024-03-01/loadbalancers/id_backendaddresspool.go @@ -117,13 +117,13 @@ func (id BackendAddressPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerName"), resourceids.StaticSegment("staticBackendAddressPools", "backendAddressPools", "backendAddressPools"), - resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendPoolName"), + resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendAddressPoolName"), } } diff --git a/resource-manager/network/2024-03-01/loadbalancers/id_backendaddresspool_test.go b/resource-manager/network/2024-03-01/loadbalancers/id_backendaddresspool_test.go index 3a2671f5985..b8334fde60c 100644 --- a/resource-manager/network/2024-03-01/loadbalancers/id_backendaddresspool_test.go +++ b/resource-manager/network/2024-03-01/loadbalancers/id_backendaddresspool_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &BackendAddressPoolId{} func TestNewBackendAddressPoolID(t *testing.T) { - id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName") + id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.LoadBalancerName != "loadBalancerName" { t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerName") } - if id.BackendAddressPoolName != "backendPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendPoolName") + if id.BackendAddressPoolName != "backendAddressPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendAddressPoolName") } } func TestFormatBackendAddressPoolID(t *testing.T) { - actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName", "backendPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName" + actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName", "backendAddressPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -67,47 +67,47 @@ func TestParseBackendAddressPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", - BackendAddressPoolName: "backendPoolName", + BackendAddressPoolName: "backendAddressPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName/extra", Error: true, }, } @@ -188,92 +188,92 @@ func TestParseBackendAddressPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", - BackendAddressPoolName: "backendPoolName", + BackendAddressPoolName: "backendAddressPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/backendAddressPools/backendAddressPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLnAmE", Expected: &BackendAddressPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", LoadBalancerName: "lOaDbAlAnCeRnAmE", - BackendAddressPoolName: "bAcKeNdPoOlNaMe", + BackendAddressPoolName: "bAcKeNdAdDrEsSpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/loadbalancers/id_loadbalancer.go b/resource-manager/network/2024-03-01/loadbalancers/id_loadbalancer.go index ef69db4bf71..61207d17d8d 100644 --- a/resource-manager/network/2024-03-01/loadbalancers/id_loadbalancer.go +++ b/resource-manager/network/2024-03-01/loadbalancers/id_loadbalancer.go @@ -111,7 +111,7 @@ func (id LoadBalancerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), diff --git a/resource-manager/network/2024-03-01/loadbalancers/id_loadbalancer_test.go b/resource-manager/network/2024-03-01/loadbalancers/id_loadbalancer_test.go index 25fcce5b649..5e02836d140 100644 --- a/resource-manager/network/2024-03-01/loadbalancers/id_loadbalancer_test.go +++ b/resource-manager/network/2024-03-01/loadbalancers/id_loadbalancer_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LoadBalancerId{} func TestNewLoadBalancerID(t *testing.T) { - id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName") + id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } if id.LoadBalancerName != "loadBalancerName" { @@ -28,8 +28,8 @@ func TestNewLoadBalancerID(t *testing.T) { } func TestFormatLoadBalancerID(t *testing.T) { - actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "groupName", "loadBalancerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName" + actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "loadBalancerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseLoadBalancerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseLoadBalancerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", + ResourceGroupName: "resourceGroupName", LoadBalancerName: "loadBalancerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Network/loadBalancers/loadBalancerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE", Expected: &LoadBalancerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", LoadBalancerName: "lOaDbAlAnCeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/loadbalancers/id_location.go b/resource-manager/network/2024-03-01/loadbalancers/id_location.go index 06ff0a743e6..b6cfa4c67ba 100644 --- a/resource-manager/network/2024-03-01/loadbalancers/id_location.go +++ b/resource-manager/network/2024-03-01/loadbalancers/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/loadbalancers/id_location_test.go b/resource-manager/network/2024-03-01/loadbalancers/id_location_test.go index 97e523fbcc4..c15a4a4b124 100644 --- a/resource-manager/network/2024-03-01/loadbalancers/id_location_test.go +++ b/resource-manager/network/2024-03-01/loadbalancers/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/networkinterfaces/README.md b/resource-manager/network/2024-03-01/networkinterfaces/README.md index 757b167348c..91f00dd5378 100644 --- a/resource-manager/network/2024-03-01/networkinterfaces/README.md +++ b/resource-manager/network/2024-03-01/networkinterfaces/README.md @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName") +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName") read, err := client.GetVirtualMachineScaleSetIPConfiguration(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions()) if err != nil { @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName") +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName") read, err := client.GetVirtualMachineScaleSetNetworkInterface(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions()) if err != nil { @@ -220,7 +220,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName") +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName") // alternatively `client.ListVirtualMachineScaleSetIPConfigurations(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions())` can be used to do batched pagination items, err := client.ListVirtualMachineScaleSetIPConfigurationsComplete(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions()) @@ -254,7 +254,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex") +id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName") // alternatively `client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id)` can be used to do batched pagination items, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx, id) @@ -317,6 +317,35 @@ for _, item := range items { ``` +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsCreateOrUpdate` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceName", "tapConfigurationName") + +payload := networkinterfaces.NetworkInterfaceTapConfiguration{ + // ... +} + + +if err := client.NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsDelete` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceName", "tapConfigurationName") + +if err := client.NetworkInterfaceTapConfigurationsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + ### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsGet` ```go diff --git a/resource-manager/network/2024-03-01/networkinterfaces/id_virtualmachine.go b/resource-manager/network/2024-03-01/networkinterfaces/id_virtualmachine.go index 3e8bac23fd1..ad24ef16d81 100644 --- a/resource-manager/network/2024-03-01/networkinterfaces/id_virtualmachine.go +++ b/resource-manager/network/2024-03-01/networkinterfaces/id_virtualmachine.go @@ -123,7 +123,7 @@ func (id VirtualMachineId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetName"), resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "virtualmachineIndex"), + resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineName"), } } diff --git a/resource-manager/network/2024-03-01/networkinterfaces/id_virtualmachine_test.go b/resource-manager/network/2024-03-01/networkinterfaces/id_virtualmachine_test.go index 612c4ecdd69..cb6aa2f9476 100644 --- a/resource-manager/network/2024-03-01/networkinterfaces/id_virtualmachine_test.go +++ b/resource-manager/network/2024-03-01/networkinterfaces/id_virtualmachine_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualMachineId{} func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex") + id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualMachineID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetName") } - if id.VirtualMachineName != "virtualmachineIndex" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualmachineIndex") + if id.VirtualMachineName != "virtualMachineName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineName") } } func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualmachineIndex").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex" + actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualMachineID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - VirtualMachineName: "virtualmachineIndex", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualMachineIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualMachineScaleSetName: "virtualMachineScaleSetName", - VirtualMachineName: "virtualmachineIndex", + VirtualMachineName: "virtualMachineName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualmachineIndex/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetName/virtualMachines/virtualMachineName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEiNdEx", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE", Expected: &VirtualMachineId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTnAmE", - VirtualMachineName: "vIrTuAlMaChInEiNdEx", + VirtualMachineName: "vIrTuAlMaChInEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEiNdEx/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTnAmE/vIrTuAlMaChInEs/vIrTuAlMaChInEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go b/resource-manager/network/2024-03-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go new file mode 100644 index 00000000000..fcece2ea104 --- /dev/null +++ b/resource-manager/network/2024-03-01/networkinterfaces/method_networkinterfacetapconfigurationscreateorupdate.go @@ -0,0 +1,75 @@ +package networkinterfaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceTapConfigurationsCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *NetworkInterfaceTapConfiguration +} + +// NetworkInterfaceTapConfigurationsCreateOrUpdate ... +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsCreateOrUpdate(ctx context.Context, id TapConfigurationId, input NetworkInterfaceTapConfiguration) (result NetworkInterfaceTapConfigurationsCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll performs NetworkInterfaceTapConfigurationsCreateOrUpdate then polls until it's completed +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsCreateOrUpdateThenPoll(ctx context.Context, id TapConfigurationId, input NetworkInterfaceTapConfiguration) error { + result, err := c.NetworkInterfaceTapConfigurationsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing NetworkInterfaceTapConfigurationsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after NetworkInterfaceTapConfigurationsCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2024-03-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go b/resource-manager/network/2024-03-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go new file mode 100644 index 00000000000..263815906b2 --- /dev/null +++ b/resource-manager/network/2024-03-01/networkinterfaces/method_networkinterfacetapconfigurationsdelete.go @@ -0,0 +1,71 @@ +package networkinterfaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceTapConfigurationsDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// NetworkInterfaceTapConfigurationsDelete ... +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsDelete(ctx context.Context, id TapConfigurationId) (result NetworkInterfaceTapConfigurationsDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// NetworkInterfaceTapConfigurationsDeleteThenPoll performs NetworkInterfaceTapConfigurationsDelete then polls until it's completed +func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsDeleteThenPoll(ctx context.Context, id TapConfigurationId) error { + result, err := c.NetworkInterfaceTapConfigurationsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing NetworkInterfaceTapConfigurationsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after NetworkInterfaceTapConfigurationsDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/README.md b/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/README.md index f78440c9094..3d3f907a489 100644 --- a/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/README.md +++ b/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := networkmanagerroutingconfigurations.NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := networkmanagerroutingconfigurations.NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName") payload := networkmanagerroutingconfigurations.NetworkManagerRoutingConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networkmanagerroutingconfigurations.NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := networkmanagerroutingconfigurations.NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName") if err := client.DeleteThenPoll(ctx, id, networkmanagerroutingconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, networkmanagerroutingconfigurations.Def ```go ctx := context.TODO() -id := networkmanagerroutingconfigurations.NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := networkmanagerroutingconfigurations.NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/id_routingconfiguration.go b/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/id_routingconfiguration.go index 6fc63bc5187..a9666fb45cd 100644 --- a/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/id_routingconfiguration.go +++ b/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/id_routingconfiguration.go @@ -123,7 +123,7 @@ func (id RoutingConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticRoutingConfigurations", "routingConfigurations", "routingConfigurations"), - resourceids.UserSpecifiedSegment("routingConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("routingConfigurationName", "routingConfigurationName"), } } diff --git a/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/id_routingconfiguration_test.go b/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/id_routingconfiguration_test.go index afe4802a4b8..ffe093025a3 100644 --- a/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/id_routingconfiguration_test.go +++ b/resource-manager/network/2024-03-01/networkmanagerroutingconfigurations/id_routingconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoutingConfigurationId{} func TestNewRoutingConfigurationID(t *testing.T) { - id := NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRoutingConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.RoutingConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "configurationName") + if id.RoutingConfigurationName != "routingConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "routingConfigurationName") } } func TestFormatRoutingConfigurationID(t *testing.T) { - actual := NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName" + actual := NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRoutingConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Expected: &RoutingConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRoutingConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Expected: &RoutingConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE", Expected: &RoutingConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - RoutingConfigurationName: "cOnFiGuRaTiOnNaMe", + RoutingConfigurationName: "rOuTiNgCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/networkvirtualappliances/README.md b/resource-manager/network/2024-03-01/networkvirtualappliances/README.md index ce31662a85a..a43627f1493 100644 --- a/resource-manager/network/2024-03-01/networkvirtualappliances/README.md +++ b/resource-manager/network/2024-03-01/networkvirtualappliances/README.md @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") +id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") payload := networkvirtualappliances.InboundSecurityRule{ // ... @@ -87,7 +87,7 @@ if err := client.InboundSecurityRuleCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") +id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") read, err := client.InboundSecurityRuleGet(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/networkvirtualappliances/id_inboundsecurityrule.go b/resource-manager/network/2024-03-01/networkvirtualappliances/id_inboundsecurityrule.go index d59b8c173b5..4da7242be6d 100644 --- a/resource-manager/network/2024-03-01/networkvirtualappliances/id_inboundsecurityrule.go +++ b/resource-manager/network/2024-03-01/networkvirtualappliances/id_inboundsecurityrule.go @@ -123,7 +123,7 @@ func (id InboundSecurityRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticInboundSecurityRules", "inboundSecurityRules", "inboundSecurityRules"), - resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "ruleCollectionName"), + resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "inboundSecurityRuleName"), } } diff --git a/resource-manager/network/2024-03-01/networkvirtualappliances/id_inboundsecurityrule_test.go b/resource-manager/network/2024-03-01/networkvirtualappliances/id_inboundsecurityrule_test.go index a4a396742df..b953b2aa90d 100644 --- a/resource-manager/network/2024-03-01/networkvirtualappliances/id_inboundsecurityrule_test.go +++ b/resource-manager/network/2024-03-01/networkvirtualappliances/id_inboundsecurityrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InboundSecurityRuleId{} func TestNewInboundSecurityRuleID(t *testing.T) { - id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName") + id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewInboundSecurityRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.InboundSecurityRuleName != "ruleCollectionName" { - t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "ruleCollectionName") + if id.InboundSecurityRuleName != "inboundSecurityRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "inboundSecurityRuleName") } } func TestFormatInboundSecurityRuleID(t *testing.T) { - actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName" + actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "inboundSecurityRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseInboundSecurityRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - InboundSecurityRuleName: "ruleCollectionName", + InboundSecurityRuleName: "inboundSecurityRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseInboundSecurityRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - InboundSecurityRuleName: "ruleCollectionName", + InboundSecurityRuleName: "inboundSecurityRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/inboundSecurityRules/inboundSecurityRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeNaMe", Expected: &InboundSecurityRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - InboundSecurityRuleName: "rUlEcOlLeCtIoNnAmE", + InboundSecurityRuleName: "iNbOuNdSeCuRiTyRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/p2svpngateways/README.md b/resource-manager/network/2024-03-01/p2svpngateways/README.md index d2820374491..37f5c2c73e3 100644 --- a/resource-manager/network/2024-03-01/p2svpngateways/README.md +++ b/resource-manager/network/2024-03-01/p2svpngateways/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnConnectionRequest{ // ... @@ -42,7 +42,7 @@ if err := client.DisconnectP2sVpnConnectionsThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnProfileParameters{ // ... @@ -59,7 +59,7 @@ if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.P2SVpnConnectionHealthRequest{ // ... @@ -88,7 +88,7 @@ if err := client.GetP2sVpnConnectionHealthDetailedThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.ResetThenPoll(ctx, id); err != nil { // handle the error @@ -100,7 +100,7 @@ if err := client.ResetThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := p2svpngateways.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/p2svpngateways/model_p2svpnconnectionhealth.go b/resource-manager/network/2024-03-01/p2svpngateways/model_p2svpnconnectionhealth.go index 42b227bbf63..d7e951d0d0a 100644 --- a/resource-manager/network/2024-03-01/p2svpngateways/model_p2svpnconnectionhealth.go +++ b/resource-manager/network/2024-03-01/p2svpngateways/model_p2svpnconnectionhealth.go @@ -4,5 +4,5 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type P2SVpnConnectionHealth struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-03-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go b/resource-manager/network/2024-03-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go index d0cd806bd05..cb5094a7b15 100644 --- a/resource-manager/network/2024-03-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go +++ b/resource-manager/network/2024-03-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go @@ -4,6 +4,6 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type P2SVpnConnectionHealthRequest struct { - OutputBlobSasUrl *string `json:"outputBlobSasUrl,omitempty"` + OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"` } diff --git a/resource-manager/network/2024-03-01/p2svpngateways/model_vpnprofileresponse.go b/resource-manager/network/2024-03-01/p2svpngateways/model_vpnprofileresponse.go index 55f4d81d16c..3d26db7265b 100644 --- a/resource-manager/network/2024-03-01/p2svpngateways/model_vpnprofileresponse.go +++ b/resource-manager/network/2024-03-01/p2svpngateways/model_vpnprofileresponse.go @@ -4,5 +4,5 @@ package p2svpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` } diff --git a/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/README.md b/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/README.md index 5b5ea012017..1c5b2ddda8a 100644 --- a/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/README.md +++ b/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") +id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName") +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/id_peerconnection.go b/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/id_peerconnection.go index 4c26579b339..4819211effd 100644 --- a/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/id_peerconnection.go +++ b/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/id_peerconnection.go @@ -127,11 +127,11 @@ func (id PeerConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "circuitName"), + resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitName"), resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), resourceids.UserSpecifiedSegment("peeringName", "peeringName"), resourceids.StaticSegment("staticPeerConnections", "peerConnections", "peerConnections"), - resourceids.UserSpecifiedSegment("peerConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("peerConnectionName", "peerConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/id_peerconnection_test.go b/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/id_peerconnection_test.go index a6434909377..578fee6fb85 100644 --- a/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/id_peerconnection_test.go +++ b/resource-manager/network/2024-03-01/peerexpressroutecircuitconnections/id_peerconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PeerConnectionId{} func TestNewPeerConnectionID(t *testing.T) { - id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName") + id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewPeerConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ExpressRouteCircuitName != "circuitName" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "circuitName") + if id.ExpressRouteCircuitName != "expressRouteCircuitName" { + t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitName") } if id.PeeringName != "peeringName" { t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringName") } - if id.PeerConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "connectionName") + if id.PeerConnectionName != "peerConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "peerConnectionName") } } func TestFormatPeerConnectionID(t *testing.T) { - actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "circuitName", "peeringName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName" + actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitName", "peeringName", "peerConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParsePeerConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - PeerConnectionName: "connectionName", + PeerConnectionName: "peerConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParsePeerConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "circuitName", + ExpressRouteCircuitName: "expressRouteCircuitName", PeeringName: "peeringName", - PeerConnectionName: "connectionName", + PeerConnectionName: "peerConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/peeringName/peerConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName/peerings/peeringName/peerConnections/peerConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNnAmE", Expected: &PeerConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "cIrCuItNaMe", + ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItNaMe", PeeringName: "pEeRiNgNaMe", - PeerConnectionName: "cOnNeCtIoNnAmE", + PeerConnectionName: "pEeRcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/cIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItNaMe/pEeRiNgS/pEeRiNgNaMe/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/privateendpoints/README.md b/resource-manager/network/2024-03-01/privateendpoints/README.md index 8422607baa6..6e0dfe6bab9 100644 --- a/resource-manager/network/2024-03-01/privateendpoints/README.md +++ b/resource-manager/network/2024-03-01/privateendpoints/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id) @@ -42,7 +42,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/privateendpoints/id_location.go b/resource-manager/network/2024-03-01/privateendpoints/id_location.go index f90051a6725..77d85ed86a2 100644 --- a/resource-manager/network/2024-03-01/privateendpoints/id_location.go +++ b/resource-manager/network/2024-03-01/privateendpoints/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/privateendpoints/id_location_test.go b/resource-manager/network/2024-03-01/privateendpoints/id_location_test.go index de6ecb243b3..aff4982b728 100644 --- a/resource-manager/network/2024-03-01/privateendpoints/id_location_test.go +++ b/resource-manager/network/2024-03-01/privateendpoints/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/privateendpoints/id_providerlocation.go b/resource-manager/network/2024-03-01/privateendpoints/id_providerlocation.go index cb389eabe34..5bf08d4e861 100644 --- a/resource-manager/network/2024-03-01/privateendpoints/id_providerlocation.go +++ b/resource-manager/network/2024-03-01/privateendpoints/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/privateendpoints/id_providerlocation_test.go b/resource-manager/network/2024-03-01/privateendpoints/id_providerlocation_test.go index 17c34f07818..ddd96efab6c 100644 --- a/resource-manager/network/2024-03-01/privateendpoints/id_providerlocation_test.go +++ b/resource-manager/network/2024-03-01/privateendpoints/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/privatelinkservices/README.md b/resource-manager/network/2024-03-01/privatelinkservices/README.md index 127e2f50762..57252b930e7 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/README.md +++ b/resource-manager/network/2024-03-01/privatelinkservices/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ // ... @@ -42,7 +42,7 @@ if err := client.CheckPrivateLinkServiceVisibilityThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ // ... @@ -59,7 +59,7 @@ if err := client.CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx, i ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") payload := privatelinkservices.PrivateLinkService{ // ... @@ -76,7 +76,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -88,7 +88,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -100,7 +100,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") read, err := client.Get(ctx, id, privatelinkservices.DefaultGetOperationOptions()) if err != nil { @@ -116,7 +116,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id, privatelinkservices.DefaultGetPrivateEndpointConnectionOperationOptions()) if err != nil { @@ -149,7 +149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListAutoApprovedPrivateLinkServices(ctx, id)` can be used to do batched pagination items, err := client.ListAutoApprovedPrivateLinkServicesComplete(ctx, id) @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id)` can be used to do batched pagination items, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx, id) @@ -200,7 +200,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") // alternatively `client.ListPrivateEndpointConnections(ctx, id)` can be used to do batched pagination items, err := client.ListPrivateEndpointConnectionsComplete(ctx, id) @@ -217,7 +217,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") payload := privatelinkservices.PrivateEndpointConnection{ // ... diff --git a/resource-manager/network/2024-03-01/privatelinkservices/id_location.go b/resource-manager/network/2024-03-01/privatelinkservices/id_location.go index c2338e0d7ee..ad61efbce7f 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/id_location.go +++ b/resource-manager/network/2024-03-01/privatelinkservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/privatelinkservices/id_location_test.go b/resource-manager/network/2024-03-01/privatelinkservices/id_location_test.go index c7b93b9c65d..56fdbbb4ab0 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/id_location_test.go +++ b/resource-manager/network/2024-03-01/privatelinkservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/privatelinkservices/id_privateendpointconnection.go b/resource-manager/network/2024-03-01/privatelinkservices/id_privateendpointconnection.go index 0bb8766006b..3f1f439928b 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/id_privateendpointconnection.go +++ b/resource-manager/network/2024-03-01/privatelinkservices/id_privateendpointconnection.go @@ -121,9 +121,9 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "peConnectionName"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/privatelinkservices/id_privateendpointconnection_test.go b/resource-manager/network/2024-03-01/privatelinkservices/id_privateendpointconnection_test.go index e82d28f6306..b76fddc6e1b 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/id_privateendpointconnection_test.go +++ b/resource-manager/network/2024-03-01/privatelinkservices/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "serviceName") + if id.PrivateLinkServiceName != "privateLinkServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceName") } - if id.PrivateEndpointConnectionName != "peConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "peConnectionName") + if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionName") } } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName", "peConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", - PrivateEndpointConnectionName: "peConnectionName", + PrivateLinkServiceName: "privateLinkServiceName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", - PrivateEndpointConnectionName: "peConnectionName", + PrivateLinkServiceName: "privateLinkServiceName", + PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/privateEndpointConnections/peConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "sErViCeNaMe", - PrivateEndpointConnectionName: "pEcOnNeCtIoNnAmE", + PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEnAmE", + PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/privatelinkservices/id_privatelinkservice.go b/resource-manager/network/2024-03-01/privatelinkservices/id_privatelinkservice.go index c093bc5f0e7..d691d1eded6 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/id_privatelinkservice.go +++ b/resource-manager/network/2024-03-01/privatelinkservices/id_privatelinkservice.go @@ -115,7 +115,7 @@ func (id PrivateLinkServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "serviceName"), + resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceName"), } } diff --git a/resource-manager/network/2024-03-01/privatelinkservices/id_privatelinkservice_test.go b/resource-manager/network/2024-03-01/privatelinkservices/id_privatelinkservice_test.go index 43aa7b6b80a..bccc5172aaf 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/id_privatelinkservice_test.go +++ b/resource-manager/network/2024-03-01/privatelinkservices/id_privatelinkservice_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkServiceId{} func TestNewPrivateLinkServiceID(t *testing.T) { - id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName") + id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateLinkServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateLinkServiceName != "serviceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "serviceName") + if id.PrivateLinkServiceName != "privateLinkServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceName") } } func TestFormatPrivateLinkServiceID(t *testing.T) { - actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName" + actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateLinkServiceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", + PrivateLinkServiceName: "privateLinkServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateLinkServiceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "serviceName", + PrivateLinkServiceName: "privateLinkServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE", Expected: &PrivateLinkServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "sErViCeNaMe", + PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/privatelinkservices/id_providerlocation.go b/resource-manager/network/2024-03-01/privatelinkservices/id_providerlocation.go index 929b9472fbc..706ab2680a9 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/id_providerlocation.go +++ b/resource-manager/network/2024-03-01/privatelinkservices/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/privatelinkservices/id_providerlocation_test.go b/resource-manager/network/2024-03-01/privatelinkservices/id_providerlocation_test.go index 77653638cf4..1565dd828b1 100644 --- a/resource-manager/network/2024-03-01/privatelinkservices/id_providerlocation_test.go +++ b/resource-manager/network/2024-03-01/privatelinkservices/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/publicipaddresses/README.md b/resource-manager/network/2024-03-01/publicipaddresses/README.md index 943f5685e96..258f20353ec 100644 --- a/resource-manager/network/2024-03-01/publicipaddresses/README.md +++ b/resource-manager/network/2024-03-01/publicipaddresses/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") payload := publicipaddresses.PublicIPAddress{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") read, err := client.Get(ctx, id, publicipaddresses.DefaultGetOperationOptions()) if err != nil { @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressesName") +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressName") payload := publicipaddresses.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/publicipprefixes/README.md b/resource-manager/network/2024-03-01/publicipprefixes/README.md index 7f39c8c5e6e..09316f3f7c6 100644 --- a/resource-manager/network/2024-03-01/publicipprefixes/README.md +++ b/resource-manager/network/2024-03-01/publicipprefixes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") payload := publicipprefixes.PublicIPPrefix{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") payload := publicipprefixes.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/publicipprefixes/id_publicipprefix.go b/resource-manager/network/2024-03-01/publicipprefixes/id_publicipprefix.go index ba849d0aad0..35801814a57 100644 --- a/resource-manager/network/2024-03-01/publicipprefixes/id_publicipprefix.go +++ b/resource-manager/network/2024-03-01/publicipprefixes/id_publicipprefix.go @@ -115,7 +115,7 @@ func (id PublicIPPrefixId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPublicIPPrefixes", "publicIPPrefixes", "publicIPPrefixes"), - resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIpPrefixName"), + resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIPPrefixName"), } } diff --git a/resource-manager/network/2024-03-01/publicipprefixes/id_publicipprefix_test.go b/resource-manager/network/2024-03-01/publicipprefixes/id_publicipprefix_test.go index c19356dcda1..267591b6714 100644 --- a/resource-manager/network/2024-03-01/publicipprefixes/id_publicipprefix_test.go +++ b/resource-manager/network/2024-03-01/publicipprefixes/id_publicipprefix_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PublicIPPrefixId{} func TestNewPublicIPPrefixID(t *testing.T) { - id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName") + id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPublicIPPrefixID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PublicIPPrefixName != "publicIpPrefixName" { - t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIpPrefixName") + if id.PublicIPPrefixName != "publicIPPrefixName" { + t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIPPrefixName") } } func TestFormatPublicIPPrefixID(t *testing.T) { - actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIpPrefixName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName" + actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePublicIPPrefixID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName", Expected: &PublicIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIpPrefixName", + PublicIPPrefixName: "publicIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParsePublicIPPrefixIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName", Expected: &PublicIPPrefixId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIpPrefixName", + PublicIPPrefixName: "publicIPPrefixName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIpPrefixName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixName/extra", Error: true, }, { diff --git a/resource-manager/network/2024-03-01/routefilterrules/README.md b/resource-manager/network/2024-03-01/routefilterrules/README.md index ecd2c10d253..b45ae71eab1 100644 --- a/resource-manager/network/2024-03-01/routefilterrules/README.md +++ b/resource-manager/network/2024-03-01/routefilterrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") payload := routefilterrules.RouteFilterRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/routefilterrules/id_routefilterrule.go b/resource-manager/network/2024-03-01/routefilterrules/id_routefilterrule.go index 120d8a966e0..d06e7791dfc 100644 --- a/resource-manager/network/2024-03-01/routefilterrules/id_routefilterrule.go +++ b/resource-manager/network/2024-03-01/routefilterrules/id_routefilterrule.go @@ -123,7 +123,7 @@ func (id RouteFilterRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterName"), resourceids.StaticSegment("staticRouteFilterRules", "routeFilterRules", "routeFilterRules"), - resourceids.UserSpecifiedSegment("routeFilterRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("routeFilterRuleName", "routeFilterRuleName"), } } diff --git a/resource-manager/network/2024-03-01/routefilterrules/id_routefilterrule_test.go b/resource-manager/network/2024-03-01/routefilterrules/id_routefilterrule_test.go index b0d5daed59a..4a52969db44 100644 --- a/resource-manager/network/2024-03-01/routefilterrules/id_routefilterrule_test.go +++ b/resource-manager/network/2024-03-01/routefilterrules/id_routefilterrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteFilterRuleId{} func TestNewRouteFilterRuleID(t *testing.T) { - id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName") + id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRouteFilterRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterName") } - if id.RouteFilterRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "ruleName") + if id.RouteFilterRuleName != "routeFilterRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "routeFilterRuleName") } } func TestFormatRouteFilterRuleID(t *testing.T) { - actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName" + actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterName", "routeFilterRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRouteFilterRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RouteFilterName: "routeFilterName", - RouteFilterRuleName: "ruleName", + RouteFilterRuleName: "routeFilterRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRouteFilterRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", RouteFilterName: "routeFilterName", - RouteFilterRuleName: "ruleName", + RouteFilterRuleName: "routeFilterRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterName/routeFilterRules/routeFilterRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeNaMe", Expected: &RouteFilterRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", RouteFilterName: "rOuTeFiLtErNaMe", - RouteFilterRuleName: "rUlEnAmE", + RouteFilterRuleName: "rOuTeFiLtErRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErNaMe/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/routingrulecollections/README.md b/resource-manager/network/2024-03-01/routingrulecollections/README.md index 11ea9a6561d..ef390e4cd44 100644 --- a/resource-manager/network/2024-03-01/routingrulecollections/README.md +++ b/resource-manager/network/2024-03-01/routingrulecollections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := routingrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := routingrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName") payload := routingrulecollections.RoutingRuleCollection{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := routingrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := routingrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName") if err := client.DeleteThenPoll(ctx, id, routingrulecollections.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, routingrulecollections.DefaultDeleteOpe ```go ctx := context.TODO() -id := routingrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := routingrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := routingrulecollections.NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := routingrulecollections.NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName") // alternatively `client.List(ctx, id, routingrulecollections.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, routingrulecollections.DefaultListOperationOptions()) diff --git a/resource-manager/network/2024-03-01/routingrulecollections/id_routingconfiguration.go b/resource-manager/network/2024-03-01/routingrulecollections/id_routingconfiguration.go index 7ea668a419b..1f12375338a 100644 --- a/resource-manager/network/2024-03-01/routingrulecollections/id_routingconfiguration.go +++ b/resource-manager/network/2024-03-01/routingrulecollections/id_routingconfiguration.go @@ -123,7 +123,7 @@ func (id RoutingConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticRoutingConfigurations", "routingConfigurations", "routingConfigurations"), - resourceids.UserSpecifiedSegment("routingConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("routingConfigurationName", "routingConfigurationName"), } } diff --git a/resource-manager/network/2024-03-01/routingrulecollections/id_routingconfiguration_test.go b/resource-manager/network/2024-03-01/routingrulecollections/id_routingconfiguration_test.go index 532dc014f32..1181a338915 100644 --- a/resource-manager/network/2024-03-01/routingrulecollections/id_routingconfiguration_test.go +++ b/resource-manager/network/2024-03-01/routingrulecollections/id_routingconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoutingConfigurationId{} func TestNewRoutingConfigurationID(t *testing.T) { - id := NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRoutingConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.RoutingConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "configurationName") + if id.RoutingConfigurationName != "routingConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "routingConfigurationName") } } func TestFormatRoutingConfigurationID(t *testing.T) { - actual := NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName" + actual := NewRoutingConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRoutingConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Expected: &RoutingConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRoutingConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Expected: &RoutingConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE", Expected: &RoutingConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - RoutingConfigurationName: "cOnFiGuRaTiOnNaMe", + RoutingConfigurationName: "rOuTiNgCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/routingrulecollections/id_rulecollection.go b/resource-manager/network/2024-03-01/routingrulecollections/id_rulecollection.go index f0b3759e397..a6828c64486 100644 --- a/resource-manager/network/2024-03-01/routingrulecollections/id_rulecollection.go +++ b/resource-manager/network/2024-03-01/routingrulecollections/id_rulecollection.go @@ -129,7 +129,7 @@ func (id RuleCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticRoutingConfigurations", "routingConfigurations", "routingConfigurations"), - resourceids.UserSpecifiedSegment("routingConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("routingConfigurationName", "routingConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2024-03-01/routingrulecollections/id_rulecollection_test.go b/resource-manager/network/2024-03-01/routingrulecollections/id_rulecollection_test.go index 7f5f29dbbfe..a24f9f8fd34 100644 --- a/resource-manager/network/2024-03-01/routingrulecollections/id_rulecollection_test.go +++ b/resource-manager/network/2024-03-01/routingrulecollections/id_rulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionId{} func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.RoutingConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "configurationName") + if id.RoutingConfigurationName != "routingConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "routingConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewRuleCollectionID(t *testing.T) { } func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRuleCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - RoutingConfigurationName: "cOnFiGuRaTiOnNaMe", + RoutingConfigurationName: "rOuTiNgCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/routingrules/README.md b/resource-manager/network/2024-03-01/routingrules/README.md index caa303be1b9..64ff0a56155 100644 --- a/resource-manager/network/2024-03-01/routingrules/README.md +++ b/resource-manager/network/2024-03-01/routingrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := routingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := routingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName", "ruleName") payload := routingrules.RoutingRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := routingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := routingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName", "ruleName") if err := client.DeleteThenPoll(ctx, id, routingrules.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, routingrules.DefaultDeleteOperationOpti ```go ctx := context.TODO() -id := routingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := routingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName", "ruleName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := routingrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := routingrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/routingrules/id_rule.go b/resource-manager/network/2024-03-01/routingrules/id_rule.go index 5c144778806..6418e71b786 100644 --- a/resource-manager/network/2024-03-01/routingrules/id_rule.go +++ b/resource-manager/network/2024-03-01/routingrules/id_rule.go @@ -135,7 +135,7 @@ func (id RuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticRoutingConfigurations", "routingConfigurations", "routingConfigurations"), - resourceids.UserSpecifiedSegment("routingConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("routingConfigurationName", "routingConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), resourceids.StaticSegment("staticRules", "rules", "rules"), diff --git a/resource-manager/network/2024-03-01/routingrules/id_rule_test.go b/resource-manager/network/2024-03-01/routingrules/id_rule_test.go index af2b3517519..79c5f1ebcf1 100644 --- a/resource-manager/network/2024-03-01/routingrules/id_rule_test.go +++ b/resource-manager/network/2024-03-01/routingrules/id_rule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleId{} func TestNewRuleID(t *testing.T) { - id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") + id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName", "ruleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.RoutingConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "configurationName") + if id.RoutingConfigurationName != "routingConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "routingConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -40,8 +40,8 @@ func TestNewRuleID(t *testing.T) { } func TestFormatRuleID(t *testing.T) { - actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName" + actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName", "ruleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - RoutingConfigurationName: "cOnFiGuRaTiOnNaMe", + RoutingConfigurationName: "rOuTiNgCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", RuleName: "rUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/routingrules/id_rulecollection.go b/resource-manager/network/2024-03-01/routingrules/id_rulecollection.go index efa18246514..44d316acd6f 100644 --- a/resource-manager/network/2024-03-01/routingrules/id_rulecollection.go +++ b/resource-manager/network/2024-03-01/routingrules/id_rulecollection.go @@ -129,7 +129,7 @@ func (id RuleCollectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticRoutingConfigurations", "routingConfigurations", "routingConfigurations"), - resourceids.UserSpecifiedSegment("routingConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("routingConfigurationName", "routingConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2024-03-01/routingrules/id_rulecollection_test.go b/resource-manager/network/2024-03-01/routingrules/id_rulecollection_test.go index 9d78f890a50..79c7cf9ce28 100644 --- a/resource-manager/network/2024-03-01/routingrules/id_rulecollection_test.go +++ b/resource-manager/network/2024-03-01/routingrules/id_rulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionId{} func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.RoutingConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "configurationName") + if id.RoutingConfigurationName != "routingConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'RoutingConfigurationName'", id.RoutingConfigurationName, "routingConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewRuleCollectionID(t *testing.T) { } func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "routingConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseRuleCollectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - RoutingConfigurationName: "configurationName", + RoutingConfigurationName: "routingConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/routingConfigurations/routingConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &RuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - RoutingConfigurationName: "cOnFiGuRaTiOnNaMe", + RoutingConfigurationName: "rOuTiNgCoNfIgUrAtIoNnAmE", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/rOuTiNgCoNfIgUrAtIoNs/rOuTiNgCoNfIgUrAtIoNnAmE/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/securityadminconfigurations/README.md b/resource-manager/network/2024-03-01/securityadminconfigurations/README.md index b0fcb0ccf59..e72955e6e0d 100644 --- a/resource-manager/network/2024-03-01/securityadminconfigurations/README.md +++ b/resource-manager/network/2024-03-01/securityadminconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") payload := securityadminconfigurations.SecurityAdminConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDele ```go ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/securityadminconfigurations/id_securityadminconfiguration.go b/resource-manager/network/2024-03-01/securityadminconfigurations/id_securityadminconfiguration.go index 30b23886bf3..070ef0fa83e 100644 --- a/resource-manager/network/2024-03-01/securityadminconfigurations/id_securityadminconfiguration.go +++ b/resource-manager/network/2024-03-01/securityadminconfigurations/id_securityadminconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityAdminConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationName"), } } diff --git a/resource-manager/network/2024-03-01/securityadminconfigurations/id_securityadminconfiguration_test.go b/resource-manager/network/2024-03-01/securityadminconfigurations/id_securityadminconfiguration_test.go index 2e644cd781d..66fc3677b11 100644 --- a/resource-manager/network/2024-03-01/securityadminconfigurations/id_securityadminconfiguration_test.go +++ b/resource-manager/network/2024-03-01/securityadminconfigurations/id_securityadminconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityAdminConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityAdminConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "configurationName") + if id.SecurityAdminConfigurationName != "securityAdminConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationName") } } func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName" + actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityAdminConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityAdminConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityAdminConfigurationName: "configurationName", + SecurityAdminConfigurationName: "securityAdminConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityAdminConfigurations/securityAdminConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE", Expected: &SecurityAdminConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityAdminConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/securityuserconfigurations/README.md b/resource-manager/network/2024-03-01/securityuserconfigurations/README.md index 83adb7f1337..5437eb2a16c 100644 --- a/resource-manager/network/2024-03-01/securityuserconfigurations/README.md +++ b/resource-manager/network/2024-03-01/securityuserconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securityuserconfigurations.NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityuserconfigurations.NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName") payload := securityuserconfigurations.SecurityUserConfiguration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityuserconfigurations.NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityuserconfigurations.NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName") if err := client.DeleteThenPoll(ctx, id, securityuserconfigurations.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, securityuserconfigurations.DefaultDelet ```go ctx := context.TODO() -id := securityuserconfigurations.NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityuserconfigurations.NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/securityuserconfigurations/id_securityuserconfiguration.go b/resource-manager/network/2024-03-01/securityuserconfigurations/id_securityuserconfiguration.go index aa02e38380d..6df5321bd18 100644 --- a/resource-manager/network/2024-03-01/securityuserconfigurations/id_securityuserconfiguration.go +++ b/resource-manager/network/2024-03-01/securityuserconfigurations/id_securityuserconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityUserConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityUserConfigurations", "securityUserConfigurations", "securityUserConfigurations"), - resourceids.UserSpecifiedSegment("securityUserConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityUserConfigurationName", "securityUserConfigurationName"), } } diff --git a/resource-manager/network/2024-03-01/securityuserconfigurations/id_securityuserconfiguration_test.go b/resource-manager/network/2024-03-01/securityuserconfigurations/id_securityuserconfiguration_test.go index 331df84f6c1..f9324fcf41d 100644 --- a/resource-manager/network/2024-03-01/securityuserconfigurations/id_securityuserconfiguration_test.go +++ b/resource-manager/network/2024-03-01/securityuserconfigurations/id_securityuserconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityUserConfigurationId{} func TestNewSecurityUserConfigurationID(t *testing.T) { - id := NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityUserConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityUserConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "configurationName") + if id.SecurityUserConfigurationName != "securityUserConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "securityUserConfigurationName") } } func TestFormatSecurityUserConfigurationID(t *testing.T) { - actual := NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName" + actual := NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityUserConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Expected: &SecurityUserConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityUserConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Expected: &SecurityUserConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe", Expected: &SecurityUserConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityUserConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityUserConfigurationName: "sEcUrItYuSeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/securityuserrulecollections/README.md b/resource-manager/network/2024-03-01/securityuserrulecollections/README.md index 19b77d4424b..d94abcbf9a0 100644 --- a/resource-manager/network/2024-03-01/securityuserrulecollections/README.md +++ b/resource-manager/network/2024-03-01/securityuserrulecollections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securityuserrulecollections.NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := securityuserrulecollections.NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName") payload := securityuserrulecollections.SecurityUserRuleCollection{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityuserrulecollections.NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := securityuserrulecollections.NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName") if err := client.DeleteThenPoll(ctx, id, securityuserrulecollections.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, securityuserrulecollections.DefaultDele ```go ctx := context.TODO() -id := securityuserrulecollections.NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := securityuserrulecollections.NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityuserrulecollections.NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") +id := securityuserrulecollections.NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName") // alternatively `client.List(ctx, id, securityuserrulecollections.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, securityuserrulecollections.DefaultListOperationOptions()) diff --git a/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfiguration.go b/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfiguration.go index 0b05272a789..ab8dfdd078d 100644 --- a/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfiguration.go +++ b/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfiguration.go @@ -123,7 +123,7 @@ func (id SecurityUserConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityUserConfigurations", "securityUserConfigurations", "securityUserConfigurations"), - resourceids.UserSpecifiedSegment("securityUserConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityUserConfigurationName", "securityUserConfigurationName"), } } diff --git a/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfiguration_test.go b/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfiguration_test.go index d1b3c557cec..9164ec66054 100644 --- a/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfiguration_test.go +++ b/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityUserConfigurationId{} func TestNewSecurityUserConfigurationID(t *testing.T) { - id := NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName") + id := NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityUserConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityUserConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "configurationName") + if id.SecurityUserConfigurationName != "securityUserConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "securityUserConfigurationName") } } func TestFormatSecurityUserConfigurationID(t *testing.T) { - actual := NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName" + actual := NewSecurityUserConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSecurityUserConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Expected: &SecurityUserConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSecurityUserConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Expected: &SecurityUserConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe", Expected: &SecurityUserConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityUserConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityUserConfigurationName: "sEcUrItYuSeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfigurationrulecollection.go b/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfigurationrulecollection.go index fb81684f99e..2b4f8fd6ed5 100644 --- a/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfigurationrulecollection.go +++ b/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfigurationrulecollection.go @@ -129,7 +129,7 @@ func (id SecurityUserConfigurationRuleCollectionId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityUserConfigurations", "securityUserConfigurations", "securityUserConfigurations"), - resourceids.UserSpecifiedSegment("securityUserConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityUserConfigurationName", "securityUserConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfigurationrulecollection_test.go b/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfigurationrulecollection_test.go index 5d41264982d..5c6cdfca615 100644 --- a/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfigurationrulecollection_test.go +++ b/resource-manager/network/2024-03-01/securityuserrulecollections/id_securityuserconfigurationrulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityUserConfigurationRuleCollectionId{} func TestNewSecurityUserConfigurationRuleCollectionID(t *testing.T) { - id := NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewSecurityUserConfigurationRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityUserConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "configurationName") + if id.SecurityUserConfigurationName != "securityUserConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "securityUserConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewSecurityUserConfigurationRuleCollectionID(t *testing.T) { } func TestFormatSecurityUserConfigurationRuleCollectionID(t *testing.T) { - actual := NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSecurityUserConfigurationRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName", Expected: &SecurityUserConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSecurityUserConfigurationRuleCollectionIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName", Expected: &SecurityUserConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &SecurityUserConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityUserConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityUserConfigurationName: "sEcUrItYuSeRcOnFiGuRaTiOnNaMe", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/securityuserrules/README.md b/resource-manager/network/2024-03-01/securityuserrules/README.md index 1f961c9b089..c3506759641 100644 --- a/resource-manager/network/2024-03-01/securityuserrules/README.md +++ b/resource-manager/network/2024-03-01/securityuserrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securityuserrules.NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := securityuserrules.NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName", "ruleName") payload := securityuserrules.SecurityUserRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityuserrules.NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := securityuserrules.NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName", "ruleName") if err := client.DeleteThenPoll(ctx, id, securityuserrules.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id, securityuserrules.DefaultDeleteOperatio ```go ctx := context.TODO() -id := securityuserrules.NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") +id := securityuserrules.NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName", "ruleName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securityuserrules.NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") +id := securityuserrules.NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/securityuserrules/id_rulecollectionrule.go b/resource-manager/network/2024-03-01/securityuserrules/id_rulecollectionrule.go index 4af43a72557..0dad04170f3 100644 --- a/resource-manager/network/2024-03-01/securityuserrules/id_rulecollectionrule.go +++ b/resource-manager/network/2024-03-01/securityuserrules/id_rulecollectionrule.go @@ -135,7 +135,7 @@ func (id RuleCollectionRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityUserConfigurations", "securityUserConfigurations", "securityUserConfigurations"), - resourceids.UserSpecifiedSegment("securityUserConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityUserConfigurationName", "securityUserConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), resourceids.StaticSegment("staticRules", "rules", "rules"), diff --git a/resource-manager/network/2024-03-01/securityuserrules/id_rulecollectionrule_test.go b/resource-manager/network/2024-03-01/securityuserrules/id_rulecollectionrule_test.go index 493e71aa0fa..b98ffe0219b 100644 --- a/resource-manager/network/2024-03-01/securityuserrules/id_rulecollectionrule_test.go +++ b/resource-manager/network/2024-03-01/securityuserrules/id_rulecollectionrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleCollectionRuleId{} func TestNewRuleCollectionRuleID(t *testing.T) { - id := NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName") + id := NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName", "ruleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRuleCollectionRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityUserConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "configurationName") + if id.SecurityUserConfigurationName != "securityUserConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "securityUserConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -40,8 +40,8 @@ func TestNewRuleCollectionRuleID(t *testing.T) { } func TestFormatRuleCollectionRuleID(t *testing.T) { - actual := NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName" + actual := NewRuleCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName", "ruleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseRuleCollectionRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleCollectionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseRuleCollectionRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/rules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/rules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName", Expected: &RuleCollectionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", RuleCollectionName: "ruleCollectionName", RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/rules/ruleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE", Expected: &RuleCollectionRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityUserConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityUserConfigurationName: "sEcUrItYuSeRcOnFiGuRaTiOnNaMe", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", RuleName: "rUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/rUlEs/rUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/securityuserrules/id_securityuserconfigurationrulecollection.go b/resource-manager/network/2024-03-01/securityuserrules/id_securityuserconfigurationrulecollection.go index 6574f9ebd29..208548d7529 100644 --- a/resource-manager/network/2024-03-01/securityuserrules/id_securityuserconfigurationrulecollection.go +++ b/resource-manager/network/2024-03-01/securityuserrules/id_securityuserconfigurationrulecollection.go @@ -129,7 +129,7 @@ func (id SecurityUserConfigurationRuleCollectionId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerName"), resourceids.StaticSegment("staticSecurityUserConfigurations", "securityUserConfigurations", "securityUserConfigurations"), - resourceids.UserSpecifiedSegment("securityUserConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("securityUserConfigurationName", "securityUserConfigurationName"), resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionName"), } diff --git a/resource-manager/network/2024-03-01/securityuserrules/id_securityuserconfigurationrulecollection_test.go b/resource-manager/network/2024-03-01/securityuserrules/id_securityuserconfigurationrulecollection_test.go index fe4ddc70732..6704a0c3439 100644 --- a/resource-manager/network/2024-03-01/securityuserrules/id_securityuserconfigurationrulecollection_test.go +++ b/resource-manager/network/2024-03-01/securityuserrules/id_securityuserconfigurationrulecollection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityUserConfigurationRuleCollectionId{} func TestNewSecurityUserConfigurationRuleCollectionID(t *testing.T) { - id := NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName") + id := NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewSecurityUserConfigurationRuleCollectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerName") } - if id.SecurityUserConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "configurationName") + if id.SecurityUserConfigurationName != "securityUserConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityUserConfigurationName'", id.SecurityUserConfigurationName, "securityUserConfigurationName") } if id.RuleCollectionName != "ruleCollectionName" { @@ -36,8 +36,8 @@ func TestNewSecurityUserConfigurationRuleCollectionID(t *testing.T) { } func TestFormatSecurityUserConfigurationRuleCollectionID(t *testing.T) { - actual := NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "configurationName", "ruleCollectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName" + actual := NewSecurityUserConfigurationRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerName", "securityUserConfigurationName", "ruleCollectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSecurityUserConfigurationRuleCollectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName", Expected: &SecurityUserConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSecurityUserConfigurationRuleCollectionIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName", Expected: &SecurityUserConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkManagerName: "networkManagerName", - SecurityUserConfigurationName: "configurationName", + SecurityUserConfigurationName: "securityUserConfigurationName", RuleCollectionName: "ruleCollectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/configurationName/ruleCollections/ruleCollectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerName/securityUserConfigurations/securityUserConfigurationName/ruleCollections/ruleCollectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE", Expected: &SecurityUserConfigurationRuleCollectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkManagerName: "nEtWoRkMaNaGeRnAmE", - SecurityUserConfigurationName: "cOnFiGuRaTiOnNaMe", + SecurityUserConfigurationName: "sEcUrItYuSeRcOnFiGuRaTiOnNaMe", RuleCollectionName: "rUlEcOlLeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRnAmE/sEcUrItYuSeRcOnFiGuRaTiOnS/sEcUrItYuSeRcOnFiGuRaTiOnNaMe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/servicetags/README.md b/resource-manager/network/2024-03-01/servicetags/README.md index 713c8f5e554..36b7a941146 100644 --- a/resource-manager/network/2024-03-01/servicetags/README.md +++ b/resource-manager/network/2024-03-01/servicetags/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ServiceTagInformationList(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions())` can be used to do batched pagination items, err := client.ServiceTagInformationListComplete(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ServiceTagsList(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/servicetags/id_location.go b/resource-manager/network/2024-03-01/servicetags/id_location.go index 82d35d1f77c..5040a3f420a 100644 --- a/resource-manager/network/2024-03-01/servicetags/id_location.go +++ b/resource-manager/network/2024-03-01/servicetags/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/servicetags/id_location_test.go b/resource-manager/network/2024-03-01/servicetags/id_location_test.go index bb87f65c1d0..003c4b42ddf 100644 --- a/resource-manager/network/2024-03-01/servicetags/id_location_test.go +++ b/resource-manager/network/2024-03-01/servicetags/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/usages/README.md b/resource-manager/network/2024-03-01/usages/README.md index f7148c30c7a..ac3c458aa8c 100644 --- a/resource-manager/network/2024-03-01/usages/README.md +++ b/resource-manager/network/2024-03-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/usages/id_location.go b/resource-manager/network/2024-03-01/usages/id_location.go index 2fe99ba303b..5f505126c1e 100644 --- a/resource-manager/network/2024-03-01/usages/id_location.go +++ b/resource-manager/network/2024-03-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/network/2024-03-01/usages/id_location_test.go b/resource-manager/network/2024-03-01/usages/id_location_test.go index b3c8d46ad6a..8b2dce92bff 100644 --- a/resource-manager/network/2024-03-01/usages/id_location_test.go +++ b/resource-manager/network/2024-03-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/vipswap/README.md b/resource-manager/network/2024-03-01/vipswap/README.md index 062884f6995..f8d4cf9aeb6 100644 --- a/resource-manager/network/2024-03-01/vipswap/README.md +++ b/resource-manager/network/2024-03-01/vipswap/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") payload := vipswap.SwapResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/vipswap/id_cloudservice.go b/resource-manager/network/2024-03-01/vipswap/id_cloudservice.go index 0b7dd65e3bd..93c12d9c01d 100644 --- a/resource-manager/network/2024-03-01/vipswap/id_cloudservice.go +++ b/resource-manager/network/2024-03-01/vipswap/id_cloudservice.go @@ -111,11 +111,11 @@ func (id CloudServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), - resourceids.UserSpecifiedSegment("resourceGroupName", "groupName"), + resourceids.UserSpecifiedSegment("resourceGroupName", "resourceGroupName"), resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "resourceName"), + resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceName"), } } diff --git a/resource-manager/network/2024-03-01/vipswap/id_cloudservice_test.go b/resource-manager/network/2024-03-01/vipswap/id_cloudservice_test.go index ffca7a5d07d..4bc26e07dc5 100644 --- a/resource-manager/network/2024-03-01/vipswap/id_cloudservice_test.go +++ b/resource-manager/network/2024-03-01/vipswap/id_cloudservice_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &CloudServiceId{} func TestNewCloudServiceID(t *testing.T) { - id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName") + id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ResourceGroupName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "groupName") + if id.ResourceGroupName != "resourceGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupName") } - if id.CloudServiceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "resourceName") + if id.CloudServiceName != "cloudServiceName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceName") } } func TestFormatCloudServiceID(t *testing.T) { - actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "groupName", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName" + actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupName", "cloudServiceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -63,36 +63,36 @@ func TestParseCloudServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", - CloudServiceName: "resourceName", + ResourceGroupName: "resourceGroupName", + CloudServiceName: "cloudServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName/extra", Error: true, }, } @@ -169,70 +169,70 @@ func TestParseCloudServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "groupName", - CloudServiceName: "resourceName", + ResourceGroupName: "resourceGroupName", + CloudServiceName: "cloudServiceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/groupName/providers/Microsoft.Compute/cloudServices/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupName/providers/Microsoft.Compute/cloudServices/cloudServiceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEnAmE", Expected: &CloudServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "gRoUpNaMe", - CloudServiceName: "rEsOuRcEnAmE", + ResourceGroupName: "rEsOuRcEgRoUpNaMe", + CloudServiceName: "cLoUdSeRvIcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/gRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpNaMe/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualappliancesites/README.md b/resource-manager/network/2024-03-01/virtualappliancesites/README.md index 19d7bcb8aea..9b1b90a265b 100644 --- a/resource-manager/network/2024-03-01/virtualappliancesites/README.md +++ b/resource-manager/network/2024-03-01/virtualappliancesites/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") payload := virtualappliancesites.VirtualApplianceSite{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/virtualappliancesites/id_virtualappliancesite.go b/resource-manager/network/2024-03-01/virtualappliancesites/id_virtualappliancesite.go index 87e626d1b0c..592f4f47427 100644 --- a/resource-manager/network/2024-03-01/virtualappliancesites/id_virtualappliancesite.go +++ b/resource-manager/network/2024-03-01/virtualappliancesites/id_virtualappliancesite.go @@ -123,7 +123,7 @@ func (id VirtualApplianceSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticVirtualApplianceSites", "virtualApplianceSites", "virtualApplianceSites"), - resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "siteName"), + resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "virtualApplianceSiteName"), } } diff --git a/resource-manager/network/2024-03-01/virtualappliancesites/id_virtualappliancesite_test.go b/resource-manager/network/2024-03-01/virtualappliancesites/id_virtualappliancesite_test.go index ffff3d499f0..672639aa072 100644 --- a/resource-manager/network/2024-03-01/virtualappliancesites/id_virtualappliancesite_test.go +++ b/resource-manager/network/2024-03-01/virtualappliancesites/id_virtualappliancesite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualApplianceSiteId{} func TestNewVirtualApplianceSiteID(t *testing.T) { - id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName") + id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewVirtualApplianceSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.VirtualApplianceSiteName != "siteName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "siteName") + if id.VirtualApplianceSiteName != "virtualApplianceSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "virtualApplianceSiteName") } } func TestFormatVirtualApplianceSiteID(t *testing.T) { - actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "siteName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName" + actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "virtualApplianceSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseVirtualApplianceSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - VirtualApplianceSiteName: "siteName", + VirtualApplianceSiteName: "virtualApplianceSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseVirtualApplianceSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - VirtualApplianceSiteName: "siteName", + VirtualApplianceSiteName: "virtualApplianceSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/siteName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/virtualApplianceSites/virtualApplianceSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/sItEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEnAmE", Expected: &VirtualApplianceSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - VirtualApplianceSiteName: "sItEnAmE", + VirtualApplianceSiteName: "vIrTuAlApPlIaNcEsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/sItEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualapplianceskus/README.md b/resource-manager/network/2024-03-01/virtualapplianceskus/README.md index 8e435228b3b..f782b817349 100644 --- a/resource-manager/network/2024-03-01/virtualapplianceskus/README.md +++ b/resource-manager/network/2024-03-01/virtualapplianceskus/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName") +id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/virtualapplianceskus/id_networkvirtualappliancesku.go b/resource-manager/network/2024-03-01/virtualapplianceskus/id_networkvirtualappliancesku.go index 46855c565e3..5eb920193a9 100644 --- a/resource-manager/network/2024-03-01/virtualapplianceskus/id_networkvirtualappliancesku.go +++ b/resource-manager/network/2024-03-01/virtualapplianceskus/id_networkvirtualappliancesku.go @@ -107,7 +107,7 @@ func (id NetworkVirtualApplianceSkuId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticNetworkVirtualApplianceSkus", "networkVirtualApplianceSkus", "networkVirtualApplianceSkus"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "skuName"), + resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "networkVirtualApplianceSkuName"), } } diff --git a/resource-manager/network/2024-03-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go b/resource-manager/network/2024-03-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go index 6901430cd2e..7ca3e924a1e 100644 --- a/resource-manager/network/2024-03-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go +++ b/resource-manager/network/2024-03-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &NetworkVirtualApplianceSkuId{} func TestNewNetworkVirtualApplianceSkuID(t *testing.T) { - id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName") + id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.NetworkVirtualApplianceSkuName != "skuName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "skuName") + if id.NetworkVirtualApplianceSkuName != "networkVirtualApplianceSkuName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "networkVirtualApplianceSkuName") } } func TestFormatNetworkVirtualApplianceSkuID(t *testing.T) { - actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "skuName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName" + actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseNetworkVirtualApplianceSkuID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "skuName", + NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseNetworkVirtualApplianceSkuIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "skuName", + NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/sKuNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUnAmE", Expected: &NetworkVirtualApplianceSkuId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "sKuNaMe", + NetworkVirtualApplianceSkuName: "nEtWoRkViRtUaLaPpLiAnCeSkUnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/sKuNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/README.md b/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/README.md index 4aed89cc84a..e01886e1873 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/README.md +++ b/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") read, err := client.Get(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.GetIkeSasThenPoll(ctx, id); err != nil { // handle the error @@ -82,7 +82,7 @@ if err := client.GetIkeSasThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") read, err := client.GetSharedKey(ctx, id) if err != nil { @@ -115,7 +115,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if err := client.ResetConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -127,7 +127,7 @@ if err := client.ResetConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{ // ... @@ -144,7 +144,7 @@ if err := client.ResetSharedKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.ConnectionSharedKey{ // ... @@ -161,7 +161,7 @@ if err := client.SetSharedKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{ // ... @@ -178,7 +178,7 @@ if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{ // ... @@ -195,7 +195,7 @@ if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgatewayconnections.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/id_connection.go b/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/id_connection.go index fcc51d5666b..25fa92d5238 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/id_connection.go +++ b/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/id_connection.go @@ -115,7 +115,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "virtualNetworkGatewayConnectionName"), + resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } } diff --git a/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/id_connection_test.go b/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/id_connection_test.go index 19029d7c27e..271fc3c17bd 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/id_connection_test.go +++ b/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectionName != "virtualNetworkGatewayConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "virtualNetworkGatewayConnectionName") + if id.ConnectionName != "connectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionName") } } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go index e7481a70176..34b83087000 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go +++ b/resource-manager/network/2024-03-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go @@ -4,5 +4,5 @@ package virtualnetworkgatewayconnections // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-03-01/virtualnetworkgateways/README.md b/resource-manager/network/2024-03-01/virtualnetworkgateways/README.md index 518a1123bb0..9397f2c4e20 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgateways/README.md +++ b/resource-manager/network/2024-03-01/virtualnetworkgateways/README.md @@ -153,13 +153,13 @@ if err := client.GetLearnedRoutesThenPoll(ctx, id); err != nil { ``` -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageUrl` +### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageURL` ```go ctx := context.TODO() id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayName") -if err := client.GetVpnProfilePackageUrlThenPoll(ctx, id); err != nil { +if err := client.GetVpnProfilePackageURLThenPoll(ctx, id); err != nil { // handle the error } ``` @@ -397,7 +397,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") +id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") payload := virtualnetworkgateways.VpnDeviceScriptParameters{ // ... diff --git a/resource-manager/network/2024-03-01/virtualnetworkgateways/id_connection.go b/resource-manager/network/2024-03-01/virtualnetworkgateways/id_connection.go index fb0eb751b39..7e0a849bdfd 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgateways/id_connection.go +++ b/resource-manager/network/2024-03-01/virtualnetworkgateways/id_connection.go @@ -115,7 +115,7 @@ func (id ConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "virtualNetworkGatewayConnectionName"), + resourceids.UserSpecifiedSegment("connectionName", "connectionName"), } } diff --git a/resource-manager/network/2024-03-01/virtualnetworkgateways/id_connection_test.go b/resource-manager/network/2024-03-01/virtualnetworkgateways/id_connection_test.go index 255ca4bbb2c..f523578a93d 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgateways/id_connection_test.go +++ b/resource-manager/network/2024-03-01/virtualnetworkgateways/id_connection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionId{} func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName") + id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ConnectionName != "virtualNetworkGatewayConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "virtualNetworkGatewayConnectionName") + if id.ConnectionName != "connectionName" { + t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionName") } } func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName" + actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ConnectionName: "virtualNetworkGatewayConnectionName", + ConnectionName: "connectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/virtualNetworkGatewayConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE", Expected: &ConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe", + ConnectionName: "cOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/vIrTuAlNeTwOrKgAtEwAyCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go b/resource-manager/network/2024-03-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go index c247730a0c5..e814c6eff38 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go +++ b/resource-manager/network/2024-03-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go @@ -14,15 +14,15 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type GetVpnProfilePackageUrlOperationResponse struct { +type GetVpnProfilePackageURLOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData Model *string } -// GetVpnProfilePackageUrl ... -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageUrlOperationResponse, err error) { +// GetVpnProfilePackageURL ... +func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -56,15 +56,15 @@ func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Contex return } -// GetVpnProfilePackageUrlThenPoll performs GetVpnProfilePackageUrl then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrlThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnProfilePackageUrl(ctx, id) +// GetVpnProfilePackageURLThenPoll performs GetVpnProfilePackageURL then polls until it's completed +func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageURLThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { + result, err := c.GetVpnProfilePackageURL(ctx, id) if err != nil { - return fmt.Errorf("performing GetVpnProfilePackageUrl: %+v", err) + return fmt.Errorf("performing GetVpnProfilePackageURL: %+v", err) } if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnProfilePackageUrl: %+v", err) + return fmt.Errorf("polling after GetVpnProfilePackageURL: %+v", err) } return nil diff --git a/resource-manager/network/2024-03-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2024-03-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go index 091426a3451..25f6fba8d55 100644 --- a/resource-manager/network/2024-03-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go +++ b/resource-manager/network/2024-03-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go @@ -4,5 +4,5 @@ package virtualnetworkgateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-03-01/virtualnetworktap/README.md b/resource-manager/network/2024-03-01/virtualnetworktap/README.md index b4eb6e6ef7a..f3c65cd3f13 100644 --- a/resource-manager/network/2024-03-01/virtualnetworktap/README.md +++ b/resource-manager/network/2024-03-01/virtualnetworktap/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") payload := virtualnetworktap.VirtualNetworkTap{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") payload := virtualnetworktap.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/virtualnetworktap/id_virtualnetworktap.go b/resource-manager/network/2024-03-01/virtualnetworktap/id_virtualnetworktap.go index 87f32e385ac..48bd4716023 100644 --- a/resource-manager/network/2024-03-01/virtualnetworktap/id_virtualnetworktap.go +++ b/resource-manager/network/2024-03-01/virtualnetworktap/id_virtualnetworktap.go @@ -115,7 +115,7 @@ func (id VirtualNetworkTapId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVirtualNetworkTaps", "virtualNetworkTaps", "virtualNetworkTaps"), - resourceids.UserSpecifiedSegment("virtualNetworkTapName", "tapName"), + resourceids.UserSpecifiedSegment("virtualNetworkTapName", "virtualNetworkTapName"), } } diff --git a/resource-manager/network/2024-03-01/virtualnetworktap/id_virtualnetworktap_test.go b/resource-manager/network/2024-03-01/virtualnetworktap/id_virtualnetworktap_test.go index 638e22fc419..614dfaaf5fd 100644 --- a/resource-manager/network/2024-03-01/virtualnetworktap/id_virtualnetworktap_test.go +++ b/resource-manager/network/2024-03-01/virtualnetworktap/id_virtualnetworktap_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkTapId{} func TestNewVirtualNetworkTapID(t *testing.T) { - id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName") + id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualNetworkTapID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualNetworkTapName != "tapName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "tapName") + if id.VirtualNetworkTapName != "virtualNetworkTapName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "virtualNetworkTapName") } } func TestFormatVirtualNetworkTapID(t *testing.T) { - actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "tapName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName" + actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualNetworkTapID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "tapName", + VirtualNetworkTapName: "virtualNetworkTapName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVirtualNetworkTapIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "tapName", + VirtualNetworkTapName: "virtualNetworkTapName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/tapName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/tApNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApNaMe", Expected: &VirtualNetworkTapId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkTapName: "tApNaMe", + VirtualNetworkTapName: "vIrTuAlNeTwOrKtApNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/tApNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualwans/README.md b/resource-manager/network/2024-03-01/virtualwans/README.md index 446e1eb10a8..e240763e952 100644 --- a/resource-manager/network/2024-03-01/virtualwans/README.md +++ b/resource-manager/network/2024-03-01/virtualwans/README.md @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.VirtualWanVpnProfileParameters{ // ... @@ -104,7 +104,7 @@ if err := client.GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx, ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") payload := virtualwans.HubRouteTable{ // ... @@ -121,7 +121,7 @@ if err := client.HubRouteTablesCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -133,7 +133,7 @@ if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") read, err := client.HubRouteTablesGet(ctx, id) if err != nil { @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") payload := virtualwans.HubVirtualNetworkConnection{ // ... @@ -183,7 +183,7 @@ if err := client.HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx, id, pay ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -195,7 +195,7 @@ if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil ```go ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") read, err := client.HubVirtualNetworkConnectionsGet(ctx, id) if err != nil { @@ -228,7 +228,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") payload := virtualwans.VpnGatewayNatRule{ // ... @@ -245,7 +245,7 @@ if err := client.NatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -257,7 +257,7 @@ if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") read, err := client.NatRulesGet(ctx, id) if err != nil { @@ -273,7 +273,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") // alternatively `client.NatRulesListByVpnGateway(ctx, id)` can be used to do batched pagination items, err := client.NatRulesListByVpnGatewayComplete(ctx, id) @@ -290,7 +290,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") payload := virtualwans.NetworkVirtualApplianceConnection{ // ... @@ -307,7 +307,7 @@ if err := client.NetworkVirtualApplianceConnectionsCreateOrUpdateThenPoll(ctx, i ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -319,7 +319,7 @@ if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err ```go ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") +id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") read, err := client.NetworkVirtualApplianceConnectionsGet(ctx, id) if err != nil { @@ -352,7 +352,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") payload := virtualwans.P2SVpnGateway{ // ... @@ -369,7 +369,7 @@ if err := client.P2sVpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -381,7 +381,7 @@ if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayName") read, err := client.P2sVpnGatewaysGet(ctx, id) if err != nil { @@ -555,7 +555,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") read, err := client.SupportedSecurityProviders(ctx, id) if err != nil { @@ -571,7 +571,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.TagsObject{ // ... @@ -592,7 +592,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") payload := virtualwans.BgpConnection{ // ... @@ -609,7 +609,7 @@ if err := client.VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -621,7 +621,7 @@ if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") read, err := client.VirtualHubBgpConnectionGet(ctx, id) if err != nil { @@ -654,7 +654,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); err != nil { // handle the error @@ -666,7 +666,7 @@ if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); ```go ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hubName", "connectionName") +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "bgpConnectionName") if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err != nil { // handle the error @@ -678,7 +678,7 @@ if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") payload := virtualwans.HubIPConfiguration{ // ... @@ -695,7 +695,7 @@ if err := client.VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx, id, payloa ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -707,7 +707,7 @@ if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigName") +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "ipConfigurationName") read, err := client.VirtualHubIPConfigurationGet(ctx, id) if err != nil { @@ -953,7 +953,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.VirtualWAN{ // ... @@ -970,7 +970,7 @@ if err := client.VirtualWansCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -982,7 +982,7 @@ if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") read, err := client.VirtualWansGet(ctx, id) if err != nil { @@ -1032,7 +1032,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnection{ // ... @@ -1049,7 +1049,7 @@ if err := client.VpnConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1061,7 +1061,7 @@ if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") read, err := client.VpnConnectionsGet(ctx, id) if err != nil { @@ -1077,7 +1077,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") // alternatively `client.VpnConnectionsListByVpnGateway(ctx, id)` can be used to do batched pagination items, err := client.VpnConnectionsListByVpnGatewayComplete(ctx, id) @@ -1094,7 +1094,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnectionPacketCaptureStartParameters{ // ... @@ -1111,7 +1111,7 @@ if err := client.VpnConnectionsStartPacketCaptureThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") payload := virtualwans.VpnConnectionPacketCaptureStopParameters{ // ... @@ -1128,7 +1128,7 @@ if err := client.VpnConnectionsStopPacketCaptureThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := virtualwans.VpnGateway{ // ... @@ -1145,7 +1145,7 @@ if err := client.VpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -1157,7 +1157,7 @@ if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") read, err := client.VpnGatewaysGet(ctx, id) if err != nil { @@ -1207,7 +1207,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") // alternatively `client.VpnLinkConnectionsGetAllSharedKeys(ctx, id)` can be used to do batched pagination items, err := client.VpnLinkConnectionsGetAllSharedKeysComplete(ctx, id) @@ -1224,7 +1224,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") read, err := client.VpnLinkConnectionsGetDefaultSharedKey(ctx, id) if err != nil { @@ -1240,7 +1240,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { // handle the error @@ -1252,7 +1252,7 @@ if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName") +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName") // alternatively `client.VpnLinkConnectionsListByVpnConnection(ctx, id)` can be used to do batched pagination items, err := client.VpnLinkConnectionsListByVpnConnectionComplete(ctx, id) @@ -1269,7 +1269,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") read, err := client.VpnLinkConnectionsListDefaultSharedKey(ctx, id) if err != nil { @@ -1285,7 +1285,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") payload := virtualwans.ConnectionSharedKeyResult{ // ... @@ -1302,7 +1302,7 @@ if err := client.VpnLinkConnectionsSetOrInitDefaultSharedKeyThenPoll(ctx, id, pa ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if err := client.VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx, id); err != nil { // handle the error @@ -1393,7 +1393,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") read, err := client.VpnSiteLinkConnectionsGet(ctx, id) if err != nil { @@ -1442,7 +1442,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") payload := virtualwans.GetVpnSitesConfigurationRequest{ // ... diff --git a/resource-manager/network/2024-03-01/virtualwans/id_hubroutetable.go b/resource-manager/network/2024-03-01/virtualwans/id_hubroutetable.go index 5c93c30fb69..12d932e8523 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_hubroutetable.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_hubroutetable.go @@ -123,7 +123,7 @@ func (id HubRouteTableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubName"), resourceids.StaticSegment("staticHubRouteTables", "hubRouteTables", "hubRouteTables"), - resourceids.UserSpecifiedSegment("hubRouteTableName", "routeTableName"), + resourceids.UserSpecifiedSegment("hubRouteTableName", "hubRouteTableName"), } } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_hubroutetable_test.go b/resource-manager/network/2024-03-01/virtualwans/id_hubroutetable_test.go index 7432f35dfa8..68d653182ed 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_hubroutetable_test.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_hubroutetable_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubRouteTableId{} func TestNewHubRouteTableID(t *testing.T) { - id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName") + id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHubRouteTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubName") } - if id.HubRouteTableName != "routeTableName" { - t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "routeTableName") + if id.HubRouteTableName != "hubRouteTableName" { + t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "hubRouteTableName") } } func TestFormatHubRouteTableID(t *testing.T) { - actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "routeTableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName" + actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubRouteTableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHubRouteTableID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubRouteTableName: "routeTableName", + HubRouteTableName: "hubRouteTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHubRouteTableIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubRouteTableName: "routeTableName", + HubRouteTableName: "hubRouteTableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/routeTableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubRouteTables/hubRouteTableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/rOuTeTaBlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/hUbRoUtEtAbLeNaMe", Expected: &HubRouteTableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualHubName: "vIrTuAlHuBnAmE", - HubRouteTableName: "rOuTeTaBlEnAmE", + HubRouteTableName: "hUbRoUtEtAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/rOuTeTaBlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbRoUtEtAbLeS/hUbRoUtEtAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_hubvirtualnetworkconnection.go b/resource-manager/network/2024-03-01/virtualwans/id_hubvirtualnetworkconnection.go index 3db347a9c76..17eee4937eb 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_hubvirtualnetworkconnection.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_hubvirtualnetworkconnection.go @@ -123,7 +123,7 @@ func (id HubVirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubName"), resourceids.StaticSegment("staticHubVirtualNetworkConnections", "hubVirtualNetworkConnections", "hubVirtualNetworkConnections"), - resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "hubVirtualNetworkConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_hubvirtualnetworkconnection_test.go b/resource-manager/network/2024-03-01/virtualwans/id_hubvirtualnetworkconnection_test.go index 1dc09c40461..fcfebd848f0 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_hubvirtualnetworkconnection_test.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_hubvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubVirtualNetworkConnectionId{} func TestNewHubVirtualNetworkConnectionID(t *testing.T) { - id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName") + id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHubVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubName") } - if id.HubVirtualNetworkConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "connectionName") + if id.HubVirtualNetworkConnectionName != "hubVirtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "hubVirtualNetworkConnectionName") } } func TestFormatHubVirtualNetworkConnectionID(t *testing.T) { - actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName" + actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubName", "hubVirtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHubVirtualNetworkConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubVirtualNetworkConnectionName: "connectionName", + HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHubVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VirtualHubName: "virtualHubName", - HubVirtualNetworkConnectionName: "connectionName", + HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubName/hubVirtualNetworkConnections/hubVirtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe", Expected: &HubVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VirtualHubName: "vIrTuAlHuBnAmE", - HubVirtualNetworkConnectionName: "cOnNeCtIoNnAmE", + HubVirtualNetworkConnectionName: "hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBnAmE/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_natrule.go b/resource-manager/network/2024-03-01/virtualwans/id_natrule.go index 5441dc04ec9..ab096bb8e61 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_natrule.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_natrule.go @@ -121,7 +121,7 @@ func (id NatRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticNatRules", "natRules", "natRules"), resourceids.UserSpecifiedSegment("natRuleName", "natRuleName"), } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_natrule_test.go b/resource-manager/network/2024-03-01/virtualwans/id_natrule_test.go index 9cc9a07875a..0b0048431d8 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_natrule_test.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_natrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NatRuleId{} func TestNewNatRuleID(t *testing.T) { - id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName") + id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNatRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } if id.NatRuleName != "natRuleName" { @@ -32,8 +32,8 @@ func TestNewNatRuleID(t *testing.T) { } func TestFormatNatRuleID(t *testing.T) { - actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "natRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName" + actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "natRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNatRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", NatRuleName: "natRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNatRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", NatRuleName: "natRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/natRules/natRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/natRules/natRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS/nAtRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS/nAtRuLeNaMe", Expected: &NatRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", NatRuleName: "nAtRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/nAtRuLeS/nAtRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/nAtRuLeS/nAtRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_networkvirtualapplianceconnection.go b/resource-manager/network/2024-03-01/virtualwans/id_networkvirtualapplianceconnection.go index eea1f6b9dd2..fbbc66efaec 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_networkvirtualapplianceconnection.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_networkvirtualapplianceconnection.go @@ -123,7 +123,7 @@ func (id NetworkVirtualApplianceConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceName"), resourceids.StaticSegment("staticNetworkVirtualApplianceConnections", "networkVirtualApplianceConnections", "networkVirtualApplianceConnections"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "networkVirtualApplianceConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_networkvirtualapplianceconnection_test.go b/resource-manager/network/2024-03-01/virtualwans/id_networkvirtualapplianceconnection_test.go index b9686058751..e467eaa75a2 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_networkvirtualapplianceconnection_test.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_networkvirtualapplianceconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkVirtualApplianceConnectionId{} func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { - id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName") + id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceName") } - if id.NetworkVirtualApplianceConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "connectionName") + if id.NetworkVirtualApplianceConnectionName != "networkVirtualApplianceConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "networkVirtualApplianceConnectionName") } } func TestFormatNetworkVirtualApplianceConnectionID(t *testing.T) { - actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "connectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName" + actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceName", "networkVirtualApplianceConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNetworkVirtualApplianceConnectionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - NetworkVirtualApplianceConnectionName: "connectionName", + NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNetworkVirtualApplianceConnectionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NetworkVirtualApplianceName: "networkVirtualApplianceName", - NetworkVirtualApplianceConnectionName: "connectionName", + NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/connectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceName/networkVirtualApplianceConnections/networkVirtualApplianceConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe", Expected: &NetworkVirtualApplianceConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeNaMe", - NetworkVirtualApplianceConnectionName: "cOnNeCtIoNnAmE", + NetworkVirtualApplianceConnectionName: "nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/cOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeNaMe/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_virtualwan.go b/resource-manager/network/2024-03-01/virtualwans/id_virtualwan.go index 7ba33187730..fa94d154c26 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_virtualwan.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_virtualwan.go @@ -115,7 +115,7 @@ func (id VirtualWANId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVirtualWans", "virtualWans", "virtualWans"), - resourceids.UserSpecifiedSegment("virtualWanName", "virtualWANName"), + resourceids.UserSpecifiedSegment("virtualWanName", "virtualWanName"), } } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_virtualwan_test.go b/resource-manager/network/2024-03-01/virtualwans/id_virtualwan_test.go index 0fb34067d23..b07670d82b4 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_virtualwan_test.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_virtualwan_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualWANId{} func TestNewVirtualWANID(t *testing.T) { - id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName") + id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVirtualWANID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VirtualWanName != "virtualWANName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWANName") + if id.VirtualWanName != "virtualWanName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWanName") } } func TestFormatVirtualWANID(t *testing.T) { - actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWANName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName" + actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVirtualWANID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName", Expected: &VirtualWANId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWANName", + VirtualWanName: "virtualWanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseVirtualWANIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName", Expected: &VirtualWANId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWANName", + VirtualWanName: "virtualWanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWANName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanName/extra", Error: true, }, { diff --git a/resource-manager/network/2024-03-01/virtualwans/id_vpngateway.go b/resource-manager/network/2024-03-01/virtualwans/id_vpngateway.go index 0ba0e40f11c..4aac85c0d13 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_vpngateway.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_vpngateway.go @@ -115,7 +115,7 @@ func (id VpnGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), } } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_vpngateway_test.go b/resource-manager/network/2024-03-01/virtualwans/id_vpngateway_test.go index b5d1b5de3a0..c7406d1fb5a 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_vpngateway_test.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_vpngateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnGatewayId{} func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") + id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVpnGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } } func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName" + actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVpnGatewayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVpnGatewayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_vpnlinkconnection.go b/resource-manager/network/2024-03-01/virtualwans/id_vpnlinkconnection.go index 6ee7f540d57..98326bfe842 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_vpnlinkconnection.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_vpnlinkconnection.go @@ -127,11 +127,11 @@ func (id VpnLinkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionName"), resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "linkConnectionName"), + resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/virtualwans/id_vpnlinkconnection_test.go b/resource-manager/network/2024-03-01/virtualwans/id_vpnlinkconnection_test.go index eb904ad1498..98ddb202383 100644 --- a/resource-manager/network/2024-03-01/virtualwans/id_vpnlinkconnection_test.go +++ b/resource-manager/network/2024-03-01/virtualwans/id_vpnlinkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnLinkConnectionId{} func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") + id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVpnLinkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } - if id.VpnConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "connectionName") + if id.VpnConnectionName != "vpnConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionName") } - if id.VpnLinkConnectionName != "linkConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "linkConnectionName") + if id.VpnLinkConnectionName != "vpnLinkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionName") } } func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName" + actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVpnLinkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", - VpnConnectionName: "cOnNeCtIoNnAmE", - VpnLinkConnectionName: "lInKcOnNeCtIoNnAmE", + VpnGatewayName: "vPnGaTeWaYnAmE", + VpnConnectionName: "vPnCoNnEcTiOnNaMe", + VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/virtualwans/model_getvpnsitesconfigurationrequest.go b/resource-manager/network/2024-03-01/virtualwans/model_getvpnsitesconfigurationrequest.go index 0dd233101ce..cd349d0cb2f 100644 --- a/resource-manager/network/2024-03-01/virtualwans/model_getvpnsitesconfigurationrequest.go +++ b/resource-manager/network/2024-03-01/virtualwans/model_getvpnsitesconfigurationrequest.go @@ -4,6 +4,6 @@ package virtualwans // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type GetVpnSitesConfigurationRequest struct { - OutputBlobSasUrl string `json:"outputBlobSasUrl"` + OutputBlobSasURL string `json:"outputBlobSasUrl"` VpnSites *[]string `json:"vpnSites,omitempty"` } diff --git a/resource-manager/network/2024-03-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go b/resource-manager/network/2024-03-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go index de501375c21..a2a50d9eb92 100644 --- a/resource-manager/network/2024-03-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go +++ b/resource-manager/network/2024-03-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go @@ -5,5 +5,5 @@ package virtualwans type VpnConnectionPacketCaptureStopParameters struct { LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-03-01/virtualwans/model_vpnprofileresponse.go b/resource-manager/network/2024-03-01/virtualwans/model_vpnprofileresponse.go index a96c942841c..ed24cd4584e 100644 --- a/resource-manager/network/2024-03-01/virtualwans/model_vpnprofileresponse.go +++ b/resource-manager/network/2024-03-01/virtualwans/model_vpnprofileresponse.go @@ -4,5 +4,5 @@ package virtualwans // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` + ProfileURL *string `json:"profileUrl,omitempty"` } diff --git a/resource-manager/network/2024-03-01/vmsspublicipaddresses/README.md b/resource-manager/network/2024-03-01/vmsspublicipaddresses/README.md index 3720e9082ab..9dae73b1bb3 100644 --- a/resource-manager/network/2024-03-01/vmsspublicipaddresses/README.md +++ b/resource-manager/network/2024-03-01/vmsspublicipaddresses/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName", "publicIpAddressName") +id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName", "publicIPAddressName") read, err := client.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx, id, vmsspublicipaddresses.DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions()) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineIndex", "networkInterfaceName", "ipConfigurationName") +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetName", "virtualMachineName", "networkInterfaceName", "ipConfigurationName") // alternatively `client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id)` can be used to do batched pagination items, err := client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx, id) diff --git a/resource-manager/network/2024-03-01/vpngateways/README.md b/resource-manager/network/2024-03-01/vpngateways/README.md index 26033b33d4f..d9d749105a9 100644 --- a/resource-manager/network/2024-03-01/vpngateways/README.md +++ b/resource-manager/network/2024-03-01/vpngateways/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions()); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.VpnGatewayPacketCaptureStartParameters{ // ... @@ -53,7 +53,7 @@ if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.VpnGatewayPacketCaptureStopParameters{ // ... @@ -70,7 +70,7 @@ if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") payload := vpngateways.TagsObject{ // ... diff --git a/resource-manager/network/2024-03-01/vpngateways/id_vpngateway.go b/resource-manager/network/2024-03-01/vpngateways/id_vpngateway.go index 52e05b7b7b8..220d3ffa7b3 100644 --- a/resource-manager/network/2024-03-01/vpngateways/id_vpngateway.go +++ b/resource-manager/network/2024-03-01/vpngateways/id_vpngateway.go @@ -115,7 +115,7 @@ func (id VpnGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), } } diff --git a/resource-manager/network/2024-03-01/vpngateways/id_vpngateway_test.go b/resource-manager/network/2024-03-01/vpngateways/id_vpngateway_test.go index f2707bf53e6..c9c4abcd122 100644 --- a/resource-manager/network/2024-03-01/vpngateways/id_vpngateway_test.go +++ b/resource-manager/network/2024-03-01/vpngateways/id_vpngateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnGatewayId{} func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName") + id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVpnGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } } func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName" + actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVpnGatewayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVpnGatewayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", + VpnGatewayName: "vpnGatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Expected: &VpnGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", + VpnGatewayName: "vPnGaTeWaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go b/resource-manager/network/2024-03-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go index ca9fe7cf71d..95998f06000 100644 --- a/resource-manager/network/2024-03-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go +++ b/resource-manager/network/2024-03-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go @@ -4,5 +4,5 @@ package vpngateways // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VpnGatewayPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/network/2024-03-01/vpnlinkconnections/id_vpnlinkconnection.go b/resource-manager/network/2024-03-01/vpnlinkconnections/id_vpnlinkconnection.go index 33a950d143f..986725e2fc1 100644 --- a/resource-manager/network/2024-03-01/vpnlinkconnections/id_vpnlinkconnection.go +++ b/resource-manager/network/2024-03-01/vpnlinkconnections/id_vpnlinkconnection.go @@ -127,11 +127,11 @@ func (id VpnLinkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "gatewayName"), + resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayName"), resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "connectionName"), + resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionName"), resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "linkConnectionName"), + resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionName"), } } diff --git a/resource-manager/network/2024-03-01/vpnlinkconnections/id_vpnlinkconnection_test.go b/resource-manager/network/2024-03-01/vpnlinkconnections/id_vpnlinkconnection_test.go index c6f966d4d10..59a74f2f8ea 100644 --- a/resource-manager/network/2024-03-01/vpnlinkconnections/id_vpnlinkconnection_test.go +++ b/resource-manager/network/2024-03-01/vpnlinkconnections/id_vpnlinkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VpnLinkConnectionId{} func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName") + id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVpnLinkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VpnGatewayName != "gatewayName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "gatewayName") + if id.VpnGatewayName != "vpnGatewayName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayName") } - if id.VpnConnectionName != "connectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "connectionName") + if id.VpnConnectionName != "vpnConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionName") } - if id.VpnLinkConnectionName != "linkConnectionName" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "linkConnectionName") + if id.VpnLinkConnectionName != "vpnLinkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionName") } } func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "gatewayName", "connectionName", "linkConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName" + actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayName", "vpnConnectionName", "vpnLinkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVpnLinkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VpnGatewayName: "gatewayName", - VpnConnectionName: "connectionName", - VpnLinkConnectionName: "linkConnectionName", + VpnGatewayName: "vpnGatewayName", + VpnConnectionName: "vpnConnectionName", + VpnLinkConnectionName: "vpnLinkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/gatewayName/vpnConnections/connectionName/vpnLinkConnections/linkConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayName/vpnConnections/vpnConnectionName/vpnLinkConnections/vpnLinkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe", Expected: &VpnLinkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "gAtEwAyNaMe", - VpnConnectionName: "cOnNeCtIoNnAmE", - VpnLinkConnectionName: "lInKcOnNeCtIoNnAmE", + VpnGatewayName: "vPnGaTeWaYnAmE", + VpnConnectionName: "vPnCoNnEcTiOnNaMe", + VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/gAtEwAyNaMe/vPnCoNnEcTiOnS/cOnNeCtIoNnAmE/vPnLiNkCoNnEcTiOnS/lInKcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYnAmE/vPnCoNnEcTiOnS/vPnCoNnEcTiOnNaMe/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/README.md b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/README.md index 79211ec263a..3ca5fee1169 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/README.md +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/constants.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/constants.go index 63d3d7fcf9a..95342653237 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/constants.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/constants.go @@ -3074,9 +3074,9 @@ const ( WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" + WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" + WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" - WebApplicationFirewallTransformUrlDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformUrlEncode WebApplicationFirewallTransform = "UrlEncode" ) func PossibleValuesForWebApplicationFirewallTransform() []string { @@ -3085,9 +3085,9 @@ func PossibleValuesForWebApplicationFirewallTransform() []string { string(WebApplicationFirewallTransformLowercase), string(WebApplicationFirewallTransformRemoveNulls), string(WebApplicationFirewallTransformTrim), + string(WebApplicationFirewallTransformURLDecode), + string(WebApplicationFirewallTransformURLEncode), string(WebApplicationFirewallTransformUppercase), - string(WebApplicationFirewallTransformUrlDecode), - string(WebApplicationFirewallTransformUrlEncode), } } @@ -3110,9 +3110,9 @@ func parseWebApplicationFirewallTransform(input string) (*WebApplicationFirewall "lowercase": WebApplicationFirewallTransformLowercase, "removenulls": WebApplicationFirewallTransformRemoveNulls, "trim": WebApplicationFirewallTransformTrim, + "urldecode": WebApplicationFirewallTransformURLDecode, + "urlencode": WebApplicationFirewallTransformURLEncode, "uppercase": WebApplicationFirewallTransformUppercase, - "urldecode": WebApplicationFirewallTransformUrlDecode, - "urlencode": WebApplicationFirewallTransformUrlEncode, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go index 0a49b366bfc..3004461fd8a 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go @@ -115,7 +115,7 @@ func (id ApplicationGatewayWebApplicationFirewallPolicyId) Segments() []resource resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticApplicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "applicationGatewayWebApplicationFirewallPolicyName"), } } diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go index c2ea316bba5..205d73da565 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationGatewayWebApplicationFirewallPolicyId{} func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName") + id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ApplicationGatewayWebApplicationFirewallPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "policyName") + if id.ApplicationGatewayWebApplicationFirewallPolicyName != "applicationGatewayWebApplicationFirewallPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "applicationGatewayWebApplicationFirewallPolicyName") } } func TestFormatApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName" + actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "policyName", + ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(t *t }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "policyName", + ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE", Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayWebApplicationFirewallPolicyName: "pOlIcYnAmE", + ApplicationGatewayWebApplicationFirewallPolicyName: "aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go index 82f3501791c..b1f6dd22b0d 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go @@ -4,6 +4,6 @@ package webapplicationfirewallpolicies // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` } diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go index f4f485b405b..6cdbb059a1b 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go @@ -38,6 +38,6 @@ type ApplicationGatewayPropertiesFormat struct { SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + UrlPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` } diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go index 7808c57c7f7..6103c017cb4 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go @@ -10,6 +10,6 @@ type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` } diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go index ed418b0d4a5..18cc34e55af 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go @@ -6,5 +6,5 @@ package webapplicationfirewallpolicies type ApplicationGatewayRewriteRuleActionSet struct { RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` + UrlConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` } diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go index 03021e43980..c6de0fdbc1b 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go @@ -3,7 +3,7 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlConfiguration struct { +type ApplicationGatewayURLConfiguration struct { ModifiedPath *string `json:"modifiedPath,omitempty"` ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` Reroute *bool `json:"reroute,omitempty"` diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go index 57b9cac7aa3..96a3dc6d985 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go @@ -3,10 +3,10 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMap struct { +type ApplicationGatewayURLPathMap struct { Etag *string `json:"etag,omitempty"` Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` + Properties *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Type *string `json:"type,omitempty"` } diff --git a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go index e69ae8cbde4..e02847a3fd9 100644 --- a/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go +++ b/resource-manager/network/2024-03-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go @@ -3,7 +3,7 @@ package webapplicationfirewallpolicies // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ApplicationGatewayUrlPathMapPropertiesFormat struct { +type ApplicationGatewayURLPathMapPropertiesFormat struct { DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` diff --git a/resource-manager/network/2024-03-01/webcategories/README.md b/resource-manager/network/2024-03-01/webcategories/README.md index bb0f330f948..d7a59c0519d 100644 --- a/resource-manager/network/2024-03-01/webcategories/README.md +++ b/resource-manager/network/2024-03-01/webcategories/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name") +id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName") read, err := client.Get(ctx, id, webcategories.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/network/2024-03-01/webcategories/id_azurewebcategory.go b/resource-manager/network/2024-03-01/webcategories/id_azurewebcategory.go index 5971766dc63..9e7d76c94f2 100644 --- a/resource-manager/network/2024-03-01/webcategories/id_azurewebcategory.go +++ b/resource-manager/network/2024-03-01/webcategories/id_azurewebcategory.go @@ -107,7 +107,7 @@ func (id AzureWebCategoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticAzureWebCategories", "azureWebCategories", "azureWebCategories"), - resourceids.UserSpecifiedSegment("azureWebCategoryName", "name"), + resourceids.UserSpecifiedSegment("azureWebCategoryName", "azureWebCategoryName"), } } diff --git a/resource-manager/network/2024-03-01/webcategories/id_azurewebcategory_test.go b/resource-manager/network/2024-03-01/webcategories/id_azurewebcategory_test.go index a6e5d9ec9de..08826593ed1 100644 --- a/resource-manager/network/2024-03-01/webcategories/id_azurewebcategory_test.go +++ b/resource-manager/network/2024-03-01/webcategories/id_azurewebcategory_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &AzureWebCategoryId{} func TestNewAzureWebCategoryID(t *testing.T) { - id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name") + id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.AzureWebCategoryName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "name") + if id.AzureWebCategoryName != "azureWebCategoryName" { + t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "azureWebCategoryName") } } func TestFormatAzureWebCategoryID(t *testing.T) { - actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name" + actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseAzureWebCategoryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "name", + AzureWebCategoryName: "azureWebCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseAzureWebCategoryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "name", + AzureWebCategoryName: "azureWebCategoryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYnAmE", Expected: &AzureWebCategoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "nAmE", + AzureWebCategoryName: "aZuReWeBcAtEgOrYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYnAmE/extra", Error: true, }, } diff --git a/resource-manager/networkanalytics/2023-11-15/dataproducts/model_consumptionendpointsproperties.go b/resource-manager/networkanalytics/2023-11-15/dataproducts/model_consumptionendpointsproperties.go index 58e330cb98b..2aba63004bd 100644 --- a/resource-manager/networkanalytics/2023-11-15/dataproducts/model_consumptionendpointsproperties.go +++ b/resource-manager/networkanalytics/2023-11-15/dataproducts/model_consumptionendpointsproperties.go @@ -5,9 +5,9 @@ package dataproducts type ConsumptionEndpointsProperties struct { FileAccessResourceId *string `json:"fileAccessResourceId,omitempty"` - FileAccessUrl *string `json:"fileAccessUrl,omitempty"` + FileAccessURL *string `json:"fileAccessUrl,omitempty"` IngestionResourceId *string `json:"ingestionResourceId,omitempty"` - IngestionUrl *string `json:"ingestionUrl,omitempty"` + IngestionURL *string `json:"ingestionUrl,omitempty"` QueryResourceId *string `json:"queryResourceId,omitempty"` - QueryUrl *string `json:"queryUrl,omitempty"` + QueryURL *string `json:"queryUrl,omitempty"` } diff --git a/resource-manager/networkanalytics/2023-11-15/dataproducts/model_dataproductproperties.go b/resource-manager/networkanalytics/2023-11-15/dataproducts/model_dataproductproperties.go index d1521c1c995..7a8b12dc8e0 100644 --- a/resource-manager/networkanalytics/2023-11-15/dataproducts/model_dataproductproperties.go +++ b/resource-manager/networkanalytics/2023-11-15/dataproducts/model_dataproductproperties.go @@ -10,7 +10,7 @@ type DataProductProperties struct { CustomerEncryptionKey *EncryptionKeyDetails `json:"customerEncryptionKey,omitempty"` CustomerManagedKeyEncryptionEnabled *ControlState `json:"customerManagedKeyEncryptionEnabled,omitempty"` Documentation *string `json:"documentation,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` MajorVersion string `json:"majorVersion"` ManagedResourceGroupConfiguration *ManagedResourceGroupConfiguration `json:"managedResourceGroupConfiguration,omitempty"` Networkacls *DataProductNetworkAcls `json:"networkacls,omitempty"` diff --git a/resource-manager/networkanalytics/2023-11-15/dataproducts/model_keyvaultinfo.go b/resource-manager/networkanalytics/2023-11-15/dataproducts/model_keyvaultinfo.go index 816c1cce981..cd79f214760 100644 --- a/resource-manager/networkanalytics/2023-11-15/dataproducts/model_keyvaultinfo.go +++ b/resource-manager/networkanalytics/2023-11-15/dataproducts/model_keyvaultinfo.go @@ -4,5 +4,5 @@ package dataproducts // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultInfo struct { - KeyVaultUrl string `json:"keyVaultUrl"` + KeyVaultURL string `json:"keyVaultUrl"` } diff --git a/resource-manager/networkanalytics/2023-11-15/datatypes/model_datatypeproperties.go b/resource-manager/networkanalytics/2023-11-15/datatypes/model_datatypeproperties.go index 93ff6804541..73bb305007f 100644 --- a/resource-manager/networkanalytics/2023-11-15/datatypes/model_datatypeproperties.go +++ b/resource-manager/networkanalytics/2023-11-15/datatypes/model_datatypeproperties.go @@ -10,5 +10,5 @@ type DataTypeProperties struct { State *DataTypeState `json:"state,omitempty"` StateReason *string `json:"stateReason,omitempty"` StorageOutputRetention *int64 `json:"storageOutputRetention,omitempty"` - VisualizationUrl *string `json:"visualizationUrl,omitempty"` + VisualizationURL *string `json:"visualizationUrl,omitempty"` } diff --git a/resource-manager/networkcloud/2023-07-01/networkclouds/model_imagerepositorycredentials.go b/resource-manager/networkcloud/2023-07-01/networkclouds/model_imagerepositorycredentials.go index 548b8dfc266..59801505f31 100644 --- a/resource-manager/networkcloud/2023-07-01/networkclouds/model_imagerepositorycredentials.go +++ b/resource-manager/networkcloud/2023-07-01/networkclouds/model_imagerepositorycredentials.go @@ -5,6 +5,6 @@ package networkclouds type ImageRepositoryCredentials struct { Password string `json:"password"` - RegistryUrl string `json:"registryUrl"` + RegistryURL string `json:"registryUrl"` Username string `json:"username"` } diff --git a/resource-manager/newrelic/2022-07-01/monitors/model_newrelicsinglesignonproperties.go b/resource-manager/newrelic/2022-07-01/monitors/model_newrelicsinglesignonproperties.go index c3f68f48dfb..6fad7183505 100644 --- a/resource-manager/newrelic/2022-07-01/monitors/model_newrelicsinglesignonproperties.go +++ b/resource-manager/newrelic/2022-07-01/monitors/model_newrelicsinglesignonproperties.go @@ -7,5 +7,5 @@ type NewRelicSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/newrelic/2022-07-01/tagrules/README.md b/resource-manager/newrelic/2022-07-01/tagrules/README.md index 5186c452ff2..7e324ae07e8 100644 --- a/resource-manager/newrelic/2022-07-01/tagrules/README.md +++ b/resource-manager/newrelic/2022-07-01/tagrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRuleUpdate{ // ... diff --git a/resource-manager/newrelic/2022-07-01/tagrules/id_tagrule.go b/resource-manager/newrelic/2022-07-01/tagrules/id_tagrule.go index bb6020fe85a..0b0569e9a92 100644 --- a/resource-manager/newrelic/2022-07-01/tagrules/id_tagrule.go +++ b/resource-manager/newrelic/2022-07-01/tagrules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/newrelic/2022-07-01/tagrules/id_tagrule_test.go b/resource-manager/newrelic/2022-07-01/tagrules/id_tagrule_test.go index d00dc35f741..1b82aad452c 100644 --- a/resource-manager/newrelic/2022-07-01/tagrules/id_tagrule_test.go +++ b/resource-manager/newrelic/2022-07-01/tagrules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/newrelic/2024-03-01/monitors/model_newrelicsinglesignonproperties.go b/resource-manager/newrelic/2024-03-01/monitors/model_newrelicsinglesignonproperties.go index c3f68f48dfb..6fad7183505 100644 --- a/resource-manager/newrelic/2024-03-01/monitors/model_newrelicsinglesignonproperties.go +++ b/resource-manager/newrelic/2024-03-01/monitors/model_newrelicsinglesignonproperties.go @@ -7,5 +7,5 @@ type NewRelicSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/newrelic/2024-03-01/tagrules/README.md b/resource-manager/newrelic/2024-03-01/tagrules/README.md index f762a8bc7f3..55d61646d58 100644 --- a/resource-manager/newrelic/2024-03-01/tagrules/README.md +++ b/resource-manager/newrelic/2024-03-01/tagrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRuleUpdate{ // ... diff --git a/resource-manager/newrelic/2024-03-01/tagrules/id_tagrule.go b/resource-manager/newrelic/2024-03-01/tagrules/id_tagrule.go index bb6020fe85a..0b0569e9a92 100644 --- a/resource-manager/newrelic/2024-03-01/tagrules/id_tagrule.go +++ b/resource-manager/newrelic/2024-03-01/tagrules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/newrelic/2024-03-01/tagrules/id_tagrule_test.go b/resource-manager/newrelic/2024-03-01/tagrules/id_tagrule_test.go index d00dc35f741..1b82aad452c 100644 --- a/resource-manager/newrelic/2024-03-01/tagrules/id_tagrule_test.go +++ b/resource-manager/newrelic/2024-03-01/tagrules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/newrelic/2024-10-01/monitors/model_newrelicsinglesignonproperties.go b/resource-manager/newrelic/2024-10-01/monitors/model_newrelicsinglesignonproperties.go index c3f68f48dfb..6fad7183505 100644 --- a/resource-manager/newrelic/2024-10-01/monitors/model_newrelicsinglesignonproperties.go +++ b/resource-manager/newrelic/2024-10-01/monitors/model_newrelicsinglesignonproperties.go @@ -7,5 +7,5 @@ type NewRelicSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/newrelic/2024-10-01/resubscribe/model_newrelicsinglesignonproperties.go b/resource-manager/newrelic/2024-10-01/resubscribe/model_newrelicsinglesignonproperties.go index e9a6fd2062e..4c350ccd914 100644 --- a/resource-manager/newrelic/2024-10-01/resubscribe/model_newrelicsinglesignonproperties.go +++ b/resource-manager/newrelic/2024-10-01/resubscribe/model_newrelicsinglesignonproperties.go @@ -7,5 +7,5 @@ type NewRelicSingleSignOnProperties struct { EnterpriseAppId *string `json:"enterpriseAppId,omitempty"` ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` SingleSignOnState *SingleSignOnStates `json:"singleSignOnState,omitempty"` - SingleSignOnUrl *string `json:"singleSignOnUrl,omitempty"` + SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` } diff --git a/resource-manager/newrelic/2024-10-01/tagrules/README.md b/resource-manager/newrelic/2024-10-01/tagrules/README.md index 54b0814df6d..868b6f06784 100644 --- a/resource-manager/newrelic/2024-10-01/tagrules/README.md +++ b/resource-manager/newrelic/2024-10-01/tagrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") +id := tagrules.NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") payload := tagrules.TagRuleUpdate{ // ... diff --git a/resource-manager/newrelic/2024-10-01/tagrules/id_tagrule.go b/resource-manager/newrelic/2024-10-01/tagrules/id_tagrule.go index bb6020fe85a..0b0569e9a92 100644 --- a/resource-manager/newrelic/2024-10-01/tagrules/id_tagrule.go +++ b/resource-manager/newrelic/2024-10-01/tagrules/id_tagrule.go @@ -123,7 +123,7 @@ func (id TagRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticMonitors", "monitors", "monitors"), resourceids.UserSpecifiedSegment("monitorName", "monitorName"), resourceids.StaticSegment("staticTagRules", "tagRules", "tagRules"), - resourceids.UserSpecifiedSegment("tagRuleName", "ruleSetName"), + resourceids.UserSpecifiedSegment("tagRuleName", "tagRuleName"), } } diff --git a/resource-manager/newrelic/2024-10-01/tagrules/id_tagrule_test.go b/resource-manager/newrelic/2024-10-01/tagrules/id_tagrule_test.go index d00dc35f741..1b82aad452c 100644 --- a/resource-manager/newrelic/2024-10-01/tagrules/id_tagrule_test.go +++ b/resource-manager/newrelic/2024-10-01/tagrules/id_tagrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagRuleId{} func TestNewTagRuleID(t *testing.T) { - id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName") + id := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTagRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'MonitorName'", id.MonitorName, "monitorName") } - if id.TagRuleName != "ruleSetName" { - t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "ruleSetName") + if id.TagRuleName != "tagRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'TagRuleName'", id.TagRuleName, "tagRuleName") } } func TestFormatTagRuleID(t *testing.T) { - actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "ruleSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName" + actual := NewTagRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "monitorName", "tagRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTagRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTagRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", MonitorName: "monitorName", - TagRuleName: "ruleSetName", + TagRuleName: "tagRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/ruleSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/NewRelic.Observability/monitors/monitorName/tagRules/tagRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe", Expected: &TagRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", MonitorName: "mOnItOrNaMe", - TagRuleName: "rUlEsEtNaMe", + TagRuleName: "tAgRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/rUlEsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nEwReLiC.ObSeRvAbIlItY/mOnItOrS/mOnItOrNaMe/tAgRuLeS/tAgRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/README.md b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/README.md index dcdfc714554..8b68ba4f115 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/README.md +++ b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName") +id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName") payload := nginxcertificate.NginxCertificate{ // ... @@ -41,7 +41,7 @@ if err := client.CertificatesCreateOrUpdateThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName") +id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName") if err := client.CertificatesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.CertificatesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName") +id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName") read, err := client.CertificatesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := nginxcertificate.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxcertificate.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") // alternatively `client.CertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CertificatesListComplete(ctx, id) diff --git a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_certificate.go b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_certificate.go index 6953311959f..2e67036475e 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_certificate.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_certificate_test.go b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_certificate_test.go index ed68f8db3f7..6c6efd96508 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_certificate_test.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_nginxdeployment.go b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_nginxdeployment.go index 061b73c073c..1fcb78071af 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_nginxdeployment.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_nginxdeployment.go @@ -115,7 +115,7 @@ func (id NginxDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), } } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_nginxdeployment_test.go b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_nginxdeployment_test.go index 0cc2b33b337..25d1659324d 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_nginxdeployment_test.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxcertificate/id_nginxdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NginxDeploymentId{} func TestNewNginxDeploymentID(t *testing.T) { - id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") + id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNginxDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } } func TestFormatNginxDeploymentID(t *testing.T) { - actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName" + actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNginxDeploymentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNginxDeploymentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/README.md b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/README.md index 77cace45e7c..a315f7a9067 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/README.md +++ b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") +id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") payload := nginxconfiguration.NginxConfiguration{ // ... @@ -41,7 +41,7 @@ if err := client.ConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") +id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") if err := client.ConfigurationsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ConfigurationsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") +id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") read, err := client.ConfigurationsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := nginxconfiguration.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxconfiguration.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") // alternatively `client.ConfigurationsList(ctx, id)` can be used to do batched pagination items, err := client.ConfigurationsListComplete(ctx, id) diff --git a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_configuration.go b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_configuration.go index c714eae3605..5b815b38c18 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_configuration.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_configuration_test.go b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_configuration_test.go index d24c0bdec20..ae67bf963aa 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_configuration_test.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_nginxdeployment.go b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_nginxdeployment.go index e359a29b582..a9894b6e912 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_nginxdeployment.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_nginxdeployment.go @@ -115,7 +115,7 @@ func (id NginxDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), } } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_nginxdeployment_test.go b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_nginxdeployment_test.go index 758870ed668..c3d651c79ab 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_nginxdeployment_test.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxconfiguration/id_nginxdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NginxDeploymentId{} func TestNewNginxDeploymentID(t *testing.T) { - id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") + id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNginxDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } } func TestFormatNginxDeploymentID(t *testing.T) { - actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName" + actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNginxDeploymentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNginxDeploymentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/README.md b/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/README.md index e32cde9556e..4e907b402de 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/README.md +++ b/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nginxconfigurationanalysis.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") +id := nginxconfigurationanalysis.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") payload := nginxconfigurationanalysis.AnalysisCreate{ // ... diff --git a/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/id_configuration.go b/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/id_configuration.go index 06b670e325f..3ceeb4f9371 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/id_configuration.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/id_configuration_test.go b/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/id_configuration_test.go index 7c480a2432d..4c09f68d290 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/id_configuration_test.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxconfigurationanalysis/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxdeployment/README.md b/resource-manager/nginx/2024-01-01-preview/nginxdeployment/README.md index 46fa56b2754..eac718712e4 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxdeployment/README.md +++ b/resource-manager/nginx/2024-01-01-preview/nginxdeployment/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") payload := nginxdeployment.NginxDeployment{ // ... @@ -42,7 +42,7 @@ if err := client.DeploymentsCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") if err := client.DeploymentsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeploymentsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") read, err := client.DeploymentsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") payload := nginxdeployment.NginxDeploymentUpdateParameters{ // ... diff --git a/resource-manager/nginx/2024-01-01-preview/nginxdeployment/id_nginxdeployment.go b/resource-manager/nginx/2024-01-01-preview/nginxdeployment/id_nginxdeployment.go index e327d5bf884..101e5a4b4be 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxdeployment/id_nginxdeployment.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxdeployment/id_nginxdeployment.go @@ -115,7 +115,7 @@ func (id NginxDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), } } diff --git a/resource-manager/nginx/2024-01-01-preview/nginxdeployment/id_nginxdeployment_test.go b/resource-manager/nginx/2024-01-01-preview/nginxdeployment/id_nginxdeployment_test.go index 1717c5d006d..55758302ad6 100644 --- a/resource-manager/nginx/2024-01-01-preview/nginxdeployment/id_nginxdeployment_test.go +++ b/resource-manager/nginx/2024-01-01-preview/nginxdeployment/id_nginxdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NginxDeploymentId{} func TestNewNginxDeploymentID(t *testing.T) { - id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") + id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNginxDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } } func TestFormatNginxDeploymentID(t *testing.T) { - actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName" + actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNginxDeploymentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNginxDeploymentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/README.md b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/README.md index f563baa6e1a..387436015c1 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/README.md +++ b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName") +id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName") payload := nginxcertificate.NginxCertificate{ // ... @@ -41,7 +41,7 @@ if err := client.CertificatesCreateOrUpdateThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName") +id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName") if err := client.CertificatesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.CertificatesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName") +id := nginxcertificate.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName") read, err := client.CertificatesGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := nginxcertificate.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxcertificate.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") // alternatively `client.CertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CertificatesListComplete(ctx, id) diff --git a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_certificate.go b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_certificate.go index 6953311959f..2e67036475e 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_certificate.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_certificate.go @@ -121,7 +121,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_certificate_test.go b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_certificate_test.go index ed68f8db3f7..6c6efd96508 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_certificate_test.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } if id.CertificateName != "certificateName" { @@ -32,8 +32,8 @@ func TestNewCertificateID(t *testing.T) { } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/certificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_nginxdeployment.go b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_nginxdeployment.go index 061b73c073c..1fcb78071af 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_nginxdeployment.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_nginxdeployment.go @@ -115,7 +115,7 @@ func (id NginxDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), } } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_nginxdeployment_test.go b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_nginxdeployment_test.go index 0cc2b33b337..25d1659324d 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_nginxdeployment_test.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxcertificate/id_nginxdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NginxDeploymentId{} func TestNewNginxDeploymentID(t *testing.T) { - id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") + id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNginxDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } } func TestFormatNginxDeploymentID(t *testing.T) { - actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName" + actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNginxDeploymentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNginxDeploymentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/README.md b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/README.md index 93b8a637350..6fe2ad8ef80 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/README.md +++ b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") +id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") payload := nginxconfiguration.NginxConfiguration{ // ... @@ -41,7 +41,7 @@ if err := client.ConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") +id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") if err := client.ConfigurationsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.ConfigurationsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") +id := nginxconfiguration.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") read, err := client.ConfigurationsGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := nginxconfiguration.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxconfiguration.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") // alternatively `client.ConfigurationsList(ctx, id)` can be used to do batched pagination items, err := client.ConfigurationsListComplete(ctx, id) diff --git a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_configuration.go b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_configuration.go index c714eae3605..5b815b38c18 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_configuration.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_configuration_test.go b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_configuration_test.go index d24c0bdec20..ae67bf963aa 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_configuration_test.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_nginxdeployment.go b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_nginxdeployment.go index e359a29b582..a9894b6e912 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_nginxdeployment.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_nginxdeployment.go @@ -115,7 +115,7 @@ func (id NginxDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), } } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_nginxdeployment_test.go b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_nginxdeployment_test.go index 758870ed668..c3d651c79ab 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_nginxdeployment_test.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxconfiguration/id_nginxdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NginxDeploymentId{} func TestNewNginxDeploymentID(t *testing.T) { - id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") + id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNginxDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } } func TestFormatNginxDeploymentID(t *testing.T) { - actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName" + actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNginxDeploymentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNginxDeploymentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/README.md b/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/README.md index 2191418a77a..4aac6b23690 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/README.md +++ b/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nginxconfigurationanalysis.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") +id := nginxconfigurationanalysis.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") payload := nginxconfigurationanalysis.AnalysisCreate{ // ... diff --git a/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/id_configuration.go b/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/id_configuration.go index 06b670e325f..3ceeb4f9371 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/id_configuration.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/id_configuration_test.go b/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/id_configuration_test.go index 7c480a2432d..4c09f68d290 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/id_configuration_test.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxconfigurationanalysis/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxdeployment/README.md b/resource-manager/nginx/2024-06-01-preview/nginxdeployment/README.md index 1a38a1dd562..47447400eb1 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxdeployment/README.md +++ b/resource-manager/nginx/2024-06-01-preview/nginxdeployment/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") payload := nginxdeployment.NginxDeployment{ // ... @@ -42,7 +42,7 @@ if err := client.DeploymentsCreateOrUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") if err := client.DeploymentsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeploymentsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") read, err := client.DeploymentsGet(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") +id := nginxdeployment.NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") payload := nginxdeployment.NginxDeploymentUpdateParameters{ // ... diff --git a/resource-manager/nginx/2024-06-01-preview/nginxdeployment/id_nginxdeployment.go b/resource-manager/nginx/2024-06-01-preview/nginxdeployment/id_nginxdeployment.go index e327d5bf884..101e5a4b4be 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxdeployment/id_nginxdeployment.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxdeployment/id_nginxdeployment.go @@ -115,7 +115,7 @@ func (id NginxDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticNginxNginxPlus", "Nginx.NginxPlus", "Nginx.NginxPlus"), resourceids.StaticSegment("staticNginxDeployments", "nginxDeployments", "nginxDeployments"), - resourceids.UserSpecifiedSegment("nginxDeploymentName", "deploymentName"), + resourceids.UserSpecifiedSegment("nginxDeploymentName", "nginxDeploymentName"), } } diff --git a/resource-manager/nginx/2024-06-01-preview/nginxdeployment/id_nginxdeployment_test.go b/resource-manager/nginx/2024-06-01-preview/nginxdeployment/id_nginxdeployment_test.go index 1717c5d006d..55758302ad6 100644 --- a/resource-manager/nginx/2024-06-01-preview/nginxdeployment/id_nginxdeployment_test.go +++ b/resource-manager/nginx/2024-06-01-preview/nginxdeployment/id_nginxdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NginxDeploymentId{} func TestNewNginxDeploymentID(t *testing.T) { - id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName") + id := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewNginxDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.NginxDeploymentName != "deploymentName" { - t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "deploymentName") + if id.NginxDeploymentName != "nginxDeploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'NginxDeploymentName'", id.NginxDeploymentName, "nginxDeploymentName") } } func TestFormatNginxDeploymentID(t *testing.T) { - actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName" + actual := NewNginxDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "nginxDeploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseNginxDeploymentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseNginxDeploymentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - NginxDeploymentName: "deploymentName", + NginxDeploymentName: "nginxDeploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/deploymentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Nginx.NginxPlus/nginxDeployments/nginxDeploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe", Expected: &NginxDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NginxDeploymentName: "dEpLoYmEnTnAmE", + NginxDeploymentName: "nGiNxDePlOyMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/dEpLoYmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/nGiNx.nGiNxPlUs/nGiNxDePlOyMeNtS/nGiNxDePlOyMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/notificationhubs/2023-09-01/hubs/model_admcredentialproperties.go b/resource-manager/notificationhubs/2023-09-01/hubs/model_admcredentialproperties.go index 897872b3d27..cb8daa08842 100644 --- a/resource-manager/notificationhubs/2023-09-01/hubs/model_admcredentialproperties.go +++ b/resource-manager/notificationhubs/2023-09-01/hubs/model_admcredentialproperties.go @@ -4,7 +4,7 @@ package hubs // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AdmCredentialProperties struct { - AuthTokenUrl string `json:"authTokenUrl"` + AuthTokenURL string `json:"authTokenUrl"` ClientId string `json:"clientId"` ClientSecret string `json:"clientSecret"` } diff --git a/resource-manager/notificationhubs/2023-09-01/namespaces/model_admcredentialproperties.go b/resource-manager/notificationhubs/2023-09-01/namespaces/model_admcredentialproperties.go index ffb262de3ca..e206f3b7185 100644 --- a/resource-manager/notificationhubs/2023-09-01/namespaces/model_admcredentialproperties.go +++ b/resource-manager/notificationhubs/2023-09-01/namespaces/model_admcredentialproperties.go @@ -4,7 +4,7 @@ package namespaces // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AdmCredentialProperties struct { - AuthTokenUrl string `json:"authTokenUrl"` + AuthTokenURL string `json:"authTokenUrl"` ClientId string `json:"clientId"` ClientSecret string `json:"clientSecret"` } diff --git a/resource-manager/notificationhubs/2023-09-01/privatelink/README.md b/resource-manager/notificationhubs/2023-09-01/privatelink/README.md index 7b00273a654..fb1f4738b24 100644 --- a/resource-manager/notificationhubs/2023-09-01/privatelink/README.md +++ b/resource-manager/notificationhubs/2023-09-01/privatelink/README.md @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelink.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "subResourceName") +id := privatelink.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "privateLinkResourceName") read, err := client.PrivateEndpointConnectionsGetGroupId(ctx, id) if err != nil { diff --git a/resource-manager/notificationhubs/2023-09-01/privatelink/id_privatelinkresource.go b/resource-manager/notificationhubs/2023-09-01/privatelink/id_privatelinkresource.go index b473b25f17a..93f0f5747d0 100644 --- a/resource-manager/notificationhubs/2023-09-01/privatelink/id_privatelinkresource.go +++ b/resource-manager/notificationhubs/2023-09-01/privatelink/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "subResourceName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/notificationhubs/2023-09-01/privatelink/id_privatelinkresource_test.go b/resource-manager/notificationhubs/2023-09-01/privatelink/id_privatelinkresource_test.go index d594211564e..01fcdf83044 100644 --- a/resource-manager/notificationhubs/2023-09-01/privatelink/id_privatelinkresource_test.go +++ b/resource-manager/notificationhubs/2023-09-01/privatelink/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "subResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.PrivateLinkResourceName != "subResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "subResourceName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "subResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/subResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/subResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - PrivateLinkResourceName: "subResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/subResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/subResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - PrivateLinkResourceName: "subResourceName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/subResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NotificationHubs/namespaces/namespaceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nOtIfIcAtIoNhUbS/nAmEsPaCeS/nAmEsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/sUbReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nOtIfIcAtIoNhUbS/nAmEsPaCeS/nAmEsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - PrivateLinkResourceName: "sUbReSoUrCeNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nOtIfIcAtIoNhUbS/nAmEsPaCeS/nAmEsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/sUbReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nOtIfIcAtIoNhUbS/nAmEsPaCeS/nAmEsPaCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/operationalinsights/2019-09-01/querypackqueries/README.md b/resource-manager/operationalinsights/2019-09-01/querypackqueries/README.md index 38797656e49..15f60791363 100644 --- a/resource-manager/operationalinsights/2019-09-01/querypackqueries/README.md +++ b/resource-manager/operationalinsights/2019-09-01/querypackqueries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := querypackqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "id") +id := querypackqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "queryName") read, err := client.QueriesDelete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := querypackqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "id") +id := querypackqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "queryName") read, err := client.QueriesGet(ctx, id) if err != nil { @@ -73,7 +73,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := querypackqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "id") +id := querypackqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "queryName") payload := querypackqueries.LogAnalyticsQueryPackQuery{ // ... @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := querypackqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "id") +id := querypackqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "queryName") payload := querypackqueries.LogAnalyticsQueryPackQuery{ // ... diff --git a/resource-manager/operationalinsights/2019-09-01/querypackqueries/id_query.go b/resource-manager/operationalinsights/2019-09-01/querypackqueries/id_query.go index 50185e56b24..d28ec182a6d 100644 --- a/resource-manager/operationalinsights/2019-09-01/querypackqueries/id_query.go +++ b/resource-manager/operationalinsights/2019-09-01/querypackqueries/id_query.go @@ -123,7 +123,7 @@ func (id QueryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticQueryPacks", "queryPacks", "queryPacks"), resourceids.UserSpecifiedSegment("queryPackName", "queryPackName"), resourceids.StaticSegment("staticQueries", "queries", "queries"), - resourceids.UserSpecifiedSegment("queryName", "id"), + resourceids.UserSpecifiedSegment("queryName", "queryName"), } } diff --git a/resource-manager/operationalinsights/2019-09-01/querypackqueries/id_query_test.go b/resource-manager/operationalinsights/2019-09-01/querypackqueries/id_query_test.go index 8770251173f..41156889895 100644 --- a/resource-manager/operationalinsights/2019-09-01/querypackqueries/id_query_test.go +++ b/resource-manager/operationalinsights/2019-09-01/querypackqueries/id_query_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &QueryId{} func TestNewQueryID(t *testing.T) { - id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "id") + id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "queryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewQueryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'QueryPackName'", id.QueryPackName, "queryPackName") } - if id.QueryName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "id") + if id.QueryName != "queryName" { + t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "queryName") } } func TestFormatQueryID(t *testing.T) { - actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/id" + actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryPackName", "queryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/queryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseQueryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", QueryPackName: "queryPackName", - QueryName: "id", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/queryName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseQueryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", QueryPackName: "queryPackName", - QueryName: "id", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/queryPacks/queryPackName/queries/queryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/qUeRyPaCkS/qUeRyPaCkNaMe/qUeRiEs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/qUeRyPaCkS/qUeRyPaCkNaMe/qUeRiEs/qUeRyNaMe", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", QueryPackName: "qUeRyPaCkNaMe", - QueryName: "iD", + QueryName: "qUeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/qUeRyPaCkS/qUeRyPaCkNaMe/qUeRiEs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/qUeRyPaCkS/qUeRyPaCkNaMe/qUeRiEs/qUeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/operationalinsights/2020-08-01/storageinsights/README.md b/resource-manager/operationalinsights/2020-08-01/storageinsights/README.md index 0881a000347..d014852ba75 100644 --- a/resource-manager/operationalinsights/2020-08-01/storageinsights/README.md +++ b/resource-manager/operationalinsights/2020-08-01/storageinsights/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storageinsights.NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightName") +id := storageinsights.NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightConfigName") payload := storageinsights.StorageInsight{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := storageinsights.NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightName") +id := storageinsights.NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightConfigName") read, err := client.StorageInsightConfigsDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := storageinsights.NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightName") +id := storageinsights.NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightConfigName") read, err := client.StorageInsightConfigsGet(ctx, id) if err != nil { diff --git a/resource-manager/operationalinsights/2020-08-01/storageinsights/id_storageinsightconfig.go b/resource-manager/operationalinsights/2020-08-01/storageinsights/id_storageinsightconfig.go index c2e3183fb0f..93477fb129e 100644 --- a/resource-manager/operationalinsights/2020-08-01/storageinsights/id_storageinsightconfig.go +++ b/resource-manager/operationalinsights/2020-08-01/storageinsights/id_storageinsightconfig.go @@ -123,7 +123,7 @@ func (id StorageInsightConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticStorageInsightConfigs", "storageInsightConfigs", "storageInsightConfigs"), - resourceids.UserSpecifiedSegment("storageInsightConfigName", "storageInsightName"), + resourceids.UserSpecifiedSegment("storageInsightConfigName", "storageInsightConfigName"), } } diff --git a/resource-manager/operationalinsights/2020-08-01/storageinsights/id_storageinsightconfig_test.go b/resource-manager/operationalinsights/2020-08-01/storageinsights/id_storageinsightconfig_test.go index 9f3de1c267f..286f5f06c59 100644 --- a/resource-manager/operationalinsights/2020-08-01/storageinsights/id_storageinsightconfig_test.go +++ b/resource-manager/operationalinsights/2020-08-01/storageinsights/id_storageinsightconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageInsightConfigId{} func TestNewStorageInsightConfigID(t *testing.T) { - id := NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightName") + id := NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewStorageInsightConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.StorageInsightConfigName != "storageInsightName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageInsightConfigName'", id.StorageInsightConfigName, "storageInsightName") + if id.StorageInsightConfigName != "storageInsightConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageInsightConfigName'", id.StorageInsightConfigName, "storageInsightConfigName") } } func TestFormatStorageInsightConfigID(t *testing.T) { - actual := NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightName" + actual := NewStorageInsightConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "storageInsightConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseStorageInsightConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightConfigName", Expected: &StorageInsightConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - StorageInsightConfigName: "storageInsightName", + StorageInsightConfigName: "storageInsightConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseStorageInsightConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightConfigName", Expected: &StorageInsightConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - StorageInsightConfigName: "storageInsightName", + StorageInsightConfigName: "storageInsightConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/storageInsightConfigs/storageInsightConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/sToRaGeInSiGhTcOnFiGs/sToRaGeInSiGhTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/sToRaGeInSiGhTcOnFiGs/sToRaGeInSiGhTcOnFiGnAmE", Expected: &StorageInsightConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - StorageInsightConfigName: "sToRaGeInSiGhTnAmE", + StorageInsightConfigName: "sToRaGeInSiGhTcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/sToRaGeInSiGhTcOnFiGs/sToRaGeInSiGhTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/sToRaGeInSiGhTcOnFiGs/sToRaGeInSiGhTcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md index dddc2b4f42c..16a4e154362 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename", "adbbackupid") +id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") payload := autonomousdatabasebackups.AutonomousDatabaseBackup{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename", "adbbackupid") +id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename", "adbbackupid") +id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autonomousdatabasebackups.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabasebackups.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") // alternatively `client.ListByAutonomousDatabase(ctx, id)` can be used to do batched pagination items, err := client.ListByAutonomousDatabaseComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename", "adbbackupid") +id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") payload := autonomousdatabasebackups.AutonomousDatabaseBackupUpdate{ // ... diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase.go index 1fa79173fc1..116d0282b39 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase.go @@ -115,7 +115,7 @@ func (id AutonomousDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticAutonomousDatabases", "autonomousDatabases", "autonomousDatabases"), - resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousdatabasename"), + resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousDatabaseName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase_test.go index 0f403abb6d4..10502560755 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutonomousDatabaseId{} func TestNewAutonomousDatabaseID(t *testing.T) { - id := NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") + id := NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutonomousDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutonomousDatabaseName != "autonomousdatabasename" { - t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseName'", id.AutonomousDatabaseName, "autonomousdatabasename") + if id.AutonomousDatabaseName != "autonomousDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseName'", id.AutonomousDatabaseName, "autonomousDatabaseName") } } func TestFormatAutonomousDatabaseID(t *testing.T) { - actual := NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename" + actual := NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutonomousDatabaseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName", Expected: &AutonomousDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutonomousDatabaseName: "autonomousdatabasename", + AutonomousDatabaseName: "autonomousDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutonomousDatabaseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName", Expected: &AutonomousDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutonomousDatabaseName: "autonomousdatabasename", + AutonomousDatabaseName: "autonomousDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/extra", Error: true, }, { diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup.go index 34cf395d198..01f5c286121 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup.go @@ -121,9 +121,9 @@ func (id AutonomousDatabaseBackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticAutonomousDatabases", "autonomousDatabases", "autonomousDatabases"), - resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousdatabasename"), + resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousDatabaseName"), resourceids.StaticSegment("staticAutonomousDatabaseBackups", "autonomousDatabaseBackups", "autonomousDatabaseBackups"), - resourceids.UserSpecifiedSegment("autonomousDatabaseBackupName", "adbbackupid"), + resourceids.UserSpecifiedSegment("autonomousDatabaseBackupName", "autonomousDatabaseBackupName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup_test.go index cbc706311de..095d7f88ef1 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutonomousDatabaseBackupId{} func TestNewAutonomousDatabaseBackupID(t *testing.T) { - id := NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename", "adbbackupid") + id := NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAutonomousDatabaseBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutonomousDatabaseName != "autonomousdatabasename" { - t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseName'", id.AutonomousDatabaseName, "autonomousdatabasename") + if id.AutonomousDatabaseName != "autonomousDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseName'", id.AutonomousDatabaseName, "autonomousDatabaseName") } - if id.AutonomousDatabaseBackupName != "adbbackupid" { - t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseBackupName'", id.AutonomousDatabaseBackupName, "adbbackupid") + if id.AutonomousDatabaseBackupName != "autonomousDatabaseBackupName" { + t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseBackupName'", id.AutonomousDatabaseBackupName, "autonomousDatabaseBackupName") } } func TestFormatAutonomousDatabaseBackupID(t *testing.T) { - actual := NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename", "adbbackupid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/autonomousDatabaseBackups/adbbackupid" + actual := NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/autonomousDatabaseBackups/autonomousDatabaseBackupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAutonomousDatabaseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/autonomousDatabaseBackups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/autonomousDatabaseBackups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/autonomousDatabaseBackups/adbbackupid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/autonomousDatabaseBackups/autonomousDatabaseBackupName", Expected: &AutonomousDatabaseBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutonomousDatabaseName: "autonomousdatabasename", - AutonomousDatabaseBackupName: "adbbackupid", + AutonomousDatabaseName: "autonomousDatabaseName", + AutonomousDatabaseBackupName: "autonomousDatabaseBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/autonomousDatabaseBackups/adbbackupid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/autonomousDatabaseBackups/autonomousDatabaseBackupName/extra", Error: true, }, } @@ -228,7 +228,7 @@ func TestParseAutonomousDatabaseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName", Error: true, }, { @@ -238,7 +238,7 @@ func TestParseAutonomousDatabaseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/autonomousDatabaseBackups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/autonomousDatabaseBackups", Error: true, }, { @@ -248,32 +248,32 @@ func TestParseAutonomousDatabaseBackupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/autonomousDatabaseBackups/adbbackupid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/autonomousDatabaseBackups/autonomousDatabaseBackupName", Expected: &AutonomousDatabaseBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutonomousDatabaseName: "autonomousdatabasename", - AutonomousDatabaseBackupName: "adbbackupid", + AutonomousDatabaseName: "autonomousDatabaseName", + AutonomousDatabaseBackupName: "autonomousDatabaseBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/autonomousDatabaseBackups/adbbackupid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/autonomousDatabaseBackups/autonomousDatabaseBackupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/aUtOnOmOuSdAtAbAsEs/aUtOnOmOuSdAtAbAsEnAmE/aUtOnOmOuSdAtAbAsEbAcKuPs/aDbBaCkUpId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/aUtOnOmOuSdAtAbAsEs/aUtOnOmOuSdAtAbAsEnAmE/aUtOnOmOuSdAtAbAsEbAcKuPs/aUtOnOmOuSdAtAbAsEbAcKuPnAmE", Expected: &AutonomousDatabaseBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", AutonomousDatabaseName: "aUtOnOmOuSdAtAbAsEnAmE", - AutonomousDatabaseBackupName: "aDbBaCkUpId", + AutonomousDatabaseBackupName: "aUtOnOmOuSdAtAbAsEbAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/aUtOnOmOuSdAtAbAsEs/aUtOnOmOuSdAtAbAsEnAmE/aUtOnOmOuSdAtAbAsEbAcKuPs/aDbBaCkUpId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/aUtOnOmOuSdAtAbAsEs/aUtOnOmOuSdAtAbAsEnAmE/aUtOnOmOuSdAtAbAsEbAcKuPs/aUtOnOmOuSdAtAbAsEbAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/README.md b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/README.md index b3c6ef90b3c..8f83dcdc175 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/README.md +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autonomousdatabasecharactersets.NewAutonomousDatabaseCharacterSetID("12345678-1234-9876-4563-123456789012", "location", "adbscharsetname") +id := autonomousdatabasecharactersets.NewAutonomousDatabaseCharacterSetID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDatabaseCharacterSetName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autonomousdatabasecharactersets.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := autonomousdatabasecharactersets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset.go index 81b02514909..5bd55410b85 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset.go @@ -113,9 +113,9 @@ func (id AutonomousDatabaseCharacterSetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticAutonomousDatabaseCharacterSets", "autonomousDatabaseCharacterSets", "autonomousDatabaseCharacterSets"), - resourceids.UserSpecifiedSegment("autonomousDatabaseCharacterSetName", "adbscharsetname"), + resourceids.UserSpecifiedSegment("autonomousDatabaseCharacterSetName", "autonomousDatabaseCharacterSetName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset_test.go index ccd6a7260ad..7ba24b7d0f9 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &AutonomousDatabaseCharacterSetId{} func TestNewAutonomousDatabaseCharacterSetID(t *testing.T) { - id := NewAutonomousDatabaseCharacterSetID("12345678-1234-9876-4563-123456789012", "location", "adbscharsetname") + id := NewAutonomousDatabaseCharacterSetID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDatabaseCharacterSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.AutonomousDatabaseCharacterSetName != "adbscharsetname" { - t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseCharacterSetName'", id.AutonomousDatabaseCharacterSetName, "adbscharsetname") + if id.AutonomousDatabaseCharacterSetName != "autonomousDatabaseCharacterSetName" { + t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseCharacterSetName'", id.AutonomousDatabaseCharacterSetName, "autonomousDatabaseCharacterSetName") } } func TestFormatAutonomousDatabaseCharacterSetID(t *testing.T) { - actual := NewAutonomousDatabaseCharacterSetID("12345678-1234-9876-4563-123456789012", "location", "adbscharsetname").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseCharacterSets/adbscharsetname" + actual := NewAutonomousDatabaseCharacterSetID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDatabaseCharacterSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseCharacterSets/autonomousDatabaseCharacterSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseAutonomousDatabaseCharacterSetID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseCharacterSets", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseCharacterSets", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseCharacterSets/adbscharsetname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseCharacterSets/autonomousDatabaseCharacterSetName", Expected: &AutonomousDatabaseCharacterSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - AutonomousDatabaseCharacterSetName: "adbscharsetname", + LocationName: "locationName", + AutonomousDatabaseCharacterSetName: "autonomousDatabaseCharacterSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseCharacterSets/adbscharsetname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseCharacterSets/autonomousDatabaseCharacterSetName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseAutonomousDatabaseCharacterSetIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseCharacterSets", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseCharacterSets", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdAtAbAsEcHaRaCtErSeTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdAtAbAsEcHaRaCtErSeTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseCharacterSets/adbscharsetname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseCharacterSets/autonomousDatabaseCharacterSetName", Expected: &AutonomousDatabaseCharacterSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - AutonomousDatabaseCharacterSetName: "adbscharsetname", + LocationName: "locationName", + AutonomousDatabaseCharacterSetName: "autonomousDatabaseCharacterSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseCharacterSets/adbscharsetname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseCharacterSets/autonomousDatabaseCharacterSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdAtAbAsEcHaRaCtErSeTs/aDbScHaRsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdAtAbAsEcHaRaCtErSeTs/aUtOnOmOuSdAtAbAsEcHaRaCtErSeTnAmE", Expected: &AutonomousDatabaseCharacterSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - AutonomousDatabaseCharacterSetName: "aDbScHaRsEtNaMe", + LocationName: "lOcAtIoNnAmE", + AutonomousDatabaseCharacterSetName: "aUtOnOmOuSdAtAbAsEcHaRaCtErSeTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdAtAbAsEcHaRaCtErSeTs/aDbScHaRsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdAtAbAsEcHaRaCtErSeTs/aUtOnOmOuSdAtAbAsEcHaRaCtErSeTnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location.go index 59f29232708..1afa483132c 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location_test.go index 33ee8d6d64c..bbf6cec32fe 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/README.md b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/README.md index 69062c90a0d..41c33e4c8b0 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/README.md +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autonomousdatabasenationalcharactersets.NewAutonomousDatabaseNationalCharacterSetID("12345678-1234-9876-4563-123456789012", "location", "adbsncharsetname") +id := autonomousdatabasenationalcharactersets.NewAutonomousDatabaseNationalCharacterSetID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDatabaseNationalCharacterSetName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autonomousdatabasenationalcharactersets.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := autonomousdatabasenationalcharactersets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset.go index 294d9a4e3ff..97a41a6ea49 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset.go @@ -113,9 +113,9 @@ func (id AutonomousDatabaseNationalCharacterSetId) Segments() []resourceids.Segm resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticAutonomousDatabaseNationalCharacterSets", "autonomousDatabaseNationalCharacterSets", "autonomousDatabaseNationalCharacterSets"), - resourceids.UserSpecifiedSegment("autonomousDatabaseNationalCharacterSetName", "adbsncharsetname"), + resourceids.UserSpecifiedSegment("autonomousDatabaseNationalCharacterSetName", "autonomousDatabaseNationalCharacterSetName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset_test.go index 058ef119d55..9c0aa774406 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &AutonomousDatabaseNationalCharacterSetId{} func TestNewAutonomousDatabaseNationalCharacterSetID(t *testing.T) { - id := NewAutonomousDatabaseNationalCharacterSetID("12345678-1234-9876-4563-123456789012", "location", "adbsncharsetname") + id := NewAutonomousDatabaseNationalCharacterSetID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDatabaseNationalCharacterSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.AutonomousDatabaseNationalCharacterSetName != "adbsncharsetname" { - t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseNationalCharacterSetName'", id.AutonomousDatabaseNationalCharacterSetName, "adbsncharsetname") + if id.AutonomousDatabaseNationalCharacterSetName != "autonomousDatabaseNationalCharacterSetName" { + t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseNationalCharacterSetName'", id.AutonomousDatabaseNationalCharacterSetName, "autonomousDatabaseNationalCharacterSetName") } } func TestFormatAutonomousDatabaseNationalCharacterSetID(t *testing.T) { - actual := NewAutonomousDatabaseNationalCharacterSetID("12345678-1234-9876-4563-123456789012", "location", "adbsncharsetname").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseNationalCharacterSets/adbsncharsetname" + actual := NewAutonomousDatabaseNationalCharacterSetID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDatabaseNationalCharacterSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseNationalCharacterSets/autonomousDatabaseNationalCharacterSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseAutonomousDatabaseNationalCharacterSetID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseNationalCharacterSets", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseNationalCharacterSets", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseNationalCharacterSets/adbsncharsetname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseNationalCharacterSets/autonomousDatabaseNationalCharacterSetName", Expected: &AutonomousDatabaseNationalCharacterSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - AutonomousDatabaseNationalCharacterSetName: "adbsncharsetname", + LocationName: "locationName", + AutonomousDatabaseNationalCharacterSetName: "autonomousDatabaseNationalCharacterSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseNationalCharacterSets/adbsncharsetname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseNationalCharacterSets/autonomousDatabaseNationalCharacterSetName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseAutonomousDatabaseNationalCharacterSetIDInsensitively(t *testing.T }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseNationalCharacterSets", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseNationalCharacterSets", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseNationalCharacterSets/adbsncharsetname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseNationalCharacterSets/autonomousDatabaseNationalCharacterSetName", Expected: &AutonomousDatabaseNationalCharacterSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - AutonomousDatabaseNationalCharacterSetName: "adbsncharsetname", + LocationName: "locationName", + AutonomousDatabaseNationalCharacterSetName: "autonomousDatabaseNationalCharacterSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDatabaseNationalCharacterSets/adbsncharsetname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDatabaseNationalCharacterSets/autonomousDatabaseNationalCharacterSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTs/aDbSnChArSeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTs/aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTnAmE", Expected: &AutonomousDatabaseNationalCharacterSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - AutonomousDatabaseNationalCharacterSetName: "aDbSnChArSeTnAmE", + LocationName: "lOcAtIoNnAmE", + AutonomousDatabaseNationalCharacterSetName: "aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTs/aDbSnChArSeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTs/aUtOnOmOuSdAtAbAsEnAtIoNaLcHaRaCtErSeTnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location.go index d324d622a47..a999a7f708c 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location_test.go index cfff7b04a53..bb93e326887 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/README.md b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/README.md index 42ccd65e0ea..d4b1d4c08eb 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/README.md +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") payload := autonomousdatabases.AutonomousDatabase{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") payload := autonomousdatabases.PeerDbDetails{ // ... @@ -71,7 +71,7 @@ if err := client.FailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") payload := autonomousdatabases.GenerateAutonomousDatabaseWalletDetails{ // ... @@ -92,7 +92,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") read, err := client.Get(ctx, id) if err != nil { @@ -142,7 +142,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") payload := autonomousdatabases.RestoreAutonomousDatabaseDetails{ // ... @@ -159,7 +159,7 @@ if err := client.RestoreThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") if err := client.ShrinkThenPoll(ctx, id); err != nil { // handle the error @@ -171,7 +171,7 @@ if err := client.ShrinkThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") payload := autonomousdatabases.PeerDbDetails{ // ... @@ -188,7 +188,7 @@ if err := client.SwitchoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") payload := autonomousdatabases.AutonomousDatabaseUpdate{ // ... diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase.go index 3b84b074c23..6067f3c0cca 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase.go @@ -115,7 +115,7 @@ func (id AutonomousDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticAutonomousDatabases", "autonomousDatabases", "autonomousDatabases"), - resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousdatabasename"), + resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousDatabaseName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase_test.go index 89049215c3c..8913a709662 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutonomousDatabaseId{} func TestNewAutonomousDatabaseID(t *testing.T) { - id := NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename") + id := NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutonomousDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutonomousDatabaseName != "autonomousdatabasename" { - t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseName'", id.AutonomousDatabaseName, "autonomousdatabasename") + if id.AutonomousDatabaseName != "autonomousDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'AutonomousDatabaseName'", id.AutonomousDatabaseName, "autonomousDatabaseName") } } func TestFormatAutonomousDatabaseID(t *testing.T) { - actual := NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousdatabasename").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename" + actual := NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutonomousDatabaseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName", Expected: &AutonomousDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutonomousDatabaseName: "autonomousdatabasename", + AutonomousDatabaseName: "autonomousDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseAutonomousDatabaseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName", Expected: &AutonomousDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutonomousDatabaseName: "autonomousdatabasename", + AutonomousDatabaseName: "autonomousDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousdatabasename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/autonomousDatabases/autonomousDatabaseName/extra", Error: true, }, { diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasebaseproperties.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasebaseproperties.go index faf60068d28..def86bd6e9e 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasebaseproperties.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasebaseproperties.go @@ -28,7 +28,7 @@ type BaseAutonomousDatabaseBasePropertiesImpl struct { ComputeCount *float64 `json:"computeCount,omitempty"` ComputeModel *ComputeModel `json:"computeModel,omitempty"` ConnectionStrings *ConnectionStringType `json:"connectionStrings,omitempty"` - ConnectionUrls *ConnectionUrlType `json:"connectionUrls,omitempty"` + ConnectionURLs *ConnectionURLType `json:"connectionUrls,omitempty"` CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` DataBaseType DataBaseType `json:"dataBaseType"` @@ -58,7 +58,7 @@ type BaseAutonomousDatabaseBasePropertiesImpl struct { MemoryPerOracleComputeUnitInGbs *int64 `json:"memoryPerOracleComputeUnitInGbs,omitempty"` NcharacterSet *string `json:"ncharacterSet,omitempty"` NextLongTermBackupTimeStamp *string `json:"nextLongTermBackupTimeStamp,omitempty"` - OciUrl *string `json:"ociUrl,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` Ocid *string `json:"ocid,omitempty"` OpenMode *OpenModeType `json:"openMode,omitempty"` OperationsInsightsStatus *OperationsInsightsStatusType `json:"operationsInsightsStatus,omitempty"` @@ -72,8 +72,8 @@ type BaseAutonomousDatabaseBasePropertiesImpl struct { ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` Role *RoleType `json:"role,omitempty"` ScheduledOperations *ScheduledOperationsType `json:"scheduledOperations,omitempty"` - ServiceConsoleUrl *string `json:"serviceConsoleUrl,omitempty"` - SqlWebDeveloperUrl *string `json:"sqlWebDeveloperUrl,omitempty"` + ServiceConsoleURL *string `json:"serviceConsoleUrl,omitempty"` + SqlWebDeveloperURL *string `json:"sqlWebDeveloperUrl,omitempty"` SubnetId *string `json:"subnetId,omitempty"` SupportedRegionsToCloneTo *[]string `json:"supportedRegionsToCloneTo,omitempty"` TimeCreated *string `json:"timeCreated,omitempty"` diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasecloneproperties.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasecloneproperties.go index 09c3df885cb..da3cc5ce566 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasecloneproperties.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasecloneproperties.go @@ -37,7 +37,7 @@ type AutonomousDatabaseCloneProperties struct { ComputeCount *float64 `json:"computeCount,omitempty"` ComputeModel *ComputeModel `json:"computeModel,omitempty"` ConnectionStrings *ConnectionStringType `json:"connectionStrings,omitempty"` - ConnectionUrls *ConnectionUrlType `json:"connectionUrls,omitempty"` + ConnectionURLs *ConnectionURLType `json:"connectionUrls,omitempty"` CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` DataBaseType DataBaseType `json:"dataBaseType"` @@ -67,7 +67,7 @@ type AutonomousDatabaseCloneProperties struct { MemoryPerOracleComputeUnitInGbs *int64 `json:"memoryPerOracleComputeUnitInGbs,omitempty"` NcharacterSet *string `json:"ncharacterSet,omitempty"` NextLongTermBackupTimeStamp *string `json:"nextLongTermBackupTimeStamp,omitempty"` - OciUrl *string `json:"ociUrl,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` Ocid *string `json:"ocid,omitempty"` OpenMode *OpenModeType `json:"openMode,omitempty"` OperationsInsightsStatus *OperationsInsightsStatusType `json:"operationsInsightsStatus,omitempty"` @@ -81,8 +81,8 @@ type AutonomousDatabaseCloneProperties struct { ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` Role *RoleType `json:"role,omitempty"` ScheduledOperations *ScheduledOperationsType `json:"scheduledOperations,omitempty"` - ServiceConsoleUrl *string `json:"serviceConsoleUrl,omitempty"` - SqlWebDeveloperUrl *string `json:"sqlWebDeveloperUrl,omitempty"` + ServiceConsoleURL *string `json:"serviceConsoleUrl,omitempty"` + SqlWebDeveloperURL *string `json:"sqlWebDeveloperUrl,omitempty"` SubnetId *string `json:"subnetId,omitempty"` SupportedRegionsToCloneTo *[]string `json:"supportedRegionsToCloneTo,omitempty"` TimeCreated *string `json:"timeCreated,omitempty"` @@ -116,7 +116,7 @@ func (s AutonomousDatabaseCloneProperties) AutonomousDatabaseBaseProperties() Ba ComputeCount: s.ComputeCount, ComputeModel: s.ComputeModel, ConnectionStrings: s.ConnectionStrings, - ConnectionUrls: s.ConnectionUrls, + ConnectionURLs: s.ConnectionURLs, CpuCoreCount: s.CpuCoreCount, CustomerContacts: s.CustomerContacts, DataBaseType: s.DataBaseType, @@ -146,7 +146,7 @@ func (s AutonomousDatabaseCloneProperties) AutonomousDatabaseBaseProperties() Ba MemoryPerOracleComputeUnitInGbs: s.MemoryPerOracleComputeUnitInGbs, NcharacterSet: s.NcharacterSet, NextLongTermBackupTimeStamp: s.NextLongTermBackupTimeStamp, - OciUrl: s.OciUrl, + OciURL: s.OciURL, Ocid: s.Ocid, OpenMode: s.OpenMode, OperationsInsightsStatus: s.OperationsInsightsStatus, @@ -160,8 +160,8 @@ func (s AutonomousDatabaseCloneProperties) AutonomousDatabaseBaseProperties() Ba ProvisioningState: s.ProvisioningState, Role: s.Role, ScheduledOperations: s.ScheduledOperations, - ServiceConsoleUrl: s.ServiceConsoleUrl, - SqlWebDeveloperUrl: s.SqlWebDeveloperUrl, + ServiceConsoleURL: s.ServiceConsoleURL, + SqlWebDeveloperURL: s.SqlWebDeveloperURL, SubnetId: s.SubnetId, SupportedRegionsToCloneTo: s.SupportedRegionsToCloneTo, TimeCreated: s.TimeCreated, diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseproperties.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseproperties.go index 5b9491f4107..d465693ca1c 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseproperties.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseproperties.go @@ -29,7 +29,7 @@ type AutonomousDatabaseProperties struct { ComputeCount *float64 `json:"computeCount,omitempty"` ComputeModel *ComputeModel `json:"computeModel,omitempty"` ConnectionStrings *ConnectionStringType `json:"connectionStrings,omitempty"` - ConnectionUrls *ConnectionUrlType `json:"connectionUrls,omitempty"` + ConnectionURLs *ConnectionURLType `json:"connectionUrls,omitempty"` CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` DataBaseType DataBaseType `json:"dataBaseType"` @@ -59,7 +59,7 @@ type AutonomousDatabaseProperties struct { MemoryPerOracleComputeUnitInGbs *int64 `json:"memoryPerOracleComputeUnitInGbs,omitempty"` NcharacterSet *string `json:"ncharacterSet,omitempty"` NextLongTermBackupTimeStamp *string `json:"nextLongTermBackupTimeStamp,omitempty"` - OciUrl *string `json:"ociUrl,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` Ocid *string `json:"ocid,omitempty"` OpenMode *OpenModeType `json:"openMode,omitempty"` OperationsInsightsStatus *OperationsInsightsStatusType `json:"operationsInsightsStatus,omitempty"` @@ -73,8 +73,8 @@ type AutonomousDatabaseProperties struct { ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` Role *RoleType `json:"role,omitempty"` ScheduledOperations *ScheduledOperationsType `json:"scheduledOperations,omitempty"` - ServiceConsoleUrl *string `json:"serviceConsoleUrl,omitempty"` - SqlWebDeveloperUrl *string `json:"sqlWebDeveloperUrl,omitempty"` + ServiceConsoleURL *string `json:"serviceConsoleUrl,omitempty"` + SqlWebDeveloperURL *string `json:"sqlWebDeveloperUrl,omitempty"` SubnetId *string `json:"subnetId,omitempty"` SupportedRegionsToCloneTo *[]string `json:"supportedRegionsToCloneTo,omitempty"` TimeCreated *string `json:"timeCreated,omitempty"` @@ -108,7 +108,7 @@ func (s AutonomousDatabaseProperties) AutonomousDatabaseBaseProperties() BaseAut ComputeCount: s.ComputeCount, ComputeModel: s.ComputeModel, ConnectionStrings: s.ConnectionStrings, - ConnectionUrls: s.ConnectionUrls, + ConnectionURLs: s.ConnectionURLs, CpuCoreCount: s.CpuCoreCount, CustomerContacts: s.CustomerContacts, DataBaseType: s.DataBaseType, @@ -138,7 +138,7 @@ func (s AutonomousDatabaseProperties) AutonomousDatabaseBaseProperties() BaseAut MemoryPerOracleComputeUnitInGbs: s.MemoryPerOracleComputeUnitInGbs, NcharacterSet: s.NcharacterSet, NextLongTermBackupTimeStamp: s.NextLongTermBackupTimeStamp, - OciUrl: s.OciUrl, + OciURL: s.OciURL, Ocid: s.Ocid, OpenMode: s.OpenMode, OperationsInsightsStatus: s.OperationsInsightsStatus, @@ -152,8 +152,8 @@ func (s AutonomousDatabaseProperties) AutonomousDatabaseBaseProperties() BaseAut ProvisioningState: s.ProvisioningState, Role: s.Role, ScheduledOperations: s.ScheduledOperations, - ServiceConsoleUrl: s.ServiceConsoleUrl, - SqlWebDeveloperUrl: s.SqlWebDeveloperUrl, + ServiceConsoleURL: s.ServiceConsoleURL, + SqlWebDeveloperURL: s.SqlWebDeveloperURL, SubnetId: s.SubnetId, SupportedRegionsToCloneTo: s.SupportedRegionsToCloneTo, TimeCreated: s.TimeCreated, diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionurltype.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionurltype.go index 0c2c730e4cf..6e866fc0a09 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionurltype.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionurltype.go @@ -3,12 +3,12 @@ package autonomousdatabases // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ConnectionUrlType struct { - ApexUrl *string `json:"apexUrl,omitempty"` - DatabaseTransformsUrl *string `json:"databaseTransformsUrl,omitempty"` - GraphStudioUrl *string `json:"graphStudioUrl,omitempty"` - MachineLearningNotebookUrl *string `json:"machineLearningNotebookUrl,omitempty"` - MongoDbUrl *string `json:"mongoDbUrl,omitempty"` - OrdsUrl *string `json:"ordsUrl,omitempty"` - SqlDevWebUrl *string `json:"sqlDevWebUrl,omitempty"` +type ConnectionURLType struct { + ApexURL *string `json:"apexUrl,omitempty"` + DatabaseTransformsURL *string `json:"databaseTransformsUrl,omitempty"` + GraphStudioURL *string `json:"graphStudioUrl,omitempty"` + MachineLearningNotebookURL *string `json:"machineLearningNotebookUrl,omitempty"` + MongoDbURL *string `json:"mongoDbUrl,omitempty"` + OrdsURL *string `json:"ordsUrl,omitempty"` + SqlDevWebURL *string `json:"sqlDevWebUrl,omitempty"` } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/README.md b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/README.md index 69b0e919302..861d8cf111d 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/README.md +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autonomousdatabaseversions.NewAutonomousDbVersionID("12345678-1234-9876-4563-123456789012", "location", "autonomousdbversionsname") +id := autonomousdatabaseversions.NewAutonomousDbVersionID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDbVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autonomousdatabaseversions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := autonomousdatabaseversions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion.go index b63b6837c32..ffb6dbab6db 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion.go @@ -113,9 +113,9 @@ func (id AutonomousDbVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticAutonomousDbVersions", "autonomousDbVersions", "autonomousDbVersions"), - resourceids.UserSpecifiedSegment("autonomousDbVersionName", "autonomousdbversionsname"), + resourceids.UserSpecifiedSegment("autonomousDbVersionName", "autonomousDbVersionName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion_test.go index 7a5f7039e0e..a7b8b99ea35 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &AutonomousDbVersionId{} func TestNewAutonomousDbVersionID(t *testing.T) { - id := NewAutonomousDbVersionID("12345678-1234-9876-4563-123456789012", "location", "autonomousdbversionsname") + id := NewAutonomousDbVersionID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDbVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.AutonomousDbVersionName != "autonomousdbversionsname" { - t.Fatalf("Expected %q but got %q for Segment 'AutonomousDbVersionName'", id.AutonomousDbVersionName, "autonomousdbversionsname") + if id.AutonomousDbVersionName != "autonomousDbVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'AutonomousDbVersionName'", id.AutonomousDbVersionName, "autonomousDbVersionName") } } func TestFormatAutonomousDbVersionID(t *testing.T) { - actual := NewAutonomousDbVersionID("12345678-1234-9876-4563-123456789012", "location", "autonomousdbversionsname").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDbVersions/autonomousdbversionsname" + actual := NewAutonomousDbVersionID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDbVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDbVersions/autonomousDbVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseAutonomousDbVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDbVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDbVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDbVersions/autonomousdbversionsname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDbVersions/autonomousDbVersionName", Expected: &AutonomousDbVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - AutonomousDbVersionName: "autonomousdbversionsname", + LocationName: "locationName", + AutonomousDbVersionName: "autonomousDbVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDbVersions/autonomousdbversionsname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDbVersions/autonomousDbVersionName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseAutonomousDbVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDbVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDbVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdBvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdBvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDbVersions/autonomousdbversionsname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDbVersions/autonomousDbVersionName", Expected: &AutonomousDbVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - AutonomousDbVersionName: "autonomousdbversionsname", + LocationName: "locationName", + AutonomousDbVersionName: "autonomousDbVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/autonomousDbVersions/autonomousdbversionsname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/autonomousDbVersions/autonomousDbVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdBvErSiOnS/aUtOnOmOuSdBvErSiOnSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdBvErSiOnS/aUtOnOmOuSdBvErSiOnNaMe", Expected: &AutonomousDbVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - AutonomousDbVersionName: "aUtOnOmOuSdBvErSiOnSnAmE", + LocationName: "lOcAtIoNnAmE", + AutonomousDbVersionName: "aUtOnOmOuSdBvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/aUtOnOmOuSdBvErSiOnS/aUtOnOmOuSdBvErSiOnSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/aUtOnOmOuSdBvErSiOnS/aUtOnOmOuSdBvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location.go index 3f88e5d7f81..c084011e456 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location_test.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location_test.go index 1eb878a5934..de8e1f63da7 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location_test.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/README.md b/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/README.md index b08eebc81d9..4ef8d6089e6 100644 --- a/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/README.md +++ b/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename") +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") if err := client.AddStorageCapacityThenPoll(ctx, id); err != nil { // handle the error @@ -37,7 +37,7 @@ if err := client.AddStorageCapacityThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename") +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") payload := cloudexadatainfrastructures.CloudExadataInfrastructure{ // ... @@ -54,7 +54,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename") +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -66,7 +66,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename") +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") read, err := client.Get(ctx, id) if err != nil { @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename") +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") payload := cloudexadatainfrastructures.CloudExadataInfrastructureUpdate{ // ... diff --git a/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure.go b/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure.go index 9184077b00d..df189438489 100644 --- a/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure.go +++ b/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure.go @@ -115,7 +115,7 @@ func (id CloudExadataInfrastructureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticCloudExadataInfrastructures", "cloudExadataInfrastructures", "cloudExadataInfrastructures"), - resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudexadatainfrastructurename"), + resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudExadataInfrastructureName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure_test.go b/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure_test.go index 724f6da0e99..b08cf137c5a 100644 --- a/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure_test.go +++ b/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CloudExadataInfrastructureId{} func TestNewCloudExadataInfrastructureID(t *testing.T) { - id := NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename") + id := NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCloudExadataInfrastructureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudExadataInfrastructureName != "cloudexadatainfrastructurename" { - t.Fatalf("Expected %q but got %q for Segment 'CloudExadataInfrastructureName'", id.CloudExadataInfrastructureName, "cloudexadatainfrastructurename") + if id.CloudExadataInfrastructureName != "cloudExadataInfrastructureName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudExadataInfrastructureName'", id.CloudExadataInfrastructureName, "cloudExadataInfrastructureName") } } func TestFormatCloudExadataInfrastructureID(t *testing.T) { - actual := NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename" + actual := NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCloudExadataInfrastructureID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName", Expected: &CloudExadataInfrastructureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudExadataInfrastructureName: "cloudexadatainfrastructurename", + CloudExadataInfrastructureName: "cloudExadataInfrastructureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCloudExadataInfrastructureIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName", Expected: &CloudExadataInfrastructureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudExadataInfrastructureName: "cloudexadatainfrastructurename", + CloudExadataInfrastructureName: "cloudExadataInfrastructureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/extra", Error: true, }, { diff --git a/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureproperties.go b/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureproperties.go index e2cae85db86..1886cf2282b 100644 --- a/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureproperties.go +++ b/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureproperties.go @@ -27,7 +27,7 @@ type CloudExadataInfrastructureProperties struct { MonthlyDbServerVersion *string `json:"monthlyDbServerVersion,omitempty"` MonthlyStorageServerVersion *string `json:"monthlyStorageServerVersion,omitempty"` NextMaintenanceRunId *string `json:"nextMaintenanceRunId,omitempty"` - OciUrl *string `json:"ociUrl,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` Ocid *string `json:"ocid,omitempty"` ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` Shape string `json:"shape"` diff --git a/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/README.md b/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/README.md index 77a3f5d5a27..bf98f9e5d73 100644 --- a/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/README.md +++ b/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") payload := cloudvmclusters.AddRemoveDbNode{ // ... @@ -42,7 +42,7 @@ if err := client.AddVMsThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") payload := cloudvmclusters.CloudVMCluster{ // ... @@ -59,7 +59,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") read, err := client.Get(ctx, id) if err != nil { @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") payload := cloudvmclusters.PrivateIPAddressesFilter{ // ... @@ -142,7 +142,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") payload := cloudvmclusters.AddRemoveDbNode{ // ... @@ -159,7 +159,7 @@ if err := client.RemoveVMsThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") payload := cloudvmclusters.CloudVMClusterUpdate{ // ... diff --git a/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster.go b/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster.go index 49eee54e6c6..45457dbb4a3 100644 --- a/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster.go +++ b/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster.go @@ -115,7 +115,7 @@ func (id CloudVMClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), - resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudvmclustername"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster_test.go b/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster_test.go index fc486a9f48a..2794d4cc0f4 100644 --- a/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster_test.go +++ b/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CloudVMClusterId{} func TestNewCloudVMClusterID(t *testing.T) { - id := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") + id := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCloudVMClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudVmClusterName != "cloudvmclustername" { - t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudvmclustername") + if id.CloudVmClusterName != "cloudVmClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudVmClusterName") } } func TestFormatCloudVMClusterID(t *testing.T) { - actual := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername" + actual := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCloudVMClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Expected: &CloudVMClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", + CloudVmClusterName: "cloudVmClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCloudVMClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Expected: &CloudVMClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", + CloudVmClusterName: "cloudVmClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/extra", Error: true, }, { diff --git a/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterproperties.go b/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterproperties.go index 73a09d1f15d..78eab72444b 100644 --- a/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterproperties.go +++ b/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterproperties.go @@ -37,8 +37,8 @@ type CloudVMClusterProperties struct { MemorySizeInGbs *int64 `json:"memorySizeInGbs,omitempty"` NodeCount *int64 `json:"nodeCount,omitempty"` NsgCidrs *[]NsgCidr `json:"nsgCidrs,omitempty"` - NsgUrl *string `json:"nsgUrl,omitempty"` - OciUrl *string `json:"ociUrl,omitempty"` + NsgURL *string `json:"nsgUrl,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` Ocid *string `json:"ocid,omitempty"` OcpuCount *float64 `json:"ocpuCount,omitempty"` ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` diff --git a/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md b/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md index db928cd7bae..85970d8b53a 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md +++ b/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dbnodes.NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "dbnodeocid") +id := dbnodes.NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "dbNodeName") payload := dbnodes.DbNodeAction{ // ... @@ -41,7 +41,7 @@ if err := client.ActionThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := dbnodes.NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "dbnodeocid") +id := dbnodes.NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "dbNodeName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dbnodes.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := dbnodes.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") // alternatively `client.ListByCloudVMCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByCloudVMClusterComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster.go b/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster.go index 458ed4de83c..cd3b68803c2 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster.go +++ b/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster.go @@ -115,7 +115,7 @@ func (id CloudVMClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), - resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudvmclustername"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster_test.go b/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster_test.go index f06e6f66837..84c155e42f5 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CloudVMClusterId{} func TestNewCloudVMClusterID(t *testing.T) { - id := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") + id := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCloudVMClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudVmClusterName != "cloudvmclustername" { - t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudvmclustername") + if id.CloudVmClusterName != "cloudVmClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudVmClusterName") } } func TestFormatCloudVMClusterID(t *testing.T) { - actual := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername" + actual := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCloudVMClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Expected: &CloudVMClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", + CloudVmClusterName: "cloudVmClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCloudVMClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Expected: &CloudVMClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", + CloudVmClusterName: "cloudVmClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/extra", Error: true, }, { diff --git a/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode.go b/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode.go index d21c326a7d7..ad7d9c0f415 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode.go +++ b/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode.go @@ -121,9 +121,9 @@ func (id DbNodeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), - resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudvmclustername"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), resourceids.StaticSegment("staticDbNodes", "dbNodes", "dbNodes"), - resourceids.UserSpecifiedSegment("dbNodeName", "dbnodeocid"), + resourceids.UserSpecifiedSegment("dbNodeName", "dbNodeName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode_test.go b/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode_test.go index 221f271bc85..dd69225af1d 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DbNodeId{} func TestNewDbNodeID(t *testing.T) { - id := NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "dbnodeocid") + id := NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "dbNodeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDbNodeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudVmClusterName != "cloudvmclustername" { - t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudvmclustername") + if id.CloudVmClusterName != "cloudVmClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudVmClusterName") } - if id.DbNodeName != "dbnodeocid" { - t.Fatalf("Expected %q but got %q for Segment 'DbNodeName'", id.DbNodeName, "dbnodeocid") + if id.DbNodeName != "dbNodeName" { + t.Fatalf("Expected %q but got %q for Segment 'DbNodeName'", id.DbNodeName, "dbNodeName") } } func TestFormatDbNodeID(t *testing.T) { - actual := NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "dbnodeocid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/dbNodes/dbnodeocid" + actual := NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "dbNodeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/dbNodes/dbNodeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDbNodeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/dbNodes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/dbNodes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/dbNodes/dbnodeocid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/dbNodes/dbNodeName", Expected: &DbNodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", - DbNodeName: "dbnodeocid", + CloudVmClusterName: "cloudVmClusterName", + DbNodeName: "dbNodeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/dbNodes/dbnodeocid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/dbNodes/dbNodeName/extra", Error: true, }, } @@ -228,7 +228,7 @@ func TestParseDbNodeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Error: true, }, { @@ -238,7 +238,7 @@ func TestParseDbNodeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/dbNodes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/dbNodes", Error: true, }, { @@ -248,32 +248,32 @@ func TestParseDbNodeIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/dbNodes/dbnodeocid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/dbNodes/dbNodeName", Expected: &DbNodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", - DbNodeName: "dbnodeocid", + CloudVmClusterName: "cloudVmClusterName", + DbNodeName: "dbNodeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/dbNodes/dbnodeocid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/dbNodes/dbNodeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/cLoUdVmClUsTeRs/cLoUdVmClUsTeRnAmE/dBnOdEs/dBnOdEoCiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/cLoUdVmClUsTeRs/cLoUdVmClUsTeRnAmE/dBnOdEs/dBnOdEnAmE", Expected: &DbNodeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CloudVmClusterName: "cLoUdVmClUsTeRnAmE", - DbNodeName: "dBnOdEoCiD", + DbNodeName: "dBnOdEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/cLoUdVmClUsTeRs/cLoUdVmClUsTeRnAmE/dBnOdEs/dBnOdEoCiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/cLoUdVmClUsTeRs/cLoUdVmClUsTeRnAmE/dBnOdEs/dBnOdEnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/dbservers/README.md b/resource-manager/oracledatabase/2024-06-01/dbservers/README.md index 186a01ea803..3e36e006cab 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbservers/README.md +++ b/resource-manager/oracledatabase/2024-06-01/dbservers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dbservers.NewDbServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename", "dbserverocid") +id := dbservers.NewDbServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName", "dbServerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dbservers.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename") +id := dbservers.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") // alternatively `client.ListByCloudExadataInfrastructure(ctx, id)` can be used to do batched pagination items, err := client.ListByCloudExadataInfrastructureComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure.go b/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure.go index 9d04206cedc..1a0d2eda372 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure.go +++ b/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure.go @@ -115,7 +115,7 @@ func (id CloudExadataInfrastructureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticCloudExadataInfrastructures", "cloudExadataInfrastructures", "cloudExadataInfrastructures"), - resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudexadatainfrastructurename"), + resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudExadataInfrastructureName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure_test.go b/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure_test.go index 5b905909d2b..ffa6cef424a 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CloudExadataInfrastructureId{} func TestNewCloudExadataInfrastructureID(t *testing.T) { - id := NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename") + id := NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCloudExadataInfrastructureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudExadataInfrastructureName != "cloudexadatainfrastructurename" { - t.Fatalf("Expected %q but got %q for Segment 'CloudExadataInfrastructureName'", id.CloudExadataInfrastructureName, "cloudexadatainfrastructurename") + if id.CloudExadataInfrastructureName != "cloudExadataInfrastructureName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudExadataInfrastructureName'", id.CloudExadataInfrastructureName, "cloudExadataInfrastructureName") } } func TestFormatCloudExadataInfrastructureID(t *testing.T) { - actual := NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename" + actual := NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCloudExadataInfrastructureID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName", Expected: &CloudExadataInfrastructureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudExadataInfrastructureName: "cloudexadatainfrastructurename", + CloudExadataInfrastructureName: "cloudExadataInfrastructureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCloudExadataInfrastructureIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName", Expected: &CloudExadataInfrastructureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudExadataInfrastructureName: "cloudexadatainfrastructurename", + CloudExadataInfrastructureName: "cloudExadataInfrastructureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/extra", Error: true, }, { diff --git a/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver.go b/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver.go index c7821b6b148..d8e6ee908f4 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver.go +++ b/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver.go @@ -121,9 +121,9 @@ func (id DbServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticCloudExadataInfrastructures", "cloudExadataInfrastructures", "cloudExadataInfrastructures"), - resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudexadatainfrastructurename"), + resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudExadataInfrastructureName"), resourceids.StaticSegment("staticDbServers", "dbServers", "dbServers"), - resourceids.UserSpecifiedSegment("dbServerName", "dbserverocid"), + resourceids.UserSpecifiedSegment("dbServerName", "dbServerName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver_test.go b/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver_test.go index 52c3b237917..27ccb910619 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DbServerId{} func TestNewDbServerID(t *testing.T) { - id := NewDbServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename", "dbserverocid") + id := NewDbServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName", "dbServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDbServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudExadataInfrastructureName != "cloudexadatainfrastructurename" { - t.Fatalf("Expected %q but got %q for Segment 'CloudExadataInfrastructureName'", id.CloudExadataInfrastructureName, "cloudexadatainfrastructurename") + if id.CloudExadataInfrastructureName != "cloudExadataInfrastructureName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudExadataInfrastructureName'", id.CloudExadataInfrastructureName, "cloudExadataInfrastructureName") } - if id.DbServerName != "dbserverocid" { - t.Fatalf("Expected %q but got %q for Segment 'DbServerName'", id.DbServerName, "dbserverocid") + if id.DbServerName != "dbServerName" { + t.Fatalf("Expected %q but got %q for Segment 'DbServerName'", id.DbServerName, "dbServerName") } } func TestFormatDbServerID(t *testing.T) { - actual := NewDbServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudexadatainfrastructurename", "dbserverocid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/dbServers/dbserverocid" + actual := NewDbServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName", "dbServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/dbServers/dbServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDbServerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/dbServers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/dbServers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/dbServers/dbserverocid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/dbServers/dbServerName", Expected: &DbServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudExadataInfrastructureName: "cloudexadatainfrastructurename", - DbServerName: "dbserverocid", + CloudExadataInfrastructureName: "cloudExadataInfrastructureName", + DbServerName: "dbServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/dbServers/dbserverocid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/dbServers/dbServerName/extra", Error: true, }, } @@ -228,7 +228,7 @@ func TestParseDbServerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName", Error: true, }, { @@ -238,7 +238,7 @@ func TestParseDbServerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/dbServers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/dbServers", Error: true, }, { @@ -248,32 +248,32 @@ func TestParseDbServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/dbServers/dbserverocid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/dbServers/dbServerName", Expected: &DbServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudExadataInfrastructureName: "cloudexadatainfrastructurename", - DbServerName: "dbserverocid", + CloudExadataInfrastructureName: "cloudExadataInfrastructureName", + DbServerName: "dbServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudexadatainfrastructurename/dbServers/dbserverocid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructureName/dbServers/dbServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/cLoUdExAdAtAiNfRaStRuCtUrEs/cLoUdExAdAtAiNfRaStRuCtUrEnAmE/dBsErVeRs/dBsErVeRoCiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/cLoUdExAdAtAiNfRaStRuCtUrEs/cLoUdExAdAtAiNfRaStRuCtUrEnAmE/dBsErVeRs/dBsErVeRnAmE", Expected: &DbServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CloudExadataInfrastructureName: "cLoUdExAdAtAiNfRaStRuCtUrEnAmE", - DbServerName: "dBsErVeRoCiD", + DbServerName: "dBsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/cLoUdExAdAtAiNfRaStRuCtUrEs/cLoUdExAdAtAiNfRaStRuCtUrEnAmE/dBsErVeRs/dBsErVeRoCiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/oRaClE.DaTaBaSe/cLoUdExAdAtAiNfRaStRuCtUrEs/cLoUdExAdAtAiNfRaStRuCtUrEnAmE/dBsErVeRs/dBsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/README.md b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/README.md index 332d4d4f6d5..9f85e312824 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/README.md +++ b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dbsystemshapes.NewDbSystemShapeID("12345678-1234-9876-4563-123456789012", "location", "dbsystemshapename") +id := dbsystemshapes.NewDbSystemShapeID("12345678-1234-9876-4563-123456789012", "locationName", "dbSystemShapeName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dbsystemshapes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := dbsystemshapes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape.go b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape.go index 744967238ad..1215665cae7 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape.go +++ b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape.go @@ -113,9 +113,9 @@ func (id DbSystemShapeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDbSystemShapes", "dbSystemShapes", "dbSystemShapes"), - resourceids.UserSpecifiedSegment("dbSystemShapeName", "dbsystemshapename"), + resourceids.UserSpecifiedSegment("dbSystemShapeName", "dbSystemShapeName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape_test.go b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape_test.go index 099d8460eec..7615681d7ce 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DbSystemShapeId{} func TestNewDbSystemShapeID(t *testing.T) { - id := NewDbSystemShapeID("12345678-1234-9876-4563-123456789012", "location", "dbsystemshapename") + id := NewDbSystemShapeID("12345678-1234-9876-4563-123456789012", "locationName", "dbSystemShapeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DbSystemShapeName != "dbsystemshapename" { - t.Fatalf("Expected %q but got %q for Segment 'DbSystemShapeName'", id.DbSystemShapeName, "dbsystemshapename") + if id.DbSystemShapeName != "dbSystemShapeName" { + t.Fatalf("Expected %q but got %q for Segment 'DbSystemShapeName'", id.DbSystemShapeName, "dbSystemShapeName") } } func TestFormatDbSystemShapeID(t *testing.T) { - actual := NewDbSystemShapeID("12345678-1234-9876-4563-123456789012", "location", "dbsystemshapename").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dbSystemShapes/dbsystemshapename" + actual := NewDbSystemShapeID("12345678-1234-9876-4563-123456789012", "locationName", "dbSystemShapeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dbSystemShapes/dbSystemShapeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDbSystemShapeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dbSystemShapes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dbSystemShapes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dbSystemShapes/dbsystemshapename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dbSystemShapes/dbSystemShapeName", Expected: &DbSystemShapeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DbSystemShapeName: "dbsystemshapename", + LocationName: "locationName", + DbSystemShapeName: "dbSystemShapeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dbSystemShapes/dbsystemshapename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dbSystemShapes/dbSystemShapeName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDbSystemShapeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dbSystemShapes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dbSystemShapes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dBsYsTeMsHaPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dBsYsTeMsHaPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dbSystemShapes/dbsystemshapename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dbSystemShapes/dbSystemShapeName", Expected: &DbSystemShapeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DbSystemShapeName: "dbsystemshapename", + LocationName: "locationName", + DbSystemShapeName: "dbSystemShapeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dbSystemShapes/dbsystemshapename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dbSystemShapes/dbSystemShapeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dBsYsTeMsHaPeS/dBsYsTeMsHaPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dBsYsTeMsHaPeS/dBsYsTeMsHaPeNaMe", Expected: &DbSystemShapeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", DbSystemShapeName: "dBsYsTeMsHaPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dBsYsTeMsHaPeS/dBsYsTeMsHaPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dBsYsTeMsHaPeS/dBsYsTeMsHaPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location.go b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location.go index 54614c78cbc..56e5e6d1a13 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location.go +++ b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location_test.go b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location_test.go index 73f4b139977..8b39bd12c17 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/README.md b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/README.md index dbac5e64d48..35c7040b7db 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/README.md +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dnsprivateviews.NewDnsPrivateViewID("12345678-1234-9876-4563-123456789012", "location", "dnsprivateviewocid") +id := dnsprivateviews.NewDnsPrivateViewID("12345678-1234-9876-4563-123456789012", "locationName", "dnsPrivateViewName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dnsprivateviews.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := dnsprivateviews.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview.go b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview.go index a369fe62efc..a2434fd5825 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview.go +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview.go @@ -113,9 +113,9 @@ func (id DnsPrivateViewId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDnsPrivateViews", "dnsPrivateViews", "dnsPrivateViews"), - resourceids.UserSpecifiedSegment("dnsPrivateViewName", "dnsprivateviewocid"), + resourceids.UserSpecifiedSegment("dnsPrivateViewName", "dnsPrivateViewName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview_test.go b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview_test.go index 960f5d74e62..87deb9c6162 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DnsPrivateViewId{} func TestNewDnsPrivateViewID(t *testing.T) { - id := NewDnsPrivateViewID("12345678-1234-9876-4563-123456789012", "location", "dnsprivateviewocid") + id := NewDnsPrivateViewID("12345678-1234-9876-4563-123456789012", "locationName", "dnsPrivateViewName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DnsPrivateViewName != "dnsprivateviewocid" { - t.Fatalf("Expected %q but got %q for Segment 'DnsPrivateViewName'", id.DnsPrivateViewName, "dnsprivateviewocid") + if id.DnsPrivateViewName != "dnsPrivateViewName" { + t.Fatalf("Expected %q but got %q for Segment 'DnsPrivateViewName'", id.DnsPrivateViewName, "dnsPrivateViewName") } } func TestFormatDnsPrivateViewID(t *testing.T) { - actual := NewDnsPrivateViewID("12345678-1234-9876-4563-123456789012", "location", "dnsprivateviewocid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateViews/dnsprivateviewocid" + actual := NewDnsPrivateViewID("12345678-1234-9876-4563-123456789012", "locationName", "dnsPrivateViewName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateViews/dnsPrivateViewName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDnsPrivateViewID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateViews", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateViews", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateViews/dnsprivateviewocid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateViews/dnsPrivateViewName", Expected: &DnsPrivateViewId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DnsPrivateViewName: "dnsprivateviewocid", + LocationName: "locationName", + DnsPrivateViewName: "dnsPrivateViewName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateViews/dnsprivateviewocid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateViews/dnsPrivateViewName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDnsPrivateViewIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateViews", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateViews", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dNsPrIvAtEvIeWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dNsPrIvAtEvIeWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateViews/dnsprivateviewocid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateViews/dnsPrivateViewName", Expected: &DnsPrivateViewId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DnsPrivateViewName: "dnsprivateviewocid", + LocationName: "locationName", + DnsPrivateViewName: "dnsPrivateViewName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateViews/dnsprivateviewocid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateViews/dnsPrivateViewName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dNsPrIvAtEvIeWs/dNsPrIvAtEvIeWoCiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dNsPrIvAtEvIeWs/dNsPrIvAtEvIeWnAmE", Expected: &DnsPrivateViewId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - DnsPrivateViewName: "dNsPrIvAtEvIeWoCiD", + LocationName: "lOcAtIoNnAmE", + DnsPrivateViewName: "dNsPrIvAtEvIeWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dNsPrIvAtEvIeWs/dNsPrIvAtEvIeWoCiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dNsPrIvAtEvIeWs/dNsPrIvAtEvIeWnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location.go b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location.go index a0c8fdd7456..8224f875a87 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location.go +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location_test.go b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location_test.go index 051c6e46558..6d5d848b925 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/README.md b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/README.md index d543a2dcd81..c9a337f5f3d 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/README.md +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := dnsprivatezones.NewDnsPrivateZoneID("12345678-1234-9876-4563-123456789012", "location", "dnsprivatezonename") +id := dnsprivatezones.NewDnsPrivateZoneID("12345678-1234-9876-4563-123456789012", "locationName", "dnsPrivateZoneName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := dnsprivatezones.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := dnsprivatezones.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone.go b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone.go index 7bf70c5d057..436717fdeaf 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone.go +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone.go @@ -113,9 +113,9 @@ func (id DnsPrivateZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDnsPrivateZones", "dnsPrivateZones", "dnsPrivateZones"), - resourceids.UserSpecifiedSegment("dnsPrivateZoneName", "dnsprivatezonename"), + resourceids.UserSpecifiedSegment("dnsPrivateZoneName", "dnsPrivateZoneName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone_test.go b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone_test.go index 4b27537c940..74562aa8144 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &DnsPrivateZoneId{} func TestNewDnsPrivateZoneID(t *testing.T) { - id := NewDnsPrivateZoneID("12345678-1234-9876-4563-123456789012", "location", "dnsprivatezonename") + id := NewDnsPrivateZoneID("12345678-1234-9876-4563-123456789012", "locationName", "dnsPrivateZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.DnsPrivateZoneName != "dnsprivatezonename" { - t.Fatalf("Expected %q but got %q for Segment 'DnsPrivateZoneName'", id.DnsPrivateZoneName, "dnsprivatezonename") + if id.DnsPrivateZoneName != "dnsPrivateZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'DnsPrivateZoneName'", id.DnsPrivateZoneName, "dnsPrivateZoneName") } } func TestFormatDnsPrivateZoneID(t *testing.T) { - actual := NewDnsPrivateZoneID("12345678-1234-9876-4563-123456789012", "location", "dnsprivatezonename").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateZones/dnsprivatezonename" + actual := NewDnsPrivateZoneID("12345678-1234-9876-4563-123456789012", "locationName", "dnsPrivateZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateZones/dnsPrivateZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDnsPrivateZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateZones", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateZones/dnsprivatezonename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateZones/dnsPrivateZoneName", Expected: &DnsPrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DnsPrivateZoneName: "dnsprivatezonename", + LocationName: "locationName", + DnsPrivateZoneName: "dnsPrivateZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateZones/dnsprivatezonename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateZones/dnsPrivateZoneName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDnsPrivateZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateZones", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateZones", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dNsPrIvAtEzOnEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dNsPrIvAtEzOnEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateZones/dnsprivatezonename", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateZones/dnsPrivateZoneName", Expected: &DnsPrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - DnsPrivateZoneName: "dnsprivatezonename", + LocationName: "locationName", + DnsPrivateZoneName: "dnsPrivateZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/dnsPrivateZones/dnsprivatezonename/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/dnsPrivateZones/dnsPrivateZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dNsPrIvAtEzOnEs/dNsPrIvAtEzOnEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dNsPrIvAtEzOnEs/dNsPrIvAtEzOnEnAmE", Expected: &DnsPrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", DnsPrivateZoneName: "dNsPrIvAtEzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/dNsPrIvAtEzOnEs/dNsPrIvAtEzOnEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/dNsPrIvAtEzOnEs/dNsPrIvAtEzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location.go b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location.go index 349942ad73c..da99d928e82 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location.go +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location_test.go b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location_test.go index 16d41d80f87..148355e5931 100644 --- a/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location_test.go +++ b/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/giversions/README.md b/resource-manager/oracledatabase/2024-06-01/giversions/README.md index 92032bd2d92..15af07d6a10 100644 --- a/resource-manager/oracledatabase/2024-06-01/giversions/README.md +++ b/resource-manager/oracledatabase/2024-06-01/giversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := giversions.NewGiVersionID("12345678-1234-9876-4563-123456789012", "location", "giversionname") +id := giversions.NewGiVersionID("12345678-1234-9876-4563-123456789012", "locationName", "giVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := giversions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := giversions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion.go b/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion.go index 1f2557f9817..8661556d4b3 100644 --- a/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion.go +++ b/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion.go @@ -113,9 +113,9 @@ func (id GiVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticGiVersions", "giVersions", "giVersions"), - resourceids.UserSpecifiedSegment("giVersionName", "giversionname"), + resourceids.UserSpecifiedSegment("giVersionName", "giVersionName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion_test.go b/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion_test.go index c8c18b42df9..1490fd1ac68 100644 --- a/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion_test.go +++ b/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &GiVersionId{} func TestNewGiVersionID(t *testing.T) { - id := NewGiVersionID("12345678-1234-9876-4563-123456789012", "location", "giversionname") + id := NewGiVersionID("12345678-1234-9876-4563-123456789012", "locationName", "giVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.GiVersionName != "giversionname" { - t.Fatalf("Expected %q but got %q for Segment 'GiVersionName'", id.GiVersionName, "giversionname") + if id.GiVersionName != "giVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'GiVersionName'", id.GiVersionName, "giVersionName") } } func TestFormatGiVersionID(t *testing.T) { - actual := NewGiVersionID("12345678-1234-9876-4563-123456789012", "location", "giversionname").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/giVersions/giversionname" + actual := NewGiVersionID("12345678-1234-9876-4563-123456789012", "locationName", "giVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/giVersions/giVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseGiVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/giVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/giVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/giVersions/giversionname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/giVersions/giVersionName", Expected: &GiVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - GiVersionName: "giversionname", + LocationName: "locationName", + GiVersionName: "giVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/giVersions/giversionname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/giVersions/giVersionName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseGiVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/giVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/giVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/gIvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/gIvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/giVersions/giversionname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/giVersions/giVersionName", Expected: &GiVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - GiVersionName: "giversionname", + LocationName: "locationName", + GiVersionName: "giVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/giVersions/giversionname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/giVersions/giVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/gIvErSiOnS/gIvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/gIvErSiOnS/gIvErSiOnNaMe", Expected: &GiVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", GiVersionName: "gIvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/gIvErSiOnS/gIvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/gIvErSiOnS/gIvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/giversions/id_location.go b/resource-manager/oracledatabase/2024-06-01/giversions/id_location.go index 8a6419c0015..b69caafd254 100644 --- a/resource-manager/oracledatabase/2024-06-01/giversions/id_location.go +++ b/resource-manager/oracledatabase/2024-06-01/giversions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/giversions/id_location_test.go b/resource-manager/oracledatabase/2024-06-01/giversions/id_location_test.go index 287d7c02ee2..81c9af4e051 100644 --- a/resource-manager/oracledatabase/2024-06-01/giversions/id_location_test.go +++ b/resource-manager/oracledatabase/2024-06-01/giversions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/systemversions/README.md b/resource-manager/oracledatabase/2024-06-01/systemversions/README.md index f14edcb381e..f0ccb872fc4 100644 --- a/resource-manager/oracledatabase/2024-06-01/systemversions/README.md +++ b/resource-manager/oracledatabase/2024-06-01/systemversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := systemversions.NewSystemVersionID("12345678-1234-9876-4563-123456789012", "location", "systemversionname") +id := systemversions.NewSystemVersionID("12345678-1234-9876-4563-123456789012", "locationName", "systemVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := systemversions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := systemversions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/systemversions/id_location.go b/resource-manager/oracledatabase/2024-06-01/systemversions/id_location.go index bbe0ced21c5..c56f67cb2c2 100644 --- a/resource-manager/oracledatabase/2024-06-01/systemversions/id_location.go +++ b/resource-manager/oracledatabase/2024-06-01/systemversions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/systemversions/id_location_test.go b/resource-manager/oracledatabase/2024-06-01/systemversions/id_location_test.go index 503862e9cfa..d1aba084163 100644 --- a/resource-manager/oracledatabase/2024-06-01/systemversions/id_location_test.go +++ b/resource-manager/oracledatabase/2024-06-01/systemversions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion.go b/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion.go index 158e0101488..b28b393451b 100644 --- a/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion.go +++ b/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion.go @@ -113,9 +113,9 @@ func (id SystemVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSystemVersions", "systemVersions", "systemVersions"), - resourceids.UserSpecifiedSegment("systemVersionName", "systemversionname"), + resourceids.UserSpecifiedSegment("systemVersionName", "systemVersionName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion_test.go b/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion_test.go index 80dbc4c8b2e..6d1f11a4163 100644 --- a/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion_test.go +++ b/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &SystemVersionId{} func TestNewSystemVersionID(t *testing.T) { - id := NewSystemVersionID("12345678-1234-9876-4563-123456789012", "location", "systemversionname") + id := NewSystemVersionID("12345678-1234-9876-4563-123456789012", "locationName", "systemVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.SystemVersionName != "systemversionname" { - t.Fatalf("Expected %q but got %q for Segment 'SystemVersionName'", id.SystemVersionName, "systemversionname") + if id.SystemVersionName != "systemVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'SystemVersionName'", id.SystemVersionName, "systemVersionName") } } func TestFormatSystemVersionID(t *testing.T) { - actual := NewSystemVersionID("12345678-1234-9876-4563-123456789012", "location", "systemversionname").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/systemVersions/systemversionname" + actual := NewSystemVersionID("12345678-1234-9876-4563-123456789012", "locationName", "systemVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/systemVersions/systemVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseSystemVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/systemVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/systemVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/systemVersions/systemversionname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/systemVersions/systemVersionName", Expected: &SystemVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SystemVersionName: "systemversionname", + LocationName: "locationName", + SystemVersionName: "systemVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/systemVersions/systemversionname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/systemVersions/systemVersionName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseSystemVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/systemVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/systemVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/sYsTeMvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/sYsTeMvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/systemVersions/systemversionname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/systemVersions/systemVersionName", Expected: &SystemVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - SystemVersionName: "systemversionname", + LocationName: "locationName", + SystemVersionName: "systemVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/location/systemVersions/systemversionname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Oracle.Database/locations/locationName/systemVersions/systemVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/sYsTeMvErSiOnS/sYsTeMvErSiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/sYsTeMvErSiOnS/sYsTeMvErSiOnNaMe", Expected: &SystemVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", SystemVersionName: "sYsTeMvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoN/sYsTeMvErSiOnS/sYsTeMvErSiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/oRaClE.DaTaBaSe/lOcAtIoNs/lOcAtIoNnAmE/sYsTeMvErSiOnS/sYsTeMvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md index 3aa97044171..38c028c0648 100644 --- a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md +++ b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "virtualnetworkaddressname") +id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "virtualNetworkAddressName") payload := virtualnetworkaddresses.VirtualNetworkAddress{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "virtualnetworkaddressname") +id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "virtualNetworkAddressName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "virtualnetworkaddressname") +id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "virtualNetworkAddressName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworkaddresses.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") +id := virtualnetworkaddresses.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") // alternatively `client.ListByCloudVMCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByCloudVMClusterComplete(ctx, id) diff --git a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster.go b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster.go index 0acd85d0a91..916b2f08848 100644 --- a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster.go +++ b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster.go @@ -115,7 +115,7 @@ func (id CloudVMClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), - resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudvmclustername"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster_test.go b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster_test.go index 73312ba29a9..f953cf0fa76 100644 --- a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster_test.go +++ b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CloudVMClusterId{} func TestNewCloudVMClusterID(t *testing.T) { - id := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername") + id := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCloudVMClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudVmClusterName != "cloudvmclustername" { - t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudvmclustername") + if id.CloudVmClusterName != "cloudVmClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudVmClusterName") } } func TestFormatCloudVMClusterID(t *testing.T) { - actual := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername" + actual := NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCloudVMClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Expected: &CloudVMClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", + CloudVmClusterName: "cloudVmClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/extra", Error: true, }, } @@ -209,16 +209,16 @@ func TestParseCloudVMClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Expected: &CloudVMClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", + CloudVmClusterName: "cloudVmClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/extra", Error: true, }, { diff --git a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress.go b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress.go index 8ceb7eae5c8..d2e41ecac8f 100644 --- a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress.go +++ b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress.go @@ -121,9 +121,9 @@ func (id VirtualNetworkAddressId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), - resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudvmclustername"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), resourceids.StaticSegment("staticVirtualNetworkAddresses", "virtualNetworkAddresses", "virtualNetworkAddresses"), - resourceids.UserSpecifiedSegment("virtualNetworkAddressName", "virtualnetworkaddressname"), + resourceids.UserSpecifiedSegment("virtualNetworkAddressName", "virtualNetworkAddressName"), } } diff --git a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress_test.go b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress_test.go index d4415566729..a20d63f2961 100644 --- a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress_test.go +++ b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkAddressId{} func TestNewVirtualNetworkAddressID(t *testing.T) { - id := NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "virtualnetworkaddressname") + id := NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "virtualNetworkAddressName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewVirtualNetworkAddressID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudVmClusterName != "cloudvmclustername" { - t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudvmclustername") + if id.CloudVmClusterName != "cloudVmClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudVmClusterName'", id.CloudVmClusterName, "cloudVmClusterName") } - if id.VirtualNetworkAddressName != "virtualnetworkaddressname" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkAddressName'", id.VirtualNetworkAddressName, "virtualnetworkaddressname") + if id.VirtualNetworkAddressName != "virtualNetworkAddressName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkAddressName'", id.VirtualNetworkAddressName, "virtualNetworkAddressName") } } func TestFormatVirtualNetworkAddressID(t *testing.T) { - actual := NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudvmclustername", "virtualnetworkaddressname").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/virtualNetworkAddresses/virtualnetworkaddressname" + actual := NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "virtualNetworkAddressName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/virtualNetworkAddresses/virtualNetworkAddressName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVirtualNetworkAddressID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/virtualNetworkAddresses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/virtualNetworkAddresses", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/virtualNetworkAddresses/virtualnetworkaddressname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/virtualNetworkAddresses/virtualNetworkAddressName", Expected: &VirtualNetworkAddressId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", - VirtualNetworkAddressName: "virtualnetworkaddressname", + CloudVmClusterName: "cloudVmClusterName", + VirtualNetworkAddressName: "virtualNetworkAddressName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/virtualNetworkAddresses/virtualnetworkaddressname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/virtualNetworkAddresses/virtualNetworkAddressName/extra", Error: true, }, } @@ -228,7 +228,7 @@ func TestParseVirtualNetworkAddressIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName", Error: true, }, { @@ -238,7 +238,7 @@ func TestParseVirtualNetworkAddressIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/virtualNetworkAddresses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/virtualNetworkAddresses", Error: true, }, { @@ -248,17 +248,17 @@ func TestParseVirtualNetworkAddressIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/virtualNetworkAddresses/virtualnetworkaddressname", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/virtualNetworkAddresses/virtualNetworkAddressName", Expected: &VirtualNetworkAddressId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudVmClusterName: "cloudvmclustername", - VirtualNetworkAddressName: "virtualnetworkaddressname", + CloudVmClusterName: "cloudVmClusterName", + VirtualNetworkAddressName: "virtualNetworkAddressName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudvmclustername/virtualNetworkAddresses/virtualnetworkaddressname/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Oracle.Database/cloudVmClusters/cloudVmClusterName/virtualNetworkAddresses/virtualNetworkAddressName/extra", Error: true, }, { diff --git a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/README.md b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/README.md index 76c0a7895e9..470df5ecb29 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "name") +id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "certificateName") payload := certificateobjectglobalrulestack.CertificateObjectGlobalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "name") +id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "certificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "name") +id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "certificateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/id_certificate.go b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/id_certificate.go index bd222d9a056..8c3eff6e9b0 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/id_certificate.go +++ b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/id_certificate.go @@ -107,7 +107,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/id_certificate_test.go b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/id_certificate_test.go index abba4bf5195..80b5676e156 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/id_certificate_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectglobalrulestack/id_certificate_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("globalRulestackName", "name") + id := NewCertificateID("globalRulestackName", "certificateName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("globalRulestackName", "name").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name" + actual := NewCertificateID("globalRulestackName", "certificateName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseCertificateID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName", Expected: &CertificateId{ GlobalRulestackName: "globalRulestackName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName", Expected: &CertificateId{ GlobalRulestackName: "globalRulestackName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/cErTiFiCaTeS/nAmE", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/cErTiFiCaTeS/nAmE/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/README.md b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/README.md index 82981f05ec3..0df327e5e8e 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName") payload := certificateobjectlocalrulestack.CertificateObjectLocalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/id_localrulestackcertificate.go b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/id_localrulestackcertificate.go index e9a183dfab6..c30fc158e15 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/id_localrulestackcertificate.go +++ b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/id_localrulestackcertificate.go @@ -123,7 +123,7 @@ func (id LocalRulestackCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocalRulestacks", "localRulestacks", "localRulestacks"), resourceids.UserSpecifiedSegment("localRulestackName", "localRulestackName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/id_localrulestackcertificate_test.go b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/id_localrulestackcertificate_test.go index 93b81d3480c..91f0152d03f 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/id_localrulestackcertificate_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/certificateobjectlocalrulestack/id_localrulestackcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalRulestackCertificateId{} func TestNewLocalRulestackCertificateID(t *testing.T) { - id := NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") + id := NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocalRulestackCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocalRulestackName'", id.LocalRulestackName, "localRulestackName") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } func TestFormatLocalRulestackCertificateID(t *testing.T) { - actual := NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name" + actual := NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocalRulestackCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName", Expected: &LocalRulestackCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocalRulestackCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName", Expected: &LocalRulestackCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/cErTiFiCaTeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &LocalRulestackCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocalRulestackName: "lOcAlRuLeStAcKnAmE", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/cErTiFiCaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/README.md b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/README.md index fd4f6fb37cf..49c25c9b5ba 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "name") +id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "fqdnListName") payload := fqdnlistglobalrulestack.FqdnListGlobalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "name") +id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "fqdnListName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "name") +id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "fqdnListName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/id_fqdnlist.go b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/id_fqdnlist.go index 07ba551d9f7..b3d8231df3e 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/id_fqdnlist.go +++ b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/id_fqdnlist.go @@ -107,7 +107,7 @@ func (id FqdnListId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticFqdnLists", "fqdnLists", "fqdnLists"), - resourceids.UserSpecifiedSegment("fqdnListName", "name"), + resourceids.UserSpecifiedSegment("fqdnListName", "fqdnListName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/id_fqdnlist_test.go b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/id_fqdnlist_test.go index d8166732dd6..ebdaf27a501 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/id_fqdnlist_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistglobalrulestack/id_fqdnlist_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &FqdnListId{} func TestNewFqdnListID(t *testing.T) { - id := NewFqdnListID("globalRulestackName", "name") + id := NewFqdnListID("globalRulestackName", "fqdnListName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.FqdnListName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FqdnListName'", id.FqdnListName, "name") + if id.FqdnListName != "fqdnListName" { + t.Fatalf("Expected %q but got %q for Segment 'FqdnListName'", id.FqdnListName, "fqdnListName") } } func TestFormatFqdnListID(t *testing.T) { - actual := NewFqdnListID("globalRulestackName", "name").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name" + actual := NewFqdnListID("globalRulestackName", "fqdnListName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseFqdnListID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName", Expected: &FqdnListId{ GlobalRulestackName: "globalRulestackName", - FqdnListName: "name", + FqdnListName: "fqdnListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseFqdnListIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName", Expected: &FqdnListId{ GlobalRulestackName: "globalRulestackName", - FqdnListName: "name", + FqdnListName: "fqdnListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/fQdNlIsTs/nAmE", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/fQdNlIsTs/fQdNlIsTnAmE", Expected: &FqdnListId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - FqdnListName: "nAmE", + FqdnListName: "fQdNlIsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/fQdNlIsTs/nAmE/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/fQdNlIsTs/fQdNlIsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/README.md b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/README.md index 2e99b8b3607..349aaa1c5fa 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName") payload := fqdnlistlocalrulestack.FqdnListLocalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/id_localrulestackfqdnlist.go b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/id_localrulestackfqdnlist.go index facd15505f4..fa04cdb5fc6 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/id_localrulestackfqdnlist.go +++ b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/id_localrulestackfqdnlist.go @@ -123,7 +123,7 @@ func (id LocalRulestackFqdnListId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocalRulestacks", "localRulestacks", "localRulestacks"), resourceids.UserSpecifiedSegment("localRulestackName", "localRulestackName"), resourceids.StaticSegment("staticFqdnLists", "fqdnLists", "fqdnLists"), - resourceids.UserSpecifiedSegment("fqdnListName", "name"), + resourceids.UserSpecifiedSegment("fqdnListName", "fqdnListName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/id_localrulestackfqdnlist_test.go b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/id_localrulestackfqdnlist_test.go index 494c75754e0..66d858fca54 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/id_localrulestackfqdnlist_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/fqdnlistlocalrulestack/id_localrulestackfqdnlist_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalRulestackFqdnListId{} func TestNewLocalRulestackFqdnListID(t *testing.T) { - id := NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") + id := NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocalRulestackFqdnListID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocalRulestackName'", id.LocalRulestackName, "localRulestackName") } - if id.FqdnListName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FqdnListName'", id.FqdnListName, "name") + if id.FqdnListName != "fqdnListName" { + t.Fatalf("Expected %q but got %q for Segment 'FqdnListName'", id.FqdnListName, "fqdnListName") } } func TestFormatLocalRulestackFqdnListID(t *testing.T) { - actual := NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name" + actual := NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocalRulestackFqdnListID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName", Expected: &LocalRulestackFqdnListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - FqdnListName: "name", + FqdnListName: "fqdnListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocalRulestackFqdnListIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName", Expected: &LocalRulestackFqdnListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - FqdnListName: "name", + FqdnListName: "fqdnListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/fQdNlIsTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/fQdNlIsTs/fQdNlIsTnAmE", Expected: &LocalRulestackFqdnListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocalRulestackName: "lOcAlRuLeStAcKnAmE", - FqdnListName: "nAmE", + FqdnListName: "fQdNlIsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/fQdNlIsTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/fQdNlIsTs/fQdNlIsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/README.md b/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/README.md index f658f66e21d..6cf645d4713 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/README.md @@ -178,14 +178,14 @@ for _, item := range items { ``` -### Example Usage: `GlobalRulestackClient.ListPredefinedUrlCategories` +### Example Usage: `GlobalRulestackClient.ListPredefinedURLCategories` ```go ctx := context.TODO() id := globalrulestack.NewGlobalRulestackID("globalRulestackName") -// alternatively `client.ListPredefinedUrlCategories(ctx, id, globalrulestack.DefaultListPredefinedUrlCategoriesOperationOptions())` can be used to do batched pagination -items, err := client.ListPredefinedUrlCategoriesComplete(ctx, id, globalrulestack.DefaultListPredefinedUrlCategoriesOperationOptions()) +// alternatively `client.ListPredefinedURLCategories(ctx, id, globalrulestack.DefaultListPredefinedURLCategoriesOperationOptions())` can be used to do batched pagination +items, err := client.ListPredefinedURLCategoriesComplete(ctx, id, globalrulestack.DefaultListPredefinedURLCategoriesOperationOptions()) if err != nil { // handle the error } diff --git a/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/method_listpredefinedurlcategories.go b/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/method_listpredefinedurlcategories.go index ceb121db5e2..7748d9bbcaa 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/method_listpredefinedurlcategories.go +++ b/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/method_listpredefinedurlcategories.go @@ -12,39 +12,39 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListPredefinedUrlCategoriesOperationResponse struct { +type ListPredefinedURLCategoriesOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *[]PredefinedUrlCategory + Model *[]PredefinedURLCategory } -type ListPredefinedUrlCategoriesCompleteResult struct { +type ListPredefinedURLCategoriesCompleteResult struct { LatestHttpResponse *http.Response - Items []PredefinedUrlCategory + Items []PredefinedURLCategory } -type ListPredefinedUrlCategoriesOperationOptions struct { +type ListPredefinedURLCategoriesOperationOptions struct { Skip *string Top *int64 } -func DefaultListPredefinedUrlCategoriesOperationOptions() ListPredefinedUrlCategoriesOperationOptions { - return ListPredefinedUrlCategoriesOperationOptions{} +func DefaultListPredefinedURLCategoriesOperationOptions() ListPredefinedURLCategoriesOperationOptions { + return ListPredefinedURLCategoriesOperationOptions{} } -func (o ListPredefinedUrlCategoriesOperationOptions) ToHeaders() *client.Headers { +func (o ListPredefinedURLCategoriesOperationOptions) ToHeaders() *client.Headers { out := client.Headers{} return &out } -func (o ListPredefinedUrlCategoriesOperationOptions) ToOData() *odata.Query { +func (o ListPredefinedURLCategoriesOperationOptions) ToOData() *odata.Query { out := odata.Query{} return &out } -func (o ListPredefinedUrlCategoriesOperationOptions) ToQuery() *client.QueryParams { +func (o ListPredefinedURLCategoriesOperationOptions) ToQuery() *client.QueryParams { out := client.QueryParams{} if o.Skip != nil { out.Append("skip", fmt.Sprintf("%v", *o.Skip)) @@ -55,11 +55,11 @@ func (o ListPredefinedUrlCategoriesOperationOptions) ToQuery() *client.QueryPara return &out } -type ListPredefinedUrlCategoriesCustomPager struct { +type ListPredefinedURLCategoriesCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListPredefinedUrlCategoriesCustomPager) NextPageLink() *odata.Link { +func (p *ListPredefinedURLCategoriesCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -67,8 +67,8 @@ func (p *ListPredefinedUrlCategoriesCustomPager) NextPageLink() *odata.Link { return p.NextLink } -// ListPredefinedUrlCategories ... -func (c GlobalRulestackClient) ListPredefinedUrlCategories(ctx context.Context, id GlobalRulestackId, options ListPredefinedUrlCategoriesOperationOptions) (result ListPredefinedUrlCategoriesOperationResponse, err error) { +// ListPredefinedURLCategories ... +func (c GlobalRulestackClient) ListPredefinedURLCategories(ctx context.Context, id GlobalRulestackId, options ListPredefinedURLCategoriesOperationOptions) (result ListPredefinedURLCategoriesOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -76,7 +76,7 @@ func (c GlobalRulestackClient) ListPredefinedUrlCategories(ctx context.Context, }, HttpMethod: http.MethodPost, OptionsObject: options, - Pager: &ListPredefinedUrlCategoriesCustomPager{}, + Pager: &ListPredefinedURLCategoriesCustomPager{}, Path: fmt.Sprintf("%s/listPredefinedUrlCategories", id.ID()), } @@ -96,7 +96,7 @@ func (c GlobalRulestackClient) ListPredefinedUrlCategories(ctx context.Context, } var values struct { - Values *[]PredefinedUrlCategory `json:"value"` + Values *[]PredefinedURLCategory `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return @@ -107,16 +107,16 @@ func (c GlobalRulestackClient) ListPredefinedUrlCategories(ctx context.Context, return } -// ListPredefinedUrlCategoriesComplete retrieves all the results into a single object -func (c GlobalRulestackClient) ListPredefinedUrlCategoriesComplete(ctx context.Context, id GlobalRulestackId, options ListPredefinedUrlCategoriesOperationOptions) (ListPredefinedUrlCategoriesCompleteResult, error) { - return c.ListPredefinedUrlCategoriesCompleteMatchingPredicate(ctx, id, options, PredefinedUrlCategoryOperationPredicate{}) +// ListPredefinedURLCategoriesComplete retrieves all the results into a single object +func (c GlobalRulestackClient) ListPredefinedURLCategoriesComplete(ctx context.Context, id GlobalRulestackId, options ListPredefinedURLCategoriesOperationOptions) (ListPredefinedURLCategoriesCompleteResult, error) { + return c.ListPredefinedURLCategoriesCompleteMatchingPredicate(ctx, id, options, PredefinedURLCategoryOperationPredicate{}) } -// ListPredefinedUrlCategoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c GlobalRulestackClient) ListPredefinedUrlCategoriesCompleteMatchingPredicate(ctx context.Context, id GlobalRulestackId, options ListPredefinedUrlCategoriesOperationOptions, predicate PredefinedUrlCategoryOperationPredicate) (result ListPredefinedUrlCategoriesCompleteResult, err error) { - items := make([]PredefinedUrlCategory, 0) +// ListPredefinedURLCategoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c GlobalRulestackClient) ListPredefinedURLCategoriesCompleteMatchingPredicate(ctx context.Context, id GlobalRulestackId, options ListPredefinedURLCategoriesOperationOptions, predicate PredefinedURLCategoryOperationPredicate) (result ListPredefinedURLCategoriesCompleteResult, err error) { + items := make([]PredefinedURLCategory, 0) - resp, err := c.ListPredefinedUrlCategories(ctx, id, options) + resp, err := c.ListPredefinedURLCategories(ctx, id, options) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -130,7 +130,7 @@ func (c GlobalRulestackClient) ListPredefinedUrlCategoriesCompleteMatchingPredic } } - result = ListPredefinedUrlCategoriesCompleteResult{ + result = ListPredefinedURLCategoriesCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/model_predefinedurlcategory.go b/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/model_predefinedurlcategory.go index 587790c2f01..ac31f544174 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/model_predefinedurlcategory.go +++ b/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/model_predefinedurlcategory.go @@ -3,7 +3,7 @@ package globalrulestack // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PredefinedUrlCategory struct { +type PredefinedURLCategory struct { Action string `json:"action"` Name string `json:"name"` } diff --git a/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/predicates.go b/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/predicates.go index 7d929b1268a..316180ef6f6 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/predicates.go +++ b/resource-manager/paloaltonetworks/2022-08-29/globalrulestack/predicates.go @@ -62,12 +62,12 @@ func (p GlobalRulestackResourceOperationPredicate) Matches(input GlobalRulestack return true } -type PredefinedUrlCategoryOperationPredicate struct { +type PredefinedURLCategoryOperationPredicate struct { Action *string Name *string } -func (p PredefinedUrlCategoryOperationPredicate) Matches(input PredefinedUrlCategory) bool { +func (p PredefinedURLCategoryOperationPredicate) Matches(input PredefinedURLCategory) bool { if p.Action != nil && *p.Action != input.Action { return false diff --git a/resource-manager/paloaltonetworks/2022-08-29/localrules/README.md b/resource-manager/paloaltonetworks/2022-08-29/localrules/README.md index 3807973a6f7..ad8433ca10a 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/localrules/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/localrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") payload := localrules.LocalRulesResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") read, err := client.GetCounters(ctx, id, localrules.DefaultGetCountersOperationOptions()) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") read, err := client.RefreshCounters(ctx, id, localrules.DefaultRefreshCountersOperationOptions()) if err != nil { @@ -118,7 +118,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") read, err := client.ResetCounters(ctx, id, localrules.DefaultResetCountersOperationOptions()) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/localrules/id_localrule.go b/resource-manager/paloaltonetworks/2022-08-29/localrules/id_localrule.go index 85995a2e630..2f283fd05cd 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/localrules/id_localrule.go +++ b/resource-manager/paloaltonetworks/2022-08-29/localrules/id_localrule.go @@ -123,7 +123,7 @@ func (id LocalRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocalRulestacks", "localRulestacks", "localRulestacks"), resourceids.UserSpecifiedSegment("localRulestackName", "localRulestackName"), resourceids.StaticSegment("staticLocalRules", "localRules", "localRules"), - resourceids.UserSpecifiedSegment("localRuleName", "priority"), + resourceids.UserSpecifiedSegment("localRuleName", "localRuleName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/localrules/id_localrule_test.go b/resource-manager/paloaltonetworks/2022-08-29/localrules/id_localrule_test.go index ab45141c629..1796c21def8 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/localrules/id_localrule_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/localrules/id_localrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalRuleId{} func TestNewLocalRuleID(t *testing.T) { - id := NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") + id := NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocalRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocalRulestackName'", id.LocalRulestackName, "localRulestackName") } - if id.LocalRuleName != "priority" { - t.Fatalf("Expected %q but got %q for Segment 'LocalRuleName'", id.LocalRuleName, "priority") + if id.LocalRuleName != "localRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'LocalRuleName'", id.LocalRuleName, "localRuleName") } } func TestFormatLocalRuleID(t *testing.T) { - actual := NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority" + actual := NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocalRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName", Expected: &LocalRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - LocalRuleName: "priority", + LocalRuleName: "localRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocalRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName", Expected: &LocalRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - LocalRuleName: "priority", + LocalRuleName: "localRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/lOcAlRuLeS/pRiOrItY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/lOcAlRuLeS/lOcAlRuLeNaMe", Expected: &LocalRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocalRulestackName: "lOcAlRuLeStAcKnAmE", - LocalRuleName: "pRiOrItY", + LocalRuleName: "lOcAlRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/lOcAlRuLeS/pRiOrItY/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/lOcAlRuLeS/lOcAlRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/README.md b/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/README.md index 4358bf30324..5d3d8edae39 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/README.md @@ -212,14 +212,14 @@ for _, item := range items { ``` -### Example Usage: `LocalRulestacksClient.ListPredefinedUrlCategories` +### Example Usage: `LocalRulestacksClient.ListPredefinedURLCategories` ```go ctx := context.TODO() id := localrulestacks.NewLocalRulestackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName") -// alternatively `client.ListPredefinedUrlCategories(ctx, id, localrulestacks.DefaultListPredefinedUrlCategoriesOperationOptions())` can be used to do batched pagination -items, err := client.ListPredefinedUrlCategoriesComplete(ctx, id, localrulestacks.DefaultListPredefinedUrlCategoriesOperationOptions()) +// alternatively `client.ListPredefinedURLCategories(ctx, id, localrulestacks.DefaultListPredefinedURLCategoriesOperationOptions())` can be used to do batched pagination +items, err := client.ListPredefinedURLCategoriesComplete(ctx, id, localrulestacks.DefaultListPredefinedURLCategoriesOperationOptions()) if err != nil { // handle the error } diff --git a/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/method_listpredefinedurlcategories.go b/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/method_listpredefinedurlcategories.go index 6af1d69c3e1..3e3cf74134d 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/method_listpredefinedurlcategories.go +++ b/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/method_listpredefinedurlcategories.go @@ -12,39 +12,39 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListPredefinedUrlCategoriesOperationResponse struct { +type ListPredefinedURLCategoriesOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *[]PredefinedUrlCategory + Model *[]PredefinedURLCategory } -type ListPredefinedUrlCategoriesCompleteResult struct { +type ListPredefinedURLCategoriesCompleteResult struct { LatestHttpResponse *http.Response - Items []PredefinedUrlCategory + Items []PredefinedURLCategory } -type ListPredefinedUrlCategoriesOperationOptions struct { +type ListPredefinedURLCategoriesOperationOptions struct { Skip *string Top *int64 } -func DefaultListPredefinedUrlCategoriesOperationOptions() ListPredefinedUrlCategoriesOperationOptions { - return ListPredefinedUrlCategoriesOperationOptions{} +func DefaultListPredefinedURLCategoriesOperationOptions() ListPredefinedURLCategoriesOperationOptions { + return ListPredefinedURLCategoriesOperationOptions{} } -func (o ListPredefinedUrlCategoriesOperationOptions) ToHeaders() *client.Headers { +func (o ListPredefinedURLCategoriesOperationOptions) ToHeaders() *client.Headers { out := client.Headers{} return &out } -func (o ListPredefinedUrlCategoriesOperationOptions) ToOData() *odata.Query { +func (o ListPredefinedURLCategoriesOperationOptions) ToOData() *odata.Query { out := odata.Query{} return &out } -func (o ListPredefinedUrlCategoriesOperationOptions) ToQuery() *client.QueryParams { +func (o ListPredefinedURLCategoriesOperationOptions) ToQuery() *client.QueryParams { out := client.QueryParams{} if o.Skip != nil { out.Append("skip", fmt.Sprintf("%v", *o.Skip)) @@ -55,11 +55,11 @@ func (o ListPredefinedUrlCategoriesOperationOptions) ToQuery() *client.QueryPara return &out } -type ListPredefinedUrlCategoriesCustomPager struct { +type ListPredefinedURLCategoriesCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListPredefinedUrlCategoriesCustomPager) NextPageLink() *odata.Link { +func (p *ListPredefinedURLCategoriesCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -67,8 +67,8 @@ func (p *ListPredefinedUrlCategoriesCustomPager) NextPageLink() *odata.Link { return p.NextLink } -// ListPredefinedUrlCategories ... -func (c LocalRulestacksClient) ListPredefinedUrlCategories(ctx context.Context, id LocalRulestackId, options ListPredefinedUrlCategoriesOperationOptions) (result ListPredefinedUrlCategoriesOperationResponse, err error) { +// ListPredefinedURLCategories ... +func (c LocalRulestacksClient) ListPredefinedURLCategories(ctx context.Context, id LocalRulestackId, options ListPredefinedURLCategoriesOperationOptions) (result ListPredefinedURLCategoriesOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -76,7 +76,7 @@ func (c LocalRulestacksClient) ListPredefinedUrlCategories(ctx context.Context, }, HttpMethod: http.MethodPost, OptionsObject: options, - Pager: &ListPredefinedUrlCategoriesCustomPager{}, + Pager: &ListPredefinedURLCategoriesCustomPager{}, Path: fmt.Sprintf("%s/listPredefinedUrlCategories", id.ID()), } @@ -96,7 +96,7 @@ func (c LocalRulestacksClient) ListPredefinedUrlCategories(ctx context.Context, } var values struct { - Values *[]PredefinedUrlCategory `json:"value"` + Values *[]PredefinedURLCategory `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return @@ -107,16 +107,16 @@ func (c LocalRulestacksClient) ListPredefinedUrlCategories(ctx context.Context, return } -// ListPredefinedUrlCategoriesComplete retrieves all the results into a single object -func (c LocalRulestacksClient) ListPredefinedUrlCategoriesComplete(ctx context.Context, id LocalRulestackId, options ListPredefinedUrlCategoriesOperationOptions) (ListPredefinedUrlCategoriesCompleteResult, error) { - return c.ListPredefinedUrlCategoriesCompleteMatchingPredicate(ctx, id, options, PredefinedUrlCategoryOperationPredicate{}) +// ListPredefinedURLCategoriesComplete retrieves all the results into a single object +func (c LocalRulestacksClient) ListPredefinedURLCategoriesComplete(ctx context.Context, id LocalRulestackId, options ListPredefinedURLCategoriesOperationOptions) (ListPredefinedURLCategoriesCompleteResult, error) { + return c.ListPredefinedURLCategoriesCompleteMatchingPredicate(ctx, id, options, PredefinedURLCategoryOperationPredicate{}) } -// ListPredefinedUrlCategoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LocalRulestacksClient) ListPredefinedUrlCategoriesCompleteMatchingPredicate(ctx context.Context, id LocalRulestackId, options ListPredefinedUrlCategoriesOperationOptions, predicate PredefinedUrlCategoryOperationPredicate) (result ListPredefinedUrlCategoriesCompleteResult, err error) { - items := make([]PredefinedUrlCategory, 0) +// ListPredefinedURLCategoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LocalRulestacksClient) ListPredefinedURLCategoriesCompleteMatchingPredicate(ctx context.Context, id LocalRulestackId, options ListPredefinedURLCategoriesOperationOptions, predicate PredefinedURLCategoryOperationPredicate) (result ListPredefinedURLCategoriesCompleteResult, err error) { + items := make([]PredefinedURLCategory, 0) - resp, err := c.ListPredefinedUrlCategories(ctx, id, options) + resp, err := c.ListPredefinedURLCategories(ctx, id, options) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -130,7 +130,7 @@ func (c LocalRulestacksClient) ListPredefinedUrlCategoriesCompleteMatchingPredic } } - result = ListPredefinedUrlCategoriesCompleteResult{ + result = ListPredefinedURLCategoriesCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/model_predefinedurlcategory.go b/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/model_predefinedurlcategory.go index bf11b4898e1..9003c358312 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/model_predefinedurlcategory.go +++ b/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/model_predefinedurlcategory.go @@ -3,7 +3,7 @@ package localrulestacks // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PredefinedUrlCategory struct { +type PredefinedURLCategory struct { Action string `json:"action"` Name string `json:"name"` } diff --git a/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/predicates.go b/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/predicates.go index 82fa87587c5..b7c888c638f 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/predicates.go +++ b/resource-manager/paloaltonetworks/2022-08-29/localrulestacks/predicates.go @@ -62,12 +62,12 @@ func (p LocalRulestackResourceOperationPredicate) Matches(input LocalRulestackRe return true } -type PredefinedUrlCategoryOperationPredicate struct { +type PredefinedURLCategoryOperationPredicate struct { Action *string Name *string } -func (p PredefinedUrlCategoryOperationPredicate) Matches(input PredefinedUrlCategory) bool { +func (p PredefinedURLCategoryOperationPredicate) Matches(input PredefinedURLCategory) bool { if p.Action != nil && *p.Action != input.Action { return false diff --git a/resource-manager/paloaltonetworks/2022-08-29/postrules/README.md b/resource-manager/paloaltonetworks/2022-08-29/postrules/README.md index 123d4ed8b28..3e3734b5f4b 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/postrules/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/postrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") payload := postrules.PostRulesResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") read, err := client.GetCounters(ctx, id, postrules.DefaultGetCountersOperationOptions()) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") read, err := client.RefreshCounters(ctx, id, postrules.DefaultRefreshCountersOperationOptions()) if err != nil { @@ -118,7 +118,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") read, err := client.ResetCounters(ctx, id, postrules.DefaultResetCountersOperationOptions()) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/postrules/id_postrule.go b/resource-manager/paloaltonetworks/2022-08-29/postrules/id_postrule.go index 2825aa1214a..1344cfb4d54 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/postrules/id_postrule.go +++ b/resource-manager/paloaltonetworks/2022-08-29/postrules/id_postrule.go @@ -107,7 +107,7 @@ func (id PostRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticPostRules", "postRules", "postRules"), - resourceids.UserSpecifiedSegment("postRuleName", "priority"), + resourceids.UserSpecifiedSegment("postRuleName", "postRuleName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/postrules/id_postrule_test.go b/resource-manager/paloaltonetworks/2022-08-29/postrules/id_postrule_test.go index 3ff1246134f..f9e6a2cd4f1 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/postrules/id_postrule_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/postrules/id_postrule_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &PostRuleId{} func TestNewPostRuleID(t *testing.T) { - id := NewPostRuleID("globalRulestackName", "priority") + id := NewPostRuleID("globalRulestackName", "postRuleName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.PostRuleName != "priority" { - t.Fatalf("Expected %q but got %q for Segment 'PostRuleName'", id.PostRuleName, "priority") + if id.PostRuleName != "postRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'PostRuleName'", id.PostRuleName, "postRuleName") } } func TestFormatPostRuleID(t *testing.T) { - actual := NewPostRuleID("globalRulestackName", "priority").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority" + actual := NewPostRuleID("globalRulestackName", "postRuleName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParsePostRuleID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName", Expected: &PostRuleId{ GlobalRulestackName: "globalRulestackName", - PostRuleName: "priority", + PostRuleName: "postRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParsePostRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName", Expected: &PostRuleId{ GlobalRulestackName: "globalRulestackName", - PostRuleName: "priority", + PostRuleName: "postRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pOsTrUlEs/pRiOrItY", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pOsTrUlEs/pOsTrUlEnAmE", Expected: &PostRuleId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - PostRuleName: "pRiOrItY", + PostRuleName: "pOsTrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pOsTrUlEs/pRiOrItY/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pOsTrUlEs/pOsTrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/README.md b/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/README.md index aae37230bb5..d4c70219763 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "name") +id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "prefixListName") payload := prefixlistglobalrulestack.PrefixListGlobalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "name") +id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "prefixListName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "name") +id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "prefixListName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/id_prefixlist.go b/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/id_prefixlist.go index 6c3711bb90b..f4cdddc2bbc 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/id_prefixlist.go +++ b/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/id_prefixlist.go @@ -107,7 +107,7 @@ func (id PrefixListId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticPrefixLists", "prefixLists", "prefixLists"), - resourceids.UserSpecifiedSegment("prefixListName", "name"), + resourceids.UserSpecifiedSegment("prefixListName", "prefixListName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/id_prefixlist_test.go b/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/id_prefixlist_test.go index aa2eaba3808..75e40ad61ea 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/id_prefixlist_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/prefixlistglobalrulestack/id_prefixlist_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &PrefixListId{} func TestNewPrefixListID(t *testing.T) { - id := NewPrefixListID("globalRulestackName", "name") + id := NewPrefixListID("globalRulestackName", "prefixListName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.PrefixListName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'PrefixListName'", id.PrefixListName, "name") + if id.PrefixListName != "prefixListName" { + t.Fatalf("Expected %q but got %q for Segment 'PrefixListName'", id.PrefixListName, "prefixListName") } } func TestFormatPrefixListID(t *testing.T) { - actual := NewPrefixListID("globalRulestackName", "name").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name" + actual := NewPrefixListID("globalRulestackName", "prefixListName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParsePrefixListID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName", Expected: &PrefixListId{ GlobalRulestackName: "globalRulestackName", - PrefixListName: "name", + PrefixListName: "prefixListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParsePrefixListIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName", Expected: &PrefixListId{ GlobalRulestackName: "globalRulestackName", - PrefixListName: "name", + PrefixListName: "prefixListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReFiXlIsTs/nAmE", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReFiXlIsTs/pReFiXlIsTnAmE", Expected: &PrefixListId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - PrefixListName: "nAmE", + PrefixListName: "pReFiXlIsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReFiXlIsTs/nAmE/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReFiXlIsTs/pReFiXlIsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/README.md b/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/README.md index 0c97e7e7cc3..1bd77becec4 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName") payload := prefixlistlocalrulestack.PrefixListResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/id_localrulestackprefixlist.go b/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/id_localrulestackprefixlist.go index b59f9eb3ed4..083d13d5471 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/id_localrulestackprefixlist.go +++ b/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/id_localrulestackprefixlist.go @@ -123,7 +123,7 @@ func (id LocalRulestackPrefixListId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocalRulestacks", "localRulestacks", "localRulestacks"), resourceids.UserSpecifiedSegment("localRulestackName", "localRulestackName"), resourceids.StaticSegment("staticPrefixLists", "prefixLists", "prefixLists"), - resourceids.UserSpecifiedSegment("prefixListName", "name"), + resourceids.UserSpecifiedSegment("prefixListName", "prefixListName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/id_localrulestackprefixlist_test.go b/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/id_localrulestackprefixlist_test.go index 60d86477170..40f5e598c3c 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/id_localrulestackprefixlist_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/prefixlistlocalrulestack/id_localrulestackprefixlist_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalRulestackPrefixListId{} func TestNewLocalRulestackPrefixListID(t *testing.T) { - id := NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") + id := NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocalRulestackPrefixListID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocalRulestackName'", id.LocalRulestackName, "localRulestackName") } - if id.PrefixListName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'PrefixListName'", id.PrefixListName, "name") + if id.PrefixListName != "prefixListName" { + t.Fatalf("Expected %q but got %q for Segment 'PrefixListName'", id.PrefixListName, "prefixListName") } } func TestFormatLocalRulestackPrefixListID(t *testing.T) { - actual := NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name" + actual := NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocalRulestackPrefixListID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName", Expected: &LocalRulestackPrefixListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - PrefixListName: "name", + PrefixListName: "prefixListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocalRulestackPrefixListIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName", Expected: &LocalRulestackPrefixListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - PrefixListName: "name", + PrefixListName: "prefixListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/pReFiXlIsTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/pReFiXlIsTs/pReFiXlIsTnAmE", Expected: &LocalRulestackPrefixListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocalRulestackName: "lOcAlRuLeStAcKnAmE", - PrefixListName: "nAmE", + PrefixListName: "pReFiXlIsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/pReFiXlIsTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/pReFiXlIsTs/pReFiXlIsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2022-08-29/prerules/README.md b/resource-manager/paloaltonetworks/2022-08-29/prerules/README.md index 009a8d93f08..df7535cd0c7 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prerules/README.md +++ b/resource-manager/paloaltonetworks/2022-08-29/prerules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") payload := prerules.PreRulesResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") read, err := client.GetCounters(ctx, id, prerules.DefaultGetCountersOperationOptions()) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") read, err := client.RefreshCounters(ctx, id, prerules.DefaultRefreshCountersOperationOptions()) if err != nil { @@ -118,7 +118,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") read, err := client.ResetCounters(ctx, id, prerules.DefaultResetCountersOperationOptions()) if err != nil { diff --git a/resource-manager/paloaltonetworks/2022-08-29/prerules/id_prerule.go b/resource-manager/paloaltonetworks/2022-08-29/prerules/id_prerule.go index 588a7364adc..963ea011fa2 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prerules/id_prerule.go +++ b/resource-manager/paloaltonetworks/2022-08-29/prerules/id_prerule.go @@ -107,7 +107,7 @@ func (id PreRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticPreRules", "preRules", "preRules"), - resourceids.UserSpecifiedSegment("preRuleName", "priority"), + resourceids.UserSpecifiedSegment("preRuleName", "preRuleName"), } } diff --git a/resource-manager/paloaltonetworks/2022-08-29/prerules/id_prerule_test.go b/resource-manager/paloaltonetworks/2022-08-29/prerules/id_prerule_test.go index 27fe4232c53..51fc1b5313e 100644 --- a/resource-manager/paloaltonetworks/2022-08-29/prerules/id_prerule_test.go +++ b/resource-manager/paloaltonetworks/2022-08-29/prerules/id_prerule_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &PreRuleId{} func TestNewPreRuleID(t *testing.T) { - id := NewPreRuleID("globalRulestackName", "priority") + id := NewPreRuleID("globalRulestackName", "preRuleName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.PreRuleName != "priority" { - t.Fatalf("Expected %q but got %q for Segment 'PreRuleName'", id.PreRuleName, "priority") + if id.PreRuleName != "preRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'PreRuleName'", id.PreRuleName, "preRuleName") } } func TestFormatPreRuleID(t *testing.T) { - actual := NewPreRuleID("globalRulestackName", "priority").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority" + actual := NewPreRuleID("globalRulestackName", "preRuleName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParsePreRuleID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName", Expected: &PreRuleId{ GlobalRulestackName: "globalRulestackName", - PreRuleName: "priority", + PreRuleName: "preRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParsePreRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName", Expected: &PreRuleId{ GlobalRulestackName: "globalRulestackName", - PreRuleName: "priority", + PreRuleName: "preRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReRuLeS/pRiOrItY", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReRuLeS/pReRuLeNaMe", Expected: &PreRuleId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - PreRuleName: "pRiOrItY", + PreRuleName: "pReRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReRuLeS/pRiOrItY/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReRuLeS/pReRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/README.md b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/README.md index 4a20f7e1efb..0175106d348 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "name") +id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "certificateName") payload := certificateobjectglobalrulestack.CertificateObjectGlobalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "name") +id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "certificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "name") +id := certificateobjectglobalrulestack.NewCertificateID("globalRulestackName", "certificateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/id_certificate.go b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/id_certificate.go index bd222d9a056..8c3eff6e9b0 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/id_certificate.go +++ b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/id_certificate.go @@ -107,7 +107,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/id_certificate_test.go b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/id_certificate_test.go index abba4bf5195..80b5676e156 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/id_certificate_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectglobalrulestack/id_certificate_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("globalRulestackName", "name") + id := NewCertificateID("globalRulestackName", "certificateName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("globalRulestackName", "name").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name" + actual := NewCertificateID("globalRulestackName", "certificateName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseCertificateID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName", Expected: &CertificateId{ GlobalRulestackName: "globalRulestackName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName", Expected: &CertificateId{ GlobalRulestackName: "globalRulestackName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/cErTiFiCaTeS/nAmE", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/cErTiFiCaTeS/nAmE/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/README.md b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/README.md index 02f0955495e..ba66f44d2ea 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName") payload := certificateobjectlocalrulestack.CertificateObjectLocalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := certificateobjectlocalrulestack.NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/id_localrulestackcertificate.go b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/id_localrulestackcertificate.go index e9a183dfab6..c30fc158e15 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/id_localrulestackcertificate.go +++ b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/id_localrulestackcertificate.go @@ -123,7 +123,7 @@ func (id LocalRulestackCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocalRulestacks", "localRulestacks", "localRulestacks"), resourceids.UserSpecifiedSegment("localRulestackName", "localRulestackName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/id_localrulestackcertificate_test.go b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/id_localrulestackcertificate_test.go index 93b81d3480c..91f0152d03f 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/id_localrulestackcertificate_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/certificateobjectlocalrulestack/id_localrulestackcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalRulestackCertificateId{} func TestNewLocalRulestackCertificateID(t *testing.T) { - id := NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") + id := NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocalRulestackCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocalRulestackName'", id.LocalRulestackName, "localRulestackName") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } func TestFormatLocalRulestackCertificateID(t *testing.T) { - actual := NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name" + actual := NewLocalRulestackCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocalRulestackCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName", Expected: &LocalRulestackCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocalRulestackCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName", Expected: &LocalRulestackCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/cErTiFiCaTeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &LocalRulestackCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocalRulestackName: "lOcAlRuLeStAcKnAmE", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/cErTiFiCaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/README.md b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/README.md index b6a03e047dc..fa4d29fbf2e 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "name") +id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "fqdnListName") payload := fqdnlistglobalrulestack.FqdnListGlobalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "name") +id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "fqdnListName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "name") +id := fqdnlistglobalrulestack.NewFqdnListID("globalRulestackName", "fqdnListName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/id_fqdnlist.go b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/id_fqdnlist.go index 07ba551d9f7..b3d8231df3e 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/id_fqdnlist.go +++ b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/id_fqdnlist.go @@ -107,7 +107,7 @@ func (id FqdnListId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticFqdnLists", "fqdnLists", "fqdnLists"), - resourceids.UserSpecifiedSegment("fqdnListName", "name"), + resourceids.UserSpecifiedSegment("fqdnListName", "fqdnListName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/id_fqdnlist_test.go b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/id_fqdnlist_test.go index d8166732dd6..ebdaf27a501 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/id_fqdnlist_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistglobalrulestack/id_fqdnlist_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &FqdnListId{} func TestNewFqdnListID(t *testing.T) { - id := NewFqdnListID("globalRulestackName", "name") + id := NewFqdnListID("globalRulestackName", "fqdnListName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.FqdnListName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FqdnListName'", id.FqdnListName, "name") + if id.FqdnListName != "fqdnListName" { + t.Fatalf("Expected %q but got %q for Segment 'FqdnListName'", id.FqdnListName, "fqdnListName") } } func TestFormatFqdnListID(t *testing.T) { - actual := NewFqdnListID("globalRulestackName", "name").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name" + actual := NewFqdnListID("globalRulestackName", "fqdnListName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseFqdnListID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName", Expected: &FqdnListId{ GlobalRulestackName: "globalRulestackName", - FqdnListName: "name", + FqdnListName: "fqdnListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseFqdnListIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName", Expected: &FqdnListId{ GlobalRulestackName: "globalRulestackName", - FqdnListName: "name", + FqdnListName: "fqdnListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/fqdnLists/fqdnListName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/fQdNlIsTs/nAmE", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/fQdNlIsTs/fQdNlIsTnAmE", Expected: &FqdnListId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - FqdnListName: "nAmE", + FqdnListName: "fQdNlIsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/fQdNlIsTs/nAmE/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/fQdNlIsTs/fQdNlIsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/README.md b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/README.md index 64fd49742e2..db114b85bfa 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName") payload := fqdnlistlocalrulestack.FqdnListLocalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := fqdnlistlocalrulestack.NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/id_localrulestackfqdnlist.go b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/id_localrulestackfqdnlist.go index facd15505f4..fa04cdb5fc6 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/id_localrulestackfqdnlist.go +++ b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/id_localrulestackfqdnlist.go @@ -123,7 +123,7 @@ func (id LocalRulestackFqdnListId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocalRulestacks", "localRulestacks", "localRulestacks"), resourceids.UserSpecifiedSegment("localRulestackName", "localRulestackName"), resourceids.StaticSegment("staticFqdnLists", "fqdnLists", "fqdnLists"), - resourceids.UserSpecifiedSegment("fqdnListName", "name"), + resourceids.UserSpecifiedSegment("fqdnListName", "fqdnListName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/id_localrulestackfqdnlist_test.go b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/id_localrulestackfqdnlist_test.go index 494c75754e0..66d858fca54 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/id_localrulestackfqdnlist_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/fqdnlistlocalrulestack/id_localrulestackfqdnlist_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalRulestackFqdnListId{} func TestNewLocalRulestackFqdnListID(t *testing.T) { - id := NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") + id := NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocalRulestackFqdnListID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocalRulestackName'", id.LocalRulestackName, "localRulestackName") } - if id.FqdnListName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'FqdnListName'", id.FqdnListName, "name") + if id.FqdnListName != "fqdnListName" { + t.Fatalf("Expected %q but got %q for Segment 'FqdnListName'", id.FqdnListName, "fqdnListName") } } func TestFormatLocalRulestackFqdnListID(t *testing.T) { - actual := NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name" + actual := NewLocalRulestackFqdnListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "fqdnListName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocalRulestackFqdnListID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName", Expected: &LocalRulestackFqdnListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - FqdnListName: "name", + FqdnListName: "fqdnListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocalRulestackFqdnListIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName", Expected: &LocalRulestackFqdnListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - FqdnListName: "name", + FqdnListName: "fqdnListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/fqdnLists/fqdnListName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/fQdNlIsTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/fQdNlIsTs/fQdNlIsTnAmE", Expected: &LocalRulestackFqdnListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocalRulestackName: "lOcAlRuLeStAcKnAmE", - FqdnListName: "nAmE", + FqdnListName: "fQdNlIsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/fQdNlIsTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/fQdNlIsTs/fQdNlIsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/README.md b/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/README.md index 279d8ff0b77..15b57b0aafa 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/README.md @@ -178,14 +178,14 @@ for _, item := range items { ``` -### Example Usage: `GlobalRulestackClient.ListPredefinedUrlCategories` +### Example Usage: `GlobalRulestackClient.ListPredefinedURLCategories` ```go ctx := context.TODO() id := globalrulestack.NewGlobalRulestackID("globalRulestackName") -// alternatively `client.ListPredefinedUrlCategories(ctx, id, globalrulestack.DefaultListPredefinedUrlCategoriesOperationOptions())` can be used to do batched pagination -items, err := client.ListPredefinedUrlCategoriesComplete(ctx, id, globalrulestack.DefaultListPredefinedUrlCategoriesOperationOptions()) +// alternatively `client.ListPredefinedURLCategories(ctx, id, globalrulestack.DefaultListPredefinedURLCategoriesOperationOptions())` can be used to do batched pagination +items, err := client.ListPredefinedURLCategoriesComplete(ctx, id, globalrulestack.DefaultListPredefinedURLCategoriesOperationOptions()) if err != nil { // handle the error } diff --git a/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/method_listpredefinedurlcategories.go b/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/method_listpredefinedurlcategories.go index ceb121db5e2..7748d9bbcaa 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/method_listpredefinedurlcategories.go +++ b/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/method_listpredefinedurlcategories.go @@ -12,39 +12,39 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListPredefinedUrlCategoriesOperationResponse struct { +type ListPredefinedURLCategoriesOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *[]PredefinedUrlCategory + Model *[]PredefinedURLCategory } -type ListPredefinedUrlCategoriesCompleteResult struct { +type ListPredefinedURLCategoriesCompleteResult struct { LatestHttpResponse *http.Response - Items []PredefinedUrlCategory + Items []PredefinedURLCategory } -type ListPredefinedUrlCategoriesOperationOptions struct { +type ListPredefinedURLCategoriesOperationOptions struct { Skip *string Top *int64 } -func DefaultListPredefinedUrlCategoriesOperationOptions() ListPredefinedUrlCategoriesOperationOptions { - return ListPredefinedUrlCategoriesOperationOptions{} +func DefaultListPredefinedURLCategoriesOperationOptions() ListPredefinedURLCategoriesOperationOptions { + return ListPredefinedURLCategoriesOperationOptions{} } -func (o ListPredefinedUrlCategoriesOperationOptions) ToHeaders() *client.Headers { +func (o ListPredefinedURLCategoriesOperationOptions) ToHeaders() *client.Headers { out := client.Headers{} return &out } -func (o ListPredefinedUrlCategoriesOperationOptions) ToOData() *odata.Query { +func (o ListPredefinedURLCategoriesOperationOptions) ToOData() *odata.Query { out := odata.Query{} return &out } -func (o ListPredefinedUrlCategoriesOperationOptions) ToQuery() *client.QueryParams { +func (o ListPredefinedURLCategoriesOperationOptions) ToQuery() *client.QueryParams { out := client.QueryParams{} if o.Skip != nil { out.Append("skip", fmt.Sprintf("%v", *o.Skip)) @@ -55,11 +55,11 @@ func (o ListPredefinedUrlCategoriesOperationOptions) ToQuery() *client.QueryPara return &out } -type ListPredefinedUrlCategoriesCustomPager struct { +type ListPredefinedURLCategoriesCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListPredefinedUrlCategoriesCustomPager) NextPageLink() *odata.Link { +func (p *ListPredefinedURLCategoriesCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -67,8 +67,8 @@ func (p *ListPredefinedUrlCategoriesCustomPager) NextPageLink() *odata.Link { return p.NextLink } -// ListPredefinedUrlCategories ... -func (c GlobalRulestackClient) ListPredefinedUrlCategories(ctx context.Context, id GlobalRulestackId, options ListPredefinedUrlCategoriesOperationOptions) (result ListPredefinedUrlCategoriesOperationResponse, err error) { +// ListPredefinedURLCategories ... +func (c GlobalRulestackClient) ListPredefinedURLCategories(ctx context.Context, id GlobalRulestackId, options ListPredefinedURLCategoriesOperationOptions) (result ListPredefinedURLCategoriesOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -76,7 +76,7 @@ func (c GlobalRulestackClient) ListPredefinedUrlCategories(ctx context.Context, }, HttpMethod: http.MethodPost, OptionsObject: options, - Pager: &ListPredefinedUrlCategoriesCustomPager{}, + Pager: &ListPredefinedURLCategoriesCustomPager{}, Path: fmt.Sprintf("%s/listPredefinedUrlCategories", id.ID()), } @@ -96,7 +96,7 @@ func (c GlobalRulestackClient) ListPredefinedUrlCategories(ctx context.Context, } var values struct { - Values *[]PredefinedUrlCategory `json:"value"` + Values *[]PredefinedURLCategory `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return @@ -107,16 +107,16 @@ func (c GlobalRulestackClient) ListPredefinedUrlCategories(ctx context.Context, return } -// ListPredefinedUrlCategoriesComplete retrieves all the results into a single object -func (c GlobalRulestackClient) ListPredefinedUrlCategoriesComplete(ctx context.Context, id GlobalRulestackId, options ListPredefinedUrlCategoriesOperationOptions) (ListPredefinedUrlCategoriesCompleteResult, error) { - return c.ListPredefinedUrlCategoriesCompleteMatchingPredicate(ctx, id, options, PredefinedUrlCategoryOperationPredicate{}) +// ListPredefinedURLCategoriesComplete retrieves all the results into a single object +func (c GlobalRulestackClient) ListPredefinedURLCategoriesComplete(ctx context.Context, id GlobalRulestackId, options ListPredefinedURLCategoriesOperationOptions) (ListPredefinedURLCategoriesCompleteResult, error) { + return c.ListPredefinedURLCategoriesCompleteMatchingPredicate(ctx, id, options, PredefinedURLCategoryOperationPredicate{}) } -// ListPredefinedUrlCategoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c GlobalRulestackClient) ListPredefinedUrlCategoriesCompleteMatchingPredicate(ctx context.Context, id GlobalRulestackId, options ListPredefinedUrlCategoriesOperationOptions, predicate PredefinedUrlCategoryOperationPredicate) (result ListPredefinedUrlCategoriesCompleteResult, err error) { - items := make([]PredefinedUrlCategory, 0) +// ListPredefinedURLCategoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c GlobalRulestackClient) ListPredefinedURLCategoriesCompleteMatchingPredicate(ctx context.Context, id GlobalRulestackId, options ListPredefinedURLCategoriesOperationOptions, predicate PredefinedURLCategoryOperationPredicate) (result ListPredefinedURLCategoriesCompleteResult, err error) { + items := make([]PredefinedURLCategory, 0) - resp, err := c.ListPredefinedUrlCategories(ctx, id, options) + resp, err := c.ListPredefinedURLCategories(ctx, id, options) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -130,7 +130,7 @@ func (c GlobalRulestackClient) ListPredefinedUrlCategoriesCompleteMatchingPredic } } - result = ListPredefinedUrlCategoriesCompleteResult{ + result = ListPredefinedURLCategoriesCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/model_predefinedurlcategory.go b/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/model_predefinedurlcategory.go index 587790c2f01..ac31f544174 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/model_predefinedurlcategory.go +++ b/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/model_predefinedurlcategory.go @@ -3,7 +3,7 @@ package globalrulestack // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PredefinedUrlCategory struct { +type PredefinedURLCategory struct { Action string `json:"action"` Name string `json:"name"` } diff --git a/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/predicates.go b/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/predicates.go index 7d929b1268a..316180ef6f6 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/predicates.go +++ b/resource-manager/paloaltonetworks/2023-09-01/globalrulestack/predicates.go @@ -62,12 +62,12 @@ func (p GlobalRulestackResourceOperationPredicate) Matches(input GlobalRulestack return true } -type PredefinedUrlCategoryOperationPredicate struct { +type PredefinedURLCategoryOperationPredicate struct { Action *string Name *string } -func (p PredefinedUrlCategoryOperationPredicate) Matches(input PredefinedUrlCategory) bool { +func (p PredefinedURLCategoryOperationPredicate) Matches(input PredefinedURLCategory) bool { if p.Action != nil && *p.Action != input.Action { return false diff --git a/resource-manager/paloaltonetworks/2023-09-01/localrules/README.md b/resource-manager/paloaltonetworks/2023-09-01/localrules/README.md index a00ef006de8..2bb7caa38be 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/localrules/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/localrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") payload := localrules.LocalRulesResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") read, err := client.GetCounters(ctx, id, localrules.DefaultGetCountersOperationOptions()) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") read, err := client.RefreshCounters(ctx, id, localrules.DefaultRefreshCountersOperationOptions()) if err != nil { @@ -118,7 +118,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") +id := localrules.NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") read, err := client.ResetCounters(ctx, id, localrules.DefaultResetCountersOperationOptions()) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/localrules/id_localrule.go b/resource-manager/paloaltonetworks/2023-09-01/localrules/id_localrule.go index 85995a2e630..2f283fd05cd 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/localrules/id_localrule.go +++ b/resource-manager/paloaltonetworks/2023-09-01/localrules/id_localrule.go @@ -123,7 +123,7 @@ func (id LocalRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocalRulestacks", "localRulestacks", "localRulestacks"), resourceids.UserSpecifiedSegment("localRulestackName", "localRulestackName"), resourceids.StaticSegment("staticLocalRules", "localRules", "localRules"), - resourceids.UserSpecifiedSegment("localRuleName", "priority"), + resourceids.UserSpecifiedSegment("localRuleName", "localRuleName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/localrules/id_localrule_test.go b/resource-manager/paloaltonetworks/2023-09-01/localrules/id_localrule_test.go index ab45141c629..1796c21def8 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/localrules/id_localrule_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/localrules/id_localrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalRuleId{} func TestNewLocalRuleID(t *testing.T) { - id := NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority") + id := NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocalRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocalRulestackName'", id.LocalRulestackName, "localRulestackName") } - if id.LocalRuleName != "priority" { - t.Fatalf("Expected %q but got %q for Segment 'LocalRuleName'", id.LocalRuleName, "priority") + if id.LocalRuleName != "localRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'LocalRuleName'", id.LocalRuleName, "localRuleName") } } func TestFormatLocalRuleID(t *testing.T) { - actual := NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "priority").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority" + actual := NewLocalRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "localRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocalRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName", Expected: &LocalRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - LocalRuleName: "priority", + LocalRuleName: "localRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocalRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName", Expected: &LocalRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - LocalRuleName: "priority", + LocalRuleName: "localRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/priority/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/localRules/localRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/lOcAlRuLeS/pRiOrItY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/lOcAlRuLeS/lOcAlRuLeNaMe", Expected: &LocalRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocalRulestackName: "lOcAlRuLeStAcKnAmE", - LocalRuleName: "pRiOrItY", + LocalRuleName: "lOcAlRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/lOcAlRuLeS/pRiOrItY/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/lOcAlRuLeS/lOcAlRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/README.md b/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/README.md index edf9765cc12..d3d5eb47052 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/README.md @@ -212,14 +212,14 @@ for _, item := range items { ``` -### Example Usage: `LocalRulestacksClient.ListPredefinedUrlCategories` +### Example Usage: `LocalRulestacksClient.ListPredefinedURLCategories` ```go ctx := context.TODO() id := localrulestacks.NewLocalRulestackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName") -// alternatively `client.ListPredefinedUrlCategories(ctx, id, localrulestacks.DefaultListPredefinedUrlCategoriesOperationOptions())` can be used to do batched pagination -items, err := client.ListPredefinedUrlCategoriesComplete(ctx, id, localrulestacks.DefaultListPredefinedUrlCategoriesOperationOptions()) +// alternatively `client.ListPredefinedURLCategories(ctx, id, localrulestacks.DefaultListPredefinedURLCategoriesOperationOptions())` can be used to do batched pagination +items, err := client.ListPredefinedURLCategoriesComplete(ctx, id, localrulestacks.DefaultListPredefinedURLCategoriesOperationOptions()) if err != nil { // handle the error } diff --git a/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/method_listpredefinedurlcategories.go b/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/method_listpredefinedurlcategories.go index 6af1d69c3e1..3e3cf74134d 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/method_listpredefinedurlcategories.go +++ b/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/method_listpredefinedurlcategories.go @@ -12,39 +12,39 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListPredefinedUrlCategoriesOperationResponse struct { +type ListPredefinedURLCategoriesOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *[]PredefinedUrlCategory + Model *[]PredefinedURLCategory } -type ListPredefinedUrlCategoriesCompleteResult struct { +type ListPredefinedURLCategoriesCompleteResult struct { LatestHttpResponse *http.Response - Items []PredefinedUrlCategory + Items []PredefinedURLCategory } -type ListPredefinedUrlCategoriesOperationOptions struct { +type ListPredefinedURLCategoriesOperationOptions struct { Skip *string Top *int64 } -func DefaultListPredefinedUrlCategoriesOperationOptions() ListPredefinedUrlCategoriesOperationOptions { - return ListPredefinedUrlCategoriesOperationOptions{} +func DefaultListPredefinedURLCategoriesOperationOptions() ListPredefinedURLCategoriesOperationOptions { + return ListPredefinedURLCategoriesOperationOptions{} } -func (o ListPredefinedUrlCategoriesOperationOptions) ToHeaders() *client.Headers { +func (o ListPredefinedURLCategoriesOperationOptions) ToHeaders() *client.Headers { out := client.Headers{} return &out } -func (o ListPredefinedUrlCategoriesOperationOptions) ToOData() *odata.Query { +func (o ListPredefinedURLCategoriesOperationOptions) ToOData() *odata.Query { out := odata.Query{} return &out } -func (o ListPredefinedUrlCategoriesOperationOptions) ToQuery() *client.QueryParams { +func (o ListPredefinedURLCategoriesOperationOptions) ToQuery() *client.QueryParams { out := client.QueryParams{} if o.Skip != nil { out.Append("skip", fmt.Sprintf("%v", *o.Skip)) @@ -55,11 +55,11 @@ func (o ListPredefinedUrlCategoriesOperationOptions) ToQuery() *client.QueryPara return &out } -type ListPredefinedUrlCategoriesCustomPager struct { +type ListPredefinedURLCategoriesCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListPredefinedUrlCategoriesCustomPager) NextPageLink() *odata.Link { +func (p *ListPredefinedURLCategoriesCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -67,8 +67,8 @@ func (p *ListPredefinedUrlCategoriesCustomPager) NextPageLink() *odata.Link { return p.NextLink } -// ListPredefinedUrlCategories ... -func (c LocalRulestacksClient) ListPredefinedUrlCategories(ctx context.Context, id LocalRulestackId, options ListPredefinedUrlCategoriesOperationOptions) (result ListPredefinedUrlCategoriesOperationResponse, err error) { +// ListPredefinedURLCategories ... +func (c LocalRulestacksClient) ListPredefinedURLCategories(ctx context.Context, id LocalRulestackId, options ListPredefinedURLCategoriesOperationOptions) (result ListPredefinedURLCategoriesOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -76,7 +76,7 @@ func (c LocalRulestacksClient) ListPredefinedUrlCategories(ctx context.Context, }, HttpMethod: http.MethodPost, OptionsObject: options, - Pager: &ListPredefinedUrlCategoriesCustomPager{}, + Pager: &ListPredefinedURLCategoriesCustomPager{}, Path: fmt.Sprintf("%s/listPredefinedUrlCategories", id.ID()), } @@ -96,7 +96,7 @@ func (c LocalRulestacksClient) ListPredefinedUrlCategories(ctx context.Context, } var values struct { - Values *[]PredefinedUrlCategory `json:"value"` + Values *[]PredefinedURLCategory `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return @@ -107,16 +107,16 @@ func (c LocalRulestacksClient) ListPredefinedUrlCategories(ctx context.Context, return } -// ListPredefinedUrlCategoriesComplete retrieves all the results into a single object -func (c LocalRulestacksClient) ListPredefinedUrlCategoriesComplete(ctx context.Context, id LocalRulestackId, options ListPredefinedUrlCategoriesOperationOptions) (ListPredefinedUrlCategoriesCompleteResult, error) { - return c.ListPredefinedUrlCategoriesCompleteMatchingPredicate(ctx, id, options, PredefinedUrlCategoryOperationPredicate{}) +// ListPredefinedURLCategoriesComplete retrieves all the results into a single object +func (c LocalRulestacksClient) ListPredefinedURLCategoriesComplete(ctx context.Context, id LocalRulestackId, options ListPredefinedURLCategoriesOperationOptions) (ListPredefinedURLCategoriesCompleteResult, error) { + return c.ListPredefinedURLCategoriesCompleteMatchingPredicate(ctx, id, options, PredefinedURLCategoryOperationPredicate{}) } -// ListPredefinedUrlCategoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LocalRulestacksClient) ListPredefinedUrlCategoriesCompleteMatchingPredicate(ctx context.Context, id LocalRulestackId, options ListPredefinedUrlCategoriesOperationOptions, predicate PredefinedUrlCategoryOperationPredicate) (result ListPredefinedUrlCategoriesCompleteResult, err error) { - items := make([]PredefinedUrlCategory, 0) +// ListPredefinedURLCategoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LocalRulestacksClient) ListPredefinedURLCategoriesCompleteMatchingPredicate(ctx context.Context, id LocalRulestackId, options ListPredefinedURLCategoriesOperationOptions, predicate PredefinedURLCategoryOperationPredicate) (result ListPredefinedURLCategoriesCompleteResult, err error) { + items := make([]PredefinedURLCategory, 0) - resp, err := c.ListPredefinedUrlCategories(ctx, id, options) + resp, err := c.ListPredefinedURLCategories(ctx, id, options) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -130,7 +130,7 @@ func (c LocalRulestacksClient) ListPredefinedUrlCategoriesCompleteMatchingPredic } } - result = ListPredefinedUrlCategoriesCompleteResult{ + result = ListPredefinedURLCategoriesCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/model_predefinedurlcategory.go b/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/model_predefinedurlcategory.go index bf11b4898e1..9003c358312 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/model_predefinedurlcategory.go +++ b/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/model_predefinedurlcategory.go @@ -3,7 +3,7 @@ package localrulestacks // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type PredefinedUrlCategory struct { +type PredefinedURLCategory struct { Action string `json:"action"` Name string `json:"name"` } diff --git a/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/predicates.go b/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/predicates.go index 82fa87587c5..b7c888c638f 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/predicates.go +++ b/resource-manager/paloaltonetworks/2023-09-01/localrulestacks/predicates.go @@ -62,12 +62,12 @@ func (p LocalRulestackResourceOperationPredicate) Matches(input LocalRulestackRe return true } -type PredefinedUrlCategoryOperationPredicate struct { +type PredefinedURLCategoryOperationPredicate struct { Action *string Name *string } -func (p PredefinedUrlCategoryOperationPredicate) Matches(input PredefinedUrlCategory) bool { +func (p PredefinedURLCategoryOperationPredicate) Matches(input PredefinedURLCategory) bool { if p.Action != nil && *p.Action != input.Action { return false diff --git a/resource-manager/paloaltonetworks/2023-09-01/postrules/README.md b/resource-manager/paloaltonetworks/2023-09-01/postrules/README.md index 6b752035595..982f4014a68 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/postrules/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/postrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") payload := postrules.PostRulesResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") read, err := client.GetCounters(ctx, id, postrules.DefaultGetCountersOperationOptions()) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") read, err := client.RefreshCounters(ctx, id, postrules.DefaultRefreshCountersOperationOptions()) if err != nil { @@ -118,7 +118,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := postrules.NewPostRuleID("globalRulestackName", "priority") +id := postrules.NewPostRuleID("globalRulestackName", "postRuleName") read, err := client.ResetCounters(ctx, id, postrules.DefaultResetCountersOperationOptions()) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/postrules/id_postrule.go b/resource-manager/paloaltonetworks/2023-09-01/postrules/id_postrule.go index 2825aa1214a..1344cfb4d54 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/postrules/id_postrule.go +++ b/resource-manager/paloaltonetworks/2023-09-01/postrules/id_postrule.go @@ -107,7 +107,7 @@ func (id PostRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticPostRules", "postRules", "postRules"), - resourceids.UserSpecifiedSegment("postRuleName", "priority"), + resourceids.UserSpecifiedSegment("postRuleName", "postRuleName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/postrules/id_postrule_test.go b/resource-manager/paloaltonetworks/2023-09-01/postrules/id_postrule_test.go index 3ff1246134f..f9e6a2cd4f1 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/postrules/id_postrule_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/postrules/id_postrule_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &PostRuleId{} func TestNewPostRuleID(t *testing.T) { - id := NewPostRuleID("globalRulestackName", "priority") + id := NewPostRuleID("globalRulestackName", "postRuleName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.PostRuleName != "priority" { - t.Fatalf("Expected %q but got %q for Segment 'PostRuleName'", id.PostRuleName, "priority") + if id.PostRuleName != "postRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'PostRuleName'", id.PostRuleName, "postRuleName") } } func TestFormatPostRuleID(t *testing.T) { - actual := NewPostRuleID("globalRulestackName", "priority").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority" + actual := NewPostRuleID("globalRulestackName", "postRuleName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParsePostRuleID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName", Expected: &PostRuleId{ GlobalRulestackName: "globalRulestackName", - PostRuleName: "priority", + PostRuleName: "postRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParsePostRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName", Expected: &PostRuleId{ GlobalRulestackName: "globalRulestackName", - PostRuleName: "priority", + PostRuleName: "postRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/priority/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/postRules/postRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pOsTrUlEs/pRiOrItY", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pOsTrUlEs/pOsTrUlEnAmE", Expected: &PostRuleId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - PostRuleName: "pRiOrItY", + PostRuleName: "pOsTrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pOsTrUlEs/pRiOrItY/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pOsTrUlEs/pOsTrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/README.md b/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/README.md index 7019444604b..3c2c1d0e8bb 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "name") +id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "prefixListName") payload := prefixlistglobalrulestack.PrefixListGlobalRulestackResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "name") +id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "prefixListName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "name") +id := prefixlistglobalrulestack.NewPrefixListID("globalRulestackName", "prefixListName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/id_prefixlist.go b/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/id_prefixlist.go index 6c3711bb90b..f4cdddc2bbc 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/id_prefixlist.go +++ b/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/id_prefixlist.go @@ -107,7 +107,7 @@ func (id PrefixListId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticPrefixLists", "prefixLists", "prefixLists"), - resourceids.UserSpecifiedSegment("prefixListName", "name"), + resourceids.UserSpecifiedSegment("prefixListName", "prefixListName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/id_prefixlist_test.go b/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/id_prefixlist_test.go index aa2eaba3808..75e40ad61ea 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/id_prefixlist_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/prefixlistglobalrulestack/id_prefixlist_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &PrefixListId{} func TestNewPrefixListID(t *testing.T) { - id := NewPrefixListID("globalRulestackName", "name") + id := NewPrefixListID("globalRulestackName", "prefixListName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.PrefixListName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'PrefixListName'", id.PrefixListName, "name") + if id.PrefixListName != "prefixListName" { + t.Fatalf("Expected %q but got %q for Segment 'PrefixListName'", id.PrefixListName, "prefixListName") } } func TestFormatPrefixListID(t *testing.T) { - actual := NewPrefixListID("globalRulestackName", "name").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name" + actual := NewPrefixListID("globalRulestackName", "prefixListName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParsePrefixListID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName", Expected: &PrefixListId{ GlobalRulestackName: "globalRulestackName", - PrefixListName: "name", + PrefixListName: "prefixListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParsePrefixListIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName", Expected: &PrefixListId{ GlobalRulestackName: "globalRulestackName", - PrefixListName: "name", + PrefixListName: "prefixListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/name/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/prefixLists/prefixListName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReFiXlIsTs/nAmE", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReFiXlIsTs/pReFiXlIsTnAmE", Expected: &PrefixListId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - PrefixListName: "nAmE", + PrefixListName: "pReFiXlIsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReFiXlIsTs/nAmE/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReFiXlIsTs/pReFiXlIsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/README.md b/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/README.md index fe341e02444..68501d35908 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName") payload := prefixlistlocalrulestack.PrefixListResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") +id := prefixlistlocalrulestack.NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/id_localrulestackprefixlist.go b/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/id_localrulestackprefixlist.go index b59f9eb3ed4..083d13d5471 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/id_localrulestackprefixlist.go +++ b/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/id_localrulestackprefixlist.go @@ -123,7 +123,7 @@ func (id LocalRulestackPrefixListId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocalRulestacks", "localRulestacks", "localRulestacks"), resourceids.UserSpecifiedSegment("localRulestackName", "localRulestackName"), resourceids.StaticSegment("staticPrefixLists", "prefixLists", "prefixLists"), - resourceids.UserSpecifiedSegment("prefixListName", "name"), + resourceids.UserSpecifiedSegment("prefixListName", "prefixListName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/id_localrulestackprefixlist_test.go b/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/id_localrulestackprefixlist_test.go index 60d86477170..40f5e598c3c 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/id_localrulestackprefixlist_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/prefixlistlocalrulestack/id_localrulestackprefixlist_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalRulestackPrefixListId{} func TestNewLocalRulestackPrefixListID(t *testing.T) { - id := NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name") + id := NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocalRulestackPrefixListID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocalRulestackName'", id.LocalRulestackName, "localRulestackName") } - if id.PrefixListName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'PrefixListName'", id.PrefixListName, "name") + if id.PrefixListName != "prefixListName" { + t.Fatalf("Expected %q but got %q for Segment 'PrefixListName'", id.PrefixListName, "prefixListName") } } func TestFormatLocalRulestackPrefixListID(t *testing.T) { - actual := NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name" + actual := NewLocalRulestackPrefixListID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localRulestackName", "prefixListName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocalRulestackPrefixListID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName", Expected: &LocalRulestackPrefixListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - PrefixListName: "name", + PrefixListName: "prefixListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocalRulestackPrefixListIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName", Expected: &LocalRulestackPrefixListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocalRulestackName: "localRulestackName", - PrefixListName: "name", + PrefixListName: "prefixListName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/PaloAltoNetworks.Cloudngfw/localRulestacks/localRulestackName/prefixLists/prefixListName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/pReFiXlIsTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/pReFiXlIsTs/pReFiXlIsTnAmE", Expected: &LocalRulestackPrefixListId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocalRulestackName: "lOcAlRuLeStAcKnAmE", - PrefixListName: "nAmE", + PrefixListName: "pReFiXlIsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/pReFiXlIsTs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/lOcAlRuLeStAcKs/lOcAlRuLeStAcKnAmE/pReFiXlIsTs/pReFiXlIsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/paloaltonetworks/2023-09-01/prerules/README.md b/resource-manager/paloaltonetworks/2023-09-01/prerules/README.md index 71d2fe4ce0b..c9f6742c237 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prerules/README.md +++ b/resource-manager/paloaltonetworks/2023-09-01/prerules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") payload := prerules.PreRulesResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") read, err := client.GetCounters(ctx, id, prerules.DefaultGetCountersOperationOptions()) if err != nil { @@ -102,7 +102,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") read, err := client.RefreshCounters(ctx, id, prerules.DefaultRefreshCountersOperationOptions()) if err != nil { @@ -118,7 +118,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := prerules.NewPreRuleID("globalRulestackName", "priority") +id := prerules.NewPreRuleID("globalRulestackName", "preRuleName") read, err := client.ResetCounters(ctx, id, prerules.DefaultResetCountersOperationOptions()) if err != nil { diff --git a/resource-manager/paloaltonetworks/2023-09-01/prerules/id_prerule.go b/resource-manager/paloaltonetworks/2023-09-01/prerules/id_prerule.go index 588a7364adc..963ea011fa2 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prerules/id_prerule.go +++ b/resource-manager/paloaltonetworks/2023-09-01/prerules/id_prerule.go @@ -107,7 +107,7 @@ func (id PreRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticGlobalRulestacks", "globalRulestacks", "globalRulestacks"), resourceids.UserSpecifiedSegment("globalRulestackName", "globalRulestackName"), resourceids.StaticSegment("staticPreRules", "preRules", "preRules"), - resourceids.UserSpecifiedSegment("preRuleName", "priority"), + resourceids.UserSpecifiedSegment("preRuleName", "preRuleName"), } } diff --git a/resource-manager/paloaltonetworks/2023-09-01/prerules/id_prerule_test.go b/resource-manager/paloaltonetworks/2023-09-01/prerules/id_prerule_test.go index 27fe4232c53..51fc1b5313e 100644 --- a/resource-manager/paloaltonetworks/2023-09-01/prerules/id_prerule_test.go +++ b/resource-manager/paloaltonetworks/2023-09-01/prerules/id_prerule_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &PreRuleId{} func TestNewPreRuleID(t *testing.T) { - id := NewPreRuleID("globalRulestackName", "priority") + id := NewPreRuleID("globalRulestackName", "preRuleName") if id.GlobalRulestackName != "globalRulestackName" { t.Fatalf("Expected %q but got %q for Segment 'GlobalRulestackName'", id.GlobalRulestackName, "globalRulestackName") } - if id.PreRuleName != "priority" { - t.Fatalf("Expected %q but got %q for Segment 'PreRuleName'", id.PreRuleName, "priority") + if id.PreRuleName != "preRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'PreRuleName'", id.PreRuleName, "preRuleName") } } func TestFormatPreRuleID(t *testing.T) { - actual := NewPreRuleID("globalRulestackName", "priority").ID() - expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority" + actual := NewPreRuleID("globalRulestackName", "preRuleName").ID() + expected := "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParsePreRuleID(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName", Expected: &PreRuleId{ GlobalRulestackName: "globalRulestackName", - PreRuleName: "priority", + PreRuleName: "preRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParsePreRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName", Expected: &PreRuleId{ GlobalRulestackName: "globalRulestackName", - PreRuleName: "priority", + PreRuleName: "preRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/priority/extra", + Input: "/providers/PaloAltoNetworks.Cloudngfw/globalRulestacks/globalRulestackName/preRules/preRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReRuLeS/pRiOrItY", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReRuLeS/pReRuLeNaMe", Expected: &PreRuleId{ GlobalRulestackName: "gLoBaLrUlEsTaCkNaMe", - PreRuleName: "pRiOrItY", + PreRuleName: "pReRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReRuLeS/pRiOrItY/extra", + Input: "/pRoViDeRs/pAlOaLtOnEtWoRkS.ClOuDnGfW/gLoBaLrUlEsTaCkS/gLoBaLrUlEsTaCkNaMe/pReRuLeS/pReRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/portal/2020-09-01-preview/tenantconfigurations/README.md b/resource-manager/portal/2020-09-01-preview/tenantconfigurations/README.md index 12c371a6c06..186b204d92f 100644 --- a/resource-manager/portal/2020-09-01-preview/tenantconfigurations/README.md +++ b/resource-manager/portal/2020-09-01-preview/tenantconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tenantconfigurations.NewTenantConfigurationID("configurationName") +id := tenantconfigurations.NewTenantConfigurationID("tenantConfigurationName") payload := tenantconfigurations.Configuration{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tenantconfigurations.NewTenantConfigurationID("configurationName") +id := tenantconfigurations.NewTenantConfigurationID("tenantConfigurationName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tenantconfigurations.NewTenantConfigurationID("configurationName") +id := tenantconfigurations.NewTenantConfigurationID("tenantConfigurationName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/portal/2020-09-01-preview/tenantconfigurations/id_tenantconfiguration.go b/resource-manager/portal/2020-09-01-preview/tenantconfigurations/id_tenantconfiguration.go index d919947291e..f70f2161897 100644 --- a/resource-manager/portal/2020-09-01-preview/tenantconfigurations/id_tenantconfiguration.go +++ b/resource-manager/portal/2020-09-01-preview/tenantconfigurations/id_tenantconfiguration.go @@ -99,7 +99,7 @@ func (id TenantConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftPortal", "Microsoft.Portal", "Microsoft.Portal"), resourceids.StaticSegment("staticTenantConfigurations", "tenantConfigurations", "tenantConfigurations"), - resourceids.UserSpecifiedSegment("tenantConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("tenantConfigurationName", "tenantConfigurationName"), } } diff --git a/resource-manager/portal/2020-09-01-preview/tenantconfigurations/id_tenantconfiguration_test.go b/resource-manager/portal/2020-09-01-preview/tenantconfigurations/id_tenantconfiguration_test.go index 0818ba28c46..bbe9f8fc67f 100644 --- a/resource-manager/portal/2020-09-01-preview/tenantconfigurations/id_tenantconfiguration_test.go +++ b/resource-manager/portal/2020-09-01-preview/tenantconfigurations/id_tenantconfiguration_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &TenantConfigurationId{} func TestNewTenantConfigurationID(t *testing.T) { - id := NewTenantConfigurationID("configurationName") + id := NewTenantConfigurationID("tenantConfigurationName") - if id.TenantConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'TenantConfigurationName'", id.TenantConfigurationName, "configurationName") + if id.TenantConfigurationName != "tenantConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'TenantConfigurationName'", id.TenantConfigurationName, "tenantConfigurationName") } } func TestFormatTenantConfigurationID(t *testing.T) { - actual := NewTenantConfigurationID("configurationName").ID() - expected := "/providers/Microsoft.Portal/tenantConfigurations/configurationName" + actual := NewTenantConfigurationID("tenantConfigurationName").ID() + expected := "/providers/Microsoft.Portal/tenantConfigurations/tenantConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseTenantConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Portal/tenantConfigurations/configurationName", + Input: "/providers/Microsoft.Portal/tenantConfigurations/tenantConfigurationName", Expected: &TenantConfigurationId{ - TenantConfigurationName: "configurationName", + TenantConfigurationName: "tenantConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Portal/tenantConfigurations/configurationName/extra", + Input: "/providers/Microsoft.Portal/tenantConfigurations/tenantConfigurationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseTenantConfigurationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Portal/tenantConfigurations/configurationName", + Input: "/providers/Microsoft.Portal/tenantConfigurations/tenantConfigurationName", Expected: &TenantConfigurationId{ - TenantConfigurationName: "configurationName", + TenantConfigurationName: "tenantConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Portal/tenantConfigurations/configurationName/extra", + Input: "/providers/Microsoft.Portal/tenantConfigurations/tenantConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.pOrTaL/tEnAnTcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/pRoViDeRs/mIcRoSoFt.pOrTaL/tEnAnTcOnFiGuRaTiOnS/tEnAnTcOnFiGuRaTiOnNaMe", Expected: &TenantConfigurationId{ - TenantConfigurationName: "cOnFiGuRaTiOnNaMe", + TenantConfigurationName: "tEnAnTcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.pOrTaL/tEnAnTcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.pOrTaL/tEnAnTcOnFiGuRaTiOnS/tEnAnTcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/configurations/README.md b/resource-manager/postgresql/2021-06-01/configurations/README.md index abb76f60876..0291677d53f 100644 --- a/resource-manager/postgresql/2021-06-01/configurations/README.md +++ b/resource-manager/postgresql/2021-06-01/configurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... @@ -74,7 +74,7 @@ if err := client.PutThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... diff --git a/resource-manager/postgresql/2021-06-01/configurations/id_configuration.go b/resource-manager/postgresql/2021-06-01/configurations/id_configuration.go index 7412c2106b4..daa679a8b3f 100644 --- a/resource-manager/postgresql/2021-06-01/configurations/id_configuration.go +++ b/resource-manager/postgresql/2021-06-01/configurations/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/postgresql/2021-06-01/configurations/id_configuration_test.go b/resource-manager/postgresql/2021-06-01/configurations/id_configuration_test.go index 9b87badb1fe..e86f991b455 100644 --- a/resource-manager/postgresql/2021-06-01/configurations/id_configuration_test.go +++ b/resource-manager/postgresql/2021-06-01/configurations/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/configurations/id_flexibleserver.go b/resource-manager/postgresql/2021-06-01/configurations/id_flexibleserver.go index 4cd0eff67f1..d2caf44125f 100644 --- a/resource-manager/postgresql/2021-06-01/configurations/id_flexibleserver.go +++ b/resource-manager/postgresql/2021-06-01/configurations/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2021-06-01/configurations/id_flexibleserver_test.go b/resource-manager/postgresql/2021-06-01/configurations/id_flexibleserver_test.go index cd0dbeac5bf..da4cbf38e83 100644 --- a/resource-manager/postgresql/2021-06-01/configurations/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2021-06-01/configurations/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/databases/README.md b/resource-manager/postgresql/2021-06-01/databases/README.md index a0db3adb8ee..1422840dfc4 100644 --- a/resource-manager/postgresql/2021-06-01/databases/README.md +++ b/resource-manager/postgresql/2021-06-01/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2021-06-01/databases/id_database.go b/resource-manager/postgresql/2021-06-01/databases/id_database.go index 71152f520ba..f0da07ac18d 100644 --- a/resource-manager/postgresql/2021-06-01/databases/id_database.go +++ b/resource-manager/postgresql/2021-06-01/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/postgresql/2021-06-01/databases/id_database_test.go b/resource-manager/postgresql/2021-06-01/databases/id_database_test.go index 21e0a03ee0a..f191274a59f 100644 --- a/resource-manager/postgresql/2021-06-01/databases/id_database_test.go +++ b/resource-manager/postgresql/2021-06-01/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/databases/id_flexibleserver.go b/resource-manager/postgresql/2021-06-01/databases/id_flexibleserver.go index f370fda42e8..3692b6f0892 100644 --- a/resource-manager/postgresql/2021-06-01/databases/id_flexibleserver.go +++ b/resource-manager/postgresql/2021-06-01/databases/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2021-06-01/databases/id_flexibleserver_test.go b/resource-manager/postgresql/2021-06-01/databases/id_flexibleserver_test.go index 480604b8787..b6fcc967d2a 100644 --- a/resource-manager/postgresql/2021-06-01/databases/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2021-06-01/databases/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/firewallrules/README.md b/resource-manager/postgresql/2021-06-01/firewallrules/README.md index 4b614b7fc25..542ea7c3a16 100644 --- a/resource-manager/postgresql/2021-06-01/firewallrules/README.md +++ b/resource-manager/postgresql/2021-06-01/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") payload := firewallrules.FirewallRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2021-06-01/firewallrules/id_firewallrule.go b/resource-manager/postgresql/2021-06-01/firewallrules/id_firewallrule.go index 44e4a903cc4..8c7587a62e6 100644 --- a/resource-manager/postgresql/2021-06-01/firewallrules/id_firewallrule.go +++ b/resource-manager/postgresql/2021-06-01/firewallrules/id_firewallrule.go @@ -121,7 +121,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } diff --git a/resource-manager/postgresql/2021-06-01/firewallrules/id_firewallrule_test.go b/resource-manager/postgresql/2021-06-01/firewallrules/id_firewallrule_test.go index bdc332f7c17..e94421ba9bc 100644 --- a/resource-manager/postgresql/2021-06-01/firewallrules/id_firewallrule_test.go +++ b/resource-manager/postgresql/2021-06-01/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.FirewallRuleName != "firewallRuleName" { @@ -32,8 +32,8 @@ func TestNewFirewallRuleID(t *testing.T) { } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/firewallrules/id_flexibleserver.go b/resource-manager/postgresql/2021-06-01/firewallrules/id_flexibleserver.go index 835759b3a99..2763dceed8b 100644 --- a/resource-manager/postgresql/2021-06-01/firewallrules/id_flexibleserver.go +++ b/resource-manager/postgresql/2021-06-01/firewallrules/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2021-06-01/firewallrules/id_flexibleserver_test.go b/resource-manager/postgresql/2021-06-01/firewallrules/id_flexibleserver_test.go index 1f028fab2c2..93b573c9c99 100644 --- a/resource-manager/postgresql/2021-06-01/firewallrules/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2021-06-01/firewallrules/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/serverrestart/README.md b/resource-manager/postgresql/2021-06-01/serverrestart/README.md index caf5bec7579..d3d1512183a 100644 --- a/resource-manager/postgresql/2021-06-01/serverrestart/README.md +++ b/resource-manager/postgresql/2021-06-01/serverrestart/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := serverrestart.RestartParameter{ // ... diff --git a/resource-manager/postgresql/2021-06-01/serverrestart/id_flexibleserver.go b/resource-manager/postgresql/2021-06-01/serverrestart/id_flexibleserver.go index 2a194410afd..5d1622ef152 100644 --- a/resource-manager/postgresql/2021-06-01/serverrestart/id_flexibleserver.go +++ b/resource-manager/postgresql/2021-06-01/serverrestart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2021-06-01/serverrestart/id_flexibleserver_test.go b/resource-manager/postgresql/2021-06-01/serverrestart/id_flexibleserver_test.go index 9d7ffda4e38..0a396114d99 100644 --- a/resource-manager/postgresql/2021-06-01/serverrestart/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2021-06-01/serverrestart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/servers/README.md b/resource-manager/postgresql/2021-06-01/servers/README.md index 5309c7a22aa..698ebf89061 100644 --- a/resource-manager/postgresql/2021-06-01/servers/README.md +++ b/resource-manager/postgresql/2021-06-01/servers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.Server{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.ServerForUpdate{ // ... diff --git a/resource-manager/postgresql/2021-06-01/servers/id_flexibleserver.go b/resource-manager/postgresql/2021-06-01/servers/id_flexibleserver.go index ca603c50095..de631236f43 100644 --- a/resource-manager/postgresql/2021-06-01/servers/id_flexibleserver.go +++ b/resource-manager/postgresql/2021-06-01/servers/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2021-06-01/servers/id_flexibleserver_test.go b/resource-manager/postgresql/2021-06-01/servers/id_flexibleserver_test.go index 9023d215fd8..7392481e94a 100644 --- a/resource-manager/postgresql/2021-06-01/servers/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2021-06-01/servers/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/serverstart/id_flexibleserver.go b/resource-manager/postgresql/2021-06-01/serverstart/id_flexibleserver.go index a8a0ef91a98..00db66b7c48 100644 --- a/resource-manager/postgresql/2021-06-01/serverstart/id_flexibleserver.go +++ b/resource-manager/postgresql/2021-06-01/serverstart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2021-06-01/serverstart/id_flexibleserver_test.go b/resource-manager/postgresql/2021-06-01/serverstart/id_flexibleserver_test.go index 8de3c2fa696..12ca7a20c49 100644 --- a/resource-manager/postgresql/2021-06-01/serverstart/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2021-06-01/serverstart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2021-06-01/serverstop/id_flexibleserver.go b/resource-manager/postgresql/2021-06-01/serverstop/id_flexibleserver.go index 7c3291843fc..a0530579a5b 100644 --- a/resource-manager/postgresql/2021-06-01/serverstop/id_flexibleserver.go +++ b/resource-manager/postgresql/2021-06-01/serverstop/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2021-06-01/serverstop/id_flexibleserver_test.go b/resource-manager/postgresql/2021-06-01/serverstop/id_flexibleserver_test.go index 341329dd6a2..fddd48472ca 100644 --- a/resource-manager/postgresql/2021-06-01/serverstop/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2021-06-01/serverstop/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/administrators/README.md b/resource-manager/postgresql/2022-12-01/administrators/README.md index 97bf49065cf..26b77d32729 100644 --- a/resource-manager/postgresql/2022-12-01/administrators/README.md +++ b/resource-manager/postgresql/2022-12-01/administrators/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId") +id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId") payload := administrators.ActiveDirectoryAdministratorAdd{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId") +id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId") +id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := administrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := administrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2022-12-01/administrators/id_administrator.go b/resource-manager/postgresql/2022-12-01/administrators/id_administrator.go index b77279e1a86..5ef76826665 100644 --- a/resource-manager/postgresql/2022-12-01/administrators/id_administrator.go +++ b/resource-manager/postgresql/2022-12-01/administrators/id_administrator.go @@ -121,7 +121,7 @@ func (id AdministratorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticAdministrators", "administrators", "administrators"), resourceids.UserSpecifiedSegment("objectId", "objectId"), } diff --git a/resource-manager/postgresql/2022-12-01/administrators/id_administrator_test.go b/resource-manager/postgresql/2022-12-01/administrators/id_administrator_test.go index 6e7764659c2..8d4a88c7e33 100644 --- a/resource-manager/postgresql/2022-12-01/administrators/id_administrator_test.go +++ b/resource-manager/postgresql/2022-12-01/administrators/id_administrator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AdministratorId{} func TestNewAdministratorID(t *testing.T) { - id := NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId") + id := NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAdministratorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ObjectId != "objectId" { @@ -32,8 +32,8 @@ func TestNewAdministratorID(t *testing.T) { } func TestFormatAdministratorID(t *testing.T) { - actual := NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId" + actual := NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAdministratorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId", Expected: &AdministratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ObjectId: "objectId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAdministratorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/aDmInIsTrAtOrS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/aDmInIsTrAtOrS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId", Expected: &AdministratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ObjectId: "objectId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/aDmInIsTrAtOrS/oBjEcTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/aDmInIsTrAtOrS/oBjEcTiD", Expected: &AdministratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ObjectId: "oBjEcTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/aDmInIsTrAtOrS/oBjEcTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/aDmInIsTrAtOrS/oBjEcTiD/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/administrators/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/administrators/id_flexibleserver.go index a779b09968f..1a03f5e9f36 100644 --- a/resource-manager/postgresql/2022-12-01/administrators/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/administrators/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/administrators/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/administrators/id_flexibleserver_test.go index 9a43f93a6ea..b12837b2f7c 100644 --- a/resource-manager/postgresql/2022-12-01/administrators/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/administrators/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/backups/README.md b/resource-manager/postgresql/2022-12-01/backups/README.md index 333063d063b..45e834e3f47 100644 --- a/resource-manager/postgresql/2022-12-01/backups/README.md +++ b/resource-manager/postgresql/2022-12-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2022-12-01/backups/id_backup.go b/resource-manager/postgresql/2022-12-01/backups/id_backup.go index a5da20a8eef..6781b8d3476 100644 --- a/resource-manager/postgresql/2022-12-01/backups/id_backup.go +++ b/resource-manager/postgresql/2022-12-01/backups/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupName", "backupName"), } diff --git a/resource-manager/postgresql/2022-12-01/backups/id_backup_test.go b/resource-manager/postgresql/2022-12-01/backups/id_backup_test.go index 113ef474376..5863c240b4a 100644 --- a/resource-manager/postgresql/2022-12-01/backups/id_backup_test.go +++ b/resource-manager/postgresql/2022-12-01/backups/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.BackupName != "backupName" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", BackupName: "bAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/backups/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/backups/id_flexibleserver.go index c717296853a..a5241d9a143 100644 --- a/resource-manager/postgresql/2022-12-01/backups/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/backups/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/backups/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/backups/id_flexibleserver_test.go index 3271d582cd7..77d4d37291a 100644 --- a/resource-manager/postgresql/2022-12-01/backups/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/backups/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/configurations/README.md b/resource-manager/postgresql/2022-12-01/configurations/README.md index 1c83d10b15e..1fc4c5bdba0 100644 --- a/resource-manager/postgresql/2022-12-01/configurations/README.md +++ b/resource-manager/postgresql/2022-12-01/configurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... @@ -74,7 +74,7 @@ if err := client.PutThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.ConfigurationForUpdate{ // ... diff --git a/resource-manager/postgresql/2022-12-01/configurations/id_configuration.go b/resource-manager/postgresql/2022-12-01/configurations/id_configuration.go index 7412c2106b4..daa679a8b3f 100644 --- a/resource-manager/postgresql/2022-12-01/configurations/id_configuration.go +++ b/resource-manager/postgresql/2022-12-01/configurations/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/postgresql/2022-12-01/configurations/id_configuration_test.go b/resource-manager/postgresql/2022-12-01/configurations/id_configuration_test.go index 9b87badb1fe..e86f991b455 100644 --- a/resource-manager/postgresql/2022-12-01/configurations/id_configuration_test.go +++ b/resource-manager/postgresql/2022-12-01/configurations/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/configurations/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/configurations/id_flexibleserver.go index 4cd0eff67f1..d2caf44125f 100644 --- a/resource-manager/postgresql/2022-12-01/configurations/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/configurations/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/configurations/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/configurations/id_flexibleserver_test.go index cd0dbeac5bf..da4cbf38e83 100644 --- a/resource-manager/postgresql/2022-12-01/configurations/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/configurations/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/databases/README.md b/resource-manager/postgresql/2022-12-01/databases/README.md index a1d8d6f433c..9f1da5b91b3 100644 --- a/resource-manager/postgresql/2022-12-01/databases/README.md +++ b/resource-manager/postgresql/2022-12-01/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2022-12-01/databases/id_database.go b/resource-manager/postgresql/2022-12-01/databases/id_database.go index 71152f520ba..f0da07ac18d 100644 --- a/resource-manager/postgresql/2022-12-01/databases/id_database.go +++ b/resource-manager/postgresql/2022-12-01/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/postgresql/2022-12-01/databases/id_database_test.go b/resource-manager/postgresql/2022-12-01/databases/id_database_test.go index 21e0a03ee0a..f191274a59f 100644 --- a/resource-manager/postgresql/2022-12-01/databases/id_database_test.go +++ b/resource-manager/postgresql/2022-12-01/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/databases/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/databases/id_flexibleserver.go index f370fda42e8..3692b6f0892 100644 --- a/resource-manager/postgresql/2022-12-01/databases/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/databases/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/databases/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/databases/id_flexibleserver_test.go index 480604b8787..b6fcc967d2a 100644 --- a/resource-manager/postgresql/2022-12-01/databases/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/databases/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/firewallrules/README.md b/resource-manager/postgresql/2022-12-01/firewallrules/README.md index 4575b0527f3..259c03d4f80 100644 --- a/resource-manager/postgresql/2022-12-01/firewallrules/README.md +++ b/resource-manager/postgresql/2022-12-01/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") payload := firewallrules.FirewallRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2022-12-01/firewallrules/id_firewallrule.go b/resource-manager/postgresql/2022-12-01/firewallrules/id_firewallrule.go index 44e4a903cc4..8c7587a62e6 100644 --- a/resource-manager/postgresql/2022-12-01/firewallrules/id_firewallrule.go +++ b/resource-manager/postgresql/2022-12-01/firewallrules/id_firewallrule.go @@ -121,7 +121,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } diff --git a/resource-manager/postgresql/2022-12-01/firewallrules/id_firewallrule_test.go b/resource-manager/postgresql/2022-12-01/firewallrules/id_firewallrule_test.go index bdc332f7c17..e94421ba9bc 100644 --- a/resource-manager/postgresql/2022-12-01/firewallrules/id_firewallrule_test.go +++ b/resource-manager/postgresql/2022-12-01/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.FirewallRuleName != "firewallRuleName" { @@ -32,8 +32,8 @@ func TestNewFirewallRuleID(t *testing.T) { } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/firewallrules/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/firewallrules/id_flexibleserver.go index 835759b3a99..2763dceed8b 100644 --- a/resource-manager/postgresql/2022-12-01/firewallrules/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/firewallrules/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/firewallrules/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/firewallrules/id_flexibleserver_test.go index 1f028fab2c2..93b573c9c99 100644 --- a/resource-manager/postgresql/2022-12-01/firewallrules/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/firewallrules/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/replicas/README.md b/resource-manager/postgresql/2022-12-01/replicas/README.md index 8d9fe9cf081..b45b43f8031 100644 --- a/resource-manager/postgresql/2022-12-01/replicas/README.md +++ b/resource-manager/postgresql/2022-12-01/replicas/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicas.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := replicas.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2022-12-01/replicas/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/replicas/id_flexibleserver.go index b4421d68724..f2e8777baa9 100644 --- a/resource-manager/postgresql/2022-12-01/replicas/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/replicas/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/replicas/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/replicas/id_flexibleserver_test.go index 669aa5e0f75..e4e16876663 100644 --- a/resource-manager/postgresql/2022-12-01/replicas/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/replicas/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/serverrestart/README.md b/resource-manager/postgresql/2022-12-01/serverrestart/README.md index 33f37f3847d..c4de3cfa77e 100644 --- a/resource-manager/postgresql/2022-12-01/serverrestart/README.md +++ b/resource-manager/postgresql/2022-12-01/serverrestart/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := serverrestart.RestartParameter{ // ... diff --git a/resource-manager/postgresql/2022-12-01/serverrestart/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/serverrestart/id_flexibleserver.go index 2a194410afd..5d1622ef152 100644 --- a/resource-manager/postgresql/2022-12-01/serverrestart/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/serverrestart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/serverrestart/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/serverrestart/id_flexibleserver_test.go index 9d7ffda4e38..0a396114d99 100644 --- a/resource-manager/postgresql/2022-12-01/serverrestart/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/serverrestart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/servers/README.md b/resource-manager/postgresql/2022-12-01/servers/README.md index a4be4d6e6f9..13f0d2d7739 100644 --- a/resource-manager/postgresql/2022-12-01/servers/README.md +++ b/resource-manager/postgresql/2022-12-01/servers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.Server{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.ServerForUpdate{ // ... diff --git a/resource-manager/postgresql/2022-12-01/servers/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/servers/id_flexibleserver.go index ca603c50095..de631236f43 100644 --- a/resource-manager/postgresql/2022-12-01/servers/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/servers/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/servers/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/servers/id_flexibleserver_test.go index 9023d215fd8..7392481e94a 100644 --- a/resource-manager/postgresql/2022-12-01/servers/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/servers/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/serverstart/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/serverstart/id_flexibleserver.go index a8a0ef91a98..00db66b7c48 100644 --- a/resource-manager/postgresql/2022-12-01/serverstart/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/serverstart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/serverstart/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/serverstart/id_flexibleserver_test.go index 8de3c2fa696..12ca7a20c49 100644 --- a/resource-manager/postgresql/2022-12-01/serverstart/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/serverstart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2022-12-01/serverstop/id_flexibleserver.go b/resource-manager/postgresql/2022-12-01/serverstop/id_flexibleserver.go index 7c3291843fc..a0530579a5b 100644 --- a/resource-manager/postgresql/2022-12-01/serverstop/id_flexibleserver.go +++ b/resource-manager/postgresql/2022-12-01/serverstop/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2022-12-01/serverstop/id_flexibleserver_test.go b/resource-manager/postgresql/2022-12-01/serverstop/id_flexibleserver_test.go index 341329dd6a2..fddd48472ca 100644 --- a/resource-manager/postgresql/2022-12-01/serverstop/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2022-12-01/serverstop/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/administrators/README.md b/resource-manager/postgresql/2023-06-01-preview/administrators/README.md index 1c82ecd9aff..f415f75087d 100644 --- a/resource-manager/postgresql/2023-06-01-preview/administrators/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/administrators/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId") +id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId") payload := administrators.ActiveDirectoryAdministratorAdd{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId") +id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId") +id := administrators.NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := administrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := administrators.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/administrators/id_administrator.go b/resource-manager/postgresql/2023-06-01-preview/administrators/id_administrator.go index b77279e1a86..5ef76826665 100644 --- a/resource-manager/postgresql/2023-06-01-preview/administrators/id_administrator.go +++ b/resource-manager/postgresql/2023-06-01-preview/administrators/id_administrator.go @@ -121,7 +121,7 @@ func (id AdministratorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticAdministrators", "administrators", "administrators"), resourceids.UserSpecifiedSegment("objectId", "objectId"), } diff --git a/resource-manager/postgresql/2023-06-01-preview/administrators/id_administrator_test.go b/resource-manager/postgresql/2023-06-01-preview/administrators/id_administrator_test.go index 6e7764659c2..8d4a88c7e33 100644 --- a/resource-manager/postgresql/2023-06-01-preview/administrators/id_administrator_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/administrators/id_administrator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AdministratorId{} func TestNewAdministratorID(t *testing.T) { - id := NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId") + id := NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAdministratorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ObjectId != "objectId" { @@ -32,8 +32,8 @@ func TestNewAdministratorID(t *testing.T) { } func TestFormatAdministratorID(t *testing.T) { - actual := NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "objectId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId" + actual := NewAdministratorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "objectId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAdministratorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId", Expected: &AdministratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ObjectId: "objectId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAdministratorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/aDmInIsTrAtOrS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/aDmInIsTrAtOrS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId", Expected: &AdministratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ObjectId: "objectId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/administrators/objectId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/administrators/objectId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/aDmInIsTrAtOrS/oBjEcTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/aDmInIsTrAtOrS/oBjEcTiD", Expected: &AdministratorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ObjectId: "oBjEcTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/aDmInIsTrAtOrS/oBjEcTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/aDmInIsTrAtOrS/oBjEcTiD/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/administrators/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/administrators/id_flexibleserver.go index a779b09968f..1a03f5e9f36 100644 --- a/resource-manager/postgresql/2023-06-01-preview/administrators/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/administrators/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/administrators/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/administrators/id_flexibleserver_test.go index 9a43f93a6ea..b12837b2f7c 100644 --- a/resource-manager/postgresql/2023-06-01-preview/administrators/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/administrators/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/README.md b/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/README.md index eb294645859..c2c08e7e6ad 100644 --- a/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := advancedthreatprotectionsettings.ServerThreatProtectionSettingsModel{ // ... @@ -41,7 +41,7 @@ if err := client.ServerThreatProtectionSettingsCreateOrUpdateThenPoll(ctx, id, p ```go ctx := context.TODO() -id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.ServerThreatProtectionSettingsGet(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := advancedthreatprotectionsettings.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ServerThreatProtectionSettingsListByServer(ctx, id)` can be used to do batched pagination items, err := client.ServerThreatProtectionSettingsListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/id_flexibleserver.go index 24eeac55f1a..6c8af36ce31 100644 --- a/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/id_flexibleserver_test.go index 0cfca948821..f686975522e 100644 --- a/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/advancedthreatprotectionsettings/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/backups/README.md b/resource-manager/postgresql/2023-06-01-preview/backups/README.md index be36c4939f2..88855de3e41 100644 --- a/resource-manager/postgresql/2023-06-01-preview/backups/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := backups.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/backups/id_backup.go b/resource-manager/postgresql/2023-06-01-preview/backups/id_backup.go index a5da20a8eef..6781b8d3476 100644 --- a/resource-manager/postgresql/2023-06-01-preview/backups/id_backup.go +++ b/resource-manager/postgresql/2023-06-01-preview/backups/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupName", "backupName"), } diff --git a/resource-manager/postgresql/2023-06-01-preview/backups/id_backup_test.go b/resource-manager/postgresql/2023-06-01-preview/backups/id_backup_test.go index 113ef474376..5863c240b4a 100644 --- a/resource-manager/postgresql/2023-06-01-preview/backups/id_backup_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/backups/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.BackupName != "backupName" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "backupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", BackupName: "backupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/backups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/backups/backupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", BackupName: "bAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/bAcKuPs/bAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/backups/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/backups/id_flexibleserver.go index c717296853a..a5241d9a143 100644 --- a/resource-manager/postgresql/2023-06-01-preview/backups/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/backups/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/backups/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/backups/id_flexibleserver_test.go index 3271d582cd7..77d4d37291a 100644 --- a/resource-manager/postgresql/2023-06-01-preview/backups/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/backups/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/configurations/README.md b/resource-manager/postgresql/2023-06-01-preview/configurations/README.md index bc1993dddca..7b245f77d1b 100644 --- a/resource-manager/postgresql/2023-06-01-preview/configurations/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/configurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := configurations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.Configuration{ // ... @@ -74,7 +74,7 @@ if err := client.PutThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") payload := configurations.ConfigurationForUpdate{ // ... diff --git a/resource-manager/postgresql/2023-06-01-preview/configurations/id_configuration.go b/resource-manager/postgresql/2023-06-01-preview/configurations/id_configuration.go index 7412c2106b4..daa679a8b3f 100644 --- a/resource-manager/postgresql/2023-06-01-preview/configurations/id_configuration.go +++ b/resource-manager/postgresql/2023-06-01-preview/configurations/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/postgresql/2023-06-01-preview/configurations/id_configuration_test.go b/resource-manager/postgresql/2023-06-01-preview/configurations/id_configuration_test.go index 9b87badb1fe..e86f991b455 100644 --- a/resource-manager/postgresql/2023-06-01-preview/configurations/id_configuration_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/configurations/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/configurations/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/configurations/id_flexibleserver.go index 4cd0eff67f1..d2caf44125f 100644 --- a/resource-manager/postgresql/2023-06-01-preview/configurations/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/configurations/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/configurations/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/configurations/id_flexibleserver_test.go index cd0dbeac5bf..da4cbf38e83 100644 --- a/resource-manager/postgresql/2023-06-01-preview/configurations/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/configurations/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/customoperation/README.md b/resource-manager/postgresql/2023-06-01-preview/customoperation/README.md index bc5b602e700..9efa0ed4d66 100644 --- a/resource-manager/postgresql/2023-06-01-preview/customoperation/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/customoperation/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customoperation.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := customoperation.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := customoperation.MigrationNameAvailabilityResource{ // ... diff --git a/resource-manager/postgresql/2023-06-01-preview/customoperation/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/customoperation/id_flexibleserver.go index a85858e9bf4..0f6154d881d 100644 --- a/resource-manager/postgresql/2023-06-01-preview/customoperation/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/customoperation/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/customoperation/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/customoperation/id_flexibleserver_test.go index 6a6b93f5b79..9417a483ab8 100644 --- a/resource-manager/postgresql/2023-06-01-preview/customoperation/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/customoperation/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/databases/README.md b/resource-manager/postgresql/2023-06-01-preview/databases/README.md index 80a8b9feb6c..741a180c67e 100644 --- a/resource-manager/postgresql/2023-06-01-preview/databases/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := databases.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/databases/id_database.go b/resource-manager/postgresql/2023-06-01-preview/databases/id_database.go index 71152f520ba..f0da07ac18d 100644 --- a/resource-manager/postgresql/2023-06-01-preview/databases/id_database.go +++ b/resource-manager/postgresql/2023-06-01-preview/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/postgresql/2023-06-01-preview/databases/id_database_test.go b/resource-manager/postgresql/2023-06-01-preview/databases/id_database_test.go index 21e0a03ee0a..f191274a59f 100644 --- a/resource-manager/postgresql/2023-06-01-preview/databases/id_database_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/databases/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/databases/id_flexibleserver.go index f370fda42e8..3692b6f0892 100644 --- a/resource-manager/postgresql/2023-06-01-preview/databases/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/databases/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/databases/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/databases/id_flexibleserver_test.go index 480604b8787..b6fcc967d2a 100644 --- a/resource-manager/postgresql/2023-06-01-preview/databases/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/databases/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/firewallrules/README.md b/resource-manager/postgresql/2023-06-01-preview/firewallrules/README.md index 11468de1021..23c332414cd 100644 --- a/resource-manager/postgresql/2023-06-01-preview/firewallrules/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") payload := firewallrules.FirewallRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := firewallrules.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_firewallrule.go b/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_firewallrule.go index 44e4a903cc4..8c7587a62e6 100644 --- a/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_firewallrule.go +++ b/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_firewallrule.go @@ -121,7 +121,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } diff --git a/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_firewallrule_test.go b/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_firewallrule_test.go index bdc332f7c17..e94421ba9bc 100644 --- a/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_firewallrule_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.FirewallRuleName != "firewallRuleName" { @@ -32,8 +32,8 @@ func TestNewFirewallRuleID(t *testing.T) { } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_flexibleserver.go index 835759b3a99..2763dceed8b 100644 --- a/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_flexibleserver_test.go index 1f028fab2c2..93b573c9c99 100644 --- a/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/firewallrules/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/README.md b/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/README.md index f8fd5056e79..dc316b3f541 100644 --- a/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := flexibleservercapabilities.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := flexibleservercapabilities.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ServerCapabilitiesList(ctx, id)` can be used to do batched pagination items, err := client.ServerCapabilitiesListComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/id_flexibleserver.go index 34474c31405..d431df079ec 100644 --- a/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/id_flexibleserver_test.go index b8f660b4962..dae573d7d82 100644 --- a/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/flexibleservercapabilities/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/logfiles/README.md b/resource-manager/postgresql/2023-06-01-preview/logfiles/README.md index 9e453e7bbb7..e210e03dea3 100644 --- a/resource-manager/postgresql/2023-06-01-preview/logfiles/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/logfiles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := logfiles.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := logfiles.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/logfiles/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/logfiles/id_flexibleserver.go index 25374c5a4f3..57ff27d0228 100644 --- a/resource-manager/postgresql/2023-06-01-preview/logfiles/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/logfiles/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/logfiles/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/logfiles/id_flexibleserver_test.go index b95af1d6bc7..7fa4cffbb5b 100644 --- a/resource-manager/postgresql/2023-06-01-preview/logfiles/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/logfiles/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/README.md b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/README.md index ee9304a3959..8d27d66f584 100644 --- a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := longtermretentionbackup.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := longtermretentionbackup.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := longtermretentionbackup.LtrBackupRequest{ // ... @@ -41,7 +41,7 @@ if err := client.FlexibleServerStartLtrBackupThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := longtermretentionbackup.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := longtermretentionbackup.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := longtermretentionbackup.BackupRequestBase{ // ... @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := longtermretentionbackup.NewLtrBackupOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") +id := longtermretentionbackup.NewLtrBackupOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "ltrBackupOperationName") read, err := client.LtrBackupOperationsGet(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := longtermretentionbackup.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := longtermretentionbackup.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.LtrBackupOperationsListByServer(ctx, id)` can be used to do batched pagination items, err := client.LtrBackupOperationsListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_flexibleserver.go index 0ed1b5ecb84..d61c171dbdc 100644 --- a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_flexibleserver_test.go index 4b96075ad12..dbdce1992fd 100644 --- a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_ltrbackupoperation.go b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_ltrbackupoperation.go index fd17f9f0565..6baac089c9f 100644 --- a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_ltrbackupoperation.go +++ b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_ltrbackupoperation.go @@ -121,9 +121,9 @@ func (id LtrBackupOperationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticLtrBackupOperations", "ltrBackupOperations", "ltrBackupOperations"), - resourceids.UserSpecifiedSegment("ltrBackupOperationName", "backupName"), + resourceids.UserSpecifiedSegment("ltrBackupOperationName", "ltrBackupOperationName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_ltrbackupoperation_test.go b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_ltrbackupoperation_test.go index 41ef9299b4c..0a1a72cb23f 100644 --- a/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_ltrbackupoperation_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/longtermretentionbackup/id_ltrbackupoperation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LtrBackupOperationId{} func TestNewLtrBackupOperationID(t *testing.T) { - id := NewLtrBackupOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName") + id := NewLtrBackupOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "ltrBackupOperationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewLtrBackupOperationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } - if id.LtrBackupOperationName != "backupName" { - t.Fatalf("Expected %q but got %q for Segment 'LtrBackupOperationName'", id.LtrBackupOperationName, "backupName") + if id.LtrBackupOperationName != "ltrBackupOperationName" { + t.Fatalf("Expected %q but got %q for Segment 'LtrBackupOperationName'", id.LtrBackupOperationName, "ltrBackupOperationName") } } func TestFormatLtrBackupOperationID(t *testing.T) { - actual := NewLtrBackupOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/ltrBackupOperations/backupName" + actual := NewLtrBackupOperationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "ltrBackupOperationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/ltrBackupOperations/ltrBackupOperationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLtrBackupOperationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/ltrBackupOperations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/ltrBackupOperations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/ltrBackupOperations/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/ltrBackupOperations/ltrBackupOperationName", Expected: &LtrBackupOperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", - LtrBackupOperationName: "backupName", + FlexibleServerName: "flexibleServerName", + LtrBackupOperationName: "ltrBackupOperationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/ltrBackupOperations/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/ltrBackupOperations/ltrBackupOperationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLtrBackupOperationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/ltrBackupOperations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/ltrBackupOperations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/lTrBaCkUpOpErAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/lTrBaCkUpOpErAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/ltrBackupOperations/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/ltrBackupOperations/ltrBackupOperationName", Expected: &LtrBackupOperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", - LtrBackupOperationName: "backupName", + FlexibleServerName: "flexibleServerName", + LtrBackupOperationName: "ltrBackupOperationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/ltrBackupOperations/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/ltrBackupOperations/ltrBackupOperationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/lTrBaCkUpOpErAtIoNs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/lTrBaCkUpOpErAtIoNs/lTrBaCkUpOpErAtIoNnAmE", Expected: &LtrBackupOperationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", - LtrBackupOperationName: "bAcKuPnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", + LtrBackupOperationName: "lTrBaCkUpOpErAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/lTrBaCkUpOpErAtIoNs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/lTrBaCkUpOpErAtIoNs/lTrBaCkUpOpErAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/migrations/README.md b/resource-manager/postgresql/2023-06-01-preview/migrations/README.md index 9d26f8c5b0a..c0372b919fb 100644 --- a/resource-manager/postgresql/2023-06-01-preview/migrations/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/migrations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "targetDbServerName", "migrationName") +id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "migrationName") payload := migrations.MigrationResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "targetDbServerName", "migrationName") +id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "migrationName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "targetDbServerName", "migrationName") +id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "migrationName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := migrations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := migrations.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByTargetServer(ctx, id, migrations.DefaultListByTargetServerOperationOptions())` can be used to do batched pagination items, err := client.ListByTargetServerComplete(ctx, id, migrations.DefaultListByTargetServerOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "targetDbServerName", "migrationName") +id := migrations.NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "migrationName") payload := migrations.MigrationResourceForPatch{ // ... diff --git a/resource-manager/postgresql/2023-06-01-preview/migrations/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/migrations/id_flexibleserver.go index 579d70af986..097e3e77da6 100644 --- a/resource-manager/postgresql/2023-06-01-preview/migrations/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/migrations/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/migrations/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/migrations/id_flexibleserver_test.go index 085c5e8fc6a..7d7bb3f84e0 100644 --- a/resource-manager/postgresql/2023-06-01-preview/migrations/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/migrations/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/migrations/id_migration.go b/resource-manager/postgresql/2023-06-01-preview/migrations/id_migration.go index b47954c9072..af292b91145 100644 --- a/resource-manager/postgresql/2023-06-01-preview/migrations/id_migration.go +++ b/resource-manager/postgresql/2023-06-01-preview/migrations/id_migration.go @@ -121,7 +121,7 @@ func (id MigrationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "targetDbServerName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticMigrations", "migrations", "migrations"), resourceids.UserSpecifiedSegment("migrationName", "migrationName"), } diff --git a/resource-manager/postgresql/2023-06-01-preview/migrations/id_migration_test.go b/resource-manager/postgresql/2023-06-01-preview/migrations/id_migration_test.go index 987b2e484af..5d5db5b06e2 100644 --- a/resource-manager/postgresql/2023-06-01-preview/migrations/id_migration_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/migrations/id_migration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MigrationId{} func TestNewMigrationID(t *testing.T) { - id := NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "targetDbServerName", "migrationName") + id := NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "migrationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewMigrationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "targetDbServerName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "targetDbServerName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.MigrationName != "migrationName" { @@ -32,8 +32,8 @@ func TestNewMigrationID(t *testing.T) { } func TestFormatMigrationID(t *testing.T) { - actual := NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "targetDbServerName", "migrationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName/migrations/migrationName" + actual := NewMigrationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "migrationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/migrations/migrationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMigrationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName/migrations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/migrations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName/migrations/migrationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/migrations/migrationName", Expected: &MigrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "targetDbServerName", + FlexibleServerName: "flexibleServerName", MigrationName: "migrationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName/migrations/migrationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/migrations/migrationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMigrationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/tArGeTdBsErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName/migrations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/migrations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/tArGeTdBsErVeRnAmE/mIgRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/mIgRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName/migrations/migrationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/migrations/migrationName", Expected: &MigrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "targetDbServerName", + FlexibleServerName: "flexibleServerName", MigrationName: "migrationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/targetDbServerName/migrations/migrationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/migrations/migrationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/tArGeTdBsErVeRnAmE/mIgRaTiOnS/mIgRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/mIgRaTiOnS/mIgRaTiOnNaMe", Expected: &MigrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "tArGeTdBsErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", MigrationName: "mIgRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/tArGeTdBsErVeRnAmE/mIgRaTiOnS/mIgRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/mIgRaTiOnS/mIgRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/post/README.md b/resource-manager/postgresql/2023-06-01-preview/post/README.md index 9a7787650a6..810a8d8ac3e 100644 --- a/resource-manager/postgresql/2023-06-01-preview/post/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/post/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := post.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := post.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := post.MigrationNameAvailabilityResource{ // ... diff --git a/resource-manager/postgresql/2023-06-01-preview/post/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/post/id_flexibleserver.go index 8450f31f0da..9be26998464 100644 --- a/resource-manager/postgresql/2023-06-01-preview/post/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/post/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/post/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/post/id_flexibleserver_test.go index ae072f4911d..e5c918cf832 100644 --- a/resource-manager/postgresql/2023-06-01-preview/post/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/post/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/README.md b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/README.md index b96adc0939a..550bd15cbb7 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := privateendpointconnections.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "privateEndpointConnectionName") if err := client.PrivateEndpointConnectionDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -69,7 +69,7 @@ if err := client.PrivateEndpointConnectionDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_flexibleserver.go index 9e67b23cbec..7fccd19ae70 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_flexibleserver_test.go index 425fc4e820f..4fdfc78d50b 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_privateendpointconnection.go index 32b349e9807..0168dfa384a 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_privateendpointconnection_test.go index cdc9b8c59a3..fbc162586d7 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/README.md b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/README.md index f570b2ba727..032fe9f7c1f 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := privatelinkresources.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_flexibleserver.go index 559c93a1557..84c10d65202 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_flexibleserver_test.go index 3791cd24074..8057f0b92ff 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_privatelinkresource.go b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_privatelinkresource.go index ce0cf5c58de..35afe3f2af6 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_privatelinkresource.go @@ -121,9 +121,9 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_privatelinkresource_test.go index ad97e911b76..30a583291b5 100644 --- a/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", - PrivateLinkResourceName: "groupName", + FlexibleServerName: "flexibleServerName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", - PrivateLinkResourceName: "groupName", + FlexibleServerName: "flexibleServerName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/replicas/README.md b/resource-manager/postgresql/2023-06-01-preview/replicas/README.md index 15503e9cbc3..fe12eccb4d1 100644 --- a/resource-manager/postgresql/2023-06-01-preview/replicas/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/replicas/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicas.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := replicas.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) diff --git a/resource-manager/postgresql/2023-06-01-preview/replicas/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/replicas/id_flexibleserver.go index b4421d68724..f2e8777baa9 100644 --- a/resource-manager/postgresql/2023-06-01-preview/replicas/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/replicas/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/replicas/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/replicas/id_flexibleserver_test.go index 669aa5e0f75..e4e16876663 100644 --- a/resource-manager/postgresql/2023-06-01-preview/replicas/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/replicas/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/serverrestart/README.md b/resource-manager/postgresql/2023-06-01-preview/serverrestart/README.md index 88296a2d75a..6cb2a7b693b 100644 --- a/resource-manager/postgresql/2023-06-01-preview/serverrestart/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/serverrestart/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := serverrestart.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := serverrestart.RestartParameter{ // ... diff --git a/resource-manager/postgresql/2023-06-01-preview/serverrestart/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/serverrestart/id_flexibleserver.go index 2a194410afd..5d1622ef152 100644 --- a/resource-manager/postgresql/2023-06-01-preview/serverrestart/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/serverrestart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/serverrestart/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/serverrestart/id_flexibleserver_test.go index 9d7ffda4e38..0a396114d99 100644 --- a/resource-manager/postgresql/2023-06-01-preview/serverrestart/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/serverrestart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/servers/README.md b/resource-manager/postgresql/2023-06-01-preview/servers/README.md index ba92641d773..4c3c6a6c440 100644 --- a/resource-manager/postgresql/2023-06-01-preview/servers/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/servers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.Server{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := servers.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") payload := servers.ServerForUpdate{ // ... diff --git a/resource-manager/postgresql/2023-06-01-preview/servers/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/servers/id_flexibleserver.go index ca603c50095..de631236f43 100644 --- a/resource-manager/postgresql/2023-06-01-preview/servers/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/servers/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/servers/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/servers/id_flexibleserver_test.go index 9023d215fd8..7392481e94a 100644 --- a/resource-manager/postgresql/2023-06-01-preview/servers/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/servers/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/serverstart/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/serverstart/id_flexibleserver.go index a8a0ef91a98..00db66b7c48 100644 --- a/resource-manager/postgresql/2023-06-01-preview/serverstart/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/serverstart/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/serverstart/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/serverstart/id_flexibleserver_test.go index 8de3c2fa696..12ca7a20c49 100644 --- a/resource-manager/postgresql/2023-06-01-preview/serverstart/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/serverstart/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/serverstop/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/serverstop/id_flexibleserver.go index 7c3291843fc..a0530579a5b 100644 --- a/resource-manager/postgresql/2023-06-01-preview/serverstop/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/serverstop/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/serverstop/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/serverstop/id_flexibleserver_test.go index 341329dd6a2..fddd48472ca 100644 --- a/resource-manager/postgresql/2023-06-01-preview/serverstop/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/serverstop/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/README.md b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/README.md index c244f106c97..ef1573aa7fa 100644 --- a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/README.md +++ b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualendpoints.NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "virtualEndpointName") +id := virtualendpoints.NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "virtualEndpointName") payload := virtualendpoints.VirtualEndpointResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := virtualendpoints.NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "virtualEndpointName") +id := virtualendpoints.NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "virtualEndpointName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := virtualendpoints.NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "virtualEndpointName") +id := virtualendpoints.NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "virtualEndpointName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualendpoints.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") +id := virtualendpoints.NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualendpoints.NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "virtualEndpointName") +id := virtualendpoints.NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "virtualEndpointName") payload := virtualendpoints.VirtualEndpointResourceForPatch{ // ... diff --git a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_flexibleserver.go b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_flexibleserver.go index c5664383cd8..788ed87f88f 100644 --- a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_flexibleserver.go +++ b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_flexibleserver.go @@ -115,7 +115,7 @@ func (id FlexibleServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), } } diff --git a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_flexibleserver_test.go b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_flexibleserver_test.go index 98da567c1f2..8249441574a 100644 --- a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_flexibleserver_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_flexibleserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FlexibleServerId{} func TestNewFlexibleServerID(t *testing.T) { - id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName") + id := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewFlexibleServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } } func TestFormatFlexibleServerID(t *testing.T) { - actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName" + actual := NewFlexibleServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseFlexibleServerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseFlexibleServerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Expected: &FlexibleServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_virtualendpoint.go b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_virtualendpoint.go index 727c3b61533..f63dd125eda 100644 --- a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_virtualendpoint.go +++ b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_virtualendpoint.go @@ -121,7 +121,7 @@ func (id VirtualEndpointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticFlexibleServers", "flexibleServers", "flexibleServers"), - resourceids.UserSpecifiedSegment("flexibleServerName", "serverName"), + resourceids.UserSpecifiedSegment("flexibleServerName", "flexibleServerName"), resourceids.StaticSegment("staticVirtualEndpoints", "virtualEndpoints", "virtualEndpoints"), resourceids.UserSpecifiedSegment("virtualEndpointName", "virtualEndpointName"), } diff --git a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_virtualendpoint_test.go b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_virtualendpoint_test.go index 7faa8920445..e90e6c52ad9 100644 --- a/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_virtualendpoint_test.go +++ b/resource-manager/postgresql/2023-06-01-preview/virtualendpoints/id_virtualendpoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualEndpointId{} func TestNewVirtualEndpointID(t *testing.T) { - id := NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "virtualEndpointName") + id := NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "virtualEndpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVirtualEndpointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.FlexibleServerName != "serverName" { - t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "serverName") + if id.FlexibleServerName != "flexibleServerName" { + t.Fatalf("Expected %q but got %q for Segment 'FlexibleServerName'", id.FlexibleServerName, "flexibleServerName") } if id.VirtualEndpointName != "virtualEndpointName" { @@ -32,8 +32,8 @@ func TestNewVirtualEndpointID(t *testing.T) { } func TestFormatVirtualEndpointID(t *testing.T) { - actual := NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "virtualEndpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/virtualEndpoints/virtualEndpointName" + actual := NewVirtualEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "flexibleServerName", "virtualEndpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/virtualEndpoints/virtualEndpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVirtualEndpointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/virtualEndpoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/virtualEndpoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/virtualEndpoints/virtualEndpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/virtualEndpoints/virtualEndpointName", Expected: &VirtualEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", VirtualEndpointName: "virtualEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/virtualEndpoints/virtualEndpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/virtualEndpoints/virtualEndpointName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVirtualEndpointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/virtualEndpoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/virtualEndpoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/vIrTuAlEnDpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/vIrTuAlEnDpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/virtualEndpoints/virtualEndpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/virtualEndpoints/virtualEndpointName", Expected: &VirtualEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - FlexibleServerName: "serverName", + FlexibleServerName: "flexibleServerName", VirtualEndpointName: "virtualEndpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/serverName/virtualEndpoints/virtualEndpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/flexibleServers/flexibleServerName/virtualEndpoints/virtualEndpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/vIrTuAlEnDpOiNtS/vIrTuAlEnDpOiNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/vIrTuAlEnDpOiNtS/vIrTuAlEnDpOiNtNaMe", Expected: &VirtualEndpointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FlexibleServerName: "sErVeRnAmE", + FlexibleServerName: "fLeXiBlEsErVeRnAmE", VirtualEndpointName: "vIrTuAlEnDpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/sErVeRnAmE/vIrTuAlEnDpOiNtS/vIrTuAlEnDpOiNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/fLeXiBlEsErVeRs/fLeXiBlEsErVeRnAmE/vIrTuAlEnDpOiNtS/vIrTuAlEnDpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/clusteroperations/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2022-11-08/clusteroperations/id_servergroupsv2.go index 7bd93c719b1..c7dd52fb885 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/clusteroperations/id_servergroupsv2.go +++ b/resource-manager/postgresqlhsc/2022-11-08/clusteroperations/id_servergroupsv2.go @@ -115,7 +115,7 @@ func (id ServerGroupsv2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/clusteroperations/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2022-11-08/clusteroperations/id_servergroupsv2_test.go index 9c92fd3f66f..e7e9c894cc3 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/clusteroperations/id_servergroupsv2_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/clusteroperations/id_servergroupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerGroupsv2Id{} func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServerGroupsv2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } } func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName" + actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServerGroupsv2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServerGroupsv2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/clusters/README.md b/resource-manager/postgresqlhsc/2022-11-08/clusters/README.md index dd72de83b01..483d77c731e 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/clusters/README.md +++ b/resource-manager/postgresqlhsc/2022-11-08/clusters/README.md @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := clusters.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := clusters.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") payload := clusters.Cluster{ // ... @@ -63,7 +63,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := clusters.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := clusters.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -75,7 +75,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := clusters.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := clusters.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") read, err := client.Get(ctx, id) if err != nil { @@ -125,7 +125,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := clusters.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := clusters.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") payload := clusters.ClusterForUpdate{ // ... diff --git a/resource-manager/postgresqlhsc/2022-11-08/clusters/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2022-11-08/clusters/id_servergroupsv2.go index d1bb3c54138..a300db90248 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/clusters/id_servergroupsv2.go +++ b/resource-manager/postgresqlhsc/2022-11-08/clusters/id_servergroupsv2.go @@ -115,7 +115,7 @@ func (id ServerGroupsv2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/clusters/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2022-11-08/clusters/id_servergroupsv2_test.go index 6e7d2ad92b7..a407b6993ec 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/clusters/id_servergroupsv2_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/clusters/id_servergroupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerGroupsv2Id{} func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServerGroupsv2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } } func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName" + actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServerGroupsv2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServerGroupsv2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/README.md b/resource-manager/postgresqlhsc/2022-11-08/configurations/README.md index 0f528b946c2..2dcb2a44350 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/README.md +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName") +id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "configurationName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewCoordinatorConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName") +id := configurations.NewCoordinatorConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "coordinatorConfigurationName") read, err := client.GetCoordinator(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewNodeConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName") +id := configurations.NewNodeConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "nodeConfigurationName") read, err := client.GetNode(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := configurations.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := configurations.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") // alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByClusterComplete(ctx, id) @@ -89,7 +89,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "serverName") +id := configurations.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "serverName") // alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination items, err := client.ListByServerComplete(ctx, id) @@ -106,7 +106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := configurations.NewCoordinatorConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName") +id := configurations.NewCoordinatorConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "coordinatorConfigurationName") payload := configurations.ServerConfiguration{ // ... @@ -123,7 +123,7 @@ if err := client.UpdateOnCoordinatorThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := configurations.NewNodeConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName") +id := configurations.NewNodeConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "nodeConfigurationName") payload := configurations.ServerConfiguration{ // ... diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_configuration.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_configuration.go index 652b018ca9f..41b974a3eed 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_configuration.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_configuration.go @@ -121,7 +121,7 @@ func (id ConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), resourceids.UserSpecifiedSegment("configurationName", "configurationName"), } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_configuration_test.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_configuration_test.go index 385f7ff0d13..320625793b6 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_configuration_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_configuration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigurationId{} func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName") + id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "configurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } if id.ConfigurationName != "configurationName" { @@ -32,8 +32,8 @@ func TestNewConfigurationID(t *testing.T) { } func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/configurations/configurationName" + actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "configurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/configurations/configurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/configurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/configurations/configurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/configurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/configurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/cOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/cOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/configurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/configurations/configurationName", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", ConfigurationName: "configurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/configurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/configurations/configurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", Expected: &ConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", ConfigurationName: "cOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_coordinatorconfiguration.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_coordinatorconfiguration.go index 88a71b11ced..acb78af1f62 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_coordinatorconfiguration.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_coordinatorconfiguration.go @@ -121,9 +121,9 @@ func (id CoordinatorConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticCoordinatorConfigurations", "coordinatorConfigurations", "coordinatorConfigurations"), - resourceids.UserSpecifiedSegment("coordinatorConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("coordinatorConfigurationName", "coordinatorConfigurationName"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_coordinatorconfiguration_test.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_coordinatorconfiguration_test.go index 4e4fc993d5f..2a730eadc2d 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_coordinatorconfiguration_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_coordinatorconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CoordinatorConfigurationId{} func TestNewCoordinatorConfigurationID(t *testing.T) { - id := NewCoordinatorConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName") + id := NewCoordinatorConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "coordinatorConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCoordinatorConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } - if id.CoordinatorConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'CoordinatorConfigurationName'", id.CoordinatorConfigurationName, "configurationName") + if id.CoordinatorConfigurationName != "coordinatorConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'CoordinatorConfigurationName'", id.CoordinatorConfigurationName, "coordinatorConfigurationName") } } func TestFormatCoordinatorConfigurationID(t *testing.T) { - actual := NewCoordinatorConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/coordinatorConfigurations/configurationName" + actual := NewCoordinatorConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "coordinatorConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/coordinatorConfigurations/coordinatorConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCoordinatorConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/coordinatorConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/coordinatorConfigurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/coordinatorConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/coordinatorConfigurations/coordinatorConfigurationName", Expected: &CoordinatorConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", - CoordinatorConfigurationName: "configurationName", + ServerGroupsv2Name: "serverGroupsv2Name", + CoordinatorConfigurationName: "coordinatorConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/coordinatorConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/coordinatorConfigurations/coordinatorConfigurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCoordinatorConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/coordinatorConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/coordinatorConfigurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/cOoRdInAtOrCoNfIgUrAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/cOoRdInAtOrCoNfIgUrAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/coordinatorConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/coordinatorConfigurations/coordinatorConfigurationName", Expected: &CoordinatorConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", - CoordinatorConfigurationName: "configurationName", + ServerGroupsv2Name: "serverGroupsv2Name", + CoordinatorConfigurationName: "coordinatorConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/coordinatorConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/coordinatorConfigurations/coordinatorConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/cOoRdInAtOrCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/cOoRdInAtOrCoNfIgUrAtIoNs/cOoRdInAtOrCoNfIgUrAtIoNnAmE", Expected: &CoordinatorConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", - CoordinatorConfigurationName: "cOnFiGuRaTiOnNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", + CoordinatorConfigurationName: "cOoRdInAtOrCoNfIgUrAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/cOoRdInAtOrCoNfIgUrAtIoNs/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/cOoRdInAtOrCoNfIgUrAtIoNs/cOoRdInAtOrCoNfIgUrAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_nodeconfiguration.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_nodeconfiguration.go index b38a78121d6..79e123da2ae 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_nodeconfiguration.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_nodeconfiguration.go @@ -121,9 +121,9 @@ func (id NodeConfigurationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticNodeConfigurations", "nodeConfigurations", "nodeConfigurations"), - resourceids.UserSpecifiedSegment("nodeConfigurationName", "configurationName"), + resourceids.UserSpecifiedSegment("nodeConfigurationName", "nodeConfigurationName"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_nodeconfiguration_test.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_nodeconfiguration_test.go index 9c034815e44..c6cdfc528bc 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_nodeconfiguration_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_nodeconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NodeConfigurationId{} func TestNewNodeConfigurationID(t *testing.T) { - id := NewNodeConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName") + id := NewNodeConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "nodeConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewNodeConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } - if id.NodeConfigurationName != "configurationName" { - t.Fatalf("Expected %q but got %q for Segment 'NodeConfigurationName'", id.NodeConfigurationName, "configurationName") + if id.NodeConfigurationName != "nodeConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'NodeConfigurationName'", id.NodeConfigurationName, "nodeConfigurationName") } } func TestFormatNodeConfigurationID(t *testing.T) { - actual := NewNodeConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "configurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/nodeConfigurations/configurationName" + actual := NewNodeConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "nodeConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/nodeConfigurations/nodeConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNodeConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/nodeConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/nodeConfigurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/nodeConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/nodeConfigurations/nodeConfigurationName", Expected: &NodeConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", - NodeConfigurationName: "configurationName", + ServerGroupsv2Name: "serverGroupsv2Name", + NodeConfigurationName: "nodeConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/nodeConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/nodeConfigurations/nodeConfigurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNodeConfigurationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/nodeConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/nodeConfigurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/nOdEcOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/nOdEcOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/nodeConfigurations/configurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/nodeConfigurations/nodeConfigurationName", Expected: &NodeConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", - NodeConfigurationName: "configurationName", + ServerGroupsv2Name: "serverGroupsv2Name", + NodeConfigurationName: "nodeConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/nodeConfigurations/configurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/nodeConfigurations/nodeConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/nOdEcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/nOdEcOnFiGuRaTiOnS/nOdEcOnFiGuRaTiOnNaMe", Expected: &NodeConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", - NodeConfigurationName: "cOnFiGuRaTiOnNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", + NodeConfigurationName: "nOdEcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/nOdEcOnFiGuRaTiOnS/cOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/nOdEcOnFiGuRaTiOnS/nOdEcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_server.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_server.go index 18959bac7e7..fc954385ef1 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_server.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_server.go @@ -121,7 +121,7 @@ func (id ServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticServers", "servers", "servers"), resourceids.UserSpecifiedSegment("serverName", "serverName"), } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_server_test.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_server_test.go index 7eee753e319..22aa52b17e7 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_server_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_server_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerId{} func TestNewServerID(t *testing.T) { - id := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "serverName") + id := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "serverName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } if id.ServerName != "serverName" { @@ -32,8 +32,8 @@ func TestNewServerID(t *testing.T) { } func TestFormatServerID(t *testing.T) { - actual := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName" + actual := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "serverName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName", Expected: &ServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", ServerName: "serverName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/sErVeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/sErVeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName", Expected: &ServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", ServerName: "serverName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/sErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/sErVeRs/sErVeRnAmE", Expected: &ServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", ServerName: "sErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/sErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/sErVeRs/sErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_servergroupsv2.go index db3afd45190..c03b1c2bb45 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_servergroupsv2.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_servergroupsv2.go @@ -115,7 +115,7 @@ func (id ServerGroupsv2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_servergroupsv2_test.go index f8654787d36..770b22ada74 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/configurations/id_servergroupsv2_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/configurations/id_servergroupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerGroupsv2Id{} func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServerGroupsv2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } } func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName" + actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServerGroupsv2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServerGroupsv2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/README.md b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/README.md index 8081b3ed484..538ba81e1ac 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/README.md +++ b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "firewallRuleName") payload := firewallrules.FirewallRule{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "firewallRuleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := firewallrules.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_firewallrule.go b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_firewallrule.go index ffb75cab602..444a1ad8430 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_firewallrule.go +++ b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_firewallrule.go @@ -121,7 +121,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } diff --git a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_firewallrule_test.go b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_firewallrule_test.go index 11b89b4cec1..a619cf69ee9 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_firewallrule_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "firewallRuleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } if id.FirewallRuleName != "firewallRuleName" { @@ -32,8 +32,8 @@ func TestNewFirewallRuleID(t *testing.T) { } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/firewallRules/firewallRuleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/firewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/firewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_servergroupsv2.go index e93f60204b8..a22d73edaa8 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_servergroupsv2.go +++ b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_servergroupsv2.go @@ -115,7 +115,7 @@ func (id ServerGroupsv2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_servergroupsv2_test.go index 672ee0c2718..c6de151f639 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_servergroupsv2_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/firewallrules/id_servergroupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerGroupsv2Id{} func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServerGroupsv2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } } func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName" + actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServerGroupsv2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServerGroupsv2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/README.md b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/README.md index 91dd24863cd..79dd14ae5fa 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/README.md +++ b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privateendpointconnections.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_privateendpointconnection.go index a8bc517a1da..e4ca3083f9d 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_privateendpointconnection_test.go index a2d5efc480d..e97aef13240 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_servergroupsv2.go index aceeeaee412..76eb8cdcbf1 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_servergroupsv2.go +++ b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_servergroupsv2.go @@ -115,7 +115,7 @@ func (id ServerGroupsv2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_servergroupsv2_test.go index b35fadbde61..5ed9b9a8c5a 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_servergroupsv2_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/privateendpointconnections/id_servergroupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerGroupsv2Id{} func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServerGroupsv2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } } func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName" + actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServerGroupsv2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServerGroupsv2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/README.md b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/README.md index 2ead4fa47b6..78fff928e14 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/README.md +++ b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateLinkResourceName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privatelinkresources.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privatelinkresources.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_privatelinkresource.go b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_privatelinkresource.go index 0496f38053f..af4e8738047 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_privatelinkresource.go @@ -121,7 +121,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } diff --git a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_privatelinkresource_test.go index 40dbe37713c..8d7e58f69c8 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateLinkResourceName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } if id.PrivateLinkResourceName != "privateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewPrivateLinkResourceID(t *testing.T) { } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateLinkResources/privateLinkResourceName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/pRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/pRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateLinkResources/privateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/privateLinkResources/privateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_servergroupsv2.go index b0e93bd7a1b..f761c0a6bb2 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_servergroupsv2.go +++ b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_servergroupsv2.go @@ -115,7 +115,7 @@ func (id ServerGroupsv2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_servergroupsv2_test.go index c1614da3ce0..73d457dfc34 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_servergroupsv2_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/privatelinkresources/id_servergroupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerGroupsv2Id{} func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServerGroupsv2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } } func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName" + actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServerGroupsv2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServerGroupsv2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/roles/README.md b/resource-manager/postgresqlhsc/2022-11-08/roles/README.md index fa5180403b0..7ff98bfcb6a 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/roles/README.md +++ b/resource-manager/postgresqlhsc/2022-11-08/roles/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "roleName") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "roleName") payload := roles.Role{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "roleName") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "roleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "roleName") +id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "roleName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := roles.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := roles.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/postgresqlhsc/2022-11-08/roles/id_role.go b/resource-manager/postgresqlhsc/2022-11-08/roles/id_role.go index 6d7c703b28e..1bde43bef4a 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/roles/id_role.go +++ b/resource-manager/postgresqlhsc/2022-11-08/roles/id_role.go @@ -121,7 +121,7 @@ func (id RoleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticRoles", "roles", "roles"), resourceids.UserSpecifiedSegment("roleName", "roleName"), } diff --git a/resource-manager/postgresqlhsc/2022-11-08/roles/id_role_test.go b/resource-manager/postgresqlhsc/2022-11-08/roles/id_role_test.go index 19887b8c91f..023c5ee4f6e 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/roles/id_role_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/roles/id_role_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RoleId{} func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "roleName") + id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "roleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRoleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } if id.RoleName != "roleName" { @@ -32,8 +32,8 @@ func TestNewRoleID(t *testing.T) { } func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "roleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/roles/roleName" + actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "roleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/roles/roleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseRoleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/roles", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/roles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/roles/roleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseRoleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/roles", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/roles", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/rOlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/rOlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/roles/roleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/roles/roleName", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", RoleName: "roleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/roles/roleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/roles/roleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/rOlEs/rOlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/rOlEs/rOlEnAmE", Expected: &RoleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", RoleName: "rOlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/rOlEs/rOlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/rOlEs/rOlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/roles/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2022-11-08/roles/id_servergroupsv2.go index 4af411f689b..dbabd38f3f6 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/roles/id_servergroupsv2.go +++ b/resource-manager/postgresqlhsc/2022-11-08/roles/id_servergroupsv2.go @@ -115,7 +115,7 @@ func (id ServerGroupsv2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/roles/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2022-11-08/roles/id_servergroupsv2_test.go index 01283467f93..88ceaf38364 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/roles/id_servergroupsv2_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/roles/id_servergroupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerGroupsv2Id{} func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServerGroupsv2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } } func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName" + actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServerGroupsv2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServerGroupsv2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/servers/README.md b/resource-manager/postgresqlhsc/2022-11-08/servers/README.md index e91aaeca529..2d56e01242c 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/servers/README.md +++ b/resource-manager/postgresqlhsc/2022-11-08/servers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servers.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "serverName") +id := servers.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "serverName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := servers.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := servers.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/postgresqlhsc/2022-11-08/servers/id_server.go b/resource-manager/postgresqlhsc/2022-11-08/servers/id_server.go index 78e23252abc..12fc1a878ba 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/servers/id_server.go +++ b/resource-manager/postgresqlhsc/2022-11-08/servers/id_server.go @@ -121,7 +121,7 @@ func (id ServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), resourceids.StaticSegment("staticServers", "servers", "servers"), resourceids.UserSpecifiedSegment("serverName", "serverName"), } diff --git a/resource-manager/postgresqlhsc/2022-11-08/servers/id_server_test.go b/resource-manager/postgresqlhsc/2022-11-08/servers/id_server_test.go index 0068ae5b71c..563b6b9100a 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/servers/id_server_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/servers/id_server_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerId{} func TestNewServerID(t *testing.T) { - id := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "serverName") + id := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "serverName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } if id.ServerName != "serverName" { @@ -32,8 +32,8 @@ func TestNewServerID(t *testing.T) { } func TestFormatServerID(t *testing.T) { - actual := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "serverName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName" + actual := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name", "serverName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName", Expected: &ServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", ServerName: "serverName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/sErVeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/sErVeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName", Expected: &ServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", ServerName: "serverName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/servers/serverName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/servers/serverName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/sErVeRs/sErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/sErVeRs/sErVeRnAmE", Expected: &ServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", ServerName: "sErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/sErVeRs/sErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/sErVeRs/sErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/postgresqlhsc/2022-11-08/servers/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2022-11-08/servers/id_servergroupsv2.go index b2c126a8de0..a770ee92a61 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/servers/id_servergroupsv2.go +++ b/resource-manager/postgresqlhsc/2022-11-08/servers/id_servergroupsv2.go @@ -115,7 +115,7 @@ func (id ServerGroupsv2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "clusterName"), + resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Name"), } } diff --git a/resource-manager/postgresqlhsc/2022-11-08/servers/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2022-11-08/servers/id_servergroupsv2_test.go index af45a7e64fe..ad9e68408e5 100644 --- a/resource-manager/postgresqlhsc/2022-11-08/servers/id_servergroupsv2_test.go +++ b/resource-manager/postgresqlhsc/2022-11-08/servers/id_servergroupsv2_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerGroupsv2Id{} func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewServerGroupsv2ID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerGroupsv2Name != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "clusterName") + if id.ServerGroupsv2Name != "serverGroupsv2Name" { + t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Name") } } func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName" + actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Name").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseServerGroupsv2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseServerGroupsv2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "clusterName", + ServerGroupsv2Name: "serverGroupsv2Name", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Name/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE", Expected: &ServerGroupsv2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "cLuStErNaMe", + ServerGroupsv2Name: "sErVeRgRoUpSv2nAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2nAmE/extra", Error: true, }, } diff --git a/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/README.md b/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/README.md index aebd7d180ce..fe0a198bde9 100644 --- a/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/README.md +++ b/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := autoscalevcores.NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcoreName") +id := autoscalevcores.NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleVCoreName") payload := autoscalevcores.AutoScaleVCore{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalevcores.NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcoreName") +id := autoscalevcores.NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleVCoreName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalevcores.NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcoreName") +id := autoscalevcores.NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleVCoreName") read, err := client.Get(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := autoscalevcores.NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcoreName") +id := autoscalevcores.NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleVCoreName") payload := autoscalevcores.AutoScaleVCoreUpdateParameters{ // ... diff --git a/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/id_autoscalevcore.go b/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/id_autoscalevcore.go index 7ab0a76f85f..538de8f0d41 100644 --- a/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/id_autoscalevcore.go +++ b/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/id_autoscalevcore.go @@ -115,7 +115,7 @@ func (id AutoScaleVCoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftPowerBIDedicated", "Microsoft.PowerBIDedicated", "Microsoft.PowerBIDedicated"), resourceids.StaticSegment("staticAutoScaleVCores", "autoScaleVCores", "autoScaleVCores"), - resourceids.UserSpecifiedSegment("autoScaleVCoreName", "vcoreName"), + resourceids.UserSpecifiedSegment("autoScaleVCoreName", "autoScaleVCoreName"), } } diff --git a/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/id_autoscalevcore_test.go b/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/id_autoscalevcore_test.go index bbad5b030d4..86cd06e05a1 100644 --- a/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/id_autoscalevcore_test.go +++ b/resource-manager/powerbidedicated/2021-01-01/autoscalevcores/id_autoscalevcore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AutoScaleVCoreId{} func TestNewAutoScaleVCoreID(t *testing.T) { - id := NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcoreName") + id := NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleVCoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAutoScaleVCoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AutoScaleVCoreName != "vcoreName" { - t.Fatalf("Expected %q but got %q for Segment 'AutoScaleVCoreName'", id.AutoScaleVCoreName, "vcoreName") + if id.AutoScaleVCoreName != "autoScaleVCoreName" { + t.Fatalf("Expected %q but got %q for Segment 'AutoScaleVCoreName'", id.AutoScaleVCoreName, "autoScaleVCoreName") } } func TestFormatAutoScaleVCoreID(t *testing.T) { - actual := NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vcoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/vcoreName" + actual := NewAutoScaleVCoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autoScaleVCoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/autoScaleVCoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAutoScaleVCoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/vcoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/autoScaleVCoreName", Expected: &AutoScaleVCoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleVCoreName: "vcoreName", + AutoScaleVCoreName: "autoScaleVCoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/vcoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/autoScaleVCoreName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAutoScaleVCoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/vcoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/autoScaleVCoreName", Expected: &AutoScaleVCoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AutoScaleVCoreName: "vcoreName", + AutoScaleVCoreName: "autoScaleVCoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/vcoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/autoScaleVCores/autoScaleVCoreName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/aUtOsCaLeVcOrEs/vCoReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/aUtOsCaLeVcOrEs/aUtOsCaLeVcOrEnAmE", Expected: &AutoScaleVCoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AutoScaleVCoreName: "vCoReNaMe", + AutoScaleVCoreName: "aUtOsCaLeVcOrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/aUtOsCaLeVcOrEs/vCoReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/aUtOsCaLeVcOrEs/aUtOsCaLeVcOrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/powerbidedicated/2021-01-01/capacities/README.md b/resource-manager/powerbidedicated/2021-01-01/capacities/README.md index 4e818598a09..21f4274d23e 100644 --- a/resource-manager/powerbidedicated/2021-01-01/capacities/README.md +++ b/resource-manager/powerbidedicated/2021-01-01/capacities/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := capacities.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := capacities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := capacities.CheckCapacityNameAvailabilityParameters{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName") +id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName") payload := capacities.DedicatedCapacity{ // ... @@ -63,7 +63,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName") +id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -75,7 +75,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName") +id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName") read, err := client.GetDetails(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName") +id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName") read, err := client.ListSkusForCapacity(ctx, id) if err != nil { @@ -139,7 +139,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName") +id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName") if err := client.ResumeThenPoll(ctx, id); err != nil { // handle the error @@ -151,7 +151,7 @@ if err := client.ResumeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName") +id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName") if err := client.SuspendThenPoll(ctx, id); err != nil { // handle the error @@ -163,7 +163,7 @@ if err := client.SuspendThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName") +id := capacities.NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName") payload := capacities.DedicatedCapacityUpdateParameters{ // ... diff --git a/resource-manager/powerbidedicated/2021-01-01/capacities/id_capacity.go b/resource-manager/powerbidedicated/2021-01-01/capacities/id_capacity.go index a51b3d4fa72..5f1de1424a3 100644 --- a/resource-manager/powerbidedicated/2021-01-01/capacities/id_capacity.go +++ b/resource-manager/powerbidedicated/2021-01-01/capacities/id_capacity.go @@ -115,7 +115,7 @@ func (id CapacityId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftPowerBIDedicated", "Microsoft.PowerBIDedicated", "Microsoft.PowerBIDedicated"), resourceids.StaticSegment("staticCapacities", "capacities", "capacities"), - resourceids.UserSpecifiedSegment("capacityName", "dedicatedCapacityName"), + resourceids.UserSpecifiedSegment("capacityName", "capacityName"), } } diff --git a/resource-manager/powerbidedicated/2021-01-01/capacities/id_capacity_test.go b/resource-manager/powerbidedicated/2021-01-01/capacities/id_capacity_test.go index 831f43b72ad..7d8cb570ff0 100644 --- a/resource-manager/powerbidedicated/2021-01-01/capacities/id_capacity_test.go +++ b/resource-manager/powerbidedicated/2021-01-01/capacities/id_capacity_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CapacityId{} func TestNewCapacityID(t *testing.T) { - id := NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName") + id := NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCapacityID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CapacityName != "dedicatedCapacityName" { - t.Fatalf("Expected %q but got %q for Segment 'CapacityName'", id.CapacityName, "dedicatedCapacityName") + if id.CapacityName != "capacityName" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityName'", id.CapacityName, "capacityName") } } func TestFormatCapacityID(t *testing.T) { - actual := NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dedicatedCapacityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/dedicatedCapacityName" + actual := NewCapacityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "capacityName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/capacityName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCapacityID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/dedicatedCapacityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/capacityName", Expected: &CapacityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CapacityName: "dedicatedCapacityName", + CapacityName: "capacityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/dedicatedCapacityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/capacityName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCapacityIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/dedicatedCapacityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/capacityName", Expected: &CapacityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CapacityName: "dedicatedCapacityName", + CapacityName: "capacityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/dedicatedCapacityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.PowerBIDedicated/capacities/capacityName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/cApAcItIeS/dEdIcAtEdCaPaCiTyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/cApAcItIeS/cApAcItYnAmE", Expected: &CapacityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CapacityName: "dEdIcAtEdCaPaCiTyNaMe", + CapacityName: "cApAcItYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/cApAcItIeS/dEdIcAtEdCaPaCiTyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/cApAcItIeS/cApAcItYnAmE/extra", Error: true, }, } diff --git a/resource-manager/powerbidedicated/2021-01-01/capacities/id_location.go b/resource-manager/powerbidedicated/2021-01-01/capacities/id_location.go index c4a53f983a5..b6af2cdad4b 100644 --- a/resource-manager/powerbidedicated/2021-01-01/capacities/id_location.go +++ b/resource-manager/powerbidedicated/2021-01-01/capacities/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftPowerBIDedicated", "Microsoft.PowerBIDedicated", "Microsoft.PowerBIDedicated"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/powerbidedicated/2021-01-01/capacities/id_location_test.go b/resource-manager/powerbidedicated/2021-01-01/capacities/id_location_test.go index 08f5a5e3056..14488194b68 100644 --- a/resource-manager/powerbidedicated/2021-01-01/capacities/id_location_test.go +++ b/resource-manager/powerbidedicated/2021-01-01/capacities/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.PowerBIDedicated/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pOwErBiDeDiCaTeD/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2020-06-01/privatezones/README.md b/resource-manager/privatedns/2020-06-01/privatezones/README.md index 8570de57b6b..aedf09996db 100644 --- a/resource-manager/privatedns/2020-06-01/privatezones/README.md +++ b/resource-manager/privatedns/2020-06-01/privatezones/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") payload := privatezones.PrivateZone{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, privatezones.DefaultCr ```go ctx := context.TODO() -id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") if err := client.DeleteThenPoll(ctx, id, privatezones.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, privatezones.DefaultDeleteOperationOpti ```go ctx := context.TODO() -id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") payload := privatezones.PrivateZone{ // ... diff --git a/resource-manager/privatedns/2020-06-01/privatezones/id_privatednszone.go b/resource-manager/privatedns/2020-06-01/privatezones/id_privatednszone.go index 8fc374b83f6..132828a6b4f 100644 --- a/resource-manager/privatedns/2020-06-01/privatezones/id_privatednszone.go +++ b/resource-manager/privatedns/2020-06-01/privatezones/id_privatednszone.go @@ -115,7 +115,7 @@ func (id PrivateDnsZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), } } diff --git a/resource-manager/privatedns/2020-06-01/privatezones/id_privatednszone_test.go b/resource-manager/privatedns/2020-06-01/privatezones/id_privatednszone_test.go index 4aee4253c2b..332b09db6ca 100644 --- a/resource-manager/privatedns/2020-06-01/privatezones/id_privatednszone_test.go +++ b/resource-manager/privatedns/2020-06-01/privatezones/id_privatednszone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateDnsZoneId{} func TestNewPrivateDnsZoneID(t *testing.T) { - id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") + id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateDnsZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } } func TestFormatPrivateDnsZoneID(t *testing.T) { - actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName" + actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateDnsZoneID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateDnsZoneIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2020-06-01/recordsets/README.md b/resource-manager/privatedns/2020-06-01/recordsets/README.md index 6982dda8601..e811d65bb64 100644 --- a/resource-manager/privatedns/2020-06-01/recordsets/README.md +++ b/resource-manager/privatedns/2020-06-01/recordsets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") payload := recordsets.RecordSet{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") read, err := client.Delete(ctx, id, recordsets.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := recordsets.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") // alternatively `client.List(ctx, id, recordsets.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recordsets.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := recordsets.NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A") +id := recordsets.NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A") // alternatively `client.ListByType(ctx, id, recordsets.DefaultListByTypeOperationOptions())` can be used to do batched pagination items, err := client.ListByTypeComplete(ctx, id, recordsets.DefaultListByTypeOperationOptions()) @@ -111,7 +111,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") payload := recordsets.RecordSet{ // ... diff --git a/resource-manager/privatedns/2020-06-01/recordsets/id_privatednszone.go b/resource-manager/privatedns/2020-06-01/recordsets/id_privatednszone.go index d34f6f60b94..82b302f5b6e 100644 --- a/resource-manager/privatedns/2020-06-01/recordsets/id_privatednszone.go +++ b/resource-manager/privatedns/2020-06-01/recordsets/id_privatednszone.go @@ -115,7 +115,7 @@ func (id PrivateDnsZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), } } diff --git a/resource-manager/privatedns/2020-06-01/recordsets/id_privatednszone_test.go b/resource-manager/privatedns/2020-06-01/recordsets/id_privatednszone_test.go index 5d9b881565e..7418a18a172 100644 --- a/resource-manager/privatedns/2020-06-01/recordsets/id_privatednszone_test.go +++ b/resource-manager/privatedns/2020-06-01/recordsets/id_privatednszone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateDnsZoneId{} func TestNewPrivateDnsZoneID(t *testing.T) { - id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") + id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateDnsZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } } func TestFormatPrivateDnsZoneID(t *testing.T) { - actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName" + actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateDnsZoneID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateDnsZoneIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2020-06-01/recordsets/id_privatezone.go b/resource-manager/privatedns/2020-06-01/recordsets/id_privatezone.go index 2c2add883b2..52769ab527e 100644 --- a/resource-manager/privatedns/2020-06-01/recordsets/id_privatezone.go +++ b/resource-manager/privatedns/2020-06-01/recordsets/id_privatezone.go @@ -129,7 +129,7 @@ func (id PrivateZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), resourceids.ConstantSegment("recordType", PossibleValuesForRecordType(), "A"), } } diff --git a/resource-manager/privatedns/2020-06-01/recordsets/id_privatezone_test.go b/resource-manager/privatedns/2020-06-01/recordsets/id_privatezone_test.go index d0f7762cd58..0bec4242d33 100644 --- a/resource-manager/privatedns/2020-06-01/recordsets/id_privatezone_test.go +++ b/resource-manager/privatedns/2020-06-01/recordsets/id_privatezone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateZoneId{} func TestNewPrivateZoneID(t *testing.T) { - id := NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A") + id := NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } if id.RecordType != "A" { @@ -32,8 +32,8 @@ func TestNewPrivateZoneID(t *testing.T) { } func TestFormatPrivateZoneID(t *testing.T) { - actual := NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A" + actual := NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,22 +87,22 @@ func TestParsePrivateZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A", Expected: &PrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/extra", Error: true, }, } @@ -223,42 +223,42 @@ func TestParsePrivateZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A", Expected: &PrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a", Expected: &PrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2020-06-01/recordsets/id_recordtype.go b/resource-manager/privatedns/2020-06-01/recordsets/id_recordtype.go index 5d7fa6425a5..d2156d8dbb7 100644 --- a/resource-manager/privatedns/2020-06-01/recordsets/id_recordtype.go +++ b/resource-manager/privatedns/2020-06-01/recordsets/id_recordtype.go @@ -135,7 +135,7 @@ func (id RecordTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), resourceids.ConstantSegment("recordType", PossibleValuesForRecordType(), "A"), resourceids.UserSpecifiedSegment("relativeRecordSetName", "relativeRecordSetName"), } diff --git a/resource-manager/privatedns/2020-06-01/recordsets/id_recordtype_test.go b/resource-manager/privatedns/2020-06-01/recordsets/id_recordtype_test.go index c6b6aab0612..82e79f2e569 100644 --- a/resource-manager/privatedns/2020-06-01/recordsets/id_recordtype_test.go +++ b/resource-manager/privatedns/2020-06-01/recordsets/id_recordtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecordTypeId{} func TestNewRecordTypeID(t *testing.T) { - id := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") + id := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRecordTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } if id.RecordType != "A" { @@ -36,8 +36,8 @@ func TestNewRecordTypeID(t *testing.T) { } func TestFormatRecordTypeID(t *testing.T) { - actual := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName" + actual := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,28 +91,28 @@ func TestParseRecordTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", RecordType: "A", RelativeRecordSetName: "relativeRecordSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName/extra", Error: true, }, } @@ -237,54 +237,54 @@ func TestParseRecordTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", RecordType: "A", RelativeRecordSetName: "relativeRecordSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a/rElAtIvErEcOrDsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a/rElAtIvErEcOrDsEtNaMe", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", RecordType: "A", RelativeRecordSetName: "rElAtIvErEcOrDsEtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a/rElAtIvErEcOrDsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a/rElAtIvErEcOrDsEtNaMe/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/README.md b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/README.md index 20f1993500e..393c9449d9c 100644 --- a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/README.md +++ b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") +id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") payload := virtualnetworklinks.VirtualNetworkLink{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, virtualnetworklinks.De ```go ctx := context.TODO() -id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") +id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") if err := client.DeleteThenPoll(ctx, id, virtualnetworklinks.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, virtualnetworklinks.DefaultDeleteOperat ```go ctx := context.TODO() -id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") +id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworklinks.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := virtualnetworklinks.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") // alternatively `client.List(ctx, id, virtualnetworklinks.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, virtualnetworklinks.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") +id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") payload := virtualnetworklinks.VirtualNetworkLink{ // ... diff --git a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_privatednszone.go b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_privatednszone.go index d8a7fd010ee..e346cad8d6b 100644 --- a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_privatednszone.go +++ b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_privatednszone.go @@ -115,7 +115,7 @@ func (id PrivateDnsZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), } } diff --git a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_privatednszone_test.go b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_privatednszone_test.go index 489aa889d81..d72fbf40370 100644 --- a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_privatednszone_test.go +++ b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_privatednszone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateDnsZoneId{} func TestNewPrivateDnsZoneID(t *testing.T) { - id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") + id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateDnsZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } } func TestFormatPrivateDnsZoneID(t *testing.T) { - actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName" + actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateDnsZoneID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateDnsZoneIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_virtualnetworklink.go b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_virtualnetworklink.go index dadf91862c0..c199e86a7a6 100644 --- a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_virtualnetworklink.go +++ b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_virtualnetworklink.go @@ -121,7 +121,7 @@ func (id VirtualNetworkLinkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), resourceids.StaticSegment("staticVirtualNetworkLinks", "virtualNetworkLinks", "virtualNetworkLinks"), resourceids.UserSpecifiedSegment("virtualNetworkLinkName", "virtualNetworkLinkName"), } diff --git a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_virtualnetworklink_test.go b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_virtualnetworklink_test.go index 91b36d8b4b7..daf38ed8276 100644 --- a/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_virtualnetworklink_test.go +++ b/resource-manager/privatedns/2020-06-01/virtualnetworklinks/id_virtualnetworklink_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkLinkId{} func TestNewVirtualNetworkLinkID(t *testing.T) { - id := NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") + id := NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVirtualNetworkLinkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } if id.VirtualNetworkLinkName != "virtualNetworkLinkName" { @@ -32,8 +32,8 @@ func TestNewVirtualNetworkLinkID(t *testing.T) { } func TestFormatVirtualNetworkLinkID(t *testing.T) { - actual := NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName" + actual := NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVirtualNetworkLinkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName", Expected: &VirtualNetworkLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", VirtualNetworkLinkName: "virtualNetworkLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVirtualNetworkLinkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/vIrTuAlNeTwOrKlInKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/vIrTuAlNeTwOrKlInKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName", Expected: &VirtualNetworkLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", VirtualNetworkLinkName: "virtualNetworkLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/vIrTuAlNeTwOrKlInKs/vIrTuAlNeTwOrKlInKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/vIrTuAlNeTwOrKlInKs/vIrTuAlNeTwOrKlInKnAmE", Expected: &VirtualNetworkLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", VirtualNetworkLinkName: "vIrTuAlNeTwOrKlInKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/vIrTuAlNeTwOrKlInKs/vIrTuAlNeTwOrKlInKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/vIrTuAlNeTwOrKlInKs/vIrTuAlNeTwOrKlInKnAmE/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2024-06-01/privatezones/README.md b/resource-manager/privatedns/2024-06-01/privatezones/README.md index 48e5b1efa73..f3eb9f5a7a6 100644 --- a/resource-manager/privatedns/2024-06-01/privatezones/README.md +++ b/resource-manager/privatedns/2024-06-01/privatezones/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") payload := privatezones.PrivateZone{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, privatezones.DefaultCr ```go ctx := context.TODO() -id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") if err := client.DeleteThenPoll(ctx, id, privatezones.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, privatezones.DefaultDeleteOperationOpti ```go ctx := context.TODO() -id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := privatezones.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") payload := privatezones.PrivateZone{ // ... diff --git a/resource-manager/privatedns/2024-06-01/privatezones/id_privatednszone.go b/resource-manager/privatedns/2024-06-01/privatezones/id_privatednszone.go index 8fc374b83f6..132828a6b4f 100644 --- a/resource-manager/privatedns/2024-06-01/privatezones/id_privatednszone.go +++ b/resource-manager/privatedns/2024-06-01/privatezones/id_privatednszone.go @@ -115,7 +115,7 @@ func (id PrivateDnsZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), } } diff --git a/resource-manager/privatedns/2024-06-01/privatezones/id_privatednszone_test.go b/resource-manager/privatedns/2024-06-01/privatezones/id_privatednszone_test.go index 4aee4253c2b..332b09db6ca 100644 --- a/resource-manager/privatedns/2024-06-01/privatezones/id_privatednszone_test.go +++ b/resource-manager/privatedns/2024-06-01/privatezones/id_privatednszone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateDnsZoneId{} func TestNewPrivateDnsZoneID(t *testing.T) { - id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") + id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateDnsZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } } func TestFormatPrivateDnsZoneID(t *testing.T) { - actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName" + actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateDnsZoneID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateDnsZoneIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2024-06-01/recordsets/README.md b/resource-manager/privatedns/2024-06-01/recordsets/README.md index 8256916b254..0550235e449 100644 --- a/resource-manager/privatedns/2024-06-01/recordsets/README.md +++ b/resource-manager/privatedns/2024-06-01/recordsets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") payload := recordsets.RecordSet{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") read, err := client.Delete(ctx, id, recordsets.DefaultDeleteOperationOptions()) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recordsets.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := recordsets.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") // alternatively `client.List(ctx, id, recordsets.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recordsets.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := recordsets.NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A") +id := recordsets.NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A") // alternatively `client.ListByType(ctx, id, recordsets.DefaultListByTypeOperationOptions())` can be used to do batched pagination items, err := client.ListByTypeComplete(ctx, id, recordsets.DefaultListByTypeOperationOptions()) @@ -111,7 +111,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") +id := recordsets.NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") payload := recordsets.RecordSet{ // ... diff --git a/resource-manager/privatedns/2024-06-01/recordsets/id_privatednszone.go b/resource-manager/privatedns/2024-06-01/recordsets/id_privatednszone.go index d34f6f60b94..82b302f5b6e 100644 --- a/resource-manager/privatedns/2024-06-01/recordsets/id_privatednszone.go +++ b/resource-manager/privatedns/2024-06-01/recordsets/id_privatednszone.go @@ -115,7 +115,7 @@ func (id PrivateDnsZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), } } diff --git a/resource-manager/privatedns/2024-06-01/recordsets/id_privatednszone_test.go b/resource-manager/privatedns/2024-06-01/recordsets/id_privatednszone_test.go index 5d9b881565e..7418a18a172 100644 --- a/resource-manager/privatedns/2024-06-01/recordsets/id_privatednszone_test.go +++ b/resource-manager/privatedns/2024-06-01/recordsets/id_privatednszone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateDnsZoneId{} func TestNewPrivateDnsZoneID(t *testing.T) { - id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") + id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateDnsZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } } func TestFormatPrivateDnsZoneID(t *testing.T) { - actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName" + actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateDnsZoneID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateDnsZoneIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2024-06-01/recordsets/id_privatezone.go b/resource-manager/privatedns/2024-06-01/recordsets/id_privatezone.go index 2c2add883b2..52769ab527e 100644 --- a/resource-manager/privatedns/2024-06-01/recordsets/id_privatezone.go +++ b/resource-manager/privatedns/2024-06-01/recordsets/id_privatezone.go @@ -129,7 +129,7 @@ func (id PrivateZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), resourceids.ConstantSegment("recordType", PossibleValuesForRecordType(), "A"), } } diff --git a/resource-manager/privatedns/2024-06-01/recordsets/id_privatezone_test.go b/resource-manager/privatedns/2024-06-01/recordsets/id_privatezone_test.go index d0f7762cd58..0bec4242d33 100644 --- a/resource-manager/privatedns/2024-06-01/recordsets/id_privatezone_test.go +++ b/resource-manager/privatedns/2024-06-01/recordsets/id_privatezone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateZoneId{} func TestNewPrivateZoneID(t *testing.T) { - id := NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A") + id := NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } if id.RecordType != "A" { @@ -32,8 +32,8 @@ func TestNewPrivateZoneID(t *testing.T) { } func TestFormatPrivateZoneID(t *testing.T) { - actual := NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A" + actual := NewPrivateZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,22 +87,22 @@ func TestParsePrivateZoneID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A", Expected: &PrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/extra", Error: true, }, } @@ -223,42 +223,42 @@ func TestParsePrivateZoneIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A", Expected: &PrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a", Expected: &PrivateZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", RecordType: "A", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2024-06-01/recordsets/id_recordtype.go b/resource-manager/privatedns/2024-06-01/recordsets/id_recordtype.go index 5d7fa6425a5..d2156d8dbb7 100644 --- a/resource-manager/privatedns/2024-06-01/recordsets/id_recordtype.go +++ b/resource-manager/privatedns/2024-06-01/recordsets/id_recordtype.go @@ -135,7 +135,7 @@ func (id RecordTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), resourceids.ConstantSegment("recordType", PossibleValuesForRecordType(), "A"), resourceids.UserSpecifiedSegment("relativeRecordSetName", "relativeRecordSetName"), } diff --git a/resource-manager/privatedns/2024-06-01/recordsets/id_recordtype_test.go b/resource-manager/privatedns/2024-06-01/recordsets/id_recordtype_test.go index c6b6aab0612..82e79f2e569 100644 --- a/resource-manager/privatedns/2024-06-01/recordsets/id_recordtype_test.go +++ b/resource-manager/privatedns/2024-06-01/recordsets/id_recordtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecordTypeId{} func TestNewRecordTypeID(t *testing.T) { - id := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName") + id := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRecordTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } if id.RecordType != "A" { @@ -36,8 +36,8 @@ func TestNewRecordTypeID(t *testing.T) { } func TestFormatRecordTypeID(t *testing.T) { - actual := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "A", "relativeRecordSetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName" + actual := NewRecordTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "A", "relativeRecordSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,28 +91,28 @@ func TestParseRecordTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", RecordType: "A", RelativeRecordSetName: "relativeRecordSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName/extra", Error: true, }, } @@ -237,54 +237,54 @@ func TestParseRecordTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", RecordType: "A", RelativeRecordSetName: "relativeRecordSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/A/relativeRecordSetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/A/relativeRecordSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a/rElAtIvErEcOrDsEtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a/rElAtIvErEcOrDsEtNaMe", Expected: &RecordTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", RecordType: "A", RelativeRecordSetName: "rElAtIvErEcOrDsEtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/a/rElAtIvErEcOrDsEtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/a/rElAtIvErEcOrDsEtNaMe/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/README.md b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/README.md index 6181783a033..307d7807c51 100644 --- a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/README.md +++ b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") +id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") payload := virtualnetworklinks.VirtualNetworkLink{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload, virtualnetworklinks.De ```go ctx := context.TODO() -id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") +id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") if err := client.DeleteThenPoll(ctx, id, virtualnetworklinks.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, virtualnetworklinks.DefaultDeleteOperat ```go ctx := context.TODO() -id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") +id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := virtualnetworklinks.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") +id := virtualnetworklinks.NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") // alternatively `client.List(ctx, id, virtualnetworklinks.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, virtualnetworklinks.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") +id := virtualnetworklinks.NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") payload := virtualnetworklinks.VirtualNetworkLink{ // ... diff --git a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_privatednszone.go b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_privatednszone.go index d8a7fd010ee..e346cad8d6b 100644 --- a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_privatednszone.go +++ b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_privatednszone.go @@ -115,7 +115,7 @@ func (id PrivateDnsZoneId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), } } diff --git a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_privatednszone_test.go b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_privatednszone_test.go index 489aa889d81..d72fbf40370 100644 --- a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_privatednszone_test.go +++ b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_privatednszone_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateDnsZoneId{} func TestNewPrivateDnsZoneID(t *testing.T) { - id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName") + id := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewPrivateDnsZoneID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } } func TestFormatPrivateDnsZoneID(t *testing.T) { - actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName" + actual := NewPrivateDnsZoneID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParsePrivateDnsZoneID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParsePrivateDnsZoneIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Expected: &PrivateDnsZoneId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/extra", Error: true, }, } diff --git a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_virtualnetworklink.go b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_virtualnetworklink.go index dadf91862c0..c199e86a7a6 100644 --- a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_virtualnetworklink.go +++ b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_virtualnetworklink.go @@ -121,7 +121,7 @@ func (id VirtualNetworkLinkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticPrivateDnsZones", "privateDnsZones", "privateDnsZones"), - resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateZoneName"), + resourceids.UserSpecifiedSegment("privateDnsZoneName", "privateDnsZoneName"), resourceids.StaticSegment("staticVirtualNetworkLinks", "virtualNetworkLinks", "virtualNetworkLinks"), resourceids.UserSpecifiedSegment("virtualNetworkLinkName", "virtualNetworkLinkName"), } diff --git a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_virtualnetworklink_test.go b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_virtualnetworklink_test.go index 91b36d8b4b7..daf38ed8276 100644 --- a/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_virtualnetworklink_test.go +++ b/resource-manager/privatedns/2024-06-01/virtualnetworklinks/id_virtualnetworklink_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkLinkId{} func TestNewVirtualNetworkLinkID(t *testing.T) { - id := NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName") + id := NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVirtualNetworkLinkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.PrivateDnsZoneName != "privateZoneName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateZoneName") + if id.PrivateDnsZoneName != "privateDnsZoneName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneName'", id.PrivateDnsZoneName, "privateDnsZoneName") } if id.VirtualNetworkLinkName != "virtualNetworkLinkName" { @@ -32,8 +32,8 @@ func TestNewVirtualNetworkLinkID(t *testing.T) { } func TestFormatVirtualNetworkLinkID(t *testing.T) { - actual := NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateZoneName", "virtualNetworkLinkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName" + actual := NewVirtualNetworkLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateDnsZoneName", "virtualNetworkLinkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVirtualNetworkLinkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName", Expected: &VirtualNetworkLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", VirtualNetworkLinkName: "virtualNetworkLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVirtualNetworkLinkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/vIrTuAlNeTwOrKlInKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/vIrTuAlNeTwOrKlInKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName", Expected: &VirtualNetworkLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - PrivateDnsZoneName: "privateZoneName", + PrivateDnsZoneName: "privateDnsZoneName", VirtualNetworkLinkName: "virtualNetworkLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateZoneName/virtualNetworkLinks/virtualNetworkLinkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateDnsZones/privateDnsZoneName/virtualNetworkLinks/virtualNetworkLinkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/vIrTuAlNeTwOrKlInKs/vIrTuAlNeTwOrKlInKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/vIrTuAlNeTwOrKlInKs/vIrTuAlNeTwOrKlInKnAmE", Expected: &VirtualNetworkLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateDnsZoneName: "pRiVaTeZoNeNaMe", + PrivateDnsZoneName: "pRiVaTeDnSzOnEnAmE", VirtualNetworkLinkName: "vIrTuAlNeTwOrKlInKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeZoNeNaMe/vIrTuAlNeTwOrKlInKs/vIrTuAlNeTwOrKlInKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeDnSzOnEs/pRiVaTeDnSzOnEnAmE/vIrTuAlNeTwOrKlInKs/vIrTuAlNeTwOrKlInKnAmE/extra", Error: true, }, } diff --git a/resource-manager/purview/2021-12-01/feature/README.md b/resource-manager/purview/2021-12-01/feature/README.md index 0a07b60a831..5fc7052ecea 100644 --- a/resource-manager/purview/2021-12-01/feature/README.md +++ b/resource-manager/purview/2021-12-01/feature/README.md @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := feature.NewLocationID("12345678-1234-9876-4563-123456789012", "locations") +id := feature.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := feature.BatchFeatureRequest{ // ... diff --git a/resource-manager/purview/2021-12-01/feature/id_location.go b/resource-manager/purview/2021-12-01/feature/id_location.go index bbd64f7d7ab..33d2cf2e7c8 100644 --- a/resource-manager/purview/2021-12-01/feature/id_location.go +++ b/resource-manager/purview/2021-12-01/feature/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftPurview", "Microsoft.Purview", "Microsoft.Purview"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/purview/2021-12-01/feature/id_location_test.go b/resource-manager/purview/2021-12-01/feature/id_location_test.go index 74f1eda2446..ab48d37f0ab 100644 --- a/resource-manager/purview/2021-12-01/feature/id_location_test.go +++ b/resource-manager/purview/2021-12-01/feature/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "locations") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "locations" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locations") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locations").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locations", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locations", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pUrViEw/lOcAtIoNs/lOcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pUrViEw/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNs", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pUrViEw/lOcAtIoNs/lOcAtIoNs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pUrViEw/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/purview/2021-12-01/usages/README.md b/resource-manager/purview/2021-12-01/usages/README.md index 72fb5c78f08..30dd26649ef 100644 --- a/resource-manager/purview/2021-12-01/usages/README.md +++ b/resource-manager/purview/2021-12-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locations") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.Get(ctx, id, usages.DefaultGetOperationOptions())` can be used to do batched pagination items, err := client.GetComplete(ctx, id, usages.DefaultGetOperationOptions()) diff --git a/resource-manager/purview/2021-12-01/usages/id_location.go b/resource-manager/purview/2021-12-01/usages/id_location.go index 324cb4d39bb..228d7397dec 100644 --- a/resource-manager/purview/2021-12-01/usages/id_location.go +++ b/resource-manager/purview/2021-12-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftPurview", "Microsoft.Purview", "Microsoft.Purview"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/purview/2021-12-01/usages/id_location_test.go b/resource-manager/purview/2021-12-01/usages/id_location_test.go index 901e110d903..f2362af919e 100644 --- a/resource-manager/purview/2021-12-01/usages/id_location_test.go +++ b/resource-manager/purview/2021-12-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "locations") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "locations" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locations") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locations").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locations", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locations", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locations/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Purview/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pUrViEw/lOcAtIoNs/lOcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pUrViEw/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNs", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pUrViEw/lOcAtIoNs/lOcAtIoNs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.pUrViEw/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/qumulostorage/2022-10-12/filesystems/model_filesystemresourceproperties.go b/resource-manager/qumulostorage/2022-10-12/filesystems/model_filesystemresourceproperties.go index be617357b05..618fa9bb131 100644 --- a/resource-manager/qumulostorage/2022-10-12/filesystems/model_filesystemresourceproperties.go +++ b/resource-manager/qumulostorage/2022-10-12/filesystems/model_filesystemresourceproperties.go @@ -6,7 +6,7 @@ package filesystems type FileSystemResourceProperties struct { AdminPassword string `json:"adminPassword"` AvailabilityZone *string `json:"availabilityZone,omitempty"` - ClusterLoginUrl *string `json:"clusterLoginUrl,omitempty"` + ClusterLoginURL *string `json:"clusterLoginUrl,omitempty"` DelegatedSubnetId string `json:"delegatedSubnetId"` InitialCapacity int64 `json:"initialCapacity"` MarketplaceDetails MarketplaceDetails `json:"marketplaceDetails"` diff --git a/resource-manager/qumulostorage/2022-10-12/filesystems/model_filesystemresourceupdateproperties.go b/resource-manager/qumulostorage/2022-10-12/filesystems/model_filesystemresourceupdateproperties.go index 4cd4e091908..d4663e60f41 100644 --- a/resource-manager/qumulostorage/2022-10-12/filesystems/model_filesystemresourceupdateproperties.go +++ b/resource-manager/qumulostorage/2022-10-12/filesystems/model_filesystemresourceupdateproperties.go @@ -4,7 +4,7 @@ package filesystems // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type FileSystemResourceUpdateProperties struct { - ClusterLoginUrl *string `json:"clusterLoginUrl,omitempty"` + ClusterLoginURL *string `json:"clusterLoginUrl,omitempty"` DelegatedSubnetId *string `json:"delegatedSubnetId,omitempty"` MarketplaceDetails *MarketplaceDetails `json:"marketplaceDetails,omitempty"` PrivateIPs *[]string `json:"privateIPs,omitempty"` diff --git a/resource-manager/qumulostorage/2024-06-19/filesystems/model_liftrbasestoragefilesystemresourceproperties.go b/resource-manager/qumulostorage/2024-06-19/filesystems/model_liftrbasestoragefilesystemresourceproperties.go index fb3dfd851aa..45e39525f99 100644 --- a/resource-manager/qumulostorage/2024-06-19/filesystems/model_liftrbasestoragefilesystemresourceproperties.go +++ b/resource-manager/qumulostorage/2024-06-19/filesystems/model_liftrbasestoragefilesystemresourceproperties.go @@ -6,7 +6,7 @@ package filesystems type LiftrBaseStorageFileSystemResourceProperties struct { AdminPassword string `json:"adminPassword"` AvailabilityZone *string `json:"availabilityZone,omitempty"` - ClusterLoginUrl *string `json:"clusterLoginUrl,omitempty"` + ClusterLoginURL *string `json:"clusterLoginUrl,omitempty"` DelegatedSubnetId string `json:"delegatedSubnetId"` MarketplaceDetails LiftrBaseMarketplaceDetails `json:"marketplaceDetails"` PrivateIPs *[]string `json:"privateIPs,omitempty"` diff --git a/resource-manager/quota/2023-02-01/quotainformation/README.md b/resource-manager/quota/2023-02-01/quotainformation/README.md index 8308542649d..6931d4d3c1c 100644 --- a/resource-manager/quota/2023-02-01/quotainformation/README.md +++ b/resource-manager/quota/2023-02-01/quotainformation/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := quotainformation.NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "resourceName") +id := quotainformation.NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "quotaName") payload := quotainformation.CurrentQuotaLimitBase{ // ... @@ -42,7 +42,7 @@ if err := client.QuotaCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := quotainformation.NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "resourceName") +id := quotainformation.NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "quotaName") read, err := client.QuotaGet(ctx, id) if err != nil { @@ -75,7 +75,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := quotainformation.NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "resourceName") +id := quotainformation.NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "quotaName") payload := quotainformation.CurrentQuotaLimitBase{ // ... diff --git a/resource-manager/quota/2023-02-01/quotainformation/id_scopedquota.go b/resource-manager/quota/2023-02-01/quotainformation/id_scopedquota.go index c1202d92ebe..079fc2ee8d9 100644 --- a/resource-manager/quota/2023-02-01/quotainformation/id_scopedquota.go +++ b/resource-manager/quota/2023-02-01/quotainformation/id_scopedquota.go @@ -106,7 +106,7 @@ func (id ScopedQuotaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftQuota", "Microsoft.Quota", "Microsoft.Quota"), resourceids.StaticSegment("staticQuotas", "quotas", "quotas"), - resourceids.UserSpecifiedSegment("quotaName", "resourceName"), + resourceids.UserSpecifiedSegment("quotaName", "quotaName"), } } diff --git a/resource-manager/quota/2023-02-01/quotainformation/id_scopedquota_test.go b/resource-manager/quota/2023-02-01/quotainformation/id_scopedquota_test.go index 1e99b72f454..23a23ed14d4 100644 --- a/resource-manager/quota/2023-02-01/quotainformation/id_scopedquota_test.go +++ b/resource-manager/quota/2023-02-01/quotainformation/id_scopedquota_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedQuotaId{} func TestNewScopedQuotaID(t *testing.T) { - id := NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "resourceName") + id := NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "quotaName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.QuotaName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'QuotaName'", id.QuotaName, "resourceName") + if id.QuotaName != "quotaName" { + t.Fatalf("Expected %q but got %q for Segment 'QuotaName'", id.QuotaName, "quotaName") } } func TestFormatScopedQuotaID(t *testing.T) { - actual := NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/resourceName" + actual := NewScopedQuotaID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "quotaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/quotaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedQuotaID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/quotaName", Expected: &ScopedQuotaId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - QuotaName: "resourceName", + QuotaName: "quotaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/quotaName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedQuotaIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/quotaName", Expected: &ScopedQuotaId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - QuotaName: "resourceName", + QuotaName: "quotaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotas/quotaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/qUoTaS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/qUoTaS/qUoTaNaMe", Expected: &ScopedQuotaId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - QuotaName: "rEsOuRcEnAmE", + QuotaName: "qUoTaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/qUoTaS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/qUoTaS/qUoTaNaMe/extra", Error: true, }, } diff --git a/resource-manager/quota/2023-02-01/quotarequests/README.md b/resource-manager/quota/2023-02-01/quotarequests/README.md index 22e6ff0f718..6114f72ab0f 100644 --- a/resource-manager/quota/2023-02-01/quotarequests/README.md +++ b/resource-manager/quota/2023-02-01/quotarequests/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := quotarequests.NewScopedQuotaRequestID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "id") +id := quotarequests.NewScopedQuotaRequestID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "quotaRequestName") read, err := client.TatusGet(ctx, id) if err != nil { diff --git a/resource-manager/quota/2023-02-01/quotarequests/id_scopedquotarequest.go b/resource-manager/quota/2023-02-01/quotarequests/id_scopedquotarequest.go index a02a53d43db..d39157da9d8 100644 --- a/resource-manager/quota/2023-02-01/quotarequests/id_scopedquotarequest.go +++ b/resource-manager/quota/2023-02-01/quotarequests/id_scopedquotarequest.go @@ -106,7 +106,7 @@ func (id ScopedQuotaRequestId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftQuota", "Microsoft.Quota", "Microsoft.Quota"), resourceids.StaticSegment("staticQuotaRequests", "quotaRequests", "quotaRequests"), - resourceids.UserSpecifiedSegment("quotaRequestName", "id"), + resourceids.UserSpecifiedSegment("quotaRequestName", "quotaRequestName"), } } diff --git a/resource-manager/quota/2023-02-01/quotarequests/id_scopedquotarequest_test.go b/resource-manager/quota/2023-02-01/quotarequests/id_scopedquotarequest_test.go index 484fdbf4c38..ad4db9cfefe 100644 --- a/resource-manager/quota/2023-02-01/quotarequests/id_scopedquotarequest_test.go +++ b/resource-manager/quota/2023-02-01/quotarequests/id_scopedquotarequest_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedQuotaRequestId{} func TestNewScopedQuotaRequestID(t *testing.T) { - id := NewScopedQuotaRequestID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "id") + id := NewScopedQuotaRequestID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "quotaRequestName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.QuotaRequestName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'QuotaRequestName'", id.QuotaRequestName, "id") + if id.QuotaRequestName != "quotaRequestName" { + t.Fatalf("Expected %q but got %q for Segment 'QuotaRequestName'", id.QuotaRequestName, "quotaRequestName") } } func TestFormatScopedQuotaRequestID(t *testing.T) { - actual := NewScopedQuotaRequestID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/id" + actual := NewScopedQuotaRequestID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "quotaRequestName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/quotaRequestName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedQuotaRequestID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/quotaRequestName", Expected: &ScopedQuotaRequestId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - QuotaRequestName: "id", + QuotaRequestName: "quotaRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/quotaRequestName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedQuotaRequestIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/quotaRequestName", Expected: &ScopedQuotaRequestId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - QuotaRequestName: "id", + QuotaRequestName: "quotaRequestName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/quotaRequests/quotaRequestName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/qUoTaReQuEsTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/qUoTaReQuEsTs/qUoTaReQuEsTnAmE", Expected: &ScopedQuotaRequestId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - QuotaRequestName: "iD", + QuotaRequestName: "qUoTaReQuEsTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/qUoTaReQuEsTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/qUoTaReQuEsTs/qUoTaReQuEsTnAmE/extra", Error: true, }, } diff --git a/resource-manager/quota/2023-02-01/usagesinformation/README.md b/resource-manager/quota/2023-02-01/usagesinformation/README.md index ac1b2dd515e..b4756e1f8c0 100644 --- a/resource-manager/quota/2023-02-01/usagesinformation/README.md +++ b/resource-manager/quota/2023-02-01/usagesinformation/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usagesinformation.NewScopedUsageID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "resourceName") +id := usagesinformation.NewScopedUsageID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "usageName") read, err := client.UsagesGet(ctx, id) if err != nil { diff --git a/resource-manager/quota/2023-02-01/usagesinformation/id_scopedusage.go b/resource-manager/quota/2023-02-01/usagesinformation/id_scopedusage.go index c41154f453d..6e492a72630 100644 --- a/resource-manager/quota/2023-02-01/usagesinformation/id_scopedusage.go +++ b/resource-manager/quota/2023-02-01/usagesinformation/id_scopedusage.go @@ -106,7 +106,7 @@ func (id ScopedUsageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftQuota", "Microsoft.Quota", "Microsoft.Quota"), resourceids.StaticSegment("staticUsages", "usages", "usages"), - resourceids.UserSpecifiedSegment("usageName", "resourceName"), + resourceids.UserSpecifiedSegment("usageName", "usageName"), } } diff --git a/resource-manager/quota/2023-02-01/usagesinformation/id_scopedusage_test.go b/resource-manager/quota/2023-02-01/usagesinformation/id_scopedusage_test.go index 864959369f1..2eaaec7bb2a 100644 --- a/resource-manager/quota/2023-02-01/usagesinformation/id_scopedusage_test.go +++ b/resource-manager/quota/2023-02-01/usagesinformation/id_scopedusage_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ScopedUsageId{} func TestNewScopedUsageID(t *testing.T) { - id := NewScopedUsageID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "resourceName") + id := NewScopedUsageID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "usageName") if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") } - if id.UsageName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'UsageName'", id.UsageName, "resourceName") + if id.UsageName != "usageName" { + t.Fatalf("Expected %q but got %q for Segment 'UsageName'", id.UsageName, "usageName") } } func TestFormatScopedUsageID(t *testing.T) { - actual := NewScopedUsageID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/resourceName" + actual := NewScopedUsageID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "usageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/usageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -64,15 +64,15 @@ func TestParseScopedUsageID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/usageName", Expected: &ScopedUsageId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - UsageName: "resourceName", + UsageName: "usageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/usageName/extra", Error: true, }, } @@ -155,28 +155,28 @@ func TestParseScopedUsageIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/usageName", Expected: &ScopedUsageId{ Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - UsageName: "resourceName", + UsageName: "usageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Quota/usages/usageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/uSaGeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/uSaGeS/uSaGeNaMe", Expected: &ScopedUsageId{ Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - UsageName: "rEsOuRcEnAmE", + UsageName: "uSaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/uSaGeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.qUoTa/uSaGeS/uSaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-01-01/recoveryservices/README.md b/resource-manager/recoveryservices/2024-01-01/recoveryservices/README.md index 7de962d414a..1c1b293a258 100644 --- a/resource-manager/recoveryservices/2024-01-01/recoveryservices/README.md +++ b/resource-manager/recoveryservices/2024-01-01/recoveryservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := recoveryservices.ResourceCapabilities{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := recoveryservices.CheckNameAvailabilityParameters{ // ... diff --git a/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_location.go b/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_location.go index 8fd5acd32a1..7645cd13836 100644 --- a/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_location.go +++ b/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_location_test.go b/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_location_test.go index aa7b47d6a23..e92c1cbef04 100644 --- a/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_location_test.go +++ b/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_providerlocation.go b/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_providerlocation.go index 791228e24fb..8efce5381e6 100644 --- a/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_providerlocation.go +++ b/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_providerlocation_test.go b/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_providerlocation_test.go index 98744bdf8ba..79e606728bf 100644 --- a/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_providerlocation_test.go +++ b/resource-manager/recoveryservices/2024-01-01/recoveryservices/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-01-01/registeredidentities/id_registeredidentity.go b/resource-manager/recoveryservices/2024-01-01/registeredidentities/id_registeredidentity.go index 096340e1044..596e7ee5850 100644 --- a/resource-manager/recoveryservices/2024-01-01/registeredidentities/id_registeredidentity.go +++ b/resource-manager/recoveryservices/2024-01-01/registeredidentities/id_registeredidentity.go @@ -123,7 +123,7 @@ func (id RegisteredIdentityId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticRegisteredIdentities", "registeredIdentities", "registeredIdentities"), - resourceids.UserSpecifiedSegment("registeredIdentityName", "identityName"), + resourceids.UserSpecifiedSegment("registeredIdentityName", "registeredIdentityName"), } } diff --git a/resource-manager/recoveryservices/2024-01-01/registeredidentities/id_registeredidentity_test.go b/resource-manager/recoveryservices/2024-01-01/registeredidentities/id_registeredidentity_test.go index 3fdabc3254f..0ad33ee16df 100644 --- a/resource-manager/recoveryservices/2024-01-01/registeredidentities/id_registeredidentity_test.go +++ b/resource-manager/recoveryservices/2024-01-01/registeredidentities/id_registeredidentity_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegisteredIdentityId{} func TestNewRegisteredIdentityID(t *testing.T) { - id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "identityName") + id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "registeredIdentityName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRegisteredIdentityID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.RegisteredIdentityName != "identityName" { - t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "identityName") + if id.RegisteredIdentityName != "registeredIdentityName" { + t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "registeredIdentityName") } } func TestFormatRegisteredIdentityID(t *testing.T) { - actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "identityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName" + actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "registeredIdentityName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRegisteredIdentityID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - RegisteredIdentityName: "identityName", + RegisteredIdentityName: "registeredIdentityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRegisteredIdentityIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - RegisteredIdentityName: "identityName", + RegisteredIdentityName: "registeredIdentityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/iDeNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYnAmE", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - RegisteredIdentityName: "iDeNtItYnAmE", + RegisteredIdentityName: "rEgIsTeReDiDeNtItYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/iDeNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-02-01/recoveryservices/README.md b/resource-manager/recoveryservices/2024-02-01/recoveryservices/README.md index f25088f882b..1b203dedd39 100644 --- a/resource-manager/recoveryservices/2024-02-01/recoveryservices/README.md +++ b/resource-manager/recoveryservices/2024-02-01/recoveryservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := recoveryservices.ResourceCapabilities{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := recoveryservices.CheckNameAvailabilityParameters{ // ... diff --git a/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_location.go b/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_location.go index 8fd5acd32a1..7645cd13836 100644 --- a/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_location.go +++ b/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_location_test.go b/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_location_test.go index aa7b47d6a23..e92c1cbef04 100644 --- a/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_location_test.go +++ b/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_providerlocation.go b/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_providerlocation.go index 791228e24fb..8efce5381e6 100644 --- a/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_providerlocation.go +++ b/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_providerlocation_test.go b/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_providerlocation_test.go index 98744bdf8ba..79e606728bf 100644 --- a/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_providerlocation_test.go +++ b/resource-manager/recoveryservices/2024-02-01/recoveryservices/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-02-01/registeredidentities/id_registeredidentity.go b/resource-manager/recoveryservices/2024-02-01/registeredidentities/id_registeredidentity.go index 096340e1044..596e7ee5850 100644 --- a/resource-manager/recoveryservices/2024-02-01/registeredidentities/id_registeredidentity.go +++ b/resource-manager/recoveryservices/2024-02-01/registeredidentities/id_registeredidentity.go @@ -123,7 +123,7 @@ func (id RegisteredIdentityId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticRegisteredIdentities", "registeredIdentities", "registeredIdentities"), - resourceids.UserSpecifiedSegment("registeredIdentityName", "identityName"), + resourceids.UserSpecifiedSegment("registeredIdentityName", "registeredIdentityName"), } } diff --git a/resource-manager/recoveryservices/2024-02-01/registeredidentities/id_registeredidentity_test.go b/resource-manager/recoveryservices/2024-02-01/registeredidentities/id_registeredidentity_test.go index 3fdabc3254f..0ad33ee16df 100644 --- a/resource-manager/recoveryservices/2024-02-01/registeredidentities/id_registeredidentity_test.go +++ b/resource-manager/recoveryservices/2024-02-01/registeredidentities/id_registeredidentity_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegisteredIdentityId{} func TestNewRegisteredIdentityID(t *testing.T) { - id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "identityName") + id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "registeredIdentityName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRegisteredIdentityID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.RegisteredIdentityName != "identityName" { - t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "identityName") + if id.RegisteredIdentityName != "registeredIdentityName" { + t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "registeredIdentityName") } } func TestFormatRegisteredIdentityID(t *testing.T) { - actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "identityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName" + actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "registeredIdentityName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRegisteredIdentityID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - RegisteredIdentityName: "identityName", + RegisteredIdentityName: "registeredIdentityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRegisteredIdentityIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - RegisteredIdentityName: "identityName", + RegisteredIdentityName: "registeredIdentityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/iDeNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYnAmE", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - RegisteredIdentityName: "iDeNtItYnAmE", + RegisteredIdentityName: "rEgIsTeReDiDeNtItYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/iDeNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-04-01/recoveryservices/README.md b/resource-manager/recoveryservices/2024-04-01/recoveryservices/README.md index 5721a3e18b5..93cbcc41e2d 100644 --- a/resource-manager/recoveryservices/2024-04-01/recoveryservices/README.md +++ b/resource-manager/recoveryservices/2024-04-01/recoveryservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := recoveryservices.ResourceCapabilities{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") payload := recoveryservices.CheckNameAvailabilityParameters{ // ... diff --git a/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_location.go b/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_location.go index 8fd5acd32a1..7645cd13836 100644 --- a/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_location.go +++ b/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_location_test.go b/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_location_test.go index aa7b47d6a23..e92c1cbef04 100644 --- a/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_location_test.go +++ b/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_providerlocation.go b/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_providerlocation.go index 791228e24fb..8efce5381e6 100644 --- a/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_providerlocation.go +++ b/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_providerlocation_test.go b/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_providerlocation_test.go index 98744bdf8ba..79e606728bf 100644 --- a/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_providerlocation_test.go +++ b/resource-manager/recoveryservices/2024-04-01/recoveryservices/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservices/2024-04-01/registeredidentities/id_registeredidentity.go b/resource-manager/recoveryservices/2024-04-01/registeredidentities/id_registeredidentity.go index 096340e1044..596e7ee5850 100644 --- a/resource-manager/recoveryservices/2024-04-01/registeredidentities/id_registeredidentity.go +++ b/resource-manager/recoveryservices/2024-04-01/registeredidentities/id_registeredidentity.go @@ -123,7 +123,7 @@ func (id RegisteredIdentityId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticRegisteredIdentities", "registeredIdentities", "registeredIdentities"), - resourceids.UserSpecifiedSegment("registeredIdentityName", "identityName"), + resourceids.UserSpecifiedSegment("registeredIdentityName", "registeredIdentityName"), } } diff --git a/resource-manager/recoveryservices/2024-04-01/registeredidentities/id_registeredidentity_test.go b/resource-manager/recoveryservices/2024-04-01/registeredidentities/id_registeredidentity_test.go index 3fdabc3254f..0ad33ee16df 100644 --- a/resource-manager/recoveryservices/2024-04-01/registeredidentities/id_registeredidentity_test.go +++ b/resource-manager/recoveryservices/2024-04-01/registeredidentities/id_registeredidentity_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RegisteredIdentityId{} func TestNewRegisteredIdentityID(t *testing.T) { - id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "identityName") + id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "registeredIdentityName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRegisteredIdentityID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.RegisteredIdentityName != "identityName" { - t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "identityName") + if id.RegisteredIdentityName != "registeredIdentityName" { + t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "registeredIdentityName") } } func TestFormatRegisteredIdentityID(t *testing.T) { - actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "identityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName" + actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "registeredIdentityName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRegisteredIdentityID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - RegisteredIdentityName: "identityName", + RegisteredIdentityName: "registeredIdentityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRegisteredIdentityIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - RegisteredIdentityName: "identityName", + RegisteredIdentityName: "registeredIdentityName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/identityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/registeredIdentities/registeredIdentityName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/iDeNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYnAmE", Expected: &RegisteredIdentityId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - RegisteredIdentityName: "iDeNtItYnAmE", + RegisteredIdentityName: "rEgIsTeReDiDeNtItYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/iDeNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backups/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/backups/README.md index 206265f6554..4fba62832bd 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backups/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := backups.BackupRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backups/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-02-01/backups/id_protecteditem.go index d2ae31f73b7..d87af28e375 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backups/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backups/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backups/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/backups/id_protecteditem_test.go index e2e6f674f02..bd7b39d1112 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backups/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backups/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/README.md index 5e381fb05a5..8f254302b16 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := backupstatus.BackupStatusRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/id_location.go b/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/id_location.go index d02657ba9d5..417d5cf70d6 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/id_location_test.go index e7d8236557f..e5365b1bacb 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backupstatus/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/README.md index 55099e94340..fe3788f7ca1 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") // alternatively `client.List(ctx, id, backupworkloaditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, backupworkloaditems.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/id_protectioncontainer.go index 9bb5618cef5..f6bef435f47 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/id_protectioncontainer_test.go index 43ee087967c..f2b0acee461 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/backupworkloaditems/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/README.md index 7e4b93454cf..e71de0d6d14 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := featuresupport.FeatureSupportRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/id_location.go b/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/id_location.go index f7289f3672a..8347c40e5d8 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/id_location_test.go index fe32a9ad6ca..c8e2c22eea9 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/featuresupport/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/README.md index b2f4e554fed..d41f76f8ea3 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := itemlevelrecoveryconnections.ILRRequestResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Revoke(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/id_recoverypoint.go index 0781239cfa9..603b7af1848 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/id_recoverypoint_test.go index 575e12afc38..c7c6bf018c1 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/itemlevelrecoveryconnections/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/jobcancellations/id_backupjob.go b/resource-manager/recoveryservicesbackup/2023-02-01/jobcancellations/id_backupjob.go index 550aa4cb7b0..fda0835fc5f 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/jobcancellations/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/jobcancellations/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/jobcancellations/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/jobcancellations/id_backupjob_test.go index a75d87968fc..dc12aed1885 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/jobcancellations/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/jobcancellations/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/README.md index 86a066a84d8..c91f8ad5fd3 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") +id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/id_backupjob.go b/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/id_backupjob.go index 5eab7c1978d..68dd9a83910 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/id_backupjob_test.go index 5dd7cf71834..7623e595a78 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/jobdetails/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/operation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-02-01/operation/model_encryptiondetails.go index 64f3372dbd2..503730b066e 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/operation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/operation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package operation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/README.md index 0f738c6c1f9..ceafffc72a4 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") // alternatively `client.List(ctx, id, protectablecontainers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, protectablecontainers.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/id_backupfabric.go index 3784727afb6..6771b5d5025 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/id_backupfabric_test.go index 4053561325f..1d43607add8 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectablecontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/README.md index 3983a2ee745..cc08cd0bb90 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := protecteditems.ProtectedItemResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Get(ctx, id, protecteditems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/id_protecteditem.go index 798b6fd09f4..34219b2c35c 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/id_protecteditem_test.go index e943367b75b..821001a86bb 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protecteditems/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/README.md index 48c1cfb74da..199515a5403 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Inquire(ctx, id, protectioncontainers.DefaultInquireOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") read, err := client.Refresh(ctx, id, protectioncontainers.DefaultRefreshOperationOptions()) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") payload := protectioncontainers.ProtectionContainerResource{ // ... @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_backupfabric.go index 50fea36c062..54027e95d42 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_backupfabric_test.go index 9421cd390bd..b5023fb6f57 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_protectioncontainer.go index 973b1512a4f..24b0d188190 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_protectioncontainer_test.go index 12b6ba48143..e8420b88b27 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectioncontainers/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/README.md index 7dc08c53cc2..08ad7e5855c 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") payload := protectionintent.ProtectionIntentResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := protectionintent.PreValidateEnableBackupRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_backupprotectionintent.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_backupprotectionintent.go index 3851befce31..688d4fb97af 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_backupprotectionintent.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_backupprotectionintent.go @@ -129,9 +129,9 @@ func (id BackupProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticBackupProtectionIntent", "backupProtectionIntent", "backupProtectionIntent"), - resourceids.UserSpecifiedSegment("backupProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("backupProtectionIntentName", "backupProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_backupprotectionintent_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_backupprotectionintent_test.go index f93903502d9..b2fd670a103 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_backupprotectionintent_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_backupprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupProtectionIntentId{} func TestNewBackupProtectionIntentID(t *testing.T) { - id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") + id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewBackupProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.BackupProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "intentObjectName") + if id.BackupProtectionIntentName != "backupProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "backupProtectionIntentName") } } func TestFormatBackupProtectionIntentID(t *testing.T) { - actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName" + actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseBackupProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseBackupProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - BackupProtectionIntentName: "iNtEnToBjEcTnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", + BackupProtectionIntentName: "bAcKuPpRoTeCtIoNiNtEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_location.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_location.go index a1f3cf24127..98c32ddf030 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_location_test.go index fcf8939ab21..091fdeda511 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectionintent/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/README.md index fab4179cd27..46296fe88b1 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") payload := protectionpolicies.ProtectionPolicyResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/id_backuppolicy.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/id_backuppolicy.go index 80fa7d63446..238e1a3ecf0 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/id_backuppolicy.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/id_backuppolicy.go @@ -123,7 +123,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), - resourceids.UserSpecifiedSegment("backupPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/id_backuppolicy_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/id_backuppolicy_test.go index 5bc2eaff079..ee84948a820 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/id_backuppolicy_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/protectionpolicies/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "policyName") + if id.BackupPolicyName != "backupPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "backupPolicyName") } } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupPolicyName: "pOlIcYnAmE", + BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/README.md index 33b20ef590c..9a2d01c69dd 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := recoverypoint.MoveRPAcrossTiersRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/id_recoverypoint.go index d9a074c3ddb..f39e95f0719 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/id_recoverypoint_test.go index c499cb3ef90..d06d7a3f935 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoint/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/README.md index 3d405474fa6..3e46b56d744 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") // alternatively `client.List(ctx, id, recoverypoints.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recoverypoints.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_protecteditem.go index 371d5ec307e..415fce0b13f 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_protecteditem_test.go index 4713cbed57b..4d122dc61d0 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_recoverypoint.go index 08495682780..3aa99fb455d 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_recoverypoint_test.go index 7fbbc9dcb5a..29d6cf0e70f 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/model_bekdetails.go index 36772ad0169..66e779c1d33 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/model_kekdetails.go index 36abbae9609..500357083c8 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypoints/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/README.md index c2b9c466964..9960bb591cd 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := recoverypointsrecommendedformove.ListRecoveryPointsRecommendedForMoveRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/id_protecteditem.go index b33a7422713..de5eadab57a 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/id_protecteditem_test.go index ee0d63cc06b..9418ddc0c75 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/model_bekdetails.go index 2060eb3fa42..d27d63b2bdb 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/model_kekdetails.go index a3aeb5f2512..4c54e953bf4 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/recoverypointsrecommendedformove/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/README.md index f709248bbe3..e8f276b527c 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.ResourceGuardProxyBaseResource{ // ... @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.UnlockDeleteRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/id_backupresourceguardproxy.go b/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/id_backupresourceguardproxy.go index 36be3b2da74..0b39ee42460 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/id_backupresourceguardproxy.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/id_backupresourceguardproxy.go @@ -123,7 +123,7 @@ func (id BackupResourceGuardProxyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupResourceGuardProxies", "backupResourceGuardProxies", "backupResourceGuardProxies"), - resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "resourceGuardProxyName"), + resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "backupResourceGuardProxyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/id_backupresourceguardproxy_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/id_backupresourceguardproxy_test.go index 85bcc507604..f1e9dde384a 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/id_backupresourceguardproxy_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/resourceguardproxy/id_backupresourceguardproxy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupResourceGuardProxyId{} func TestNewBackupResourceGuardProxyID(t *testing.T) { - id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") + id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupResourceGuardProxyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupResourceGuardProxyName != "resourceGuardProxyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "resourceGuardProxyName") + if id.BackupResourceGuardProxyName != "backupResourceGuardProxyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "backupResourceGuardProxyName") } } func TestFormatBackupResourceGuardProxyID(t *testing.T) { - actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName" + actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupResourceGuardProxyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupResourceGuardProxyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupResourceGuardProxyName: "rEsOuRcEgUaRdPrOxYnAmE", + BackupResourceGuardProxyName: "bAcKuPrEsOuRcEgUaRdPrOxYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/restores/README.md b/resource-manager/recoveryservicesbackup/2023-02-01/restores/README.md index f14e9406c98..e4ab7bcc5eb 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/restores/README.md +++ b/resource-manager/recoveryservicesbackup/2023-02-01/restores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := restores.RestoreRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/restores/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-02-01/restores/id_recoverypoint.go index ce494aed2e6..863cfe24ce1 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/restores/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/restores/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/restores/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-02-01/restores/id_recoverypoint_test.go index da9b49a581a..ff387277ecc 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/restores/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/restores/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/restores/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-02-01/restores/model_encryptiondetails.go index 59b1b6b4b01..9351ce35d30 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/restores/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/restores/model_encryptiondetails.go @@ -5,8 +5,8 @@ package restores type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-02-01/validateoperation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-02-01/validateoperation/model_encryptiondetails.go index 68be47387a8..d2830fa3e2f 100644 --- a/resource-manager/recoveryservicesbackup/2023-02-01/validateoperation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-02-01/validateoperation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package validateoperation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backups/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/backups/README.md index 5d33c4b787d..10460bf087a 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backups/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := backups.BackupRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backups/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-04-01/backups/id_protecteditem.go index d2ae31f73b7..d87af28e375 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backups/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backups/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backups/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/backups/id_protecteditem_test.go index e2e6f674f02..bd7b39d1112 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backups/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backups/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/README.md index de5e12b0c0b..da33c1763ef 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := backupstatus.BackupStatusRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/id_location.go b/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/id_location.go index d02657ba9d5..417d5cf70d6 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/id_location_test.go index e7d8236557f..e5365b1bacb 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backupstatus/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/README.md index 77557ed881c..27cd209045d 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") // alternatively `client.List(ctx, id, backupworkloaditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, backupworkloaditems.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/id_protectioncontainer.go index 9bb5618cef5..f6bef435f47 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/id_protectioncontainer_test.go index 43ee087967c..f2b0acee461 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/backupworkloaditems/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/README.md index 920d2e5493e..c3dac139fdd 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := featuresupport.FeatureSupportRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/id_location.go b/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/id_location.go index f7289f3672a..8347c40e5d8 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/id_location_test.go index fe32a9ad6ca..c8e2c22eea9 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/featuresupport/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/README.md index 6ee91ef3f9b..94cd6c2df56 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := itemlevelrecoveryconnections.ILRRequestResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Revoke(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/id_recoverypoint.go index 0781239cfa9..603b7af1848 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/id_recoverypoint_test.go index 575e12afc38..c7c6bf018c1 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/itemlevelrecoveryconnections/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/jobcancellations/id_backupjob.go b/resource-manager/recoveryservicesbackup/2023-04-01/jobcancellations/id_backupjob.go index 550aa4cb7b0..fda0835fc5f 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/jobcancellations/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/jobcancellations/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/jobcancellations/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/jobcancellations/id_backupjob_test.go index a75d87968fc..dc12aed1885 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/jobcancellations/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/jobcancellations/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/README.md index 93ff963ae90..90e4827b89c 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") +id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/id_backupjob.go b/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/id_backupjob.go index 5eab7c1978d..68dd9a83910 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/id_backupjob_test.go index 5dd7cf71834..7623e595a78 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/jobdetails/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/operation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-04-01/operation/model_encryptiondetails.go index 64f3372dbd2..503730b066e 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/operation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/operation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package operation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/README.md index 3c2aa0b7e25..e44ba3c3306 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") // alternatively `client.List(ctx, id, protectablecontainers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, protectablecontainers.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/id_backupfabric.go index 3784727afb6..6771b5d5025 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/id_backupfabric_test.go index 4053561325f..1d43607add8 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectablecontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/README.md index 313fa860e91..9b09c35e7ac 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := protecteditems.ProtectedItemResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Get(ctx, id, protecteditems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/id_protecteditem.go index 798b6fd09f4..34219b2c35c 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/id_protecteditem_test.go index e943367b75b..821001a86bb 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protecteditems/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/README.md index 01a1b47ab7e..be59420c05b 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Inquire(ctx, id, protectioncontainers.DefaultInquireOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") read, err := client.Refresh(ctx, id, protectioncontainers.DefaultRefreshOperationOptions()) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") payload := protectioncontainers.ProtectionContainerResource{ // ... @@ -89,7 +89,7 @@ if err := client.RegisterThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_backupfabric.go index 50fea36c062..54027e95d42 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_backupfabric_test.go index 9421cd390bd..b5023fb6f57 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_protectioncontainer.go index 973b1512a4f..24b0d188190 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_protectioncontainer_test.go index 12b6ba48143..e8420b88b27 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectioncontainers/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/README.md index c3d29d9494f..62a510ba07e 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") payload := protectionintent.ProtectionIntentResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := protectionintent.PreValidateEnableBackupRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_backupprotectionintent.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_backupprotectionintent.go index 3851befce31..688d4fb97af 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_backupprotectionintent.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_backupprotectionintent.go @@ -129,9 +129,9 @@ func (id BackupProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticBackupProtectionIntent", "backupProtectionIntent", "backupProtectionIntent"), - resourceids.UserSpecifiedSegment("backupProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("backupProtectionIntentName", "backupProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_backupprotectionintent_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_backupprotectionintent_test.go index f93903502d9..b2fd670a103 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_backupprotectionintent_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_backupprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupProtectionIntentId{} func TestNewBackupProtectionIntentID(t *testing.T) { - id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") + id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewBackupProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.BackupProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "intentObjectName") + if id.BackupProtectionIntentName != "backupProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "backupProtectionIntentName") } } func TestFormatBackupProtectionIntentID(t *testing.T) { - actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName" + actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseBackupProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseBackupProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - BackupProtectionIntentName: "iNtEnToBjEcTnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", + BackupProtectionIntentName: "bAcKuPpRoTeCtIoNiNtEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_location.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_location.go index a1f3cf24127..98c32ddf030 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_location_test.go index fcf8939ab21..091fdeda511 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectionintent/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/README.md index 4ef23926a8e..d97e9f41309 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") payload := protectionpolicies.ProtectionPolicyResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/id_backuppolicy.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/id_backuppolicy.go index 80fa7d63446..238e1a3ecf0 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/id_backuppolicy.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/id_backuppolicy.go @@ -123,7 +123,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), - resourceids.UserSpecifiedSegment("backupPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/id_backuppolicy_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/id_backuppolicy_test.go index 5bc2eaff079..ee84948a820 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/id_backuppolicy_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/protectionpolicies/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "policyName") + if id.BackupPolicyName != "backupPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "backupPolicyName") } } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupPolicyName: "pOlIcYnAmE", + BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/README.md index 154e451132d..794bccfdcc4 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := recoverypoint.MoveRPAcrossTiersRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/id_recoverypoint.go index d9a074c3ddb..f39e95f0719 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/id_recoverypoint_test.go index c499cb3ef90..d06d7a3f935 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoint/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/README.md index d56ea02f090..bbbccae7e10 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") // alternatively `client.List(ctx, id, recoverypoints.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recoverypoints.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_protecteditem.go index 371d5ec307e..415fce0b13f 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_protecteditem_test.go index 4713cbed57b..4d122dc61d0 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_recoverypoint.go index 08495682780..3aa99fb455d 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_recoverypoint_test.go index 7fbbc9dcb5a..29d6cf0e70f 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/model_bekdetails.go index 36772ad0169..66e779c1d33 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/model_kekdetails.go index 36abbae9609..500357083c8 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypoints/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/README.md index 95fc31d6d1d..66b7a4d8bbd 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := recoverypointsrecommendedformove.ListRecoveryPointsRecommendedForMoveRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/id_protecteditem.go index b33a7422713..de5eadab57a 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/id_protecteditem_test.go index ee0d63cc06b..9418ddc0c75 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/model_bekdetails.go index 2060eb3fa42..d27d63b2bdb 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/model_kekdetails.go index a3aeb5f2512..4c54e953bf4 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/recoverypointsrecommendedformove/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/README.md index a6d8d503809..c8d42fb60c6 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.ResourceGuardProxyBaseResource{ // ... @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.UnlockDeleteRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/id_backupresourceguardproxy.go b/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/id_backupresourceguardproxy.go index 36be3b2da74..0b39ee42460 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/id_backupresourceguardproxy.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/id_backupresourceguardproxy.go @@ -123,7 +123,7 @@ func (id BackupResourceGuardProxyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupResourceGuardProxies", "backupResourceGuardProxies", "backupResourceGuardProxies"), - resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "resourceGuardProxyName"), + resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "backupResourceGuardProxyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/id_backupresourceguardproxy_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/id_backupresourceguardproxy_test.go index 85bcc507604..f1e9dde384a 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/id_backupresourceguardproxy_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/resourceguardproxy/id_backupresourceguardproxy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupResourceGuardProxyId{} func TestNewBackupResourceGuardProxyID(t *testing.T) { - id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") + id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupResourceGuardProxyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupResourceGuardProxyName != "resourceGuardProxyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "resourceGuardProxyName") + if id.BackupResourceGuardProxyName != "backupResourceGuardProxyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "backupResourceGuardProxyName") } } func TestFormatBackupResourceGuardProxyID(t *testing.T) { - actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName" + actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupResourceGuardProxyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupResourceGuardProxyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupResourceGuardProxyName: "rEsOuRcEgUaRdPrOxYnAmE", + BackupResourceGuardProxyName: "bAcKuPrEsOuRcEgUaRdPrOxYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/restores/README.md b/resource-manager/recoveryservicesbackup/2023-04-01/restores/README.md index ad493c5d53c..e911728bf10 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/restores/README.md +++ b/resource-manager/recoveryservicesbackup/2023-04-01/restores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := restores.RestoreRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/restores/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-04-01/restores/id_recoverypoint.go index ce494aed2e6..863cfe24ce1 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/restores/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/restores/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/restores/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-04-01/restores/id_recoverypoint_test.go index da9b49a581a..ff387277ecc 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/restores/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/restores/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/restores/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-04-01/restores/model_encryptiondetails.go index 59b1b6b4b01..9351ce35d30 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/restores/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/restores/model_encryptiondetails.go @@ -5,8 +5,8 @@ package restores type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-04-01/validateoperation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-04-01/validateoperation/model_encryptiondetails.go index 68be47387a8..d2830fa3e2f 100644 --- a/resource-manager/recoveryservicesbackup/2023-04-01/validateoperation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-04-01/validateoperation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package validateoperation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backups/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/backups/README.md index 1a638ad77f1..15137e8d98b 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backups/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := backups.BackupRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backups/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-06-01/backups/id_protecteditem.go index d2ae31f73b7..d87af28e375 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backups/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backups/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backups/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/backups/id_protecteditem_test.go index e2e6f674f02..bd7b39d1112 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backups/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backups/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/README.md index 4136aba0190..68700af440e 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := backupstatus.BackupStatusRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/id_location.go b/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/id_location.go index d02657ba9d5..417d5cf70d6 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/id_location_test.go index e7d8236557f..e5365b1bacb 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backupstatus/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/README.md index c8d9c91482c..05d0794532f 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") // alternatively `client.List(ctx, id, backupworkloaditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, backupworkloaditems.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/id_protectioncontainer.go index 9bb5618cef5..f6bef435f47 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/id_protectioncontainer_test.go index 43ee087967c..f2b0acee461 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/backupworkloaditems/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/README.md index 3749c2f019a..55cf18d37c5 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := featuresupport.FeatureSupportRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/id_location.go b/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/id_location.go index f7289f3672a..8347c40e5d8 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/id_location_test.go index fe32a9ad6ca..c8e2c22eea9 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/featuresupport/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/README.md index 93cfe4a3454..75dd02f1b26 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := itemlevelrecoveryconnections.ILRRequestResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Revoke(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/id_recoverypoint.go index 0781239cfa9..603b7af1848 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/id_recoverypoint_test.go index 575e12afc38..c7c6bf018c1 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/itemlevelrecoveryconnections/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/jobcancellations/id_backupjob.go b/resource-manager/recoveryservicesbackup/2023-06-01/jobcancellations/id_backupjob.go index 550aa4cb7b0..fda0835fc5f 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/jobcancellations/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/jobcancellations/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/jobcancellations/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/jobcancellations/id_backupjob_test.go index a75d87968fc..dc12aed1885 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/jobcancellations/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/jobcancellations/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/README.md index ca219f2e12f..9b42a750646 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") +id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/id_backupjob.go b/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/id_backupjob.go index 5eab7c1978d..68dd9a83910 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/id_backupjob_test.go index 5dd7cf71834..7623e595a78 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/jobdetails/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/operation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-06-01/operation/model_encryptiondetails.go index 64f3372dbd2..503730b066e 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/operation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/operation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package operation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/README.md index cb3c4616a26..46401178967 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") // alternatively `client.List(ctx, id, protectablecontainers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, protectablecontainers.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/id_backupfabric.go index 3784727afb6..6771b5d5025 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/id_backupfabric_test.go index 4053561325f..1d43607add8 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectablecontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/README.md index ad247915c25..06001e7ecc0 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := protecteditems.ProtectedItemResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Get(ctx, id, protecteditems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/id_protecteditem.go index 798b6fd09f4..34219b2c35c 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/id_protecteditem_test.go index e943367b75b..821001a86bb 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protecteditems/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/README.md index 1ec8eb52294..8d1a97df0dc 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Inquire(ctx, id, protectioncontainers.DefaultInquireOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") read, err := client.Refresh(ctx, id, protectioncontainers.DefaultRefreshOperationOptions()) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") payload := protectioncontainers.ProtectionContainerResource{ // ... @@ -89,7 +89,7 @@ if err := client.RegisterThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_backupfabric.go index 50fea36c062..54027e95d42 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_backupfabric_test.go index 9421cd390bd..b5023fb6f57 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_protectioncontainer.go index 973b1512a4f..24b0d188190 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_protectioncontainer_test.go index 12b6ba48143..e8420b88b27 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectioncontainers/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/README.md index be6b86228f8..7da0b809d2e 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") payload := protectionintent.ProtectionIntentResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := protectionintent.PreValidateEnableBackupRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_backupprotectionintent.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_backupprotectionintent.go index 3851befce31..688d4fb97af 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_backupprotectionintent.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_backupprotectionintent.go @@ -129,9 +129,9 @@ func (id BackupProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticBackupProtectionIntent", "backupProtectionIntent", "backupProtectionIntent"), - resourceids.UserSpecifiedSegment("backupProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("backupProtectionIntentName", "backupProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_backupprotectionintent_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_backupprotectionintent_test.go index f93903502d9..b2fd670a103 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_backupprotectionintent_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_backupprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupProtectionIntentId{} func TestNewBackupProtectionIntentID(t *testing.T) { - id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") + id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewBackupProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.BackupProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "intentObjectName") + if id.BackupProtectionIntentName != "backupProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "backupProtectionIntentName") } } func TestFormatBackupProtectionIntentID(t *testing.T) { - actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName" + actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseBackupProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseBackupProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - BackupProtectionIntentName: "iNtEnToBjEcTnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", + BackupProtectionIntentName: "bAcKuPpRoTeCtIoNiNtEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_location.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_location.go index a1f3cf24127..98c32ddf030 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_location_test.go index fcf8939ab21..091fdeda511 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectionintent/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/README.md index b9adb2390f4..1795e624349 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") payload := protectionpolicies.ProtectionPolicyResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/id_backuppolicy.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/id_backuppolicy.go index 80fa7d63446..238e1a3ecf0 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/id_backuppolicy.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/id_backuppolicy.go @@ -123,7 +123,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), - resourceids.UserSpecifiedSegment("backupPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/id_backuppolicy_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/id_backuppolicy_test.go index 5bc2eaff079..ee84948a820 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/id_backuppolicy_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/protectionpolicies/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "policyName") + if id.BackupPolicyName != "backupPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "backupPolicyName") } } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupPolicyName: "pOlIcYnAmE", + BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/README.md index 8a3313332d2..5601b961f31 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := recoverypoint.MoveRPAcrossTiersRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/id_recoverypoint.go index d9a074c3ddb..f39e95f0719 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/id_recoverypoint_test.go index c499cb3ef90..d06d7a3f935 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoint/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/README.md index 0c1ef00586e..dcec97407a7 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") // alternatively `client.List(ctx, id, recoverypoints.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recoverypoints.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_protecteditem.go index 371d5ec307e..415fce0b13f 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_protecteditem_test.go index 4713cbed57b..4d122dc61d0 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_recoverypoint.go index 08495682780..3aa99fb455d 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_recoverypoint_test.go index 7fbbc9dcb5a..29d6cf0e70f 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/model_bekdetails.go index 36772ad0169..66e779c1d33 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/model_kekdetails.go index 36abbae9609..500357083c8 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypoints/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/README.md index 4988bd6ec00..2c95798f7d7 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := recoverypointsrecommendedformove.ListRecoveryPointsRecommendedForMoveRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/id_protecteditem.go index b33a7422713..de5eadab57a 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/id_protecteditem_test.go index ee0d63cc06b..9418ddc0c75 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/model_bekdetails.go index 2060eb3fa42..d27d63b2bdb 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/model_kekdetails.go index a3aeb5f2512..4c54e953bf4 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/recoverypointsrecommendedformove/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/README.md index c04527da24f..ab1e7713717 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.ResourceGuardProxyBaseResource{ // ... @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.UnlockDeleteRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/id_backupresourceguardproxy.go b/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/id_backupresourceguardproxy.go index 36be3b2da74..0b39ee42460 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/id_backupresourceguardproxy.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/id_backupresourceguardproxy.go @@ -123,7 +123,7 @@ func (id BackupResourceGuardProxyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupResourceGuardProxies", "backupResourceGuardProxies", "backupResourceGuardProxies"), - resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "resourceGuardProxyName"), + resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "backupResourceGuardProxyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/id_backupresourceguardproxy_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/id_backupresourceguardproxy_test.go index 85bcc507604..f1e9dde384a 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/id_backupresourceguardproxy_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/resourceguardproxy/id_backupresourceguardproxy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupResourceGuardProxyId{} func TestNewBackupResourceGuardProxyID(t *testing.T) { - id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") + id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupResourceGuardProxyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupResourceGuardProxyName != "resourceGuardProxyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "resourceGuardProxyName") + if id.BackupResourceGuardProxyName != "backupResourceGuardProxyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "backupResourceGuardProxyName") } } func TestFormatBackupResourceGuardProxyID(t *testing.T) { - actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName" + actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupResourceGuardProxyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupResourceGuardProxyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupResourceGuardProxyName: "rEsOuRcEgUaRdPrOxYnAmE", + BackupResourceGuardProxyName: "bAcKuPrEsOuRcEgUaRdPrOxYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/restores/README.md b/resource-manager/recoveryservicesbackup/2023-06-01/restores/README.md index ec11bf17742..bc1d9e70153 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/restores/README.md +++ b/resource-manager/recoveryservicesbackup/2023-06-01/restores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := restores.RestoreRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/restores/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-06-01/restores/id_recoverypoint.go index ce494aed2e6..863cfe24ce1 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/restores/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/restores/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/restores/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-06-01/restores/id_recoverypoint_test.go index da9b49a581a..ff387277ecc 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/restores/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/restores/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/restores/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-06-01/restores/model_encryptiondetails.go index 59b1b6b4b01..9351ce35d30 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/restores/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/restores/model_encryptiondetails.go @@ -5,8 +5,8 @@ package restores type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-06-01/validateoperation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-06-01/validateoperation/model_encryptiondetails.go index 68be47387a8..d2830fa3e2f 100644 --- a/resource-manager/recoveryservicesbackup/2023-06-01/validateoperation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-06-01/validateoperation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package validateoperation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backups/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/backups/README.md index fe9a3530b5e..7214129c32a 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backups/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := backups.BackupRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backups/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-08-01/backups/id_protecteditem.go index d2ae31f73b7..d87af28e375 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backups/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backups/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backups/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/backups/id_protecteditem_test.go index e2e6f674f02..bd7b39d1112 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backups/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backups/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/README.md index 721f4601bbf..fbb75abd62a 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := backupstatus.BackupStatusRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/id_location.go b/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/id_location.go index d02657ba9d5..417d5cf70d6 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/id_location_test.go index e7d8236557f..e5365b1bacb 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backupstatus/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/README.md index 3bf648f0c7e..79c1f35f9b5 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") // alternatively `client.List(ctx, id, backupworkloaditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, backupworkloaditems.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/id_protectioncontainer.go index 9bb5618cef5..f6bef435f47 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/id_protectioncontainer_test.go index 43ee087967c..f2b0acee461 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/backupworkloaditems/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/README.md index ade376a3d9e..cae4138ae5e 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := featuresupport.FeatureSupportRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/id_location.go b/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/id_location.go index f7289f3672a..8347c40e5d8 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/id_location_test.go index fe32a9ad6ca..c8e2c22eea9 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/featuresupport/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/README.md index 738ed4b644c..4180dd6436e 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := itemlevelrecoveryconnections.ILRRequestResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Revoke(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/id_recoverypoint.go index 0781239cfa9..603b7af1848 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/id_recoverypoint_test.go index 575e12afc38..c7c6bf018c1 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/itemlevelrecoveryconnections/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/jobcancellations/id_backupjob.go b/resource-manager/recoveryservicesbackup/2023-08-01/jobcancellations/id_backupjob.go index 550aa4cb7b0..fda0835fc5f 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/jobcancellations/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/jobcancellations/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/jobcancellations/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/jobcancellations/id_backupjob_test.go index a75d87968fc..dc12aed1885 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/jobcancellations/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/jobcancellations/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/README.md index 8ac091c15f5..f95767f37cb 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") +id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/id_backupjob.go b/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/id_backupjob.go index 5eab7c1978d..68dd9a83910 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/id_backupjob_test.go index 5dd7cf71834..7623e595a78 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/jobdetails/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/operation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-08-01/operation/model_encryptiondetails.go index 64f3372dbd2..503730b066e 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/operation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/operation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package operation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/README.md index b61f0bee483..6785bb6673a 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") // alternatively `client.List(ctx, id, protectablecontainers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, protectablecontainers.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/id_backupfabric.go index 3784727afb6..6771b5d5025 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/id_backupfabric_test.go index 4053561325f..1d43607add8 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectablecontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/README.md index f9e6c6abf2b..0b8f3184136 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := protecteditems.ProtectedItemResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Get(ctx, id, protecteditems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/id_protecteditem.go index 798b6fd09f4..34219b2c35c 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/id_protecteditem_test.go index e943367b75b..821001a86bb 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protecteditems/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/README.md index 9d25068c241..68f9113b90c 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Inquire(ctx, id, protectioncontainers.DefaultInquireOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") read, err := client.Refresh(ctx, id, protectioncontainers.DefaultRefreshOperationOptions()) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") payload := protectioncontainers.ProtectionContainerResource{ // ... @@ -89,7 +89,7 @@ if err := client.RegisterThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_backupfabric.go index 50fea36c062..54027e95d42 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_backupfabric_test.go index 9421cd390bd..b5023fb6f57 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_protectioncontainer.go index 973b1512a4f..24b0d188190 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_protectioncontainer_test.go index 12b6ba48143..e8420b88b27 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectioncontainers/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/README.md index 4308b847666..94cba5d3e12 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") payload := protectionintent.ProtectionIntentResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := protectionintent.PreValidateEnableBackupRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_backupprotectionintent.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_backupprotectionintent.go index 3851befce31..688d4fb97af 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_backupprotectionintent.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_backupprotectionintent.go @@ -129,9 +129,9 @@ func (id BackupProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticBackupProtectionIntent", "backupProtectionIntent", "backupProtectionIntent"), - resourceids.UserSpecifiedSegment("backupProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("backupProtectionIntentName", "backupProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_backupprotectionintent_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_backupprotectionintent_test.go index f93903502d9..b2fd670a103 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_backupprotectionintent_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_backupprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupProtectionIntentId{} func TestNewBackupProtectionIntentID(t *testing.T) { - id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") + id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewBackupProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.BackupProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "intentObjectName") + if id.BackupProtectionIntentName != "backupProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "backupProtectionIntentName") } } func TestFormatBackupProtectionIntentID(t *testing.T) { - actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName" + actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseBackupProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseBackupProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - BackupProtectionIntentName: "iNtEnToBjEcTnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", + BackupProtectionIntentName: "bAcKuPpRoTeCtIoNiNtEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_location.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_location.go index a1f3cf24127..98c32ddf030 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_location.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_location_test.go index fcf8939ab21..091fdeda511 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectionintent/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/README.md index 5dd1a9614a7..bae742af6c4 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") payload := protectionpolicies.ProtectionPolicyResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/id_backuppolicy.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/id_backuppolicy.go index 80fa7d63446..238e1a3ecf0 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/id_backuppolicy.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/id_backuppolicy.go @@ -123,7 +123,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), - resourceids.UserSpecifiedSegment("backupPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/id_backuppolicy_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/id_backuppolicy_test.go index 5bc2eaff079..ee84948a820 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/id_backuppolicy_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/protectionpolicies/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "policyName") + if id.BackupPolicyName != "backupPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "backupPolicyName") } } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupPolicyName: "pOlIcYnAmE", + BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/README.md index e4cf4a4615e..df7f4d04070 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := recoverypoint.MoveRPAcrossTiersRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/id_recoverypoint.go index d9a074c3ddb..f39e95f0719 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/id_recoverypoint_test.go index c499cb3ef90..d06d7a3f935 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoint/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/README.md index a468ea89787..de5e0880222 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") // alternatively `client.List(ctx, id, recoverypoints.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recoverypoints.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_protecteditem.go index 371d5ec307e..415fce0b13f 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_protecteditem_test.go index 4713cbed57b..4d122dc61d0 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_recoverypoint.go index 08495682780..3aa99fb455d 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_recoverypoint_test.go index 7fbbc9dcb5a..29d6cf0e70f 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/model_bekdetails.go index 36772ad0169..66e779c1d33 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/model_kekdetails.go index 36abbae9609..500357083c8 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypoints/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/README.md index 9ec1431fe06..99144c1ca1e 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := recoverypointsrecommendedformove.ListRecoveryPointsRecommendedForMoveRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/id_protecteditem.go index b33a7422713..de5eadab57a 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/id_protecteditem_test.go index ee0d63cc06b..9418ddc0c75 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/model_bekdetails.go index 2060eb3fa42..d27d63b2bdb 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/model_kekdetails.go index a3aeb5f2512..4c54e953bf4 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/recoverypointsrecommendedformove/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/README.md index 0d3b7b1db65..5f855bf9724 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.ResourceGuardProxyBaseResource{ // ... @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.UnlockDeleteRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/id_backupresourceguardproxy.go b/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/id_backupresourceguardproxy.go index 36be3b2da74..0b39ee42460 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/id_backupresourceguardproxy.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/id_backupresourceguardproxy.go @@ -123,7 +123,7 @@ func (id BackupResourceGuardProxyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupResourceGuardProxies", "backupResourceGuardProxies", "backupResourceGuardProxies"), - resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "resourceGuardProxyName"), + resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "backupResourceGuardProxyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/id_backupresourceguardproxy_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/id_backupresourceguardproxy_test.go index 85bcc507604..f1e9dde384a 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/id_backupresourceguardproxy_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/resourceguardproxy/id_backupresourceguardproxy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupResourceGuardProxyId{} func TestNewBackupResourceGuardProxyID(t *testing.T) { - id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") + id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupResourceGuardProxyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupResourceGuardProxyName != "resourceGuardProxyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "resourceGuardProxyName") + if id.BackupResourceGuardProxyName != "backupResourceGuardProxyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "backupResourceGuardProxyName") } } func TestFormatBackupResourceGuardProxyID(t *testing.T) { - actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName" + actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupResourceGuardProxyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupResourceGuardProxyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupResourceGuardProxyName: "rEsOuRcEgUaRdPrOxYnAmE", + BackupResourceGuardProxyName: "bAcKuPrEsOuRcEgUaRdPrOxYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/restores/README.md b/resource-manager/recoveryservicesbackup/2023-08-01/restores/README.md index b67b5cad075..2e190417ccc 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/restores/README.md +++ b/resource-manager/recoveryservicesbackup/2023-08-01/restores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := restores.RestoreRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/restores/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-08-01/restores/id_recoverypoint.go index ce494aed2e6..863cfe24ce1 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/restores/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/restores/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/restores/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-08-01/restores/id_recoverypoint_test.go index da9b49a581a..ff387277ecc 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/restores/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/restores/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/restores/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-08-01/restores/model_encryptiondetails.go index 59b1b6b4b01..9351ce35d30 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/restores/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/restores/model_encryptiondetails.go @@ -5,8 +5,8 @@ package restores type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2023-08-01/validateoperation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-08-01/validateoperation/model_encryptiondetails.go index 68be47387a8..d2830fa3e2f 100644 --- a/resource-manager/recoveryservicesbackup/2023-08-01/validateoperation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2023-08-01/validateoperation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package validateoperation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backups/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/backups/README.md index f114316e6ce..d4558413102 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backups/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := backups.BackupRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backups/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-01-01/backups/id_protecteditem.go index d2ae31f73b7..d87af28e375 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backups/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backups/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backups/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/backups/id_protecteditem_test.go index e2e6f674f02..bd7b39d1112 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backups/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backups/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/README.md index c96aa8d3969..11e0068da7e 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := backupstatus.BackupStatusRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/id_location.go b/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/id_location.go index d02657ba9d5..417d5cf70d6 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/id_location_test.go index e7d8236557f..e5365b1bacb 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backupstatus/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/README.md index 7cf4711f499..50b6fe97dd3 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") // alternatively `client.List(ctx, id, backupworkloaditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, backupworkloaditems.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/id_protectioncontainer.go index 9bb5618cef5..f6bef435f47 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/id_protectioncontainer_test.go index 43ee087967c..f2b0acee461 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/backupworkloaditems/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/README.md index 198d66e5d42..f562c961e2e 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := featuresupport.FeatureSupportRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/id_location.go b/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/id_location.go index f7289f3672a..8347c40e5d8 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/id_location_test.go index fe32a9ad6ca..c8e2c22eea9 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/featuresupport/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/README.md index 4d5c89c513a..606f2d9ffc9 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := itemlevelrecoveryconnections.ILRRequestResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Revoke(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/id_recoverypoint.go index 0781239cfa9..603b7af1848 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/id_recoverypoint_test.go index 575e12afc38..c7c6bf018c1 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/itemlevelrecoveryconnections/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/jobcancellations/id_backupjob.go b/resource-manager/recoveryservicesbackup/2024-01-01/jobcancellations/id_backupjob.go index 550aa4cb7b0..fda0835fc5f 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/jobcancellations/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/jobcancellations/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/jobcancellations/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/jobcancellations/id_backupjob_test.go index a75d87968fc..dc12aed1885 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/jobcancellations/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/jobcancellations/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/README.md index 21ae6c1460b..e5e849c5465 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") +id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/id_backupjob.go b/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/id_backupjob.go index 5eab7c1978d..68dd9a83910 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/id_backupjob_test.go index 5dd7cf71834..7623e595a78 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/jobdetails/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/operation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-01-01/operation/model_encryptiondetails.go index 64f3372dbd2..503730b066e 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/operation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/operation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package operation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/README.md index 725a488d492..eca329f3612 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") // alternatively `client.List(ctx, id, protectablecontainers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, protectablecontainers.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/id_backupfabric.go index 3784727afb6..6771b5d5025 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/id_backupfabric_test.go index 4053561325f..1d43607add8 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectablecontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/README.md index ceb0c118677..7a987d13f9b 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := protecteditems.ProtectedItemResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Get(ctx, id, protecteditems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/id_protecteditem.go index 798b6fd09f4..34219b2c35c 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/id_protecteditem_test.go index e943367b75b..821001a86bb 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protecteditems/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/README.md index e59c4717f5e..149f6a4f3a9 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Inquire(ctx, id, protectioncontainers.DefaultInquireOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") read, err := client.Refresh(ctx, id, protectioncontainers.DefaultRefreshOperationOptions()) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") payload := protectioncontainers.ProtectionContainerResource{ // ... @@ -89,7 +89,7 @@ if err := client.RegisterThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_backupfabric.go index 50fea36c062..54027e95d42 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_backupfabric_test.go index 9421cd390bd..b5023fb6f57 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_protectioncontainer.go index 973b1512a4f..24b0d188190 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_protectioncontainer_test.go index 12b6ba48143..e8420b88b27 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectioncontainers/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/README.md index 3e7137d8b7c..f667b7b260e 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") payload := protectionintent.ProtectionIntentResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := protectionintent.PreValidateEnableBackupRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_backupprotectionintent.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_backupprotectionintent.go index 3851befce31..688d4fb97af 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_backupprotectionintent.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_backupprotectionintent.go @@ -129,9 +129,9 @@ func (id BackupProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticBackupProtectionIntent", "backupProtectionIntent", "backupProtectionIntent"), - resourceids.UserSpecifiedSegment("backupProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("backupProtectionIntentName", "backupProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_backupprotectionintent_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_backupprotectionintent_test.go index f93903502d9..b2fd670a103 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_backupprotectionintent_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_backupprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupProtectionIntentId{} func TestNewBackupProtectionIntentID(t *testing.T) { - id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") + id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewBackupProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.BackupProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "intentObjectName") + if id.BackupProtectionIntentName != "backupProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "backupProtectionIntentName") } } func TestFormatBackupProtectionIntentID(t *testing.T) { - actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName" + actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseBackupProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseBackupProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - BackupProtectionIntentName: "iNtEnToBjEcTnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", + BackupProtectionIntentName: "bAcKuPpRoTeCtIoNiNtEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_location.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_location.go index a1f3cf24127..98c32ddf030 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_location_test.go index fcf8939ab21..091fdeda511 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectionintent/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/README.md index 47701270c5a..379ba27fb07 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") payload := protectionpolicies.ProtectionPolicyResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/id_backuppolicy.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/id_backuppolicy.go index 80fa7d63446..238e1a3ecf0 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/id_backuppolicy.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/id_backuppolicy.go @@ -123,7 +123,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), - resourceids.UserSpecifiedSegment("backupPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/id_backuppolicy_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/id_backuppolicy_test.go index 5bc2eaff079..ee84948a820 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/id_backuppolicy_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/protectionpolicies/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "policyName") + if id.BackupPolicyName != "backupPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "backupPolicyName") } } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupPolicyName: "pOlIcYnAmE", + BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/README.md index 94399df2c7d..18ea28d431e 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := recoverypoint.MoveRPAcrossTiersRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/id_recoverypoint.go index d9a074c3ddb..f39e95f0719 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/id_recoverypoint_test.go index c499cb3ef90..d06d7a3f935 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoint/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/README.md index bb0b3f4959e..45205b1206c 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") // alternatively `client.List(ctx, id, recoverypoints.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recoverypoints.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_protecteditem.go index 371d5ec307e..415fce0b13f 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_protecteditem_test.go index 4713cbed57b..4d122dc61d0 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_recoverypoint.go index 08495682780..3aa99fb455d 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_recoverypoint_test.go index 7fbbc9dcb5a..29d6cf0e70f 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/model_bekdetails.go index 36772ad0169..66e779c1d33 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/model_kekdetails.go index 36abbae9609..500357083c8 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypoints/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/README.md index 977f7688f72..b9ead88a10c 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := recoverypointsrecommendedformove.ListRecoveryPointsRecommendedForMoveRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/id_protecteditem.go index b33a7422713..de5eadab57a 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/id_protecteditem_test.go index ee0d63cc06b..9418ddc0c75 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/model_bekdetails.go index 2060eb3fa42..d27d63b2bdb 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/model_kekdetails.go index a3aeb5f2512..4c54e953bf4 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/recoverypointsrecommendedformove/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/README.md index 1294cff8e27..cd60da294e7 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.ResourceGuardProxyBaseResource{ // ... @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.UnlockDeleteRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/id_backupresourceguardproxy.go b/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/id_backupresourceguardproxy.go index 36be3b2da74..0b39ee42460 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/id_backupresourceguardproxy.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/id_backupresourceguardproxy.go @@ -123,7 +123,7 @@ func (id BackupResourceGuardProxyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupResourceGuardProxies", "backupResourceGuardProxies", "backupResourceGuardProxies"), - resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "resourceGuardProxyName"), + resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "backupResourceGuardProxyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/id_backupresourceguardproxy_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/id_backupresourceguardproxy_test.go index 85bcc507604..f1e9dde384a 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/id_backupresourceguardproxy_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/resourceguardproxy/id_backupresourceguardproxy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupResourceGuardProxyId{} func TestNewBackupResourceGuardProxyID(t *testing.T) { - id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") + id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupResourceGuardProxyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupResourceGuardProxyName != "resourceGuardProxyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "resourceGuardProxyName") + if id.BackupResourceGuardProxyName != "backupResourceGuardProxyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "backupResourceGuardProxyName") } } func TestFormatBackupResourceGuardProxyID(t *testing.T) { - actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName" + actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupResourceGuardProxyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupResourceGuardProxyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupResourceGuardProxyName: "rEsOuRcEgUaRdPrOxYnAmE", + BackupResourceGuardProxyName: "bAcKuPrEsOuRcEgUaRdPrOxYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/restores/README.md b/resource-manager/recoveryservicesbackup/2024-01-01/restores/README.md index 44fc629bfc3..45e1b31f8ee 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/restores/README.md +++ b/resource-manager/recoveryservicesbackup/2024-01-01/restores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := restores.RestoreRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/restores/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-01-01/restores/id_recoverypoint.go index ce494aed2e6..863cfe24ce1 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/restores/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/restores/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/restores/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-01-01/restores/id_recoverypoint_test.go index da9b49a581a..ff387277ecc 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/restores/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/restores/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/restores/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-01-01/restores/model_encryptiondetails.go index 59b1b6b4b01..9351ce35d30 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/restores/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/restores/model_encryptiondetails.go @@ -5,8 +5,8 @@ package restores type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-01-01/validateoperation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-01-01/validateoperation/model_encryptiondetails.go index 68be47387a8..d2830fa3e2f 100644 --- a/resource-manager/recoveryservicesbackup/2024-01-01/validateoperation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-01-01/validateoperation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package validateoperation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backups/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/backups/README.md index 71f5b16d68f..887ae2bd63f 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backups/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := backups.BackupRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backups/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-02-01/backups/id_protecteditem.go index d2ae31f73b7..d87af28e375 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backups/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backups/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backups/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/backups/id_protecteditem_test.go index e2e6f674f02..bd7b39d1112 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backups/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backups/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/README.md index bfce197637a..8e6cdea1c3c 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := backupstatus.BackupStatusRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/id_location.go b/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/id_location.go index d02657ba9d5..417d5cf70d6 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/id_location_test.go index e7d8236557f..e5365b1bacb 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backupstatus/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/README.md index 384dea99178..872fc6d5300 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") // alternatively `client.List(ctx, id, backupworkloaditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, backupworkloaditems.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/id_protectioncontainer.go index 9bb5618cef5..f6bef435f47 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/id_protectioncontainer_test.go index 43ee087967c..f2b0acee461 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/backupworkloaditems/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/README.md index b9085400b8e..5c8fb0ccfa8 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := featuresupport.FeatureSupportRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/id_location.go b/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/id_location.go index f7289f3672a..8347c40e5d8 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/id_location_test.go index fe32a9ad6ca..c8e2c22eea9 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/featuresupport/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/README.md index 19f9cdcf1e9..d109f7c5dfa 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := itemlevelrecoveryconnections.ILRRequestResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Revoke(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/id_recoverypoint.go index 0781239cfa9..603b7af1848 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/id_recoverypoint_test.go index 575e12afc38..c7c6bf018c1 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/itemlevelrecoveryconnections/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/jobcancellations/id_backupjob.go b/resource-manager/recoveryservicesbackup/2024-02-01/jobcancellations/id_backupjob.go index 550aa4cb7b0..fda0835fc5f 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/jobcancellations/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/jobcancellations/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/jobcancellations/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/jobcancellations/id_backupjob_test.go index a75d87968fc..dc12aed1885 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/jobcancellations/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/jobcancellations/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/README.md index 344e900d5d4..b0ac6d78360 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") +id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/id_backupjob.go b/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/id_backupjob.go index 5eab7c1978d..68dd9a83910 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/id_backupjob_test.go index 5dd7cf71834..7623e595a78 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/jobdetails/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/operation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-02-01/operation/model_encryptiondetails.go index 64f3372dbd2..503730b066e 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/operation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/operation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package operation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/README.md index b08b21dba9f..5005fd24e6c 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") // alternatively `client.List(ctx, id, protectablecontainers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, protectablecontainers.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/id_backupfabric.go index 3784727afb6..6771b5d5025 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/id_backupfabric_test.go index 4053561325f..1d43607add8 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectablecontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/README.md index be4daea4bb4..74d8a003e86 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := protecteditems.ProtectedItemResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Get(ctx, id, protecteditems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/id_protecteditem.go index 798b6fd09f4..34219b2c35c 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/id_protecteditem_test.go index e943367b75b..821001a86bb 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protecteditems/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/README.md index 6189d5b4ce0..4436b54d979 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Inquire(ctx, id, protectioncontainers.DefaultInquireOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") read, err := client.Refresh(ctx, id, protectioncontainers.DefaultRefreshOperationOptions()) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") payload := protectioncontainers.ProtectionContainerResource{ // ... @@ -89,7 +89,7 @@ if err := client.RegisterThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_backupfabric.go index 50fea36c062..54027e95d42 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_backupfabric_test.go index 9421cd390bd..b5023fb6f57 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_protectioncontainer.go index 973b1512a4f..24b0d188190 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_protectioncontainer_test.go index 12b6ba48143..e8420b88b27 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectioncontainers/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/README.md index 709bf8285e6..1e83900b22e 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") payload := protectionintent.ProtectionIntentResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := protectionintent.PreValidateEnableBackupRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_backupprotectionintent.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_backupprotectionintent.go index 3851befce31..688d4fb97af 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_backupprotectionintent.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_backupprotectionintent.go @@ -129,9 +129,9 @@ func (id BackupProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticBackupProtectionIntent", "backupProtectionIntent", "backupProtectionIntent"), - resourceids.UserSpecifiedSegment("backupProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("backupProtectionIntentName", "backupProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_backupprotectionintent_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_backupprotectionintent_test.go index f93903502d9..b2fd670a103 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_backupprotectionintent_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_backupprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupProtectionIntentId{} func TestNewBackupProtectionIntentID(t *testing.T) { - id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") + id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewBackupProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.BackupProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "intentObjectName") + if id.BackupProtectionIntentName != "backupProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "backupProtectionIntentName") } } func TestFormatBackupProtectionIntentID(t *testing.T) { - actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName" + actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseBackupProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseBackupProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - BackupProtectionIntentName: "iNtEnToBjEcTnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", + BackupProtectionIntentName: "bAcKuPpRoTeCtIoNiNtEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_location.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_location.go index a1f3cf24127..98c32ddf030 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_location_test.go index fcf8939ab21..091fdeda511 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectionintent/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/README.md index 3918508c84f..22e0b4e22a1 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") payload := protectionpolicies.ProtectionPolicyResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/id_backuppolicy.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/id_backuppolicy.go index 80fa7d63446..238e1a3ecf0 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/id_backuppolicy.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/id_backuppolicy.go @@ -123,7 +123,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), - resourceids.UserSpecifiedSegment("backupPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/id_backuppolicy_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/id_backuppolicy_test.go index 5bc2eaff079..ee84948a820 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/id_backuppolicy_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/protectionpolicies/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "policyName") + if id.BackupPolicyName != "backupPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "backupPolicyName") } } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupPolicyName: "pOlIcYnAmE", + BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/README.md index 4b1bd368523..28c42a931b7 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := recoverypoint.MoveRPAcrossTiersRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/id_recoverypoint.go index d9a074c3ddb..f39e95f0719 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/id_recoverypoint_test.go index c499cb3ef90..d06d7a3f935 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoint/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/README.md index d3a5417aab6..99c47ce83cd 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") // alternatively `client.List(ctx, id, recoverypoints.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recoverypoints.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_protecteditem.go index 371d5ec307e..415fce0b13f 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_protecteditem_test.go index 4713cbed57b..4d122dc61d0 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_recoverypoint.go index 08495682780..3aa99fb455d 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_recoverypoint_test.go index 7fbbc9dcb5a..29d6cf0e70f 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/model_bekdetails.go index 36772ad0169..66e779c1d33 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/model_kekdetails.go index 36abbae9609..500357083c8 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypoints/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/README.md index b485bdbb1ca..d8a35e5384c 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := recoverypointsrecommendedformove.ListRecoveryPointsRecommendedForMoveRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/id_protecteditem.go index b33a7422713..de5eadab57a 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/id_protecteditem_test.go index ee0d63cc06b..9418ddc0c75 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/model_bekdetails.go index 2060eb3fa42..d27d63b2bdb 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/model_kekdetails.go index a3aeb5f2512..4c54e953bf4 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/recoverypointsrecommendedformove/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/README.md index 067ec2438c3..031a3341e20 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.ResourceGuardProxyBaseResource{ // ... @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.UnlockDeleteRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/id_backupresourceguardproxy.go b/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/id_backupresourceguardproxy.go index 36be3b2da74..0b39ee42460 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/id_backupresourceguardproxy.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/id_backupresourceguardproxy.go @@ -123,7 +123,7 @@ func (id BackupResourceGuardProxyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupResourceGuardProxies", "backupResourceGuardProxies", "backupResourceGuardProxies"), - resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "resourceGuardProxyName"), + resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "backupResourceGuardProxyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/id_backupresourceguardproxy_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/id_backupresourceguardproxy_test.go index 85bcc507604..f1e9dde384a 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/id_backupresourceguardproxy_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/resourceguardproxy/id_backupresourceguardproxy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupResourceGuardProxyId{} func TestNewBackupResourceGuardProxyID(t *testing.T) { - id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") + id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupResourceGuardProxyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupResourceGuardProxyName != "resourceGuardProxyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "resourceGuardProxyName") + if id.BackupResourceGuardProxyName != "backupResourceGuardProxyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "backupResourceGuardProxyName") } } func TestFormatBackupResourceGuardProxyID(t *testing.T) { - actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName" + actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupResourceGuardProxyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupResourceGuardProxyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupResourceGuardProxyName: "rEsOuRcEgUaRdPrOxYnAmE", + BackupResourceGuardProxyName: "bAcKuPrEsOuRcEgUaRdPrOxYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/restores/README.md b/resource-manager/recoveryservicesbackup/2024-02-01/restores/README.md index e782a81fdf3..99dcf8347ca 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/restores/README.md +++ b/resource-manager/recoveryservicesbackup/2024-02-01/restores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := restores.RestoreRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/restores/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-02-01/restores/id_recoverypoint.go index ce494aed2e6..863cfe24ce1 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/restores/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/restores/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/restores/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-02-01/restores/id_recoverypoint_test.go index da9b49a581a..ff387277ecc 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/restores/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/restores/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/restores/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-02-01/restores/model_encryptiondetails.go index 59b1b6b4b01..9351ce35d30 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/restores/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/restores/model_encryptiondetails.go @@ -5,8 +5,8 @@ package restores type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-02-01/validateoperation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-02-01/validateoperation/model_encryptiondetails.go index 68be47387a8..d2830fa3e2f 100644 --- a/resource-manager/recoveryservicesbackup/2024-02-01/validateoperation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-02-01/validateoperation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package validateoperation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backups/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/backups/README.md index 43fe3710d18..8d3e1052aa8 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backups/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := backups.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := backups.BackupRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backups/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-04-01/backups/id_protecteditem.go index d2ae31f73b7..d87af28e375 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backups/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backups/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backups/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/backups/id_protecteditem_test.go index e2e6f674f02..bd7b39d1112 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backups/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backups/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/README.md index 148468fcaaf..ccb2396f977 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := backupstatus.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := backupstatus.BackupStatusRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/id_location.go b/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/id_location.go index d02657ba9d5..417d5cf70d6 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/id_location_test.go index e7d8236557f..e5365b1bacb 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backupstatus/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/README.md index 767edd03eec..243d7642ae0 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := backupworkloaditems.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") // alternatively `client.List(ctx, id, backupworkloaditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, backupworkloaditems.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/id_protectioncontainer.go index 9bb5618cef5..f6bef435f47 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/id_protectioncontainer_test.go index 43ee087967c..f2b0acee461 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/backupworkloaditems/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/README.md index 808f52078a0..12635678da0 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := featuresupport.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := featuresupport.FeatureSupportRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/id_location.go b/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/id_location.go index f7289f3672a..8347c40e5d8 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/id_location_test.go index fe32a9ad6ca..c8e2c22eea9 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/featuresupport/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/README.md index 2a5c48d2f76..e97cc3c819c 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := itemlevelrecoveryconnections.ILRRequestResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := itemlevelrecoveryconnections.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Revoke(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/id_recoverypoint.go index 0781239cfa9..603b7af1848 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/id_recoverypoint_test.go index 575e12afc38..c7c6bf018c1 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/itemlevelrecoveryconnections/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/jobcancellations/id_backupjob.go b/resource-manager/recoveryservicesbackup/2024-04-01/jobcancellations/id_backupjob.go index 550aa4cb7b0..fda0835fc5f 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/jobcancellations/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/jobcancellations/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/jobcancellations/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/jobcancellations/id_backupjob_test.go index a75d87968fc..dc12aed1885 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/jobcancellations/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/jobcancellations/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/README.md index 8a41c68a09c..2531a4e21dd 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") +id := jobdetails.NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/id_backupjob.go b/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/id_backupjob.go index 5eab7c1978d..68dd9a83910 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/id_backupjob.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/id_backupjob.go @@ -123,7 +123,7 @@ func (id BackupJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupJobs", "backupJobs", "backupJobs"), - resourceids.UserSpecifiedSegment("backupJobName", "jobName"), + resourceids.UserSpecifiedSegment("backupJobName", "backupJobName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/id_backupjob_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/id_backupjob_test.go index 5dd7cf71834..7623e595a78 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/id_backupjob_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/jobdetails/id_backupjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupJobId{} func TestNewBackupJobID(t *testing.T) { - id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName") + id := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "jobName") + if id.BackupJobName != "backupJobName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupJobName'", id.BackupJobName, "backupJobName") } } func TestFormatBackupJobID(t *testing.T) { - actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName" + actual := NewBackupJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupJobName: "jobName", + BackupJobName: "backupJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupJobs/backupJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe", Expected: &BackupJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupJobName: "jObNaMe", + BackupJobName: "bAcKuPjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPjObS/bAcKuPjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/operation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-04-01/operation/model_encryptiondetails.go index 64f3372dbd2..503730b066e 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/operation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/operation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package operation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/README.md index 379909c06a7..1ca5aae51d5 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectablecontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") // alternatively `client.List(ctx, id, protectablecontainers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, protectablecontainers.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/id_backupfabric.go index 3784727afb6..6771b5d5025 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/id_backupfabric_test.go index 4053561325f..1d43607add8 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectablecontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/README.md index feec5ae39d8..7ef45cbbdc1 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := protecteditems.ProtectedItemResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := protecteditems.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") read, err := client.Get(ctx, id, protecteditems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/id_protecteditem.go index 798b6fd09f4..34219b2c35c 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/id_protecteditem_test.go index e943367b75b..821001a86bb 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protecteditems/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/README.md index ca9e09d64d0..af3505f514f 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Inquire(ctx, id, protectioncontainers.DefaultInquireOperationOptions()) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") +id := protectioncontainers.NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") read, err := client.Refresh(ctx, id, protectioncontainers.DefaultRefreshOperationOptions()) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") payload := protectioncontainers.ProtectionContainerResource{ // ... @@ -89,7 +89,7 @@ if err := client.RegisterThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") +id := protectioncontainers.NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_backupfabric.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_backupfabric.go index 50fea36c062..54027e95d42 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_backupfabric.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_backupfabric.go @@ -123,7 +123,7 @@ func (id BackupFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_backupfabric_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_backupfabric_test.go index 9421cd390bd..b5023fb6f57 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_backupfabric_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_backupfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupFabricId{} func TestNewBackupFabricID(t *testing.T) { - id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName") + id := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } } func TestFormatBackupFabricID(t *testing.T) { - actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName" + actual := NewBackupFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupFabricID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupFabricIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", + BackupFabricName: "backupFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Expected: &BackupFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_protectioncontainer.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_protectioncontainer.go index 973b1512a4f..24b0d188190 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_protectioncontainer.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_protectioncontainer.go @@ -129,9 +129,9 @@ func (id ProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_protectioncontainer_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_protectioncontainer_test.go index 12b6ba48143..e8420b88b27 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_protectioncontainer_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectioncontainers/id_protectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectionContainerId{} func TestNewProtectionContainerID(t *testing.T) { - id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName") + id := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } } func TestFormatProtectionContainerID(t *testing.T) { - actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName" + actual := NewProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Expected: &ProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/README.md index e485fb931dd..8790a5eca50 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") payload := protectionintent.ProtectionIntentResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") +id := protectionintent.NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") +id := protectionintent.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := protectionintent.PreValidateEnableBackupRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_backupprotectionintent.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_backupprotectionintent.go index 3851befce31..688d4fb97af 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_backupprotectionintent.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_backupprotectionintent.go @@ -129,9 +129,9 @@ func (id BackupProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticBackupProtectionIntent", "backupProtectionIntent", "backupProtectionIntent"), - resourceids.UserSpecifiedSegment("backupProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("backupProtectionIntentName", "backupProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_backupprotectionintent_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_backupprotectionintent_test.go index f93903502d9..b2fd670a103 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_backupprotectionintent_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_backupprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupProtectionIntentId{} func TestNewBackupProtectionIntentID(t *testing.T) { - id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName") + id := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewBackupProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.BackupProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "intentObjectName") + if id.BackupProtectionIntentName != "backupProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupProtectionIntentName'", id.BackupProtectionIntentName, "backupProtectionIntentName") } } func TestFormatBackupProtectionIntentID(t *testing.T) { - actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName" + actual := NewBackupProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "backupProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseBackupProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseBackupProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - BackupProtectionIntentName: "intentObjectName", + BackupFabricName: "backupFabricName", + BackupProtectionIntentName: "backupProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/backupProtectionIntent/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/backupProtectionIntent/backupProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE", Expected: &BackupProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - BackupProtectionIntentName: "iNtEnToBjEcTnAmE", + BackupFabricName: "bAcKuPfAbRiCnAmE", + BackupProtectionIntentName: "bAcKuPpRoTeCtIoNiNtEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/bAcKuPpRoTeCtIoNiNtEnT/bAcKuPpRoTeCtIoNiNtEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_location.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_location.go index a1f3cf24127..98c32ddf030 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_location.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "azureRegion"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_location_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_location_test.go index fcf8939ab21..091fdeda511 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_location_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectionintent/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "azureRegion" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "azureRegion") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "azureRegion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "azureRegion", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/azureRegion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aZuReReGiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/aZuReReGiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/README.md index 768a2edb5de..886000daa8d 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") payload := protectionpolicies.ProtectionPolicyResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") +id := protectionpolicies.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/id_backuppolicy.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/id_backuppolicy.go index 80fa7d63446..238e1a3ecf0 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/id_backuppolicy.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/id_backuppolicy.go @@ -123,7 +123,7 @@ func (id BackupPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), - resourceids.UserSpecifiedSegment("backupPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/id_backuppolicy_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/id_backuppolicy_test.go index 5bc2eaff079..ee84948a820 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/id_backuppolicy_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/protectionpolicies/id_backuppolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupPolicyId{} func TestNewBackupPolicyID(t *testing.T) { - id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName") + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "policyName") + if id.BackupPolicyName != "backupPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "backupPolicyName") } } func TestFormatBackupPolicyID(t *testing.T) { - actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName" + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupPolicyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupPolicyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupPolicyName: "policyName", + BackupPolicyName: "backupPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupPolicies/backupPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE", Expected: &BackupPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupPolicyName: "pOlIcYnAmE", + BackupPolicyName: "bAcKuPpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPpOlIcIeS/bAcKuPpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/README.md index 75ea64acf1f..6b1675e6e35 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoint.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := recoverypoint.MoveRPAcrossTiersRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/id_recoverypoint.go index d9a074c3ddb..f39e95f0719 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/id_recoverypoint_test.go index c499cb3ef90..d06d7a3f935 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoint/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/README.md index 7a4853e6b21..7c3486296be 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypoints.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") // alternatively `client.List(ctx, id, recoverypoints.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, recoverypoints.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_protecteditem.go index 371d5ec307e..415fce0b13f 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_protecteditem_test.go index 4713cbed57b..4d122dc61d0 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_recoverypoint.go index 08495682780..3aa99fb455d 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_recoverypoint_test.go index 7fbbc9dcb5a..29d6cf0e70f 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/model_bekdetails.go index 36772ad0169..66e779c1d33 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/model_kekdetails.go index 36abbae9609..500357083c8 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypoints/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypoints type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/README.md index d2093907362..915e911c857 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") +id := recoverypointsrecommendedformove.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") payload := recoverypointsrecommendedformove.ListRecoveryPointsRecommendedForMoveRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/id_protecteditem.go index b33a7422713..de5eadab57a 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/id_protecteditem.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/id_protecteditem.go @@ -135,9 +135,9 @@ func (id ProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/id_protecteditem_test.go index ee0d63cc06b..9418ddc0c75 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/id_protecteditem_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/id_protecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProtectedItemId{} func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName") + id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -40,8 +40,8 @@ func TestNewProtectedItemID(t *testing.T) { } func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName" + actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Expected: &ProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/model_bekdetails.go index 2060eb3fa42..d27d63b2bdb 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/model_bekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/model_bekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type BEKDetails struct { SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` SecretVaultId *string `json:"secretVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/model_kekdetails.go index a3aeb5f2512..4c54e953bf4 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/model_kekdetails.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/recoverypointsrecommendedformove/model_kekdetails.go @@ -5,6 +5,6 @@ package recoverypointsrecommendedformove type KEKDetails struct { KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` KeyVaultId *string `json:"keyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/README.md index f9a503f01d5..d4cdb23d76a 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.ResourceGuardProxyBaseResource{ // ... @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") +id := resourceguardproxy.NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") payload := resourceguardproxy.UnlockDeleteRequest{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/id_backupresourceguardproxy.go b/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/id_backupresourceguardproxy.go index 36be3b2da74..0b39ee42460 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/id_backupresourceguardproxy.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/id_backupresourceguardproxy.go @@ -123,7 +123,7 @@ func (id BackupResourceGuardProxyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupResourceGuardProxies", "backupResourceGuardProxies", "backupResourceGuardProxies"), - resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "resourceGuardProxyName"), + resourceids.UserSpecifiedSegment("backupResourceGuardProxyName", "backupResourceGuardProxyName"), } } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/id_backupresourceguardproxy_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/id_backupresourceguardproxy_test.go index 85bcc507604..f1e9dde384a 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/id_backupresourceguardproxy_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/resourceguardproxy/id_backupresourceguardproxy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupResourceGuardProxyId{} func TestNewBackupResourceGuardProxyID(t *testing.T) { - id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName") + id := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewBackupResourceGuardProxyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupResourceGuardProxyName != "resourceGuardProxyName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "resourceGuardProxyName") + if id.BackupResourceGuardProxyName != "backupResourceGuardProxyName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupResourceGuardProxyName'", id.BackupResourceGuardProxyName, "backupResourceGuardProxyName") } } func TestFormatBackupResourceGuardProxyID(t *testing.T) { - actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "resourceGuardProxyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName" + actual := NewBackupResourceGuardProxyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupResourceGuardProxyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseBackupResourceGuardProxyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseBackupResourceGuardProxyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupResourceGuardProxyName: "resourceGuardProxyName", + BackupResourceGuardProxyName: "backupResourceGuardProxyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/resourceGuardProxyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupResourceGuardProxies/backupResourceGuardProxyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE", Expected: &BackupResourceGuardProxyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupResourceGuardProxyName: "rEsOuRcEgUaRdPrOxYnAmE", + BackupResourceGuardProxyName: "bAcKuPrEsOuRcEgUaRdPrOxYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/rEsOuRcEgUaRdPrOxYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPrEsOuRcEgUaRdPrOxIeS/bAcKuPrEsOuRcEgUaRdPrOxYnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/restores/README.md b/resource-manager/recoveryservicesbackup/2024-04-01/restores/README.md index 9b077fed5a8..f44d7153c6e 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/restores/README.md +++ b/resource-manager/recoveryservicesbackup/2024-04-01/restores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") +id := restores.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") payload := restores.RestoreRequestResource{ // ... diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/restores/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2024-04-01/restores/id_recoverypoint.go index ce494aed2e6..863cfe24ce1 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/restores/id_recoverypoint.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/restores/id_recoverypoint.go @@ -141,9 +141,9 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVaults", "vaults", "vaults"), resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricName"), resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "containerName"), + resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerName"), resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/restores/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2024-04-01/restores/id_recoverypoint_test.go index da9b49a581a..ff387277ecc 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/restores/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/restores/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.BackupFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "fabricName") + if id.BackupFabricName != "backupFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricName") } - if id.ProtectionContainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "containerName") + if id.ProtectionContainerName != "protectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerName") } if id.ProtectedItemName != "protectedItemName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "fabricName", "containerName", "protectedItemName", "recoveryPointId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "backupFabricName", "protectionContainerName", "protectedItemName", "recoveryPointId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -109,50 +109,50 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, } @@ -305,98 +305,98 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VaultName: "vaultName", - BackupFabricName: "fabricName", - ProtectionContainerName: "containerName", + BackupFabricName: "backupFabricName", + ProtectionContainerName: "protectionContainerName", ProtectedItemName: "protectedItemName", RecoveryPointId: "recoveryPointId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/fabricName/protectionContainers/containerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/backupFabrics/backupFabricName/protectionContainers/protectionContainerName/protectedItems/protectedItemName/recoveryPoints/recoveryPointId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VaultName: "vAuLtNaMe", - BackupFabricName: "fAbRiCnAmE", - ProtectionContainerName: "cOnTaInErNaMe", + BackupFabricName: "bAcKuPfAbRiCnAmE", + ProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", ProtectedItemName: "pRoTeCtEdItEmNaMe", RecoveryPointId: "rEcOvErYpOiNtId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/fAbRiCnAmE/pRoTeCtIoNcOnTaInErS/cOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/bAcKuPfAbRiCs/bAcKuPfAbRiCnAmE/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErNaMe/pRoTeCtEdItEmS/pRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtId/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/restores/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-04-01/restores/model_encryptiondetails.go index 59b1b6b4b01..9351ce35d30 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/restores/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/restores/model_encryptiondetails.go @@ -5,8 +5,8 @@ package restores type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicesbackup/2024-04-01/validateoperation/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2024-04-01/validateoperation/model_encryptiondetails.go index 68be47387a8..d2830fa3e2f 100644 --- a/resource-manager/recoveryservicesbackup/2024-04-01/validateoperation/model_encryptiondetails.go +++ b/resource-manager/recoveryservicesbackup/2024-04-01/validateoperation/model_encryptiondetails.go @@ -5,8 +5,8 @@ package validateoperation type EncryptionDetails struct { EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` + KekURL *string `json:"kekUrl,omitempty"` KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` + SecretKeyURL *string `json:"secretKeyUrl,omitempty"` SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/README.md index a4331507364..bb01e611636 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := migrationrecoverypoints.NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName") +id := migrationrecoverypoints.NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := migrationrecoverypoints.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := migrationrecoverypoints.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") // alternatively `client.ListByReplicationMigrationItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationMigrationItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_migrationrecoverypoint.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_migrationrecoverypoint.go index 752ee034412..f0e9101261c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_migrationrecoverypoint.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_migrationrecoverypoint.go @@ -139,13 +139,13 @@ func (id MigrationRecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), resourceids.StaticSegment("staticMigrationRecoveryPoints", "migrationRecoveryPoints", "migrationRecoveryPoints"), resourceids.UserSpecifiedSegment("migrationRecoveryPointName", "migrationRecoveryPointName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go index 7c74dacadd3..d216774042c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MigrationRecoveryPointId{} func TestNewMigrationRecoveryPointID(t *testing.T) { - id := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName") + id := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewMigrationRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } if id.MigrationRecoveryPointName != "migrationRecoveryPointName" { @@ -44,8 +44,8 @@ func TestNewMigrationRecoveryPointID(t *testing.T) { } func TestFormatMigrationRecoveryPointID(t *testing.T) { - actual := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName" + actual := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseMigrationRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", MigrationRecoveryPointName: "migrationRecoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseMigrationRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", MigrationRecoveryPointName: "migrationRecoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", MigrationRecoveryPointName: "mIgRaTiOnReCoVeRyPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_replicationmigrationitem.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_replicationmigrationitem.go index 027a4d6a709..9ccb9efa50b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_replicationmigrationitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_replicationmigrationitem.go @@ -133,13 +133,13 @@ func (id ReplicationMigrationItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_replicationmigrationitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_replicationmigrationitem_test.go index 24383f205f4..dde2cd4e339 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_replicationmigrationitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/migrationrecoverypoints/id_replicationmigrationitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationMigrationItemId{} func TestNewReplicationMigrationItemID(t *testing.T) { - id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") + id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationMigrationItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } } func TestFormatReplicationMigrationItemID(t *testing.T) { - actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName" + actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationMigrationItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationMigrationItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/README.md index 8af3f4a4889..735d52885e1 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := recoverypoints.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") // alternatively `client.ListByReplicationProtectedItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectedItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_recoverypoint.go index 5c25218f1d4..961edec2d6d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_recoverypoint.go @@ -139,13 +139,13 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), resourceids.UserSpecifiedSegment("recoveryPointName", "recoveryPointName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_recoverypoint_test.go index dd1f423957f..f7195561c72 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } if id.RecoveryPointName != "recoveryPointName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", RecoveryPointName: "rEcOvErYpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_replicationprotecteditem.go index e3bb58daad9..6c0d7acae11 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_replicationprotecteditem_test.go index d7001321908..f60a0f6a4a3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/recoverypoints/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/README.md index b6b903d62e0..fff85e01065 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") +id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") payload := replicationalertsettings.ConfigureAlertRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") +id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationalertsettings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationalertsettings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_replicationalertsetting.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_replicationalertsetting.go index 8a0e7289454..58cedfe08d3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_replicationalertsetting.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_replicationalertsetting.go @@ -121,9 +121,9 @@ func (id ReplicationAlertSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationAlertSettings", "replicationAlertSettings", "replicationAlertSettings"), - resourceids.UserSpecifiedSegment("replicationAlertSettingName", "alertSettingName"), + resourceids.UserSpecifiedSegment("replicationAlertSettingName", "replicationAlertSettingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_replicationalertsetting_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_replicationalertsetting_test.go index f422ed36f3a..56e5094c009 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_replicationalertsetting_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_replicationalertsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationAlertSettingId{} func TestNewReplicationAlertSettingID(t *testing.T) { - id := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") + id := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationAlertSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationAlertSettingName != "alertSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationAlertSettingName'", id.ReplicationAlertSettingName, "alertSettingName") + if id.ReplicationAlertSettingName != "replicationAlertSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationAlertSettingName'", id.ReplicationAlertSettingName, "replicationAlertSettingName") } } func TestFormatReplicationAlertSettingID(t *testing.T) { - actual := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName" + actual := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationAlertSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationAlertSettingName: "alertSettingName", + VaultName: "vaultName", + ReplicationAlertSettingName: "replicationAlertSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationAlertSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationAlertSettingName: "alertSettingName", + VaultName: "vaultName", + ReplicationAlertSettingName: "replicationAlertSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS/aLeRtSeTtInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS/rEpLiCaTiOnAlErTsEtTiNgNaMe", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationAlertSettingName: "aLeRtSeTtInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationAlertSettingName: "rEpLiCaTiOnAlErTsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS/aLeRtSeTtInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS/rEpLiCaTiOnAlErTsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_vault.go index 5959ea2b7ea..4d0e369d238 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_vault_test.go index 76fd493fb3e..9d66b7eb7e7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationalertsettings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/README.md index 94ac05028f6..1e2c3704430 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationappliances.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationappliances.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationappliances.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationappliances.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/id_vault.go index 0b8f2f357fa..840bc253579 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/id_vault_test.go index 440cf83eb99..b55e9882b37 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationappliances/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/README.md index 8dfdbb4447a..3f61ffcfc0b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationevents.NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName") +id := replicationevents.NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationevents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationevents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationevents.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationevents.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_replicationevent.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_replicationevent.go index 8cceef37e74..9a94a8d463c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_replicationevent.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_replicationevent.go @@ -121,9 +121,9 @@ func (id ReplicationEventId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationEvents", "replicationEvents", "replicationEvents"), - resourceids.UserSpecifiedSegment("replicationEventName", "eventName"), + resourceids.UserSpecifiedSegment("replicationEventName", "replicationEventName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_replicationevent_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_replicationevent_test.go index 048f9f24dab..f4be6ef83fd 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_replicationevent_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_replicationevent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationEventId{} func TestNewReplicationEventID(t *testing.T) { - id := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName") + id := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationEventID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationEventName != "eventName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationEventName'", id.ReplicationEventName, "eventName") + if id.ReplicationEventName != "replicationEventName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationEventName'", id.ReplicationEventName, "replicationEventName") } } func TestFormatReplicationEventID(t *testing.T) { - actual := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName" + actual := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationEventID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationEventName: "eventName", + VaultName: "vaultName", + ReplicationEventName: "replicationEventName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationEventIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationEventName: "eventName", + VaultName: "vaultName", + ReplicationEventName: "replicationEventName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs/eVeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs/rEpLiCaTiOnEvEnTnAmE", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationEventName: "eVeNtNaMe", + VaultName: "vAuLtNaMe", + ReplicationEventName: "rEpLiCaTiOnEvEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs/eVeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs/rEpLiCaTiOnEvEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_vault.go index 08164fe4eee..f540d5ea573 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_vault_test.go index 3706228ecd7..fc824ae5e8b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationevents/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/README.md index 881ba8bb483..f380ffa7125 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.CheckConsistencyThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CheckConsistencyThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.FabricCreationInput{ // ... @@ -53,7 +53,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -65,7 +65,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") read, err := client.Get(ctx, id, replicationfabrics.DefaultGetOperationOptions()) if err != nil { @@ -81,7 +81,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationfabrics.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -98,7 +98,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.MigrateToAadThenPoll(ctx, id); err != nil { // handle the error @@ -110,7 +110,7 @@ if err := client.MigrateToAadThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -122,7 +122,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.FailoverProcessServerRequest{ // ... @@ -139,7 +139,7 @@ if err := client.ReassociateGatewayThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.RemoveInfraThenPoll(ctx, id); err != nil { // handle the error @@ -151,7 +151,7 @@ if err := client.RemoveInfraThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.RenewCertificateInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_replicationfabric.go index 543c6b7ed30..020505872b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_replicationfabric_test.go index 6f8bf12bb5f..19edc4fbec2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_vault.go index a26b6403ff5..d5e352feba9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_vault_test.go index 0e25b12412a..a8000d12f4a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationfabrics/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/README.md index 4747b683150..2ed52aaf5a3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if err := client.CancelThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") payload := replicationjobs.JobQueryParameter{ // ... @@ -53,7 +53,7 @@ if err := client.ExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationjobs.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationjobs.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") payload := replicationjobs.ResumeJobParams{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_replicationjob.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_replicationjob.go index 5be22f9f962..4abf5a4a7be 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_replicationjob.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_replicationjob.go @@ -121,9 +121,9 @@ func (id ReplicationJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationJobs", "replicationJobs", "replicationJobs"), - resourceids.UserSpecifiedSegment("replicationJobName", "jobName"), + resourceids.UserSpecifiedSegment("replicationJobName", "replicationJobName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_replicationjob_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_replicationjob_test.go index 96fa5d5e3b9..1f54c3772b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_replicationjob_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_replicationjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationJobId{} func TestNewReplicationJobID(t *testing.T) { - id := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") + id := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationJobName'", id.ReplicationJobName, "jobName") + if id.ReplicationJobName != "replicationJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationJobName'", id.ReplicationJobName, "replicationJobName") } } func TestFormatReplicationJobID(t *testing.T) { - actual := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName" + actual := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationJobName: "jobName", + VaultName: "vaultName", + ReplicationJobName: "replicationJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationJobName: "jobName", + VaultName: "vaultName", + ReplicationJobName: "replicationJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs/rEpLiCaTiOnJoBnAmE", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationJobName: "jObNaMe", + VaultName: "vAuLtNaMe", + ReplicationJobName: "rEpLiCaTiOnJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs/rEpLiCaTiOnJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_vault.go index 9269e4fa589..da6fbb451d2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_vault_test.go index 1ed11cd7739..33e578b5b44 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationjobs/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/README.md index d57584c56a1..b15bf00499a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationlogicalnetworks.NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName") +id := replicationlogicalnetworks.NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationlogicalnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationlogicalnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationfabric.go index 196c6fa3801..cd151e6011f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationfabric_test.go index 345754c84e8..09d32c71688 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go index a00d702ee95..7f9fd6f74ba 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationLogicalNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationLogicalNetworks", "replicationLogicalNetworks", "replicationLogicalNetworks"), - resourceids.UserSpecifiedSegment("replicationLogicalNetworkName", "logicalNetworkName"), + resourceids.UserSpecifiedSegment("replicationLogicalNetworkName", "replicationLogicalNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go index 6a416d05a53..d0a55e18453 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationLogicalNetworkId{} func TestNewReplicationLogicalNetworkID(t *testing.T) { - id := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName") + id := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationLogicalNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationLogicalNetworkName != "logicalNetworkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationLogicalNetworkName'", id.ReplicationLogicalNetworkName, "logicalNetworkName") + if id.ReplicationLogicalNetworkName != "replicationLogicalNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationLogicalNetworkName'", id.ReplicationLogicalNetworkName, "replicationLogicalNetworkName") } } func TestFormatReplicationLogicalNetworkID(t *testing.T) { - actual := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName" + actual := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationLogicalNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationLogicalNetworkName: "logicalNetworkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationLogicalNetworkName: "replicationLogicalNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationLogicalNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationLogicalNetworkName: "logicalNetworkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationLogicalNetworkName: "replicationLogicalNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS/lOgIcAlNeTwOrKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS/rEpLiCaTiOnLoGiCaLnEtWoRkNaMe", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationLogicalNetworkName: "lOgIcAlNeTwOrKnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationLogicalNetworkName: "rEpLiCaTiOnLoGiCaLnEtWoRkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS/lOgIcAlNeTwOrKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS/rEpLiCaTiOnLoGiCaLnEtWoRkNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/README.md index 65be55e4304..1baea7baa66 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.EnableMigrationInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if err := client.DeleteThenPoll(ctx, id, replicationmigrationitems.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, replicationmigrationitems.DefaultDelete ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationmigrationitems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationmigrationitems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationmigrationitems.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationmigrationitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id, replicationmigrationitems.DefaultListByReplicationProtectionContainersOperationOptions())` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id, replicationmigrationitems.DefaultListByReplicationProtectionContainersOperationOptions()) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.MigrateInput{ // ... @@ -120,7 +120,7 @@ if err := client.MigrateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.PauseReplicationInput{ // ... @@ -137,7 +137,7 @@ if err := client.PauseReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.ResumeReplicationInput{ // ... @@ -154,7 +154,7 @@ if err := client.ResumeReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.ResyncInput{ // ... @@ -171,7 +171,7 @@ if err := client.ResyncThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.TestMigrateInput{ // ... @@ -188,7 +188,7 @@ if err := client.TestMigrateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.TestMigrateCleanupInput{ // ... @@ -205,7 +205,7 @@ if err := client.TestMigrateCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.UpdateMigrationItemInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationmigrationitem.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationmigrationitem.go index 349e9ee5fb7..af2c070a6aa 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationmigrationitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationmigrationitem.go @@ -133,13 +133,13 @@ func (id ReplicationMigrationItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationmigrationitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationmigrationitem_test.go index 71602c091d3..3df0ca67a2d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationmigrationitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationmigrationitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationMigrationItemId{} func TestNewReplicationMigrationItemID(t *testing.T) { - id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") + id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationMigrationItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } } func TestFormatReplicationMigrationItemID(t *testing.T) { - actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName" + actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationMigrationItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationMigrationItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationprotectioncontainer.go index 3fd1310f68c..f6b59f9a420 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go index 65fe630e5ef..7d99ad5e9be 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_vault.go index e1c1fa8bcc6..5d25616da85 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_vault_test.go index 807a2b87c52..b0b22c1e6a7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/model_managedruncommandscriptinput.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/model_managedruncommandscriptinput.go index 29941ef4979..5ee3b09a915 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/model_managedruncommandscriptinput.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationmigrationitems/model_managedruncommandscriptinput.go @@ -5,6 +5,6 @@ package replicationmigrationitems type ManagedRunCommandScriptInput struct { ScriptParameters string `json:"scriptParameters"` - ScriptUrl string `json:"scriptUrl"` + ScriptURL string `json:"scriptUrl"` StepName string `json:"stepName"` } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/README.md index 05e1f9491ed..93bb015ea76 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") payload := replicationnetworkmappings.CreateNetworkMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationnetworkmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") +id := replicationnetworkmappings.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") // alternatively `client.ListByReplicationNetworks(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationNetworksComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") payload := replicationnetworkmappings.UpdateNetworkMappingInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetwork.go index ee4dfc3a51f..bc0a19b4b6e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetwork_test.go index 3120f4e7ba8..82963269f22 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkId{} func TestNewReplicationNetworkID(t *testing.T) { - id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") + id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } } func TestFormatReplicationNetworkID(t *testing.T) { - actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName" + actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetworkmapping.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetworkmapping.go index b2735d87b57..f35ea2e5232 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetworkmapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetworkmapping.go @@ -133,13 +133,13 @@ func (id ReplicationNetworkMappingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), resourceids.StaticSegment("staticReplicationNetworkMappings", "replicationNetworkMappings", "replicationNetworkMappings"), - resourceids.UserSpecifiedSegment("replicationNetworkMappingName", "networkMappingName"), + resourceids.UserSpecifiedSegment("replicationNetworkMappingName", "replicationNetworkMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go index 6f7602aef17..1d386c1e039 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkMappingId{} func TestNewReplicationNetworkMappingID(t *testing.T) { - id := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") + id := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationNetworkMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } - if id.ReplicationNetworkMappingName != "networkMappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkMappingName'", id.ReplicationNetworkMappingName, "networkMappingName") + if id.ReplicationNetworkMappingName != "replicationNetworkMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkMappingName'", id.ReplicationNetworkMappingName, "replicationNetworkMappingName") } } func TestFormatReplicationNetworkMappingID(t *testing.T) { - actual := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName" + actual := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationNetworkMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", - ReplicationNetworkMappingName: "networkMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", + ReplicationNetworkMappingName: "replicationNetworkMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationNetworkMappingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", - ReplicationNetworkMappingName: "networkMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", + ReplicationNetworkMappingName: "replicationNetworkMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS/nEtWoRkMaPpInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS/rEpLiCaTiOnNeTwOrKmApPiNgNaMe", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", - ReplicationNetworkMappingName: "nEtWoRkMaPpInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", + ReplicationNetworkMappingName: "rEpLiCaTiOnNeTwOrKmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS/nEtWoRkMaPpInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS/rEpLiCaTiOnNeTwOrKmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_vault.go index ebfe061bdb2..5cecc8e3e7f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_vault_test.go index b24f77c90b4..0403f3ac48e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworkmappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/README.md index 443e12bb3dd..48966440192 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationnetworks.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") +id := replicationnetworks.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationnetworks.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationnetworks.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationfabric.go index f2b991fe1ea..a8c98a7e306 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationfabric_test.go index 7adf449d0ed..e06cfc4dd1a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationnetwork.go index 56d0fe3f65f..edf86f27ed8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationnetwork_test.go index 78fd36447b1..876c102db90 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_replicationnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkId{} func TestNewReplicationNetworkID(t *testing.T) { - id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") + id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } } func TestFormatReplicationNetworkID(t *testing.T) { - actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName" + actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_vault.go index 9819f106905..57c8e9dba03 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_vault_test.go index 523f645b8f6..4baea566f21 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationnetworks/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/README.md index 499d7b6d2a8..ea9e46efcdc 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") payload := replicationpolicies.CreatePolicyInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationpolicies.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") payload := replicationpolicies.UpdatePolicyInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_replicationpolicy.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_replicationpolicy.go index bfa93e62ba4..8e52815a483 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_replicationpolicy.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_replicationpolicy.go @@ -121,9 +121,9 @@ func (id ReplicationPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationPolicies", "replicationPolicies", "replicationPolicies"), - resourceids.UserSpecifiedSegment("replicationPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("replicationPolicyName", "replicationPolicyName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_replicationpolicy_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_replicationpolicy_test.go index 0af62e99af0..a22bec723f0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_replicationpolicy_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_replicationpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationPolicyId{} func TestNewReplicationPolicyID(t *testing.T) { - id := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") + id := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationPolicyName'", id.ReplicationPolicyName, "policyName") + if id.ReplicationPolicyName != "replicationPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationPolicyName'", id.ReplicationPolicyName, "replicationPolicyName") } } func TestFormatReplicationPolicyID(t *testing.T) { - actual := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName" + actual := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationPolicyName: "policyName", + VaultName: "vaultName", + ReplicationPolicyName: "replicationPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationPolicyName: "policyName", + VaultName: "vaultName", + ReplicationPolicyName: "replicationPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs/rEpLiCaTiOnPoLiCyNaMe", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationPolicyName: "pOlIcYnAmE", + VaultName: "vAuLtNaMe", + ReplicationPolicyName: "rEpLiCaTiOnPoLiCyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs/rEpLiCaTiOnPoLiCyNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_vault.go index 31f525956e7..e16dd3da492 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_vault_test.go index df63447ec2e..8c7119dc1f2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationpolicies/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/README.md index 733d7c33e71..4c46b664f4b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectableitems.NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName") +id := replicationprotectableitems.NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectableitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectableitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id, replicationprotectableitems.DefaultListByReplicationProtectionContainersOperationOptions())` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id, replicationprotectableitems.DefaultListByReplicationProtectionContainersOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectableitem.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectableitem.go index 063a750b792..5688af5bd49 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectableitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectableitem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectableItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectableItems", "replicationProtectableItems", "replicationProtectableItems"), - resourceids.UserSpecifiedSegment("replicationProtectableItemName", "protectableItemName"), + resourceids.UserSpecifiedSegment("replicationProtectableItemName", "replicationProtectableItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectableitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectableitem_test.go index bd8b1ae136d..5ca442edaf4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectableitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectableitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectableItemId{} func TestNewReplicationProtectableItemID(t *testing.T) { - id := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName") + id := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectableItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectableItemName != "protectableItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectableItemName'", id.ReplicationProtectableItemName, "protectableItemName") + if id.ReplicationProtectableItemName != "replicationProtectableItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectableItemName'", id.ReplicationProtectableItemName, "replicationProtectableItemName") } } func TestFormatReplicationProtectableItemID(t *testing.T) { - actual := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName" + actual := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectableItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectableItemName: "protectableItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectableItemName: "replicationProtectableItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectableItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectableItemName: "protectableItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectableItemName: "replicationProtectableItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs/pRoTeCtAbLeItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs/rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectableItemName: "pRoTeCtAbLeItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectableItemName: "rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs/pRoTeCtAbLeItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs/rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectioncontainer.go index dd994133f3e..f23f4dd7edc 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go index f8737867968..34d92bb2295 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/README.md index 4f6fe65061c..fba3da54625 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.AddDisksInput{ // ... @@ -41,7 +41,7 @@ if err := client.AddDisksThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ApplyRecoveryPointInput{ // ... @@ -58,7 +58,7 @@ if err := client.ApplyRecoveryPointThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.EnableProtectionInput{ // ... @@ -75,7 +75,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.DisableProtectionInput{ // ... @@ -92,7 +92,7 @@ if err := client.DeleteThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.FailoverCancelThenPoll(ctx, id); err != nil { // handle the error @@ -104,7 +104,7 @@ if err := client.FailoverCancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.FailoverCommitThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.FailoverCommitThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") read, err := client.Get(ctx, id) if err != nil { @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotecteditems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationprotecteditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationprotecteditems.DefaultListOperationOptions()) @@ -149,7 +149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotecteditems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id) @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.PlannedFailoverInput{ // ... @@ -183,7 +183,7 @@ if err := client.PlannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -195,7 +195,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.RemoveDisksInput{ // ... @@ -212,7 +212,7 @@ if err := client.RemoveDisksThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.RepairReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -224,7 +224,7 @@ if err := client.RepairReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ReverseReplicationInput{ // ... @@ -241,7 +241,7 @@ if err := client.ReprotectThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ResolveHealthInput{ // ... @@ -258,7 +258,7 @@ if err := client.ResolveHealthErrorsThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.SwitchProviderInput{ // ... @@ -275,7 +275,7 @@ if err := client.SwitchProviderThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.TestFailoverInput{ // ... @@ -292,7 +292,7 @@ if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.TestFailoverCleanupInput{ // ... @@ -309,7 +309,7 @@ if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UnplannedFailoverInput{ // ... @@ -326,7 +326,7 @@ if err := client.UnplannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateReplicationProtectedItemInput{ // ... @@ -343,7 +343,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateApplianceForReplicationProtectedItemInput{ // ... @@ -360,7 +360,7 @@ if err := client.UpdateApplianceThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateMobilityServiceRequest{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotecteditem.go index 619562136d7..ec2c5d221c2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotecteditem_test.go index 606f34b42bd..af1be070147 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotectioncontainer.go index 3b60acb0471..90d3e87f91d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go index 839ec0dfc63..6a6c47d5d94 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_vault.go index 4c54630eaad..35eb0fa0277 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_vault_test.go index abe1e462a85..85390476d93 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotecteditems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/README.md index 5a93ff8ffc1..03516f01277 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.CreateProtectionContainerMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.RemoveProtectionContainerMappingInput{ // ... @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectioncontainermappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -120,7 +120,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.UpdateProtectionContainerMappingInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go index ee9a5b2733d..61b19e9b5bb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go index 7ecbdb77424..054eecca438 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go index 1fbd79d1a44..2b2e19aec67 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go @@ -133,13 +133,13 @@ func (id ReplicationProtectionContainerMappingId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionContainerMappings", "replicationProtectionContainerMappings", "replicationProtectionContainerMappings"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerMappingName", "mappingName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerMappingName", "replicationProtectionContainerMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go index de38e43ce9b..3da16c9dc30 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerMappingId{} func TestNewReplicationProtectionContainerMappingID(t *testing.T) { - id := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") + id := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectionContainerMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectionContainerMappingName != "mappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerMappingName'", id.ReplicationProtectionContainerMappingName, "mappingName") + if id.ReplicationProtectionContainerMappingName != "replicationProtectionContainerMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerMappingName'", id.ReplicationProtectionContainerMappingName, "replicationProtectionContainerMappingName") } } func TestFormatReplicationProtectionContainerMappingID(t *testing.T) { - actual := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName" + actual := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectionContainerMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectionContainerMappingName: "mappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectionContainerMappingName: "replicationProtectionContainerMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectionContainerMappingIDInsensitively(t *testing.T) }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectionContainerMappingName: "mappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectionContainerMappingName: "replicationProtectionContainerMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/mApPiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectionContainerMappingName: "mApPiNgNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectionContainerMappingName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/mApPiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_vault.go index 067641d7f6b..732e128c07b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_vault_test.go index 1aa940e3c6b..5d5304ccb76 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainermappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/README.md index 7542cd96811..ecf2a18340c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.CreateProtectionContainerInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.DiscoverProtectableItemRequest{ // ... @@ -70,7 +70,7 @@ if err := client.DiscoverProtectableItemThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectioncontainers.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationprotectioncontainers.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.SwitchProtectionInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationfabric.go index 976708ca52d..3bd079512ad 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationfabric_test.go index 0c8da3dd020..4bf4be40c8e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go index b8d2d8fb70a..e5592319c54 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go index 508844b562b..a91ca97cb10 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_vault.go index f5f018b0031..8bf89545d20 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_vault_test.go index 299181333ca..4d480e32c58 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectioncontainers/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/README.md index 1520f715332..736e52e1335 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") +id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") payload := replicationprotectionintents.CreateProtectionIntentInput{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") +id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectionintents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectionintents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationprotectionintents.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationprotectionintents.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_replicationprotectionintent.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_replicationprotectionintent.go index dad9f6c7fad..78e9627f11f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_replicationprotectionintent.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_replicationprotectionintent.go @@ -121,9 +121,9 @@ func (id ReplicationProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationProtectionIntents", "replicationProtectionIntents", "replicationProtectionIntents"), - resourceids.UserSpecifiedSegment("replicationProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("replicationProtectionIntentName", "replicationProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_replicationprotectionintent_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_replicationprotectionintent_test.go index 07e75f6ffa0..b3dedc733d4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_replicationprotectionintent_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_replicationprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionIntentId{} func TestNewReplicationProtectionIntentID(t *testing.T) { - id := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") + id := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionIntentName'", id.ReplicationProtectionIntentName, "intentObjectName") + if id.ReplicationProtectionIntentName != "replicationProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionIntentName'", id.ReplicationProtectionIntentName, "replicationProtectionIntentName") } } func TestFormatReplicationProtectionIntentID(t *testing.T) { - actual := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName" + actual := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationProtectionIntentName: "intentObjectName", + VaultName: "vaultName", + ReplicationProtectionIntentName: "replicationProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationProtectionIntentName: "intentObjectName", + VaultName: "vaultName", + ReplicationProtectionIntentName: "replicationProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS/rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationProtectionIntentName: "iNtEnToBjEcTnAmE", + VaultName: "vAuLtNaMe", + ReplicationProtectionIntentName: "rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS/rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_vault.go index 8c17143fbef..4df44daf2b0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_vault_test.go index 851c0416ea7..deb409a106d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationprotectionintents/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/README.md index 3624bde1e67..3ea24afce23 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.CreateRecoveryPlanInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.FailoverCancelThenPoll(ctx, id); err != nil { // handle the error @@ -65,7 +65,7 @@ if err := client.FailoverCancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.FailoverCommitThenPoll(ctx, id); err != nil { // handle the error @@ -77,7 +77,7 @@ if err := client.FailoverCommitThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") read, err := client.Get(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationrecoveryplans.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanPlannedFailoverInput{ // ... @@ -127,7 +127,7 @@ if err := client.PlannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.ReprotectThenPoll(ctx, id); err != nil { // handle the error @@ -139,7 +139,7 @@ if err := client.ReprotectThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanTestFailoverInput{ // ... @@ -156,7 +156,7 @@ if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanTestFailoverCleanupInput{ // ... @@ -173,7 +173,7 @@ if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanUnplannedFailoverInput{ // ... @@ -190,7 +190,7 @@ if err := client.UnplannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.UpdateRecoveryPlanInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_replicationrecoveryplan.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_replicationrecoveryplan.go index b1d8edc1b99..02aef0ff679 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_replicationrecoveryplan.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_replicationrecoveryplan.go @@ -121,9 +121,9 @@ func (id ReplicationRecoveryPlanId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationRecoveryPlans", "replicationRecoveryPlans", "replicationRecoveryPlans"), - resourceids.UserSpecifiedSegment("replicationRecoveryPlanName", "recoveryPlanName"), + resourceids.UserSpecifiedSegment("replicationRecoveryPlanName", "replicationRecoveryPlanName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go index 3785a66bf52..64c0aac5f20 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationRecoveryPlanId{} func TestNewReplicationRecoveryPlanID(t *testing.T) { - id := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") + id := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationRecoveryPlanID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationRecoveryPlanName != "recoveryPlanName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryPlanName'", id.ReplicationRecoveryPlanName, "recoveryPlanName") + if id.ReplicationRecoveryPlanName != "replicationRecoveryPlanName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryPlanName'", id.ReplicationRecoveryPlanName, "replicationRecoveryPlanName") } } func TestFormatReplicationRecoveryPlanID(t *testing.T) { - actual := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName" + actual := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationRecoveryPlanID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationRecoveryPlanName: "recoveryPlanName", + VaultName: "vaultName", + ReplicationRecoveryPlanName: "replicationRecoveryPlanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationRecoveryPlanIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationRecoveryPlanName: "recoveryPlanName", + VaultName: "vaultName", + ReplicationRecoveryPlanName: "replicationRecoveryPlanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS/rEcOvErYpLaNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS/rEpLiCaTiOnReCoVeRyPlAnNaMe", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationRecoveryPlanName: "rEcOvErYpLaNnAmE", + VaultName: "vAuLtNaMe", + ReplicationRecoveryPlanName: "rEpLiCaTiOnReCoVeRyPlAnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS/rEcOvErYpLaNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS/rEpLiCaTiOnReCoVeRyPlAnNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_vault.go index 377ae873a39..634bd8573b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_vault_test.go index 7a4a6294e06..3f67d09bb04 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryplans/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/README.md index 0f60e76fcbb..10c90eaf8d2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") payload := replicationrecoveryservicesproviders.AddRecoveryServicesProviderInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationrecoveryservicesproviders.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationrecoveryservicesproviders.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -115,7 +115,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.RefreshProviderThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationfabric.go index 5a00c601bc1..9b5124c9f9f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go index f7837dea5f4..d7afe711ff4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go index 8cd6155224c..9cba3d8c658 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go @@ -127,11 +127,11 @@ func (id ReplicationRecoveryServicesProviderId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationRecoveryServicesProviders", "replicationRecoveryServicesProviders", "replicationRecoveryServicesProviders"), - resourceids.UserSpecifiedSegment("replicationRecoveryServicesProviderName", "providerName"), + resourceids.UserSpecifiedSegment("replicationRecoveryServicesProviderName", "replicationRecoveryServicesProviderName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go index aaaaa1ceb4c..330064d9655 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationRecoveryServicesProviderId{} func TestNewReplicationRecoveryServicesProviderID(t *testing.T) { - id := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") + id := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationRecoveryServicesProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationRecoveryServicesProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryServicesProviderName'", id.ReplicationRecoveryServicesProviderName, "providerName") + if id.ReplicationRecoveryServicesProviderName != "replicationRecoveryServicesProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryServicesProviderName'", id.ReplicationRecoveryServicesProviderName, "replicationRecoveryServicesProviderName") } } func TestFormatReplicationRecoveryServicesProviderID(t *testing.T) { - actual := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName" + actual := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationRecoveryServicesProviderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationRecoveryServicesProviderName: "providerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationRecoveryServicesProviderName: "replicationRecoveryServicesProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationRecoveryServicesProviderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationRecoveryServicesProviderName: "providerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationRecoveryServicesProviderName: "replicationRecoveryServicesProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationRecoveryServicesProviderName: "pRoViDeRnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationRecoveryServicesProviderName: "rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/pRoViDeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_vault.go index c9f73babd5b..e0624e18242 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_vault_test.go index 0961c577c71..bd041b99e7c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationrecoveryservicesproviders/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/README.md index 22d50f989c7..e617898c69c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") payload := replicationstorageclassificationmappings.StorageClassificationMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationstorageclassificationmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") // alternatively `client.ListByReplicationStorageClassifications(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationStorageClassificationsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go index 90d5c24d59e..6153e2573af 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go @@ -127,11 +127,11 @@ func (id ReplicationStorageClassificationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go index 6a834a59db6..93419cf7b07 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationId{} func TestNewReplicationStorageClassificationID(t *testing.T) { - id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") + id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationStorageClassificationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } } func TestFormatReplicationStorageClassificationID(t *testing.T) { - actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName" + actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationStorageClassificationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationStorageClassificationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go index 824c6d0a66a..35968166e9f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go @@ -133,13 +133,13 @@ func (id ReplicationStorageClassificationMappingId) Segments() []resourceids.Seg resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), resourceids.StaticSegment("staticReplicationStorageClassificationMappings", "replicationStorageClassificationMappings", "replicationStorageClassificationMappings"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationMappingName", "storageClassificationMappingName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationMappingName", "replicationStorageClassificationMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go index 417937fb019..83299d4dc83 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationMappingId{} func TestNewReplicationStorageClassificationMappingID(t *testing.T) { - id := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") + id := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationStorageClassificationMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } - if id.ReplicationStorageClassificationMappingName != "storageClassificationMappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationMappingName'", id.ReplicationStorageClassificationMappingName, "storageClassificationMappingName") + if id.ReplicationStorageClassificationMappingName != "replicationStorageClassificationMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationMappingName'", id.ReplicationStorageClassificationMappingName, "replicationStorageClassificationMappingName") } } func TestFormatReplicationStorageClassificationMappingID(t *testing.T) { - actual := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName" + actual := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationStorageClassificationMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", - ReplicationStorageClassificationMappingName: "storageClassificationMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", + ReplicationStorageClassificationMappingName: "replicationStorageClassificationMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationStorageClassificationMappingIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", - ReplicationStorageClassificationMappingName: "storageClassificationMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", + ReplicationStorageClassificationMappingName: "replicationStorageClassificationMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/sToRaGeClAsSiFiCaTiOnMaPpInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", - ReplicationStorageClassificationMappingName: "sToRaGeClAsSiFiCaTiOnMaPpInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", + ReplicationStorageClassificationMappingName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/sToRaGeClAsSiFiCaTiOnMaPpInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_vault.go index 21b75b920e0..e792b2e3f57 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_vault_test.go index 73ba9056908..fc6942dc1c9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassificationmappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/README.md index 31b3bf0a737..c14e303ecf5 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationstorageclassifications.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") +id := replicationstorageclassifications.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationstorageclassifications.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationstorageclassifications.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationstorageclassifications.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationstorageclassifications.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationfabric.go index 98d8bd783a2..e2899f5fecb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationfabric_test.go index c9f379bec3b..726bd85a5dc 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationstorageclassification.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationstorageclassification.go index 81c1b64d092..8e8996b47e8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationstorageclassification.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationstorageclassification.go @@ -127,11 +127,11 @@ func (id ReplicationStorageClassificationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationstorageclassification_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationstorageclassification_test.go index 3a50dd4d3a9..e66a6025f8c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationstorageclassification_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_replicationstorageclassification_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationId{} func TestNewReplicationStorageClassificationID(t *testing.T) { - id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") + id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationStorageClassificationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } } func TestFormatReplicationStorageClassificationID(t *testing.T) { - actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName" + actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationStorageClassificationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationStorageClassificationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_vault.go index 15acbb5190f..e6e8ef1f8a7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_vault_test.go index 70408cb72ae..f166541032d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationstorageclassifications/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/README.md index 2ac4e91aef7..fbce4e3cbed 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/id_vault.go index 5f01afb39da..bfec839dc80 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/id_vault_test.go index 7b50331b8cc..1eed0241695 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaulthealth/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/README.md index 83d07a243ef..a4b61758482 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") +id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") payload := replicationvaultsetting.VaultSettingCreationInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") +id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvaultsetting.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaultsetting.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_replicationvaultsetting.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_replicationvaultsetting.go index db0dd36ef4d..ecf9719a633 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_replicationvaultsetting.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_replicationvaultsetting.go @@ -121,9 +121,9 @@ func (id ReplicationVaultSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationVaultSettings", "replicationVaultSettings", "replicationVaultSettings"), - resourceids.UserSpecifiedSegment("replicationVaultSettingName", "vaultSettingName"), + resourceids.UserSpecifiedSegment("replicationVaultSettingName", "replicationVaultSettingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_replicationvaultsetting_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_replicationvaultsetting_test.go index 34e14537f4f..bf6d3aeb9ce 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_replicationvaultsetting_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_replicationvaultsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationVaultSettingId{} func TestNewReplicationVaultSettingID(t *testing.T) { - id := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") + id := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationVaultSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationVaultSettingName != "vaultSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationVaultSettingName'", id.ReplicationVaultSettingName, "vaultSettingName") + if id.ReplicationVaultSettingName != "replicationVaultSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationVaultSettingName'", id.ReplicationVaultSettingName, "replicationVaultSettingName") } } func TestFormatReplicationVaultSettingID(t *testing.T) { - actual := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName" + actual := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationVaultSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationVaultSettingName: "vaultSettingName", + VaultName: "vaultName", + ReplicationVaultSettingName: "replicationVaultSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationVaultSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationVaultSettingName: "vaultSettingName", + VaultName: "vaultName", + ReplicationVaultSettingName: "replicationVaultSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS/vAuLtSeTtInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS/rEpLiCaTiOnVaUlTsEtTiNgNaMe", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationVaultSettingName: "vAuLtSeTtInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationVaultSettingName: "rEpLiCaTiOnVaUlTsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS/vAuLtSeTtInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS/rEpLiCaTiOnVaUlTsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_vault.go index 30405e4ff37..26d5327d79b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_vault_test.go index 26d5afc2275..db40ac61c76 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvaultsetting/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/README.md index 3919075cb12..1bf6dc2d3d2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") payload := replicationvcenters.AddVCenterRequest{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvcenters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationvcenters.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") payload := replicationvcenters.UpdateVCenterRequest{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationfabric.go index 2b2d9ed460e..02266219cb8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationfabric_test.go index e96172e94ee..34ad51f05fd 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationvcenter.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationvcenter.go index ddcd8bb416d..0737f2b9eb7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationvcenter.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationvcenter.go @@ -127,11 +127,11 @@ func (id ReplicationvCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationvCenters", "replicationvCenters", "replicationvCenters"), - resourceids.UserSpecifiedSegment("replicationvCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("replicationvCenterName", "replicationvCenterName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationvcenter_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationvcenter_test.go index c4c39c44feb..9825c94a29a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationvcenter_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_replicationvcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationvCenterId{} func TestNewReplicationvCenterID(t *testing.T) { - id := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") + id := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationvCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationvCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationvCenterName'", id.ReplicationvCenterName, "vcenterName") + if id.ReplicationvCenterName != "replicationvCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationvCenterName'", id.ReplicationvCenterName, "replicationvCenterName") } } func TestFormatReplicationvCenterID(t *testing.T) { - actual := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName" + actual := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationvCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationvCenterName: "vcenterName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationvCenterName: "replicationvCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationvCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationvCenterName: "vcenterName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationvCenterName: "replicationvCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs/vCeNtErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs/rEpLiCaTiOnVcEnTeRnAmE", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationvCenterName: "vCeNtErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationvCenterName: "rEpLiCaTiOnVcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs/vCeNtErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs/rEpLiCaTiOnVcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_vault.go index 13ce0b3f0ef..e37ff91d564 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_vault_test.go index df951ba3b35..d474d05200f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/replicationvcenters/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/README.md index e4f1c6d0b56..957ae41db08 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := supportedoperatingsystems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := supportedoperatingsystems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") read, err := client.Get(ctx, id, supportedoperatingsystems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/id_vault.go index c8c2297e843..2577775d89c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/id_vault_test.go index a30da0e201d..84334cd878a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/supportedoperatingsystems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/README.md b/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/README.md index cd193e58cc2..4a9f91b0a2c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := targetcomputesizes.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := targetcomputesizes.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") // alternatively `client.ListByReplicationProtectedItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectedItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/id_replicationprotecteditem.go index 615b84e8509..980d5cc9c99 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/id_replicationprotecteditem_test.go index 6fe9b86a24a..79746b3b3a0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-01-01/targetcomputesizes/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/README.md index 2b0c5b2768e..afd38bcb9e6 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := clusterrecoverypoint.NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName", "recoveryPointName") +id := clusterrecoverypoint.NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName", "recoveryPointName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint.go index 6b404add055..cb85902f9a5 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint.go @@ -139,11 +139,11 @@ func (id ReplicationProtectionClusterRecoveryPointId) Segments() []resourceids.S resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionClusters", "replicationProtectionClusters", "replicationProtectionClusters"), resourceids.UserSpecifiedSegment("replicationProtectionClusterName", "replicationProtectionClusterName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint_test.go index 779b658f94a..976ddec572b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionClusterRecoveryPointId{} func TestNewReplicationProtectionClusterRecoveryPointID(t *testing.T) { - id := NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName", "recoveryPointName") + id := NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName", "recoveryPointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewReplicationProtectionClusterRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } if id.ReplicationProtectionClusterName != "replicationProtectionClusterName" { @@ -44,8 +44,8 @@ func TestNewReplicationProtectionClusterRecoveryPointID(t *testing.T) { } func TestFormatReplicationProtectionClusterRecoveryPointID(t *testing.T) { - actual := NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName", "recoveryPointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName" + actual := NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName", "recoveryPointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseReplicationProtectionClusterRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName", Expected: &ReplicationProtectionClusterRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseReplicationProtectionClusterRecoveryPointIDInsensitively(t *testin }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName", Expected: &ReplicationProtectionClusterRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", Expected: &ReplicationProtectionClusterRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", ReplicationProtectionClusterName: "rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", RecoveryPointName: "rEcOvErYpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/README.md index 7727a49b63a..199d08868b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := clusterrecoverypoints.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := clusterrecoverypoints.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") // alternatively `client.ListByReplicationProtectionCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionClusterComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/id_replicationprotectioncluster.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/id_replicationprotectioncluster.go index 075e8f3f88d..7e5b399bbfb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/id_replicationprotectioncluster.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/id_replicationprotectioncluster.go @@ -133,11 +133,11 @@ func (id ReplicationProtectionClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionClusters", "replicationProtectionClusters", "replicationProtectionClusters"), resourceids.UserSpecifiedSegment("replicationProtectionClusterName", "replicationProtectionClusterName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/id_replicationprotectioncluster_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/id_replicationprotectioncluster_test.go index f23b1bbfed1..37dd3a94fa4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/id_replicationprotectioncluster_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/clusterrecoverypoints/id_replicationprotectioncluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionClusterId{} func TestNewReplicationProtectionClusterID(t *testing.T) { - id := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") + id := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewReplicationProtectionClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } if id.ReplicationProtectionClusterName != "replicationProtectionClusterName" { @@ -40,8 +40,8 @@ func TestNewReplicationProtectionClusterID(t *testing.T) { } func TestFormatReplicationProtectionClusterID(t *testing.T) { - actual := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName" + actual := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectionClusterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectionClusterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", ReplicationProtectionClusterName: "rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/README.md index d1399bb1515..621bde82ca4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := migrationrecoverypoints.NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName") +id := migrationrecoverypoints.NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := migrationrecoverypoints.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := migrationrecoverypoints.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") // alternatively `client.ListByReplicationMigrationItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationMigrationItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_migrationrecoverypoint.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_migrationrecoverypoint.go index 752ee034412..f0e9101261c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_migrationrecoverypoint.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_migrationrecoverypoint.go @@ -139,13 +139,13 @@ func (id MigrationRecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), resourceids.StaticSegment("staticMigrationRecoveryPoints", "migrationRecoveryPoints", "migrationRecoveryPoints"), resourceids.UserSpecifiedSegment("migrationRecoveryPointName", "migrationRecoveryPointName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go index 7c74dacadd3..d216774042c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MigrationRecoveryPointId{} func TestNewMigrationRecoveryPointID(t *testing.T) { - id := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName") + id := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewMigrationRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } if id.MigrationRecoveryPointName != "migrationRecoveryPointName" { @@ -44,8 +44,8 @@ func TestNewMigrationRecoveryPointID(t *testing.T) { } func TestFormatMigrationRecoveryPointID(t *testing.T) { - actual := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName" + actual := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseMigrationRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", MigrationRecoveryPointName: "migrationRecoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseMigrationRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", MigrationRecoveryPointName: "migrationRecoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", MigrationRecoveryPointName: "mIgRaTiOnReCoVeRyPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_replicationmigrationitem.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_replicationmigrationitem.go index 027a4d6a709..9ccb9efa50b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_replicationmigrationitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_replicationmigrationitem.go @@ -133,13 +133,13 @@ func (id ReplicationMigrationItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_replicationmigrationitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_replicationmigrationitem_test.go index 24383f205f4..dde2cd4e339 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_replicationmigrationitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/migrationrecoverypoints/id_replicationmigrationitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationMigrationItemId{} func TestNewReplicationMigrationItemID(t *testing.T) { - id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") + id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationMigrationItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } } func TestFormatReplicationMigrationItemID(t *testing.T) { - actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName" + actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationMigrationItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationMigrationItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/README.md index 4c30275fc0c..961b5f6621d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := recoverypoints.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") // alternatively `client.ListByReplicationProtectedItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectedItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_recoverypoint.go index 5c25218f1d4..961edec2d6d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_recoverypoint.go @@ -139,13 +139,13 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), resourceids.UserSpecifiedSegment("recoveryPointName", "recoveryPointName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_recoverypoint_test.go index dd1f423957f..f7195561c72 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } if id.RecoveryPointName != "recoveryPointName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", RecoveryPointName: "rEcOvErYpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_replicationprotecteditem.go index e3bb58daad9..6c0d7acae11 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_replicationprotecteditem_test.go index d7001321908..f60a0f6a4a3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/recoverypoints/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/README.md index 832953016b3..745f4f965a0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") +id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") payload := replicationalertsettings.ConfigureAlertRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") +id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationalertsettings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationalertsettings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_replicationalertsetting.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_replicationalertsetting.go index 8a0e7289454..58cedfe08d3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_replicationalertsetting.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_replicationalertsetting.go @@ -121,9 +121,9 @@ func (id ReplicationAlertSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationAlertSettings", "replicationAlertSettings", "replicationAlertSettings"), - resourceids.UserSpecifiedSegment("replicationAlertSettingName", "alertSettingName"), + resourceids.UserSpecifiedSegment("replicationAlertSettingName", "replicationAlertSettingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_replicationalertsetting_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_replicationalertsetting_test.go index f422ed36f3a..56e5094c009 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_replicationalertsetting_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_replicationalertsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationAlertSettingId{} func TestNewReplicationAlertSettingID(t *testing.T) { - id := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") + id := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationAlertSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationAlertSettingName != "alertSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationAlertSettingName'", id.ReplicationAlertSettingName, "alertSettingName") + if id.ReplicationAlertSettingName != "replicationAlertSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationAlertSettingName'", id.ReplicationAlertSettingName, "replicationAlertSettingName") } } func TestFormatReplicationAlertSettingID(t *testing.T) { - actual := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName" + actual := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationAlertSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationAlertSettingName: "alertSettingName", + VaultName: "vaultName", + ReplicationAlertSettingName: "replicationAlertSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationAlertSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationAlertSettingName: "alertSettingName", + VaultName: "vaultName", + ReplicationAlertSettingName: "replicationAlertSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS/aLeRtSeTtInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS/rEpLiCaTiOnAlErTsEtTiNgNaMe", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationAlertSettingName: "aLeRtSeTtInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationAlertSettingName: "rEpLiCaTiOnAlErTsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS/aLeRtSeTtInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS/rEpLiCaTiOnAlErTsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_vault.go index 5959ea2b7ea..4d0e369d238 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_vault_test.go index 76fd493fb3e..9d66b7eb7e7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationalertsettings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/README.md index ba956353fdb..2ae80ab2e55 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationappliances.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationappliances.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationappliances.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationappliances.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/id_vault.go index 0b8f2f357fa..840bc253579 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/id_vault_test.go index 440cf83eb99..b55e9882b37 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationappliances/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/README.md index 7c5c63827d6..b5af9446704 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationevents.NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName") +id := replicationevents.NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationevents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationevents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationevents.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationevents.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_replicationevent.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_replicationevent.go index 8cceef37e74..9a94a8d463c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_replicationevent.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_replicationevent.go @@ -121,9 +121,9 @@ func (id ReplicationEventId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationEvents", "replicationEvents", "replicationEvents"), - resourceids.UserSpecifiedSegment("replicationEventName", "eventName"), + resourceids.UserSpecifiedSegment("replicationEventName", "replicationEventName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_replicationevent_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_replicationevent_test.go index 048f9f24dab..f4be6ef83fd 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_replicationevent_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_replicationevent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationEventId{} func TestNewReplicationEventID(t *testing.T) { - id := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName") + id := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationEventID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationEventName != "eventName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationEventName'", id.ReplicationEventName, "eventName") + if id.ReplicationEventName != "replicationEventName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationEventName'", id.ReplicationEventName, "replicationEventName") } } func TestFormatReplicationEventID(t *testing.T) { - actual := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName" + actual := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationEventID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationEventName: "eventName", + VaultName: "vaultName", + ReplicationEventName: "replicationEventName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationEventIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationEventName: "eventName", + VaultName: "vaultName", + ReplicationEventName: "replicationEventName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs/eVeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs/rEpLiCaTiOnEvEnTnAmE", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationEventName: "eVeNtNaMe", + VaultName: "vAuLtNaMe", + ReplicationEventName: "rEpLiCaTiOnEvEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs/eVeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs/rEpLiCaTiOnEvEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_vault.go index 08164fe4eee..f540d5ea573 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_vault_test.go index 3706228ecd7..fc824ae5e8b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationevents/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/README.md index b1e7d8f10fe..b3fe06fbb80 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.CheckConsistencyThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CheckConsistencyThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.FabricCreationInput{ // ... @@ -53,7 +53,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -65,7 +65,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") read, err := client.Get(ctx, id, replicationfabrics.DefaultGetOperationOptions()) if err != nil { @@ -81,7 +81,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationfabrics.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -98,7 +98,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.MigrateToAadThenPoll(ctx, id); err != nil { // handle the error @@ -110,7 +110,7 @@ if err := client.MigrateToAadThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -122,7 +122,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.FailoverProcessServerRequest{ // ... @@ -139,7 +139,7 @@ if err := client.ReassociateGatewayThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.RemoveInfraThenPoll(ctx, id); err != nil { // handle the error @@ -151,7 +151,7 @@ if err := client.RemoveInfraThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.RenewCertificateInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_replicationfabric.go index 543c6b7ed30..020505872b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_replicationfabric_test.go index 6f8bf12bb5f..19edc4fbec2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_vault.go index a26b6403ff5..d5e352feba9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_vault_test.go index 0e25b12412a..a8000d12f4a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationfabrics/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/README.md index d217862438a..b85391ee7d6 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if err := client.CancelThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") payload := replicationjobs.JobQueryParameter{ // ... @@ -53,7 +53,7 @@ if err := client.ExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationjobs.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationjobs.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") payload := replicationjobs.ResumeJobParams{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_replicationjob.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_replicationjob.go index 5be22f9f962..4abf5a4a7be 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_replicationjob.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_replicationjob.go @@ -121,9 +121,9 @@ func (id ReplicationJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationJobs", "replicationJobs", "replicationJobs"), - resourceids.UserSpecifiedSegment("replicationJobName", "jobName"), + resourceids.UserSpecifiedSegment("replicationJobName", "replicationJobName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_replicationjob_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_replicationjob_test.go index 96fa5d5e3b9..1f54c3772b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_replicationjob_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_replicationjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationJobId{} func TestNewReplicationJobID(t *testing.T) { - id := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") + id := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationJobName'", id.ReplicationJobName, "jobName") + if id.ReplicationJobName != "replicationJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationJobName'", id.ReplicationJobName, "replicationJobName") } } func TestFormatReplicationJobID(t *testing.T) { - actual := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName" + actual := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationJobName: "jobName", + VaultName: "vaultName", + ReplicationJobName: "replicationJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationJobName: "jobName", + VaultName: "vaultName", + ReplicationJobName: "replicationJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs/rEpLiCaTiOnJoBnAmE", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationJobName: "jObNaMe", + VaultName: "vAuLtNaMe", + ReplicationJobName: "rEpLiCaTiOnJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs/rEpLiCaTiOnJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_vault.go index 9269e4fa589..da6fbb451d2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_vault_test.go index 1ed11cd7739..33e578b5b44 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationjobs/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/README.md index e55b65941a2..dfd6635120d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationlogicalnetworks.NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName") +id := replicationlogicalnetworks.NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationlogicalnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationlogicalnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationfabric.go index 196c6fa3801..cd151e6011f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationfabric_test.go index 345754c84e8..09d32c71688 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go index a00d702ee95..7f9fd6f74ba 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationLogicalNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationLogicalNetworks", "replicationLogicalNetworks", "replicationLogicalNetworks"), - resourceids.UserSpecifiedSegment("replicationLogicalNetworkName", "logicalNetworkName"), + resourceids.UserSpecifiedSegment("replicationLogicalNetworkName", "replicationLogicalNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go index 6a416d05a53..d0a55e18453 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationLogicalNetworkId{} func TestNewReplicationLogicalNetworkID(t *testing.T) { - id := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName") + id := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationLogicalNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationLogicalNetworkName != "logicalNetworkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationLogicalNetworkName'", id.ReplicationLogicalNetworkName, "logicalNetworkName") + if id.ReplicationLogicalNetworkName != "replicationLogicalNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationLogicalNetworkName'", id.ReplicationLogicalNetworkName, "replicationLogicalNetworkName") } } func TestFormatReplicationLogicalNetworkID(t *testing.T) { - actual := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName" + actual := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationLogicalNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationLogicalNetworkName: "logicalNetworkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationLogicalNetworkName: "replicationLogicalNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationLogicalNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationLogicalNetworkName: "logicalNetworkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationLogicalNetworkName: "replicationLogicalNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS/lOgIcAlNeTwOrKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS/rEpLiCaTiOnLoGiCaLnEtWoRkNaMe", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationLogicalNetworkName: "lOgIcAlNeTwOrKnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationLogicalNetworkName: "rEpLiCaTiOnLoGiCaLnEtWoRkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS/lOgIcAlNeTwOrKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS/rEpLiCaTiOnLoGiCaLnEtWoRkNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/README.md index dfb94cef236..becd7b37adc 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.EnableMigrationInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if err := client.DeleteThenPoll(ctx, id, replicationmigrationitems.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, replicationmigrationitems.DefaultDelete ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationmigrationitems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationmigrationitems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationmigrationitems.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationmigrationitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id, replicationmigrationitems.DefaultListByReplicationProtectionContainersOperationOptions())` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id, replicationmigrationitems.DefaultListByReplicationProtectionContainersOperationOptions()) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.MigrateInput{ // ... @@ -120,7 +120,7 @@ if err := client.MigrateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.PauseReplicationInput{ // ... @@ -137,7 +137,7 @@ if err := client.PauseReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.ResumeReplicationInput{ // ... @@ -154,7 +154,7 @@ if err := client.ResumeReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.ResyncInput{ // ... @@ -171,7 +171,7 @@ if err := client.ResyncThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.TestMigrateInput{ // ... @@ -188,7 +188,7 @@ if err := client.TestMigrateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.TestMigrateCleanupInput{ // ... @@ -205,7 +205,7 @@ if err := client.TestMigrateCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.UpdateMigrationItemInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationmigrationitem.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationmigrationitem.go index 349e9ee5fb7..af2c070a6aa 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationmigrationitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationmigrationitem.go @@ -133,13 +133,13 @@ func (id ReplicationMigrationItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationmigrationitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationmigrationitem_test.go index 71602c091d3..3df0ca67a2d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationmigrationitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationmigrationitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationMigrationItemId{} func TestNewReplicationMigrationItemID(t *testing.T) { - id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") + id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationMigrationItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } } func TestFormatReplicationMigrationItemID(t *testing.T) { - actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName" + actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationMigrationItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationMigrationItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationprotectioncontainer.go index 3fd1310f68c..f6b59f9a420 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go index 65fe630e5ef..7d99ad5e9be 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_vault.go index e1c1fa8bcc6..5d25616da85 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_vault_test.go index 807a2b87c52..b0b22c1e6a7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/model_managedruncommandscriptinput.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/model_managedruncommandscriptinput.go index 29941ef4979..5ee3b09a915 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/model_managedruncommandscriptinput.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationmigrationitems/model_managedruncommandscriptinput.go @@ -5,6 +5,6 @@ package replicationmigrationitems type ManagedRunCommandScriptInput struct { ScriptParameters string `json:"scriptParameters"` - ScriptUrl string `json:"scriptUrl"` + ScriptURL string `json:"scriptUrl"` StepName string `json:"stepName"` } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/README.md index 9ff53cb29de..7762b61b39a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") payload := replicationnetworkmappings.CreateNetworkMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationnetworkmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") +id := replicationnetworkmappings.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") // alternatively `client.ListByReplicationNetworks(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationNetworksComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") payload := replicationnetworkmappings.UpdateNetworkMappingInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetwork.go index ee4dfc3a51f..bc0a19b4b6e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetwork_test.go index 3120f4e7ba8..82963269f22 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkId{} func TestNewReplicationNetworkID(t *testing.T) { - id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") + id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } } func TestFormatReplicationNetworkID(t *testing.T) { - actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName" + actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetworkmapping.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetworkmapping.go index b2735d87b57..f35ea2e5232 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetworkmapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetworkmapping.go @@ -133,13 +133,13 @@ func (id ReplicationNetworkMappingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), resourceids.StaticSegment("staticReplicationNetworkMappings", "replicationNetworkMappings", "replicationNetworkMappings"), - resourceids.UserSpecifiedSegment("replicationNetworkMappingName", "networkMappingName"), + resourceids.UserSpecifiedSegment("replicationNetworkMappingName", "replicationNetworkMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go index 6f7602aef17..1d386c1e039 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkMappingId{} func TestNewReplicationNetworkMappingID(t *testing.T) { - id := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") + id := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationNetworkMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } - if id.ReplicationNetworkMappingName != "networkMappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkMappingName'", id.ReplicationNetworkMappingName, "networkMappingName") + if id.ReplicationNetworkMappingName != "replicationNetworkMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkMappingName'", id.ReplicationNetworkMappingName, "replicationNetworkMappingName") } } func TestFormatReplicationNetworkMappingID(t *testing.T) { - actual := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName" + actual := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationNetworkMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", - ReplicationNetworkMappingName: "networkMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", + ReplicationNetworkMappingName: "replicationNetworkMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationNetworkMappingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", - ReplicationNetworkMappingName: "networkMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", + ReplicationNetworkMappingName: "replicationNetworkMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS/nEtWoRkMaPpInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS/rEpLiCaTiOnNeTwOrKmApPiNgNaMe", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", - ReplicationNetworkMappingName: "nEtWoRkMaPpInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", + ReplicationNetworkMappingName: "rEpLiCaTiOnNeTwOrKmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS/nEtWoRkMaPpInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS/rEpLiCaTiOnNeTwOrKmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_vault.go index ebfe061bdb2..5cecc8e3e7f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_vault_test.go index b24f77c90b4..0403f3ac48e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworkmappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/README.md index 8979f4684fd..e007405a3b4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationnetworks.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") +id := replicationnetworks.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationnetworks.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationnetworks.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationfabric.go index f2b991fe1ea..a8c98a7e306 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationfabric_test.go index 7adf449d0ed..e06cfc4dd1a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationnetwork.go index 56d0fe3f65f..edf86f27ed8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationnetwork_test.go index 78fd36447b1..876c102db90 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_replicationnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkId{} func TestNewReplicationNetworkID(t *testing.T) { - id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") + id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } } func TestFormatReplicationNetworkID(t *testing.T) { - actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName" + actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_vault.go index 9819f106905..57c8e9dba03 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_vault_test.go index 523f645b8f6..4baea566f21 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationnetworks/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/README.md index 4f967dcffe0..c3801cad86c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") payload := replicationpolicies.CreatePolicyInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationpolicies.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") payload := replicationpolicies.UpdatePolicyInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_replicationpolicy.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_replicationpolicy.go index bfa93e62ba4..8e52815a483 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_replicationpolicy.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_replicationpolicy.go @@ -121,9 +121,9 @@ func (id ReplicationPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationPolicies", "replicationPolicies", "replicationPolicies"), - resourceids.UserSpecifiedSegment("replicationPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("replicationPolicyName", "replicationPolicyName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_replicationpolicy_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_replicationpolicy_test.go index 0af62e99af0..a22bec723f0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_replicationpolicy_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_replicationpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationPolicyId{} func TestNewReplicationPolicyID(t *testing.T) { - id := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") + id := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationPolicyName'", id.ReplicationPolicyName, "policyName") + if id.ReplicationPolicyName != "replicationPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationPolicyName'", id.ReplicationPolicyName, "replicationPolicyName") } } func TestFormatReplicationPolicyID(t *testing.T) { - actual := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName" + actual := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationPolicyName: "policyName", + VaultName: "vaultName", + ReplicationPolicyName: "replicationPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationPolicyName: "policyName", + VaultName: "vaultName", + ReplicationPolicyName: "replicationPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs/rEpLiCaTiOnPoLiCyNaMe", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationPolicyName: "pOlIcYnAmE", + VaultName: "vAuLtNaMe", + ReplicationPolicyName: "rEpLiCaTiOnPoLiCyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs/rEpLiCaTiOnPoLiCyNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_vault.go index 31f525956e7..e16dd3da492 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_vault_test.go index df63447ec2e..8c7119dc1f2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationpolicies/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/README.md index 122e7aaf4f6..aceecdfb448 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectableitems.NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName") +id := replicationprotectableitems.NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectableitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectableitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id, replicationprotectableitems.DefaultListByReplicationProtectionContainersOperationOptions())` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id, replicationprotectableitems.DefaultListByReplicationProtectionContainersOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectableitem.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectableitem.go index 063a750b792..5688af5bd49 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectableitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectableitem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectableItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectableItems", "replicationProtectableItems", "replicationProtectableItems"), - resourceids.UserSpecifiedSegment("replicationProtectableItemName", "protectableItemName"), + resourceids.UserSpecifiedSegment("replicationProtectableItemName", "replicationProtectableItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectableitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectableitem_test.go index bd8b1ae136d..5ca442edaf4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectableitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectableitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectableItemId{} func TestNewReplicationProtectableItemID(t *testing.T) { - id := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName") + id := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectableItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectableItemName != "protectableItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectableItemName'", id.ReplicationProtectableItemName, "protectableItemName") + if id.ReplicationProtectableItemName != "replicationProtectableItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectableItemName'", id.ReplicationProtectableItemName, "replicationProtectableItemName") } } func TestFormatReplicationProtectableItemID(t *testing.T) { - actual := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName" + actual := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectableItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectableItemName: "protectableItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectableItemName: "replicationProtectableItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectableItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectableItemName: "protectableItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectableItemName: "replicationProtectableItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs/pRoTeCtAbLeItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs/rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectableItemName: "pRoTeCtAbLeItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectableItemName: "rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs/pRoTeCtAbLeItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs/rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectioncontainer.go index dd994133f3e..f23f4dd7edc 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go index f8737867968..34d92bb2295 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/README.md index 3958c20f45b..3d7a4d69de3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.AddDisksInput{ // ... @@ -41,7 +41,7 @@ if err := client.AddDisksThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ApplyRecoveryPointInput{ // ... @@ -58,7 +58,7 @@ if err := client.ApplyRecoveryPointThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.EnableProtectionInput{ // ... @@ -75,7 +75,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.DisableProtectionInput{ // ... @@ -92,7 +92,7 @@ if err := client.DeleteThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.FailoverCancelThenPoll(ctx, id); err != nil { // handle the error @@ -104,7 +104,7 @@ if err := client.FailoverCancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.FailoverCommitThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.FailoverCommitThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") read, err := client.Get(ctx, id) if err != nil { @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotecteditems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationprotecteditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationprotecteditems.DefaultListOperationOptions()) @@ -149,7 +149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotecteditems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id) @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.PlannedFailoverInput{ // ... @@ -183,7 +183,7 @@ if err := client.PlannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -195,7 +195,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.RemoveDisksInput{ // ... @@ -212,7 +212,7 @@ if err := client.RemoveDisksThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.RepairReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -224,7 +224,7 @@ if err := client.RepairReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ReverseReplicationInput{ // ... @@ -241,7 +241,7 @@ if err := client.ReprotectThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ResolveHealthInput{ // ... @@ -258,7 +258,7 @@ if err := client.ResolveHealthErrorsThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.SwitchProviderInput{ // ... @@ -275,7 +275,7 @@ if err := client.SwitchProviderThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.TestFailoverInput{ // ... @@ -292,7 +292,7 @@ if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.TestFailoverCleanupInput{ // ... @@ -309,7 +309,7 @@ if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UnplannedFailoverInput{ // ... @@ -326,7 +326,7 @@ if err := client.UnplannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateReplicationProtectedItemInput{ // ... @@ -343,7 +343,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateApplianceForReplicationProtectedItemInput{ // ... @@ -360,7 +360,7 @@ if err := client.UpdateApplianceThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateMobilityServiceRequest{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotecteditem.go index 619562136d7..ec2c5d221c2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotecteditem_test.go index 606f34b42bd..af1be070147 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotectioncontainer.go index 3b60acb0471..90d3e87f91d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go index 839ec0dfc63..6a6c47d5d94 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_vault.go index 4c54630eaad..35eb0fa0277 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_vault_test.go index abe1e462a85..85390476d93 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotecteditems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/README.md index 75f90c3da5e..9c59aefed4f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ApplyClusterRecoveryPointInput{ // ... @@ -41,7 +41,7 @@ if err := client.ApplyRecoveryPointThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ReplicationProtectionCluster{ // ... @@ -58,7 +58,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if err := client.FailoverCommitThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.FailoverCommitThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectionclusters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationprotectionclusters.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationprotectionclusters.DefaultListOperationOptions()) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectionclusters.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id) @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -132,7 +132,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if err := client.RepairReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -144,7 +144,7 @@ if err := client.RepairReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ClusterTestFailoverInput{ // ... @@ -161,7 +161,7 @@ if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ClusterTestFailoverCleanupInput{ // ... @@ -178,7 +178,7 @@ if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ClusterUnplannedFailoverInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncluster.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncluster.go index 8b8fd548ba9..2f390968800 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncluster.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncluster.go @@ -133,11 +133,11 @@ func (id ReplicationProtectionClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionClusters", "replicationProtectionClusters", "replicationProtectionClusters"), resourceids.UserSpecifiedSegment("replicationProtectionClusterName", "replicationProtectionClusterName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncluster_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncluster_test.go index 3232fe2ece3..51d21c9522d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncluster_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionClusterId{} func TestNewReplicationProtectionClusterID(t *testing.T) { - id := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") + id := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewReplicationProtectionClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } if id.ReplicationProtectionClusterName != "replicationProtectionClusterName" { @@ -40,8 +40,8 @@ func TestNewReplicationProtectionClusterID(t *testing.T) { } func TestFormatReplicationProtectionClusterID(t *testing.T) { - actual := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName" + actual := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectionClusterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectionClusterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", ReplicationProtectionClusterName: "rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncontainer.go index d761ddec007..e6dc5092a4b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncontainer_test.go index b277f14f250..0a7fb19397c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_vault.go index 01ec4fa617e..cc7c01caea9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_vault_test.go index 63c66a89f90..c0019a94ada 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionclusters/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/README.md index 943bab769bf..049fe71ffc9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.CreateProtectionContainerMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.RemoveProtectionContainerMappingInput{ // ... @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectioncontainermappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -120,7 +120,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.UpdateProtectionContainerMappingInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go index ee9a5b2733d..61b19e9b5bb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go index 7ecbdb77424..054eecca438 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go index 1fbd79d1a44..2b2e19aec67 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go @@ -133,13 +133,13 @@ func (id ReplicationProtectionContainerMappingId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionContainerMappings", "replicationProtectionContainerMappings", "replicationProtectionContainerMappings"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerMappingName", "mappingName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerMappingName", "replicationProtectionContainerMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go index de38e43ce9b..3da16c9dc30 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerMappingId{} func TestNewReplicationProtectionContainerMappingID(t *testing.T) { - id := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") + id := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectionContainerMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectionContainerMappingName != "mappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerMappingName'", id.ReplicationProtectionContainerMappingName, "mappingName") + if id.ReplicationProtectionContainerMappingName != "replicationProtectionContainerMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerMappingName'", id.ReplicationProtectionContainerMappingName, "replicationProtectionContainerMappingName") } } func TestFormatReplicationProtectionContainerMappingID(t *testing.T) { - actual := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName" + actual := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectionContainerMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectionContainerMappingName: "mappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectionContainerMappingName: "replicationProtectionContainerMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectionContainerMappingIDInsensitively(t *testing.T) }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectionContainerMappingName: "mappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectionContainerMappingName: "replicationProtectionContainerMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/mApPiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectionContainerMappingName: "mApPiNgNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectionContainerMappingName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/mApPiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_vault.go index 067641d7f6b..732e128c07b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_vault_test.go index 1aa940e3c6b..5d5304ccb76 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainermappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/README.md index acafae1f658..8c97cd019c2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.CreateProtectionContainerInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.DiscoverProtectableItemRequest{ // ... @@ -70,7 +70,7 @@ if err := client.DiscoverProtectableItemThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectioncontainers.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationprotectioncontainers.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.SwitchClusterProtectionInput{ // ... @@ -137,7 +137,7 @@ if err := client.SwitchClusterProtectionThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.SwitchProtectionInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationfabric.go index 976708ca52d..3bd079512ad 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationfabric_test.go index 0c8da3dd020..4bf4be40c8e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go index b8d2d8fb70a..e5592319c54 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go index 508844b562b..a91ca97cb10 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_vault.go index f5f018b0031..8bf89545d20 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_vault_test.go index 299181333ca..4d480e32c58 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectioncontainers/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/README.md index ae064f936cb..47110904ae3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") +id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") payload := replicationprotectionintents.CreateProtectionIntentInput{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") +id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectionintents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectionintents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationprotectionintents.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationprotectionintents.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_replicationprotectionintent.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_replicationprotectionintent.go index dad9f6c7fad..78e9627f11f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_replicationprotectionintent.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_replicationprotectionintent.go @@ -121,9 +121,9 @@ func (id ReplicationProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationProtectionIntents", "replicationProtectionIntents", "replicationProtectionIntents"), - resourceids.UserSpecifiedSegment("replicationProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("replicationProtectionIntentName", "replicationProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_replicationprotectionintent_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_replicationprotectionintent_test.go index 07e75f6ffa0..b3dedc733d4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_replicationprotectionintent_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_replicationprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionIntentId{} func TestNewReplicationProtectionIntentID(t *testing.T) { - id := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") + id := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionIntentName'", id.ReplicationProtectionIntentName, "intentObjectName") + if id.ReplicationProtectionIntentName != "replicationProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionIntentName'", id.ReplicationProtectionIntentName, "replicationProtectionIntentName") } } func TestFormatReplicationProtectionIntentID(t *testing.T) { - actual := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName" + actual := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationProtectionIntentName: "intentObjectName", + VaultName: "vaultName", + ReplicationProtectionIntentName: "replicationProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationProtectionIntentName: "intentObjectName", + VaultName: "vaultName", + ReplicationProtectionIntentName: "replicationProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS/rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationProtectionIntentName: "iNtEnToBjEcTnAmE", + VaultName: "vAuLtNaMe", + ReplicationProtectionIntentName: "rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS/rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_vault.go index 8c17143fbef..4df44daf2b0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_vault_test.go index 851c0416ea7..deb409a106d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationprotectionintents/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/README.md index d105560f17a..04f441ed287 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.CreateRecoveryPlanInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.FailoverCancelThenPoll(ctx, id); err != nil { // handle the error @@ -65,7 +65,7 @@ if err := client.FailoverCancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.FailoverCommitThenPoll(ctx, id); err != nil { // handle the error @@ -77,7 +77,7 @@ if err := client.FailoverCommitThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") read, err := client.Get(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationrecoveryplans.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanPlannedFailoverInput{ // ... @@ -127,7 +127,7 @@ if err := client.PlannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.ReprotectThenPoll(ctx, id); err != nil { // handle the error @@ -139,7 +139,7 @@ if err := client.ReprotectThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanTestFailoverInput{ // ... @@ -156,7 +156,7 @@ if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanTestFailoverCleanupInput{ // ... @@ -173,7 +173,7 @@ if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanUnplannedFailoverInput{ // ... @@ -190,7 +190,7 @@ if err := client.UnplannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.UpdateRecoveryPlanInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_replicationrecoveryplan.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_replicationrecoveryplan.go index b1d8edc1b99..02aef0ff679 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_replicationrecoveryplan.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_replicationrecoveryplan.go @@ -121,9 +121,9 @@ func (id ReplicationRecoveryPlanId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationRecoveryPlans", "replicationRecoveryPlans", "replicationRecoveryPlans"), - resourceids.UserSpecifiedSegment("replicationRecoveryPlanName", "recoveryPlanName"), + resourceids.UserSpecifiedSegment("replicationRecoveryPlanName", "replicationRecoveryPlanName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go index 3785a66bf52..64c0aac5f20 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationRecoveryPlanId{} func TestNewReplicationRecoveryPlanID(t *testing.T) { - id := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") + id := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationRecoveryPlanID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationRecoveryPlanName != "recoveryPlanName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryPlanName'", id.ReplicationRecoveryPlanName, "recoveryPlanName") + if id.ReplicationRecoveryPlanName != "replicationRecoveryPlanName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryPlanName'", id.ReplicationRecoveryPlanName, "replicationRecoveryPlanName") } } func TestFormatReplicationRecoveryPlanID(t *testing.T) { - actual := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName" + actual := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationRecoveryPlanID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationRecoveryPlanName: "recoveryPlanName", + VaultName: "vaultName", + ReplicationRecoveryPlanName: "replicationRecoveryPlanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationRecoveryPlanIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationRecoveryPlanName: "recoveryPlanName", + VaultName: "vaultName", + ReplicationRecoveryPlanName: "replicationRecoveryPlanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS/rEcOvErYpLaNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS/rEpLiCaTiOnReCoVeRyPlAnNaMe", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationRecoveryPlanName: "rEcOvErYpLaNnAmE", + VaultName: "vAuLtNaMe", + ReplicationRecoveryPlanName: "rEpLiCaTiOnReCoVeRyPlAnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS/rEcOvErYpLaNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS/rEpLiCaTiOnReCoVeRyPlAnNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_vault.go index 377ae873a39..634bd8573b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_vault_test.go index 7a4a6294e06..3f67d09bb04 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryplans/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/README.md index 8ea30c8afe6..161e701081d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") payload := replicationrecoveryservicesproviders.AddRecoveryServicesProviderInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationrecoveryservicesproviders.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationrecoveryservicesproviders.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -115,7 +115,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.RefreshProviderThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationfabric.go index 5a00c601bc1..9b5124c9f9f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go index f7837dea5f4..d7afe711ff4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go index 8cd6155224c..9cba3d8c658 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go @@ -127,11 +127,11 @@ func (id ReplicationRecoveryServicesProviderId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationRecoveryServicesProviders", "replicationRecoveryServicesProviders", "replicationRecoveryServicesProviders"), - resourceids.UserSpecifiedSegment("replicationRecoveryServicesProviderName", "providerName"), + resourceids.UserSpecifiedSegment("replicationRecoveryServicesProviderName", "replicationRecoveryServicesProviderName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go index aaaaa1ceb4c..330064d9655 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationRecoveryServicesProviderId{} func TestNewReplicationRecoveryServicesProviderID(t *testing.T) { - id := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") + id := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationRecoveryServicesProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationRecoveryServicesProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryServicesProviderName'", id.ReplicationRecoveryServicesProviderName, "providerName") + if id.ReplicationRecoveryServicesProviderName != "replicationRecoveryServicesProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryServicesProviderName'", id.ReplicationRecoveryServicesProviderName, "replicationRecoveryServicesProviderName") } } func TestFormatReplicationRecoveryServicesProviderID(t *testing.T) { - actual := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName" + actual := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationRecoveryServicesProviderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationRecoveryServicesProviderName: "providerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationRecoveryServicesProviderName: "replicationRecoveryServicesProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationRecoveryServicesProviderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationRecoveryServicesProviderName: "providerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationRecoveryServicesProviderName: "replicationRecoveryServicesProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationRecoveryServicesProviderName: "pRoViDeRnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationRecoveryServicesProviderName: "rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/pRoViDeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_vault.go index c9f73babd5b..e0624e18242 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_vault_test.go index 0961c577c71..bd041b99e7c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationrecoveryservicesproviders/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/README.md index 09d93d3f1f8..8ff7f2a95ff 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") payload := replicationstorageclassificationmappings.StorageClassificationMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationstorageclassificationmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") // alternatively `client.ListByReplicationStorageClassifications(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationStorageClassificationsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go index 90d5c24d59e..6153e2573af 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go @@ -127,11 +127,11 @@ func (id ReplicationStorageClassificationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go index 6a834a59db6..93419cf7b07 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationId{} func TestNewReplicationStorageClassificationID(t *testing.T) { - id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") + id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationStorageClassificationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } } func TestFormatReplicationStorageClassificationID(t *testing.T) { - actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName" + actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationStorageClassificationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationStorageClassificationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go index 824c6d0a66a..35968166e9f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go @@ -133,13 +133,13 @@ func (id ReplicationStorageClassificationMappingId) Segments() []resourceids.Seg resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), resourceids.StaticSegment("staticReplicationStorageClassificationMappings", "replicationStorageClassificationMappings", "replicationStorageClassificationMappings"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationMappingName", "storageClassificationMappingName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationMappingName", "replicationStorageClassificationMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go index 417937fb019..83299d4dc83 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationMappingId{} func TestNewReplicationStorageClassificationMappingID(t *testing.T) { - id := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") + id := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationStorageClassificationMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } - if id.ReplicationStorageClassificationMappingName != "storageClassificationMappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationMappingName'", id.ReplicationStorageClassificationMappingName, "storageClassificationMappingName") + if id.ReplicationStorageClassificationMappingName != "replicationStorageClassificationMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationMappingName'", id.ReplicationStorageClassificationMappingName, "replicationStorageClassificationMappingName") } } func TestFormatReplicationStorageClassificationMappingID(t *testing.T) { - actual := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName" + actual := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationStorageClassificationMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", - ReplicationStorageClassificationMappingName: "storageClassificationMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", + ReplicationStorageClassificationMappingName: "replicationStorageClassificationMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationStorageClassificationMappingIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", - ReplicationStorageClassificationMappingName: "storageClassificationMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", + ReplicationStorageClassificationMappingName: "replicationStorageClassificationMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/sToRaGeClAsSiFiCaTiOnMaPpInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", - ReplicationStorageClassificationMappingName: "sToRaGeClAsSiFiCaTiOnMaPpInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", + ReplicationStorageClassificationMappingName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/sToRaGeClAsSiFiCaTiOnMaPpInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_vault.go index 21b75b920e0..e792b2e3f57 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_vault_test.go index 73ba9056908..fc6942dc1c9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassificationmappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/README.md index 7513f4ffbd5..8f0e69e92ec 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationstorageclassifications.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") +id := replicationstorageclassifications.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationstorageclassifications.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationstorageclassifications.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationstorageclassifications.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationstorageclassifications.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationfabric.go index 98d8bd783a2..e2899f5fecb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationfabric_test.go index c9f379bec3b..726bd85a5dc 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationstorageclassification.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationstorageclassification.go index 81c1b64d092..8e8996b47e8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationstorageclassification.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationstorageclassification.go @@ -127,11 +127,11 @@ func (id ReplicationStorageClassificationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationstorageclassification_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationstorageclassification_test.go index 3a50dd4d3a9..e66a6025f8c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationstorageclassification_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_replicationstorageclassification_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationId{} func TestNewReplicationStorageClassificationID(t *testing.T) { - id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") + id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationStorageClassificationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } } func TestFormatReplicationStorageClassificationID(t *testing.T) { - actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName" + actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationStorageClassificationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationStorageClassificationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_vault.go index 15acbb5190f..e6e8ef1f8a7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_vault_test.go index 70408cb72ae..f166541032d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationstorageclassifications/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/README.md index 92ca2393913..a0609764329 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/id_vault.go index 5f01afb39da..bfec839dc80 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/id_vault_test.go index 7b50331b8cc..1eed0241695 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaulthealth/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/README.md index dbaccd4ec92..20818b59436 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") +id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") payload := replicationvaultsetting.VaultSettingCreationInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") +id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvaultsetting.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaultsetting.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_replicationvaultsetting.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_replicationvaultsetting.go index db0dd36ef4d..ecf9719a633 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_replicationvaultsetting.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_replicationvaultsetting.go @@ -121,9 +121,9 @@ func (id ReplicationVaultSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationVaultSettings", "replicationVaultSettings", "replicationVaultSettings"), - resourceids.UserSpecifiedSegment("replicationVaultSettingName", "vaultSettingName"), + resourceids.UserSpecifiedSegment("replicationVaultSettingName", "replicationVaultSettingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_replicationvaultsetting_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_replicationvaultsetting_test.go index 34e14537f4f..bf6d3aeb9ce 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_replicationvaultsetting_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_replicationvaultsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationVaultSettingId{} func TestNewReplicationVaultSettingID(t *testing.T) { - id := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") + id := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationVaultSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationVaultSettingName != "vaultSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationVaultSettingName'", id.ReplicationVaultSettingName, "vaultSettingName") + if id.ReplicationVaultSettingName != "replicationVaultSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationVaultSettingName'", id.ReplicationVaultSettingName, "replicationVaultSettingName") } } func TestFormatReplicationVaultSettingID(t *testing.T) { - actual := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName" + actual := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationVaultSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationVaultSettingName: "vaultSettingName", + VaultName: "vaultName", + ReplicationVaultSettingName: "replicationVaultSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationVaultSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationVaultSettingName: "vaultSettingName", + VaultName: "vaultName", + ReplicationVaultSettingName: "replicationVaultSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS/vAuLtSeTtInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS/rEpLiCaTiOnVaUlTsEtTiNgNaMe", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationVaultSettingName: "vAuLtSeTtInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationVaultSettingName: "rEpLiCaTiOnVaUlTsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS/vAuLtSeTtInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS/rEpLiCaTiOnVaUlTsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_vault.go index 30405e4ff37..26d5327d79b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_vault_test.go index 26d5afc2275..db40ac61c76 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvaultsetting/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/README.md index 1e3da7536c3..7ac9b90a845 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") payload := replicationvcenters.AddVCenterRequest{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvcenters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationvcenters.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") payload := replicationvcenters.UpdateVCenterRequest{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationfabric.go index 2b2d9ed460e..02266219cb8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationfabric_test.go index e96172e94ee..34ad51f05fd 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationvcenter.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationvcenter.go index ddcd8bb416d..0737f2b9eb7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationvcenter.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationvcenter.go @@ -127,11 +127,11 @@ func (id ReplicationvCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationvCenters", "replicationvCenters", "replicationvCenters"), - resourceids.UserSpecifiedSegment("replicationvCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("replicationvCenterName", "replicationvCenterName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationvcenter_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationvcenter_test.go index c4c39c44feb..9825c94a29a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationvcenter_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_replicationvcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationvCenterId{} func TestNewReplicationvCenterID(t *testing.T) { - id := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") + id := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationvCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationvCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationvCenterName'", id.ReplicationvCenterName, "vcenterName") + if id.ReplicationvCenterName != "replicationvCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationvCenterName'", id.ReplicationvCenterName, "replicationvCenterName") } } func TestFormatReplicationvCenterID(t *testing.T) { - actual := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName" + actual := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationvCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationvCenterName: "vcenterName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationvCenterName: "replicationvCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationvCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationvCenterName: "vcenterName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationvCenterName: "replicationvCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs/vCeNtErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs/rEpLiCaTiOnVcEnTeRnAmE", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationvCenterName: "vCeNtErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationvCenterName: "rEpLiCaTiOnVcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs/vCeNtErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs/rEpLiCaTiOnVcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_vault.go index 13ce0b3f0ef..e37ff91d564 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_vault_test.go index df951ba3b35..d474d05200f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/replicationvcenters/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/README.md index d259234b1f5..7ef021245b5 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := supportedoperatingsystems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := supportedoperatingsystems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") read, err := client.Get(ctx, id, supportedoperatingsystems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/id_vault.go index c8c2297e843..2577775d89c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/id_vault_test.go index a30da0e201d..84334cd878a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/supportedoperatingsystems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/README.md b/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/README.md index c4e9faaf392..e9f5b3ae772 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := targetcomputesizes.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := targetcomputesizes.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") // alternatively `client.ListByReplicationProtectedItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectedItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/id_replicationprotecteditem.go index 615b84e8509..980d5cc9c99 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/id_replicationprotecteditem_test.go index 6fe9b86a24a..79746b3b3a0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-02-01/targetcomputesizes/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/README.md index 452628e18cd..1546ca72171 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := clusterrecoverypoint.NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName", "recoveryPointName") +id := clusterrecoverypoint.NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName", "recoveryPointName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint.go index 6b404add055..cb85902f9a5 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint.go @@ -139,11 +139,11 @@ func (id ReplicationProtectionClusterRecoveryPointId) Segments() []resourceids.S resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionClusters", "replicationProtectionClusters", "replicationProtectionClusters"), resourceids.UserSpecifiedSegment("replicationProtectionClusterName", "replicationProtectionClusterName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint_test.go index 779b658f94a..976ddec572b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoint/id_replicationprotectionclusterrecoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionClusterRecoveryPointId{} func TestNewReplicationProtectionClusterRecoveryPointID(t *testing.T) { - id := NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName", "recoveryPointName") + id := NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName", "recoveryPointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewReplicationProtectionClusterRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } if id.ReplicationProtectionClusterName != "replicationProtectionClusterName" { @@ -44,8 +44,8 @@ func TestNewReplicationProtectionClusterRecoveryPointID(t *testing.T) { } func TestFormatReplicationProtectionClusterRecoveryPointID(t *testing.T) { - actual := NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName", "recoveryPointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName" + actual := NewReplicationProtectionClusterRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName", "recoveryPointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseReplicationProtectionClusterRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName", Expected: &ReplicationProtectionClusterRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseReplicationProtectionClusterRecoveryPointIDInsensitively(t *testin }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName", Expected: &ReplicationProtectionClusterRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/recoveryPoints/recoveryPointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", Expected: &ReplicationProtectionClusterRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", ReplicationProtectionClusterName: "rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", RecoveryPointName: "rEcOvErYpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/README.md index 351d9f9ce3a..7521903e6fb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := clusterrecoverypoints.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := clusterrecoverypoints.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") // alternatively `client.ListByReplicationProtectionCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionClusterComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/id_replicationprotectioncluster.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/id_replicationprotectioncluster.go index 075e8f3f88d..7e5b399bbfb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/id_replicationprotectioncluster.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/id_replicationprotectioncluster.go @@ -133,11 +133,11 @@ func (id ReplicationProtectionClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionClusters", "replicationProtectionClusters", "replicationProtectionClusters"), resourceids.UserSpecifiedSegment("replicationProtectionClusterName", "replicationProtectionClusterName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/id_replicationprotectioncluster_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/id_replicationprotectioncluster_test.go index f23b1bbfed1..37dd3a94fa4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/id_replicationprotectioncluster_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/clusterrecoverypoints/id_replicationprotectioncluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionClusterId{} func TestNewReplicationProtectionClusterID(t *testing.T) { - id := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") + id := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewReplicationProtectionClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } if id.ReplicationProtectionClusterName != "replicationProtectionClusterName" { @@ -40,8 +40,8 @@ func TestNewReplicationProtectionClusterID(t *testing.T) { } func TestFormatReplicationProtectionClusterID(t *testing.T) { - actual := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName" + actual := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectionClusterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectionClusterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", ReplicationProtectionClusterName: "rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/README.md index 8dd6abe7b58..ebd26597ec2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := migrationrecoverypoints.NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName") +id := migrationrecoverypoints.NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := migrationrecoverypoints.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := migrationrecoverypoints.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") // alternatively `client.ListByReplicationMigrationItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationMigrationItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_migrationrecoverypoint.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_migrationrecoverypoint.go index 752ee034412..f0e9101261c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_migrationrecoverypoint.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_migrationrecoverypoint.go @@ -139,13 +139,13 @@ func (id MigrationRecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), resourceids.StaticSegment("staticMigrationRecoveryPoints", "migrationRecoveryPoints", "migrationRecoveryPoints"), resourceids.UserSpecifiedSegment("migrationRecoveryPointName", "migrationRecoveryPointName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go index 7c74dacadd3..d216774042c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_migrationrecoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MigrationRecoveryPointId{} func TestNewMigrationRecoveryPointID(t *testing.T) { - id := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName") + id := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewMigrationRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } if id.MigrationRecoveryPointName != "migrationRecoveryPointName" { @@ -44,8 +44,8 @@ func TestNewMigrationRecoveryPointID(t *testing.T) { } func TestFormatMigrationRecoveryPointID(t *testing.T) { - actual := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName", "migrationRecoveryPointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName" + actual := NewMigrationRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName", "migrationRecoveryPointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseMigrationRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", MigrationRecoveryPointName: "migrationRecoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseMigrationRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", MigrationRecoveryPointName: "migrationRecoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/migrationRecoveryPoints/migrationRecoveryPointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE", Expected: &MigrationRecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", MigrationRecoveryPointName: "mIgRaTiOnReCoVeRyPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/mIgRaTiOnReCoVeRyPoInTs/mIgRaTiOnReCoVeRyPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_replicationmigrationitem.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_replicationmigrationitem.go index 027a4d6a709..9ccb9efa50b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_replicationmigrationitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_replicationmigrationitem.go @@ -133,13 +133,13 @@ func (id ReplicationMigrationItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_replicationmigrationitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_replicationmigrationitem_test.go index 24383f205f4..dde2cd4e339 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_replicationmigrationitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/migrationrecoverypoints/id_replicationmigrationitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationMigrationItemId{} func TestNewReplicationMigrationItemID(t *testing.T) { - id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") + id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationMigrationItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } } func TestFormatReplicationMigrationItemID(t *testing.T) { - actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName" + actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationMigrationItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationMigrationItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/README.md index bc96b643004..1a33a51ea4e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName") +id := recoverypoints.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recoverypoints.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := recoverypoints.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") // alternatively `client.ListByReplicationProtectedItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectedItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_recoverypoint.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_recoverypoint.go index 5c25218f1d4..961edec2d6d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_recoverypoint.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_recoverypoint.go @@ -139,13 +139,13 @@ func (id RecoveryPointId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), resourceids.UserSpecifiedSegment("recoveryPointName", "recoveryPointName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_recoverypoint_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_recoverypoint_test.go index dd1f423957f..f7195561c72 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_recoverypoint_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_recoverypoint_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoveryPointId{} func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName") + id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,20 +22,20 @@ func TestNewRecoveryPointID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } if id.RecoveryPointName != "recoveryPointName" { @@ -44,8 +44,8 @@ func TestNewRecoveryPointID(t *testing.T) { } func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName", "recoveryPointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName" + actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName", "recoveryPointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseRecoveryPointID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseRecoveryPointIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", RecoveryPointName: "recoveryPointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/recoveryPoints/recoveryPointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/recoveryPoints/recoveryPointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe", Expected: &RecoveryPointId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", RecoveryPointName: "rEcOvErYpOiNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/rEcOvErYpOiNtS/rEcOvErYpOiNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_replicationprotecteditem.go index e3bb58daad9..6c0d7acae11 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_replicationprotecteditem_test.go index d7001321908..f60a0f6a4a3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/recoverypoints/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/README.md index 617713ed96e..67d9bde6985 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") +id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") payload := replicationalertsettings.ConfigureAlertRequest{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") +id := replicationalertsettings.NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationalertsettings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationalertsettings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_replicationalertsetting.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_replicationalertsetting.go index 8a0e7289454..58cedfe08d3 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_replicationalertsetting.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_replicationalertsetting.go @@ -121,9 +121,9 @@ func (id ReplicationAlertSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationAlertSettings", "replicationAlertSettings", "replicationAlertSettings"), - resourceids.UserSpecifiedSegment("replicationAlertSettingName", "alertSettingName"), + resourceids.UserSpecifiedSegment("replicationAlertSettingName", "replicationAlertSettingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_replicationalertsetting_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_replicationalertsetting_test.go index f422ed36f3a..56e5094c009 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_replicationalertsetting_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_replicationalertsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationAlertSettingId{} func TestNewReplicationAlertSettingID(t *testing.T) { - id := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName") + id := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationAlertSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationAlertSettingName != "alertSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationAlertSettingName'", id.ReplicationAlertSettingName, "alertSettingName") + if id.ReplicationAlertSettingName != "replicationAlertSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationAlertSettingName'", id.ReplicationAlertSettingName, "replicationAlertSettingName") } } func TestFormatReplicationAlertSettingID(t *testing.T) { - actual := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "alertSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName" + actual := NewReplicationAlertSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationAlertSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationAlertSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationAlertSettingName: "alertSettingName", + VaultName: "vaultName", + ReplicationAlertSettingName: "replicationAlertSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationAlertSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationAlertSettingName: "alertSettingName", + VaultName: "vaultName", + ReplicationAlertSettingName: "replicationAlertSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationAlertSettings/alertSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationAlertSettings/replicationAlertSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS/aLeRtSeTtInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS/rEpLiCaTiOnAlErTsEtTiNgNaMe", Expected: &ReplicationAlertSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationAlertSettingName: "aLeRtSeTtInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationAlertSettingName: "rEpLiCaTiOnAlErTsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnAlErTsEtTiNgS/aLeRtSeTtInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnAlErTsEtTiNgS/rEpLiCaTiOnAlErTsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_vault.go index 5959ea2b7ea..4d0e369d238 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_vault_test.go index 76fd493fb3e..9d66b7eb7e7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationalertsettings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/README.md index 304d3bf7aa2..3c0dbb68e54 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationappliances.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationappliances.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationappliances.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationappliances.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/id_vault.go index 0b8f2f357fa..840bc253579 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/id_vault_test.go index 440cf83eb99..b55e9882b37 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationappliances/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/README.md index f10958aec4f..3f55a8b1490 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationevents.NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName") +id := replicationevents.NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationevents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationevents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationevents.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationevents.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_replicationevent.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_replicationevent.go index 8cceef37e74..9a94a8d463c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_replicationevent.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_replicationevent.go @@ -121,9 +121,9 @@ func (id ReplicationEventId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationEvents", "replicationEvents", "replicationEvents"), - resourceids.UserSpecifiedSegment("replicationEventName", "eventName"), + resourceids.UserSpecifiedSegment("replicationEventName", "replicationEventName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_replicationevent_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_replicationevent_test.go index 048f9f24dab..f4be6ef83fd 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_replicationevent_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_replicationevent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationEventId{} func TestNewReplicationEventID(t *testing.T) { - id := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName") + id := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationEventID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationEventName != "eventName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationEventName'", id.ReplicationEventName, "eventName") + if id.ReplicationEventName != "replicationEventName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationEventName'", id.ReplicationEventName, "replicationEventName") } } func TestFormatReplicationEventID(t *testing.T) { - actual := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "eventName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName" + actual := NewReplicationEventID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationEventName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationEventID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationEventName: "eventName", + VaultName: "vaultName", + ReplicationEventName: "replicationEventName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationEventIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationEventName: "eventName", + VaultName: "vaultName", + ReplicationEventName: "replicationEventName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationEvents/eventName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationEvents/replicationEventName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs/eVeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs/rEpLiCaTiOnEvEnTnAmE", Expected: &ReplicationEventId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationEventName: "eVeNtNaMe", + VaultName: "vAuLtNaMe", + ReplicationEventName: "rEpLiCaTiOnEvEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnEvEnTs/eVeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnEvEnTs/rEpLiCaTiOnEvEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_vault.go index 08164fe4eee..f540d5ea573 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_vault_test.go index 3706228ecd7..fc824ae5e8b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationevents/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/README.md index 90c709e1461..cf3e44f215a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.CheckConsistencyThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CheckConsistencyThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.FabricCreationInput{ // ... @@ -53,7 +53,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -65,7 +65,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") read, err := client.Get(ctx, id, replicationfabrics.DefaultGetOperationOptions()) if err != nil { @@ -81,7 +81,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationfabrics.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -98,7 +98,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.MigrateToAadThenPoll(ctx, id); err != nil { // handle the error @@ -110,7 +110,7 @@ if err := client.MigrateToAadThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -122,7 +122,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.FailoverProcessServerRequest{ // ... @@ -139,7 +139,7 @@ if err := client.ReassociateGatewayThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if err := client.RemoveInfraThenPoll(ctx, id); err != nil { // handle the error @@ -151,7 +151,7 @@ if err := client.RemoveInfraThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationfabrics.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") payload := replicationfabrics.RenewCertificateInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_replicationfabric.go index 543c6b7ed30..020505872b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_replicationfabric_test.go index 6f8bf12bb5f..19edc4fbec2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_vault.go index a26b6403ff5..d5e352feba9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_vault_test.go index 0e25b12412a..a8000d12f4a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationfabrics/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/README.md index c6cb756491b..d460bb33709 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if err := client.CancelThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.CancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") payload := replicationjobs.JobQueryParameter{ // ... @@ -53,7 +53,7 @@ if err := client.ExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationjobs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationjobs.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationjobs.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") +id := replicationjobs.NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") payload := replicationjobs.ResumeJobParams{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_replicationjob.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_replicationjob.go index 5be22f9f962..4abf5a4a7be 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_replicationjob.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_replicationjob.go @@ -121,9 +121,9 @@ func (id ReplicationJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationJobs", "replicationJobs", "replicationJobs"), - resourceids.UserSpecifiedSegment("replicationJobName", "jobName"), + resourceids.UserSpecifiedSegment("replicationJobName", "replicationJobName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_replicationjob_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_replicationjob_test.go index 96fa5d5e3b9..1f54c3772b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_replicationjob_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_replicationjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationJobId{} func TestNewReplicationJobID(t *testing.T) { - id := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName") + id := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationJobName'", id.ReplicationJobName, "jobName") + if id.ReplicationJobName != "replicationJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationJobName'", id.ReplicationJobName, "replicationJobName") } } func TestFormatReplicationJobID(t *testing.T) { - actual := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName" + actual := NewReplicationJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationJobName: "jobName", + VaultName: "vaultName", + ReplicationJobName: "replicationJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationJobName: "jobName", + VaultName: "vaultName", + ReplicationJobName: "replicationJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationJobs/replicationJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs/rEpLiCaTiOnJoBnAmE", Expected: &ReplicationJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationJobName: "jObNaMe", + VaultName: "vAuLtNaMe", + ReplicationJobName: "rEpLiCaTiOnJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnJoBs/rEpLiCaTiOnJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_vault.go index 9269e4fa589..da6fbb451d2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_vault_test.go index 1ed11cd7739..33e578b5b44 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationjobs/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/README.md index f47b01812da..a66b3eeaadf 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationlogicalnetworks.NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName") +id := replicationlogicalnetworks.NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationlogicalnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationlogicalnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationfabric.go index 196c6fa3801..cd151e6011f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationfabric_test.go index 345754c84e8..09d32c71688 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go index a00d702ee95..7f9fd6f74ba 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationlogicalnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationLogicalNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationLogicalNetworks", "replicationLogicalNetworks", "replicationLogicalNetworks"), - resourceids.UserSpecifiedSegment("replicationLogicalNetworkName", "logicalNetworkName"), + resourceids.UserSpecifiedSegment("replicationLogicalNetworkName", "replicationLogicalNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go index 6a416d05a53..d0a55e18453 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationlogicalnetworks/id_replicationlogicalnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationLogicalNetworkId{} func TestNewReplicationLogicalNetworkID(t *testing.T) { - id := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName") + id := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationLogicalNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationLogicalNetworkName != "logicalNetworkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationLogicalNetworkName'", id.ReplicationLogicalNetworkName, "logicalNetworkName") + if id.ReplicationLogicalNetworkName != "replicationLogicalNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationLogicalNetworkName'", id.ReplicationLogicalNetworkName, "replicationLogicalNetworkName") } } func TestFormatReplicationLogicalNetworkID(t *testing.T) { - actual := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "logicalNetworkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName" + actual := NewReplicationLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationLogicalNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationLogicalNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationLogicalNetworkName: "logicalNetworkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationLogicalNetworkName: "replicationLogicalNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationLogicalNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationLogicalNetworkName: "logicalNetworkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationLogicalNetworkName: "replicationLogicalNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationLogicalNetworks/logicalNetworkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationLogicalNetworks/replicationLogicalNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS/lOgIcAlNeTwOrKnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS/rEpLiCaTiOnLoGiCaLnEtWoRkNaMe", Expected: &ReplicationLogicalNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationLogicalNetworkName: "lOgIcAlNeTwOrKnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationLogicalNetworkName: "rEpLiCaTiOnLoGiCaLnEtWoRkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnLoGiCaLnEtWoRkS/lOgIcAlNeTwOrKnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnLoGiCaLnEtWoRkS/rEpLiCaTiOnLoGiCaLnEtWoRkNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/README.md index 7901db9e2a7..678fbc62303 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.EnableMigrationInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if err := client.DeleteThenPoll(ctx, id, replicationmigrationitems.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id, replicationmigrationitems.DefaultDelete ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationmigrationitems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationmigrationitems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationmigrationitems.DefaultListOperationOptions()) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationmigrationitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id, replicationmigrationitems.DefaultListByReplicationProtectionContainersOperationOptions())` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id, replicationmigrationitems.DefaultListByReplicationProtectionContainersOperationOptions()) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.MigrateInput{ // ... @@ -120,7 +120,7 @@ if err := client.MigrateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.PauseReplicationInput{ // ... @@ -137,7 +137,7 @@ if err := client.PauseReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.ResumeReplicationInput{ // ... @@ -154,7 +154,7 @@ if err := client.ResumeReplicationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.ResyncInput{ // ... @@ -171,7 +171,7 @@ if err := client.ResyncThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.TestMigrateInput{ // ... @@ -188,7 +188,7 @@ if err := client.TestMigrateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.TestMigrateCleanupInput{ // ... @@ -205,7 +205,7 @@ if err := client.TestMigrateCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") +id := replicationmigrationitems.NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") payload := replicationmigrationitems.UpdateMigrationItemInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationmigrationitem.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationmigrationitem.go index 349e9ee5fb7..af2c070a6aa 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationmigrationitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationmigrationitem.go @@ -133,13 +133,13 @@ func (id ReplicationMigrationItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationMigrationItems", "replicationMigrationItems", "replicationMigrationItems"), - resourceids.UserSpecifiedSegment("replicationMigrationItemName", "migrationItemName"), + resourceids.UserSpecifiedSegment("replicationMigrationItemName", "replicationMigrationItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationmigrationitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationmigrationitem_test.go index 71602c091d3..3df0ca67a2d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationmigrationitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationmigrationitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationMigrationItemId{} func TestNewReplicationMigrationItemID(t *testing.T) { - id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName") + id := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationMigrationItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationMigrationItemName != "migrationItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "migrationItemName") + if id.ReplicationMigrationItemName != "replicationMigrationItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationMigrationItemName'", id.ReplicationMigrationItemName, "replicationMigrationItemName") } } func TestFormatReplicationMigrationItemID(t *testing.T) { - actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "migrationItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName" + actual := NewReplicationMigrationItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationMigrationItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationMigrationItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationMigrationItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationMigrationItemName: "migrationItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationMigrationItemName: "replicationMigrationItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationMigrationItems/migrationItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationMigrationItems/replicationMigrationItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE", Expected: &ReplicationMigrationItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationMigrationItemName: "mIgRaTiOnItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationMigrationItemName: "rEpLiCaTiOnMiGrAtIoNiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnMiGrAtIoNiTeMs/mIgRaTiOnItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnMiGrAtIoNiTeMs/rEpLiCaTiOnMiGrAtIoNiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationprotectioncontainer.go index 3fd1310f68c..f6b59f9a420 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go index 65fe630e5ef..7d99ad5e9be 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_vault.go index e1c1fa8bcc6..5d25616da85 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_vault_test.go index 807a2b87c52..b0b22c1e6a7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/model_managedruncommandscriptinput.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/model_managedruncommandscriptinput.go index 29941ef4979..5ee3b09a915 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/model_managedruncommandscriptinput.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationmigrationitems/model_managedruncommandscriptinput.go @@ -5,6 +5,6 @@ package replicationmigrationitems type ManagedRunCommandScriptInput struct { ScriptParameters string `json:"scriptParameters"` - ScriptUrl string `json:"scriptUrl"` + ScriptURL string `json:"scriptUrl"` StepName string `json:"stepName"` } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/README.md index d1cccf2ddc4..f0490bf76c9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") payload := replicationnetworkmappings.CreateNetworkMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationnetworkmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") +id := replicationnetworkmappings.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") // alternatively `client.ListByReplicationNetworks(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationNetworksComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") +id := replicationnetworkmappings.NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") payload := replicationnetworkmappings.UpdateNetworkMappingInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetwork.go index ee4dfc3a51f..bc0a19b4b6e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetwork_test.go index 3120f4e7ba8..82963269f22 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkId{} func TestNewReplicationNetworkID(t *testing.T) { - id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") + id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } } func TestFormatReplicationNetworkID(t *testing.T) { - actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName" + actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetworkmapping.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetworkmapping.go index b2735d87b57..f35ea2e5232 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetworkmapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetworkmapping.go @@ -133,13 +133,13 @@ func (id ReplicationNetworkMappingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), resourceids.StaticSegment("staticReplicationNetworkMappings", "replicationNetworkMappings", "replicationNetworkMappings"), - resourceids.UserSpecifiedSegment("replicationNetworkMappingName", "networkMappingName"), + resourceids.UserSpecifiedSegment("replicationNetworkMappingName", "replicationNetworkMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go index 6f7602aef17..1d386c1e039 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_replicationnetworkmapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkMappingId{} func TestNewReplicationNetworkMappingID(t *testing.T) { - id := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName") + id := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationNetworkMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } - if id.ReplicationNetworkMappingName != "networkMappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkMappingName'", id.ReplicationNetworkMappingName, "networkMappingName") + if id.ReplicationNetworkMappingName != "replicationNetworkMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkMappingName'", id.ReplicationNetworkMappingName, "replicationNetworkMappingName") } } func TestFormatReplicationNetworkMappingID(t *testing.T) { - actual := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName", "networkMappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName" + actual := NewReplicationNetworkMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName", "replicationNetworkMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationNetworkMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", - ReplicationNetworkMappingName: "networkMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", + ReplicationNetworkMappingName: "replicationNetworkMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationNetworkMappingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", - ReplicationNetworkMappingName: "networkMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", + ReplicationNetworkMappingName: "replicationNetworkMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/replicationNetworkMappings/networkMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/replicationNetworkMappings/replicationNetworkMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS/nEtWoRkMaPpInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS/rEpLiCaTiOnNeTwOrKmApPiNgNaMe", Expected: &ReplicationNetworkMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", - ReplicationNetworkMappingName: "nEtWoRkMaPpInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", + ReplicationNetworkMappingName: "rEpLiCaTiOnNeTwOrKmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/rEpLiCaTiOnNeTwOrKmApPiNgS/nEtWoRkMaPpInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/rEpLiCaTiOnNeTwOrKmApPiNgS/rEpLiCaTiOnNeTwOrKmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_vault.go index ebfe061bdb2..5cecc8e3e7f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_vault_test.go index b24f77c90b4..0403f3ac48e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworkmappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/README.md index 3c90c151430..497045a9474 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationnetworks.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") +id := replicationnetworks.NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationnetworks.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationnetworks.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationnetworks.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationfabric.go index f2b991fe1ea..a8c98a7e306 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationfabric_test.go index 7adf449d0ed..e06cfc4dd1a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationnetwork.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationnetwork.go index 56d0fe3f65f..edf86f27ed8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationnetwork.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationnetwork.go @@ -127,11 +127,11 @@ func (id ReplicationNetworkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationNetworks", "replicationNetworks", "replicationNetworks"), - resourceids.UserSpecifiedSegment("replicationNetworkName", "networkName"), + resourceids.UserSpecifiedSegment("replicationNetworkName", "replicationNetworkName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationnetwork_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationnetwork_test.go index 78fd36447b1..876c102db90 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationnetwork_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_replicationnetwork_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationNetworkId{} func TestNewReplicationNetworkID(t *testing.T) { - id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName") + id := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationNetworkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationNetworkName != "networkName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "networkName") + if id.ReplicationNetworkName != "replicationNetworkName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationNetworkName'", id.ReplicationNetworkName, "replicationNetworkName") } } func TestFormatReplicationNetworkID(t *testing.T) { - actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "networkName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName" + actual := NewReplicationNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationNetworkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationNetworkID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationNetworkIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationNetworkName: "networkName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationNetworkName: "replicationNetworkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationNetworks/networkName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationNetworks/replicationNetworkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE", Expected: &ReplicationNetworkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationNetworkName: "nEtWoRkNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationNetworkName: "rEpLiCaTiOnNeTwOrKnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnNeTwOrKs/nEtWoRkNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnNeTwOrKs/rEpLiCaTiOnNeTwOrKnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_vault.go index 9819f106905..57c8e9dba03 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_vault_test.go index 523f645b8f6..4baea566f21 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationnetworks/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/README.md index 0f41a3db189..81df4a110aa 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") payload := replicationpolicies.CreatePolicyInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationpolicies.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationpolicies.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") +id := replicationpolicies.NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") payload := replicationpolicies.UpdatePolicyInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_replicationpolicy.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_replicationpolicy.go index bfa93e62ba4..8e52815a483 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_replicationpolicy.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_replicationpolicy.go @@ -121,9 +121,9 @@ func (id ReplicationPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationPolicies", "replicationPolicies", "replicationPolicies"), - resourceids.UserSpecifiedSegment("replicationPolicyName", "policyName"), + resourceids.UserSpecifiedSegment("replicationPolicyName", "replicationPolicyName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_replicationpolicy_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_replicationpolicy_test.go index 0af62e99af0..a22bec723f0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_replicationpolicy_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_replicationpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationPolicyId{} func TestNewReplicationPolicyID(t *testing.T) { - id := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName") + id := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationPolicyName != "policyName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationPolicyName'", id.ReplicationPolicyName, "policyName") + if id.ReplicationPolicyName != "replicationPolicyName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationPolicyName'", id.ReplicationPolicyName, "replicationPolicyName") } } func TestFormatReplicationPolicyID(t *testing.T) { - actual := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "policyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName" + actual := NewReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationPolicyName: "policyName", + VaultName: "vaultName", + ReplicationPolicyName: "replicationPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationPolicyName: "policyName", + VaultName: "vaultName", + ReplicationPolicyName: "replicationPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationPolicies/policyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationPolicies/replicationPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs/pOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs/rEpLiCaTiOnPoLiCyNaMe", Expected: &ReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationPolicyName: "pOlIcYnAmE", + VaultName: "vAuLtNaMe", + ReplicationPolicyName: "rEpLiCaTiOnPoLiCyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPoLiCiEs/pOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPoLiCiEs/rEpLiCaTiOnPoLiCyNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_vault.go index 31f525956e7..e16dd3da492 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_vault_test.go index df63447ec2e..8c7119dc1f2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationpolicies/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/README.md index 2aed175bad9..0e679748d95 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectableitems.NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName") +id := replicationprotectableitems.NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectableitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectableitems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id, replicationprotectableitems.DefaultListByReplicationProtectionContainersOperationOptions())` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id, replicationprotectableitems.DefaultListByReplicationProtectionContainersOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectableitem.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectableitem.go index 063a750b792..5688af5bd49 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectableitem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectableitem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectableItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectableItems", "replicationProtectableItems", "replicationProtectableItems"), - resourceids.UserSpecifiedSegment("replicationProtectableItemName", "protectableItemName"), + resourceids.UserSpecifiedSegment("replicationProtectableItemName", "replicationProtectableItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectableitem_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectableitem_test.go index bd8b1ae136d..5ca442edaf4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectableitem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectableitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectableItemId{} func TestNewReplicationProtectableItemID(t *testing.T) { - id := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName") + id := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectableItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectableItemName != "protectableItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectableItemName'", id.ReplicationProtectableItemName, "protectableItemName") + if id.ReplicationProtectableItemName != "replicationProtectableItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectableItemName'", id.ReplicationProtectableItemName, "replicationProtectableItemName") } } func TestFormatReplicationProtectableItemID(t *testing.T) { - actual := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "protectableItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName" + actual := NewReplicationProtectableItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectableItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectableItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectableItemName: "protectableItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectableItemName: "replicationProtectableItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectableItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectableItemName: "protectableItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectableItemName: "replicationProtectableItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectableItems/protectableItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectableItems/replicationProtectableItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs/pRoTeCtAbLeItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs/rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE", Expected: &ReplicationProtectableItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectableItemName: "pRoTeCtAbLeItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectableItemName: "rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTaBlEiTeMs/pRoTeCtAbLeItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTaBlEiTeMs/rEpLiCaTiOnPrOtEcTaBlEiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectioncontainer.go index dd994133f3e..f23f4dd7edc 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go index f8737867968..34d92bb2295 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectableitems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/README.md index d46dc53e5cb..00676074104 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.AddDisksInput{ // ... @@ -41,7 +41,7 @@ if err := client.AddDisksThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ApplyRecoveryPointInput{ // ... @@ -58,7 +58,7 @@ if err := client.ApplyRecoveryPointThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.EnableProtectionInput{ // ... @@ -75,7 +75,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.DisableProtectionInput{ // ... @@ -92,7 +92,7 @@ if err := client.DeleteThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.FailoverCancelThenPoll(ctx, id); err != nil { // handle the error @@ -104,7 +104,7 @@ if err := client.FailoverCancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.FailoverCommitThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.FailoverCommitThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") read, err := client.Get(ctx, id) if err != nil { @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotecteditems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationprotecteditems.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationprotecteditems.DefaultListOperationOptions()) @@ -149,7 +149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotecteditems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id) @@ -166,7 +166,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.PlannedFailoverInput{ // ... @@ -183,7 +183,7 @@ if err := client.PlannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -195,7 +195,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.RemoveDisksInput{ // ... @@ -212,7 +212,7 @@ if err := client.RemoveDisksThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if err := client.RepairReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -224,7 +224,7 @@ if err := client.RepairReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ReverseReplicationInput{ // ... @@ -241,7 +241,7 @@ if err := client.ReprotectThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.ResolveHealthInput{ // ... @@ -258,7 +258,7 @@ if err := client.ResolveHealthErrorsThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.SwitchProviderInput{ // ... @@ -275,7 +275,7 @@ if err := client.SwitchProviderThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.TestFailoverInput{ // ... @@ -292,7 +292,7 @@ if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.TestFailoverCleanupInput{ // ... @@ -309,7 +309,7 @@ if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UnplannedFailoverInput{ // ... @@ -326,7 +326,7 @@ if err := client.UnplannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateReplicationProtectedItemInput{ // ... @@ -343,7 +343,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateApplianceForReplicationProtectedItemInput{ // ... @@ -360,7 +360,7 @@ if err := client.UpdateApplianceThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") payload := replicationprotecteditems.UpdateMobilityServiceRequest{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotecteditem.go index 619562136d7..ec2c5d221c2 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotecteditem_test.go index 606f34b42bd..af1be070147 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotectioncontainer.go index 3b60acb0471..90d3e87f91d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go index 839ec0dfc63..6a6c47d5d94 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_vault.go index 4c54630eaad..35eb0fa0277 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_vault_test.go index abe1e462a85..85390476d93 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotecteditems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/README.md index e8ad94f7e7c..33a34cda5be 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ApplyClusterRecoveryPointInput{ // ... @@ -41,7 +41,7 @@ if err := client.ApplyRecoveryPointThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ReplicationProtectionCluster{ // ... @@ -58,7 +58,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if err := client.FailoverCommitThenPoll(ctx, id); err != nil { // handle the error @@ -70,7 +70,7 @@ if err := client.FailoverCommitThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectionclusters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationprotectionclusters.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationprotectionclusters.DefaultListOperationOptions()) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectionclusters.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id) @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -132,7 +132,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if err := client.RepairReplicationThenPoll(ctx, id); err != nil { // handle the error @@ -144,7 +144,7 @@ if err := client.RepairReplicationThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ClusterTestFailoverInput{ // ... @@ -161,7 +161,7 @@ if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ClusterTestFailoverCleanupInput{ // ... @@ -178,7 +178,7 @@ if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") +id := replicationprotectionclusters.NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") payload := replicationprotectionclusters.ClusterUnplannedFailoverInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncluster.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncluster.go index 8b8fd548ba9..2f390968800 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncluster.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncluster.go @@ -133,11 +133,11 @@ func (id ReplicationProtectionClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionClusters", "replicationProtectionClusters", "replicationProtectionClusters"), resourceids.UserSpecifiedSegment("replicationProtectionClusterName", "replicationProtectionClusterName"), } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncluster_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncluster_test.go index 3232fe2ece3..51d21c9522d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncluster_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionClusterId{} func TestNewReplicationProtectionClusterID(t *testing.T) { - id := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName") + id := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewReplicationProtectionClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } if id.ReplicationProtectionClusterName != "replicationProtectionClusterName" { @@ -40,8 +40,8 @@ func TestNewReplicationProtectionClusterID(t *testing.T) { } func TestFormatReplicationProtectionClusterID(t *testing.T) { - actual := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicationProtectionClusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName" + actual := NewReplicationProtectionClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectionClusterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectionClusterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", ReplicationProtectionClusterName: "replicationProtectionClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionClusters/replicationProtectionClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", Expected: &ReplicationProtectionClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", ReplicationProtectionClusterName: "rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnClUsTeRs/rEpLiCaTiOnPrOtEcTiOnClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncontainer.go index d761ddec007..e6dc5092a4b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncontainer_test.go index b277f14f250..0a7fb19397c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_vault.go index 01ec4fa617e..cc7c01caea9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_vault_test.go index 63c66a89f90..c0019a94ada 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionclusters/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/README.md index 17cc3f6df70..fe3cd190594 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.CreateProtectionContainerMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.RemoveProtectionContainerMappingInput{ // ... @@ -58,7 +58,7 @@ if err := client.DeleteThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectioncontainermappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") // alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectionContainersComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -120,7 +120,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") +id := replicationprotectioncontainermappings.NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") payload := replicationprotectioncontainermappings.UpdateProtectionContainerMappingInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go index ee9a5b2733d..61b19e9b5bb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go index 7ecbdb77424..054eecca438 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go index 1fbd79d1a44..2b2e19aec67 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping.go @@ -133,13 +133,13 @@ func (id ReplicationProtectionContainerMappingId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectionContainerMappings", "replicationProtectionContainerMappings", "replicationProtectionContainerMappings"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerMappingName", "mappingName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerMappingName", "replicationProtectionContainerMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go index de38e43ce9b..3da16c9dc30 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_replicationprotectioncontainermapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerMappingId{} func TestNewReplicationProtectionContainerMappingID(t *testing.T) { - id := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName") + id := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectionContainerMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectionContainerMappingName != "mappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerMappingName'", id.ReplicationProtectionContainerMappingName, "mappingName") + if id.ReplicationProtectionContainerMappingName != "replicationProtectionContainerMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerMappingName'", id.ReplicationProtectionContainerMappingName, "replicationProtectionContainerMappingName") } } func TestFormatReplicationProtectionContainerMappingID(t *testing.T) { - actual := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "mappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName" + actual := NewReplicationProtectionContainerMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectionContainerMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectionContainerMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectionContainerMappingName: "mappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectionContainerMappingName: "replicationProtectionContainerMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectionContainerMappingIDInsensitively(t *testing.T) }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectionContainerMappingName: "mappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectionContainerMappingName: "replicationProtectionContainerMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectionContainerMappings/mappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectionContainerMappings/replicationProtectionContainerMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/mApPiNgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe", Expected: &ReplicationProtectionContainerMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectionContainerMappingName: "mApPiNgNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectionContainerMappingName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/mApPiNgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgS/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_vault.go index 067641d7f6b..732e128c07b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_vault_test.go index 1aa940e3c6b..5d5304ccb76 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainermappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/README.md index 27d78ae8221..aa8e90b7304 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.CreateProtectionContainerInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.DiscoverProtectableItemRequest{ // ... @@ -70,7 +70,7 @@ if err := client.DiscoverProtectableItemThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectioncontainers.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationprotectioncontainers.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.SwitchClusterProtectionInput{ // ... @@ -137,7 +137,7 @@ if err := client.SwitchClusterProtectionThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") +id := replicationprotectioncontainers.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") payload := replicationprotectioncontainers.SwitchProtectionInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationfabric.go index 976708ca52d..3bd079512ad 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationfabric_test.go index 0c8da3dd020..4bf4be40c8e 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go index b8d2d8fb70a..e5592319c54 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationprotectioncontainer.go @@ -127,11 +127,11 @@ func (id ReplicationProtectionContainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go index 508844b562b..a91ca97cb10 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_replicationprotectioncontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionContainerId{} func TestNewReplicationProtectionContainerID(t *testing.T) { - id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName") + id := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationProtectionContainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } } func TestFormatReplicationProtectionContainerID(t *testing.T) { - actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName" + actual := NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationProtectionContainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationProtectionContainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Expected: &ReplicationProtectionContainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_vault.go index f5f018b0031..8bf89545d20 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_vault_test.go index 299181333ca..4d480e32c58 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectioncontainers/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/README.md index 82bd4377b55..315be9345c4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") +id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") payload := replicationprotectionintents.CreateProtectionIntentInput{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") +id := replicationprotectionintents.NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationprotectionintents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationprotectionintents.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id, replicationprotectionintents.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, replicationprotectionintents.DefaultListOperationOptions()) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_replicationprotectionintent.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_replicationprotectionintent.go index dad9f6c7fad..78e9627f11f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_replicationprotectionintent.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_replicationprotectionintent.go @@ -121,9 +121,9 @@ func (id ReplicationProtectionIntentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationProtectionIntents", "replicationProtectionIntents", "replicationProtectionIntents"), - resourceids.UserSpecifiedSegment("replicationProtectionIntentName", "intentObjectName"), + resourceids.UserSpecifiedSegment("replicationProtectionIntentName", "replicationProtectionIntentName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_replicationprotectionintent_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_replicationprotectionintent_test.go index 07e75f6ffa0..b3dedc733d4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_replicationprotectionintent_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_replicationprotectionintent_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectionIntentId{} func TestNewReplicationProtectionIntentID(t *testing.T) { - id := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName") + id := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationProtectionIntentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationProtectionIntentName != "intentObjectName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionIntentName'", id.ReplicationProtectionIntentName, "intentObjectName") + if id.ReplicationProtectionIntentName != "replicationProtectionIntentName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionIntentName'", id.ReplicationProtectionIntentName, "replicationProtectionIntentName") } } func TestFormatReplicationProtectionIntentID(t *testing.T) { - actual := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "intentObjectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName" + actual := NewReplicationProtectionIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationProtectionIntentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationProtectionIntentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationProtectionIntentName: "intentObjectName", + VaultName: "vaultName", + ReplicationProtectionIntentName: "replicationProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationProtectionIntentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationProtectionIntentName: "intentObjectName", + VaultName: "vaultName", + ReplicationProtectionIntentName: "replicationProtectionIntentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationProtectionIntents/intentObjectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationProtectionIntents/replicationProtectionIntentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS/iNtEnToBjEcTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS/rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe", Expected: &ReplicationProtectionIntentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationProtectionIntentName: "iNtEnToBjEcTnAmE", + VaultName: "vAuLtNaMe", + ReplicationProtectionIntentName: "rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnPrOtEcTiOnInTeNtS/iNtEnToBjEcTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnPrOtEcTiOnInTeNtS/rEpLiCaTiOnPrOtEcTiOnInTeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_vault.go index 8c17143fbef..4df44daf2b0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_vault_test.go index 851c0416ea7..deb409a106d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationprotectionintents/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/README.md index 8b3b12aa839..3fedf016f52 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.CreateRecoveryPlanInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.FailoverCancelThenPoll(ctx, id); err != nil { // handle the error @@ -65,7 +65,7 @@ if err := client.FailoverCancelThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.FailoverCommitThenPoll(ctx, id); err != nil { // handle the error @@ -77,7 +77,7 @@ if err := client.FailoverCommitThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") read, err := client.Get(ctx, id) if err != nil { @@ -93,7 +93,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationrecoveryplans.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanPlannedFailoverInput{ // ... @@ -127,7 +127,7 @@ if err := client.PlannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if err := client.ReprotectThenPoll(ctx, id); err != nil { // handle the error @@ -139,7 +139,7 @@ if err := client.ReprotectThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanTestFailoverInput{ // ... @@ -156,7 +156,7 @@ if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanTestFailoverCleanupInput{ // ... @@ -173,7 +173,7 @@ if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.RecoveryPlanUnplannedFailoverInput{ // ... @@ -190,7 +190,7 @@ if err := client.UnplannedFailoverThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") +id := replicationrecoveryplans.NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") payload := replicationrecoveryplans.UpdateRecoveryPlanInput{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_replicationrecoveryplan.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_replicationrecoveryplan.go index b1d8edc1b99..02aef0ff679 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_replicationrecoveryplan.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_replicationrecoveryplan.go @@ -121,9 +121,9 @@ func (id ReplicationRecoveryPlanId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationRecoveryPlans", "replicationRecoveryPlans", "replicationRecoveryPlans"), - resourceids.UserSpecifiedSegment("replicationRecoveryPlanName", "recoveryPlanName"), + resourceids.UserSpecifiedSegment("replicationRecoveryPlanName", "replicationRecoveryPlanName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go index 3785a66bf52..64c0aac5f20 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_replicationrecoveryplan_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationRecoveryPlanId{} func TestNewReplicationRecoveryPlanID(t *testing.T) { - id := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName") + id := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationRecoveryPlanID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationRecoveryPlanName != "recoveryPlanName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryPlanName'", id.ReplicationRecoveryPlanName, "recoveryPlanName") + if id.ReplicationRecoveryPlanName != "replicationRecoveryPlanName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryPlanName'", id.ReplicationRecoveryPlanName, "replicationRecoveryPlanName") } } func TestFormatReplicationRecoveryPlanID(t *testing.T) { - actual := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "recoveryPlanName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName" + actual := NewReplicationRecoveryPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationRecoveryPlanName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationRecoveryPlanID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationRecoveryPlanName: "recoveryPlanName", + VaultName: "vaultName", + ReplicationRecoveryPlanName: "replicationRecoveryPlanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationRecoveryPlanIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationRecoveryPlanName: "recoveryPlanName", + VaultName: "vaultName", + ReplicationRecoveryPlanName: "replicationRecoveryPlanName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationRecoveryPlans/recoveryPlanName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/replicationRecoveryPlanName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS/rEcOvErYpLaNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS/rEpLiCaTiOnReCoVeRyPlAnNaMe", Expected: &ReplicationRecoveryPlanId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationRecoveryPlanName: "rEcOvErYpLaNnAmE", + VaultName: "vAuLtNaMe", + ReplicationRecoveryPlanName: "rEpLiCaTiOnReCoVeRyPlAnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnReCoVeRyPlAnS/rEcOvErYpLaNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnReCoVeRyPlAnS/rEpLiCaTiOnReCoVeRyPlAnNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_vault.go index 377ae873a39..634bd8573b8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_vault_test.go index 7a4a6294e06..3f67d09bb04 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryplans/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/README.md index 1f2fac682bc..2cd8ca9914f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") payload := replicationrecoveryservicesproviders.AddRecoveryServicesProviderInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationrecoveryservicesproviders.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationrecoveryservicesproviders.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.PurgeThenPoll(ctx, id); err != nil { // handle the error @@ -115,7 +115,7 @@ if err := client.PurgeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") +id := replicationrecoveryservicesproviders.NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if err := client.RefreshProviderThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationfabric.go index 5a00c601bc1..9b5124c9f9f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go index f7837dea5f4..d7afe711ff4 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go index 8cd6155224c..9cba3d8c658 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider.go @@ -127,11 +127,11 @@ func (id ReplicationRecoveryServicesProviderId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationRecoveryServicesProviders", "replicationRecoveryServicesProviders", "replicationRecoveryServicesProviders"), - resourceids.UserSpecifiedSegment("replicationRecoveryServicesProviderName", "providerName"), + resourceids.UserSpecifiedSegment("replicationRecoveryServicesProviderName", "replicationRecoveryServicesProviderName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go index aaaaa1ceb4c..330064d9655 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_replicationrecoveryservicesprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationRecoveryServicesProviderId{} func TestNewReplicationRecoveryServicesProviderID(t *testing.T) { - id := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName") + id := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationRecoveryServicesProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationRecoveryServicesProviderName != "providerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryServicesProviderName'", id.ReplicationRecoveryServicesProviderName, "providerName") + if id.ReplicationRecoveryServicesProviderName != "replicationRecoveryServicesProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationRecoveryServicesProviderName'", id.ReplicationRecoveryServicesProviderName, "replicationRecoveryServicesProviderName") } } func TestFormatReplicationRecoveryServicesProviderID(t *testing.T) { - actual := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "providerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName" + actual := NewReplicationRecoveryServicesProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationRecoveryServicesProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationRecoveryServicesProviderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationRecoveryServicesProviderName: "providerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationRecoveryServicesProviderName: "replicationRecoveryServicesProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationRecoveryServicesProviderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationRecoveryServicesProviderName: "providerName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationRecoveryServicesProviderName: "replicationRecoveryServicesProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationRecoveryServicesProviders/providerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationRecoveryServicesProviders/replicationRecoveryServicesProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/pRoViDeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe", Expected: &ReplicationRecoveryServicesProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationRecoveryServicesProviderName: "pRoViDeRnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationRecoveryServicesProviderName: "rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/pRoViDeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErS/rEpLiCaTiOnReCoVeRySeRvIcEsPrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_vault.go index c9f73babd5b..e0624e18242 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_vault_test.go index 0961c577c71..bd041b99e7c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationrecoveryservicesproviders/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/README.md index 081b2c5b6fa..e74019ef9da 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") payload := replicationstorageclassificationmappings.StorageClassificationMappingInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationstorageclassificationmappings.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationstorageclassificationmappings.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") +id := replicationstorageclassificationmappings.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") // alternatively `client.ListByReplicationStorageClassifications(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationStorageClassificationsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go index 90d5c24d59e..6153e2573af 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassification.go @@ -127,11 +127,11 @@ func (id ReplicationStorageClassificationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go index 6a834a59db6..93419cf7b07 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassification_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationId{} func TestNewReplicationStorageClassificationID(t *testing.T) { - id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") + id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationStorageClassificationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } } func TestFormatReplicationStorageClassificationID(t *testing.T) { - actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName" + actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationStorageClassificationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationStorageClassificationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go index 824c6d0a66a..35968166e9f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping.go @@ -133,13 +133,13 @@ func (id ReplicationStorageClassificationMappingId) Segments() []resourceids.Seg resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), resourceids.StaticSegment("staticReplicationStorageClassificationMappings", "replicationStorageClassificationMappings", "replicationStorageClassificationMappings"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationMappingName", "storageClassificationMappingName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationMappingName", "replicationStorageClassificationMappingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go index 417937fb019..83299d4dc83 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_replicationstorageclassificationmapping_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationMappingId{} func TestNewReplicationStorageClassificationMappingID(t *testing.T) { - id := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName") + id := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationStorageClassificationMappingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } - if id.ReplicationStorageClassificationMappingName != "storageClassificationMappingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationMappingName'", id.ReplicationStorageClassificationMappingName, "storageClassificationMappingName") + if id.ReplicationStorageClassificationMappingName != "replicationStorageClassificationMappingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationMappingName'", id.ReplicationStorageClassificationMappingName, "replicationStorageClassificationMappingName") } } func TestFormatReplicationStorageClassificationMappingID(t *testing.T) { - actual := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName", "storageClassificationMappingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName" + actual := NewReplicationStorageClassificationMappingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName", "replicationStorageClassificationMappingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationStorageClassificationMappingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", - ReplicationStorageClassificationMappingName: "storageClassificationMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", + ReplicationStorageClassificationMappingName: "replicationStorageClassificationMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationStorageClassificationMappingIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", - ReplicationStorageClassificationMappingName: "storageClassificationMappingName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", + ReplicationStorageClassificationMappingName: "replicationStorageClassificationMappingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/replicationStorageClassificationMappings/storageClassificationMappingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/replicationStorageClassificationMappings/replicationStorageClassificationMappingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/sToRaGeClAsSiFiCaTiOnMaPpInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe", Expected: &ReplicationStorageClassificationMappingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", - ReplicationStorageClassificationMappingName: "sToRaGeClAsSiFiCaTiOnMaPpInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", + ReplicationStorageClassificationMappingName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/sToRaGeClAsSiFiCaTiOnMaPpInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgS/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNmApPiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_vault.go index 21b75b920e0..e792b2e3f57 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_vault_test.go index 73ba9056908..fc6942dc1c9 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassificationmappings/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/README.md index ac82cb4b90d..3fde292e029 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationstorageclassifications.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") +id := replicationstorageclassifications.NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationstorageclassifications.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationstorageclassifications.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationstorageclassifications.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationstorageclassifications.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationfabric.go index 98d8bd783a2..e2899f5fecb 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationfabric_test.go index c9f379bec3b..726bd85a5dc 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationstorageclassification.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationstorageclassification.go index 81c1b64d092..8e8996b47e8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationstorageclassification.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationstorageclassification.go @@ -127,11 +127,11 @@ func (id ReplicationStorageClassificationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationStorageClassifications", "replicationStorageClassifications", "replicationStorageClassifications"), - resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "storageClassificationName"), + resourceids.UserSpecifiedSegment("replicationStorageClassificationName", "replicationStorageClassificationName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationstorageclassification_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationstorageclassification_test.go index 3a50dd4d3a9..e66a6025f8c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationstorageclassification_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_replicationstorageclassification_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationStorageClassificationId{} func TestNewReplicationStorageClassificationID(t *testing.T) { - id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName") + id := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationStorageClassificationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationStorageClassificationName != "storageClassificationName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "storageClassificationName") + if id.ReplicationStorageClassificationName != "replicationStorageClassificationName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationStorageClassificationName'", id.ReplicationStorageClassificationName, "replicationStorageClassificationName") } } func TestFormatReplicationStorageClassificationID(t *testing.T) { - actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "storageClassificationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName" + actual := NewReplicationStorageClassificationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationStorageClassificationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationStorageClassificationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationStorageClassificationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationStorageClassificationName: "storageClassificationName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationStorageClassificationName: "replicationStorageClassificationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationStorageClassifications/storageClassificationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationStorageClassifications/replicationStorageClassificationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", Expected: &ReplicationStorageClassificationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationStorageClassificationName: "sToRaGeClAsSiFiCaTiOnNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationStorageClassificationName: "rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/sToRaGeClAsSiFiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNs/rEpLiCaTiOnStOrAgEcLaSsIfIcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_vault.go index 15acbb5190f..e6e8ef1f8a7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_vault_test.go index 70408cb72ae..f166541032d 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationstorageclassifications/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/README.md index b79dbba4c75..dd5fbff72db 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaulthealth.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if err := client.RefreshThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/id_vault.go index 5f01afb39da..bfec839dc80 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/id_vault_test.go index 7b50331b8cc..1eed0241695 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaulthealth/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/README.md index 8e1f9a5b1ce..352d45c647b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") +id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") payload := replicationvaultsetting.VaultSettingCreationInput{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") +id := replicationvaultsetting.NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") read, err := client.Get(ctx, id) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvaultsetting.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvaultsetting.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_replicationvaultsetting.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_replicationvaultsetting.go index db0dd36ef4d..ecf9719a633 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_replicationvaultsetting.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_replicationvaultsetting.go @@ -121,9 +121,9 @@ func (id ReplicationVaultSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationVaultSettings", "replicationVaultSettings", "replicationVaultSettings"), - resourceids.UserSpecifiedSegment("replicationVaultSettingName", "vaultSettingName"), + resourceids.UserSpecifiedSegment("replicationVaultSettingName", "replicationVaultSettingName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_replicationvaultsetting_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_replicationvaultsetting_test.go index 34e14537f4f..bf6d3aeb9ce 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_replicationvaultsetting_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_replicationvaultsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationVaultSettingId{} func TestNewReplicationVaultSettingID(t *testing.T) { - id := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName") + id := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationVaultSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationVaultSettingName != "vaultSettingName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationVaultSettingName'", id.ReplicationVaultSettingName, "vaultSettingName") + if id.ReplicationVaultSettingName != "replicationVaultSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationVaultSettingName'", id.ReplicationVaultSettingName, "replicationVaultSettingName") } } func TestFormatReplicationVaultSettingID(t *testing.T) { - actual := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "vaultSettingName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName" + actual := NewReplicationVaultSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationVaultSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationVaultSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationVaultSettingName: "vaultSettingName", + VaultName: "vaultName", + ReplicationVaultSettingName: "replicationVaultSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationVaultSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationVaultSettingName: "vaultSettingName", + VaultName: "vaultName", + ReplicationVaultSettingName: "replicationVaultSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationVaultSettings/vaultSettingName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationVaultSettings/replicationVaultSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS/vAuLtSeTtInGnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS/rEpLiCaTiOnVaUlTsEtTiNgNaMe", Expected: &ReplicationVaultSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationVaultSettingName: "vAuLtSeTtInGnAmE", + VaultName: "vAuLtNaMe", + ReplicationVaultSettingName: "rEpLiCaTiOnVaUlTsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnVaUlTsEtTiNgS/vAuLtSeTtInGnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnVaUlTsEtTiNgS/rEpLiCaTiOnVaUlTsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_vault.go index 30405e4ff37..26d5327d79b 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_vault_test.go index 26d5afc2275..db40ac61c76 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvaultsetting/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/README.md index a50ca701cc0..371db2ff8ac 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") payload := replicationvcenters.AddVCenterRequest{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := replicationvcenters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := replicationvcenters.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") +id := replicationvcenters.NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") // alternatively `client.ListByReplicationFabrics(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationFabricsComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") +id := replicationvcenters.NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") payload := replicationvcenters.UpdateVCenterRequest{ // ... diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationfabric.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationfabric.go index 2b2d9ed460e..02266219cb8 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationfabric.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationfabric.go @@ -121,9 +121,9 @@ func (id ReplicationFabricId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationfabric_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationfabric_test.go index e96172e94ee..34ad51f05fd 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationfabric_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationfabric_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationFabricId{} func TestNewReplicationFabricID(t *testing.T) { - id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName") + id := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewReplicationFabricID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } } func TestFormatReplicationFabricID(t *testing.T) { - actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName" + actual := NewReplicationFabricID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicationFabricID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicationFabricIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Expected: &ReplicationFabricId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationvcenter.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationvcenter.go index ddcd8bb416d..0737f2b9eb7 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationvcenter.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationvcenter.go @@ -127,11 +127,11 @@ func (id ReplicationvCenterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationvCenters", "replicationvCenters", "replicationvCenters"), - resourceids.UserSpecifiedSegment("replicationvCenterName", "vcenterName"), + resourceids.UserSpecifiedSegment("replicationvCenterName", "replicationvCenterName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationvcenter_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationvcenter_test.go index c4c39c44feb..9825c94a29a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationvcenter_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_replicationvcenter_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationvCenterId{} func TestNewReplicationvCenterID(t *testing.T) { - id := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName") + id := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewReplicationvCenterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationvCenterName != "vcenterName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationvCenterName'", id.ReplicationvCenterName, "vcenterName") + if id.ReplicationvCenterName != "replicationvCenterName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationvCenterName'", id.ReplicationvCenterName, "replicationvCenterName") } } func TestFormatReplicationvCenterID(t *testing.T) { - actual := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "vcenterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName" + actual := NewReplicationvCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationvCenterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicationvCenterID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationvCenterName: "vcenterName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationvCenterName: "replicationvCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicationvCenterIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationvCenterName: "vcenterName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationvCenterName: "replicationvCenterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationvCenters/vcenterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationvCenters/replicationvCenterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs/vCeNtErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs/rEpLiCaTiOnVcEnTeRnAmE", Expected: &ReplicationvCenterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationvCenterName: "vCeNtErNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationvCenterName: "rEpLiCaTiOnVcEnTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnVcEnTeRs/vCeNtErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnVcEnTeRs/rEpLiCaTiOnVcEnTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_vault.go index 13ce0b3f0ef..e37ff91d564 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_vault_test.go index df951ba3b35..d474d05200f 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/replicationvcenters/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/README.md index 49a6752c84b..ca03b89e89c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := supportedoperatingsystems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := supportedoperatingsystems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") read, err := client.Get(ctx, id, supportedoperatingsystems.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/id_vault.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/id_vault.go index c8c2297e843..2577775d89c 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/id_vault.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/id_vault.go @@ -115,7 +115,7 @@ func (id VaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/id_vault_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/id_vault_test.go index a30da0e201d..84334cd878a 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/id_vault_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/supportedoperatingsystems/id_vault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VaultId{} func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } } func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName" + actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVaultID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVaultIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", + VaultName: "vaultName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Expected: &VaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", + VaultName: "vAuLtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/extra", Error: true, }, } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/README.md b/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/README.md index 544c8e7a65a..66e58cbe0a1 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/README.md +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := targetcomputesizes.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") +id := targetcomputesizes.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") // alternatively `client.ListByReplicationProtectedItems(ctx, id)` can be used to do batched pagination items, err := client.ListByReplicationProtectedItemsComplete(ctx, id) diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/id_replicationprotecteditem.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/id_replicationprotecteditem.go index 615b84e8509..980d5cc9c99 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/id_replicationprotecteditem.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/id_replicationprotecteditem.go @@ -133,13 +133,13 @@ func (id ReplicationProtectedItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "resourceName"), + resourceids.UserSpecifiedSegment("vaultName", "vaultName"), resourceids.StaticSegment("staticReplicationFabrics", "replicationFabrics", "replicationFabrics"), - resourceids.UserSpecifiedSegment("replicationFabricName", "fabricName"), + resourceids.UserSpecifiedSegment("replicationFabricName", "replicationFabricName"), resourceids.StaticSegment("staticReplicationProtectionContainers", "replicationProtectionContainers", "replicationProtectionContainers"), - resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "protectionContainerName"), + resourceids.UserSpecifiedSegment("replicationProtectionContainerName", "replicationProtectionContainerName"), resourceids.StaticSegment("staticReplicationProtectedItems", "replicationProtectedItems", "replicationProtectedItems"), - resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicatedProtectedItemName"), + resourceids.UserSpecifiedSegment("replicationProtectedItemName", "replicationProtectedItemName"), } } diff --git a/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/id_replicationprotecteditem_test.go b/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/id_replicationprotecteditem_test.go index 6fe9b86a24a..79746b3b3a0 100644 --- a/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/id_replicationprotecteditem_test.go +++ b/resource-manager/recoveryservicessiterecovery/2024-04-01/targetcomputesizes/id_replicationprotecteditem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicationProtectedItemId{} func TestNewReplicationProtectedItemID(t *testing.T) { - id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName") + id := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewReplicationProtectedItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VaultName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "resourceName") + if id.VaultName != "vaultName" { + t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultName") } - if id.ReplicationFabricName != "fabricName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "fabricName") + if id.ReplicationFabricName != "replicationFabricName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationFabricName'", id.ReplicationFabricName, "replicationFabricName") } - if id.ReplicationProtectionContainerName != "protectionContainerName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "protectionContainerName") + if id.ReplicationProtectionContainerName != "replicationProtectionContainerName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectionContainerName'", id.ReplicationProtectionContainerName, "replicationProtectionContainerName") } - if id.ReplicationProtectedItemName != "replicatedProtectedItemName" { - t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicatedProtectedItemName") + if id.ReplicationProtectedItemName != "replicationProtectedItemName" { + t.Fatalf("Expected %q but got %q for Segment 'ReplicationProtectedItemName'", id.ReplicationProtectedItemName, "replicationProtectedItemName") } } func TestFormatReplicationProtectedItemID(t *testing.T) { - actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "fabricName", "protectionContainerName", "replicatedProtectedItemName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName" + actual := NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultName", "replicationFabricName", "replicationProtectionContainerName", "replicationProtectedItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseReplicationProtectedItemID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseReplicationProtectedItemIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VaultName: "resourceName", - ReplicationFabricName: "fabricName", - ReplicationProtectionContainerName: "protectionContainerName", - ReplicationProtectedItemName: "replicatedProtectedItemName", + VaultName: "vaultName", + ReplicationFabricName: "replicationFabricName", + ReplicationProtectionContainerName: "replicationProtectionContainerName", + ReplicationProtectedItemName: "replicationProtectedItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/resourceName/replicationFabrics/fabricName/replicationProtectionContainers/protectionContainerName/replicationProtectedItems/replicatedProtectedItemName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationFabrics/replicationFabricName/replicationProtectionContainers/replicationProtectionContainerName/replicationProtectedItems/replicationProtectedItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE", Expected: &ReplicationProtectedItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "rEsOuRcEnAmE", - ReplicationFabricName: "fAbRiCnAmE", - ReplicationProtectionContainerName: "pRoTeCtIoNcOnTaInErNaMe", - ReplicationProtectedItemName: "rEpLiCaTeDpRoTeCtEdItEmNaMe", + VaultName: "vAuLtNaMe", + ReplicationFabricName: "rEpLiCaTiOnFaBrIcNaMe", + ReplicationProtectionContainerName: "rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE", + ReplicationProtectedItemName: "rEpLiCaTiOnPrOtEcTeDiTeMnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/rEsOuRcEnAmE/rEpLiCaTiOnFaBrIcS/fAbRiCnAmE/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/pRoTeCtIoNcOnTaInErNaMe/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTeDpRoTeCtEdItEmNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtNaMe/rEpLiCaTiOnFaBrIcS/rEpLiCaTiOnFaBrIcNaMe/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRs/rEpLiCaTiOnPrOtEcTiOnCoNtAiNeRnAmE/rEpLiCaTiOnPrOtEcTeDiTeMs/rEpLiCaTiOnPrOtEcTeDiTeMnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/machinepools/README.md b/resource-manager/redhatopenshift/2023-09-04/machinepools/README.md index 094ca1eb877..033f65a3c17 100644 --- a/resource-manager/redhatopenshift/2023-09-04/machinepools/README.md +++ b/resource-manager/redhatopenshift/2023-09-04/machinepools/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") payload := machinepools.MachinePool{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := machinepools.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := machinepools.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") payload := machinepools.MachinePoolUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-09-04/machinepools/id_machinepool.go b/resource-manager/redhatopenshift/2023-09-04/machinepools/id_machinepool.go index ecb5ef86b0d..155cf3d6aa6 100644 --- a/resource-manager/redhatopenshift/2023-09-04/machinepools/id_machinepool.go +++ b/resource-manager/redhatopenshift/2023-09-04/machinepools/id_machinepool.go @@ -121,9 +121,9 @@ func (id MachinePoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), resourceids.StaticSegment("staticMachinePool", "machinePool", "machinePool"), - resourceids.UserSpecifiedSegment("machinePoolName", "childResourceName"), + resourceids.UserSpecifiedSegment("machinePoolName", "machinePoolName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/machinepools/id_machinepool_test.go b/resource-manager/redhatopenshift/2023-09-04/machinepools/id_machinepool_test.go index 657956e965a..3fd0db0d9d2 100644 --- a/resource-manager/redhatopenshift/2023-09-04/machinepools/id_machinepool_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/machinepools/id_machinepool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MachinePoolId{} func TestNewMachinePoolID(t *testing.T) { - id := NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") + id := NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMachinePoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } - if id.MachinePoolName != "childResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'MachinePoolName'", id.MachinePoolName, "childResourceName") + if id.MachinePoolName != "machinePoolName" { + t.Fatalf("Expected %q but got %q for Segment 'MachinePoolName'", id.MachinePoolName, "machinePoolName") } } func TestFormatMachinePoolID(t *testing.T) { - actual := NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName" + actual := NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMachinePoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName", Expected: &MachinePoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - MachinePoolName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + MachinePoolName: "machinePoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMachinePoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/mAcHiNePoOl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/mAcHiNePoOl", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName", Expected: &MachinePoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - MachinePoolName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + MachinePoolName: "machinePoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/mAcHiNePoOl/cHiLdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/mAcHiNePoOl/mAcHiNePoOlNaMe", Expected: &MachinePoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", - MachinePoolName: "cHiLdReSoUrCeNaMe", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", + MachinePoolName: "mAcHiNePoOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/mAcHiNePoOl/cHiLdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/mAcHiNePoOl/mAcHiNePoOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/machinepools/id_openshiftcluster.go b/resource-manager/redhatopenshift/2023-09-04/machinepools/id_openshiftcluster.go index 496304a5662..adac7a019f6 100644 --- a/resource-manager/redhatopenshift/2023-09-04/machinepools/id_openshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-09-04/machinepools/id_openshiftcluster.go @@ -115,7 +115,7 @@ func (id OpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftCluster", "openShiftCluster", "openShiftCluster"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/machinepools/id_openshiftcluster_test.go b/resource-manager/redhatopenshift/2023-09-04/machinepools/id_openshiftcluster_test.go index d314897ce5a..5df79a3bb20 100644 --- a/resource-manager/redhatopenshift/2023-09-04/machinepools/id_openshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/machinepools/id_openshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenShiftClusterId{} func TestNewOpenShiftClusterID(t *testing.T) { - id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatOpenShiftClusterID(t *testing.T) { - actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName" + actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/README.md b/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/README.md index a65aa85c07c..b9830e3e809 100644 --- a/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/README.md +++ b/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") payload := openshiftclusters.OpenShiftCluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") read, err := client.Get(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") read, err := client.ListAdminCredentials(ctx, id) if err != nil { @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") read, err := client.ListCredentials(ctx, id) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") payload := openshiftclusters.OpenShiftClusterUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/id_provideropenshiftcluster.go b/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/id_provideropenshiftcluster.go index 79202b7954f..ff29768ba0d 100644 --- a/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/id_provideropenshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/id_provideropenshiftcluster.go @@ -115,7 +115,7 @@ func (id ProviderOpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/id_provideropenshiftcluster_test.go b/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/id_provideropenshiftcluster_test.go index 86a6129c87c..85a748e70e6 100644 --- a/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/id_provideropenshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/openshiftclusters/id_provideropenshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderOpenShiftClusterId{} func TestNewProviderOpenShiftClusterID(t *testing.T) { - id := NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatProviderOpenShiftClusterID(t *testing.T) { - actual := NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName" + actual := NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Expected: &ProviderOpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Expected: &ProviderOpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Expected: &ProviderOpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/openshiftversions/README.md b/resource-manager/redhatopenshift/2023-09-04/openshiftversions/README.md index 6350c7f1a86..0fcb5add3db 100644 --- a/resource-manager/redhatopenshift/2023-09-04/openshiftversions/README.md +++ b/resource-manager/redhatopenshift/2023-09-04/openshiftversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openshiftversions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := openshiftversions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/redhatopenshift/2023-09-04/openshiftversions/id_location.go b/resource-manager/redhatopenshift/2023-09-04/openshiftversions/id_location.go index df45d38b300..176dd77a4da 100644 --- a/resource-manager/redhatopenshift/2023-09-04/openshiftversions/id_location.go +++ b/resource-manager/redhatopenshift/2023-09-04/openshiftversions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/openshiftversions/id_location_test.go b/resource-manager/redhatopenshift/2023-09-04/openshiftversions/id_location_test.go index 65890eb99b1..62769ead250 100644 --- a/resource-manager/redhatopenshift/2023-09-04/openshiftversions/id_location_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/openshiftversions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/secrets/README.md b/resource-manager/redhatopenshift/2023-09-04/secrets/README.md index 00fd471b87b..0a3da2458ff 100644 --- a/resource-manager/redhatopenshift/2023-09-04/secrets/README.md +++ b/resource-manager/redhatopenshift/2023-09-04/secrets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") payload := secrets.Secret{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := secrets.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := secrets.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") payload := secrets.SecretUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-09-04/secrets/id_openshiftcluster.go b/resource-manager/redhatopenshift/2023-09-04/secrets/id_openshiftcluster.go index 31aa26a54bd..e40834e1d24 100644 --- a/resource-manager/redhatopenshift/2023-09-04/secrets/id_openshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-09-04/secrets/id_openshiftcluster.go @@ -115,7 +115,7 @@ func (id OpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftCluster", "openShiftCluster", "openShiftCluster"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/secrets/id_openshiftcluster_test.go b/resource-manager/redhatopenshift/2023-09-04/secrets/id_openshiftcluster_test.go index 78d0b13c52b..b091ba277d7 100644 --- a/resource-manager/redhatopenshift/2023-09-04/secrets/id_openshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/secrets/id_openshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenShiftClusterId{} func TestNewOpenShiftClusterID(t *testing.T) { - id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatOpenShiftClusterID(t *testing.T) { - actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName" + actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/secrets/id_secret.go b/resource-manager/redhatopenshift/2023-09-04/secrets/id_secret.go index 76c3fd8ae3f..b6d9654df3c 100644 --- a/resource-manager/redhatopenshift/2023-09-04/secrets/id_secret.go +++ b/resource-manager/redhatopenshift/2023-09-04/secrets/id_secret.go @@ -121,9 +121,9 @@ func (id SecretId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), resourceids.StaticSegment("staticSecret", "secret", "secret"), - resourceids.UserSpecifiedSegment("secretName", "childResourceName"), + resourceids.UserSpecifiedSegment("secretName", "secretName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/secrets/id_secret_test.go b/resource-manager/redhatopenshift/2023-09-04/secrets/id_secret_test.go index abb64bd1ba7..8480e4fb119 100644 --- a/resource-manager/redhatopenshift/2023-09-04/secrets/id_secret_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/secrets/id_secret_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecretId{} func TestNewSecretID(t *testing.T) { - id := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") + id := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSecretID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } - if id.SecretName != "childResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SecretName'", id.SecretName, "childResourceName") + if id.SecretName != "secretName" { + t.Fatalf("Expected %q but got %q for Segment 'SecretName'", id.SecretName, "secretName") } } func TestFormatSecretID(t *testing.T) { - actual := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName" + actual := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSecretID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SecretName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SecretName: "secretName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSecretIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sEcReT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sEcReT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SecretName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SecretName: "secretName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sEcReT/cHiLdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sEcReT/sEcReTnAmE", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", - SecretName: "cHiLdReSoUrCeNaMe", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", + SecretName: "sEcReTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sEcReT/cHiLdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sEcReT/sEcReTnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/README.md b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/README.md index a718018db0a..66c4d17cf8e 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/README.md +++ b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") payload := syncidentityproviders.SyncIdentityProvider{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncidentityproviders.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := syncidentityproviders.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") payload := syncidentityproviders.SyncIdentityProviderUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_openshiftcluster.go b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_openshiftcluster.go index 5d2ac794e5d..b61c1917e78 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_openshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_openshiftcluster.go @@ -115,7 +115,7 @@ func (id OpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftCluster", "openShiftCluster", "openShiftCluster"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_openshiftcluster_test.go b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_openshiftcluster_test.go index 27106774cc9..a97022889af 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_openshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_openshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenShiftClusterId{} func TestNewOpenShiftClusterID(t *testing.T) { - id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatOpenShiftClusterID(t *testing.T) { - actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName" + actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_syncidentityprovider.go b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_syncidentityprovider.go index 9d4f75db286..24ed882cb87 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_syncidentityprovider.go +++ b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_syncidentityprovider.go @@ -121,9 +121,9 @@ func (id SyncIdentityProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), resourceids.StaticSegment("staticSyncIdentityProvider", "syncIdentityProvider", "syncIdentityProvider"), - resourceids.UserSpecifiedSegment("syncIdentityProviderName", "childResourceName"), + resourceids.UserSpecifiedSegment("syncIdentityProviderName", "syncIdentityProviderName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_syncidentityprovider_test.go b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_syncidentityprovider_test.go index 12ef44597f5..df4afb23701 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_syncidentityprovider_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/syncidentityproviders/id_syncidentityprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SyncIdentityProviderId{} func TestNewSyncIdentityProviderID(t *testing.T) { - id := NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") + id := NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSyncIdentityProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } - if id.SyncIdentityProviderName != "childResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SyncIdentityProviderName'", id.SyncIdentityProviderName, "childResourceName") + if id.SyncIdentityProviderName != "syncIdentityProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'SyncIdentityProviderName'", id.SyncIdentityProviderName, "syncIdentityProviderName") } } func TestFormatSyncIdentityProviderID(t *testing.T) { - actual := NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName" + actual := NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSyncIdentityProviderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName", Expected: &SyncIdentityProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SyncIdentityProviderName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SyncIdentityProviderName: "syncIdentityProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSyncIdentityProviderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCiDeNtItYpRoViDeR", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCiDeNtItYpRoViDeR", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName", Expected: &SyncIdentityProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SyncIdentityProviderName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SyncIdentityProviderName: "syncIdentityProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCiDeNtItYpRoViDeR/cHiLdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCiDeNtItYpRoViDeR/sYnCiDeNtItYpRoViDeRnAmE", Expected: &SyncIdentityProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", - SyncIdentityProviderName: "cHiLdReSoUrCeNaMe", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", + SyncIdentityProviderName: "sYnCiDeNtItYpRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCiDeNtItYpRoViDeR/cHiLdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCiDeNtItYpRoViDeR/sYnCiDeNtItYpRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/syncsets/README.md b/resource-manager/redhatopenshift/2023-09-04/syncsets/README.md index a05377cc94d..af1a2446984 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncsets/README.md +++ b/resource-manager/redhatopenshift/2023-09-04/syncsets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") payload := syncsets.SyncSet{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncsets.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := syncsets.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") payload := syncsets.SyncSetUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-09-04/syncsets/id_openshiftcluster.go b/resource-manager/redhatopenshift/2023-09-04/syncsets/id_openshiftcluster.go index 28cb9582d00..ab5f0730db7 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncsets/id_openshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-09-04/syncsets/id_openshiftcluster.go @@ -115,7 +115,7 @@ func (id OpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftCluster", "openShiftCluster", "openShiftCluster"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/syncsets/id_openshiftcluster_test.go b/resource-manager/redhatopenshift/2023-09-04/syncsets/id_openshiftcluster_test.go index 955cddb7a24..2d75dc7d705 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncsets/id_openshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/syncsets/id_openshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenShiftClusterId{} func TestNewOpenShiftClusterID(t *testing.T) { - id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatOpenShiftClusterID(t *testing.T) { - actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName" + actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-09-04/syncsets/id_syncset.go b/resource-manager/redhatopenshift/2023-09-04/syncsets/id_syncset.go index 59ff5973e7a..46b3f48d0ea 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncsets/id_syncset.go +++ b/resource-manager/redhatopenshift/2023-09-04/syncsets/id_syncset.go @@ -121,9 +121,9 @@ func (id SyncSetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), resourceids.StaticSegment("staticSyncSet", "syncSet", "syncSet"), - resourceids.UserSpecifiedSegment("syncSetName", "childResourceName"), + resourceids.UserSpecifiedSegment("syncSetName", "syncSetName"), } } diff --git a/resource-manager/redhatopenshift/2023-09-04/syncsets/id_syncset_test.go b/resource-manager/redhatopenshift/2023-09-04/syncsets/id_syncset_test.go index 948725cdc30..1ee2f0e0622 100644 --- a/resource-manager/redhatopenshift/2023-09-04/syncsets/id_syncset_test.go +++ b/resource-manager/redhatopenshift/2023-09-04/syncsets/id_syncset_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SyncSetId{} func TestNewSyncSetID(t *testing.T) { - id := NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") + id := NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSyncSetID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } - if id.SyncSetName != "childResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SyncSetName'", id.SyncSetName, "childResourceName") + if id.SyncSetName != "syncSetName" { + t.Fatalf("Expected %q but got %q for Segment 'SyncSetName'", id.SyncSetName, "syncSetName") } } func TestFormatSyncSetID(t *testing.T) { - actual := NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName" + actual := NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSyncSetID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName", Expected: &SyncSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SyncSetName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SyncSetName: "syncSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSyncSetIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCsEt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCsEt", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName", Expected: &SyncSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SyncSetName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SyncSetName: "syncSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCsEt/cHiLdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCsEt/sYnCsEtNaMe", Expected: &SyncSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", - SyncSetName: "cHiLdReSoUrCeNaMe", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", + SyncSetName: "sYnCsEtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCsEt/cHiLdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCsEt/sYnCsEtNaMe/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/machinepools/README.md b/resource-manager/redhatopenshift/2023-11-22/machinepools/README.md index 583efe49050..7b366303727 100644 --- a/resource-manager/redhatopenshift/2023-11-22/machinepools/README.md +++ b/resource-manager/redhatopenshift/2023-11-22/machinepools/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") payload := machinepools.MachinePool{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := machinepools.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := machinepools.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := machinepools.NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") payload := machinepools.MachinePoolUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-11-22/machinepools/id_machinepool.go b/resource-manager/redhatopenshift/2023-11-22/machinepools/id_machinepool.go index ecb5ef86b0d..155cf3d6aa6 100644 --- a/resource-manager/redhatopenshift/2023-11-22/machinepools/id_machinepool.go +++ b/resource-manager/redhatopenshift/2023-11-22/machinepools/id_machinepool.go @@ -121,9 +121,9 @@ func (id MachinePoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), resourceids.StaticSegment("staticMachinePool", "machinePool", "machinePool"), - resourceids.UserSpecifiedSegment("machinePoolName", "childResourceName"), + resourceids.UserSpecifiedSegment("machinePoolName", "machinePoolName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/machinepools/id_machinepool_test.go b/resource-manager/redhatopenshift/2023-11-22/machinepools/id_machinepool_test.go index 657956e965a..3fd0db0d9d2 100644 --- a/resource-manager/redhatopenshift/2023-11-22/machinepools/id_machinepool_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/machinepools/id_machinepool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &MachinePoolId{} func TestNewMachinePoolID(t *testing.T) { - id := NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") + id := NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewMachinePoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } - if id.MachinePoolName != "childResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'MachinePoolName'", id.MachinePoolName, "childResourceName") + if id.MachinePoolName != "machinePoolName" { + t.Fatalf("Expected %q but got %q for Segment 'MachinePoolName'", id.MachinePoolName, "machinePoolName") } } func TestFormatMachinePoolID(t *testing.T) { - actual := NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName" + actual := NewMachinePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "machinePoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseMachinePoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName", Expected: &MachinePoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - MachinePoolName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + MachinePoolName: "machinePoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseMachinePoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/mAcHiNePoOl", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/mAcHiNePoOl", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName", Expected: &MachinePoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - MachinePoolName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + MachinePoolName: "machinePoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/machinePool/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/machinePool/machinePoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/mAcHiNePoOl/cHiLdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/mAcHiNePoOl/mAcHiNePoOlNaMe", Expected: &MachinePoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", - MachinePoolName: "cHiLdReSoUrCeNaMe", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", + MachinePoolName: "mAcHiNePoOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/mAcHiNePoOl/cHiLdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/mAcHiNePoOl/mAcHiNePoOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/machinepools/id_openshiftcluster.go b/resource-manager/redhatopenshift/2023-11-22/machinepools/id_openshiftcluster.go index 496304a5662..adac7a019f6 100644 --- a/resource-manager/redhatopenshift/2023-11-22/machinepools/id_openshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-11-22/machinepools/id_openshiftcluster.go @@ -115,7 +115,7 @@ func (id OpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftCluster", "openShiftCluster", "openShiftCluster"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/machinepools/id_openshiftcluster_test.go b/resource-manager/redhatopenshift/2023-11-22/machinepools/id_openshiftcluster_test.go index d314897ce5a..5df79a3bb20 100644 --- a/resource-manager/redhatopenshift/2023-11-22/machinepools/id_openshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/machinepools/id_openshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenShiftClusterId{} func TestNewOpenShiftClusterID(t *testing.T) { - id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatOpenShiftClusterID(t *testing.T) { - actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName" + actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/README.md b/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/README.md index f39764a1aa5..a68acb98710 100644 --- a/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/README.md +++ b/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") payload := openshiftclusters.OpenShiftCluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") read, err := client.Get(ctx, id) if err != nil { @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") read, err := client.ListAdminCredentials(ctx, id) if err != nil { @@ -120,7 +120,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") read, err := client.ListCredentials(ctx, id) if err != nil { @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := openshiftclusters.NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") payload := openshiftclusters.OpenShiftClusterUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/id_provideropenshiftcluster.go b/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/id_provideropenshiftcluster.go index 79202b7954f..ff29768ba0d 100644 --- a/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/id_provideropenshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/id_provideropenshiftcluster.go @@ -115,7 +115,7 @@ func (id ProviderOpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/id_provideropenshiftcluster_test.go b/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/id_provideropenshiftcluster_test.go index 86a6129c87c..85a748e70e6 100644 --- a/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/id_provideropenshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/openshiftclusters/id_provideropenshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderOpenShiftClusterId{} func TestNewProviderOpenShiftClusterID(t *testing.T) { - id := NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatProviderOpenShiftClusterID(t *testing.T) { - actual := NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName" + actual := NewProviderOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Expected: &ProviderOpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Expected: &ProviderOpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Expected: &ProviderOpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/openshiftversions/README.md b/resource-manager/redhatopenshift/2023-11-22/openshiftversions/README.md index 792a5f4301d..f6b9240700d 100644 --- a/resource-manager/redhatopenshift/2023-11-22/openshiftversions/README.md +++ b/resource-manager/redhatopenshift/2023-11-22/openshiftversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := openshiftversions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := openshiftversions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/redhatopenshift/2023-11-22/openshiftversions/id_location.go b/resource-manager/redhatopenshift/2023-11-22/openshiftversions/id_location.go index df45d38b300..176dd77a4da 100644 --- a/resource-manager/redhatopenshift/2023-11-22/openshiftversions/id_location.go +++ b/resource-manager/redhatopenshift/2023-11-22/openshiftversions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/openshiftversions/id_location_test.go b/resource-manager/redhatopenshift/2023-11-22/openshiftversions/id_location_test.go index 65890eb99b1..62769ead250 100644 --- a/resource-manager/redhatopenshift/2023-11-22/openshiftversions/id_location_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/openshiftversions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RedHatOpenShift/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/secrets/README.md b/resource-manager/redhatopenshift/2023-11-22/secrets/README.md index 6dfaf2cff89..a49d9afc401 100644 --- a/resource-manager/redhatopenshift/2023-11-22/secrets/README.md +++ b/resource-manager/redhatopenshift/2023-11-22/secrets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") payload := secrets.Secret{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := secrets.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := secrets.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := secrets.NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") payload := secrets.SecretUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-11-22/secrets/id_openshiftcluster.go b/resource-manager/redhatopenshift/2023-11-22/secrets/id_openshiftcluster.go index 31aa26a54bd..e40834e1d24 100644 --- a/resource-manager/redhatopenshift/2023-11-22/secrets/id_openshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-11-22/secrets/id_openshiftcluster.go @@ -115,7 +115,7 @@ func (id OpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftCluster", "openShiftCluster", "openShiftCluster"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/secrets/id_openshiftcluster_test.go b/resource-manager/redhatopenshift/2023-11-22/secrets/id_openshiftcluster_test.go index 78d0b13c52b..b091ba277d7 100644 --- a/resource-manager/redhatopenshift/2023-11-22/secrets/id_openshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/secrets/id_openshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenShiftClusterId{} func TestNewOpenShiftClusterID(t *testing.T) { - id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatOpenShiftClusterID(t *testing.T) { - actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName" + actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/secrets/id_secret.go b/resource-manager/redhatopenshift/2023-11-22/secrets/id_secret.go index 76c3fd8ae3f..b6d9654df3c 100644 --- a/resource-manager/redhatopenshift/2023-11-22/secrets/id_secret.go +++ b/resource-manager/redhatopenshift/2023-11-22/secrets/id_secret.go @@ -121,9 +121,9 @@ func (id SecretId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), resourceids.StaticSegment("staticSecret", "secret", "secret"), - resourceids.UserSpecifiedSegment("secretName", "childResourceName"), + resourceids.UserSpecifiedSegment("secretName", "secretName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/secrets/id_secret_test.go b/resource-manager/redhatopenshift/2023-11-22/secrets/id_secret_test.go index abb64bd1ba7..8480e4fb119 100644 --- a/resource-manager/redhatopenshift/2023-11-22/secrets/id_secret_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/secrets/id_secret_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecretId{} func TestNewSecretID(t *testing.T) { - id := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") + id := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSecretID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } - if id.SecretName != "childResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SecretName'", id.SecretName, "childResourceName") + if id.SecretName != "secretName" { + t.Fatalf("Expected %q but got %q for Segment 'SecretName'", id.SecretName, "secretName") } } func TestFormatSecretID(t *testing.T) { - actual := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName" + actual := NewSecretID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "secretName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSecretID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SecretName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SecretName: "secretName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSecretIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sEcReT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sEcReT", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SecretName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SecretName: "secretName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/secret/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/secret/secretName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sEcReT/cHiLdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sEcReT/sEcReTnAmE", Expected: &SecretId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", - SecretName: "cHiLdReSoUrCeNaMe", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", + SecretName: "sEcReTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sEcReT/cHiLdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sEcReT/sEcReTnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/README.md b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/README.md index 03ace0cda17..670dd346b8e 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/README.md +++ b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") payload := syncidentityproviders.SyncIdentityProvider{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncidentityproviders.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := syncidentityproviders.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncidentityproviders.NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") payload := syncidentityproviders.SyncIdentityProviderUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_openshiftcluster.go b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_openshiftcluster.go index 5d2ac794e5d..b61c1917e78 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_openshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_openshiftcluster.go @@ -115,7 +115,7 @@ func (id OpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftCluster", "openShiftCluster", "openShiftCluster"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_openshiftcluster_test.go b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_openshiftcluster_test.go index 27106774cc9..a97022889af 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_openshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_openshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenShiftClusterId{} func TestNewOpenShiftClusterID(t *testing.T) { - id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatOpenShiftClusterID(t *testing.T) { - actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName" + actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_syncidentityprovider.go b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_syncidentityprovider.go index 9d4f75db286..24ed882cb87 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_syncidentityprovider.go +++ b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_syncidentityprovider.go @@ -121,9 +121,9 @@ func (id SyncIdentityProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), resourceids.StaticSegment("staticSyncIdentityProvider", "syncIdentityProvider", "syncIdentityProvider"), - resourceids.UserSpecifiedSegment("syncIdentityProviderName", "childResourceName"), + resourceids.UserSpecifiedSegment("syncIdentityProviderName", "syncIdentityProviderName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_syncidentityprovider_test.go b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_syncidentityprovider_test.go index 12ef44597f5..df4afb23701 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_syncidentityprovider_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/syncidentityproviders/id_syncidentityprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SyncIdentityProviderId{} func TestNewSyncIdentityProviderID(t *testing.T) { - id := NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") + id := NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSyncIdentityProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } - if id.SyncIdentityProviderName != "childResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SyncIdentityProviderName'", id.SyncIdentityProviderName, "childResourceName") + if id.SyncIdentityProviderName != "syncIdentityProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'SyncIdentityProviderName'", id.SyncIdentityProviderName, "syncIdentityProviderName") } } func TestFormatSyncIdentityProviderID(t *testing.T) { - actual := NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName" + actual := NewSyncIdentityProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncIdentityProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSyncIdentityProviderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName", Expected: &SyncIdentityProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SyncIdentityProviderName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SyncIdentityProviderName: "syncIdentityProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSyncIdentityProviderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCiDeNtItYpRoViDeR", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCiDeNtItYpRoViDeR", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName", Expected: &SyncIdentityProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SyncIdentityProviderName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SyncIdentityProviderName: "syncIdentityProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncIdentityProvider/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncIdentityProvider/syncIdentityProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCiDeNtItYpRoViDeR/cHiLdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCiDeNtItYpRoViDeR/sYnCiDeNtItYpRoViDeRnAmE", Expected: &SyncIdentityProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", - SyncIdentityProviderName: "cHiLdReSoUrCeNaMe", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", + SyncIdentityProviderName: "sYnCiDeNtItYpRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCiDeNtItYpRoViDeR/cHiLdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCiDeNtItYpRoViDeR/sYnCiDeNtItYpRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/syncsets/README.md b/resource-manager/redhatopenshift/2023-11-22/syncsets/README.md index 97c66707724..71d7cb7bed6 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncsets/README.md +++ b/resource-manager/redhatopenshift/2023-11-22/syncsets/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") payload := syncsets.SyncSet{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := syncsets.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := syncsets.NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") +id := syncsets.NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") payload := syncsets.SyncSetUpdate{ // ... diff --git a/resource-manager/redhatopenshift/2023-11-22/syncsets/id_openshiftcluster.go b/resource-manager/redhatopenshift/2023-11-22/syncsets/id_openshiftcluster.go index 28cb9582d00..ab5f0730db7 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncsets/id_openshiftcluster.go +++ b/resource-manager/redhatopenshift/2023-11-22/syncsets/id_openshiftcluster.go @@ -115,7 +115,7 @@ func (id OpenShiftClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftCluster", "openShiftCluster", "openShiftCluster"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/syncsets/id_openshiftcluster_test.go b/resource-manager/redhatopenshift/2023-11-22/syncsets/id_openshiftcluster_test.go index 955cddb7a24..2d75dc7d705 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncsets/id_openshiftcluster_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/syncsets/id_openshiftcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OpenShiftClusterId{} func TestNewOpenShiftClusterID(t *testing.T) { - id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewOpenShiftClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } } func TestFormatOpenShiftClusterID(t *testing.T) { - actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName" + actual := NewOpenShiftClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseOpenShiftClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseOpenShiftClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", + OpenShiftClusterName: "openShiftClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftCluster/openShiftClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE", Expected: &OpenShiftClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeR/oPeNsHiFtClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redhatopenshift/2023-11-22/syncsets/id_syncset.go b/resource-manager/redhatopenshift/2023-11-22/syncsets/id_syncset.go index 59ff5973e7a..46b3f48d0ea 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncsets/id_syncset.go +++ b/resource-manager/redhatopenshift/2023-11-22/syncsets/id_syncset.go @@ -121,9 +121,9 @@ func (id SyncSetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftRedHatOpenShift", "Microsoft.RedHatOpenShift", "Microsoft.RedHatOpenShift"), resourceids.StaticSegment("staticOpenShiftClusters", "openShiftClusters", "openShiftClusters"), - resourceids.UserSpecifiedSegment("openShiftClusterName", "resourceName"), + resourceids.UserSpecifiedSegment("openShiftClusterName", "openShiftClusterName"), resourceids.StaticSegment("staticSyncSet", "syncSet", "syncSet"), - resourceids.UserSpecifiedSegment("syncSetName", "childResourceName"), + resourceids.UserSpecifiedSegment("syncSetName", "syncSetName"), } } diff --git a/resource-manager/redhatopenshift/2023-11-22/syncsets/id_syncset_test.go b/resource-manager/redhatopenshift/2023-11-22/syncsets/id_syncset_test.go index 948725cdc30..1ee2f0e0622 100644 --- a/resource-manager/redhatopenshift/2023-11-22/syncsets/id_syncset_test.go +++ b/resource-manager/redhatopenshift/2023-11-22/syncsets/id_syncset_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SyncSetId{} func TestNewSyncSetID(t *testing.T) { - id := NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName") + id := NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSyncSetID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.OpenShiftClusterName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "resourceName") + if id.OpenShiftClusterName != "openShiftClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'OpenShiftClusterName'", id.OpenShiftClusterName, "openShiftClusterName") } - if id.SyncSetName != "childResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SyncSetName'", id.SyncSetName, "childResourceName") + if id.SyncSetName != "syncSetName" { + t.Fatalf("Expected %q but got %q for Segment 'SyncSetName'", id.SyncSetName, "syncSetName") } } func TestFormatSyncSetID(t *testing.T) { - actual := NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "childResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName" + actual := NewSyncSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "openShiftClusterName", "syncSetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSyncSetID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName", Expected: &SyncSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SyncSetName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SyncSetName: "syncSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSyncSetIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCsEt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCsEt", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName", Expected: &SyncSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - OpenShiftClusterName: "resourceName", - SyncSetName: "childResourceName", + OpenShiftClusterName: "openShiftClusterName", + SyncSetName: "syncSetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/resourceName/syncSet/childResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RedHatOpenShift/openShiftClusters/openShiftClusterName/syncSet/syncSetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCsEt/cHiLdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCsEt/sYnCsEtNaMe", Expected: &SyncSetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - OpenShiftClusterName: "rEsOuRcEnAmE", - SyncSetName: "cHiLdReSoUrCeNaMe", + OpenShiftClusterName: "oPeNsHiFtClUsTeRnAmE", + SyncSetName: "sYnCsEtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/rEsOuRcEnAmE/sYnCsEt/cHiLdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEdHaToPeNsHiFt/oPeNsHiFtClUsTeRs/oPeNsHiFtClUsTeRnAmE/sYnCsEt/sYnCsEtNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/aad/README.md b/resource-manager/redis/2023-08-01/aad/README.md index bc197fc59d7..6c420eab913 100644 --- a/resource-manager/redis/2023-08-01/aad/README.md +++ b/resource-manager/redis/2023-08-01/aad/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") payload := aad.RedisCacheAccessPolicyAssignment{ // ... @@ -41,7 +41,7 @@ if err := client.AccessPolicyAssignmentCreateUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") if err := client.AccessPolicyAssignmentDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.AccessPolicyAssignmentDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") read, err := client.AccessPolicyAssignmentGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := aad.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := aad.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.AccessPolicyAssignmentList(ctx, id)` can be used to do batched pagination items, err := client.AccessPolicyAssignmentListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") payload := aad.RedisCacheAccessPolicy{ // ... @@ -103,7 +103,7 @@ if err := client.AccessPolicyCreateUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") if err := client.AccessPolicyDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -115,7 +115,7 @@ if err := client.AccessPolicyDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") read, err := client.AccessPolicyGet(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := aad.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := aad.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.AccessPolicyList(ctx, id)` can be used to do batched pagination items, err := client.AccessPolicyListComplete(ctx, id) diff --git a/resource-manager/redis/2023-08-01/aad/id_accesspolicy.go b/resource-manager/redis/2023-08-01/aad/id_accesspolicy.go index a16d15092f2..da3ac7ecde9 100644 --- a/resource-manager/redis/2023-08-01/aad/id_accesspolicy.go +++ b/resource-manager/redis/2023-08-01/aad/id_accesspolicy.go @@ -121,7 +121,7 @@ func (id AccessPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticAccessPolicies", "accessPolicies", "accessPolicies"), resourceids.UserSpecifiedSegment("accessPolicyName", "accessPolicyName"), } diff --git a/resource-manager/redis/2023-08-01/aad/id_accesspolicy_test.go b/resource-manager/redis/2023-08-01/aad/id_accesspolicy_test.go index 3192a49fe14..57c1a3c5fa2 100644 --- a/resource-manager/redis/2023-08-01/aad/id_accesspolicy_test.go +++ b/resource-manager/redis/2023-08-01/aad/id_accesspolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyId{} func TestNewAccessPolicyID(t *testing.T) { - id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") + id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.AccessPolicyName != "accessPolicyName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyID(t *testing.T) { } func TestFormatAccessPolicyID(t *testing.T) { - actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName" + actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", AccessPolicyName: "aCcEsSpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/aad/id_accesspolicyassignment.go b/resource-manager/redis/2023-08-01/aad/id_accesspolicyassignment.go index 1793d01877c..49a6e2f4c5e 100644 --- a/resource-manager/redis/2023-08-01/aad/id_accesspolicyassignment.go +++ b/resource-manager/redis/2023-08-01/aad/id_accesspolicyassignment.go @@ -121,7 +121,7 @@ func (id AccessPolicyAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticAccessPolicyAssignments", "accessPolicyAssignments", "accessPolicyAssignments"), resourceids.UserSpecifiedSegment("accessPolicyAssignmentName", "accessPolicyAssignmentName"), } diff --git a/resource-manager/redis/2023-08-01/aad/id_accesspolicyassignment_test.go b/resource-manager/redis/2023-08-01/aad/id_accesspolicyassignment_test.go index 2a4ee6d12ab..21eb6dbc9bc 100644 --- a/resource-manager/redis/2023-08-01/aad/id_accesspolicyassignment_test.go +++ b/resource-manager/redis/2023-08-01/aad/id_accesspolicyassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyAssignmentId{} func TestNewAccessPolicyAssignmentID(t *testing.T) { - id := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") + id := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.AccessPolicyAssignmentName != "accessPolicyAssignmentName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyAssignmentID(t *testing.T) { } func TestFormatAccessPolicyAssignmentID(t *testing.T) { - actual := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName" + actual := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyAssignmentName: "accessPolicyAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyAssignmentName: "accessPolicyAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", AccessPolicyAssignmentName: "aCcEsSpOlIcYaSsIgNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/aad/id_redi.go b/resource-manager/redis/2023-08-01/aad/id_redi.go index 26113a03ff7..50bc8d8af2e 100644 --- a/resource-manager/redis/2023-08-01/aad/id_redi.go +++ b/resource-manager/redis/2023-08-01/aad/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2023-08-01/aad/id_redi_test.go b/resource-manager/redis/2023-08-01/aad/id_redi_test.go index 63edcb4499b..4b83906dc4a 100644 --- a/resource-manager/redis/2023-08-01/aad/id_redi_test.go +++ b/resource-manager/redis/2023-08-01/aad/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/firewallrules/README.md b/resource-manager/redis/2023-08-01/firewallrules/README.md index 4690dde527c..876627d2872 100644 --- a/resource-manager/redis/2023-08-01/firewallrules/README.md +++ b/resource-manager/redis/2023-08-01/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") payload := firewallrules.RedisFirewallRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := firewallrules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/redis/2023-08-01/firewallrules/id_firewallrule.go b/resource-manager/redis/2023-08-01/firewallrules/id_firewallrule.go index 2aa7bb4fd3a..86034bdb183 100644 --- a/resource-manager/redis/2023-08-01/firewallrules/id_firewallrule.go +++ b/resource-manager/redis/2023-08-01/firewallrules/id_firewallrule.go @@ -121,9 +121,9 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), - resourceids.UserSpecifiedSegment("firewallRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } } diff --git a/resource-manager/redis/2023-08-01/firewallrules/id_firewallrule_test.go b/resource-manager/redis/2023-08-01/firewallrules/id_firewallrule_test.go index 5c87ed73e56..9256c22423f 100644 --- a/resource-manager/redis/2023-08-01/firewallrules/id_firewallrule_test.go +++ b/resource-manager/redis/2023-08-01/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } - if id.FirewallRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "ruleName") + if id.FirewallRuleName != "firewallRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "firewallRuleName") } } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", - FirewallRuleName: "ruleName", + RedisName: "redisName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", - FirewallRuleName: "ruleName", + RedisName: "redisName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", - FirewallRuleName: "rUlEnAmE", + RedisName: "rEdIsNaMe", + FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/firewallrules/id_redi.go b/resource-manager/redis/2023-08-01/firewallrules/id_redi.go index ff7a195b757..17db49cf0a5 100644 --- a/resource-manager/redis/2023-08-01/firewallrules/id_redi.go +++ b/resource-manager/redis/2023-08-01/firewallrules/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2023-08-01/firewallrules/id_redi_test.go b/resource-manager/redis/2023-08-01/firewallrules/id_redi_test.go index 705f80b1a2f..fb5bbdaccc0 100644 --- a/resource-manager/redis/2023-08-01/firewallrules/id_redi_test.go +++ b/resource-manager/redis/2023-08-01/firewallrules/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/patchschedules/README.md b/resource-manager/redis/2023-08-01/patchschedules/README.md index 0b9735dcd5a..e18d7f6e7fe 100644 --- a/resource-manager/redis/2023-08-01/patchschedules/README.md +++ b/resource-manager/redis/2023-08-01/patchschedules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := patchschedules.RedisPatchSchedule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.ListByRedisResource(ctx, id)` can be used to do batched pagination items, err := client.ListByRedisResourceComplete(ctx, id) diff --git a/resource-manager/redis/2023-08-01/patchschedules/id_redi.go b/resource-manager/redis/2023-08-01/patchschedules/id_redi.go index 48865645f59..050f3a1e79e 100644 --- a/resource-manager/redis/2023-08-01/patchschedules/id_redi.go +++ b/resource-manager/redis/2023-08-01/patchschedules/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2023-08-01/patchschedules/id_redi_test.go b/resource-manager/redis/2023-08-01/patchschedules/id_redi_test.go index c0d258286ba..7a25d343567 100644 --- a/resource-manager/redis/2023-08-01/patchschedules/id_redi_test.go +++ b/resource-manager/redis/2023-08-01/patchschedules/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/privateendpointconnections/README.md b/resource-manager/redis/2023-08-01/privateendpointconnections/README.md index 0e7b31521ee..0975b6dfc97 100644 --- a/resource-manager/redis/2023-08-01/privateendpointconnections/README.md +++ b/resource-manager/redis/2023-08-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := privateendpointconnections.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.List(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/redis/2023-08-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/redis/2023-08-01/privateendpointconnections/id_privateendpointconnection.go index 6a0ec3a4b5c..ad0a01db303 100644 --- a/resource-manager/redis/2023-08-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/redis/2023-08-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/redis/2023-08-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/redis/2023-08-01/privateendpointconnections/id_privateendpointconnection_test.go index 0b50835a182..e3295158396 100644 --- a/resource-manager/redis/2023-08-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/redis/2023-08-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/privateendpointconnections/id_redi.go b/resource-manager/redis/2023-08-01/privateendpointconnections/id_redi.go index 0f8e8b3d66d..f048b1fe11d 100644 --- a/resource-manager/redis/2023-08-01/privateendpointconnections/id_redi.go +++ b/resource-manager/redis/2023-08-01/privateendpointconnections/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2023-08-01/privateendpointconnections/id_redi_test.go b/resource-manager/redis/2023-08-01/privateendpointconnections/id_redi_test.go index f6eaab50244..4a00d4e8872 100644 --- a/resource-manager/redis/2023-08-01/privateendpointconnections/id_redi_test.go +++ b/resource-manager/redis/2023-08-01/privateendpointconnections/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/privatelinkresources/README.md b/resource-manager/redis/2023-08-01/privatelinkresources/README.md index 2ff08eee9bd..810dd89590d 100644 --- a/resource-manager/redis/2023-08-01/privatelinkresources/README.md +++ b/resource-manager/redis/2023-08-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := privatelinkresources.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.ListByRedisCache(ctx, id) if err != nil { diff --git a/resource-manager/redis/2023-08-01/privatelinkresources/id_redi.go b/resource-manager/redis/2023-08-01/privatelinkresources/id_redi.go index 1b741edb064..6396bc7d845 100644 --- a/resource-manager/redis/2023-08-01/privatelinkresources/id_redi.go +++ b/resource-manager/redis/2023-08-01/privatelinkresources/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2023-08-01/privatelinkresources/id_redi_test.go b/resource-manager/redis/2023-08-01/privatelinkresources/id_redi_test.go index 624c16c774f..e7ce2558187 100644 --- a/resource-manager/redis/2023-08-01/privatelinkresources/id_redi_test.go +++ b/resource-manager/redis/2023-08-01/privatelinkresources/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/redis/README.md b/resource-manager/redis/2023-08-01/redis/README.md index 504cc491932..a1488399d05 100644 --- a/resource-manager/redis/2023-08-01/redis/README.md +++ b/resource-manager/redis/2023-08-01/redis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") payload := redis.RedisCacheAccessPolicyAssignment{ // ... @@ -42,7 +42,7 @@ if err := client.AccessPolicyAssignmentCreateUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") if err := client.AccessPolicyAssignmentDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.AccessPolicyAssignmentDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") read, err := client.AccessPolicyAssignmentGet(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.AccessPolicyAssignmentList(ctx, id)` can be used to do batched pagination items, err := client.AccessPolicyAssignmentListComplete(ctx, id) @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") payload := redis.RedisCacheAccessPolicy{ // ... @@ -104,7 +104,7 @@ if err := client.AccessPolicyCreateUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") if err := client.AccessPolicyDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.AccessPolicyDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") read, err := client.AccessPolicyGet(ctx, id) if err != nil { @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.AccessPolicyList(ctx, id)` can be used to do batched pagination items, err := client.AccessPolicyListComplete(ctx, id) @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisCreateParameters{ // ... @@ -187,7 +187,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -199,7 +199,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.ExportRDBParameters{ // ... @@ -216,7 +216,7 @@ if err := client.ExportDataThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") payload := redis.RedisFirewallRule{ // ... @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") read, err := client.FirewallRulesDelete(ctx, id) if err != nil { @@ -253,7 +253,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") read, err := client.FirewallRulesGet(ctx, id) if err != nil { @@ -269,7 +269,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.FirewallRulesList(ctx, id)` can be used to do batched pagination items, err := client.FirewallRulesListComplete(ctx, id) @@ -286,7 +286,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if err := client.FlushCacheThenPoll(ctx, id); err != nil { // handle the error @@ -298,7 +298,7 @@ if err := client.FlushCacheThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisRebootParameters{ // ... @@ -319,7 +319,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.Get(ctx, id) if err != nil { @@ -335,7 +335,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.ImportRDBParameters{ // ... @@ -352,7 +352,7 @@ if err := client.ImportDataThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName") +id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName") payload := redis.RedisLinkedServerCreateParameters{ // ... @@ -369,7 +369,7 @@ if err := client.LinkedServerCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName") +id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName") if err := client.LinkedServerDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -381,7 +381,7 @@ if err := client.LinkedServerDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName") +id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName") read, err := client.LinkedServerGet(ctx, id) if err != nil { @@ -397,7 +397,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.LinkedServerList(ctx, id)` can be used to do batched pagination items, err := client.LinkedServerListComplete(ctx, id) @@ -448,7 +448,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -464,7 +464,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.ListUpgradeNotifications(ctx, id, redis.DefaultListUpgradeNotificationsOperationOptions())` can be used to do batched pagination items, err := client.ListUpgradeNotificationsComplete(ctx, id, redis.DefaultListUpgradeNotificationsOperationOptions()) @@ -481,7 +481,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisPatchSchedule{ // ... @@ -502,7 +502,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.PatchSchedulesDelete(ctx, id) if err != nil { @@ -518,7 +518,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.PatchSchedulesGet(ctx, id) if err != nil { @@ -534,7 +534,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.PatchSchedulesListByRedisResource(ctx, id)` can be used to do batched pagination items, err := client.PatchSchedulesListByRedisResourceComplete(ctx, id) @@ -551,7 +551,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisRegenerateKeyParameters{ // ... @@ -572,7 +572,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisUpdateParameters{ // ... diff --git a/resource-manager/redis/2023-08-01/redis/id_accesspolicy.go b/resource-manager/redis/2023-08-01/redis/id_accesspolicy.go index 11a6ebdb48c..920dd91e030 100644 --- a/resource-manager/redis/2023-08-01/redis/id_accesspolicy.go +++ b/resource-manager/redis/2023-08-01/redis/id_accesspolicy.go @@ -121,7 +121,7 @@ func (id AccessPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticAccessPolicies", "accessPolicies", "accessPolicies"), resourceids.UserSpecifiedSegment("accessPolicyName", "accessPolicyName"), } diff --git a/resource-manager/redis/2023-08-01/redis/id_accesspolicy_test.go b/resource-manager/redis/2023-08-01/redis/id_accesspolicy_test.go index 2f8f30510ed..1ef10b41cd7 100644 --- a/resource-manager/redis/2023-08-01/redis/id_accesspolicy_test.go +++ b/resource-manager/redis/2023-08-01/redis/id_accesspolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyId{} func TestNewAccessPolicyID(t *testing.T) { - id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") + id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.AccessPolicyName != "accessPolicyName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyID(t *testing.T) { } func TestFormatAccessPolicyID(t *testing.T) { - actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName" + actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", AccessPolicyName: "aCcEsSpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/redis/id_accesspolicyassignment.go b/resource-manager/redis/2023-08-01/redis/id_accesspolicyassignment.go index afc9b384507..e964e1cbbef 100644 --- a/resource-manager/redis/2023-08-01/redis/id_accesspolicyassignment.go +++ b/resource-manager/redis/2023-08-01/redis/id_accesspolicyassignment.go @@ -121,7 +121,7 @@ func (id AccessPolicyAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticAccessPolicyAssignments", "accessPolicyAssignments", "accessPolicyAssignments"), resourceids.UserSpecifiedSegment("accessPolicyAssignmentName", "accessPolicyAssignmentName"), } diff --git a/resource-manager/redis/2023-08-01/redis/id_accesspolicyassignment_test.go b/resource-manager/redis/2023-08-01/redis/id_accesspolicyassignment_test.go index bf6872707a5..c75a1bff369 100644 --- a/resource-manager/redis/2023-08-01/redis/id_accesspolicyassignment_test.go +++ b/resource-manager/redis/2023-08-01/redis/id_accesspolicyassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyAssignmentId{} func TestNewAccessPolicyAssignmentID(t *testing.T) { - id := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") + id := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.AccessPolicyAssignmentName != "accessPolicyAssignmentName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyAssignmentID(t *testing.T) { } func TestFormatAccessPolicyAssignmentID(t *testing.T) { - actual := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName" + actual := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyAssignmentName: "accessPolicyAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyAssignmentName: "accessPolicyAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", AccessPolicyAssignmentName: "aCcEsSpOlIcYaSsIgNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/redis/id_firewallrule.go b/resource-manager/redis/2023-08-01/redis/id_firewallrule.go index 896b58fec52..748eacf643b 100644 --- a/resource-manager/redis/2023-08-01/redis/id_firewallrule.go +++ b/resource-manager/redis/2023-08-01/redis/id_firewallrule.go @@ -121,9 +121,9 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), - resourceids.UserSpecifiedSegment("firewallRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } } diff --git a/resource-manager/redis/2023-08-01/redis/id_firewallrule_test.go b/resource-manager/redis/2023-08-01/redis/id_firewallrule_test.go index 390503e1f66..d14e19501e9 100644 --- a/resource-manager/redis/2023-08-01/redis/id_firewallrule_test.go +++ b/resource-manager/redis/2023-08-01/redis/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } - if id.FirewallRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "ruleName") + if id.FirewallRuleName != "firewallRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "firewallRuleName") } } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", - FirewallRuleName: "ruleName", + RedisName: "redisName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", - FirewallRuleName: "ruleName", + RedisName: "redisName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", - FirewallRuleName: "rUlEnAmE", + RedisName: "rEdIsNaMe", + FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/redis/id_linkedserver.go b/resource-manager/redis/2023-08-01/redis/id_linkedserver.go index e8601f16fa5..f51bdbe8889 100644 --- a/resource-manager/redis/2023-08-01/redis/id_linkedserver.go +++ b/resource-manager/redis/2023-08-01/redis/id_linkedserver.go @@ -121,7 +121,7 @@ func (id LinkedServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticLinkedServers", "linkedServers", "linkedServers"), resourceids.UserSpecifiedSegment("linkedServerName", "linkedServerName"), } diff --git a/resource-manager/redis/2023-08-01/redis/id_linkedserver_test.go b/resource-manager/redis/2023-08-01/redis/id_linkedserver_test.go index 8da5c545f63..51611777396 100644 --- a/resource-manager/redis/2023-08-01/redis/id_linkedserver_test.go +++ b/resource-manager/redis/2023-08-01/redis/id_linkedserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LinkedServerId{} func TestNewLinkedServerID(t *testing.T) { - id := NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName") + id := NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewLinkedServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.LinkedServerName != "linkedServerName" { @@ -32,8 +32,8 @@ func TestNewLinkedServerID(t *testing.T) { } func TestFormatLinkedServerID(t *testing.T) { - actual := NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName" + actual := NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLinkedServerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName", Expected: &LinkedServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", LinkedServerName: "linkedServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLinkedServerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/lInKeDsErVeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/lInKeDsErVeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName", Expected: &LinkedServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", LinkedServerName: "linkedServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/lInKeDsErVeRs/lInKeDsErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/lInKeDsErVeRs/lInKeDsErVeRnAmE", Expected: &LinkedServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", LinkedServerName: "lInKeDsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/lInKeDsErVeRs/lInKeDsErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/lInKeDsErVeRs/lInKeDsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2023-08-01/redis/id_redi.go b/resource-manager/redis/2023-08-01/redis/id_redi.go index f745aa10725..423b0882905 100644 --- a/resource-manager/redis/2023-08-01/redis/id_redi.go +++ b/resource-manager/redis/2023-08-01/redis/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2023-08-01/redis/id_redi_test.go b/resource-manager/redis/2023-08-01/redis/id_redi_test.go index 2082f302950..5f77e9b3569 100644 --- a/resource-manager/redis/2023-08-01/redis/id_redi_test.go +++ b/resource-manager/redis/2023-08-01/redis/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/aad/README.md b/resource-manager/redis/2024-03-01/aad/README.md index 3a2dcec4efa..13cfe9a3bb9 100644 --- a/resource-manager/redis/2024-03-01/aad/README.md +++ b/resource-manager/redis/2024-03-01/aad/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") payload := aad.RedisCacheAccessPolicyAssignment{ // ... @@ -41,7 +41,7 @@ if err := client.AccessPolicyAssignmentCreateUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") if err := client.AccessPolicyAssignmentDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.AccessPolicyAssignmentDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := aad.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") read, err := client.AccessPolicyAssignmentGet(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := aad.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := aad.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.AccessPolicyAssignmentList(ctx, id)` can be used to do batched pagination items, err := client.AccessPolicyAssignmentListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") payload := aad.RedisCacheAccessPolicy{ // ... @@ -103,7 +103,7 @@ if err := client.AccessPolicyCreateUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") if err := client.AccessPolicyDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -115,7 +115,7 @@ if err := client.AccessPolicyDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := aad.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") read, err := client.AccessPolicyGet(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := aad.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := aad.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.AccessPolicyList(ctx, id)` can be used to do batched pagination items, err := client.AccessPolicyListComplete(ctx, id) diff --git a/resource-manager/redis/2024-03-01/aad/id_accesspolicy.go b/resource-manager/redis/2024-03-01/aad/id_accesspolicy.go index a16d15092f2..da3ac7ecde9 100644 --- a/resource-manager/redis/2024-03-01/aad/id_accesspolicy.go +++ b/resource-manager/redis/2024-03-01/aad/id_accesspolicy.go @@ -121,7 +121,7 @@ func (id AccessPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticAccessPolicies", "accessPolicies", "accessPolicies"), resourceids.UserSpecifiedSegment("accessPolicyName", "accessPolicyName"), } diff --git a/resource-manager/redis/2024-03-01/aad/id_accesspolicy_test.go b/resource-manager/redis/2024-03-01/aad/id_accesspolicy_test.go index 3192a49fe14..57c1a3c5fa2 100644 --- a/resource-manager/redis/2024-03-01/aad/id_accesspolicy_test.go +++ b/resource-manager/redis/2024-03-01/aad/id_accesspolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyId{} func TestNewAccessPolicyID(t *testing.T) { - id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") + id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.AccessPolicyName != "accessPolicyName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyID(t *testing.T) { } func TestFormatAccessPolicyID(t *testing.T) { - actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName" + actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", AccessPolicyName: "aCcEsSpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/aad/id_accesspolicyassignment.go b/resource-manager/redis/2024-03-01/aad/id_accesspolicyassignment.go index 1793d01877c..49a6e2f4c5e 100644 --- a/resource-manager/redis/2024-03-01/aad/id_accesspolicyassignment.go +++ b/resource-manager/redis/2024-03-01/aad/id_accesspolicyassignment.go @@ -121,7 +121,7 @@ func (id AccessPolicyAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticAccessPolicyAssignments", "accessPolicyAssignments", "accessPolicyAssignments"), resourceids.UserSpecifiedSegment("accessPolicyAssignmentName", "accessPolicyAssignmentName"), } diff --git a/resource-manager/redis/2024-03-01/aad/id_accesspolicyassignment_test.go b/resource-manager/redis/2024-03-01/aad/id_accesspolicyassignment_test.go index 2a4ee6d12ab..21eb6dbc9bc 100644 --- a/resource-manager/redis/2024-03-01/aad/id_accesspolicyassignment_test.go +++ b/resource-manager/redis/2024-03-01/aad/id_accesspolicyassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyAssignmentId{} func TestNewAccessPolicyAssignmentID(t *testing.T) { - id := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") + id := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.AccessPolicyAssignmentName != "accessPolicyAssignmentName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyAssignmentID(t *testing.T) { } func TestFormatAccessPolicyAssignmentID(t *testing.T) { - actual := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName" + actual := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyAssignmentName: "accessPolicyAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyAssignmentName: "accessPolicyAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", AccessPolicyAssignmentName: "aCcEsSpOlIcYaSsIgNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/aad/id_redi.go b/resource-manager/redis/2024-03-01/aad/id_redi.go index 26113a03ff7..50bc8d8af2e 100644 --- a/resource-manager/redis/2024-03-01/aad/id_redi.go +++ b/resource-manager/redis/2024-03-01/aad/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2024-03-01/aad/id_redi_test.go b/resource-manager/redis/2024-03-01/aad/id_redi_test.go index 63edcb4499b..4b83906dc4a 100644 --- a/resource-manager/redis/2024-03-01/aad/id_redi_test.go +++ b/resource-manager/redis/2024-03-01/aad/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/firewallrules/README.md b/resource-manager/redis/2024-03-01/firewallrules/README.md index 54a77fa82d4..14543eac0de 100644 --- a/resource-manager/redis/2024-03-01/firewallrules/README.md +++ b/resource-manager/redis/2024-03-01/firewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") payload := firewallrules.RedisFirewallRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := firewallrules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := firewallrules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/redis/2024-03-01/firewallrules/id_firewallrule.go b/resource-manager/redis/2024-03-01/firewallrules/id_firewallrule.go index 2aa7bb4fd3a..86034bdb183 100644 --- a/resource-manager/redis/2024-03-01/firewallrules/id_firewallrule.go +++ b/resource-manager/redis/2024-03-01/firewallrules/id_firewallrule.go @@ -121,9 +121,9 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), - resourceids.UserSpecifiedSegment("firewallRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } } diff --git a/resource-manager/redis/2024-03-01/firewallrules/id_firewallrule_test.go b/resource-manager/redis/2024-03-01/firewallrules/id_firewallrule_test.go index 5c87ed73e56..9256c22423f 100644 --- a/resource-manager/redis/2024-03-01/firewallrules/id_firewallrule_test.go +++ b/resource-manager/redis/2024-03-01/firewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } - if id.FirewallRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "ruleName") + if id.FirewallRuleName != "firewallRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "firewallRuleName") } } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", - FirewallRuleName: "ruleName", + RedisName: "redisName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", - FirewallRuleName: "ruleName", + RedisName: "redisName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", - FirewallRuleName: "rUlEnAmE", + RedisName: "rEdIsNaMe", + FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/firewallrules/id_redi.go b/resource-manager/redis/2024-03-01/firewallrules/id_redi.go index ff7a195b757..17db49cf0a5 100644 --- a/resource-manager/redis/2024-03-01/firewallrules/id_redi.go +++ b/resource-manager/redis/2024-03-01/firewallrules/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2024-03-01/firewallrules/id_redi_test.go b/resource-manager/redis/2024-03-01/firewallrules/id_redi_test.go index 705f80b1a2f..fb5bbdaccc0 100644 --- a/resource-manager/redis/2024-03-01/firewallrules/id_redi_test.go +++ b/resource-manager/redis/2024-03-01/firewallrules/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/patchschedules/README.md b/resource-manager/redis/2024-03-01/patchschedules/README.md index 5c83ff66451..c41e7caf21d 100644 --- a/resource-manager/redis/2024-03-01/patchschedules/README.md +++ b/resource-manager/redis/2024-03-01/patchschedules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := patchschedules.RedisPatchSchedule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := patchschedules.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.ListByRedisResource(ctx, id)` can be used to do batched pagination items, err := client.ListByRedisResourceComplete(ctx, id) diff --git a/resource-manager/redis/2024-03-01/patchschedules/id_redi.go b/resource-manager/redis/2024-03-01/patchschedules/id_redi.go index 48865645f59..050f3a1e79e 100644 --- a/resource-manager/redis/2024-03-01/patchschedules/id_redi.go +++ b/resource-manager/redis/2024-03-01/patchschedules/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2024-03-01/patchschedules/id_redi_test.go b/resource-manager/redis/2024-03-01/patchschedules/id_redi_test.go index c0d258286ba..7a25d343567 100644 --- a/resource-manager/redis/2024-03-01/patchschedules/id_redi_test.go +++ b/resource-manager/redis/2024-03-01/patchschedules/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/privateendpointconnections/README.md b/resource-manager/redis/2024-03-01/privateendpointconnections/README.md index 07c7ede6e35..4d1abda4617 100644 --- a/resource-manager/redis/2024-03-01/privateendpointconnections/README.md +++ b/resource-manager/redis/2024-03-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName") read, err := client.Delete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := privateendpointconnections.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.List(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/redis/2024-03-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/redis/2024-03-01/privateendpointconnections/id_privateendpointconnection.go index 6a0ec3a4b5c..ad0a01db303 100644 --- a/resource-manager/redis/2024-03-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/redis/2024-03-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/redis/2024-03-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/redis/2024-03-01/privateendpointconnections/id_privateendpointconnection_test.go index 0b50835a182..e3295158396 100644 --- a/resource-manager/redis/2024-03-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/redis/2024-03-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/privateendpointconnections/id_redi.go b/resource-manager/redis/2024-03-01/privateendpointconnections/id_redi.go index 0f8e8b3d66d..f048b1fe11d 100644 --- a/resource-manager/redis/2024-03-01/privateendpointconnections/id_redi.go +++ b/resource-manager/redis/2024-03-01/privateendpointconnections/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2024-03-01/privateendpointconnections/id_redi_test.go b/resource-manager/redis/2024-03-01/privateendpointconnections/id_redi_test.go index f6eaab50244..4a00d4e8872 100644 --- a/resource-manager/redis/2024-03-01/privateendpointconnections/id_redi_test.go +++ b/resource-manager/redis/2024-03-01/privateendpointconnections/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/privatelinkresources/README.md b/resource-manager/redis/2024-03-01/privatelinkresources/README.md index 6b62c527538..09107c8a5fb 100644 --- a/resource-manager/redis/2024-03-01/privatelinkresources/README.md +++ b/resource-manager/redis/2024-03-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := privatelinkresources.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.ListByRedisCache(ctx, id) if err != nil { diff --git a/resource-manager/redis/2024-03-01/privatelinkresources/id_redi.go b/resource-manager/redis/2024-03-01/privatelinkresources/id_redi.go index 1b741edb064..6396bc7d845 100644 --- a/resource-manager/redis/2024-03-01/privatelinkresources/id_redi.go +++ b/resource-manager/redis/2024-03-01/privatelinkresources/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2024-03-01/privatelinkresources/id_redi_test.go b/resource-manager/redis/2024-03-01/privatelinkresources/id_redi_test.go index 624c16c774f..e7ce2558187 100644 --- a/resource-manager/redis/2024-03-01/privatelinkresources/id_redi_test.go +++ b/resource-manager/redis/2024-03-01/privatelinkresources/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/redis/README.md b/resource-manager/redis/2024-03-01/redis/README.md index e8c5509277f..e9832da3af2 100644 --- a/resource-manager/redis/2024-03-01/redis/README.md +++ b/resource-manager/redis/2024-03-01/redis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") payload := redis.RedisCacheAccessPolicyAssignment{ // ... @@ -42,7 +42,7 @@ if err := client.AccessPolicyAssignmentCreateUpdateThenPoll(ctx, id, payload); e ```go ctx := context.TODO() -id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") if err := client.AccessPolicyAssignmentDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.AccessPolicyAssignmentDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") +id := redis.NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") read, err := client.AccessPolicyAssignmentGet(ctx, id) if err != nil { @@ -70,7 +70,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.AccessPolicyAssignmentList(ctx, id)` can be used to do batched pagination items, err := client.AccessPolicyAssignmentListComplete(ctx, id) @@ -87,7 +87,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") payload := redis.RedisCacheAccessPolicy{ // ... @@ -104,7 +104,7 @@ if err := client.AccessPolicyCreateUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") if err := client.AccessPolicyDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.AccessPolicyDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") +id := redis.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") read, err := client.AccessPolicyGet(ctx, id) if err != nil { @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.AccessPolicyList(ctx, id)` can be used to do batched pagination items, err := client.AccessPolicyListComplete(ctx, id) @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisCreateParameters{ // ... @@ -187,7 +187,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -199,7 +199,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.ExportRDBParameters{ // ... @@ -216,7 +216,7 @@ if err := client.ExportDataThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") payload := redis.RedisFirewallRule{ // ... @@ -237,7 +237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") read, err := client.FirewallRulesDelete(ctx, id) if err != nil { @@ -253,7 +253,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") +id := redis.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") read, err := client.FirewallRulesGet(ctx, id) if err != nil { @@ -269,7 +269,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.FirewallRulesList(ctx, id)` can be used to do batched pagination items, err := client.FirewallRulesListComplete(ctx, id) @@ -286,7 +286,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if err := client.FlushCacheThenPoll(ctx, id); err != nil { // handle the error @@ -298,7 +298,7 @@ if err := client.FlushCacheThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisRebootParameters{ // ... @@ -319,7 +319,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.Get(ctx, id) if err != nil { @@ -335,7 +335,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.ImportRDBParameters{ // ... @@ -352,7 +352,7 @@ if err := client.ImportDataThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName") +id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName") payload := redis.RedisLinkedServerCreateParameters{ // ... @@ -369,7 +369,7 @@ if err := client.LinkedServerCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName") +id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName") if err := client.LinkedServerDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -381,7 +381,7 @@ if err := client.LinkedServerDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName") +id := redis.NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName") read, err := client.LinkedServerGet(ctx, id) if err != nil { @@ -397,7 +397,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.LinkedServerList(ctx, id)` can be used to do batched pagination items, err := client.LinkedServerListComplete(ctx, id) @@ -448,7 +448,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -464,7 +464,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.ListUpgradeNotifications(ctx, id, redis.DefaultListUpgradeNotificationsOperationOptions())` can be used to do batched pagination items, err := client.ListUpgradeNotificationsComplete(ctx, id, redis.DefaultListUpgradeNotificationsOperationOptions()) @@ -481,7 +481,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisPatchSchedule{ // ... @@ -502,7 +502,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.PatchSchedulesDelete(ctx, id) if err != nil { @@ -518,7 +518,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") read, err := client.PatchSchedulesGet(ctx, id) if err != nil { @@ -534,7 +534,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") // alternatively `client.PatchSchedulesListByRedisResource(ctx, id)` can be used to do batched pagination items, err := client.PatchSchedulesListByRedisResourceComplete(ctx, id) @@ -551,7 +551,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisRegenerateKeyParameters{ // ... @@ -572,7 +572,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := redis.NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") payload := redis.RedisUpdateParameters{ // ... diff --git a/resource-manager/redis/2024-03-01/redis/id_accesspolicy.go b/resource-manager/redis/2024-03-01/redis/id_accesspolicy.go index 11a6ebdb48c..920dd91e030 100644 --- a/resource-manager/redis/2024-03-01/redis/id_accesspolicy.go +++ b/resource-manager/redis/2024-03-01/redis/id_accesspolicy.go @@ -121,7 +121,7 @@ func (id AccessPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticAccessPolicies", "accessPolicies", "accessPolicies"), resourceids.UserSpecifiedSegment("accessPolicyName", "accessPolicyName"), } diff --git a/resource-manager/redis/2024-03-01/redis/id_accesspolicy_test.go b/resource-manager/redis/2024-03-01/redis/id_accesspolicy_test.go index 2f8f30510ed..1ef10b41cd7 100644 --- a/resource-manager/redis/2024-03-01/redis/id_accesspolicy_test.go +++ b/resource-manager/redis/2024-03-01/redis/id_accesspolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyId{} func TestNewAccessPolicyID(t *testing.T) { - id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName") + id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.AccessPolicyName != "accessPolicyName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyID(t *testing.T) { } func TestFormatAccessPolicyID(t *testing.T) { - actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName" + actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicies/accessPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", AccessPolicyName: "aCcEsSpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/redis/id_accesspolicyassignment.go b/resource-manager/redis/2024-03-01/redis/id_accesspolicyassignment.go index afc9b384507..e964e1cbbef 100644 --- a/resource-manager/redis/2024-03-01/redis/id_accesspolicyassignment.go +++ b/resource-manager/redis/2024-03-01/redis/id_accesspolicyassignment.go @@ -121,7 +121,7 @@ func (id AccessPolicyAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticAccessPolicyAssignments", "accessPolicyAssignments", "accessPolicyAssignments"), resourceids.UserSpecifiedSegment("accessPolicyAssignmentName", "accessPolicyAssignmentName"), } diff --git a/resource-manager/redis/2024-03-01/redis/id_accesspolicyassignment_test.go b/resource-manager/redis/2024-03-01/redis/id_accesspolicyassignment_test.go index bf6872707a5..c75a1bff369 100644 --- a/resource-manager/redis/2024-03-01/redis/id_accesspolicyassignment_test.go +++ b/resource-manager/redis/2024-03-01/redis/id_accesspolicyassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyAssignmentId{} func TestNewAccessPolicyAssignmentID(t *testing.T) { - id := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName") + id := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.AccessPolicyAssignmentName != "accessPolicyAssignmentName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyAssignmentID(t *testing.T) { } func TestFormatAccessPolicyAssignmentID(t *testing.T) { - actual := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "accessPolicyAssignmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName" + actual := NewAccessPolicyAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "accessPolicyAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyAssignmentName: "accessPolicyAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", + RedisName: "redisName", AccessPolicyAssignmentName: "accessPolicyAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/accessPolicyAssignments/accessPolicyAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/accessPolicyAssignments/accessPolicyAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE", Expected: &AccessPolicyAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", + RedisName: "rEdIsNaMe", AccessPolicyAssignmentName: "aCcEsSpOlIcYaSsIgNmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/aCcEsSpOlIcYaSsIgNmEnTs/aCcEsSpOlIcYaSsIgNmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/redis/id_firewallrule.go b/resource-manager/redis/2024-03-01/redis/id_firewallrule.go index 896b58fec52..748eacf643b 100644 --- a/resource-manager/redis/2024-03-01/redis/id_firewallrule.go +++ b/resource-manager/redis/2024-03-01/redis/id_firewallrule.go @@ -121,9 +121,9 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "cacheName"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), - resourceids.UserSpecifiedSegment("firewallRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } } diff --git a/resource-manager/redis/2024-03-01/redis/id_firewallrule_test.go b/resource-manager/redis/2024-03-01/redis/id_firewallrule_test.go index 390503e1f66..d14e19501e9 100644 --- a/resource-manager/redis/2024-03-01/redis/id_firewallrule_test.go +++ b/resource-manager/redis/2024-03-01/redis/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "cacheName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "cacheName") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } - if id.FirewallRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "ruleName") + if id.FirewallRuleName != "firewallRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "firewallRuleName") } } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cacheName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", - FirewallRuleName: "ruleName", + RedisName: "redisName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "cacheName", - FirewallRuleName: "ruleName", + RedisName: "redisName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/cacheName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "cAcHeNaMe", - FirewallRuleName: "rUlEnAmE", + RedisName: "rEdIsNaMe", + FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/cAcHeNaMe/fIrEwAlLrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/redis/id_linkedserver.go b/resource-manager/redis/2024-03-01/redis/id_linkedserver.go index e8601f16fa5..f51bdbe8889 100644 --- a/resource-manager/redis/2024-03-01/redis/id_linkedserver.go +++ b/resource-manager/redis/2024-03-01/redis/id_linkedserver.go @@ -121,7 +121,7 @@ func (id LinkedServerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), resourceids.StaticSegment("staticLinkedServers", "linkedServers", "linkedServers"), resourceids.UserSpecifiedSegment("linkedServerName", "linkedServerName"), } diff --git a/resource-manager/redis/2024-03-01/redis/id_linkedserver_test.go b/resource-manager/redis/2024-03-01/redis/id_linkedserver_test.go index 8da5c545f63..51611777396 100644 --- a/resource-manager/redis/2024-03-01/redis/id_linkedserver_test.go +++ b/resource-manager/redis/2024-03-01/redis/id_linkedserver_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LinkedServerId{} func TestNewLinkedServerID(t *testing.T) { - id := NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName") + id := NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewLinkedServerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } if id.LinkedServerName != "linkedServerName" { @@ -32,8 +32,8 @@ func TestNewLinkedServerID(t *testing.T) { } func TestFormatLinkedServerID(t *testing.T) { - actual := NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedServerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName" + actual := NewLinkedServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName", "linkedServerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLinkedServerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName", Expected: &LinkedServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", LinkedServerName: "linkedServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLinkedServerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/lInKeDsErVeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/lInKeDsErVeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName", Expected: &LinkedServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", LinkedServerName: "linkedServerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/linkedServers/linkedServerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/linkedServers/linkedServerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/lInKeDsErVeRs/lInKeDsErVeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/lInKeDsErVeRs/lInKeDsErVeRnAmE", Expected: &LinkedServerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", LinkedServerName: "lInKeDsErVeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/lInKeDsErVeRs/lInKeDsErVeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/lInKeDsErVeRs/lInKeDsErVeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/redis/2024-03-01/redis/id_redi.go b/resource-manager/redis/2024-03-01/redis/id_redi.go index f745aa10725..423b0882905 100644 --- a/resource-manager/redis/2024-03-01/redis/id_redi.go +++ b/resource-manager/redis/2024-03-01/redis/id_redi.go @@ -115,7 +115,7 @@ func (id RediId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedis", "redis", "redis"), - resourceids.UserSpecifiedSegment("redisName", "name"), + resourceids.UserSpecifiedSegment("redisName", "redisName"), } } diff --git a/resource-manager/redis/2024-03-01/redis/id_redi_test.go b/resource-manager/redis/2024-03-01/redis/id_redi_test.go index 2082f302950..5f77e9b3569 100644 --- a/resource-manager/redis/2024-03-01/redis/id_redi_test.go +++ b/resource-manager/redis/2024-03-01/redis/id_redi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RediId{} func TestNewRediID(t *testing.T) { - id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRediID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "name") + if id.RedisName != "redisName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisName'", id.RedisName, "redisName") } } func TestFormatRediID(t *testing.T) { - actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name" + actual := NewRediID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRediID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRediIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisName: "name", + RedisName: "redisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redis/redisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe", Expected: &RediId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisName: "nAmE", + RedisName: "rEdIsNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIs/rEdIsNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-07-01/databases/README.md b/resource-manager/redisenterprise/2023-07-01/databases/README.md index e70b0542fb6..1cdf541b683 100644 --- a/resource-manager/redisenterprise/2023-07-01/databases/README.md +++ b/resource-manager/redisenterprise/2023-07-01/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ExportClusterParameters{ // ... @@ -70,7 +70,7 @@ if err := client.ExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.FlushParameters{ // ... @@ -87,7 +87,7 @@ if err := client.FlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ForceUnlinkParameters{ // ... @@ -104,7 +104,7 @@ if err := client.ForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ImportClusterParameters{ // ... @@ -137,7 +137,7 @@ if err := client.ImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByClusterComplete(ctx, id) @@ -154,7 +154,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.RegenerateKeyParameters{ // ... @@ -187,7 +187,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.DatabaseUpdate{ // ... diff --git a/resource-manager/redisenterprise/2023-07-01/databases/id_database.go b/resource-manager/redisenterprise/2023-07-01/databases/id_database.go index 00dec593214..c2402902641 100644 --- a/resource-manager/redisenterprise/2023-07-01/databases/id_database.go +++ b/resource-manager/redisenterprise/2023-07-01/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2023-07-01/databases/id_database_test.go b/resource-manager/redisenterprise/2023-07-01/databases/id_database_test.go index 23cfb4708dd..5dbc49dabaf 100644 --- a/resource-manager/redisenterprise/2023-07-01/databases/id_database_test.go +++ b/resource-manager/redisenterprise/2023-07-01/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-07-01/databases/id_redisenterprise.go b/resource-manager/redisenterprise/2023-07-01/databases/id_redisenterprise.go index 480ce6d5a03..c872e92eb24 100644 --- a/resource-manager/redisenterprise/2023-07-01/databases/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-07-01/databases/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-07-01/databases/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-07-01/databases/id_redisenterprise_test.go index c2d810a8396..06c2b187531 100644 --- a/resource-manager/redisenterprise/2023-07-01/databases/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-07-01/databases/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/README.md b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/README.md index 14e6ef49e56..bd9067d9089 100644 --- a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/README.md +++ b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.List(ctx, id) if err != nil { @@ -68,7 +68,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_privateendpointconnection.go index 79acd6ba5ee..26ef2c08058 100644 --- a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_privateendpointconnection_test.go index 3833e54094b..6361371497e 100644 --- a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_redisenterprise.go b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_redisenterprise.go index 545512526ee..6449511cb2f 100644 --- a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_redisenterprise_test.go index 977d843cca6..d5ce5afd6e9 100644 --- a/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-07-01/privateendpointconnections/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-07-01/privatelinkresources/README.md b/resource-manager/redisenterprise/2023-07-01/privatelinkresources/README.md index afb628254bf..8a6f0fa4683 100644 --- a/resource-manager/redisenterprise/2023-07-01/privatelinkresources/README.md +++ b/resource-manager/redisenterprise/2023-07-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/redisenterprise/2023-07-01/privatelinkresources/id_redisenterprise.go b/resource-manager/redisenterprise/2023-07-01/privatelinkresources/id_redisenterprise.go index 5b0bef5ace4..b57b6c2bd42 100644 --- a/resource-manager/redisenterprise/2023-07-01/privatelinkresources/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-07-01/privatelinkresources/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-07-01/privatelinkresources/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-07-01/privatelinkresources/id_redisenterprise_test.go index f26ab91c98a..c43caa9e0f6 100644 --- a/resource-manager/redisenterprise/2023-07-01/privatelinkresources/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-07-01/privatelinkresources/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-07-01/redisenterprise/README.md b/resource-manager/redisenterprise/2023-07-01/redisenterprise/README.md index 8e9c9085ba2..bfdcf0da5df 100644 --- a/resource-manager/redisenterprise/2023-07-01/redisenterprise/README.md +++ b/resource-manager/redisenterprise/2023-07-01/redisenterprise/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.Cluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.Database{ // ... @@ -59,7 +59,7 @@ if err := client.DatabasesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ExportClusterParameters{ // ... @@ -88,7 +88,7 @@ if err := client.DatabasesExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.FlushParameters{ // ... @@ -105,7 +105,7 @@ if err := client.DatabasesFlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ForceUnlinkParameters{ // ... @@ -122,7 +122,7 @@ if err := client.DatabasesForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesGet(ctx, id) if err != nil { @@ -138,7 +138,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ImportClusterParameters{ // ... @@ -155,7 +155,7 @@ if err := client.DatabasesImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.DatabasesListByCluster(ctx, id)` can be used to do batched pagination items, err := client.DatabasesListByClusterComplete(ctx, id) @@ -172,7 +172,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesListKeys(ctx, id) if err != nil { @@ -188,7 +188,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.RegenerateKeyParameters{ // ... @@ -205,7 +205,7 @@ if err := client.DatabasesRegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.DatabaseUpdate{ // ... @@ -222,7 +222,7 @@ if err := client.DatabasesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -234,7 +234,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.Get(ctx, id) if err != nil { @@ -284,7 +284,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.ClusterUpdate{ // ... diff --git a/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_database.go b/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_database.go index cfa855a7683..f7352ec7d89 100644 --- a/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_database.go +++ b/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_database_test.go b/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_database_test.go index c10149de201..ec9168fdb8c 100644 --- a/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_database_test.go +++ b/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_redisenterprise.go b/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_redisenterprise.go index a51de530d49..de1d9d9bef2 100644 --- a/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_redisenterprise_test.go index b1ef3e8cfc5..8676cc8523e 100644 --- a/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-07-01/redisenterprise/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/databases/README.md b/resource-manager/redisenterprise/2023-10-01-preview/databases/README.md index 9255e014ee1..acf16365aa1 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/databases/README.md +++ b/resource-manager/redisenterprise/2023-10-01-preview/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ExportClusterParameters{ // ... @@ -70,7 +70,7 @@ if err := client.ExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.FlushParameters{ // ... @@ -87,7 +87,7 @@ if err := client.FlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ForceUnlinkParameters{ // ... @@ -104,7 +104,7 @@ if err := client.ForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ImportClusterParameters{ // ... @@ -137,7 +137,7 @@ if err := client.ImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByClusterComplete(ctx, id) @@ -154,7 +154,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.RegenerateKeyParameters{ // ... @@ -187,7 +187,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.DatabaseUpdate{ // ... diff --git a/resource-manager/redisenterprise/2023-10-01-preview/databases/id_database.go b/resource-manager/redisenterprise/2023-10-01-preview/databases/id_database.go index 00dec593214..c2402902641 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/databases/id_database.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/databases/id_database_test.go b/resource-manager/redisenterprise/2023-10-01-preview/databases/id_database_test.go index 23cfb4708dd..5dbc49dabaf 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/databases/id_database_test.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/databases/id_redisenterprise.go b/resource-manager/redisenterprise/2023-10-01-preview/databases/id_redisenterprise.go index 480ce6d5a03..c872e92eb24 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/databases/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/databases/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/databases/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-10-01-preview/databases/id_redisenterprise_test.go index c2d810a8396..06c2b187531 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/databases/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/databases/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/README.md b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/README.md index 9c13addb0a4..1424fc46403 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/README.md +++ b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.List(ctx, id) if err != nil { @@ -68,7 +68,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_privateendpointconnection.go index 79acd6ba5ee..26ef2c08058 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_privateendpointconnection_test.go index 3833e54094b..6361371497e 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_redisenterprise.go b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_redisenterprise.go index 545512526ee..6449511cb2f 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_redisenterprise_test.go index 977d843cca6..d5ce5afd6e9 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/privateendpointconnections/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/README.md b/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/README.md index 25bbaa3615c..8f4c70154ae 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/README.md +++ b/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/id_redisenterprise.go b/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/id_redisenterprise.go index 5b0bef5ace4..b57b6c2bd42 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/id_redisenterprise_test.go index f26ab91c98a..c43caa9e0f6 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/privatelinkresources/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/README.md b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/README.md index 5e57639172e..8c5d90b69da 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/README.md +++ b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/README.md @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.Cluster{ // ... @@ -63,7 +63,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.Database{ // ... @@ -80,7 +80,7 @@ if err := client.DatabasesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -92,7 +92,7 @@ if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ExportClusterParameters{ // ... @@ -109,7 +109,7 @@ if err := client.DatabasesExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.FlushParameters{ // ... @@ -126,7 +126,7 @@ if err := client.DatabasesFlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ForceUnlinkParameters{ // ... @@ -143,7 +143,7 @@ if err := client.DatabasesForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesGet(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ImportClusterParameters{ // ... @@ -176,7 +176,7 @@ if err := client.DatabasesImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.DatabasesListByCluster(ctx, id)` can be used to do batched pagination items, err := client.DatabasesListByClusterComplete(ctx, id) @@ -193,7 +193,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesListKeys(ctx, id) if err != nil { @@ -209,7 +209,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.RegenerateKeyParameters{ // ... @@ -226,7 +226,7 @@ if err := client.DatabasesRegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.DatabaseUpdate{ // ... @@ -243,7 +243,7 @@ if err := client.DatabasesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -255,7 +255,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.Get(ctx, id) if err != nil { @@ -305,7 +305,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.ClusterUpdate{ // ... diff --git a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_database.go b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_database.go index cfa855a7683..f7352ec7d89 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_database.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_database_test.go b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_database_test.go index c10149de201..ec9168fdb8c 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_database_test.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_redisenterprise.go b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_redisenterprise.go index a51de530d49..de1d9d9bef2 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_redisenterprise_test.go index b1ef3e8cfc5..8676cc8523e 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go index fb4cf04d887..8c3ddebdaca 100644 --- a/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go +++ b/resource-manager/redisenterprise/2023-10-01-preview/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go @@ -5,5 +5,5 @@ package redisenterprise type ClusterPropertiesEncryptionCustomerManagedKeyEncryption struct { KeyEncryptionKeyIdentity *ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyEncryptionKeyIdentity `json:"keyEncryptionKeyIdentity,omitempty"` - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/redisenterprise/2023-11-01/databases/README.md b/resource-manager/redisenterprise/2023-11-01/databases/README.md index 30b774b90b9..08acb209c34 100644 --- a/resource-manager/redisenterprise/2023-11-01/databases/README.md +++ b/resource-manager/redisenterprise/2023-11-01/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ExportClusterParameters{ // ... @@ -70,7 +70,7 @@ if err := client.ExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.FlushParameters{ // ... @@ -87,7 +87,7 @@ if err := client.FlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ForceUnlinkParameters{ // ... @@ -104,7 +104,7 @@ if err := client.ForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ImportClusterParameters{ // ... @@ -137,7 +137,7 @@ if err := client.ImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByClusterComplete(ctx, id) @@ -154,7 +154,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.RegenerateKeyParameters{ // ... @@ -187,7 +187,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.DatabaseUpdate{ // ... diff --git a/resource-manager/redisenterprise/2023-11-01/databases/id_database.go b/resource-manager/redisenterprise/2023-11-01/databases/id_database.go index 00dec593214..c2402902641 100644 --- a/resource-manager/redisenterprise/2023-11-01/databases/id_database.go +++ b/resource-manager/redisenterprise/2023-11-01/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2023-11-01/databases/id_database_test.go b/resource-manager/redisenterprise/2023-11-01/databases/id_database_test.go index 23cfb4708dd..5dbc49dabaf 100644 --- a/resource-manager/redisenterprise/2023-11-01/databases/id_database_test.go +++ b/resource-manager/redisenterprise/2023-11-01/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-11-01/databases/id_redisenterprise.go b/resource-manager/redisenterprise/2023-11-01/databases/id_redisenterprise.go index 480ce6d5a03..c872e92eb24 100644 --- a/resource-manager/redisenterprise/2023-11-01/databases/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-11-01/databases/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-11-01/databases/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-11-01/databases/id_redisenterprise_test.go index c2d810a8396..06c2b187531 100644 --- a/resource-manager/redisenterprise/2023-11-01/databases/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-11-01/databases/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/README.md b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/README.md index 16a6b48786a..2f625cfa917 100644 --- a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/README.md +++ b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.List(ctx, id) if err != nil { @@ -68,7 +68,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_privateendpointconnection.go index 79acd6ba5ee..26ef2c08058 100644 --- a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_privateendpointconnection_test.go index 3833e54094b..6361371497e 100644 --- a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_redisenterprise.go b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_redisenterprise.go index 545512526ee..6449511cb2f 100644 --- a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_redisenterprise_test.go index 977d843cca6..d5ce5afd6e9 100644 --- a/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-11-01/privateendpointconnections/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-11-01/privatelinkresources/README.md b/resource-manager/redisenterprise/2023-11-01/privatelinkresources/README.md index 91974d105e4..0618d62ff33 100644 --- a/resource-manager/redisenterprise/2023-11-01/privatelinkresources/README.md +++ b/resource-manager/redisenterprise/2023-11-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/redisenterprise/2023-11-01/privatelinkresources/id_redisenterprise.go b/resource-manager/redisenterprise/2023-11-01/privatelinkresources/id_redisenterprise.go index 5b0bef5ace4..b57b6c2bd42 100644 --- a/resource-manager/redisenterprise/2023-11-01/privatelinkresources/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-11-01/privatelinkresources/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-11-01/privatelinkresources/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-11-01/privatelinkresources/id_redisenterprise_test.go index f26ab91c98a..c43caa9e0f6 100644 --- a/resource-manager/redisenterprise/2023-11-01/privatelinkresources/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-11-01/privatelinkresources/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-11-01/redisenterprise/README.md b/resource-manager/redisenterprise/2023-11-01/redisenterprise/README.md index ea627369f37..20011efd7b5 100644 --- a/resource-manager/redisenterprise/2023-11-01/redisenterprise/README.md +++ b/resource-manager/redisenterprise/2023-11-01/redisenterprise/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.Cluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.Database{ // ... @@ -59,7 +59,7 @@ if err := client.DatabasesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ExportClusterParameters{ // ... @@ -88,7 +88,7 @@ if err := client.DatabasesExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.FlushParameters{ // ... @@ -105,7 +105,7 @@ if err := client.DatabasesFlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ForceUnlinkParameters{ // ... @@ -122,7 +122,7 @@ if err := client.DatabasesForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesGet(ctx, id) if err != nil { @@ -138,7 +138,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ImportClusterParameters{ // ... @@ -155,7 +155,7 @@ if err := client.DatabasesImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.DatabasesListByCluster(ctx, id)` can be used to do batched pagination items, err := client.DatabasesListByClusterComplete(ctx, id) @@ -172,7 +172,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesListKeys(ctx, id) if err != nil { @@ -188,7 +188,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.RegenerateKeyParameters{ // ... @@ -205,7 +205,7 @@ if err := client.DatabasesRegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.DatabaseUpdate{ // ... @@ -222,7 +222,7 @@ if err := client.DatabasesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -234,7 +234,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.Get(ctx, id) if err != nil { @@ -284,7 +284,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.ClusterUpdate{ // ... diff --git a/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_database.go b/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_database.go index cfa855a7683..f7352ec7d89 100644 --- a/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_database.go +++ b/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_database_test.go b/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_database_test.go index c10149de201..ec9168fdb8c 100644 --- a/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_database_test.go +++ b/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_redisenterprise.go b/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_redisenterprise.go index a51de530d49..de1d9d9bef2 100644 --- a/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_redisenterprise_test.go b/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_redisenterprise_test.go index b1ef3e8cfc5..8676cc8523e 100644 --- a/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2023-11-01/redisenterprise/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2023-11-01/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go b/resource-manager/redisenterprise/2023-11-01/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go index fb4cf04d887..8c3ddebdaca 100644 --- a/resource-manager/redisenterprise/2023-11-01/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go +++ b/resource-manager/redisenterprise/2023-11-01/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go @@ -5,5 +5,5 @@ package redisenterprise type ClusterPropertiesEncryptionCustomerManagedKeyEncryption struct { KeyEncryptionKeyIdentity *ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyEncryptionKeyIdentity `json:"keyEncryptionKeyIdentity,omitempty"` - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/redisenterprise/2024-02-01/databases/README.md b/resource-manager/redisenterprise/2024-02-01/databases/README.md index 7f5cc366765..ea613dd1efc 100644 --- a/resource-manager/redisenterprise/2024-02-01/databases/README.md +++ b/resource-manager/redisenterprise/2024-02-01/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ExportClusterParameters{ // ... @@ -70,7 +70,7 @@ if err := client.ExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.FlushParameters{ // ... @@ -87,7 +87,7 @@ if err := client.FlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ForceUnlinkParameters{ // ... @@ -104,7 +104,7 @@ if err := client.ForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ImportClusterParameters{ // ... @@ -137,7 +137,7 @@ if err := client.ImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByClusterComplete(ctx, id) @@ -154,7 +154,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -170,7 +170,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.RegenerateKeyParameters{ // ... @@ -187,7 +187,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.DatabaseUpdate{ // ... diff --git a/resource-manager/redisenterprise/2024-02-01/databases/id_database.go b/resource-manager/redisenterprise/2024-02-01/databases/id_database.go index 00dec593214..c2402902641 100644 --- a/resource-manager/redisenterprise/2024-02-01/databases/id_database.go +++ b/resource-manager/redisenterprise/2024-02-01/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2024-02-01/databases/id_database_test.go b/resource-manager/redisenterprise/2024-02-01/databases/id_database_test.go index 23cfb4708dd..5dbc49dabaf 100644 --- a/resource-manager/redisenterprise/2024-02-01/databases/id_database_test.go +++ b/resource-manager/redisenterprise/2024-02-01/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-02-01/databases/id_redisenterprise.go b/resource-manager/redisenterprise/2024-02-01/databases/id_redisenterprise.go index 480ce6d5a03..c872e92eb24 100644 --- a/resource-manager/redisenterprise/2024-02-01/databases/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2024-02-01/databases/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2024-02-01/databases/id_redisenterprise_test.go b/resource-manager/redisenterprise/2024-02-01/databases/id_redisenterprise_test.go index c2d810a8396..06c2b187531 100644 --- a/resource-manager/redisenterprise/2024-02-01/databases/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2024-02-01/databases/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/README.md b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/README.md index 22be92a7139..d987ccae1f5 100644 --- a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/README.md +++ b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.List(ctx, id) if err != nil { @@ -68,7 +68,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_privateendpointconnection.go index 79acd6ba5ee..26ef2c08058 100644 --- a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_privateendpointconnection_test.go index 3833e54094b..6361371497e 100644 --- a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_redisenterprise.go b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_redisenterprise.go index 545512526ee..6449511cb2f 100644 --- a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_redisenterprise_test.go b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_redisenterprise_test.go index 977d843cca6..d5ce5afd6e9 100644 --- a/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2024-02-01/privateendpointconnections/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-02-01/privatelinkresources/README.md b/resource-manager/redisenterprise/2024-02-01/privatelinkresources/README.md index f3a3cf152d5..df1661fdb55 100644 --- a/resource-manager/redisenterprise/2024-02-01/privatelinkresources/README.md +++ b/resource-manager/redisenterprise/2024-02-01/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/redisenterprise/2024-02-01/privatelinkresources/id_redisenterprise.go b/resource-manager/redisenterprise/2024-02-01/privatelinkresources/id_redisenterprise.go index 5b0bef5ace4..b57b6c2bd42 100644 --- a/resource-manager/redisenterprise/2024-02-01/privatelinkresources/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2024-02-01/privatelinkresources/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2024-02-01/privatelinkresources/id_redisenterprise_test.go b/resource-manager/redisenterprise/2024-02-01/privatelinkresources/id_redisenterprise_test.go index f26ab91c98a..c43caa9e0f6 100644 --- a/resource-manager/redisenterprise/2024-02-01/privatelinkresources/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2024-02-01/privatelinkresources/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-02-01/redisenterprise/README.md b/resource-manager/redisenterprise/2024-02-01/redisenterprise/README.md index c66f2df22d1..9e6240fcee4 100644 --- a/resource-manager/redisenterprise/2024-02-01/redisenterprise/README.md +++ b/resource-manager/redisenterprise/2024-02-01/redisenterprise/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.Cluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.Database{ // ... @@ -59,7 +59,7 @@ if err := client.DatabasesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ExportClusterParameters{ // ... @@ -88,7 +88,7 @@ if err := client.DatabasesExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.FlushParameters{ // ... @@ -105,7 +105,7 @@ if err := client.DatabasesFlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ForceUnlinkParameters{ // ... @@ -122,7 +122,7 @@ if err := client.DatabasesForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesGet(ctx, id) if err != nil { @@ -138,7 +138,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ImportClusterParameters{ // ... @@ -155,7 +155,7 @@ if err := client.DatabasesImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.DatabasesListByCluster(ctx, id)` can be used to do batched pagination items, err := client.DatabasesListByClusterComplete(ctx, id) @@ -172,7 +172,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesListKeys(ctx, id) if err != nil { @@ -188,7 +188,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.RegenerateKeyParameters{ // ... @@ -205,7 +205,7 @@ if err := client.DatabasesRegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.DatabaseUpdate{ // ... @@ -222,7 +222,7 @@ if err := client.DatabasesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -234,7 +234,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.Get(ctx, id) if err != nil { @@ -284,7 +284,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.ClusterUpdate{ // ... diff --git a/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_database.go b/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_database.go index cfa855a7683..f7352ec7d89 100644 --- a/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_database.go +++ b/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_database_test.go b/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_database_test.go index c10149de201..ec9168fdb8c 100644 --- a/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_database_test.go +++ b/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_redisenterprise.go b/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_redisenterprise.go index a51de530d49..de1d9d9bef2 100644 --- a/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_redisenterprise_test.go b/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_redisenterprise_test.go index b1ef3e8cfc5..8676cc8523e 100644 --- a/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2024-02-01/redisenterprise/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-02-01/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go b/resource-manager/redisenterprise/2024-02-01/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go index fb4cf04d887..8c3ddebdaca 100644 --- a/resource-manager/redisenterprise/2024-02-01/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go +++ b/resource-manager/redisenterprise/2024-02-01/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go @@ -5,5 +5,5 @@ package redisenterprise type ClusterPropertiesEncryptionCustomerManagedKeyEncryption struct { KeyEncryptionKeyIdentity *ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyEncryptionKeyIdentity `json:"keyEncryptionKeyIdentity,omitempty"` - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/databases/README.md b/resource-manager/redisenterprise/2024-06-01-preview/databases/README.md index cf95163b34d..90651b539a2 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/databases/README.md +++ b/resource-manager/redisenterprise/2024-06-01-preview/databases/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.Database{ // ... @@ -41,7 +41,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ExportClusterParameters{ // ... @@ -70,7 +70,7 @@ if err := client.ExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.FlushParameters{ // ... @@ -87,7 +87,7 @@ if err := client.FlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ForceLinkParameters{ // ... @@ -104,7 +104,7 @@ if err := client.ForceLinkToReplicationGroupThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ForceUnlinkParameters{ // ... @@ -121,7 +121,7 @@ if err := client.ForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.Get(ctx, id) if err != nil { @@ -137,7 +137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.ImportClusterParameters{ // ... @@ -154,7 +154,7 @@ if err := client.ImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := databases.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination items, err := client.ListByClusterComplete(ctx, id) @@ -171,7 +171,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -187,7 +187,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.RegenerateKeyParameters{ // ... @@ -204,7 +204,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := databases.DatabaseUpdate{ // ... @@ -221,7 +221,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := databases.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.UpgradeDBRedisVersionThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/redisenterprise/2024-06-01-preview/databases/id_database.go b/resource-manager/redisenterprise/2024-06-01-preview/databases/id_database.go index 00dec593214..c2402902641 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/databases/id_database.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/databases/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/databases/id_database_test.go b/resource-manager/redisenterprise/2024-06-01-preview/databases/id_database_test.go index 23cfb4708dd..5dbc49dabaf 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/databases/id_database_test.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/databases/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/databases/id_redisenterprise.go b/resource-manager/redisenterprise/2024-06-01-preview/databases/id_redisenterprise.go index 480ce6d5a03..c872e92eb24 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/databases/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/databases/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/databases/id_redisenterprise_test.go b/resource-manager/redisenterprise/2024-06-01-preview/databases/id_redisenterprise_test.go index c2d810a8396..06c2b187531 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/databases/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/databases/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/README.md b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/README.md index 1c4d78ca3f6..40a776cb6c4 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/README.md +++ b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -52,7 +52,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privateendpointconnections.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.List(ctx, id) if err != nil { @@ -68,7 +68,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_privateendpointconnection.go index 79acd6ba5ee..26ef2c08058 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_privateendpointconnection_test.go index 3833e54094b..6361371497e 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_redisenterprise.go b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_redisenterprise.go index 545512526ee..6449511cb2f 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_redisenterprise_test.go b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_redisenterprise_test.go index 977d843cca6..d5ce5afd6e9 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/privateendpointconnections/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/README.md b/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/README.md index 39268b7dd71..001affd5cce 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/README.md +++ b/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := privatelinkresources.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.ListByCluster(ctx, id) if err != nil { diff --git a/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/id_redisenterprise.go b/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/id_redisenterprise.go index 5b0bef5ace4..b57b6c2bd42 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/id_redisenterprise_test.go b/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/id_redisenterprise_test.go index f26ab91c98a..c43caa9e0f6 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/privatelinkresources/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/README.md b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/README.md index 4f66b9dabe0..54800f2cd75 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/README.md +++ b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.Cluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.Database{ // ... @@ -59,7 +59,7 @@ if err := client.DatabasesCreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -71,7 +71,7 @@ if err := client.DatabasesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ExportClusterParameters{ // ... @@ -88,7 +88,7 @@ if err := client.DatabasesExportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.FlushParameters{ // ... @@ -105,7 +105,7 @@ if err := client.DatabasesFlushThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ForceLinkParameters{ // ... @@ -122,7 +122,7 @@ if err := client.DatabasesForceLinkToReplicationGroupThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ForceUnlinkParameters{ // ... @@ -139,7 +139,7 @@ if err := client.DatabasesForceUnlinkThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesGet(ctx, id) if err != nil { @@ -155,7 +155,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.ImportClusterParameters{ // ... @@ -172,7 +172,7 @@ if err := client.DatabasesImportThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") // alternatively `client.DatabasesListByCluster(ctx, id)` can be used to do batched pagination items, err := client.DatabasesListByClusterComplete(ctx, id) @@ -189,7 +189,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") read, err := client.DatabasesListKeys(ctx, id) if err != nil { @@ -205,7 +205,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.RegenerateKeyParameters{ // ... @@ -222,7 +222,7 @@ if err := client.DatabasesRegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") payload := redisenterprise.DatabaseUpdate{ // ... @@ -239,7 +239,7 @@ if err := client.DatabasesUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") +id := redisenterprise.NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if err := client.DatabasesUpgradeDBRedisVersionThenPoll(ctx, id); err != nil { // handle the error @@ -251,7 +251,7 @@ if err := client.DatabasesUpgradeDBRedisVersionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -263,7 +263,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") read, err := client.Get(ctx, id) if err != nil { @@ -313,7 +313,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := redisenterprise.NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") payload := redisenterprise.ClusterUpdate{ // ... diff --git a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_database.go b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_database.go index cfa855a7683..f7352ec7d89 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_database.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_database.go @@ -121,7 +121,7 @@ func (id DatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), resourceids.StaticSegment("staticDatabases", "databases", "databases"), resourceids.UserSpecifiedSegment("databaseName", "databaseName"), } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_database_test.go b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_database_test.go index c10149de201..ec9168fdb8c 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_database_test.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_database_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseId{} func TestNewDatabaseID(t *testing.T) { - id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName") + id := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } if id.DatabaseName != "databaseName" { @@ -32,8 +32,8 @@ func TestNewDatabaseID(t *testing.T) { } func TestFormatDatabaseID(t *testing.T) { - actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName" + actual := NewDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName", "databaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", DatabaseName: "databaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/databases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/databases/databaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE", Expected: &DatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", DatabaseName: "dAtAbAsEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/dAtAbAsEs/dAtAbAsEnAmE/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_redisenterprise.go b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_redisenterprise.go index a51de530d49..de1d9d9bef2 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_redisenterprise.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_redisenterprise.go @@ -115,7 +115,7 @@ func (id RedisEnterpriseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftCache", "Microsoft.Cache", "Microsoft.Cache"), resourceids.StaticSegment("staticRedisEnterprise", "redisEnterprise", "redisEnterprise"), - resourceids.UserSpecifiedSegment("redisEnterpriseName", "clusterName"), + resourceids.UserSpecifiedSegment("redisEnterpriseName", "redisEnterpriseName"), } } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_redisenterprise_test.go b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_redisenterprise_test.go index b1ef3e8cfc5..8676cc8523e 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_redisenterprise_test.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/id_redisenterprise_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RedisEnterpriseId{} func TestNewRedisEnterpriseID(t *testing.T) { - id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewRedisEnterpriseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.RedisEnterpriseName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "clusterName") + if id.RedisEnterpriseName != "redisEnterpriseName" { + t.Fatalf("Expected %q but got %q for Segment 'RedisEnterpriseName'", id.RedisEnterpriseName, "redisEnterpriseName") } } func TestFormatRedisEnterpriseID(t *testing.T) { - actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName" + actual := NewRedisEnterpriseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "redisEnterpriseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseRedisEnterpriseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseRedisEnterpriseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - RedisEnterpriseName: "clusterName", + RedisEnterpriseName: "redisEnterpriseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Cache/redisEnterprise/redisEnterpriseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe", Expected: &RedisEnterpriseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RedisEnterpriseName: "cLuStErNaMe", + RedisEnterpriseName: "rEdIsEnTeRpRiSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cAcHe/rEdIsEnTeRpRiSe/rEdIsEnTeRpRiSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go index fb4cf04d887..8c3ddebdaca 100644 --- a/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go +++ b/resource-manager/redisenterprise/2024-06-01-preview/redisenterprise/model_clusterpropertiesencryptioncustomermanagedkeyencryption.go @@ -5,5 +5,5 @@ package redisenterprise type ClusterPropertiesEncryptionCustomerManagedKeyEncryption struct { KeyEncryptionKeyIdentity *ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyEncryptionKeyIdentity `json:"keyEncryptionKeyIdentity,omitempty"` - KeyEncryptionKeyUrl *string `json:"keyEncryptionKeyUrl,omitempty"` + KeyEncryptionKeyURL *string `json:"keyEncryptionKeyUrl,omitempty"` } diff --git a/resource-manager/relay/2021-11-01/wcfrelays/README.md b/resource-manager/relay/2021-11-01/wcfrelays/README.md index 4e365666051..edb3bab2418 100644 --- a/resource-manager/relay/2021-11-01/wcfrelays/README.md +++ b/resource-manager/relay/2021-11-01/wcfrelays/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") +id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") payload := wcfrelays.WcfRelay{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") payload := wcfrelays.AuthorizationRule{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") +id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") read, err := client.DeleteAuthorizationRule(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") +id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") read, err := client.Get(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") +id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") // alternatively `client.ListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.ListAuthorizationRulesComplete(ctx, id) @@ -164,7 +164,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -180,7 +180,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") payload := wcfrelays.RegenerateAccessKeyParameters{ // ... diff --git a/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelay.go b/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelay.go index ba6da5d5ce6..0c9944753f3 100644 --- a/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelay.go +++ b/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelay.go @@ -123,7 +123,7 @@ func (id WcfRelayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticWcfRelays", "wcfRelays", "wcfRelays"), - resourceids.UserSpecifiedSegment("wcfRelayName", "relayName"), + resourceids.UserSpecifiedSegment("wcfRelayName", "wcfRelayName"), } } diff --git a/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelay_test.go b/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelay_test.go index 3f9ba828f5a..6c02b937e38 100644 --- a/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelay_test.go +++ b/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WcfRelayId{} func TestNewWcfRelayID(t *testing.T) { - id := NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") + id := NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWcfRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.WcfRelayName != "relayName" { - t.Fatalf("Expected %q but got %q for Segment 'WcfRelayName'", id.WcfRelayName, "relayName") + if id.WcfRelayName != "wcfRelayName" { + t.Fatalf("Expected %q but got %q for Segment 'WcfRelayName'", id.WcfRelayName, "wcfRelayName") } } func TestFormatWcfRelayID(t *testing.T) { - actual := NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName" + actual := NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWcfRelayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName", Expected: &WcfRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - WcfRelayName: "relayName", + WcfRelayName: "wcfRelayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWcfRelayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName", Expected: &WcfRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - WcfRelayName: "relayName", + WcfRelayName: "wcfRelayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE", Expected: &WcfRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - WcfRelayName: "rElAyNaMe", + WcfRelayName: "wCfReLaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelayauthorizationrule.go b/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelayauthorizationrule.go index 3f16710da95..8085f677ab1 100644 --- a/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelayauthorizationrule.go +++ b/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelayauthorizationrule.go @@ -129,7 +129,7 @@ func (id WcfRelayAuthorizationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticWcfRelays", "wcfRelays", "wcfRelays"), - resourceids.UserSpecifiedSegment("wcfRelayName", "relayName"), + resourceids.UserSpecifiedSegment("wcfRelayName", "wcfRelayName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelayauthorizationrule_test.go b/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelayauthorizationrule_test.go index ac8dc47655b..2ce3b398b5d 100644 --- a/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelayauthorizationrule_test.go +++ b/resource-manager/relay/2021-11-01/wcfrelays/id_wcfrelayauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WcfRelayAuthorizationRuleId{} func TestNewWcfRelayAuthorizationRuleID(t *testing.T) { - id := NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") + id := NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewWcfRelayAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.WcfRelayName != "relayName" { - t.Fatalf("Expected %q but got %q for Segment 'WcfRelayName'", id.WcfRelayName, "relayName") + if id.WcfRelayName != "wcfRelayName" { + t.Fatalf("Expected %q but got %q for Segment 'WcfRelayName'", id.WcfRelayName, "wcfRelayName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewWcfRelayAuthorizationRuleID(t *testing.T) { } func TestFormatWcfRelayAuthorizationRuleID(t *testing.T) { - actual := NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName" + actual := NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseWcfRelayAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName", Expected: &WcfRelayAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - WcfRelayName: "relayName", + WcfRelayName: "wcfRelayName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseWcfRelayAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName", Expected: &WcfRelayAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - WcfRelayName: "relayName", + WcfRelayName: "wcfRelayName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &WcfRelayAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - WcfRelayName: "rElAyNaMe", + WcfRelayName: "wCfReLaYnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/relay/2024-01-01/wcfrelays/README.md b/resource-manager/relay/2024-01-01/wcfrelays/README.md index d3ebf39f021..a3874a8e9b2 100644 --- a/resource-manager/relay/2024-01-01/wcfrelays/README.md +++ b/resource-manager/relay/2024-01-01/wcfrelays/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") +id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") payload := wcfrelays.WcfRelay{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") payload := wcfrelays.AuthorizationRule{ // ... @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") +id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") read, err := client.Delete(ctx, id) if err != nil { @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") read, err := client.DeleteAuthorizationRule(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") +id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") read, err := client.Get(ctx, id) if err != nil { @@ -114,7 +114,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { @@ -130,7 +130,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") +id := wcfrelays.NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") // alternatively `client.ListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.ListAuthorizationRulesComplete(ctx, id) @@ -164,7 +164,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -180,7 +180,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") +id := wcfrelays.NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") payload := wcfrelays.RegenerateAccessKeyParameters{ // ... diff --git a/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelay.go b/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelay.go index ba6da5d5ce6..0c9944753f3 100644 --- a/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelay.go +++ b/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelay.go @@ -123,7 +123,7 @@ func (id WcfRelayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticWcfRelays", "wcfRelays", "wcfRelays"), - resourceids.UserSpecifiedSegment("wcfRelayName", "relayName"), + resourceids.UserSpecifiedSegment("wcfRelayName", "wcfRelayName"), } } diff --git a/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelay_test.go b/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelay_test.go index 3f9ba828f5a..6c02b937e38 100644 --- a/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelay_test.go +++ b/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WcfRelayId{} func TestNewWcfRelayID(t *testing.T) { - id := NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName") + id := NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewWcfRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.WcfRelayName != "relayName" { - t.Fatalf("Expected %q but got %q for Segment 'WcfRelayName'", id.WcfRelayName, "relayName") + if id.WcfRelayName != "wcfRelayName" { + t.Fatalf("Expected %q but got %q for Segment 'WcfRelayName'", id.WcfRelayName, "wcfRelayName") } } func TestFormatWcfRelayID(t *testing.T) { - actual := NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName" + actual := NewWcfRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseWcfRelayID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName", Expected: &WcfRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - WcfRelayName: "relayName", + WcfRelayName: "wcfRelayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseWcfRelayIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName", Expected: &WcfRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - WcfRelayName: "relayName", + WcfRelayName: "wcfRelayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE", Expected: &WcfRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - WcfRelayName: "rElAyNaMe", + WcfRelayName: "wCfReLaYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE/extra", Error: true, }, } diff --git a/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelayauthorizationrule.go b/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelayauthorizationrule.go index 3f16710da95..8085f677ab1 100644 --- a/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelayauthorizationrule.go +++ b/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelayauthorizationrule.go @@ -129,7 +129,7 @@ func (id WcfRelayAuthorizationRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticWcfRelays", "wcfRelays", "wcfRelays"), - resourceids.UserSpecifiedSegment("wcfRelayName", "relayName"), + resourceids.UserSpecifiedSegment("wcfRelayName", "wcfRelayName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelayauthorizationrule_test.go b/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelayauthorizationrule_test.go index ac8dc47655b..2ce3b398b5d 100644 --- a/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelayauthorizationrule_test.go +++ b/resource-manager/relay/2024-01-01/wcfrelays/id_wcfrelayauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WcfRelayAuthorizationRuleId{} func TestNewWcfRelayAuthorizationRuleID(t *testing.T) { - id := NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName") + id := NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewWcfRelayAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.WcfRelayName != "relayName" { - t.Fatalf("Expected %q but got %q for Segment 'WcfRelayName'", id.WcfRelayName, "relayName") + if id.WcfRelayName != "wcfRelayName" { + t.Fatalf("Expected %q but got %q for Segment 'WcfRelayName'", id.WcfRelayName, "wcfRelayName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewWcfRelayAuthorizationRuleID(t *testing.T) { } func TestFormatWcfRelayAuthorizationRuleID(t *testing.T) { - actual := NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "relayName", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName" + actual := NewWcfRelayAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "wcfRelayName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseWcfRelayAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName", Expected: &WcfRelayAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - WcfRelayName: "relayName", + WcfRelayName: "wcfRelayName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseWcfRelayAuthorizationRuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName", Expected: &WcfRelayAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - WcfRelayName: "relayName", + WcfRelayName: "wcfRelayName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/relayName/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Relay/namespaces/namespaceName/wcfRelays/wcfRelayName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &WcfRelayAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - WcfRelayName: "rElAyNaMe", + WcfRelayName: "wCfReLaYnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/rElAyNaMe/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rElAy/nAmEsPaCeS/nAmEsPaCeNaMe/wCfReLaYs/wCfReLaYnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/resourceconnector/2022-10-27/appliances/README.md b/resource-manager/resourceconnector/2022-10-27/appliances/README.md index 4e8756491ac..8fd8dac1aa1 100644 --- a/resource-manager/resourceconnector/2022-10-27/appliances/README.md +++ b/resource-manager/resourceconnector/2022-10-27/appliances/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName") payload := appliances.Appliance{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appliances.NewUpgradeGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "upgradeGraph") +id := appliances.NewUpgradeGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName", "upgradeGraphName") read, err := client.GetUpgradeGraph(ctx, id) if err != nil { @@ -136,7 +136,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName") read, err := client.ListClusterUserCredential(ctx, id) if err != nil { @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName") read, err := client.ListKeys(ctx, id, appliances.DefaultListKeysOperationOptions()) if err != nil { @@ -168,7 +168,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName") payload := appliances.PatchableAppliance{ // ... diff --git a/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance.go b/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance.go index 3a0142f6232..462a1c5593b 100644 --- a/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance.go +++ b/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance.go @@ -115,7 +115,7 @@ func (id ApplianceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResourceConnector", "Microsoft.ResourceConnector", "Microsoft.ResourceConnector"), resourceids.StaticSegment("staticAppliances", "appliances", "appliances"), - resourceids.UserSpecifiedSegment("applianceName", "resourceName"), + resourceids.UserSpecifiedSegment("applianceName", "applianceName"), } } diff --git a/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance_test.go b/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance_test.go index b24dda85973..fe598244deb 100644 --- a/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance_test.go +++ b/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplianceId{} func TestNewApplianceID(t *testing.T) { - id := NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewApplianceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ApplianceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplianceName'", id.ApplianceName, "resourceName") + if id.ApplianceName != "applianceName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplianceName'", id.ApplianceName, "applianceName") } } func TestFormatApplianceID(t *testing.T) { - actual := NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName" + actual := NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseApplianceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName", Expected: &ApplianceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplianceName: "resourceName", + ApplianceName: "applianceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseApplianceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName", Expected: &ApplianceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplianceName: "resourceName", + ApplianceName: "applianceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/aPpLiAnCeNaMe", Expected: &ApplianceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplianceName: "rEsOuRcEnAmE", + ApplianceName: "aPpLiAnCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/aPpLiAnCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph.go b/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph.go index cc44563bfb2..37d36f5df32 100644 --- a/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph.go +++ b/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph.go @@ -121,9 +121,9 @@ func (id UpgradeGraphId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResourceConnector", "Microsoft.ResourceConnector", "Microsoft.ResourceConnector"), resourceids.StaticSegment("staticAppliances", "appliances", "appliances"), - resourceids.UserSpecifiedSegment("applianceName", "resourceName"), + resourceids.UserSpecifiedSegment("applianceName", "applianceName"), resourceids.StaticSegment("staticUpgradeGraphs", "upgradeGraphs", "upgradeGraphs"), - resourceids.UserSpecifiedSegment("upgradeGraphName", "upgradeGraph"), + resourceids.UserSpecifiedSegment("upgradeGraphName", "upgradeGraphName"), } } diff --git a/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph_test.go b/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph_test.go index f9924e31361..17cdb900bfc 100644 --- a/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph_test.go +++ b/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UpgradeGraphId{} func TestNewUpgradeGraphID(t *testing.T) { - id := NewUpgradeGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "upgradeGraph") + id := NewUpgradeGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName", "upgradeGraphName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUpgradeGraphID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ApplianceName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'ApplianceName'", id.ApplianceName, "resourceName") + if id.ApplianceName != "applianceName" { + t.Fatalf("Expected %q but got %q for Segment 'ApplianceName'", id.ApplianceName, "applianceName") } - if id.UpgradeGraphName != "upgradeGraph" { - t.Fatalf("Expected %q but got %q for Segment 'UpgradeGraphName'", id.UpgradeGraphName, "upgradeGraph") + if id.UpgradeGraphName != "upgradeGraphName" { + t.Fatalf("Expected %q but got %q for Segment 'UpgradeGraphName'", id.UpgradeGraphName, "upgradeGraphName") } } func TestFormatUpgradeGraphID(t *testing.T) { - actual := NewUpgradeGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "upgradeGraph").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/upgradeGraphs/upgradeGraph" + actual := NewUpgradeGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceName", "upgradeGraphName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/upgradeGraphs/upgradeGraphName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUpgradeGraphID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/upgradeGraphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/upgradeGraphs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/upgradeGraphs/upgradeGraph", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/upgradeGraphs/upgradeGraphName", Expected: &UpgradeGraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplianceName: "resourceName", - UpgradeGraphName: "upgradeGraph", + ApplianceName: "applianceName", + UpgradeGraphName: "upgradeGraphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/upgradeGraphs/upgradeGraph/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/upgradeGraphs/upgradeGraphName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUpgradeGraphIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/aPpLiAnCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/upgradeGraphs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/upgradeGraphs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/rEsOuRcEnAmE/uPgRaDeGrApHs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/aPpLiAnCeNaMe/uPgRaDeGrApHs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/upgradeGraphs/upgradeGraph", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/upgradeGraphs/upgradeGraphName", Expected: &UpgradeGraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ApplianceName: "resourceName", - UpgradeGraphName: "upgradeGraph", + ApplianceName: "applianceName", + UpgradeGraphName: "upgradeGraphName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/resourceName/upgradeGraphs/upgradeGraph/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceConnector/appliances/applianceName/upgradeGraphs/upgradeGraphName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/rEsOuRcEnAmE/uPgRaDeGrApHs/uPgRaDeGrApH", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/aPpLiAnCeNaMe/uPgRaDeGrApHs/uPgRaDeGrApHnAmE", Expected: &UpgradeGraphId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplianceName: "rEsOuRcEnAmE", - UpgradeGraphName: "uPgRaDeGrApH", + ApplianceName: "aPpLiAnCeNaMe", + UpgradeGraphName: "uPgRaDeGrApHnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/rEsOuRcEnAmE/uPgRaDeGrApHs/uPgRaDeGrApH/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEcOnNeCtOr/aPpLiAnCeS/aPpLiAnCeNaMe/uPgRaDeGrApHs/uPgRaDeGrApHnAmE/extra", Error: true, }, } diff --git a/resource-manager/resourcegraph/2022-10-01/graphqueries/README.md b/resource-manager/resourcegraph/2022-10-01/graphqueries/README.md index 2675168622b..2829d47eb22 100644 --- a/resource-manager/resourcegraph/2022-10-01/graphqueries/README.md +++ b/resource-manager/resourcegraph/2022-10-01/graphqueries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") payload := graphqueries.GraphQueryUpdateParameters{ // ... diff --git a/resource-manager/resourcegraph/2022-10-01/graphqueries/id_query.go b/resource-manager/resourcegraph/2022-10-01/graphqueries/id_query.go index 6e5b119535c..6d840651766 100644 --- a/resource-manager/resourcegraph/2022-10-01/graphqueries/id_query.go +++ b/resource-manager/resourcegraph/2022-10-01/graphqueries/id_query.go @@ -115,7 +115,7 @@ func (id QueryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResourceGraph", "Microsoft.ResourceGraph", "Microsoft.ResourceGraph"), resourceids.StaticSegment("staticQueries", "queries", "queries"), - resourceids.UserSpecifiedSegment("queryName", "resourceName"), + resourceids.UserSpecifiedSegment("queryName", "queryName"), } } diff --git a/resource-manager/resourcegraph/2022-10-01/graphqueries/id_query_test.go b/resource-manager/resourcegraph/2022-10-01/graphqueries/id_query_test.go index b27163aaba4..c2d9e3023b9 100644 --- a/resource-manager/resourcegraph/2022-10-01/graphqueries/id_query_test.go +++ b/resource-manager/resourcegraph/2022-10-01/graphqueries/id_query_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &QueryId{} func TestNewQueryID(t *testing.T) { - id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewQueryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.QueryName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "resourceName") + if id.QueryName != "queryName" { + t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "queryName") } } func TestFormatQueryID(t *testing.T) { - actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName" + actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseQueryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - QueryName: "resourceName", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseQueryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - QueryName: "resourceName", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/qUeRyNaMe", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - QueryName: "rEsOuRcEnAmE", + QueryName: "qUeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/qUeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/resourcegraph/2022-10-01/graphquery/README.md b/resource-manager/resourcegraph/2022-10-01/graphquery/README.md index efa9882ef15..c7808865f1a 100644 --- a/resource-manager/resourcegraph/2022-10-01/graphquery/README.md +++ b/resource-manager/resourcegraph/2022-10-01/graphquery/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") payload := graphquery.GraphQueryResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/resourcegraph/2022-10-01/graphquery/id_query.go b/resource-manager/resourcegraph/2022-10-01/graphquery/id_query.go index 449b3da58e1..d137cc34f81 100644 --- a/resource-manager/resourcegraph/2022-10-01/graphquery/id_query.go +++ b/resource-manager/resourcegraph/2022-10-01/graphquery/id_query.go @@ -115,7 +115,7 @@ func (id QueryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResourceGraph", "Microsoft.ResourceGraph", "Microsoft.ResourceGraph"), resourceids.StaticSegment("staticQueries", "queries", "queries"), - resourceids.UserSpecifiedSegment("queryName", "resourceName"), + resourceids.UserSpecifiedSegment("queryName", "queryName"), } } diff --git a/resource-manager/resourcegraph/2022-10-01/graphquery/id_query_test.go b/resource-manager/resourcegraph/2022-10-01/graphquery/id_query_test.go index d3ad7faeda2..2b719949d61 100644 --- a/resource-manager/resourcegraph/2022-10-01/graphquery/id_query_test.go +++ b/resource-manager/resourcegraph/2022-10-01/graphquery/id_query_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &QueryId{} func TestNewQueryID(t *testing.T) { - id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewQueryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.QueryName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "resourceName") + if id.QueryName != "queryName" { + t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "queryName") } } func TestFormatQueryID(t *testing.T) { - actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName" + actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseQueryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - QueryName: "resourceName", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseQueryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - QueryName: "resourceName", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/qUeRyNaMe", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - QueryName: "rEsOuRcEnAmE", + QueryName: "qUeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/qUeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/resourcegraph/2024-04-01/graphqueries/README.md b/resource-manager/resourcegraph/2024-04-01/graphqueries/README.md index 596c8963d2a..aec8a2ad940 100644 --- a/resource-manager/resourcegraph/2024-04-01/graphqueries/README.md +++ b/resource-manager/resourcegraph/2024-04-01/graphqueries/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphqueries.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") payload := graphqueries.GraphQueryUpdateParameters{ // ... diff --git a/resource-manager/resourcegraph/2024-04-01/graphqueries/id_query.go b/resource-manager/resourcegraph/2024-04-01/graphqueries/id_query.go index 6e5b119535c..6d840651766 100644 --- a/resource-manager/resourcegraph/2024-04-01/graphqueries/id_query.go +++ b/resource-manager/resourcegraph/2024-04-01/graphqueries/id_query.go @@ -115,7 +115,7 @@ func (id QueryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResourceGraph", "Microsoft.ResourceGraph", "Microsoft.ResourceGraph"), resourceids.StaticSegment("staticQueries", "queries", "queries"), - resourceids.UserSpecifiedSegment("queryName", "resourceName"), + resourceids.UserSpecifiedSegment("queryName", "queryName"), } } diff --git a/resource-manager/resourcegraph/2024-04-01/graphqueries/id_query_test.go b/resource-manager/resourcegraph/2024-04-01/graphqueries/id_query_test.go index b27163aaba4..c2d9e3023b9 100644 --- a/resource-manager/resourcegraph/2024-04-01/graphqueries/id_query_test.go +++ b/resource-manager/resourcegraph/2024-04-01/graphqueries/id_query_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &QueryId{} func TestNewQueryID(t *testing.T) { - id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewQueryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.QueryName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "resourceName") + if id.QueryName != "queryName" { + t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "queryName") } } func TestFormatQueryID(t *testing.T) { - actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName" + actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseQueryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - QueryName: "resourceName", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseQueryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - QueryName: "resourceName", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/qUeRyNaMe", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - QueryName: "rEsOuRcEnAmE", + QueryName: "qUeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/qUeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/resourcegraph/2024-04-01/graphquery/README.md b/resource-manager/resourcegraph/2024-04-01/graphquery/README.md index dba601a0cec..75d622f6521 100644 --- a/resource-manager/resourcegraph/2024-04-01/graphquery/README.md +++ b/resource-manager/resourcegraph/2024-04-01/graphquery/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") payload := graphquery.GraphQueryResource{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := graphquery.NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/resourcegraph/2024-04-01/graphquery/id_query.go b/resource-manager/resourcegraph/2024-04-01/graphquery/id_query.go index 449b3da58e1..d137cc34f81 100644 --- a/resource-manager/resourcegraph/2024-04-01/graphquery/id_query.go +++ b/resource-manager/resourcegraph/2024-04-01/graphquery/id_query.go @@ -115,7 +115,7 @@ func (id QueryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResourceGraph", "Microsoft.ResourceGraph", "Microsoft.ResourceGraph"), resourceids.StaticSegment("staticQueries", "queries", "queries"), - resourceids.UserSpecifiedSegment("queryName", "resourceName"), + resourceids.UserSpecifiedSegment("queryName", "queryName"), } } diff --git a/resource-manager/resourcegraph/2024-04-01/graphquery/id_query_test.go b/resource-manager/resourcegraph/2024-04-01/graphquery/id_query_test.go index d3ad7faeda2..2b719949d61 100644 --- a/resource-manager/resourcegraph/2024-04-01/graphquery/id_query_test.go +++ b/resource-manager/resourcegraph/2024-04-01/graphquery/id_query_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &QueryId{} func TestNewQueryID(t *testing.T) { - id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewQueryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.QueryName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "resourceName") + if id.QueryName != "queryName" { + t.Fatalf("Expected %q but got %q for Segment 'QueryName'", id.QueryName, "queryName") } } func TestFormatQueryID(t *testing.T) { - actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName" + actual := NewQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "queryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseQueryID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - QueryName: "resourceName", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseQueryIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - QueryName: "resourceName", + QueryName: "queryName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ResourceGraph/queries/queryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/qUeRyNaMe", Expected: &QueryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - QueryName: "rEsOuRcEnAmE", + QueryName: "qUeRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEgRaPh/qUeRiEs/qUeRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2015-11-01/policydefinitions/README.md b/resource-manager/resources/2015-11-01/policydefinitions/README.md index 611902e9d35..c61febcb9b0 100644 --- a/resource-manager/resources/2015-11-01/policydefinitions/README.md +++ b/resource-manager/resources/2015-11-01/policydefinitions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := policydefinitions.NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policyDefinitionName") +id := policydefinitions.NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policydefinitionName") payload := policydefinitions.PolicyDefinition{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policydefinitions.NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policyDefinitionName") +id := policydefinitions.NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policydefinitionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := policydefinitions.NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policyDefinitionName") +id := policydefinitions.NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policydefinitionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/resources/2015-11-01/policydefinitions/id_policydefinition.go b/resource-manager/resources/2015-11-01/policydefinitions/id_policydefinition.go index 7d77dc8128f..1c7c30d5428 100644 --- a/resource-manager/resources/2015-11-01/policydefinitions/id_policydefinition.go +++ b/resource-manager/resources/2015-11-01/policydefinitions/id_policydefinition.go @@ -107,7 +107,7 @@ func (id PolicydefinitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAuthorization", "Microsoft.Authorization", "Microsoft.Authorization"), resourceids.StaticSegment("staticPolicydefinitions", "policydefinitions", "policydefinitions"), - resourceids.UserSpecifiedSegment("policydefinitionName", "policyDefinitionName"), + resourceids.UserSpecifiedSegment("policydefinitionName", "policydefinitionName"), } } diff --git a/resource-manager/resources/2015-11-01/policydefinitions/id_policydefinition_test.go b/resource-manager/resources/2015-11-01/policydefinitions/id_policydefinition_test.go index 447d9455beb..1415159e82d 100644 --- a/resource-manager/resources/2015-11-01/policydefinitions/id_policydefinition_test.go +++ b/resource-manager/resources/2015-11-01/policydefinitions/id_policydefinition_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &PolicydefinitionId{} func TestNewPolicydefinitionID(t *testing.T) { - id := NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policyDefinitionName") + id := NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policydefinitionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.PolicydefinitionName != "policyDefinitionName" { - t.Fatalf("Expected %q but got %q for Segment 'PolicydefinitionName'", id.PolicydefinitionName, "policyDefinitionName") + if id.PolicydefinitionName != "policydefinitionName" { + t.Fatalf("Expected %q but got %q for Segment 'PolicydefinitionName'", id.PolicydefinitionName, "policydefinitionName") } } func TestFormatPolicydefinitionID(t *testing.T) { - actual := NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policyDefinitionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policyDefinitionName" + actual := NewPolicydefinitionID("12345678-1234-9876-4563-123456789012", "policydefinitionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policydefinitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParsePolicydefinitionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policyDefinitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policydefinitionName", Expected: &PolicydefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PolicydefinitionName: "policyDefinitionName", + PolicydefinitionName: "policydefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policyDefinitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policydefinitionName/extra", Error: true, }, } @@ -170,15 +170,15 @@ func TestParsePolicydefinitionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policyDefinitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policydefinitionName", Expected: &PolicydefinitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - PolicydefinitionName: "policyDefinitionName", + PolicydefinitionName: "policydefinitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policyDefinitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Authorization/policydefinitions/policydefinitionName/extra", Error: true, }, { diff --git a/resource-manager/resources/2015-11-01/providers/README.md b/resource-manager/resources/2015-11-01/providers/README.md index 7fe78e20b69..ff9f2725ede 100644 --- a/resource-manager/resources/2015-11-01/providers/README.md +++ b/resource-manager/resources/2015-11-01/providers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := providers.NewProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Register(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/resources/2015-11-01/providers/id_provider.go b/resource-manager/resources/2015-11-01/providers/id_provider.go index eb06b44e67e..a1a43ca1c99 100644 --- a/resource-manager/resources/2015-11-01/providers/id_provider.go +++ b/resource-manager/resources/2015-11-01/providers/id_provider.go @@ -105,7 +105,7 @@ func (id ProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2015-11-01/providers/id_provider_test.go b/resource-manager/resources/2015-11-01/providers/id_provider_test.go index 3fbd32486aa..60237143a1e 100644 --- a/resource-manager/resources/2015-11-01/providers/id_provider_test.go +++ b/resource-manager/resources/2015-11-01/providers/id_provider_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderId{} func TestNewProviderID(t *testing.T) { - id := NewProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") + id := NewProviderID("12345678-1234-9876-4563-123456789012", "providerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviderID(t *testing.T) { - actual := NewProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace" + actual := NewProviderID("12345678-1234-9876-4563-123456789012", "providerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &ProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &ProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE", Expected: &ProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2015-11-01/tags/README.md b/resource-manager/resources/2015-11-01/tags/README.md index 23ef391a91b..0b8bb0b657f 100644 --- a/resource-manager/resources/2015-11-01/tags/README.md +++ b/resource-manager/resources/2015-11-01/tags/README.md @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.CreateOrUpdateValue(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.DeleteValue(ctx, id) if err != nil { diff --git a/resource-manager/resources/2015-11-01/tags/id_tagvalue.go b/resource-manager/resources/2015-11-01/tags/id_tagvalue.go index da625991a86..3771f3e7f9a 100644 --- a/resource-manager/resources/2015-11-01/tags/id_tagvalue.go +++ b/resource-manager/resources/2015-11-01/tags/id_tagvalue.go @@ -113,7 +113,7 @@ func (id TagValueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTagNames", "tagNames", "tagNames"), resourceids.UserSpecifiedSegment("tagName", "tagName"), resourceids.StaticSegment("staticTagValues", "tagValues", "tagValues"), - resourceids.UserSpecifiedSegment("tagValueName", "tagValue"), + resourceids.UserSpecifiedSegment("tagValueName", "tagValueName"), } } diff --git a/resource-manager/resources/2015-11-01/tags/id_tagvalue_test.go b/resource-manager/resources/2015-11-01/tags/id_tagvalue_test.go index 7bd0cf6abdc..a1243c411ae 100644 --- a/resource-manager/resources/2015-11-01/tags/id_tagvalue_test.go +++ b/resource-manager/resources/2015-11-01/tags/id_tagvalue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagValueId{} func TestNewTagValueID(t *testing.T) { - id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") + id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewTagValueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TagName'", id.TagName, "tagName") } - if id.TagValueName != "tagValue" { - t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValue") + if id.TagValueName != "tagValueName" { + t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValueName") } } func TestFormatTagValueID(t *testing.T) { - actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue" + actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,16 +73,16 @@ func TestParseTagValueID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, } @@ -179,30 +179,30 @@ func TestParseTagValueIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tAgNaMe", - TagValueName: "tAgVaLuE", + TagValueName: "tAgVaLuEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/README.md b/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/README.md index 035fefb81da..853507caae7 100644 --- a/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/README.md +++ b/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourcemanagementprivatelink.NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "rmplName") +id := resourcemanagementprivatelink.NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceManagementPrivateLinkName") read, err := client.Delete(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourcemanagementprivatelink.NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "rmplName") +id := resourcemanagementprivatelink.NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceManagementPrivateLinkName") read, err := client.Get(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourcemanagementprivatelink.NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "rmplName") +id := resourcemanagementprivatelink.NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceManagementPrivateLinkName") payload := resourcemanagementprivatelink.ResourceManagementPrivateLinkLocation{ // ... diff --git a/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/id_resourcemanagementprivatelink.go b/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/id_resourcemanagementprivatelink.go index 0d05f87ce56..64570c99dfc 100644 --- a/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/id_resourcemanagementprivatelink.go +++ b/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/id_resourcemanagementprivatelink.go @@ -115,7 +115,7 @@ func (id ResourceManagementPrivateLinkId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAuthorization", "Microsoft.Authorization", "Microsoft.Authorization"), resourceids.StaticSegment("staticResourceManagementPrivateLinks", "resourceManagementPrivateLinks", "resourceManagementPrivateLinks"), - resourceids.UserSpecifiedSegment("resourceManagementPrivateLinkName", "rmplName"), + resourceids.UserSpecifiedSegment("resourceManagementPrivateLinkName", "resourceManagementPrivateLinkName"), } } diff --git a/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/id_resourcemanagementprivatelink_test.go b/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/id_resourcemanagementprivatelink_test.go index 42447208769..9a6e1740bd2 100644 --- a/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/id_resourcemanagementprivatelink_test.go +++ b/resource-manager/resources/2020-05-01/resourcemanagementprivatelink/id_resourcemanagementprivatelink_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ResourceManagementPrivateLinkId{} func TestNewResourceManagementPrivateLinkID(t *testing.T) { - id := NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "rmplName") + id := NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceManagementPrivateLinkName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewResourceManagementPrivateLinkID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ResourceManagementPrivateLinkName != "rmplName" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceManagementPrivateLinkName'", id.ResourceManagementPrivateLinkName, "rmplName") + if id.ResourceManagementPrivateLinkName != "resourceManagementPrivateLinkName" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceManagementPrivateLinkName'", id.ResourceManagementPrivateLinkName, "resourceManagementPrivateLinkName") } } func TestFormatResourceManagementPrivateLinkID(t *testing.T) { - actual := NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "rmplName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/rmplName" + actual := NewResourceManagementPrivateLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceManagementPrivateLinkName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/resourceManagementPrivateLinkName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseResourceManagementPrivateLinkID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/rmplName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/resourceManagementPrivateLinkName", Expected: &ResourceManagementPrivateLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceManagementPrivateLinkName: "rmplName", + ResourceManagementPrivateLinkName: "resourceManagementPrivateLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/rmplName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/resourceManagementPrivateLinkName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseResourceManagementPrivateLinkIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/rmplName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/resourceManagementPrivateLinkName", Expected: &ResourceManagementPrivateLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ResourceManagementPrivateLinkName: "rmplName", + ResourceManagementPrivateLinkName: "resourceManagementPrivateLinkName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/rmplName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Authorization/resourceManagementPrivateLinks/resourceManagementPrivateLinkName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/rEsOuRcEmAnAgEmEnTpRiVaTeLiNkS/rMpLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/rEsOuRcEmAnAgEmEnTpRiVaTeLiNkS/rEsOuRcEmAnAgEmEnTpRiVaTeLiNkNaMe", Expected: &ResourceManagementPrivateLinkId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ResourceManagementPrivateLinkName: "rMpLnAmE", + ResourceManagementPrivateLinkName: "rEsOuRcEmAnAgEmEnTpRiVaTeLiNkNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/rEsOuRcEmAnAgEmEnTpRiVaTeLiNkS/rMpLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aUtHoRiZaTiOn/rEsOuRcEmAnAgEmEnTpRiVaTeLiNkS/rEsOuRcEmAnAgEmEnTpRiVaTeLiNkNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2020-10-01/deploymentscripts/README.md b/resource-manager/resources/2020-10-01/deploymentscripts/README.md index 72d551ebc44..ec7ffaa00d4 100644 --- a/resource-manager/resources/2020-10-01/deploymentscripts/README.md +++ b/resource-manager/resources/2020-10-01/deploymentscripts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") payload := deploymentscripts.DeploymentScript{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") read, err := client.Delete(ctx, id) if err != nil { @@ -58,7 +58,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") read, err := client.GetLogs(ctx, id) if err != nil { @@ -90,7 +90,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") read, err := client.GetLogsDefault(ctx, id, deploymentscripts.DefaultGetLogsDefaultOperationOptions()) if err != nil { @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") payload := deploymentscripts.DeploymentScriptUpdateParameter{ // ... diff --git a/resource-manager/resources/2020-10-01/deploymentscripts/id_deploymentscript.go b/resource-manager/resources/2020-10-01/deploymentscripts/id_deploymentscript.go index 995e0ffbd55..396389f8ae8 100644 --- a/resource-manager/resources/2020-10-01/deploymentscripts/id_deploymentscript.go +++ b/resource-manager/resources/2020-10-01/deploymentscripts/id_deploymentscript.go @@ -115,7 +115,7 @@ func (id DeploymentScriptId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResources", "Microsoft.Resources", "Microsoft.Resources"), resourceids.StaticSegment("staticDeploymentScripts", "deploymentScripts", "deploymentScripts"), - resourceids.UserSpecifiedSegment("deploymentScriptName", "scriptName"), + resourceids.UserSpecifiedSegment("deploymentScriptName", "deploymentScriptName"), } } diff --git a/resource-manager/resources/2020-10-01/deploymentscripts/id_deploymentscript_test.go b/resource-manager/resources/2020-10-01/deploymentscripts/id_deploymentscript_test.go index 311733b27b4..9144b9364c0 100644 --- a/resource-manager/resources/2020-10-01/deploymentscripts/id_deploymentscript_test.go +++ b/resource-manager/resources/2020-10-01/deploymentscripts/id_deploymentscript_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeploymentScriptId{} func TestNewDeploymentScriptID(t *testing.T) { - id := NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") + id := NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDeploymentScriptID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DeploymentScriptName != "scriptName" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentScriptName'", id.DeploymentScriptName, "scriptName") + if id.DeploymentScriptName != "deploymentScriptName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentScriptName'", id.DeploymentScriptName, "deploymentScriptName") } } func TestFormatDeploymentScriptID(t *testing.T) { - actual := NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName" + actual := NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDeploymentScriptID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName", Expected: &DeploymentScriptId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DeploymentScriptName: "scriptName", + DeploymentScriptName: "deploymentScriptName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDeploymentScriptIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName", Expected: &DeploymentScriptId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DeploymentScriptName: "scriptName", + DeploymentScriptName: "deploymentScriptName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsCrIpTs/sCrIpTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsCrIpTs/dEpLoYmEnTsCrIpTnAmE", Expected: &DeploymentScriptId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DeploymentScriptName: "sCrIpTnAmE", + DeploymentScriptName: "dEpLoYmEnTsCrIpTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsCrIpTs/sCrIpTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsCrIpTs/dEpLoYmEnTsCrIpTnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2020-10-01/providers/README.md b/resource-manager/resources/2020-10-01/providers/README.md index 8e17c294004..a7a96fd47d0 100644 --- a/resource-manager/resources/2020-10-01/providers/README.md +++ b/resource-manager/resources/2020-10-01/providers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Get(ctx, id, providers.DefaultGetOperationOptions()) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviderID("resourceProviderNamespace") +id := providers.NewProviderID("providerName") read, err := client.GetAtTenantScope(ctx, id, providers.DefaultGetAtTenantScopeOperationOptions()) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderResourceTypesList(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions())` can be used to do batched pagination items, err := client.ProviderResourceTypesListComplete(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions()) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Register(ctx, id) if err != nil { @@ -124,7 +124,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviders2ID("groupId", "resourceProviderNamespace") +id := providers.NewProviders2ID("groupId", "providerName") read, err := client.RegisterAtManagementGroupScope(ctx, id) if err != nil { @@ -140,7 +140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/resources/2020-10-01/providers/id_provider.go b/resource-manager/resources/2020-10-01/providers/id_provider.go index 64201d1da62..71544793e1f 100644 --- a/resource-manager/resources/2020-10-01/providers/id_provider.go +++ b/resource-manager/resources/2020-10-01/providers/id_provider.go @@ -97,7 +97,7 @@ func (id ProviderId) ID() string { func (id ProviderId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2020-10-01/providers/id_provider_test.go b/resource-manager/resources/2020-10-01/providers/id_provider_test.go index 72f331a300e..262553688e3 100644 --- a/resource-manager/resources/2020-10-01/providers/id_provider_test.go +++ b/resource-manager/resources/2020-10-01/providers/id_provider_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ProviderId{} func TestNewProviderID(t *testing.T) { - id := NewProviderID("resourceProviderNamespace") + id := NewProviderID("providerName") - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviderID(t *testing.T) { - actual := NewProviderID("resourceProviderNamespace").ID() - expected := "/providers/resourceProviderNamespace" + actual := NewProviderID("providerName").ID() + expected := "/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -45,14 +45,14 @@ func TestParseProviderID(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, } @@ -101,26 +101,26 @@ func TestParseProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/pRoViDeRnAmE", Expected: &ProviderId{ - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2020-10-01/providers/id_providers2.go b/resource-manager/resources/2020-10-01/providers/id_providers2.go index 915907fb0ad..6236a5adf0c 100644 --- a/resource-manager/resources/2020-10-01/providers/id_providers2.go +++ b/resource-manager/resources/2020-10-01/providers/id_providers2.go @@ -107,7 +107,7 @@ func (id Providers2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticManagementGroups", "managementGroups", "managementGroups"), resourceids.UserSpecifiedSegment("groupId", "groupId"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2020-10-01/providers/id_providers2_test.go b/resource-manager/resources/2020-10-01/providers/id_providers2_test.go index fa2e45139ab..cc31c332e6e 100644 --- a/resource-manager/resources/2020-10-01/providers/id_providers2_test.go +++ b/resource-manager/resources/2020-10-01/providers/id_providers2_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &Providers2Id{} func TestNewProviders2ID(t *testing.T) { - id := NewProviders2ID("groupId", "resourceProviderNamespace") + id := NewProviders2ID("groupId", "providerName") if id.GroupId != "groupId" { t.Fatalf("Expected %q but got %q for Segment 'GroupId'", id.GroupId, "groupId") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviders2ID(t *testing.T) { - actual := NewProviders2ID("groupId", "resourceProviderNamespace").ID() - expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace" + actual := NewProviders2ID("groupId", "providerName").ID() + expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviders2ID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviders2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE", Expected: &Providers2Id{ GroupId: "gRoUpId", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2020-10-01/providers/id_subscriptionprovider.go b/resource-manager/resources/2020-10-01/providers/id_subscriptionprovider.go index 652370f9102..4ba6dbab693 100644 --- a/resource-manager/resources/2020-10-01/providers/id_subscriptionprovider.go +++ b/resource-manager/resources/2020-10-01/providers/id_subscriptionprovider.go @@ -105,7 +105,7 @@ func (id SubscriptionProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2020-10-01/providers/id_subscriptionprovider_test.go b/resource-manager/resources/2020-10-01/providers/id_subscriptionprovider_test.go index 162974a0173..a9ca5cba7d0 100644 --- a/resource-manager/resources/2020-10-01/providers/id_subscriptionprovider_test.go +++ b/resource-manager/resources/2020-10-01/providers/id_subscriptionprovider_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &SubscriptionProviderId{} func TestNewSubscriptionProviderID(t *testing.T) { - id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") + id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatSubscriptionProviderID(t *testing.T) { - actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace" + actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseSubscriptionProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseSubscriptionProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2020-10-01/tags/README.md b/resource-manager/resources/2020-10-01/tags/README.md index 86749de3e5a..5079c4c284e 100644 --- a/resource-manager/resources/2020-10-01/tags/README.md +++ b/resource-manager/resources/2020-10-01/tags/README.md @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.CreateOrUpdateValue(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.DeleteValue(ctx, id) if err != nil { diff --git a/resource-manager/resources/2020-10-01/tags/id_tagvalue.go b/resource-manager/resources/2020-10-01/tags/id_tagvalue.go index da625991a86..3771f3e7f9a 100644 --- a/resource-manager/resources/2020-10-01/tags/id_tagvalue.go +++ b/resource-manager/resources/2020-10-01/tags/id_tagvalue.go @@ -113,7 +113,7 @@ func (id TagValueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTagNames", "tagNames", "tagNames"), resourceids.UserSpecifiedSegment("tagName", "tagName"), resourceids.StaticSegment("staticTagValues", "tagValues", "tagValues"), - resourceids.UserSpecifiedSegment("tagValueName", "tagValue"), + resourceids.UserSpecifiedSegment("tagValueName", "tagValueName"), } } diff --git a/resource-manager/resources/2020-10-01/tags/id_tagvalue_test.go b/resource-manager/resources/2020-10-01/tags/id_tagvalue_test.go index 7bd0cf6abdc..a1243c411ae 100644 --- a/resource-manager/resources/2020-10-01/tags/id_tagvalue_test.go +++ b/resource-manager/resources/2020-10-01/tags/id_tagvalue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagValueId{} func TestNewTagValueID(t *testing.T) { - id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") + id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewTagValueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TagName'", id.TagName, "tagName") } - if id.TagValueName != "tagValue" { - t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValue") + if id.TagValueName != "tagValueName" { + t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValueName") } } func TestFormatTagValueID(t *testing.T) { - actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue" + actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,16 +73,16 @@ func TestParseTagValueID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, } @@ -179,30 +179,30 @@ func TestParseTagValueIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tAgNaMe", - TagValueName: "tAgVaLuE", + TagValueName: "tAgVaLuEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2021-07-01/features/README.md b/resource-manager/resources/2021-07-01/features/README.md index 395efd5e6bb..2298c9902ff 100644 --- a/resource-manager/resources/2021-07-01/features/README.md +++ b/resource-manager/resources/2021-07-01/features/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := features.NewFeatureID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace", "featureName") +id := features.NewFeatureID("12345678-1234-9876-4563-123456789012", "providerName", "featureName") read, err := client.Get(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := features.NewProviders2ID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := features.NewProviders2ID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -75,7 +75,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := features.NewFeatureID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace", "featureName") +id := features.NewFeatureID("12345678-1234-9876-4563-123456789012", "providerName", "featureName") read, err := client.Register(ctx, id) if err != nil { @@ -91,7 +91,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := features.NewFeatureID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace", "featureName") +id := features.NewFeatureID("12345678-1234-9876-4563-123456789012", "providerName", "featureName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/resources/2021-07-01/features/id_feature.go b/resource-manager/resources/2021-07-01/features/id_feature.go index 4a74bd6b53a..994ce5b6ee7 100644 --- a/resource-manager/resources/2021-07-01/features/id_feature.go +++ b/resource-manager/resources/2021-07-01/features/id_feature.go @@ -113,7 +113,7 @@ func (id FeatureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftFeatures", "Microsoft.Features", "Microsoft.Features"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), resourceids.StaticSegment("staticFeatures", "features", "features"), resourceids.UserSpecifiedSegment("featureName", "featureName"), } diff --git a/resource-manager/resources/2021-07-01/features/id_feature_test.go b/resource-manager/resources/2021-07-01/features/id_feature_test.go index b14c764710c..ba7e6b54ae6 100644 --- a/resource-manager/resources/2021-07-01/features/id_feature_test.go +++ b/resource-manager/resources/2021-07-01/features/id_feature_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &FeatureId{} func TestNewFeatureID(t *testing.T) { - id := NewFeatureID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace", "featureName") + id := NewFeatureID("12345678-1234-9876-4563-123456789012", "providerName", "featureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } if id.FeatureName != "featureName" { @@ -28,8 +28,8 @@ func TestNewFeatureID(t *testing.T) { } func TestFormatFeatureID(t *testing.T) { - actual := NewFeatureID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace", "featureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/features/featureName" + actual := NewFeatureID("12345678-1234-9876-4563-123456789012", "providerName", "featureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/features/featureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseFeatureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/features", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/features", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/features/featureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/features/featureName", Expected: &FeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", FeatureName: "featureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/features/featureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/features/featureName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/pRoViDeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/features", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/features", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/fEaTuReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/pRoViDeRnAmE/fEaTuReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/features/featureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/features/featureName", Expected: &FeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", FeatureName: "featureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/features/featureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/features/featureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/fEaTuReS/fEaTuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/pRoViDeRnAmE/fEaTuReS/fEaTuReNaMe", Expected: &FeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", FeatureName: "fEaTuReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/fEaTuReS/fEaTuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/pRoViDeRnAmE/fEaTuReS/fEaTuReNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2021-07-01/features/id_providers2.go b/resource-manager/resources/2021-07-01/features/id_providers2.go index da0daa70b01..8776976d8cb 100644 --- a/resource-manager/resources/2021-07-01/features/id_providers2.go +++ b/resource-manager/resources/2021-07-01/features/id_providers2.go @@ -107,7 +107,7 @@ func (id Providers2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftFeatures", "Microsoft.Features", "Microsoft.Features"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2021-07-01/features/id_providers2_test.go b/resource-manager/resources/2021-07-01/features/id_providers2_test.go index 6e78497fe6d..3c20fba3e9b 100644 --- a/resource-manager/resources/2021-07-01/features/id_providers2_test.go +++ b/resource-manager/resources/2021-07-01/features/id_providers2_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &Providers2Id{} func TestNewProviders2ID(t *testing.T) { - id := NewProviders2ID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") + id := NewProviders2ID("12345678-1234-9876-4563-123456789012", "providerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviders2ID(t *testing.T) { - actual := NewProviders2ID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace" + actual := NewProviders2ID("12345678-1234-9876-4563-123456789012", "providerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviders2ID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName", Expected: &Providers2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviders2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName", Expected: &Providers2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/pRoViDeRnAmE", Expected: &Providers2Id{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/README.md b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/README.md index b75de1bc7e4..7cc1a721fa4 100644 --- a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/README.md +++ b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subscriptionfeatureregistrations.NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "providerNamespace", "featureName") +id := subscriptionfeatureregistrations.NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "featureProviderName", "subscriptionFeatureRegistrationName") payload := subscriptionfeatureregistrations.SubscriptionFeatureRegistration{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscriptionfeatureregistrations.NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "providerNamespace", "featureName") +id := subscriptionfeatureregistrations.NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "featureProviderName", "subscriptionFeatureRegistrationName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscriptionfeatureregistrations.NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "providerNamespace", "featureName") +id := subscriptionfeatureregistrations.NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "featureProviderName", "subscriptionFeatureRegistrationName") read, err := client.Get(ctx, id) if err != nil { @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := subscriptionfeatureregistrations.NewFeatureProviderID("12345678-1234-9876-4563-123456789012", "providerNamespace") +id := subscriptionfeatureregistrations.NewFeatureProviderID("12345678-1234-9876-4563-123456789012", "featureProviderName") // alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination items, err := client.ListBySubscriptionComplete(ctx, id) diff --git a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_featureprovider.go b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_featureprovider.go index 472beee2946..85d1e0cc81c 100644 --- a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_featureprovider.go +++ b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_featureprovider.go @@ -107,7 +107,7 @@ func (id FeatureProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftFeatures", "Microsoft.Features", "Microsoft.Features"), resourceids.StaticSegment("staticFeatureProviders", "featureProviders", "featureProviders"), - resourceids.UserSpecifiedSegment("featureProviderName", "providerNamespace"), + resourceids.UserSpecifiedSegment("featureProviderName", "featureProviderName"), } } diff --git a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_featureprovider_test.go b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_featureprovider_test.go index ee7fd0b66c1..e7b1f94a0ea 100644 --- a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_featureprovider_test.go +++ b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_featureprovider_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &FeatureProviderId{} func TestNewFeatureProviderID(t *testing.T) { - id := NewFeatureProviderID("12345678-1234-9876-4563-123456789012", "providerNamespace") + id := NewFeatureProviderID("12345678-1234-9876-4563-123456789012", "featureProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.FeatureProviderName != "providerNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureProviderName'", id.FeatureProviderName, "providerNamespace") + if id.FeatureProviderName != "featureProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureProviderName'", id.FeatureProviderName, "featureProviderName") } } func TestFormatFeatureProviderID(t *testing.T) { - actual := NewFeatureProviderID("12345678-1234-9876-4563-123456789012", "providerNamespace").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace" + actual := NewFeatureProviderID("12345678-1234-9876-4563-123456789012", "featureProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseFeatureProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName", Expected: &FeatureProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - FeatureProviderName: "providerNamespace", + FeatureProviderName: "featureProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseFeatureProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName", Expected: &FeatureProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - FeatureProviderName: "providerNamespace", + FeatureProviderName: "featureProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/pRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/fEaTuRePrOvIdErNaMe", Expected: &FeatureProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - FeatureProviderName: "pRoViDeRnAmEsPaCe", + FeatureProviderName: "fEaTuRePrOvIdErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/pRoViDeRnAmEsPaCe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/fEaTuRePrOvIdErNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_subscriptionfeatureregistration.go b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_subscriptionfeatureregistration.go index 22f95653921..7c07e83b91d 100644 --- a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_subscriptionfeatureregistration.go +++ b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_subscriptionfeatureregistration.go @@ -113,9 +113,9 @@ func (id SubscriptionFeatureRegistrationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftFeatures", "Microsoft.Features", "Microsoft.Features"), resourceids.StaticSegment("staticFeatureProviders", "featureProviders", "featureProviders"), - resourceids.UserSpecifiedSegment("featureProviderName", "providerNamespace"), + resourceids.UserSpecifiedSegment("featureProviderName", "featureProviderName"), resourceids.StaticSegment("staticSubscriptionFeatureRegistrations", "subscriptionFeatureRegistrations", "subscriptionFeatureRegistrations"), - resourceids.UserSpecifiedSegment("subscriptionFeatureRegistrationName", "featureName"), + resourceids.UserSpecifiedSegment("subscriptionFeatureRegistrationName", "subscriptionFeatureRegistrationName"), } } diff --git a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_subscriptionfeatureregistration_test.go b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_subscriptionfeatureregistration_test.go index 4a5fe206650..b6f1fbc447d 100644 --- a/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_subscriptionfeatureregistration_test.go +++ b/resource-manager/resources/2021-07-01/subscriptionfeatureregistrations/id_subscriptionfeatureregistration_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &SubscriptionFeatureRegistrationId{} func TestNewSubscriptionFeatureRegistrationID(t *testing.T) { - id := NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "providerNamespace", "featureName") + id := NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "featureProviderName", "subscriptionFeatureRegistrationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.FeatureProviderName != "providerNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'FeatureProviderName'", id.FeatureProviderName, "providerNamespace") + if id.FeatureProviderName != "featureProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'FeatureProviderName'", id.FeatureProviderName, "featureProviderName") } - if id.SubscriptionFeatureRegistrationName != "featureName" { - t.Fatalf("Expected %q but got %q for Segment 'SubscriptionFeatureRegistrationName'", id.SubscriptionFeatureRegistrationName, "featureName") + if id.SubscriptionFeatureRegistrationName != "subscriptionFeatureRegistrationName" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionFeatureRegistrationName'", id.SubscriptionFeatureRegistrationName, "subscriptionFeatureRegistrationName") } } func TestFormatSubscriptionFeatureRegistrationID(t *testing.T) { - actual := NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "providerNamespace", "featureName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/subscriptionFeatureRegistrations/featureName" + actual := NewSubscriptionFeatureRegistrationID("12345678-1234-9876-4563-123456789012", "featureProviderName", "subscriptionFeatureRegistrationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/subscriptionFeatureRegistrations/subscriptionFeatureRegistrationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseSubscriptionFeatureRegistrationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/subscriptionFeatureRegistrations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/subscriptionFeatureRegistrations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/subscriptionFeatureRegistrations/featureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/subscriptionFeatureRegistrations/subscriptionFeatureRegistrationName", Expected: &SubscriptionFeatureRegistrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - FeatureProviderName: "providerNamespace", - SubscriptionFeatureRegistrationName: "featureName", + FeatureProviderName: "featureProviderName", + SubscriptionFeatureRegistrationName: "subscriptionFeatureRegistrationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/subscriptionFeatureRegistrations/featureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/subscriptionFeatureRegistrations/subscriptionFeatureRegistrationName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseSubscriptionFeatureRegistrationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/pRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/fEaTuRePrOvIdErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/subscriptionFeatureRegistrations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/subscriptionFeatureRegistrations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/pRoViDeRnAmEsPaCe/sUbScRiPtIoNfEaTuReReGiStRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/fEaTuRePrOvIdErNaMe/sUbScRiPtIoNfEaTuReReGiStRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/subscriptionFeatureRegistrations/featureName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/subscriptionFeatureRegistrations/subscriptionFeatureRegistrationName", Expected: &SubscriptionFeatureRegistrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - FeatureProviderName: "providerNamespace", - SubscriptionFeatureRegistrationName: "featureName", + FeatureProviderName: "featureProviderName", + SubscriptionFeatureRegistrationName: "subscriptionFeatureRegistrationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/providerNamespace/subscriptionFeatureRegistrations/featureName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Features/featureProviders/featureProviderName/subscriptionFeatureRegistrations/subscriptionFeatureRegistrationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/pRoViDeRnAmEsPaCe/sUbScRiPtIoNfEaTuReReGiStRaTiOnS/fEaTuReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/fEaTuRePrOvIdErNaMe/sUbScRiPtIoNfEaTuReReGiStRaTiOnS/sUbScRiPtIoNfEaTuReReGiStRaTiOnNaMe", Expected: &SubscriptionFeatureRegistrationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - FeatureProviderName: "pRoViDeRnAmEsPaCe", - SubscriptionFeatureRegistrationName: "fEaTuReNaMe", + FeatureProviderName: "fEaTuRePrOvIdErNaMe", + SubscriptionFeatureRegistrationName: "sUbScRiPtIoNfEaTuReReGiStRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/pRoViDeRnAmEsPaCe/sUbScRiPtIoNfEaTuReReGiStRaTiOnS/fEaTuReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.fEaTuReS/fEaTuRePrOvIdErS/fEaTuRePrOvIdErNaMe/sUbScRiPtIoNfEaTuReReGiStRaTiOnS/sUbScRiPtIoNfEaTuReReGiStRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-02-01/templatespecs/README.md b/resource-manager/resources/2022-02-01/templatespecs/README.md index 73dac765afe..09c0589e27c 100644 --- a/resource-manager/resources/2022-02-01/templatespecs/README.md +++ b/resource-manager/resources/2022-02-01/templatespecs/README.md @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := templatespecs.NewBuiltInTemplateSpecID("templateSpecName") +id := templatespecs.NewBuiltInTemplateSpecID("builtInTemplateSpecName") read, err := client.GetBuiltIn(ctx, id, templatespecs.DefaultGetBuiltInOperationOptions()) if err != nil { diff --git a/resource-manager/resources/2022-02-01/templatespecs/id_builtintemplatespec.go b/resource-manager/resources/2022-02-01/templatespecs/id_builtintemplatespec.go index 35473a033cd..3f33a0b9f2e 100644 --- a/resource-manager/resources/2022-02-01/templatespecs/id_builtintemplatespec.go +++ b/resource-manager/resources/2022-02-01/templatespecs/id_builtintemplatespec.go @@ -99,7 +99,7 @@ func (id BuiltInTemplateSpecId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResources", "Microsoft.Resources", "Microsoft.Resources"), resourceids.StaticSegment("staticBuiltInTemplateSpecs", "builtInTemplateSpecs", "builtInTemplateSpecs"), - resourceids.UserSpecifiedSegment("builtInTemplateSpecName", "templateSpecName"), + resourceids.UserSpecifiedSegment("builtInTemplateSpecName", "builtInTemplateSpecName"), } } diff --git a/resource-manager/resources/2022-02-01/templatespecs/id_builtintemplatespec_test.go b/resource-manager/resources/2022-02-01/templatespecs/id_builtintemplatespec_test.go index 88d1e73d296..182aa756c47 100644 --- a/resource-manager/resources/2022-02-01/templatespecs/id_builtintemplatespec_test.go +++ b/resource-manager/resources/2022-02-01/templatespecs/id_builtintemplatespec_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &BuiltInTemplateSpecId{} func TestNewBuiltInTemplateSpecID(t *testing.T) { - id := NewBuiltInTemplateSpecID("templateSpecName") + id := NewBuiltInTemplateSpecID("builtInTemplateSpecName") - if id.BuiltInTemplateSpecName != "templateSpecName" { - t.Fatalf("Expected %q but got %q for Segment 'BuiltInTemplateSpecName'", id.BuiltInTemplateSpecName, "templateSpecName") + if id.BuiltInTemplateSpecName != "builtInTemplateSpecName" { + t.Fatalf("Expected %q but got %q for Segment 'BuiltInTemplateSpecName'", id.BuiltInTemplateSpecName, "builtInTemplateSpecName") } } func TestFormatBuiltInTemplateSpecID(t *testing.T) { - actual := NewBuiltInTemplateSpecID("templateSpecName").ID() - expected := "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName" + actual := NewBuiltInTemplateSpecID("builtInTemplateSpecName").ID() + expected := "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseBuiltInTemplateSpecID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName", Expected: &BuiltInTemplateSpecId{ - BuiltInTemplateSpecName: "templateSpecName", + BuiltInTemplateSpecName: "builtInTemplateSpecName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/extra", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseBuiltInTemplateSpecIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName", Expected: &BuiltInTemplateSpecId{ - BuiltInTemplateSpecName: "templateSpecName", + BuiltInTemplateSpecName: "builtInTemplateSpecName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/extra", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/tEmPlAtEsPeCnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/bUiLtInTeMpLaTeSpEcNaMe", Expected: &BuiltInTemplateSpecId{ - BuiltInTemplateSpecName: "tEmPlAtEsPeCnAmE", + BuiltInTemplateSpecName: "bUiLtInTeMpLaTeSpEcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/tEmPlAtEsPeCnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/bUiLtInTeMpLaTeSpEcNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-02-01/templatespecversions/README.md b/resource-manager/resources/2022-02-01/templatespecversions/README.md index 3918b0ea936..3c7f185621a 100644 --- a/resource-manager/resources/2022-02-01/templatespecversions/README.md +++ b/resource-manager/resources/2022-02-01/templatespecversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := templatespecversions.NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "templateSpecVersion") +id := templatespecversions.NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "versionName") payload := templatespecversions.TemplateSpecVersion{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := templatespecversions.NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "templateSpecVersion") +id := templatespecversions.NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "versionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := templatespecversions.NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "templateSpecVersion") +id := templatespecversions.NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := templatespecversions.NewVersionID("templateSpecName", "templateSpecVersion") +id := templatespecversions.NewVersionID("builtInTemplateSpecName", "versionName") read, err := client.GetBuiltIn(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := templatespecversions.NewBuiltInTemplateSpecID("templateSpecName") +id := templatespecversions.NewBuiltInTemplateSpecID("builtInTemplateSpecName") // alternatively `client.ListBuiltIns(ctx, id)` can be used to do batched pagination items, err := client.ListBuiltInsComplete(ctx, id) @@ -127,7 +127,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := templatespecversions.NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "templateSpecVersion") +id := templatespecversions.NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "versionName") payload := templatespecversions.TemplateSpecVersionUpdateModel{ // ... diff --git a/resource-manager/resources/2022-02-01/templatespecversions/id_builtintemplatespec.go b/resource-manager/resources/2022-02-01/templatespecversions/id_builtintemplatespec.go index 1f6ce46691e..89d29802b58 100644 --- a/resource-manager/resources/2022-02-01/templatespecversions/id_builtintemplatespec.go +++ b/resource-manager/resources/2022-02-01/templatespecversions/id_builtintemplatespec.go @@ -99,7 +99,7 @@ func (id BuiltInTemplateSpecId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResources", "Microsoft.Resources", "Microsoft.Resources"), resourceids.StaticSegment("staticBuiltInTemplateSpecs", "builtInTemplateSpecs", "builtInTemplateSpecs"), - resourceids.UserSpecifiedSegment("builtInTemplateSpecName", "templateSpecName"), + resourceids.UserSpecifiedSegment("builtInTemplateSpecName", "builtInTemplateSpecName"), } } diff --git a/resource-manager/resources/2022-02-01/templatespecversions/id_builtintemplatespec_test.go b/resource-manager/resources/2022-02-01/templatespecversions/id_builtintemplatespec_test.go index 3dafbff17ef..b3f253b1af6 100644 --- a/resource-manager/resources/2022-02-01/templatespecversions/id_builtintemplatespec_test.go +++ b/resource-manager/resources/2022-02-01/templatespecversions/id_builtintemplatespec_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &BuiltInTemplateSpecId{} func TestNewBuiltInTemplateSpecID(t *testing.T) { - id := NewBuiltInTemplateSpecID("templateSpecName") + id := NewBuiltInTemplateSpecID("builtInTemplateSpecName") - if id.BuiltInTemplateSpecName != "templateSpecName" { - t.Fatalf("Expected %q but got %q for Segment 'BuiltInTemplateSpecName'", id.BuiltInTemplateSpecName, "templateSpecName") + if id.BuiltInTemplateSpecName != "builtInTemplateSpecName" { + t.Fatalf("Expected %q but got %q for Segment 'BuiltInTemplateSpecName'", id.BuiltInTemplateSpecName, "builtInTemplateSpecName") } } func TestFormatBuiltInTemplateSpecID(t *testing.T) { - actual := NewBuiltInTemplateSpecID("templateSpecName").ID() - expected := "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName" + actual := NewBuiltInTemplateSpecID("builtInTemplateSpecName").ID() + expected := "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseBuiltInTemplateSpecID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName", Expected: &BuiltInTemplateSpecId{ - BuiltInTemplateSpecName: "templateSpecName", + BuiltInTemplateSpecName: "builtInTemplateSpecName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/extra", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseBuiltInTemplateSpecIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName", Expected: &BuiltInTemplateSpecId{ - BuiltInTemplateSpecName: "templateSpecName", + BuiltInTemplateSpecName: "builtInTemplateSpecName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/extra", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/tEmPlAtEsPeCnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/bUiLtInTeMpLaTeSpEcNaMe", Expected: &BuiltInTemplateSpecId{ - BuiltInTemplateSpecName: "tEmPlAtEsPeCnAmE", + BuiltInTemplateSpecName: "bUiLtInTeMpLaTeSpEcNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/tEmPlAtEsPeCnAmE/extra", + Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/bUiLtInTeMpLaTeSpEcNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-02-01/templatespecversions/id_templatespecversion.go b/resource-manager/resources/2022-02-01/templatespecversions/id_templatespecversion.go index 1f6af1be98c..f569f68ea94 100644 --- a/resource-manager/resources/2022-02-01/templatespecversions/id_templatespecversion.go +++ b/resource-manager/resources/2022-02-01/templatespecversions/id_templatespecversion.go @@ -123,7 +123,7 @@ func (id TemplateSpecVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTemplateSpecs", "templateSpecs", "templateSpecs"), resourceids.UserSpecifiedSegment("templateSpecName", "templateSpecName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "templateSpecVersion"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/resources/2022-02-01/templatespecversions/id_templatespecversion_test.go b/resource-manager/resources/2022-02-01/templatespecversions/id_templatespecversion_test.go index fb920dc5d28..aacecae9acb 100644 --- a/resource-manager/resources/2022-02-01/templatespecversions/id_templatespecversion_test.go +++ b/resource-manager/resources/2022-02-01/templatespecversions/id_templatespecversion_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TemplateSpecVersionId{} func TestNewTemplateSpecVersionID(t *testing.T) { - id := NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "templateSpecVersion") + id := NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewTemplateSpecVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TemplateSpecName'", id.TemplateSpecName, "templateSpecName") } - if id.VersionName != "templateSpecVersion" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "templateSpecVersion") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatTemplateSpecVersionID(t *testing.T) { - actual := NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "templateSpecVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/templateSpecVersion" + actual := NewTemplateSpecVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "templateSpecName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseTemplateSpecVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/templateSpecVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/versionName", Expected: &TemplateSpecVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", TemplateSpecName: "templateSpecName", - VersionName: "templateSpecVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/templateSpecVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/versionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseTemplateSpecVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/templateSpecVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/versionName", Expected: &TemplateSpecVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", TemplateSpecName: "templateSpecName", - VersionName: "templateSpecVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/templateSpecVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/templateSpecs/templateSpecName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/tEmPlAtEsPeCs/tEmPlAtEsPeCnAmE/vErSiOnS/tEmPlAtEsPeCvErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/tEmPlAtEsPeCs/tEmPlAtEsPeCnAmE/vErSiOnS/vErSiOnNaMe", Expected: &TemplateSpecVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", TemplateSpecName: "tEmPlAtEsPeCnAmE", - VersionName: "tEmPlAtEsPeCvErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/tEmPlAtEsPeCs/tEmPlAtEsPeCnAmE/vErSiOnS/tEmPlAtEsPeCvErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/tEmPlAtEsPeCs/tEmPlAtEsPeCnAmE/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-02-01/templatespecversions/id_version.go b/resource-manager/resources/2022-02-01/templatespecversions/id_version.go index 64b3c055cf4..b005ad06134 100644 --- a/resource-manager/resources/2022-02-01/templatespecversions/id_version.go +++ b/resource-manager/resources/2022-02-01/templatespecversions/id_version.go @@ -105,9 +105,9 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResources", "Microsoft.Resources", "Microsoft.Resources"), resourceids.StaticSegment("staticBuiltInTemplateSpecs", "builtInTemplateSpecs", "builtInTemplateSpecs"), - resourceids.UserSpecifiedSegment("builtInTemplateSpecName", "templateSpecName"), + resourceids.UserSpecifiedSegment("builtInTemplateSpecName", "builtInTemplateSpecName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "templateSpecVersion"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/resources/2022-02-01/templatespecversions/id_version_test.go b/resource-manager/resources/2022-02-01/templatespecversions/id_version_test.go index edd41a657b7..5e8bd266815 100644 --- a/resource-manager/resources/2022-02-01/templatespecversions/id_version_test.go +++ b/resource-manager/resources/2022-02-01/templatespecversions/id_version_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("templateSpecName", "templateSpecVersion") + id := NewVersionID("builtInTemplateSpecName", "versionName") - if id.BuiltInTemplateSpecName != "templateSpecName" { - t.Fatalf("Expected %q but got %q for Segment 'BuiltInTemplateSpecName'", id.BuiltInTemplateSpecName, "templateSpecName") + if id.BuiltInTemplateSpecName != "builtInTemplateSpecName" { + t.Fatalf("Expected %q but got %q for Segment 'BuiltInTemplateSpecName'", id.BuiltInTemplateSpecName, "builtInTemplateSpecName") } - if id.VersionName != "templateSpecVersion" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "templateSpecVersion") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("templateSpecName", "templateSpecVersion").ID() - expected := "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/versions/templateSpecVersion" + actual := NewVersionID("builtInTemplateSpecName", "versionName").ID() + expected := "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,25 +59,25 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName", Error: true, }, { // Incomplete URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/versions", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/versions", Error: true, }, { // Valid URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/versions/templateSpecVersion", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/versions/versionName", Expected: &VersionId{ - BuiltInTemplateSpecName: "templateSpecName", - VersionName: "templateSpecVersion", + BuiltInTemplateSpecName: "builtInTemplateSpecName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/versions/templateSpecVersion/extra", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/versions/versionName/extra", Error: true, }, } @@ -150,48 +150,48 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/tEmPlAtEsPeCnAmE", + Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/bUiLtInTeMpLaTeSpEcNaMe", Error: true, }, { // Incomplete URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/versions", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/tEmPlAtEsPeCnAmE/vErSiOnS", + Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/bUiLtInTeMpLaTeSpEcNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/versions/templateSpecVersion", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/versions/versionName", Expected: &VersionId{ - BuiltInTemplateSpecName: "templateSpecName", - VersionName: "templateSpecVersion", + BuiltInTemplateSpecName: "builtInTemplateSpecName", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/templateSpecName/versions/templateSpecVersion/extra", + Input: "/providers/Microsoft.Resources/builtInTemplateSpecs/builtInTemplateSpecName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/tEmPlAtEsPeCnAmE/vErSiOnS/tEmPlAtEsPeCvErSiOn", + Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/bUiLtInTeMpLaTeSpEcNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ - BuiltInTemplateSpecName: "tEmPlAtEsPeCnAmE", - VersionName: "tEmPlAtEsPeCvErSiOn", + BuiltInTemplateSpecName: "bUiLtInTeMpLaTeSpEcNaMe", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/tEmPlAtEsPeCnAmE/vErSiOnS/tEmPlAtEsPeCvErSiOn/extra", + Input: "/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/bUiLtInTeMpLaTeSpEcS/bUiLtInTeMpLaTeSpEcNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-09-01/providers/README.md b/resource-manager/resources/2022-09-01/providers/README.md index a4c00283c4e..4796cb319a6 100644 --- a/resource-manager/resources/2022-09-01/providers/README.md +++ b/resource-manager/resources/2022-09-01/providers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Get(ctx, id, providers.DefaultGetOperationOptions()) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviderID("resourceProviderNamespace") +id := providers.NewProviderID("providerName") read, err := client.GetAtTenantScope(ctx, id, providers.DefaultGetAtTenantScopeOperationOptions()) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderPermissions(ctx, id)` can be used to do batched pagination items, err := client.ProviderPermissionsComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderResourceTypesList(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions())` can be used to do batched pagination items, err := client.ProviderResourceTypesListComplete(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions()) @@ -125,7 +125,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") payload := providers.ProviderRegistrationRequest{ // ... @@ -146,7 +146,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviders2ID("groupId", "resourceProviderNamespace") +id := providers.NewProviders2ID("groupId", "providerName") read, err := client.RegisterAtManagementGroupScope(ctx, id) if err != nil { @@ -162,7 +162,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/resources/2022-09-01/providers/id_provider.go b/resource-manager/resources/2022-09-01/providers/id_provider.go index 64201d1da62..71544793e1f 100644 --- a/resource-manager/resources/2022-09-01/providers/id_provider.go +++ b/resource-manager/resources/2022-09-01/providers/id_provider.go @@ -97,7 +97,7 @@ func (id ProviderId) ID() string { func (id ProviderId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2022-09-01/providers/id_provider_test.go b/resource-manager/resources/2022-09-01/providers/id_provider_test.go index 72f331a300e..262553688e3 100644 --- a/resource-manager/resources/2022-09-01/providers/id_provider_test.go +++ b/resource-manager/resources/2022-09-01/providers/id_provider_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ProviderId{} func TestNewProviderID(t *testing.T) { - id := NewProviderID("resourceProviderNamespace") + id := NewProviderID("providerName") - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviderID(t *testing.T) { - actual := NewProviderID("resourceProviderNamespace").ID() - expected := "/providers/resourceProviderNamespace" + actual := NewProviderID("providerName").ID() + expected := "/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -45,14 +45,14 @@ func TestParseProviderID(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, } @@ -101,26 +101,26 @@ func TestParseProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/pRoViDeRnAmE", Expected: &ProviderId{ - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-09-01/providers/id_providers2.go b/resource-manager/resources/2022-09-01/providers/id_providers2.go index 915907fb0ad..6236a5adf0c 100644 --- a/resource-manager/resources/2022-09-01/providers/id_providers2.go +++ b/resource-manager/resources/2022-09-01/providers/id_providers2.go @@ -107,7 +107,7 @@ func (id Providers2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticManagementGroups", "managementGroups", "managementGroups"), resourceids.UserSpecifiedSegment("groupId", "groupId"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2022-09-01/providers/id_providers2_test.go b/resource-manager/resources/2022-09-01/providers/id_providers2_test.go index fa2e45139ab..cc31c332e6e 100644 --- a/resource-manager/resources/2022-09-01/providers/id_providers2_test.go +++ b/resource-manager/resources/2022-09-01/providers/id_providers2_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &Providers2Id{} func TestNewProviders2ID(t *testing.T) { - id := NewProviders2ID("groupId", "resourceProviderNamespace") + id := NewProviders2ID("groupId", "providerName") if id.GroupId != "groupId" { t.Fatalf("Expected %q but got %q for Segment 'GroupId'", id.GroupId, "groupId") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviders2ID(t *testing.T) { - actual := NewProviders2ID("groupId", "resourceProviderNamespace").ID() - expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace" + actual := NewProviders2ID("groupId", "providerName").ID() + expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviders2ID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviders2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE", Expected: &Providers2Id{ GroupId: "gRoUpId", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-09-01/providers/id_subscriptionprovider.go b/resource-manager/resources/2022-09-01/providers/id_subscriptionprovider.go index 652370f9102..4ba6dbab693 100644 --- a/resource-manager/resources/2022-09-01/providers/id_subscriptionprovider.go +++ b/resource-manager/resources/2022-09-01/providers/id_subscriptionprovider.go @@ -105,7 +105,7 @@ func (id SubscriptionProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2022-09-01/providers/id_subscriptionprovider_test.go b/resource-manager/resources/2022-09-01/providers/id_subscriptionprovider_test.go index 162974a0173..a9ca5cba7d0 100644 --- a/resource-manager/resources/2022-09-01/providers/id_subscriptionprovider_test.go +++ b/resource-manager/resources/2022-09-01/providers/id_subscriptionprovider_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &SubscriptionProviderId{} func TestNewSubscriptionProviderID(t *testing.T) { - id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") + id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatSubscriptionProviderID(t *testing.T) { - actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace" + actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseSubscriptionProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseSubscriptionProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-09-01/tags/README.md b/resource-manager/resources/2022-09-01/tags/README.md index 24b841de958..fd739335a19 100644 --- a/resource-manager/resources/2022-09-01/tags/README.md +++ b/resource-manager/resources/2022-09-01/tags/README.md @@ -58,7 +58,7 @@ if err := client.CreateOrUpdateAtScopeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.CreateOrUpdateValue(ctx, id) if err != nil { @@ -102,7 +102,7 @@ if err := client.DeleteAtScopeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.DeleteValue(ctx, id) if err != nil { diff --git a/resource-manager/resources/2022-09-01/tags/id_tagvalue.go b/resource-manager/resources/2022-09-01/tags/id_tagvalue.go index da625991a86..3771f3e7f9a 100644 --- a/resource-manager/resources/2022-09-01/tags/id_tagvalue.go +++ b/resource-manager/resources/2022-09-01/tags/id_tagvalue.go @@ -113,7 +113,7 @@ func (id TagValueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTagNames", "tagNames", "tagNames"), resourceids.UserSpecifiedSegment("tagName", "tagName"), resourceids.StaticSegment("staticTagValues", "tagValues", "tagValues"), - resourceids.UserSpecifiedSegment("tagValueName", "tagValue"), + resourceids.UserSpecifiedSegment("tagValueName", "tagValueName"), } } diff --git a/resource-manager/resources/2022-09-01/tags/id_tagvalue_test.go b/resource-manager/resources/2022-09-01/tags/id_tagvalue_test.go index 7bd0cf6abdc..a1243c411ae 100644 --- a/resource-manager/resources/2022-09-01/tags/id_tagvalue_test.go +++ b/resource-manager/resources/2022-09-01/tags/id_tagvalue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagValueId{} func TestNewTagValueID(t *testing.T) { - id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") + id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewTagValueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TagName'", id.TagName, "tagName") } - if id.TagValueName != "tagValue" { - t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValue") + if id.TagValueName != "tagValueName" { + t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValueName") } } func TestFormatTagValueID(t *testing.T) { - actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue" + actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,16 +73,16 @@ func TestParseTagValueID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, } @@ -179,30 +179,30 @@ func TestParseTagValueIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tAgNaMe", - TagValueName: "tAgVaLuE", + TagValueName: "tAgVaLuEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2022-12-01/tenants/model_tenantiddescription.go b/resource-manager/resources/2022-12-01/tenants/model_tenantiddescription.go index d6caf396698..6076c827852 100644 --- a/resource-manager/resources/2022-12-01/tenants/model_tenantiddescription.go +++ b/resource-manager/resources/2022-12-01/tenants/model_tenantiddescription.go @@ -10,7 +10,7 @@ type TenantIdDescription struct { DisplayName *string `json:"displayName,omitempty"` Domains *[]string `json:"domains,omitempty"` Id *string `json:"id,omitempty"` - TenantBrandingLogoUrl *string `json:"tenantBrandingLogoUrl,omitempty"` + TenantBrandingLogoURL *string `json:"tenantBrandingLogoUrl,omitempty"` TenantCategory *TenantCategory `json:"tenantCategory,omitempty"` TenantId *string `json:"tenantId,omitempty"` TenantType *string `json:"tenantType,omitempty"` diff --git a/resource-manager/resources/2022-12-01/tenants/predicates.go b/resource-manager/resources/2022-12-01/tenants/predicates.go index 8a3771855af..e74bd9f4ba9 100644 --- a/resource-manager/resources/2022-12-01/tenants/predicates.go +++ b/resource-manager/resources/2022-12-01/tenants/predicates.go @@ -9,7 +9,7 @@ type TenantIdDescriptionOperationPredicate struct { DefaultDomain *string DisplayName *string Id *string - TenantBrandingLogoUrl *string + TenantBrandingLogoURL *string TenantId *string TenantType *string } @@ -36,7 +36,7 @@ func (p TenantIdDescriptionOperationPredicate) Matches(input TenantIdDescription return false } - if p.TenantBrandingLogoUrl != nil && (input.TenantBrandingLogoUrl == nil || *p.TenantBrandingLogoUrl != *input.TenantBrandingLogoUrl) { + if p.TenantBrandingLogoURL != nil && (input.TenantBrandingLogoURL == nil || *p.TenantBrandingLogoURL != *input.TenantBrandingLogoURL) { return false } diff --git a/resource-manager/resources/2023-07-01/providers/README.md b/resource-manager/resources/2023-07-01/providers/README.md index 894d74a9c80..3e8d6af6e5e 100644 --- a/resource-manager/resources/2023-07-01/providers/README.md +++ b/resource-manager/resources/2023-07-01/providers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Get(ctx, id, providers.DefaultGetOperationOptions()) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviderID("resourceProviderNamespace") +id := providers.NewProviderID("providerName") read, err := client.GetAtTenantScope(ctx, id, providers.DefaultGetAtTenantScopeOperationOptions()) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderPermissions(ctx, id)` can be used to do batched pagination items, err := client.ProviderPermissionsComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderResourceTypesList(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions())` can be used to do batched pagination items, err := client.ProviderResourceTypesListComplete(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions()) @@ -125,7 +125,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") payload := providers.ProviderRegistrationRequest{ // ... @@ -146,7 +146,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviders2ID("groupId", "resourceProviderNamespace") +id := providers.NewProviders2ID("groupId", "providerName") read, err := client.RegisterAtManagementGroupScope(ctx, id) if err != nil { @@ -162,7 +162,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/resources/2023-07-01/providers/id_provider.go b/resource-manager/resources/2023-07-01/providers/id_provider.go index 64201d1da62..71544793e1f 100644 --- a/resource-manager/resources/2023-07-01/providers/id_provider.go +++ b/resource-manager/resources/2023-07-01/providers/id_provider.go @@ -97,7 +97,7 @@ func (id ProviderId) ID() string { func (id ProviderId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2023-07-01/providers/id_provider_test.go b/resource-manager/resources/2023-07-01/providers/id_provider_test.go index 72f331a300e..262553688e3 100644 --- a/resource-manager/resources/2023-07-01/providers/id_provider_test.go +++ b/resource-manager/resources/2023-07-01/providers/id_provider_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ProviderId{} func TestNewProviderID(t *testing.T) { - id := NewProviderID("resourceProviderNamespace") + id := NewProviderID("providerName") - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviderID(t *testing.T) { - actual := NewProviderID("resourceProviderNamespace").ID() - expected := "/providers/resourceProviderNamespace" + actual := NewProviderID("providerName").ID() + expected := "/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -45,14 +45,14 @@ func TestParseProviderID(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, } @@ -101,26 +101,26 @@ func TestParseProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/pRoViDeRnAmE", Expected: &ProviderId{ - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2023-07-01/providers/id_providers2.go b/resource-manager/resources/2023-07-01/providers/id_providers2.go index 915907fb0ad..6236a5adf0c 100644 --- a/resource-manager/resources/2023-07-01/providers/id_providers2.go +++ b/resource-manager/resources/2023-07-01/providers/id_providers2.go @@ -107,7 +107,7 @@ func (id Providers2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticManagementGroups", "managementGroups", "managementGroups"), resourceids.UserSpecifiedSegment("groupId", "groupId"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2023-07-01/providers/id_providers2_test.go b/resource-manager/resources/2023-07-01/providers/id_providers2_test.go index fa2e45139ab..cc31c332e6e 100644 --- a/resource-manager/resources/2023-07-01/providers/id_providers2_test.go +++ b/resource-manager/resources/2023-07-01/providers/id_providers2_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &Providers2Id{} func TestNewProviders2ID(t *testing.T) { - id := NewProviders2ID("groupId", "resourceProviderNamespace") + id := NewProviders2ID("groupId", "providerName") if id.GroupId != "groupId" { t.Fatalf("Expected %q but got %q for Segment 'GroupId'", id.GroupId, "groupId") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviders2ID(t *testing.T) { - actual := NewProviders2ID("groupId", "resourceProviderNamespace").ID() - expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace" + actual := NewProviders2ID("groupId", "providerName").ID() + expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviders2ID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviders2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE", Expected: &Providers2Id{ GroupId: "gRoUpId", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2023-07-01/providers/id_subscriptionprovider.go b/resource-manager/resources/2023-07-01/providers/id_subscriptionprovider.go index 652370f9102..4ba6dbab693 100644 --- a/resource-manager/resources/2023-07-01/providers/id_subscriptionprovider.go +++ b/resource-manager/resources/2023-07-01/providers/id_subscriptionprovider.go @@ -105,7 +105,7 @@ func (id SubscriptionProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2023-07-01/providers/id_subscriptionprovider_test.go b/resource-manager/resources/2023-07-01/providers/id_subscriptionprovider_test.go index 162974a0173..a9ca5cba7d0 100644 --- a/resource-manager/resources/2023-07-01/providers/id_subscriptionprovider_test.go +++ b/resource-manager/resources/2023-07-01/providers/id_subscriptionprovider_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &SubscriptionProviderId{} func TestNewSubscriptionProviderID(t *testing.T) { - id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") + id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatSubscriptionProviderID(t *testing.T) { - actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace" + actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseSubscriptionProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseSubscriptionProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2023-07-01/tags/README.md b/resource-manager/resources/2023-07-01/tags/README.md index 4f6509680fb..bd016ac4593 100644 --- a/resource-manager/resources/2023-07-01/tags/README.md +++ b/resource-manager/resources/2023-07-01/tags/README.md @@ -58,7 +58,7 @@ if err := client.CreateOrUpdateAtScopeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.CreateOrUpdateValue(ctx, id) if err != nil { @@ -102,7 +102,7 @@ if err := client.DeleteAtScopeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.DeleteValue(ctx, id) if err != nil { diff --git a/resource-manager/resources/2023-07-01/tags/id_tagvalue.go b/resource-manager/resources/2023-07-01/tags/id_tagvalue.go index da625991a86..3771f3e7f9a 100644 --- a/resource-manager/resources/2023-07-01/tags/id_tagvalue.go +++ b/resource-manager/resources/2023-07-01/tags/id_tagvalue.go @@ -113,7 +113,7 @@ func (id TagValueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTagNames", "tagNames", "tagNames"), resourceids.UserSpecifiedSegment("tagName", "tagName"), resourceids.StaticSegment("staticTagValues", "tagValues", "tagValues"), - resourceids.UserSpecifiedSegment("tagValueName", "tagValue"), + resourceids.UserSpecifiedSegment("tagValueName", "tagValueName"), } } diff --git a/resource-manager/resources/2023-07-01/tags/id_tagvalue_test.go b/resource-manager/resources/2023-07-01/tags/id_tagvalue_test.go index 7bd0cf6abdc..a1243c411ae 100644 --- a/resource-manager/resources/2023-07-01/tags/id_tagvalue_test.go +++ b/resource-manager/resources/2023-07-01/tags/id_tagvalue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagValueId{} func TestNewTagValueID(t *testing.T) { - id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") + id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewTagValueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TagName'", id.TagName, "tagName") } - if id.TagValueName != "tagValue" { - t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValue") + if id.TagValueName != "tagValueName" { + t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValueName") } } func TestFormatTagValueID(t *testing.T) { - actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue" + actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,16 +73,16 @@ func TestParseTagValueID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, } @@ -179,30 +179,30 @@ func TestParseTagValueIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tAgNaMe", - TagValueName: "tAgVaLuE", + TagValueName: "tAgVaLuEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2023-08-01/deploymentscripts/README.md b/resource-manager/resources/2023-08-01/deploymentscripts/README.md index 565b5ec18e2..ed1c531e59e 100644 --- a/resource-manager/resources/2023-08-01/deploymentscripts/README.md +++ b/resource-manager/resources/2023-08-01/deploymentscripts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") payload := deploymentscripts.DeploymentScript{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") read, err := client.Delete(ctx, id) if err != nil { @@ -58,7 +58,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") read, err := client.Get(ctx, id) if err != nil { @@ -74,7 +74,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") read, err := client.GetLogs(ctx, id) if err != nil { @@ -90,7 +90,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") read, err := client.GetLogsDefault(ctx, id, deploymentscripts.DefaultGetLogsDefaultOperationOptions()) if err != nil { @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") +id := deploymentscripts.NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") payload := deploymentscripts.DeploymentScriptUpdateParameter{ // ... diff --git a/resource-manager/resources/2023-08-01/deploymentscripts/id_deploymentscript.go b/resource-manager/resources/2023-08-01/deploymentscripts/id_deploymentscript.go index 995e0ffbd55..396389f8ae8 100644 --- a/resource-manager/resources/2023-08-01/deploymentscripts/id_deploymentscript.go +++ b/resource-manager/resources/2023-08-01/deploymentscripts/id_deploymentscript.go @@ -115,7 +115,7 @@ func (id DeploymentScriptId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftResources", "Microsoft.Resources", "Microsoft.Resources"), resourceids.StaticSegment("staticDeploymentScripts", "deploymentScripts", "deploymentScripts"), - resourceids.UserSpecifiedSegment("deploymentScriptName", "scriptName"), + resourceids.UserSpecifiedSegment("deploymentScriptName", "deploymentScriptName"), } } diff --git a/resource-manager/resources/2023-08-01/deploymentscripts/id_deploymentscript_test.go b/resource-manager/resources/2023-08-01/deploymentscripts/id_deploymentscript_test.go index 311733b27b4..9144b9364c0 100644 --- a/resource-manager/resources/2023-08-01/deploymentscripts/id_deploymentscript_test.go +++ b/resource-manager/resources/2023-08-01/deploymentscripts/id_deploymentscript_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeploymentScriptId{} func TestNewDeploymentScriptID(t *testing.T) { - id := NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName") + id := NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewDeploymentScriptID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.DeploymentScriptName != "scriptName" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentScriptName'", id.DeploymentScriptName, "scriptName") + if id.DeploymentScriptName != "deploymentScriptName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentScriptName'", id.DeploymentScriptName, "deploymentScriptName") } } func TestFormatDeploymentScriptID(t *testing.T) { - actual := NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "scriptName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName" + actual := NewDeploymentScriptID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentScriptName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseDeploymentScriptID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName", Expected: &DeploymentScriptId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DeploymentScriptName: "scriptName", + DeploymentScriptName: "deploymentScriptName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseDeploymentScriptIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName", Expected: &DeploymentScriptId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - DeploymentScriptName: "scriptName", + DeploymentScriptName: "deploymentScriptName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/scriptName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentScripts/deploymentScriptName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsCrIpTs/sCrIpTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsCrIpTs/dEpLoYmEnTsCrIpTnAmE", Expected: &DeploymentScriptId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DeploymentScriptName: "sCrIpTnAmE", + DeploymentScriptName: "dEpLoYmEnTsCrIpTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsCrIpTs/sCrIpTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsCrIpTs/dEpLoYmEnTsCrIpTnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2024-03-01/providers/README.md b/resource-manager/resources/2024-03-01/providers/README.md index ba35531a42e..75bab14ac91 100644 --- a/resource-manager/resources/2024-03-01/providers/README.md +++ b/resource-manager/resources/2024-03-01/providers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Get(ctx, id, providers.DefaultGetOperationOptions()) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviderID("resourceProviderNamespace") +id := providers.NewProviderID("providerName") read, err := client.GetAtTenantScope(ctx, id, providers.DefaultGetAtTenantScopeOperationOptions()) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderPermissions(ctx, id)` can be used to do batched pagination items, err := client.ProviderPermissionsComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderResourceTypesList(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions())` can be used to do batched pagination items, err := client.ProviderResourceTypesListComplete(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions()) @@ -125,7 +125,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") payload := providers.ProviderRegistrationRequest{ // ... @@ -146,7 +146,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviders2ID("groupId", "resourceProviderNamespace") +id := providers.NewProviders2ID("groupId", "providerName") read, err := client.RegisterAtManagementGroupScope(ctx, id) if err != nil { @@ -162,7 +162,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/resources/2024-03-01/providers/id_provider.go b/resource-manager/resources/2024-03-01/providers/id_provider.go index 64201d1da62..71544793e1f 100644 --- a/resource-manager/resources/2024-03-01/providers/id_provider.go +++ b/resource-manager/resources/2024-03-01/providers/id_provider.go @@ -97,7 +97,7 @@ func (id ProviderId) ID() string { func (id ProviderId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2024-03-01/providers/id_provider_test.go b/resource-manager/resources/2024-03-01/providers/id_provider_test.go index 72f331a300e..262553688e3 100644 --- a/resource-manager/resources/2024-03-01/providers/id_provider_test.go +++ b/resource-manager/resources/2024-03-01/providers/id_provider_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ProviderId{} func TestNewProviderID(t *testing.T) { - id := NewProviderID("resourceProviderNamespace") + id := NewProviderID("providerName") - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviderID(t *testing.T) { - actual := NewProviderID("resourceProviderNamespace").ID() - expected := "/providers/resourceProviderNamespace" + actual := NewProviderID("providerName").ID() + expected := "/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -45,14 +45,14 @@ func TestParseProviderID(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, } @@ -101,26 +101,26 @@ func TestParseProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/pRoViDeRnAmE", Expected: &ProviderId{ - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2024-03-01/providers/id_providers2.go b/resource-manager/resources/2024-03-01/providers/id_providers2.go index 915907fb0ad..6236a5adf0c 100644 --- a/resource-manager/resources/2024-03-01/providers/id_providers2.go +++ b/resource-manager/resources/2024-03-01/providers/id_providers2.go @@ -107,7 +107,7 @@ func (id Providers2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticManagementGroups", "managementGroups", "managementGroups"), resourceids.UserSpecifiedSegment("groupId", "groupId"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2024-03-01/providers/id_providers2_test.go b/resource-manager/resources/2024-03-01/providers/id_providers2_test.go index fa2e45139ab..cc31c332e6e 100644 --- a/resource-manager/resources/2024-03-01/providers/id_providers2_test.go +++ b/resource-manager/resources/2024-03-01/providers/id_providers2_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &Providers2Id{} func TestNewProviders2ID(t *testing.T) { - id := NewProviders2ID("groupId", "resourceProviderNamespace") + id := NewProviders2ID("groupId", "providerName") if id.GroupId != "groupId" { t.Fatalf("Expected %q but got %q for Segment 'GroupId'", id.GroupId, "groupId") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviders2ID(t *testing.T) { - actual := NewProviders2ID("groupId", "resourceProviderNamespace").ID() - expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace" + actual := NewProviders2ID("groupId", "providerName").ID() + expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviders2ID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviders2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE", Expected: &Providers2Id{ GroupId: "gRoUpId", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2024-03-01/providers/id_subscriptionprovider.go b/resource-manager/resources/2024-03-01/providers/id_subscriptionprovider.go index 652370f9102..4ba6dbab693 100644 --- a/resource-manager/resources/2024-03-01/providers/id_subscriptionprovider.go +++ b/resource-manager/resources/2024-03-01/providers/id_subscriptionprovider.go @@ -105,7 +105,7 @@ func (id SubscriptionProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2024-03-01/providers/id_subscriptionprovider_test.go b/resource-manager/resources/2024-03-01/providers/id_subscriptionprovider_test.go index 162974a0173..a9ca5cba7d0 100644 --- a/resource-manager/resources/2024-03-01/providers/id_subscriptionprovider_test.go +++ b/resource-manager/resources/2024-03-01/providers/id_subscriptionprovider_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &SubscriptionProviderId{} func TestNewSubscriptionProviderID(t *testing.T) { - id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") + id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatSubscriptionProviderID(t *testing.T) { - actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace" + actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseSubscriptionProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseSubscriptionProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2024-03-01/tags/README.md b/resource-manager/resources/2024-03-01/tags/README.md index 8f6027b9ee8..61c02664ec1 100644 --- a/resource-manager/resources/2024-03-01/tags/README.md +++ b/resource-manager/resources/2024-03-01/tags/README.md @@ -58,7 +58,7 @@ if err := client.CreateOrUpdateAtScopeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.CreateOrUpdateValue(ctx, id) if err != nil { @@ -102,7 +102,7 @@ if err := client.DeleteAtScopeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.DeleteValue(ctx, id) if err != nil { diff --git a/resource-manager/resources/2024-03-01/tags/id_tagvalue.go b/resource-manager/resources/2024-03-01/tags/id_tagvalue.go index da625991a86..3771f3e7f9a 100644 --- a/resource-manager/resources/2024-03-01/tags/id_tagvalue.go +++ b/resource-manager/resources/2024-03-01/tags/id_tagvalue.go @@ -113,7 +113,7 @@ func (id TagValueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTagNames", "tagNames", "tagNames"), resourceids.UserSpecifiedSegment("tagName", "tagName"), resourceids.StaticSegment("staticTagValues", "tagValues", "tagValues"), - resourceids.UserSpecifiedSegment("tagValueName", "tagValue"), + resourceids.UserSpecifiedSegment("tagValueName", "tagValueName"), } } diff --git a/resource-manager/resources/2024-03-01/tags/id_tagvalue_test.go b/resource-manager/resources/2024-03-01/tags/id_tagvalue_test.go index 7bd0cf6abdc..a1243c411ae 100644 --- a/resource-manager/resources/2024-03-01/tags/id_tagvalue_test.go +++ b/resource-manager/resources/2024-03-01/tags/id_tagvalue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagValueId{} func TestNewTagValueID(t *testing.T) { - id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") + id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewTagValueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TagName'", id.TagName, "tagName") } - if id.TagValueName != "tagValue" { - t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValue") + if id.TagValueName != "tagValueName" { + t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValueName") } } func TestFormatTagValueID(t *testing.T) { - actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue" + actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,16 +73,16 @@ func TestParseTagValueID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, } @@ -179,30 +179,30 @@ func TestParseTagValueIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tAgNaMe", - TagValueName: "tAgVaLuE", + TagValueName: "tAgVaLuEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2024-07-01/providers/README.md b/resource-manager/resources/2024-07-01/providers/README.md index 056b2c761e3..32d34d13f9b 100644 --- a/resource-manager/resources/2024-07-01/providers/README.md +++ b/resource-manager/resources/2024-07-01/providers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Get(ctx, id, providers.DefaultGetOperationOptions()) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviderID("resourceProviderNamespace") +id := providers.NewProviderID("providerName") read, err := client.GetAtTenantScope(ctx, id, providers.DefaultGetAtTenantScopeOperationOptions()) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderPermissions(ctx, id)` can be used to do batched pagination items, err := client.ProviderPermissionsComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") // alternatively `client.ProviderResourceTypesList(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions())` can be used to do batched pagination items, err := client.ProviderResourceTypesListComplete(ctx, id, providers.DefaultProviderResourceTypesListOperationOptions()) @@ -125,7 +125,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") payload := providers.ProviderRegistrationRequest{ // ... @@ -146,7 +146,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewProviders2ID("groupId", "resourceProviderNamespace") +id := providers.NewProviders2ID("groupId", "providerName") read, err := client.RegisterAtManagementGroupScope(ctx, id) if err != nil { @@ -162,7 +162,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") +id := providers.NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") read, err := client.Unregister(ctx, id) if err != nil { diff --git a/resource-manager/resources/2024-07-01/providers/id_provider.go b/resource-manager/resources/2024-07-01/providers/id_provider.go index 64201d1da62..71544793e1f 100644 --- a/resource-manager/resources/2024-07-01/providers/id_provider.go +++ b/resource-manager/resources/2024-07-01/providers/id_provider.go @@ -97,7 +97,7 @@ func (id ProviderId) ID() string { func (id ProviderId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2024-07-01/providers/id_provider_test.go b/resource-manager/resources/2024-07-01/providers/id_provider_test.go index 72f331a300e..262553688e3 100644 --- a/resource-manager/resources/2024-07-01/providers/id_provider_test.go +++ b/resource-manager/resources/2024-07-01/providers/id_provider_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &ProviderId{} func TestNewProviderID(t *testing.T) { - id := NewProviderID("resourceProviderNamespace") + id := NewProviderID("providerName") - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviderID(t *testing.T) { - actual := NewProviderID("resourceProviderNamespace").ID() - expected := "/providers/resourceProviderNamespace" + actual := NewProviderID("providerName").ID() + expected := "/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -45,14 +45,14 @@ func TestParseProviderID(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, } @@ -101,26 +101,26 @@ func TestParseProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/resourceProviderNamespace", + Input: "/providers/providerName", Expected: &ProviderId{ - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/resourceProviderNamespace/extra", + Input: "/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/pRoViDeRnAmE", Expected: &ProviderId{ - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2024-07-01/providers/id_providers2.go b/resource-manager/resources/2024-07-01/providers/id_providers2.go index 915907fb0ad..6236a5adf0c 100644 --- a/resource-manager/resources/2024-07-01/providers/id_providers2.go +++ b/resource-manager/resources/2024-07-01/providers/id_providers2.go @@ -107,7 +107,7 @@ func (id Providers2Id) Segments() []resourceids.Segment { resourceids.StaticSegment("staticManagementGroups", "managementGroups", "managementGroups"), resourceids.UserSpecifiedSegment("groupId", "groupId"), resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2024-07-01/providers/id_providers2_test.go b/resource-manager/resources/2024-07-01/providers/id_providers2_test.go index fa2e45139ab..cc31c332e6e 100644 --- a/resource-manager/resources/2024-07-01/providers/id_providers2_test.go +++ b/resource-manager/resources/2024-07-01/providers/id_providers2_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &Providers2Id{} func TestNewProviders2ID(t *testing.T) { - id := NewProviders2ID("groupId", "resourceProviderNamespace") + id := NewProviders2ID("groupId", "providerName") if id.GroupId != "groupId" { t.Fatalf("Expected %q but got %q for Segment 'GroupId'", id.GroupId, "groupId") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatProviders2ID(t *testing.T) { - actual := NewProviders2ID("groupId", "resourceProviderNamespace").ID() - expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace" + actual := NewProviders2ID("groupId", "providerName").ID() + expected := "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviders2ID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviders2IDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName", Expected: &Providers2Id{ GroupId: "groupId", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/resourceProviderNamespace/extra", + Input: "/providers/Microsoft.Management/managementGroups/groupId/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE", Expected: &Providers2Id{ GroupId: "gRoUpId", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/gRoUpId/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2024-07-01/providers/id_subscriptionprovider.go b/resource-manager/resources/2024-07-01/providers/id_subscriptionprovider.go index 652370f9102..4ba6dbab693 100644 --- a/resource-manager/resources/2024-07-01/providers/id_subscriptionprovider.go +++ b/resource-manager/resources/2024-07-01/providers/id_subscriptionprovider.go @@ -105,7 +105,7 @@ func (id SubscriptionProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.UserSpecifiedSegment("providerName", "resourceProviderNamespace"), + resourceids.UserSpecifiedSegment("providerName", "providerName"), } } diff --git a/resource-manager/resources/2024-07-01/providers/id_subscriptionprovider_test.go b/resource-manager/resources/2024-07-01/providers/id_subscriptionprovider_test.go index 162974a0173..a9ca5cba7d0 100644 --- a/resource-manager/resources/2024-07-01/providers/id_subscriptionprovider_test.go +++ b/resource-manager/resources/2024-07-01/providers/id_subscriptionprovider_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &SubscriptionProviderId{} func TestNewSubscriptionProviderID(t *testing.T) { - id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace") + id := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ProviderName != "resourceProviderNamespace" { - t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "resourceProviderNamespace") + if id.ProviderName != "providerName" { + t.Fatalf("Expected %q but got %q for Segment 'ProviderName'", id.ProviderName, "providerName") } } func TestFormatSubscriptionProviderID(t *testing.T) { - actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "resourceProviderNamespace").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace" + actual := NewSubscriptionProviderID("12345678-1234-9876-4563-123456789012", "providerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -59,15 +59,15 @@ func TestParseSubscriptionProviderID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, } @@ -140,28 +140,28 @@ func TestParseSubscriptionProviderIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "resourceProviderNamespace", + ProviderName: "providerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/resourceProviderNamespace/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/providerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE", Expected: &SubscriptionProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ProviderName: "rEsOuRcEpRoViDeRnAmEsPaCe", + ProviderName: "pRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/rEsOuRcEpRoViDeRnAmEsPaCe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/pRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/resources/2024-07-01/tags/README.md b/resource-manager/resources/2024-07-01/tags/README.md index 2d9711b01bd..2c1d912d2d8 100644 --- a/resource-manager/resources/2024-07-01/tags/README.md +++ b/resource-manager/resources/2024-07-01/tags/README.md @@ -58,7 +58,7 @@ if err := client.CreateOrUpdateAtScopeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.CreateOrUpdateValue(ctx, id) if err != nil { @@ -102,7 +102,7 @@ if err := client.DeleteAtScopeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") +id := tags.NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") read, err := client.DeleteValue(ctx, id) if err != nil { diff --git a/resource-manager/resources/2024-07-01/tags/id_tagvalue.go b/resource-manager/resources/2024-07-01/tags/id_tagvalue.go index da625991a86..3771f3e7f9a 100644 --- a/resource-manager/resources/2024-07-01/tags/id_tagvalue.go +++ b/resource-manager/resources/2024-07-01/tags/id_tagvalue.go @@ -113,7 +113,7 @@ func (id TagValueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticTagNames", "tagNames", "tagNames"), resourceids.UserSpecifiedSegment("tagName", "tagName"), resourceids.StaticSegment("staticTagValues", "tagValues", "tagValues"), - resourceids.UserSpecifiedSegment("tagValueName", "tagValue"), + resourceids.UserSpecifiedSegment("tagValueName", "tagValueName"), } } diff --git a/resource-manager/resources/2024-07-01/tags/id_tagvalue_test.go b/resource-manager/resources/2024-07-01/tags/id_tagvalue_test.go index 7bd0cf6abdc..a1243c411ae 100644 --- a/resource-manager/resources/2024-07-01/tags/id_tagvalue_test.go +++ b/resource-manager/resources/2024-07-01/tags/id_tagvalue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TagValueId{} func TestNewTagValueID(t *testing.T) { - id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue") + id := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewTagValueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'TagName'", id.TagName, "tagName") } - if id.TagValueName != "tagValue" { - t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValue") + if id.TagValueName != "tagValueName" { + t.Fatalf("Expected %q but got %q for Segment 'TagValueName'", id.TagValueName, "tagValueName") } } func TestFormatTagValueID(t *testing.T) { - actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue" + actual := NewTagValueID("12345678-1234-9876-4563-123456789012", "tagName", "tagValueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,16 +73,16 @@ func TestParseTagValueID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, } @@ -179,30 +179,30 @@ func TestParseTagValueIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tagName", - TagValueName: "tagValue", + TagValueName: "tagValueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValue/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/tagNames/tagName/tagValues/tagValueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE", Expected: &TagValueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", TagName: "tAgNaMe", - TagValueName: "tAgVaLuE", + TagValueName: "tAgVaLuEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/tAgNaMeS/tAgNaMe/tAgVaLuEs/tAgVaLuEnAmE/extra", Error: true, }, } diff --git a/resource-manager/search/2022-09-01/querykeys/README.md b/resource-manager/search/2022-09-01/querykeys/README.md index 0739bda81d7..b8da75d06eb 100644 --- a/resource-manager/search/2022-09-01/querykeys/README.md +++ b/resource-manager/search/2022-09-01/querykeys/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := querykeys.NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "name") +id := querykeys.NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "createQueryKeyName") read, err := client.Create(ctx, id, querykeys.DefaultCreateOperationOptions()) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := querykeys.NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "key") +id := querykeys.NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "deleteQueryKeyName") read, err := client.Delete(ctx, id, querykeys.DefaultDeleteOperationOptions()) if err != nil { diff --git a/resource-manager/search/2022-09-01/querykeys/id_createquerykey.go b/resource-manager/search/2022-09-01/querykeys/id_createquerykey.go index 99815045b6e..dc859a9cb10 100644 --- a/resource-manager/search/2022-09-01/querykeys/id_createquerykey.go +++ b/resource-manager/search/2022-09-01/querykeys/id_createquerykey.go @@ -123,7 +123,7 @@ func (id CreateQueryKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSearchServices", "searchServices", "searchServices"), resourceids.UserSpecifiedSegment("searchServiceName", "searchServiceName"), resourceids.StaticSegment("staticCreateQueryKey", "createQueryKey", "createQueryKey"), - resourceids.UserSpecifiedSegment("createQueryKeyName", "name"), + resourceids.UserSpecifiedSegment("createQueryKeyName", "createQueryKeyName"), } } diff --git a/resource-manager/search/2022-09-01/querykeys/id_createquerykey_test.go b/resource-manager/search/2022-09-01/querykeys/id_createquerykey_test.go index 0646e4116de..4aea4df9f15 100644 --- a/resource-manager/search/2022-09-01/querykeys/id_createquerykey_test.go +++ b/resource-manager/search/2022-09-01/querykeys/id_createquerykey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CreateQueryKeyId{} func TestNewCreateQueryKeyID(t *testing.T) { - id := NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "name") + id := NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "createQueryKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewCreateQueryKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SearchServiceName'", id.SearchServiceName, "searchServiceName") } - if id.CreateQueryKeyName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CreateQueryKeyName'", id.CreateQueryKeyName, "name") + if id.CreateQueryKeyName != "createQueryKeyName" { + t.Fatalf("Expected %q but got %q for Segment 'CreateQueryKeyName'", id.CreateQueryKeyName, "createQueryKeyName") } } func TestFormatCreateQueryKeyID(t *testing.T) { - actual := NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name" + actual := NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "createQueryKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseCreateQueryKeyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName", Expected: &CreateQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SearchServiceName: "searchServiceName", - CreateQueryKeyName: "name", + CreateQueryKeyName: "createQueryKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseCreateQueryKeyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName", Expected: &CreateQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SearchServiceName: "searchServiceName", - CreateQueryKeyName: "name", + CreateQueryKeyName: "createQueryKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/cReAtEqUeRyKeY/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/cReAtEqUeRyKeY/cReAtEqUeRyKeYnAmE", Expected: &CreateQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SearchServiceName: "sEaRcHsErViCeNaMe", - CreateQueryKeyName: "nAmE", + CreateQueryKeyName: "cReAtEqUeRyKeYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/cReAtEqUeRyKeY/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/cReAtEqUeRyKeY/cReAtEqUeRyKeYnAmE/extra", Error: true, }, } diff --git a/resource-manager/search/2022-09-01/querykeys/id_deletequerykey.go b/resource-manager/search/2022-09-01/querykeys/id_deletequerykey.go index bdedadae458..2d538c92b2e 100644 --- a/resource-manager/search/2022-09-01/querykeys/id_deletequerykey.go +++ b/resource-manager/search/2022-09-01/querykeys/id_deletequerykey.go @@ -123,7 +123,7 @@ func (id DeleteQueryKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSearchServices", "searchServices", "searchServices"), resourceids.UserSpecifiedSegment("searchServiceName", "searchServiceName"), resourceids.StaticSegment("staticDeleteQueryKey", "deleteQueryKey", "deleteQueryKey"), - resourceids.UserSpecifiedSegment("deleteQueryKeyName", "key"), + resourceids.UserSpecifiedSegment("deleteQueryKeyName", "deleteQueryKeyName"), } } diff --git a/resource-manager/search/2022-09-01/querykeys/id_deletequerykey_test.go b/resource-manager/search/2022-09-01/querykeys/id_deletequerykey_test.go index aafee8d60f2..a52be96e5e7 100644 --- a/resource-manager/search/2022-09-01/querykeys/id_deletequerykey_test.go +++ b/resource-manager/search/2022-09-01/querykeys/id_deletequerykey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeleteQueryKeyId{} func TestNewDeleteQueryKeyID(t *testing.T) { - id := NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "key") + id := NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "deleteQueryKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDeleteQueryKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SearchServiceName'", id.SearchServiceName, "searchServiceName") } - if id.DeleteQueryKeyName != "key" { - t.Fatalf("Expected %q but got %q for Segment 'DeleteQueryKeyName'", id.DeleteQueryKeyName, "key") + if id.DeleteQueryKeyName != "deleteQueryKeyName" { + t.Fatalf("Expected %q but got %q for Segment 'DeleteQueryKeyName'", id.DeleteQueryKeyName, "deleteQueryKeyName") } } func TestFormatDeleteQueryKeyID(t *testing.T) { - actual := NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "key").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key" + actual := NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "deleteQueryKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDeleteQueryKeyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName", Expected: &DeleteQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SearchServiceName: "searchServiceName", - DeleteQueryKeyName: "key", + DeleteQueryKeyName: "deleteQueryKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDeleteQueryKeyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName", Expected: &DeleteQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SearchServiceName: "searchServiceName", - DeleteQueryKeyName: "key", + DeleteQueryKeyName: "deleteQueryKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/dElEtEqUeRyKeY/kEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/dElEtEqUeRyKeY/dElEtEqUeRyKeYnAmE", Expected: &DeleteQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SearchServiceName: "sEaRcHsErViCeNaMe", - DeleteQueryKeyName: "kEy", + DeleteQueryKeyName: "dElEtEqUeRyKeYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/dElEtEqUeRyKeY/kEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/dElEtEqUeRyKeY/dElEtEqUeRyKeYnAmE/extra", Error: true, }, } diff --git a/resource-manager/search/2023-11-01/querykeys/README.md b/resource-manager/search/2023-11-01/querykeys/README.md index 006f89d76e0..5ec7b585c95 100644 --- a/resource-manager/search/2023-11-01/querykeys/README.md +++ b/resource-manager/search/2023-11-01/querykeys/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := querykeys.NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "name") +id := querykeys.NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "createQueryKeyName") read, err := client.Create(ctx, id, querykeys.DefaultCreateOperationOptions()) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := querykeys.NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "key") +id := querykeys.NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "deleteQueryKeyName") read, err := client.Delete(ctx, id, querykeys.DefaultDeleteOperationOptions()) if err != nil { diff --git a/resource-manager/search/2023-11-01/querykeys/id_createquerykey.go b/resource-manager/search/2023-11-01/querykeys/id_createquerykey.go index 99815045b6e..dc859a9cb10 100644 --- a/resource-manager/search/2023-11-01/querykeys/id_createquerykey.go +++ b/resource-manager/search/2023-11-01/querykeys/id_createquerykey.go @@ -123,7 +123,7 @@ func (id CreateQueryKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSearchServices", "searchServices", "searchServices"), resourceids.UserSpecifiedSegment("searchServiceName", "searchServiceName"), resourceids.StaticSegment("staticCreateQueryKey", "createQueryKey", "createQueryKey"), - resourceids.UserSpecifiedSegment("createQueryKeyName", "name"), + resourceids.UserSpecifiedSegment("createQueryKeyName", "createQueryKeyName"), } } diff --git a/resource-manager/search/2023-11-01/querykeys/id_createquerykey_test.go b/resource-manager/search/2023-11-01/querykeys/id_createquerykey_test.go index 0646e4116de..4aea4df9f15 100644 --- a/resource-manager/search/2023-11-01/querykeys/id_createquerykey_test.go +++ b/resource-manager/search/2023-11-01/querykeys/id_createquerykey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CreateQueryKeyId{} func TestNewCreateQueryKeyID(t *testing.T) { - id := NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "name") + id := NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "createQueryKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewCreateQueryKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SearchServiceName'", id.SearchServiceName, "searchServiceName") } - if id.CreateQueryKeyName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CreateQueryKeyName'", id.CreateQueryKeyName, "name") + if id.CreateQueryKeyName != "createQueryKeyName" { + t.Fatalf("Expected %q but got %q for Segment 'CreateQueryKeyName'", id.CreateQueryKeyName, "createQueryKeyName") } } func TestFormatCreateQueryKeyID(t *testing.T) { - actual := NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name" + actual := NewCreateQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "createQueryKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseCreateQueryKeyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName", Expected: &CreateQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SearchServiceName: "searchServiceName", - CreateQueryKeyName: "name", + CreateQueryKeyName: "createQueryKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseCreateQueryKeyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName", Expected: &CreateQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SearchServiceName: "searchServiceName", - CreateQueryKeyName: "name", + CreateQueryKeyName: "createQueryKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/createQueryKey/createQueryKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/cReAtEqUeRyKeY/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/cReAtEqUeRyKeY/cReAtEqUeRyKeYnAmE", Expected: &CreateQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SearchServiceName: "sEaRcHsErViCeNaMe", - CreateQueryKeyName: "nAmE", + CreateQueryKeyName: "cReAtEqUeRyKeYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/cReAtEqUeRyKeY/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/cReAtEqUeRyKeY/cReAtEqUeRyKeYnAmE/extra", Error: true, }, } diff --git a/resource-manager/search/2023-11-01/querykeys/id_deletequerykey.go b/resource-manager/search/2023-11-01/querykeys/id_deletequerykey.go index bdedadae458..2d538c92b2e 100644 --- a/resource-manager/search/2023-11-01/querykeys/id_deletequerykey.go +++ b/resource-manager/search/2023-11-01/querykeys/id_deletequerykey.go @@ -123,7 +123,7 @@ func (id DeleteQueryKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSearchServices", "searchServices", "searchServices"), resourceids.UserSpecifiedSegment("searchServiceName", "searchServiceName"), resourceids.StaticSegment("staticDeleteQueryKey", "deleteQueryKey", "deleteQueryKey"), - resourceids.UserSpecifiedSegment("deleteQueryKeyName", "key"), + resourceids.UserSpecifiedSegment("deleteQueryKeyName", "deleteQueryKeyName"), } } diff --git a/resource-manager/search/2023-11-01/querykeys/id_deletequerykey_test.go b/resource-manager/search/2023-11-01/querykeys/id_deletequerykey_test.go index aafee8d60f2..a52be96e5e7 100644 --- a/resource-manager/search/2023-11-01/querykeys/id_deletequerykey_test.go +++ b/resource-manager/search/2023-11-01/querykeys/id_deletequerykey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeleteQueryKeyId{} func TestNewDeleteQueryKeyID(t *testing.T) { - id := NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "key") + id := NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "deleteQueryKeyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDeleteQueryKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SearchServiceName'", id.SearchServiceName, "searchServiceName") } - if id.DeleteQueryKeyName != "key" { - t.Fatalf("Expected %q but got %q for Segment 'DeleteQueryKeyName'", id.DeleteQueryKeyName, "key") + if id.DeleteQueryKeyName != "deleteQueryKeyName" { + t.Fatalf("Expected %q but got %q for Segment 'DeleteQueryKeyName'", id.DeleteQueryKeyName, "deleteQueryKeyName") } } func TestFormatDeleteQueryKeyID(t *testing.T) { - actual := NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "key").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key" + actual := NewDeleteQueryKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "searchServiceName", "deleteQueryKeyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDeleteQueryKeyID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName", Expected: &DeleteQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SearchServiceName: "searchServiceName", - DeleteQueryKeyName: "key", + DeleteQueryKeyName: "deleteQueryKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDeleteQueryKeyIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName", Expected: &DeleteQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SearchServiceName: "searchServiceName", - DeleteQueryKeyName: "key", + DeleteQueryKeyName: "deleteQueryKeyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/key/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Search/searchServices/searchServiceName/deleteQueryKey/deleteQueryKeyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/dElEtEqUeRyKeY/kEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/dElEtEqUeRyKeY/dElEtEqUeRyKeYnAmE", Expected: &DeleteQueryKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SearchServiceName: "sEaRcHsErViCeNaMe", - DeleteQueryKeyName: "kEy", + DeleteQueryKeyName: "dElEtEqUeRyKeYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/dElEtEqUeRyKeY/kEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEaRcH/sEaRcHsErViCeS/sEaRcHsErViCeNaMe/dElEtEqUeRyKeY/dElEtEqUeRyKeYnAmE/extra", Error: true, }, } diff --git a/resource-manager/search/2023-11-01/usages/README.md b/resource-manager/search/2023-11-01/usages/README.md index 1377ed346d4..1ad6b5aa8b1 100644 --- a/resource-manager/search/2023-11-01/usages/README.md +++ b/resource-manager/search/2023-11-01/usages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListBySubscription(ctx, id, usages.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination items, err := client.ListBySubscriptionComplete(ctx, id, usages.DefaultListBySubscriptionOperationOptions()) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := usages.NewUsageID("12345678-1234-9876-4563-123456789012", "location", "skuName") +id := usages.NewUsageID("12345678-1234-9876-4563-123456789012", "locationName", "usageName") read, err := client.UsageBySubscriptionSku(ctx, id, usages.DefaultUsageBySubscriptionSkuOperationOptions()) if err != nil { diff --git a/resource-manager/search/2023-11-01/usages/id_location.go b/resource-manager/search/2023-11-01/usages/id_location.go index 836fb3be9ad..9c965faf9c6 100644 --- a/resource-manager/search/2023-11-01/usages/id_location.go +++ b/resource-manager/search/2023-11-01/usages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSearch", "Microsoft.Search", "Microsoft.Search"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/search/2023-11-01/usages/id_location_test.go b/resource-manager/search/2023-11-01/usages/id_location_test.go index a1e3baa4218..9542fbf99e2 100644 --- a/resource-manager/search/2023-11-01/usages/id_location_test.go +++ b/resource-manager/search/2023-11-01/usages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/search/2023-11-01/usages/id_usage.go b/resource-manager/search/2023-11-01/usages/id_usage.go index 2b5548008e2..b4a582125ed 100644 --- a/resource-manager/search/2023-11-01/usages/id_usage.go +++ b/resource-manager/search/2023-11-01/usages/id_usage.go @@ -113,9 +113,9 @@ func (id UsageId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSearch", "Microsoft.Search", "Microsoft.Search"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticUsages", "usages", "usages"), - resourceids.UserSpecifiedSegment("usageName", "skuName"), + resourceids.UserSpecifiedSegment("usageName", "usageName"), } } diff --git a/resource-manager/search/2023-11-01/usages/id_usage_test.go b/resource-manager/search/2023-11-01/usages/id_usage_test.go index 36e2dd4c66c..1b38f124b7f 100644 --- a/resource-manager/search/2023-11-01/usages/id_usage_test.go +++ b/resource-manager/search/2023-11-01/usages/id_usage_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &UsageId{} func TestNewUsageID(t *testing.T) { - id := NewUsageID("12345678-1234-9876-4563-123456789012", "location", "skuName") + id := NewUsageID("12345678-1234-9876-4563-123456789012", "locationName", "usageName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.UsageName != "skuName" { - t.Fatalf("Expected %q but got %q for Segment 'UsageName'", id.UsageName, "skuName") + if id.UsageName != "usageName" { + t.Fatalf("Expected %q but got %q for Segment 'UsageName'", id.UsageName, "usageName") } } func TestFormatUsageID(t *testing.T) { - actual := NewUsageID("12345678-1234-9876-4563-123456789012", "location", "skuName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/usages/skuName" + actual := NewUsageID("12345678-1234-9876-4563-123456789012", "locationName", "usageName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/usages/usageName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseUsageID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/usages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/usages", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/usages/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/usages/usageName", Expected: &UsageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - UsageName: "skuName", + LocationName: "locationName", + UsageName: "usageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/usages/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/usages/usageName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseUsageIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/usages", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/usages", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoN/uSaGeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoNnAmE/uSaGeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/usages/skuName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/usages/usageName", Expected: &UsageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - UsageName: "skuName", + LocationName: "locationName", + UsageName: "usageName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/location/usages/skuName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Search/locations/locationName/usages/usageName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoN/uSaGeS/sKuNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoNnAmE/uSaGeS/uSaGeNaMe", Expected: &UsageId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - UsageName: "sKuNaMe", + LocationName: "lOcAtIoNnAmE", + UsageName: "uSaGeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoN/uSaGeS/sKuNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEaRcH/lOcAtIoNs/lOcAtIoNnAmE/uSaGeS/uSaGeNaMe/extra", Error: true, }, } diff --git a/resource-manager/security/2019-01-01-preview/assessments/model_azureresourcedetails.go b/resource-manager/security/2019-01-01-preview/assessments/model_azureresourcedetails.go new file mode 100644 index 00000000000..d6db9b0b6f4 --- /dev/null +++ b/resource-manager/security/2019-01-01-preview/assessments/model_azureresourcedetails.go @@ -0,0 +1,50 @@ +package assessments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ResourceDetails = AzureResourceDetails{} + +type AzureResourceDetails struct { + Id *string `json:"id,omitempty"` + + // Fields inherited from ResourceDetails + + Source Source `json:"source"` +} + +func (s AzureResourceDetails) ResourceDetails() BaseResourceDetailsImpl { + return BaseResourceDetailsImpl{ + Source: s.Source, + } +} + +var _ json.Marshaler = AzureResourceDetails{} + +func (s AzureResourceDetails) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceDetails: %+v", err) + } + + decoded["source"] = "Azure" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/security/2019-01-01-preview/assessments/model_onpremiseresourcedetails.go b/resource-manager/security/2019-01-01-preview/assessments/model_onpremiseresourcedetails.go new file mode 100644 index 00000000000..e76d5ed33d8 --- /dev/null +++ b/resource-manager/security/2019-01-01-preview/assessments/model_onpremiseresourcedetails.go @@ -0,0 +1,53 @@ +package assessments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ResourceDetails = OnPremiseResourceDetails{} + +type OnPremiseResourceDetails struct { + MachineName string `json:"machineName"` + SourceComputerId string `json:"sourceComputerId"` + VMuuid string `json:"vmuuid"` + WorkspaceId string `json:"workspaceId"` + + // Fields inherited from ResourceDetails + + Source Source `json:"source"` +} + +func (s OnPremiseResourceDetails) ResourceDetails() BaseResourceDetailsImpl { + return BaseResourceDetailsImpl{ + Source: s.Source, + } +} + +var _ json.Marshaler = OnPremiseResourceDetails{} + +func (s OnPremiseResourceDetails) MarshalJSON() ([]byte, error) { + type wrapper OnPremiseResourceDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OnPremiseResourceDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OnPremiseResourceDetails: %+v", err) + } + + decoded["source"] = "OnPremise" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OnPremiseResourceDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/security/2019-01-01-preview/assessments/model_resourcedetails.go b/resource-manager/security/2019-01-01-preview/assessments/model_resourcedetails.go index a8add9e8a4f..5e2fc2f752e 100644 --- a/resource-manager/security/2019-01-01-preview/assessments/model_resourcedetails.go +++ b/resource-manager/security/2019-01-01-preview/assessments/model_resourcedetails.go @@ -1,8 +1,83 @@ package assessments +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ResourceDetails struct { +type ResourceDetails interface { + ResourceDetails() BaseResourceDetailsImpl +} + +var _ ResourceDetails = BaseResourceDetailsImpl{} + +type BaseResourceDetailsImpl struct { Source Source `json:"source"` } + +func (s BaseResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl { + return s +} + +var _ ResourceDetails = RawResourceDetailsImpl{} + +// RawResourceDetailsImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawResourceDetailsImpl struct { + resourceDetails BaseResourceDetailsImpl + Type string + Values map[string]interface{} +} + +func (s RawResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl { + return s.resourceDetails +} + +func UnmarshalResourceDetailsImplementation(input []byte) (ResourceDetails, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ResourceDetails into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["source"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Azure") { + var out AzureResourceDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceDetails: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OnPremise") { + var out OnPremiseResourceDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OnPremiseResourceDetails: %+v", err) + } + return out, nil + } + + var parent BaseResourceDetailsImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseResourceDetailsImpl: %+v", err) + } + + return RawResourceDetailsImpl{ + resourceDetails: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/security/2019-01-01-preview/assessments/model_securityassessmentproperties.go b/resource-manager/security/2019-01-01-preview/assessments/model_securityassessmentproperties.go index 1fe4f7b85c8..7d763f1b4fd 100644 --- a/resource-manager/security/2019-01-01-preview/assessments/model_securityassessmentproperties.go +++ b/resource-manager/security/2019-01-01-preview/assessments/model_securityassessmentproperties.go @@ -1,5 +1,10 @@ package assessments +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -10,3 +15,37 @@ type SecurityAssessmentProperties struct { ResourceDetails ResourceDetails `json:"resourceDetails"` Status AssessmentStatus `json:"status"` } + +var _ json.Unmarshaler = &SecurityAssessmentProperties{} + +func (s *SecurityAssessmentProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AdditionalData *map[string]string `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Links *AssessmentLinks `json:"links,omitempty"` + Status AssessmentStatus `json:"status"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AdditionalData = decoded.AdditionalData + s.DisplayName = decoded.DisplayName + s.Links = decoded.Links + s.Status = decoded.Status + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SecurityAssessmentProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["resourceDetails"]; ok { + impl, err := UnmarshalResourceDetailsImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ResourceDetails' for 'SecurityAssessmentProperties': %+v", err) + } + s.ResourceDetails = impl + } + + return nil +} diff --git a/resource-manager/security/2019-01-01-preview/subassessments/model_azureresourcedetails.go b/resource-manager/security/2019-01-01-preview/subassessments/model_azureresourcedetails.go new file mode 100644 index 00000000000..f6bc2b306e3 --- /dev/null +++ b/resource-manager/security/2019-01-01-preview/subassessments/model_azureresourcedetails.go @@ -0,0 +1,50 @@ +package subassessments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ResourceDetails = AzureResourceDetails{} + +type AzureResourceDetails struct { + Id *string `json:"id,omitempty"` + + // Fields inherited from ResourceDetails + + Source Source `json:"source"` +} + +func (s AzureResourceDetails) ResourceDetails() BaseResourceDetailsImpl { + return BaseResourceDetailsImpl{ + Source: s.Source, + } +} + +var _ json.Marshaler = AzureResourceDetails{} + +func (s AzureResourceDetails) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceDetails: %+v", err) + } + + decoded["source"] = "Azure" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/security/2019-01-01-preview/subassessments/model_onpremiseresourcedetails.go b/resource-manager/security/2019-01-01-preview/subassessments/model_onpremiseresourcedetails.go new file mode 100644 index 00000000000..816537842c0 --- /dev/null +++ b/resource-manager/security/2019-01-01-preview/subassessments/model_onpremiseresourcedetails.go @@ -0,0 +1,53 @@ +package subassessments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ResourceDetails = OnPremiseResourceDetails{} + +type OnPremiseResourceDetails struct { + MachineName string `json:"machineName"` + SourceComputerId string `json:"sourceComputerId"` + VMuuid string `json:"vmuuid"` + WorkspaceId string `json:"workspaceId"` + + // Fields inherited from ResourceDetails + + Source Source `json:"source"` +} + +func (s OnPremiseResourceDetails) ResourceDetails() BaseResourceDetailsImpl { + return BaseResourceDetailsImpl{ + Source: s.Source, + } +} + +var _ json.Marshaler = OnPremiseResourceDetails{} + +func (s OnPremiseResourceDetails) MarshalJSON() ([]byte, error) { + type wrapper OnPremiseResourceDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OnPremiseResourceDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OnPremiseResourceDetails: %+v", err) + } + + decoded["source"] = "OnPremise" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OnPremiseResourceDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/security/2019-01-01-preview/subassessments/model_resourcedetails.go b/resource-manager/security/2019-01-01-preview/subassessments/model_resourcedetails.go index c894222939a..33489b55a37 100644 --- a/resource-manager/security/2019-01-01-preview/subassessments/model_resourcedetails.go +++ b/resource-manager/security/2019-01-01-preview/subassessments/model_resourcedetails.go @@ -1,8 +1,83 @@ package subassessments +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ResourceDetails struct { +type ResourceDetails interface { + ResourceDetails() BaseResourceDetailsImpl +} + +var _ ResourceDetails = BaseResourceDetailsImpl{} + +type BaseResourceDetailsImpl struct { Source Source `json:"source"` } + +func (s BaseResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl { + return s +} + +var _ ResourceDetails = RawResourceDetailsImpl{} + +// RawResourceDetailsImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawResourceDetailsImpl struct { + resourceDetails BaseResourceDetailsImpl + Type string + Values map[string]interface{} +} + +func (s RawResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl { + return s.resourceDetails +} + +func UnmarshalResourceDetailsImplementation(input []byte) (ResourceDetails, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ResourceDetails into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["source"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Azure") { + var out AzureResourceDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceDetails: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OnPremise") { + var out OnPremiseResourceDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OnPremiseResourceDetails: %+v", err) + } + return out, nil + } + + var parent BaseResourceDetailsImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseResourceDetailsImpl: %+v", err) + } + + return RawResourceDetailsImpl{ + resourceDetails: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/security/2019-01-01-preview/subassessments/model_securitysubassessmentproperties.go b/resource-manager/security/2019-01-01-preview/subassessments/model_securitysubassessmentproperties.go index 20d122a5a23..79d3edb5ede 100644 --- a/resource-manager/security/2019-01-01-preview/subassessments/model_securitysubassessmentproperties.go +++ b/resource-manager/security/2019-01-01-preview/subassessments/model_securitysubassessmentproperties.go @@ -19,7 +19,7 @@ type SecuritySubAssessmentProperties struct { Id *string `json:"id,omitempty"` Impact *string `json:"impact,omitempty"` Remediation *string `json:"remediation,omitempty"` - ResourceDetails *ResourceDetails `json:"resourceDetails,omitempty"` + ResourceDetails ResourceDetails `json:"resourceDetails"` Status *SubAssessmentStatus `json:"status,omitempty"` TimeGenerated *string `json:"timeGenerated,omitempty"` } @@ -40,15 +40,14 @@ var _ json.Unmarshaler = &SecuritySubAssessmentProperties{} func (s *SecuritySubAssessmentProperties) UnmarshalJSON(bytes []byte) error { var decoded struct { - Category *string `json:"category,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Id *string `json:"id,omitempty"` - Impact *string `json:"impact,omitempty"` - Remediation *string `json:"remediation,omitempty"` - ResourceDetails *ResourceDetails `json:"resourceDetails,omitempty"` - Status *SubAssessmentStatus `json:"status,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` + Category *string `json:"category,omitempty"` + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Id *string `json:"id,omitempty"` + Impact *string `json:"impact,omitempty"` + Remediation *string `json:"remediation,omitempty"` + Status *SubAssessmentStatus `json:"status,omitempty"` + TimeGenerated *string `json:"timeGenerated,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -60,7 +59,6 @@ func (s *SecuritySubAssessmentProperties) UnmarshalJSON(bytes []byte) error { s.Id = decoded.Id s.Impact = decoded.Impact s.Remediation = decoded.Remediation - s.ResourceDetails = decoded.ResourceDetails s.Status = decoded.Status s.TimeGenerated = decoded.TimeGenerated @@ -77,5 +75,13 @@ func (s *SecuritySubAssessmentProperties) UnmarshalJSON(bytes []byte) error { s.AdditionalData = impl } + if v, ok := temp["resourceDetails"]; ok { + impl, err := UnmarshalResourceDetailsImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ResourceDetails' for 'SecuritySubAssessmentProperties': %+v", err) + } + s.ResourceDetails = impl + } + return nil } diff --git a/resource-manager/security/2020-01-01/alerts/README.md b/resource-manager/security/2020-01-01/alerts/README.md index c2861245cca..916b5ed7b89 100644 --- a/resource-manager/security/2020-01-01/alerts/README.md +++ b/resource-manager/security/2020-01-01/alerts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "alertName") +id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "alertName") read, err := client.GetResourceGroupLevelAlerts(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "ascLocation", "alertName") +id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "locationName", "alertName") read, err := client.GetSubscriptionLevelAlert(ctx, id) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := alerts.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation") +id := alerts.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListResourceGroupLevelAlertsByRegion(ctx, id)` can be used to do batched pagination items, err := client.ListResourceGroupLevelAlertsByRegionComplete(ctx, id) @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := alerts.NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") +id := alerts.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListSubscriptionLevelAlertsByRegion(ctx, id)` can be used to do batched pagination items, err := client.ListSubscriptionLevelAlertsByRegionComplete(ctx, id) @@ -125,7 +125,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "alertName") +id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "alertName") read, err := client.UpdateResourceGroupLevelAlertStateToDismiss(ctx, id) if err != nil { @@ -141,7 +141,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "alertName") +id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "alertName") read, err := client.UpdateResourceGroupLevelAlertStateToReactivate(ctx, id) if err != nil { @@ -157,7 +157,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "alertName") +id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "alertName") read, err := client.UpdateResourceGroupLevelStateToResolve(ctx, id) if err != nil { @@ -173,7 +173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "ascLocation", "alertName") +id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "locationName", "alertName") read, err := client.UpdateSubscriptionLevelAlertStateToDismiss(ctx, id) if err != nil { @@ -189,7 +189,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "ascLocation", "alertName") +id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "locationName", "alertName") read, err := client.UpdateSubscriptionLevelAlertStateToReactivate(ctx, id) if err != nil { @@ -205,7 +205,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "ascLocation", "alertName") +id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "locationName", "alertName") read, err := client.UpdateSubscriptionLevelStateToResolve(ctx, id) if err != nil { diff --git a/resource-manager/security/2020-01-01/alerts/id_alert.go b/resource-manager/security/2020-01-01/alerts/id_alert.go index 3651bf82c5f..ce3269b6c3e 100644 --- a/resource-manager/security/2020-01-01/alerts/id_alert.go +++ b/resource-manager/security/2020-01-01/alerts/id_alert.go @@ -113,7 +113,7 @@ func (id AlertId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticAlerts", "alerts", "alerts"), resourceids.UserSpecifiedSegment("alertName", "alertName"), } diff --git a/resource-manager/security/2020-01-01/alerts/id_alert_test.go b/resource-manager/security/2020-01-01/alerts/id_alert_test.go index 54315f09da9..88ca14958be 100644 --- a/resource-manager/security/2020-01-01/alerts/id_alert_test.go +++ b/resource-manager/security/2020-01-01/alerts/id_alert_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &AlertId{} func TestNewAlertID(t *testing.T) { - id := NewAlertID("12345678-1234-9876-4563-123456789012", "ascLocation", "alertName") + id := NewAlertID("12345678-1234-9876-4563-123456789012", "locationName", "alertName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.AlertName != "alertName" { @@ -28,8 +28,8 @@ func TestNewAlertID(t *testing.T) { } func TestFormatAlertID(t *testing.T) { - actual := NewAlertID("12345678-1234-9876-4563-123456789012", "ascLocation", "alertName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/alerts/alertName" + actual := NewAlertID("12345678-1234-9876-4563-123456789012", "locationName", "alertName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/alerts/alertName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseAlertID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/alerts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/alerts/alertName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/alerts/alertName", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/alerts/alertName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/alerts/alertName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseAlertIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/alerts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLeRtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLeRtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/alerts/alertName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/alerts/alertName", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/alerts/alertName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/alerts/alertName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLeRtS/aLeRtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLeRtS/aLeRtNaMe", Expected: &AlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", AlertName: "aLeRtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLeRtS/aLeRtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLeRtS/aLeRtNaMe/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/alerts/id_location.go b/resource-manager/security/2020-01-01/alerts/id_location.go index 8065f5bcb92..eb9b8da5082 100644 --- a/resource-manager/security/2020-01-01/alerts/id_location.go +++ b/resource-manager/security/2020-01-01/alerts/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/alerts/id_location_test.go b/resource-manager/security/2020-01-01/alerts/id_location_test.go index b79318791d5..91e8d6b57e8 100644 --- a/resource-manager/security/2020-01-01/alerts/id_location_test.go +++ b/resource-manager/security/2020-01-01/alerts/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/alerts/id_locationalert.go b/resource-manager/security/2020-01-01/alerts/id_locationalert.go index 45c20b74e16..79e67a4a134 100644 --- a/resource-manager/security/2020-01-01/alerts/id_locationalert.go +++ b/resource-manager/security/2020-01-01/alerts/id_locationalert.go @@ -121,7 +121,7 @@ func (id LocationAlertId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticAlerts", "alerts", "alerts"), resourceids.UserSpecifiedSegment("alertName", "alertName"), } diff --git a/resource-manager/security/2020-01-01/alerts/id_locationalert_test.go b/resource-manager/security/2020-01-01/alerts/id_locationalert_test.go index 04681b90ecf..371f3961c7c 100644 --- a/resource-manager/security/2020-01-01/alerts/id_locationalert_test.go +++ b/resource-manager/security/2020-01-01/alerts/id_locationalert_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocationAlertId{} func TestNewLocationAlertID(t *testing.T) { - id := NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "alertName") + id := NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "alertName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewLocationAlertID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.AlertName != "alertName" { @@ -32,8 +32,8 @@ func TestNewLocationAlertID(t *testing.T) { } func TestFormatLocationAlertID(t *testing.T) { - actual := NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "alertName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/alerts/alertName" + actual := NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "alertName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/alerts/alertName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLocationAlertID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/alerts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/alerts/alertName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/alerts/alertName", Expected: &LocationAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/alerts/alertName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/alerts/alertName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLocationAlertIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/alerts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/alerts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLeRtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLeRtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/alerts/alertName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/alerts/alertName", Expected: &LocationAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", AlertName: "alertName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/alerts/alertName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/alerts/alertName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLeRtS/aLeRtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLeRtS/aLeRtNaMe", Expected: &LocationAlertId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", AlertName: "aLeRtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLeRtS/aLeRtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLeRtS/aLeRtNaMe/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/alerts/id_providerlocation.go b/resource-manager/security/2020-01-01/alerts/id_providerlocation.go index e15002b1d01..e57f9eb3d03 100644 --- a/resource-manager/security/2020-01-01/alerts/id_providerlocation.go +++ b/resource-manager/security/2020-01-01/alerts/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/alerts/id_providerlocation_test.go b/resource-manager/security/2020-01-01/alerts/id_providerlocation_test.go index f1bd6ab7fe3..1108836b2db 100644 --- a/resource-manager/security/2020-01-01/alerts/id_providerlocation_test.go +++ b/resource-manager/security/2020-01-01/alerts/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/allowedconnections/README.md b/resource-manager/security/2020-01-01/allowedconnections/README.md index 82e263573dd..dba80817c4f 100644 --- a/resource-manager/security/2020-01-01/allowedconnections/README.md +++ b/resource-manager/security/2020-01-01/allowedconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := allowedconnections.NewConnectionTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "External") +id := allowedconnections.NewConnectionTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "External") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := allowedconnections.NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") +id := allowedconnections.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByHomeRegion(ctx, id)` can be used to do batched pagination items, err := client.ListByHomeRegionComplete(ctx, id) diff --git a/resource-manager/security/2020-01-01/allowedconnections/id_connectiontype.go b/resource-manager/security/2020-01-01/allowedconnections/id_connectiontype.go index b8c7f439fa4..3f88f38bf0f 100644 --- a/resource-manager/security/2020-01-01/allowedconnections/id_connectiontype.go +++ b/resource-manager/security/2020-01-01/allowedconnections/id_connectiontype.go @@ -129,7 +129,7 @@ func (id ConnectionTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticAllowedConnections", "allowedConnections", "allowedConnections"), resourceids.ConstantSegment("connectionType", PossibleValuesForConnectionType(), "External"), } diff --git a/resource-manager/security/2020-01-01/allowedconnections/id_connectiontype_test.go b/resource-manager/security/2020-01-01/allowedconnections/id_connectiontype_test.go index 1486afb6cd9..4db3c559289 100644 --- a/resource-manager/security/2020-01-01/allowedconnections/id_connectiontype_test.go +++ b/resource-manager/security/2020-01-01/allowedconnections/id_connectiontype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionTypeId{} func TestNewConnectionTypeID(t *testing.T) { - id := NewConnectionTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "External") + id := NewConnectionTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "External") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConnectionTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.ConnectionType != "External" { @@ -32,8 +32,8 @@ func TestNewConnectionTypeID(t *testing.T) { } func TestFormatConnectionTypeID(t *testing.T) { - actual := NewConnectionTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "External").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/allowedConnections/External" + actual := NewConnectionTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "External").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/allowedConnections/External" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConnectionTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/allowedConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/allowedConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/allowedConnections/External", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/allowedConnections/External", Expected: &ConnectionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", ConnectionType: "External", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/allowedConnections/External/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/allowedConnections/External/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConnectionTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/allowedConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/allowedConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLlOwEdCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLlOwEdCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/allowedConnections/External", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/allowedConnections/External", Expected: &ConnectionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", ConnectionType: "External", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/allowedConnections/External/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/allowedConnections/External/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLlOwEdCoNnEcTiOnS/eXtErNaL", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLlOwEdCoNnEcTiOnS/eXtErNaL", Expected: &ConnectionTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", ConnectionType: "External", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/aLlOwEdCoNnEcTiOnS/eXtErNaL/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/aLlOwEdCoNnEcTiOnS/eXtErNaL/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/allowedconnections/id_location.go b/resource-manager/security/2020-01-01/allowedconnections/id_location.go index fad299e40af..c59e72a3814 100644 --- a/resource-manager/security/2020-01-01/allowedconnections/id_location.go +++ b/resource-manager/security/2020-01-01/allowedconnections/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/allowedconnections/id_location_test.go b/resource-manager/security/2020-01-01/allowedconnections/id_location_test.go index fa6899003bd..9c16f1a904f 100644 --- a/resource-manager/security/2020-01-01/allowedconnections/id_location_test.go +++ b/resource-manager/security/2020-01-01/allowedconnections/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/assessments/model_azureresourcedetails.go b/resource-manager/security/2020-01-01/assessments/model_azureresourcedetails.go new file mode 100644 index 00000000000..d6db9b0b6f4 --- /dev/null +++ b/resource-manager/security/2020-01-01/assessments/model_azureresourcedetails.go @@ -0,0 +1,50 @@ +package assessments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ResourceDetails = AzureResourceDetails{} + +type AzureResourceDetails struct { + Id *string `json:"id,omitempty"` + + // Fields inherited from ResourceDetails + + Source Source `json:"source"` +} + +func (s AzureResourceDetails) ResourceDetails() BaseResourceDetailsImpl { + return BaseResourceDetailsImpl{ + Source: s.Source, + } +} + +var _ json.Marshaler = AzureResourceDetails{} + +func (s AzureResourceDetails) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceDetails: %+v", err) + } + + decoded["source"] = "Azure" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/security/2020-01-01/assessments/model_onpremiseresourcedetails.go b/resource-manager/security/2020-01-01/assessments/model_onpremiseresourcedetails.go new file mode 100644 index 00000000000..e76d5ed33d8 --- /dev/null +++ b/resource-manager/security/2020-01-01/assessments/model_onpremiseresourcedetails.go @@ -0,0 +1,53 @@ +package assessments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ResourceDetails = OnPremiseResourceDetails{} + +type OnPremiseResourceDetails struct { + MachineName string `json:"machineName"` + SourceComputerId string `json:"sourceComputerId"` + VMuuid string `json:"vmuuid"` + WorkspaceId string `json:"workspaceId"` + + // Fields inherited from ResourceDetails + + Source Source `json:"source"` +} + +func (s OnPremiseResourceDetails) ResourceDetails() BaseResourceDetailsImpl { + return BaseResourceDetailsImpl{ + Source: s.Source, + } +} + +var _ json.Marshaler = OnPremiseResourceDetails{} + +func (s OnPremiseResourceDetails) MarshalJSON() ([]byte, error) { + type wrapper OnPremiseResourceDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OnPremiseResourceDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OnPremiseResourceDetails: %+v", err) + } + + decoded["source"] = "OnPremise" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OnPremiseResourceDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/security/2020-01-01/assessments/model_resourcedetails.go b/resource-manager/security/2020-01-01/assessments/model_resourcedetails.go index a8add9e8a4f..5e2fc2f752e 100644 --- a/resource-manager/security/2020-01-01/assessments/model_resourcedetails.go +++ b/resource-manager/security/2020-01-01/assessments/model_resourcedetails.go @@ -1,8 +1,83 @@ package assessments +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ResourceDetails struct { +type ResourceDetails interface { + ResourceDetails() BaseResourceDetailsImpl +} + +var _ ResourceDetails = BaseResourceDetailsImpl{} + +type BaseResourceDetailsImpl struct { Source Source `json:"source"` } + +func (s BaseResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl { + return s +} + +var _ ResourceDetails = RawResourceDetailsImpl{} + +// RawResourceDetailsImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawResourceDetailsImpl struct { + resourceDetails BaseResourceDetailsImpl + Type string + Values map[string]interface{} +} + +func (s RawResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl { + return s.resourceDetails +} + +func UnmarshalResourceDetailsImplementation(input []byte) (ResourceDetails, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ResourceDetails into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["source"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Azure") { + var out AzureResourceDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceDetails: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OnPremise") { + var out OnPremiseResourceDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OnPremiseResourceDetails: %+v", err) + } + return out, nil + } + + var parent BaseResourceDetailsImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseResourceDetailsImpl: %+v", err) + } + + return RawResourceDetailsImpl{ + resourceDetails: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/security/2020-01-01/assessments/model_securityassessmentproperties.go b/resource-manager/security/2020-01-01/assessments/model_securityassessmentproperties.go index f9a99b8a643..2684da7a90f 100644 --- a/resource-manager/security/2020-01-01/assessments/model_securityassessmentproperties.go +++ b/resource-manager/security/2020-01-01/assessments/model_securityassessmentproperties.go @@ -1,5 +1,10 @@ package assessments +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -12,3 +17,41 @@ type SecurityAssessmentProperties struct { ResourceDetails ResourceDetails `json:"resourceDetails"` Status AssessmentStatus `json:"status"` } + +var _ json.Unmarshaler = &SecurityAssessmentProperties{} + +func (s *SecurityAssessmentProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AdditionalData *map[string]string `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Links *AssessmentLinks `json:"links,omitempty"` + Metadata *SecurityAssessmentMetadataProperties `json:"metadata,omitempty"` + PartnersData *SecurityAssessmentPartnerData `json:"partnersData,omitempty"` + Status AssessmentStatus `json:"status"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AdditionalData = decoded.AdditionalData + s.DisplayName = decoded.DisplayName + s.Links = decoded.Links + s.Metadata = decoded.Metadata + s.PartnersData = decoded.PartnersData + s.Status = decoded.Status + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SecurityAssessmentProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["resourceDetails"]; ok { + impl, err := UnmarshalResourceDetailsImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ResourceDetails' for 'SecurityAssessmentProperties': %+v", err) + } + s.ResourceDetails = impl + } + + return nil +} diff --git a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/README.md b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/README.md index 08bf2be9782..182a5f3a422 100644 --- a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/README.md +++ b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := discoveredsecuritysolutions.NewDiscoveredSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "discoveredSecuritySolutionName") +id := discoveredsecuritysolutions.NewDiscoveredSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "discoveredSecuritySolutionName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := discoveredsecuritysolutions.NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") +id := discoveredsecuritysolutions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByHomeRegion(ctx, id)` can be used to do batched pagination items, err := client.ListByHomeRegionComplete(ctx, id) diff --git a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_discoveredsecuritysolution.go b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_discoveredsecuritysolution.go index 42d42f0f925..ace030a8bfc 100644 --- a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_discoveredsecuritysolution.go +++ b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_discoveredsecuritysolution.go @@ -121,7 +121,7 @@ func (id DiscoveredSecuritySolutionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDiscoveredSecuritySolutions", "discoveredSecuritySolutions", "discoveredSecuritySolutions"), resourceids.UserSpecifiedSegment("discoveredSecuritySolutionName", "discoveredSecuritySolutionName"), } diff --git a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_discoveredsecuritysolution_test.go b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_discoveredsecuritysolution_test.go index 4b5274f4e45..14c15d3f153 100644 --- a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_discoveredsecuritysolution_test.go +++ b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_discoveredsecuritysolution_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiscoveredSecuritySolutionId{} func TestNewDiscoveredSecuritySolutionID(t *testing.T) { - id := NewDiscoveredSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "discoveredSecuritySolutionName") + id := NewDiscoveredSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "discoveredSecuritySolutionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDiscoveredSecuritySolutionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.DiscoveredSecuritySolutionName != "discoveredSecuritySolutionName" { @@ -32,8 +32,8 @@ func TestNewDiscoveredSecuritySolutionID(t *testing.T) { } func TestFormatDiscoveredSecuritySolutionID(t *testing.T) { - actual := NewDiscoveredSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "discoveredSecuritySolutionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/discoveredSecuritySolutions/discoveredSecuritySolutionName" + actual := NewDiscoveredSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "discoveredSecuritySolutionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/discoveredSecuritySolutions/discoveredSecuritySolutionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDiscoveredSecuritySolutionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/discoveredSecuritySolutions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/discoveredSecuritySolutions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/discoveredSecuritySolutions/discoveredSecuritySolutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/discoveredSecuritySolutions/discoveredSecuritySolutionName", Expected: &DiscoveredSecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", DiscoveredSecuritySolutionName: "discoveredSecuritySolutionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/discoveredSecuritySolutions/discoveredSecuritySolutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/discoveredSecuritySolutions/discoveredSecuritySolutionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDiscoveredSecuritySolutionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/discoveredSecuritySolutions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/discoveredSecuritySolutions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/dIsCoVeReDsEcUrItYsOlUtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/dIsCoVeReDsEcUrItYsOlUtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/discoveredSecuritySolutions/discoveredSecuritySolutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/discoveredSecuritySolutions/discoveredSecuritySolutionName", Expected: &DiscoveredSecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", DiscoveredSecuritySolutionName: "discoveredSecuritySolutionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/discoveredSecuritySolutions/discoveredSecuritySolutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/discoveredSecuritySolutions/discoveredSecuritySolutionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/dIsCoVeReDsEcUrItYsOlUtIoNs/dIsCoVeReDsEcUrItYsOlUtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/dIsCoVeReDsEcUrItYsOlUtIoNs/dIsCoVeReDsEcUrItYsOlUtIoNnAmE", Expected: &DiscoveredSecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", DiscoveredSecuritySolutionName: "dIsCoVeReDsEcUrItYsOlUtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/dIsCoVeReDsEcUrItYsOlUtIoNs/dIsCoVeReDsEcUrItYsOlUtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/dIsCoVeReDsEcUrItYsOlUtIoNs/dIsCoVeReDsEcUrItYsOlUtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_location.go b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_location.go index 1849d2d33ad..aea2ac570dc 100644 --- a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_location.go +++ b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_location_test.go b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_location_test.go index 4e4d174b6d2..e906e38e3d9 100644 --- a/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_location_test.go +++ b/resource-manager/security/2020-01-01/discoveredsecuritysolutions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/externalsecuritysolutions/README.md b/resource-manager/security/2020-01-01/externalsecuritysolutions/README.md index 4d437d2be46..d15288eb1b6 100644 --- a/resource-manager/security/2020-01-01/externalsecuritysolutions/README.md +++ b/resource-manager/security/2020-01-01/externalsecuritysolutions/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := externalsecuritysolutions.NewExternalSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "externalSecuritySolutionsName") +id := externalsecuritysolutions.NewExternalSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "externalSecuritySolutionName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := externalsecuritysolutions.NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") +id := externalsecuritysolutions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByHomeRegion(ctx, id)` can be used to do batched pagination items, err := client.ListByHomeRegionComplete(ctx, id) diff --git a/resource-manager/security/2020-01-01/externalsecuritysolutions/id_externalsecuritysolution.go b/resource-manager/security/2020-01-01/externalsecuritysolutions/id_externalsecuritysolution.go index 9377abe0df9..178f8f34fd8 100644 --- a/resource-manager/security/2020-01-01/externalsecuritysolutions/id_externalsecuritysolution.go +++ b/resource-manager/security/2020-01-01/externalsecuritysolutions/id_externalsecuritysolution.go @@ -121,9 +121,9 @@ func (id ExternalSecuritySolutionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticExternalSecuritySolutions", "externalSecuritySolutions", "externalSecuritySolutions"), - resourceids.UserSpecifiedSegment("externalSecuritySolutionName", "externalSecuritySolutionsName"), + resourceids.UserSpecifiedSegment("externalSecuritySolutionName", "externalSecuritySolutionName"), } } diff --git a/resource-manager/security/2020-01-01/externalsecuritysolutions/id_externalsecuritysolution_test.go b/resource-manager/security/2020-01-01/externalsecuritysolutions/id_externalsecuritysolution_test.go index f25d08405dc..b1ca585f2f4 100644 --- a/resource-manager/security/2020-01-01/externalsecuritysolutions/id_externalsecuritysolution_test.go +++ b/resource-manager/security/2020-01-01/externalsecuritysolutions/id_externalsecuritysolution_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ExternalSecuritySolutionId{} func TestNewExternalSecuritySolutionID(t *testing.T) { - id := NewExternalSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "externalSecuritySolutionsName") + id := NewExternalSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "externalSecuritySolutionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewExternalSecuritySolutionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ExternalSecuritySolutionName != "externalSecuritySolutionsName" { - t.Fatalf("Expected %q but got %q for Segment 'ExternalSecuritySolutionName'", id.ExternalSecuritySolutionName, "externalSecuritySolutionsName") + if id.ExternalSecuritySolutionName != "externalSecuritySolutionName" { + t.Fatalf("Expected %q but got %q for Segment 'ExternalSecuritySolutionName'", id.ExternalSecuritySolutionName, "externalSecuritySolutionName") } } func TestFormatExternalSecuritySolutionID(t *testing.T) { - actual := NewExternalSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "externalSecuritySolutionsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/externalSecuritySolutions/externalSecuritySolutionsName" + actual := NewExternalSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "externalSecuritySolutionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/externalSecuritySolutions/externalSecuritySolutionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseExternalSecuritySolutionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/externalSecuritySolutions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/externalSecuritySolutions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/externalSecuritySolutions/externalSecuritySolutionsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/externalSecuritySolutions/externalSecuritySolutionName", Expected: &ExternalSecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", - ExternalSecuritySolutionName: "externalSecuritySolutionsName", + LocationName: "locationName", + ExternalSecuritySolutionName: "externalSecuritySolutionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/externalSecuritySolutions/externalSecuritySolutionsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/externalSecuritySolutions/externalSecuritySolutionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseExternalSecuritySolutionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/externalSecuritySolutions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/externalSecuritySolutions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/eXtErNaLsEcUrItYsOlUtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/eXtErNaLsEcUrItYsOlUtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/externalSecuritySolutions/externalSecuritySolutionsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/externalSecuritySolutions/externalSecuritySolutionName", Expected: &ExternalSecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", - ExternalSecuritySolutionName: "externalSecuritySolutionsName", + LocationName: "locationName", + ExternalSecuritySolutionName: "externalSecuritySolutionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/externalSecuritySolutions/externalSecuritySolutionsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/externalSecuritySolutions/externalSecuritySolutionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/eXtErNaLsEcUrItYsOlUtIoNs/eXtErNaLsEcUrItYsOlUtIoNsNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/eXtErNaLsEcUrItYsOlUtIoNs/eXtErNaLsEcUrItYsOlUtIoNnAmE", Expected: &ExternalSecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", - ExternalSecuritySolutionName: "eXtErNaLsEcUrItYsOlUtIoNsNaMe", + LocationName: "lOcAtIoNnAmE", + ExternalSecuritySolutionName: "eXtErNaLsEcUrItYsOlUtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/eXtErNaLsEcUrItYsOlUtIoNs/eXtErNaLsEcUrItYsOlUtIoNsNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/eXtErNaLsEcUrItYsOlUtIoNs/eXtErNaLsEcUrItYsOlUtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/externalsecuritysolutions/id_location.go b/resource-manager/security/2020-01-01/externalsecuritysolutions/id_location.go index 807acfbcebd..da19ed24265 100644 --- a/resource-manager/security/2020-01-01/externalsecuritysolutions/id_location.go +++ b/resource-manager/security/2020-01-01/externalsecuritysolutions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/externalsecuritysolutions/id_location_test.go b/resource-manager/security/2020-01-01/externalsecuritysolutions/id_location_test.go index c5cd8e2d565..ee201bd004e 100644 --- a/resource-manager/security/2020-01-01/externalsecuritysolutions/id_location_test.go +++ b/resource-manager/security/2020-01-01/externalsecuritysolutions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/README.md b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/README.md index 1c66a3af20b..1df7f00b1ba 100644 --- a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/README.md +++ b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "jitNetworkAccessPolicyName") +id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "jitNetworkAccessPolicyName") payload := jitnetworkaccesspolicies.JitNetworkAccessPolicy{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "jitNetworkAccessPolicyName") +id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "jitNetworkAccessPolicyName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "jitNetworkAccessPolicyName") +id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "jitNetworkAccessPolicyName") read, err := client.Get(ctx, id) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "jitNetworkAccessPolicyName") +id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "jitNetworkAccessPolicyName") payload := jitnetworkaccesspolicies.JitNetworkAccessPolicyInitiateRequest{ // ... @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := jitnetworkaccesspolicies.NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") +id := jitnetworkaccesspolicies.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByRegion(ctx, id)` can be used to do batched pagination items, err := client.ListByRegionComplete(ctx, id) @@ -150,7 +150,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := jitnetworkaccesspolicies.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation") +id := jitnetworkaccesspolicies.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListByResourceGroupAndRegion(ctx, id)` can be used to do batched pagination items, err := client.ListByResourceGroupAndRegionComplete(ctx, id) diff --git a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_jitnetworkaccesspolicy.go b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_jitnetworkaccesspolicy.go index b7a81945581..7f066142fca 100644 --- a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_jitnetworkaccesspolicy.go +++ b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_jitnetworkaccesspolicy.go @@ -121,7 +121,7 @@ func (id JitNetworkAccessPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticJitNetworkAccessPolicies", "jitNetworkAccessPolicies", "jitNetworkAccessPolicies"), resourceids.UserSpecifiedSegment("jitNetworkAccessPolicyName", "jitNetworkAccessPolicyName"), } diff --git a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_jitnetworkaccesspolicy_test.go b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_jitnetworkaccesspolicy_test.go index 90e25b1a6d2..62f3c21ee52 100644 --- a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_jitnetworkaccesspolicy_test.go +++ b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_jitnetworkaccesspolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &JitNetworkAccessPolicyId{} func TestNewJitNetworkAccessPolicyID(t *testing.T) { - id := NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "jitNetworkAccessPolicyName") + id := NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "jitNetworkAccessPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewJitNetworkAccessPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.JitNetworkAccessPolicyName != "jitNetworkAccessPolicyName" { @@ -32,8 +32,8 @@ func TestNewJitNetworkAccessPolicyID(t *testing.T) { } func TestFormatJitNetworkAccessPolicyID(t *testing.T) { - actual := NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "jitNetworkAccessPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/jitNetworkAccessPolicies/jitNetworkAccessPolicyName" + actual := NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "jitNetworkAccessPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/jitNetworkAccessPolicies/jitNetworkAccessPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseJitNetworkAccessPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/jitNetworkAccessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/jitNetworkAccessPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/jitNetworkAccessPolicies/jitNetworkAccessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/jitNetworkAccessPolicies/jitNetworkAccessPolicyName", Expected: &JitNetworkAccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", JitNetworkAccessPolicyName: "jitNetworkAccessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/jitNetworkAccessPolicies/jitNetworkAccessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/jitNetworkAccessPolicies/jitNetworkAccessPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseJitNetworkAccessPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/jitNetworkAccessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/jitNetworkAccessPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/jItNeTwOrKaCcEsSpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/jItNeTwOrKaCcEsSpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/jitNetworkAccessPolicies/jitNetworkAccessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/jitNetworkAccessPolicies/jitNetworkAccessPolicyName", Expected: &JitNetworkAccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", JitNetworkAccessPolicyName: "jitNetworkAccessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/jitNetworkAccessPolicies/jitNetworkAccessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/jitNetworkAccessPolicies/jitNetworkAccessPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/jItNeTwOrKaCcEsSpOlIcIeS/jItNeTwOrKaCcEsSpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/jItNeTwOrKaCcEsSpOlIcIeS/jItNeTwOrKaCcEsSpOlIcYnAmE", Expected: &JitNetworkAccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", JitNetworkAccessPolicyName: "jItNeTwOrKaCcEsSpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/jItNeTwOrKaCcEsSpOlIcIeS/jItNeTwOrKaCcEsSpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/jItNeTwOrKaCcEsSpOlIcIeS/jItNeTwOrKaCcEsSpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_location.go b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_location.go index 84c071d62ec..f93408afc46 100644 --- a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_location.go +++ b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_location_test.go b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_location_test.go index df87e024657..9ab8af67def 100644 --- a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_location_test.go +++ b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_providerlocation.go b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_providerlocation.go index c3100168af1..74ebf344684 100644 --- a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_providerlocation.go +++ b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_providerlocation.go @@ -115,7 +115,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_providerlocation_test.go b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_providerlocation_test.go index 08ae56dbf21..9b7b04f9d68 100644 --- a/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_providerlocation_test.go +++ b/resource-manager/security/2020-01-01/jitnetworkaccesspolicies/id_providerlocation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/securitysolutions/README.md b/resource-manager/security/2020-01-01/securitysolutions/README.md index 2928b01fd2e..7ced4c8ac2e 100644 --- a/resource-manager/security/2020-01-01/securitysolutions/README.md +++ b/resource-manager/security/2020-01-01/securitysolutions/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securitysolutions.NewSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "securitySolutionName") +id := securitysolutions.NewSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "securitySolutionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/security/2020-01-01/securitysolutions/id_securitysolution.go b/resource-manager/security/2020-01-01/securitysolutions/id_securitysolution.go index c87b45ead4a..face4152c70 100644 --- a/resource-manager/security/2020-01-01/securitysolutions/id_securitysolution.go +++ b/resource-manager/security/2020-01-01/securitysolutions/id_securitysolution.go @@ -121,7 +121,7 @@ func (id SecuritySolutionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticSecuritySolutions", "securitySolutions", "securitySolutions"), resourceids.UserSpecifiedSegment("securitySolutionName", "securitySolutionName"), } diff --git a/resource-manager/security/2020-01-01/securitysolutions/id_securitysolution_test.go b/resource-manager/security/2020-01-01/securitysolutions/id_securitysolution_test.go index c4f1c16c892..0a98b0110ce 100644 --- a/resource-manager/security/2020-01-01/securitysolutions/id_securitysolution_test.go +++ b/resource-manager/security/2020-01-01/securitysolutions/id_securitysolution_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecuritySolutionId{} func TestNewSecuritySolutionID(t *testing.T) { - id := NewSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "securitySolutionName") + id := NewSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "securitySolutionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSecuritySolutionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.SecuritySolutionName != "securitySolutionName" { @@ -32,8 +32,8 @@ func TestNewSecuritySolutionID(t *testing.T) { } func TestFormatSecuritySolutionID(t *testing.T) { - actual := NewSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "securitySolutionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/securitySolutions/securitySolutionName" + actual := NewSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "securitySolutionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/securitySolutions/securitySolutionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSecuritySolutionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/securitySolutions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/securitySolutions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/securitySolutions/securitySolutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/securitySolutions/securitySolutionName", Expected: &SecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", SecuritySolutionName: "securitySolutionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/securitySolutions/securitySolutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/securitySolutions/securitySolutionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSecuritySolutionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/securitySolutions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/securitySolutions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/sEcUrItYsOlUtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/sEcUrItYsOlUtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/securitySolutions/securitySolutionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/securitySolutions/securitySolutionName", Expected: &SecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", + LocationName: "locationName", SecuritySolutionName: "securitySolutionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/securitySolutions/securitySolutionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/securitySolutions/securitySolutionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/sEcUrItYsOlUtIoNs/sEcUrItYsOlUtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/sEcUrItYsOlUtIoNs/sEcUrItYsOlUtIoNnAmE", Expected: &SecuritySolutionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", SecuritySolutionName: "sEcUrItYsOlUtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/sEcUrItYsOlUtIoNs/sEcUrItYsOlUtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/sEcUrItYsOlUtIoNs/sEcUrItYsOlUtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/securitysolutionsreferencedata/README.md b/resource-manager/security/2020-01-01/securitysolutionsreferencedata/README.md index 182936aa038..0bd5ccfa755 100644 --- a/resource-manager/security/2020-01-01/securitysolutionsreferencedata/README.md +++ b/resource-manager/security/2020-01-01/securitysolutionsreferencedata/README.md @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitysolutionsreferencedata.NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") +id := securitysolutionsreferencedata.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListByHomeRegion(ctx, id) if err != nil { diff --git a/resource-manager/security/2020-01-01/securitysolutionsreferencedata/id_location.go b/resource-manager/security/2020-01-01/securitysolutionsreferencedata/id_location.go index 5d350871489..d080e54bca0 100644 --- a/resource-manager/security/2020-01-01/securitysolutionsreferencedata/id_location.go +++ b/resource-manager/security/2020-01-01/securitysolutionsreferencedata/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/securitysolutionsreferencedata/id_location_test.go b/resource-manager/security/2020-01-01/securitysolutionsreferencedata/id_location_test.go index 4d643c640b9..5e7dc8b9fb9 100644 --- a/resource-manager/security/2020-01-01/securitysolutionsreferencedata/id_location_test.go +++ b/resource-manager/security/2020-01-01/securitysolutionsreferencedata/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/securitysolutionsreferencedata/model_securitysolutionsreferencedataproperties.go b/resource-manager/security/2020-01-01/securitysolutionsreferencedata/model_securitysolutionsreferencedataproperties.go index 95333a49f0c..82f3baed4b4 100644 --- a/resource-manager/security/2020-01-01/securitysolutionsreferencedata/model_securitysolutionsreferencedataproperties.go +++ b/resource-manager/security/2020-01-01/securitysolutionsreferencedata/model_securitysolutionsreferencedataproperties.go @@ -5,7 +5,7 @@ package securitysolutionsreferencedata type SecuritySolutionsReferenceDataProperties struct { AlertVendorName string `json:"alertVendorName"` - PackageInfoUrl string `json:"packageInfoUrl"` + PackageInfoURL string `json:"packageInfoUrl"` ProductName string `json:"productName"` Publisher string `json:"publisher"` PublisherDisplayName string `json:"publisherDisplayName"` diff --git a/resource-manager/security/2020-01-01/topology/README.md b/resource-manager/security/2020-01-01/topology/README.md index 246ab1f39a1..0d867bba4a1 100644 --- a/resource-manager/security/2020-01-01/topology/README.md +++ b/resource-manager/security/2020-01-01/topology/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := topology.NewTopologyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "topologyResourceName") +id := topology.NewTopologyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topologyName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := topology.NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") +id := topology.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByHomeRegion(ctx, id)` can be used to do batched pagination items, err := client.ListByHomeRegionComplete(ctx, id) diff --git a/resource-manager/security/2020-01-01/topology/id_location.go b/resource-manager/security/2020-01-01/topology/id_location.go index cfa206d466c..f270b983216 100644 --- a/resource-manager/security/2020-01-01/topology/id_location.go +++ b/resource-manager/security/2020-01-01/topology/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/security/2020-01-01/topology/id_location_test.go b/resource-manager/security/2020-01-01/topology/id_location_test.go index 654cd3440a3..19cfaf3b9d9 100644 --- a/resource-manager/security/2020-01-01/topology/id_location_test.go +++ b/resource-manager/security/2020-01-01/topology/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "ascLocation").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "ascLocation", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/ascLocation/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "aScLoCaTiOn", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2020-01-01/topology/id_topology.go b/resource-manager/security/2020-01-01/topology/id_topology.go index 139b4e70631..325234214cf 100644 --- a/resource-manager/security/2020-01-01/topology/id_topology.go +++ b/resource-manager/security/2020-01-01/topology/id_topology.go @@ -121,9 +121,9 @@ func (id TopologyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "ascLocation"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticTopologies", "topologies", "topologies"), - resourceids.UserSpecifiedSegment("topologyName", "topologyResourceName"), + resourceids.UserSpecifiedSegment("topologyName", "topologyName"), } } diff --git a/resource-manager/security/2020-01-01/topology/id_topology_test.go b/resource-manager/security/2020-01-01/topology/id_topology_test.go index 699426f8a81..d3ab2acc460 100644 --- a/resource-manager/security/2020-01-01/topology/id_topology_test.go +++ b/resource-manager/security/2020-01-01/topology/id_topology_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TopologyId{} func TestNewTopologyID(t *testing.T) { - id := NewTopologyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "topologyResourceName") + id := NewTopologyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topologyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTopologyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "ascLocation" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "ascLocation") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.TopologyName != "topologyResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'TopologyName'", id.TopologyName, "topologyResourceName") + if id.TopologyName != "topologyName" { + t.Fatalf("Expected %q but got %q for Segment 'TopologyName'", id.TopologyName, "topologyName") } } func TestFormatTopologyID(t *testing.T) { - actual := NewTopologyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ascLocation", "topologyResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/topologies/topologyResourceName" + actual := NewTopologyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "topologyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/topologies/topologyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTopologyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/topologies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/topologies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/topologies/topologyResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/topologies/topologyName", Expected: &TopologyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", - TopologyName: "topologyResourceName", + LocationName: "locationName", + TopologyName: "topologyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/topologies/topologyResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/topologies/topologyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTopologyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/topologies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/topologies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/tOpOlOgIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/tOpOlOgIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/topologies/topologyResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/topologies/topologyName", Expected: &TopologyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "ascLocation", - TopologyName: "topologyResourceName", + LocationName: "locationName", + TopologyName: "topologyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/ascLocation/topologies/topologyResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationName/topologies/topologyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/tOpOlOgIeS/tOpOlOgYrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/tOpOlOgIeS/tOpOlOgYnAmE", Expected: &TopologyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "aScLoCaTiOn", - TopologyName: "tOpOlOgYrEsOuRcEnAmE", + LocationName: "lOcAtIoNnAmE", + TopologyName: "tOpOlOgYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/aScLoCaTiOn/tOpOlOgIeS/tOpOlOgYrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNnAmE/tOpOlOgIeS/tOpOlOgYnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2021-06-01/assessments/model_azureresourcedetails.go b/resource-manager/security/2021-06-01/assessments/model_azureresourcedetails.go new file mode 100644 index 00000000000..d6db9b0b6f4 --- /dev/null +++ b/resource-manager/security/2021-06-01/assessments/model_azureresourcedetails.go @@ -0,0 +1,50 @@ +package assessments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ResourceDetails = AzureResourceDetails{} + +type AzureResourceDetails struct { + Id *string `json:"id,omitempty"` + + // Fields inherited from ResourceDetails + + Source Source `json:"source"` +} + +func (s AzureResourceDetails) ResourceDetails() BaseResourceDetailsImpl { + return BaseResourceDetailsImpl{ + Source: s.Source, + } +} + +var _ json.Marshaler = AzureResourceDetails{} + +func (s AzureResourceDetails) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceDetails: %+v", err) + } + + decoded["source"] = "Azure" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/security/2021-06-01/assessments/model_onpremiseresourcedetails.go b/resource-manager/security/2021-06-01/assessments/model_onpremiseresourcedetails.go new file mode 100644 index 00000000000..e76d5ed33d8 --- /dev/null +++ b/resource-manager/security/2021-06-01/assessments/model_onpremiseresourcedetails.go @@ -0,0 +1,53 @@ +package assessments + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ResourceDetails = OnPremiseResourceDetails{} + +type OnPremiseResourceDetails struct { + MachineName string `json:"machineName"` + SourceComputerId string `json:"sourceComputerId"` + VMuuid string `json:"vmuuid"` + WorkspaceId string `json:"workspaceId"` + + // Fields inherited from ResourceDetails + + Source Source `json:"source"` +} + +func (s OnPremiseResourceDetails) ResourceDetails() BaseResourceDetailsImpl { + return BaseResourceDetailsImpl{ + Source: s.Source, + } +} + +var _ json.Marshaler = OnPremiseResourceDetails{} + +func (s OnPremiseResourceDetails) MarshalJSON() ([]byte, error) { + type wrapper OnPremiseResourceDetails + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling OnPremiseResourceDetails: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling OnPremiseResourceDetails: %+v", err) + } + + decoded["source"] = "OnPremise" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling OnPremiseResourceDetails: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/security/2021-06-01/assessments/model_resourcedetails.go b/resource-manager/security/2021-06-01/assessments/model_resourcedetails.go index a8add9e8a4f..5e2fc2f752e 100644 --- a/resource-manager/security/2021-06-01/assessments/model_resourcedetails.go +++ b/resource-manager/security/2021-06-01/assessments/model_resourcedetails.go @@ -1,8 +1,83 @@ package assessments +import ( + "encoding/json" + "fmt" + "strings" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ResourceDetails struct { +type ResourceDetails interface { + ResourceDetails() BaseResourceDetailsImpl +} + +var _ ResourceDetails = BaseResourceDetailsImpl{} + +type BaseResourceDetailsImpl struct { Source Source `json:"source"` } + +func (s BaseResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl { + return s +} + +var _ ResourceDetails = RawResourceDetailsImpl{} + +// RawResourceDetailsImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawResourceDetailsImpl struct { + resourceDetails BaseResourceDetailsImpl + Type string + Values map[string]interface{} +} + +func (s RawResourceDetailsImpl) ResourceDetails() BaseResourceDetailsImpl { + return s.resourceDetails +} + +func UnmarshalResourceDetailsImplementation(input []byte) (ResourceDetails, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ResourceDetails into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["source"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Azure") { + var out AzureResourceDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceDetails: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "OnPremise") { + var out OnPremiseResourceDetails + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into OnPremiseResourceDetails: %+v", err) + } + return out, nil + } + + var parent BaseResourceDetailsImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseResourceDetailsImpl: %+v", err) + } + + return RawResourceDetailsImpl{ + resourceDetails: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/security/2021-06-01/assessments/model_securityassessmentproperties.go b/resource-manager/security/2021-06-01/assessments/model_securityassessmentproperties.go index f9a99b8a643..2684da7a90f 100644 --- a/resource-manager/security/2021-06-01/assessments/model_securityassessmentproperties.go +++ b/resource-manager/security/2021-06-01/assessments/model_securityassessmentproperties.go @@ -1,5 +1,10 @@ package assessments +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -12,3 +17,41 @@ type SecurityAssessmentProperties struct { ResourceDetails ResourceDetails `json:"resourceDetails"` Status AssessmentStatus `json:"status"` } + +var _ json.Unmarshaler = &SecurityAssessmentProperties{} + +func (s *SecurityAssessmentProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AdditionalData *map[string]string `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Links *AssessmentLinks `json:"links,omitempty"` + Metadata *SecurityAssessmentMetadataProperties `json:"metadata,omitempty"` + PartnersData *SecurityAssessmentPartnerData `json:"partnersData,omitempty"` + Status AssessmentStatus `json:"status"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AdditionalData = decoded.AdditionalData + s.DisplayName = decoded.DisplayName + s.Links = decoded.Links + s.Metadata = decoded.Metadata + s.PartnersData = decoded.PartnersData + s.Status = decoded.Status + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SecurityAssessmentProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["resourceDetails"]; ok { + impl, err := UnmarshalResourceDetailsImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ResourceDetails' for 'SecurityAssessmentProperties': %+v", err) + } + s.ResourceDetails = impl + } + + return nil +} diff --git a/resource-manager/security/2021-06-01/assessments/model_securityassessmentpropertiesresponse.go b/resource-manager/security/2021-06-01/assessments/model_securityassessmentpropertiesresponse.go index 3ce72439e7d..7edbc401b1e 100644 --- a/resource-manager/security/2021-06-01/assessments/model_securityassessmentpropertiesresponse.go +++ b/resource-manager/security/2021-06-01/assessments/model_securityassessmentpropertiesresponse.go @@ -1,5 +1,10 @@ package assessments +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -12,3 +17,41 @@ type SecurityAssessmentPropertiesResponse struct { ResourceDetails ResourceDetails `json:"resourceDetails"` Status AssessmentStatusResponse `json:"status"` } + +var _ json.Unmarshaler = &SecurityAssessmentPropertiesResponse{} + +func (s *SecurityAssessmentPropertiesResponse) UnmarshalJSON(bytes []byte) error { + var decoded struct { + AdditionalData *map[string]string `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Links *AssessmentLinks `json:"links,omitempty"` + Metadata *SecurityAssessmentMetadataProperties `json:"metadata,omitempty"` + PartnersData *SecurityAssessmentPartnerData `json:"partnersData,omitempty"` + Status AssessmentStatusResponse `json:"status"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.AdditionalData = decoded.AdditionalData + s.DisplayName = decoded.DisplayName + s.Links = decoded.Links + s.Metadata = decoded.Metadata + s.PartnersData = decoded.PartnersData + s.Status = decoded.Status + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling SecurityAssessmentPropertiesResponse into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["resourceDetails"]; ok { + impl, err := UnmarshalResourceDetailsImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ResourceDetails' for 'SecurityAssessmentPropertiesResponse': %+v", err) + } + s.ResourceDetails = impl + } + + return nil +} diff --git a/resource-manager/security/2023-01-01/pricings/model_extension.go b/resource-manager/security/2023-01-01/pricings/model_extension.go index 4be10adad61..0eefe8472a0 100644 --- a/resource-manager/security/2023-01-01/pricings/model_extension.go +++ b/resource-manager/security/2023-01-01/pricings/model_extension.go @@ -4,8 +4,8 @@ package pricings // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Extension struct { - AdditionalExtensionProperties *interface{} `json:"additionalExtensionProperties,omitempty"` - IsEnabled IsEnabled `json:"isEnabled"` - Name string `json:"name"` - OperationStatus *OperationStatus `json:"operationStatus,omitempty"` + AdditionalExtensionProperties *map[string]interface{} `json:"additionalExtensionProperties,omitempty"` + IsEnabled IsEnabled `json:"isEnabled"` + Name string `json:"name"` + OperationStatus *OperationStatus `json:"operationStatus,omitempty"` } diff --git a/resource-manager/security/2023-11-15/apimconfig/model_apicollectionproperties.go b/resource-manager/security/2023-11-15/apimconfig/model_apicollectionproperties.go index cf4f3e546be..e27b8e52196 100644 --- a/resource-manager/security/2023-11-15/apimconfig/model_apicollectionproperties.go +++ b/resource-manager/security/2023-11-15/apimconfig/model_apicollectionproperties.go @@ -4,7 +4,7 @@ package apimconfig // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiCollectionProperties struct { - BaseUrl *string `json:"baseUrl,omitempty"` + BaseURL *string `json:"baseUrl,omitempty"` DiscoveredVia *string `json:"discoveredVia,omitempty"` DisplayName *string `json:"displayName,omitempty"` NumberOfApiEndpoints *int64 `json:"numberOfApiEndpoints,omitempty"` diff --git a/resource-manager/security/2023-11-15/d4apicollection/model_apicollectionproperties.go b/resource-manager/security/2023-11-15/d4apicollection/model_apicollectionproperties.go index 7ae7aa841d5..9bd6c8abea6 100644 --- a/resource-manager/security/2023-11-15/d4apicollection/model_apicollectionproperties.go +++ b/resource-manager/security/2023-11-15/d4apicollection/model_apicollectionproperties.go @@ -4,7 +4,7 @@ package d4apicollection // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiCollectionProperties struct { - BaseUrl *string `json:"baseUrl,omitempty"` + BaseURL *string `json:"baseUrl,omitempty"` DiscoveredVia *string `json:"discoveredVia,omitempty"` DisplayName *string `json:"displayName,omitempty"` NumberOfApiEndpoints *int64 `json:"numberOfApiEndpoints,omitempty"` diff --git a/resource-manager/security/2023-11-15/d4apicollectionlist/model_apicollectionproperties.go b/resource-manager/security/2023-11-15/d4apicollectionlist/model_apicollectionproperties.go index 9905995b305..ee76f136297 100644 --- a/resource-manager/security/2023-11-15/d4apicollectionlist/model_apicollectionproperties.go +++ b/resource-manager/security/2023-11-15/d4apicollectionlist/model_apicollectionproperties.go @@ -4,7 +4,7 @@ package d4apicollectionlist // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiCollectionProperties struct { - BaseUrl *string `json:"baseUrl,omitempty"` + BaseURL *string `json:"baseUrl,omitempty"` DiscoveredVia *string `json:"discoveredVia,omitempty"` DisplayName *string `json:"displayName,omitempty"` NumberOfApiEndpoints *int64 `json:"numberOfApiEndpoints,omitempty"` diff --git a/resource-manager/security/2023-11-15/onboardtod4api/model_apicollectionproperties.go b/resource-manager/security/2023-11-15/onboardtod4api/model_apicollectionproperties.go index 49987830ce6..5322fc76442 100644 --- a/resource-manager/security/2023-11-15/onboardtod4api/model_apicollectionproperties.go +++ b/resource-manager/security/2023-11-15/onboardtod4api/model_apicollectionproperties.go @@ -4,7 +4,7 @@ package onboardtod4api // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiCollectionProperties struct { - BaseUrl *string `json:"baseUrl,omitempty"` + BaseURL *string `json:"baseUrl,omitempty"` DiscoveredVia *string `json:"discoveredVia,omitempty"` DisplayName *string `json:"displayName,omitempty"` NumberOfApiEndpoints *int64 `json:"numberOfApiEndpoints,omitempty"` diff --git a/resource-manager/security/2024-01-01/pricings/model_extension.go b/resource-manager/security/2024-01-01/pricings/model_extension.go index 4be10adad61..0eefe8472a0 100644 --- a/resource-manager/security/2024-01-01/pricings/model_extension.go +++ b/resource-manager/security/2024-01-01/pricings/model_extension.go @@ -4,8 +4,8 @@ package pricings // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Extension struct { - AdditionalExtensionProperties *interface{} `json:"additionalExtensionProperties,omitempty"` - IsEnabled IsEnabled `json:"isEnabled"` - Name string `json:"name"` - OperationStatus *OperationStatus `json:"operationStatus,omitempty"` + AdditionalExtensionProperties *map[string]interface{} `json:"additionalExtensionProperties,omitempty"` + IsEnabled IsEnabled `json:"isEnabled"` + Name string `json:"name"` + OperationStatus *OperationStatus `json:"operationStatus,omitempty"` } diff --git a/resource-manager/security/2024-04-01/devops/README.md b/resource-manager/security/2024-04-01/devops/README.md index b5dae5ade82..b6ca443fb98 100644 --- a/resource-manager/security/2024-04-01/devops/README.md +++ b/resource-manager/security/2024-04-01/devops/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := devops.NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName") +id := devops.NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName") payload := devops.AzureDevOpsOrg{ // ... @@ -41,7 +41,7 @@ if err := client.AzureDevOpsOrgsCreateOrUpdateThenPoll(ctx, id, payload); err != ```go ctx := context.TODO() -id := devops.NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName") +id := devops.NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName") read, err := client.AzureDevOpsOrgsGet(ctx, id) if err != nil { @@ -91,7 +91,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devops.NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName") +id := devops.NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName") payload := devops.AzureDevOpsOrg{ // ... @@ -108,7 +108,7 @@ if err := client.AzureDevOpsOrgsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := devops.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName") +id := devops.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName") payload := devops.AzureDevOpsProject{ // ... @@ -125,7 +125,7 @@ if err := client.AzureDevOpsProjectsCreateOrUpdateThenPoll(ctx, id, payload); er ```go ctx := context.TODO() -id := devops.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName") +id := devops.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName") read, err := client.AzureDevOpsProjectsGet(ctx, id) if err != nil { @@ -141,7 +141,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devops.NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName") +id := devops.NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName") // alternatively `client.AzureDevOpsProjectsList(ctx, id)` can be used to do batched pagination items, err := client.AzureDevOpsProjectsListComplete(ctx, id) @@ -158,7 +158,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devops.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName") +id := devops.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName") payload := devops.AzureDevOpsProject{ // ... @@ -175,7 +175,7 @@ if err := client.AzureDevOpsProjectsUpdateThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := devops.NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName", "repoName") +id := devops.NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName", "repoName") payload := devops.AzureDevOpsRepository{ // ... @@ -192,7 +192,7 @@ if err := client.AzureDevOpsReposCreateOrUpdateThenPoll(ctx, id, payload); err ! ```go ctx := context.TODO() -id := devops.NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName", "repoName") +id := devops.NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName", "repoName") read, err := client.AzureDevOpsReposGet(ctx, id) if err != nil { @@ -208,7 +208,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devops.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName") +id := devops.NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName") // alternatively `client.AzureDevOpsReposList(ctx, id)` can be used to do batched pagination items, err := client.AzureDevOpsReposListComplete(ctx, id) @@ -225,7 +225,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devops.NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName", "repoName") +id := devops.NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName", "repoName") payload := devops.AzureDevOpsRepository{ // ... @@ -321,7 +321,7 @@ if err := client.ConfigurationsUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := devops.NewGitHubOwnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "ownerName") +id := devops.NewGitHubOwnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitHubOwnerName") read, err := client.GitHubOwnersGet(ctx, id) if err != nil { @@ -371,7 +371,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devops.NewRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "ownerName", "repoName") +id := devops.NewRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitHubOwnerName", "repoName") read, err := client.GitHubReposGet(ctx, id) if err != nil { @@ -387,7 +387,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devops.NewGitHubOwnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "ownerName") +id := devops.NewGitHubOwnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitHubOwnerName") // alternatively `client.GitHubReposList(ctx, id)` can be used to do batched pagination items, err := client.GitHubReposListComplete(ctx, id) @@ -404,7 +404,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devops.NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "groupFQName") +id := devops.NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitLabGroupName") read, err := client.GitLabGroupsGet(ctx, id) if err != nil { @@ -454,7 +454,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devops.NewGitLabGroupProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "groupFQName", "projectName") +id := devops.NewGitLabGroupProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitLabGroupName", "projectName") read, err := client.GitLabProjectsGet(ctx, id) if err != nil { @@ -470,7 +470,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := devops.NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "groupFQName") +id := devops.NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitLabGroupName") // alternatively `client.GitLabProjectsList(ctx, id)` can be used to do batched pagination items, err := client.GitLabProjectsListComplete(ctx, id) @@ -487,7 +487,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := devops.NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "groupFQName") +id := devops.NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitLabGroupName") // alternatively `client.GitLabSubgroupsList(ctx, id)` can be used to do batched pagination items, err := client.GitLabSubgroupsListComplete(ctx, id) diff --git a/resource-manager/security/2024-04-01/devops/id_azuredevopsorg.go b/resource-manager/security/2024-04-01/devops/id_azuredevopsorg.go index 82261d07091..f52ce6e324c 100644 --- a/resource-manager/security/2024-04-01/devops/id_azuredevopsorg.go +++ b/resource-manager/security/2024-04-01/devops/id_azuredevopsorg.go @@ -125,7 +125,7 @@ func (id AzureDevOpsOrgId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDevops", "devops", "devops"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticAzureDevOpsOrgs", "azureDevOpsOrgs", "azureDevOpsOrgs"), - resourceids.UserSpecifiedSegment("azureDevOpsOrgName", "orgName"), + resourceids.UserSpecifiedSegment("azureDevOpsOrgName", "azureDevOpsOrgName"), } } diff --git a/resource-manager/security/2024-04-01/devops/id_azuredevopsorg_test.go b/resource-manager/security/2024-04-01/devops/id_azuredevopsorg_test.go index 6cc81201b1e..70d8663db33 100644 --- a/resource-manager/security/2024-04-01/devops/id_azuredevopsorg_test.go +++ b/resource-manager/security/2024-04-01/devops/id_azuredevopsorg_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AzureDevOpsOrgId{} func TestNewAzureDevOpsOrgID(t *testing.T) { - id := NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName") + id := NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewAzureDevOpsOrgID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SecurityConnectorName'", id.SecurityConnectorName, "securityConnectorName") } - if id.AzureDevOpsOrgName != "orgName" { - t.Fatalf("Expected %q but got %q for Segment 'AzureDevOpsOrgName'", id.AzureDevOpsOrgName, "orgName") + if id.AzureDevOpsOrgName != "azureDevOpsOrgName" { + t.Fatalf("Expected %q but got %q for Segment 'AzureDevOpsOrgName'", id.AzureDevOpsOrgName, "azureDevOpsOrgName") } } func TestFormatAzureDevOpsOrgID(t *testing.T) { - actual := NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName" + actual := NewAzureDevOpsOrgID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseAzureDevOpsOrgID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName", Expected: &AzureDevOpsOrgId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - AzureDevOpsOrgName: "orgName", + AzureDevOpsOrgName: "azureDevOpsOrgName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseAzureDevOpsOrgIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName", Expected: &AzureDevOpsOrgId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - AzureDevOpsOrgName: "orgName", + AzureDevOpsOrgName: "azureDevOpsOrgName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE", Expected: &AzureDevOpsOrgId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SecurityConnectorName: "sEcUrItYcOnNeCtOrNaMe", - AzureDevOpsOrgName: "oRgNaMe", + AzureDevOpsOrgName: "aZuReDeVoPsOrGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2024-04-01/devops/id_githubowner.go b/resource-manager/security/2024-04-01/devops/id_githubowner.go index 523fb8a3c31..a28671fd02c 100644 --- a/resource-manager/security/2024-04-01/devops/id_githubowner.go +++ b/resource-manager/security/2024-04-01/devops/id_githubowner.go @@ -125,7 +125,7 @@ func (id GitHubOwnerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDevops", "devops", "devops"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticGitHubOwners", "gitHubOwners", "gitHubOwners"), - resourceids.UserSpecifiedSegment("gitHubOwnerName", "ownerName"), + resourceids.UserSpecifiedSegment("gitHubOwnerName", "gitHubOwnerName"), } } diff --git a/resource-manager/security/2024-04-01/devops/id_githubowner_test.go b/resource-manager/security/2024-04-01/devops/id_githubowner_test.go index 708381e648d..14a3ab6c1be 100644 --- a/resource-manager/security/2024-04-01/devops/id_githubowner_test.go +++ b/resource-manager/security/2024-04-01/devops/id_githubowner_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GitHubOwnerId{} func TestNewGitHubOwnerID(t *testing.T) { - id := NewGitHubOwnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "ownerName") + id := NewGitHubOwnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitHubOwnerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGitHubOwnerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SecurityConnectorName'", id.SecurityConnectorName, "securityConnectorName") } - if id.GitHubOwnerName != "ownerName" { - t.Fatalf("Expected %q but got %q for Segment 'GitHubOwnerName'", id.GitHubOwnerName, "ownerName") + if id.GitHubOwnerName != "gitHubOwnerName" { + t.Fatalf("Expected %q but got %q for Segment 'GitHubOwnerName'", id.GitHubOwnerName, "gitHubOwnerName") } } func TestFormatGitHubOwnerID(t *testing.T) { - actual := NewGitHubOwnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "ownerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName" + actual := NewGitHubOwnerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitHubOwnerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseGitHubOwnerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName", Expected: &GitHubOwnerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - GitHubOwnerName: "ownerName", + GitHubOwnerName: "gitHubOwnerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseGitHubOwnerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName", Expected: &GitHubOwnerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - GitHubOwnerName: "ownerName", + GitHubOwnerName: "gitHubOwnerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/oWnErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/gItHuBoWnErNaMe", Expected: &GitHubOwnerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SecurityConnectorName: "sEcUrItYcOnNeCtOrNaMe", - GitHubOwnerName: "oWnErNaMe", + GitHubOwnerName: "gItHuBoWnErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/oWnErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/gItHuBoWnErNaMe/extra", Error: true, }, } diff --git a/resource-manager/security/2024-04-01/devops/id_gitlabgroup.go b/resource-manager/security/2024-04-01/devops/id_gitlabgroup.go index ca6b9d92481..b18fd2dabe4 100644 --- a/resource-manager/security/2024-04-01/devops/id_gitlabgroup.go +++ b/resource-manager/security/2024-04-01/devops/id_gitlabgroup.go @@ -125,7 +125,7 @@ func (id GitLabGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDevops", "devops", "devops"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticGitLabGroups", "gitLabGroups", "gitLabGroups"), - resourceids.UserSpecifiedSegment("gitLabGroupName", "groupFQName"), + resourceids.UserSpecifiedSegment("gitLabGroupName", "gitLabGroupName"), } } diff --git a/resource-manager/security/2024-04-01/devops/id_gitlabgroup_test.go b/resource-manager/security/2024-04-01/devops/id_gitlabgroup_test.go index 043f4da9852..e96700bb536 100644 --- a/resource-manager/security/2024-04-01/devops/id_gitlabgroup_test.go +++ b/resource-manager/security/2024-04-01/devops/id_gitlabgroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GitLabGroupId{} func TestNewGitLabGroupID(t *testing.T) { - id := NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "groupFQName") + id := NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitLabGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewGitLabGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SecurityConnectorName'", id.SecurityConnectorName, "securityConnectorName") } - if id.GitLabGroupName != "groupFQName" { - t.Fatalf("Expected %q but got %q for Segment 'GitLabGroupName'", id.GitLabGroupName, "groupFQName") + if id.GitLabGroupName != "gitLabGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'GitLabGroupName'", id.GitLabGroupName, "gitLabGroupName") } } func TestFormatGitLabGroupID(t *testing.T) { - actual := NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "groupFQName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName" + actual := NewGitLabGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitLabGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseGitLabGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName", Expected: &GitLabGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - GitLabGroupName: "groupFQName", + GitLabGroupName: "gitLabGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseGitLabGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName", Expected: &GitLabGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - GitLabGroupName: "groupFQName", + GitLabGroupName: "gitLabGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gRoUpFqNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gItLaBgRoUpNaMe", Expected: &GitLabGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SecurityConnectorName: "sEcUrItYcOnNeCtOrNaMe", - GitLabGroupName: "gRoUpFqNaMe", + GitLabGroupName: "gItLaBgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gRoUpFqNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gItLaBgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/security/2024-04-01/devops/id_gitlabgroupproject.go b/resource-manager/security/2024-04-01/devops/id_gitlabgroupproject.go index c7a6e5ca3c4..cb967b13620 100644 --- a/resource-manager/security/2024-04-01/devops/id_gitlabgroupproject.go +++ b/resource-manager/security/2024-04-01/devops/id_gitlabgroupproject.go @@ -131,7 +131,7 @@ func (id GitLabGroupProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDevops", "devops", "devops"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticGitLabGroups", "gitLabGroups", "gitLabGroups"), - resourceids.UserSpecifiedSegment("gitLabGroupName", "groupFQName"), + resourceids.UserSpecifiedSegment("gitLabGroupName", "gitLabGroupName"), resourceids.StaticSegment("staticProjects", "projects", "projects"), resourceids.UserSpecifiedSegment("projectName", "projectName"), } diff --git a/resource-manager/security/2024-04-01/devops/id_gitlabgroupproject_test.go b/resource-manager/security/2024-04-01/devops/id_gitlabgroupproject_test.go index b60cf908e87..0443a4c1529 100644 --- a/resource-manager/security/2024-04-01/devops/id_gitlabgroupproject_test.go +++ b/resource-manager/security/2024-04-01/devops/id_gitlabgroupproject_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GitLabGroupProjectId{} func TestNewGitLabGroupProjectID(t *testing.T) { - id := NewGitLabGroupProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "groupFQName", "projectName") + id := NewGitLabGroupProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitLabGroupName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewGitLabGroupProjectID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SecurityConnectorName'", id.SecurityConnectorName, "securityConnectorName") } - if id.GitLabGroupName != "groupFQName" { - t.Fatalf("Expected %q but got %q for Segment 'GitLabGroupName'", id.GitLabGroupName, "groupFQName") + if id.GitLabGroupName != "gitLabGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'GitLabGroupName'", id.GitLabGroupName, "gitLabGroupName") } if id.ProjectName != "projectName" { @@ -36,8 +36,8 @@ func TestNewGitLabGroupProjectID(t *testing.T) { } func TestFormatGitLabGroupProjectID(t *testing.T) { - actual := NewGitLabGroupProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "groupFQName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/projects/projectName" + actual := NewGitLabGroupProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitLabGroupName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,28 +111,28 @@ func TestParseGitLabGroupProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/projects/projectName", Expected: &GitLabGroupProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - GitLabGroupName: "groupFQName", + GitLabGroupName: "gitLabGroupName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/projects/projectName/extra", Error: true, }, } @@ -297,54 +297,54 @@ func TestParseGitLabGroupProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gRoUpFqNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gItLaBgRoUpNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gRoUpFqNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gItLaBgRoUpNaMe/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/projects/projectName", Expected: &GitLabGroupProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - GitLabGroupName: "groupFQName", + GitLabGroupName: "gitLabGroupName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/groupFQName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitLabGroups/gitLabGroupName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gRoUpFqNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gItLaBgRoUpNaMe/pRoJeCtS/pRoJeCtNaMe", Expected: &GitLabGroupProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SecurityConnectorName: "sEcUrItYcOnNeCtOrNaMe", - GitLabGroupName: "gRoUpFqNaMe", + GitLabGroupName: "gItLaBgRoUpNaMe", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gRoUpFqNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItLaBgRoUpS/gItLaBgRoUpNaMe/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/security/2024-04-01/devops/id_project.go b/resource-manager/security/2024-04-01/devops/id_project.go index 6cf6e8172d6..50a19bbe0da 100644 --- a/resource-manager/security/2024-04-01/devops/id_project.go +++ b/resource-manager/security/2024-04-01/devops/id_project.go @@ -131,7 +131,7 @@ func (id ProjectId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDevops", "devops", "devops"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticAzureDevOpsOrgs", "azureDevOpsOrgs", "azureDevOpsOrgs"), - resourceids.UserSpecifiedSegment("azureDevOpsOrgName", "orgName"), + resourceids.UserSpecifiedSegment("azureDevOpsOrgName", "azureDevOpsOrgName"), resourceids.StaticSegment("staticProjects", "projects", "projects"), resourceids.UserSpecifiedSegment("projectName", "projectName"), } diff --git a/resource-manager/security/2024-04-01/devops/id_project_test.go b/resource-manager/security/2024-04-01/devops/id_project_test.go index 091faecb310..8027b0656d8 100644 --- a/resource-manager/security/2024-04-01/devops/id_project_test.go +++ b/resource-manager/security/2024-04-01/devops/id_project_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProjectId{} func TestNewProjectID(t *testing.T) { - id := NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName") + id := NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewProjectID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SecurityConnectorName'", id.SecurityConnectorName, "securityConnectorName") } - if id.AzureDevOpsOrgName != "orgName" { - t.Fatalf("Expected %q but got %q for Segment 'AzureDevOpsOrgName'", id.AzureDevOpsOrgName, "orgName") + if id.AzureDevOpsOrgName != "azureDevOpsOrgName" { + t.Fatalf("Expected %q but got %q for Segment 'AzureDevOpsOrgName'", id.AzureDevOpsOrgName, "azureDevOpsOrgName") } if id.ProjectName != "projectName" { @@ -36,8 +36,8 @@ func TestNewProjectID(t *testing.T) { } func TestFormatProjectID(t *testing.T) { - actual := NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName" + actual := NewProjectID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,28 +111,28 @@ func TestParseProjectID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - AzureDevOpsOrgName: "orgName", + AzureDevOpsOrgName: "azureDevOpsOrgName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/extra", Error: true, }, } @@ -297,54 +297,54 @@ func TestParseProjectIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/pRoJeCtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - AzureDevOpsOrgName: "orgName", + AzureDevOpsOrgName: "azureDevOpsOrgName", ProjectName: "projectName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/pRoJeCtS/pRoJeCtNaMe", Expected: &ProjectId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SecurityConnectorName: "sEcUrItYcOnNeCtOrNaMe", - AzureDevOpsOrgName: "oRgNaMe", + AzureDevOpsOrgName: "aZuReDeVoPsOrGnAmE", ProjectName: "pRoJeCtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/pRoJeCtS/pRoJeCtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/pRoJeCtS/pRoJeCtNaMe/extra", Error: true, }, } diff --git a/resource-manager/security/2024-04-01/devops/id_projectrepo.go b/resource-manager/security/2024-04-01/devops/id_projectrepo.go index ed2a3bf21fd..bb6e773c528 100644 --- a/resource-manager/security/2024-04-01/devops/id_projectrepo.go +++ b/resource-manager/security/2024-04-01/devops/id_projectrepo.go @@ -137,7 +137,7 @@ func (id ProjectRepoId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDevops", "devops", "devops"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticAzureDevOpsOrgs", "azureDevOpsOrgs", "azureDevOpsOrgs"), - resourceids.UserSpecifiedSegment("azureDevOpsOrgName", "orgName"), + resourceids.UserSpecifiedSegment("azureDevOpsOrgName", "azureDevOpsOrgName"), resourceids.StaticSegment("staticProjects", "projects", "projects"), resourceids.UserSpecifiedSegment("projectName", "projectName"), resourceids.StaticSegment("staticRepos", "repos", "repos"), diff --git a/resource-manager/security/2024-04-01/devops/id_projectrepo_test.go b/resource-manager/security/2024-04-01/devops/id_projectrepo_test.go index 436edf6bd1c..6d129c94eaf 100644 --- a/resource-manager/security/2024-04-01/devops/id_projectrepo_test.go +++ b/resource-manager/security/2024-04-01/devops/id_projectrepo_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProjectRepoId{} func TestNewProjectRepoID(t *testing.T) { - id := NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName", "repoName") + id := NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName", "repoName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewProjectRepoID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SecurityConnectorName'", id.SecurityConnectorName, "securityConnectorName") } - if id.AzureDevOpsOrgName != "orgName" { - t.Fatalf("Expected %q but got %q for Segment 'AzureDevOpsOrgName'", id.AzureDevOpsOrgName, "orgName") + if id.AzureDevOpsOrgName != "azureDevOpsOrgName" { + t.Fatalf("Expected %q but got %q for Segment 'AzureDevOpsOrgName'", id.AzureDevOpsOrgName, "azureDevOpsOrgName") } if id.ProjectName != "projectName" { @@ -40,8 +40,8 @@ func TestNewProjectRepoID(t *testing.T) { } func TestFormatProjectRepoID(t *testing.T) { - actual := NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "orgName", "projectName", "repoName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/repos/repoName" + actual := NewProjectRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "azureDevOpsOrgName", "projectName", "repoName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/repos/repoName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -115,39 +115,39 @@ func TestParseProjectRepoID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/repos", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/repos", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/repos/repoName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/repos/repoName", Expected: &ProjectRepoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - AzureDevOpsOrgName: "orgName", + AzureDevOpsOrgName: "azureDevOpsOrgName", ProjectName: "projectName", RepoName: "repoName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/repos/repoName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/repos/repoName/extra", Error: true, }, } @@ -316,76 +316,76 @@ func TestParseProjectRepoIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/pRoJeCtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/pRoJeCtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/pRoJeCtS/pRoJeCtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/pRoJeCtS/pRoJeCtNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/repos", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/repos", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/pRoJeCtS/pRoJeCtNaMe/rEpOs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/pRoJeCtS/pRoJeCtNaMe/rEpOs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/repos/repoName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/repos/repoName", Expected: &ProjectRepoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - AzureDevOpsOrgName: "orgName", + AzureDevOpsOrgName: "azureDevOpsOrgName", ProjectName: "projectName", RepoName: "repoName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/orgName/projects/projectName/repos/repoName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/azureDevOpsOrgs/azureDevOpsOrgName/projects/projectName/repos/repoName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/pRoJeCtS/pRoJeCtNaMe/rEpOs/rEpOnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/pRoJeCtS/pRoJeCtNaMe/rEpOs/rEpOnAmE", Expected: &ProjectRepoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SecurityConnectorName: "sEcUrItYcOnNeCtOrNaMe", - AzureDevOpsOrgName: "oRgNaMe", + AzureDevOpsOrgName: "aZuReDeVoPsOrGnAmE", ProjectName: "pRoJeCtNaMe", RepoName: "rEpOnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/oRgNaMe/pRoJeCtS/pRoJeCtNaMe/rEpOs/rEpOnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/aZuReDeVoPsOrGs/aZuReDeVoPsOrGnAmE/pRoJeCtS/pRoJeCtNaMe/rEpOs/rEpOnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2024-04-01/devops/id_repo.go b/resource-manager/security/2024-04-01/devops/id_repo.go index 8bf227db437..6f0a604bbcf 100644 --- a/resource-manager/security/2024-04-01/devops/id_repo.go +++ b/resource-manager/security/2024-04-01/devops/id_repo.go @@ -131,7 +131,7 @@ func (id RepoId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDevops", "devops", "devops"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticGitHubOwners", "gitHubOwners", "gitHubOwners"), - resourceids.UserSpecifiedSegment("gitHubOwnerName", "ownerName"), + resourceids.UserSpecifiedSegment("gitHubOwnerName", "gitHubOwnerName"), resourceids.StaticSegment("staticRepos", "repos", "repos"), resourceids.UserSpecifiedSegment("repoName", "repoName"), } diff --git a/resource-manager/security/2024-04-01/devops/id_repo_test.go b/resource-manager/security/2024-04-01/devops/id_repo_test.go index 18dc05455e0..53764cb7d7f 100644 --- a/resource-manager/security/2024-04-01/devops/id_repo_test.go +++ b/resource-manager/security/2024-04-01/devops/id_repo_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RepoId{} func TestNewRepoID(t *testing.T) { - id := NewRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "ownerName", "repoName") + id := NewRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitHubOwnerName", "repoName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewRepoID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SecurityConnectorName'", id.SecurityConnectorName, "securityConnectorName") } - if id.GitHubOwnerName != "ownerName" { - t.Fatalf("Expected %q but got %q for Segment 'GitHubOwnerName'", id.GitHubOwnerName, "ownerName") + if id.GitHubOwnerName != "gitHubOwnerName" { + t.Fatalf("Expected %q but got %q for Segment 'GitHubOwnerName'", id.GitHubOwnerName, "gitHubOwnerName") } if id.RepoName != "repoName" { @@ -36,8 +36,8 @@ func TestNewRepoID(t *testing.T) { } func TestFormatRepoID(t *testing.T) { - actual := NewRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "ownerName", "repoName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/repos/repoName" + actual := NewRepoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityConnectorName", "gitHubOwnerName", "repoName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/repos/repoName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,28 +111,28 @@ func TestParseRepoID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/repos", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/repos", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/repos/repoName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/repos/repoName", Expected: &RepoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - GitHubOwnerName: "ownerName", + GitHubOwnerName: "gitHubOwnerName", RepoName: "repoName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/repos/repoName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/repos/repoName/extra", Error: true, }, } @@ -297,54 +297,54 @@ func TestParseRepoIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/oWnErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/gItHuBoWnErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/repos", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/repos", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/oWnErNaMe/rEpOs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/gItHuBoWnErNaMe/rEpOs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/repos/repoName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/repos/repoName", Expected: &RepoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SecurityConnectorName: "securityConnectorName", - GitHubOwnerName: "ownerName", + GitHubOwnerName: "gitHubOwnerName", RepoName: "repoName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/ownerName/repos/repoName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/securityConnectors/securityConnectorName/devops/default/gitHubOwners/gitHubOwnerName/repos/repoName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/oWnErNaMe/rEpOs/rEpOnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/gItHuBoWnErNaMe/rEpOs/rEpOnAmE", Expected: &RepoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SecurityConnectorName: "sEcUrItYcOnNeCtOrNaMe", - GitHubOwnerName: "oWnErNaMe", + GitHubOwnerName: "gItHuBoWnErNaMe", RepoName: "rEpOnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/oWnErNaMe/rEpOs/rEpOnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnNeCtOrS/sEcUrItYcOnNeCtOrNaMe/dEvOpS/dEfAuLt/gItHuBoWnErS/gItHuBoWnErNaMe/rEpOs/rEpOnAmE/extra", Error: true, }, } diff --git a/resource-manager/security/2024-04-01/devops/model_azuredevopsrepositoryproperties.go b/resource-manager/security/2024-04-01/devops/model_azuredevopsrepositoryproperties.go index 81fe100ea9d..96dea0315a8 100644 --- a/resource-manager/security/2024-04-01/devops/model_azuredevopsrepositoryproperties.go +++ b/resource-manager/security/2024-04-01/devops/model_azuredevopsrepositoryproperties.go @@ -18,7 +18,7 @@ type AzureDevOpsRepositoryProperties struct { ProvisioningStatusMessage *string `json:"provisioningStatusMessage,omitempty"` ProvisioningStatusUpdateTimeUtc *string `json:"provisioningStatusUpdateTimeUtc,omitempty"` RepoId *string `json:"repoId,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` Visibility *string `json:"visibility,omitempty"` } diff --git a/resource-manager/security/2024-04-01/devops/model_githubownerproperties.go b/resource-manager/security/2024-04-01/devops/model_githubownerproperties.go index 41d8140d1bb..8639e475270 100644 --- a/resource-manager/security/2024-04-01/devops/model_githubownerproperties.go +++ b/resource-manager/security/2024-04-01/devops/model_githubownerproperties.go @@ -12,7 +12,7 @@ import ( type GitHubOwnerProperties struct { GitHubInternalId *string `json:"gitHubInternalId,omitempty"` OnboardingState *OnboardingState `json:"onboardingState,omitempty"` - OwnerUrl *string `json:"ownerUrl,omitempty"` + OwnerURL *string `json:"ownerUrl,omitempty"` ProvisioningState *DevOpsProvisioningState `json:"provisioningState,omitempty"` ProvisioningStatusMessage *string `json:"provisioningStatusMessage,omitempty"` ProvisioningStatusUpdateTimeUtc *string `json:"provisioningStatusUpdateTimeUtc,omitempty"` diff --git a/resource-manager/security/2024-04-01/devops/model_githubrepositoryproperties.go b/resource-manager/security/2024-04-01/devops/model_githubrepositoryproperties.go index 39893d405c1..a3d390589d4 100644 --- a/resource-manager/security/2024-04-01/devops/model_githubrepositoryproperties.go +++ b/resource-manager/security/2024-04-01/devops/model_githubrepositoryproperties.go @@ -18,7 +18,7 @@ type GitHubRepositoryProperties struct { RepoFullName *string `json:"repoFullName,omitempty"` RepoId *string `json:"repoId,omitempty"` RepoName *string `json:"repoName,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` } func (o *GitHubRepositoryProperties) GetProvisioningStatusUpdateTimeUtcAsTime() (*time.Time, error) { diff --git a/resource-manager/security/2024-08-01/standardassignments/model_attestationevidence.go b/resource-manager/security/2024-08-01/standardassignments/model_attestationevidence.go index 01e9f4a9c4b..47bb21c491a 100644 --- a/resource-manager/security/2024-08-01/standardassignments/model_attestationevidence.go +++ b/resource-manager/security/2024-08-01/standardassignments/model_attestationevidence.go @@ -5,5 +5,5 @@ package standardassignments type AttestationEvidence struct { Description *string `json:"description,omitempty"` - SourceUrl *string `json:"sourceUrl,omitempty"` + SourceURL *string `json:"sourceUrl,omitempty"` } diff --git a/resource-manager/securityinsights/2022-10-01-preview/automationrules/constants.go b/resource-manager/securityinsights/2022-10-01-preview/automationrules/constants.go index 7e27f51e7cc..401acf4cf17 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/automationrules/constants.go +++ b/resource-manager/securityinsights/2022-10-01-preview/automationrules/constants.go @@ -459,7 +459,7 @@ const ( AutomationRulePropertyConditionSupportedPropertyProcessId AutomationRulePropertyConditionSupportedProperty = "ProcessId" AutomationRulePropertyConditionSupportedPropertyRegistryKey AutomationRulePropertyConditionSupportedProperty = "RegistryKey" AutomationRulePropertyConditionSupportedPropertyRegistryValueData AutomationRulePropertyConditionSupportedProperty = "RegistryValueData" - AutomationRulePropertyConditionSupportedPropertyUrl AutomationRulePropertyConditionSupportedProperty = "Url" + AutomationRulePropertyConditionSupportedPropertyURL AutomationRulePropertyConditionSupportedProperty = "Url" ) func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []string { @@ -521,7 +521,7 @@ func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []strin string(AutomationRulePropertyConditionSupportedPropertyProcessId), string(AutomationRulePropertyConditionSupportedPropertyRegistryKey), string(AutomationRulePropertyConditionSupportedPropertyRegistryValueData), - string(AutomationRulePropertyConditionSupportedPropertyUrl), + string(AutomationRulePropertyConditionSupportedPropertyURL), } } @@ -597,7 +597,7 @@ func parseAutomationRulePropertyConditionSupportedProperty(input string) (*Autom "processid": AutomationRulePropertyConditionSupportedPropertyProcessId, "registrykey": AutomationRulePropertyConditionSupportedPropertyRegistryKey, "registryvaluedata": AutomationRulePropertyConditionSupportedPropertyRegistryValueData, - "url": AutomationRulePropertyConditionSupportedPropertyUrl, + "url": AutomationRulePropertyConditionSupportedPropertyURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/constants.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/constants.go index 95e462c1392..33747323852 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/bookmark/constants.go +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/constants.go @@ -9,6 +9,530 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AlertSeverity string + +const ( + AlertSeverityHigh AlertSeverity = "High" + AlertSeverityInformational AlertSeverity = "Informational" + AlertSeverityLow AlertSeverity = "Low" + AlertSeverityMedium AlertSeverity = "Medium" +) + +func PossibleValuesForAlertSeverity() []string { + return []string{ + string(AlertSeverityHigh), + string(AlertSeverityInformational), + string(AlertSeverityLow), + string(AlertSeverityMedium), + } +} + +func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAlertSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAlertSeverity(input string) (*AlertSeverity, error) { + vals := map[string]AlertSeverity{ + "high": AlertSeverityHigh, + "informational": AlertSeverityInformational, + "low": AlertSeverityLow, + "medium": AlertSeverityMedium, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AlertSeverity(input) + return &out, nil +} + +type AlertStatus string + +const ( + AlertStatusDismissed AlertStatus = "Dismissed" + AlertStatusInProgress AlertStatus = "InProgress" + AlertStatusNew AlertStatus = "New" + AlertStatusResolved AlertStatus = "Resolved" + AlertStatusUnknown AlertStatus = "Unknown" +) + +func PossibleValuesForAlertStatus() []string { + return []string{ + string(AlertStatusDismissed), + string(AlertStatusInProgress), + string(AlertStatusNew), + string(AlertStatusResolved), + string(AlertStatusUnknown), + } +} + +func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAlertStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAlertStatus(input string) (*AlertStatus, error) { + vals := map[string]AlertStatus{ + "dismissed": AlertStatusDismissed, + "inprogress": AlertStatusInProgress, + "new": AlertStatusNew, + "resolved": AlertStatusResolved, + "unknown": AlertStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AlertStatus(input) + return &out, nil +} + +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + +type AttackTactic string + +const ( + AttackTacticCollection AttackTactic = "Collection" + AttackTacticCommandAndControl AttackTactic = "CommandAndControl" + AttackTacticCredentialAccess AttackTactic = "CredentialAccess" + AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" + AttackTacticDiscovery AttackTactic = "Discovery" + AttackTacticExecution AttackTactic = "Execution" + AttackTacticExfiltration AttackTactic = "Exfiltration" + AttackTacticImpact AttackTactic = "Impact" + AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" + AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" + AttackTacticInitialAccess AttackTactic = "InitialAccess" + AttackTacticLateralMovement AttackTactic = "LateralMovement" + AttackTacticPersistence AttackTactic = "Persistence" + AttackTacticPreAttack AttackTactic = "PreAttack" + AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" + AttackTacticReconnaissance AttackTactic = "Reconnaissance" + AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" +) + +func PossibleValuesForAttackTactic() []string { + return []string{ + string(AttackTacticCollection), + string(AttackTacticCommandAndControl), + string(AttackTacticCredentialAccess), + string(AttackTacticDefenseEvasion), + string(AttackTacticDiscovery), + string(AttackTacticExecution), + string(AttackTacticExfiltration), + string(AttackTacticImpact), + string(AttackTacticImpairProcessControl), + string(AttackTacticInhibitResponseFunction), + string(AttackTacticInitialAccess), + string(AttackTacticLateralMovement), + string(AttackTacticPersistence), + string(AttackTacticPreAttack), + string(AttackTacticPrivilegeEscalation), + string(AttackTacticReconnaissance), + string(AttackTacticResourceDevelopment), + } +} + +func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAttackTactic(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAttackTactic(input string) (*AttackTactic, error) { + vals := map[string]AttackTactic{ + "collection": AttackTacticCollection, + "commandandcontrol": AttackTacticCommandAndControl, + "credentialaccess": AttackTacticCredentialAccess, + "defenseevasion": AttackTacticDefenseEvasion, + "discovery": AttackTacticDiscovery, + "execution": AttackTacticExecution, + "exfiltration": AttackTacticExfiltration, + "impact": AttackTacticImpact, + "impairprocesscontrol": AttackTacticImpairProcessControl, + "inhibitresponsefunction": AttackTacticInhibitResponseFunction, + "initialaccess": AttackTacticInitialAccess, + "lateralmovement": AttackTacticLateralMovement, + "persistence": AttackTacticPersistence, + "preattack": AttackTacticPreAttack, + "privilegeescalation": AttackTacticPrivilegeEscalation, + "reconnaissance": AttackTacticReconnaissance, + "resourcedevelopment": AttackTacticResourceDevelopment, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AttackTactic(input) + return &out, nil +} + +type ConfidenceLevel string + +const ( + ConfidenceLevelHigh ConfidenceLevel = "High" + ConfidenceLevelLow ConfidenceLevel = "Low" + ConfidenceLevelUnknown ConfidenceLevel = "Unknown" +) + +func PossibleValuesForConfidenceLevel() []string { + return []string{ + string(ConfidenceLevelHigh), + string(ConfidenceLevelLow), + string(ConfidenceLevelUnknown), + } +} + +func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConfidenceLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { + vals := map[string]ConfidenceLevel{ + "high": ConfidenceLevelHigh, + "low": ConfidenceLevelLow, + "unknown": ConfidenceLevelUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConfidenceLevel(input) + return &out, nil +} + +type ConfidenceScoreStatus string + +const ( + ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" + ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" + ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" + ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" +) + +func PossibleValuesForConfidenceScoreStatus() []string { + return []string{ + string(ConfidenceScoreStatusFinal), + string(ConfidenceScoreStatusInProcess), + string(ConfidenceScoreStatusNotApplicable), + string(ConfidenceScoreStatusNotFinal), + } +} + +func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConfidenceScoreStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { + vals := map[string]ConfidenceScoreStatus{ + "final": ConfidenceScoreStatusFinal, + "inprocess": ConfidenceScoreStatusInProcess, + "notapplicable": ConfidenceScoreStatusNotApplicable, + "notfinal": ConfidenceScoreStatusNotFinal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConfidenceScoreStatus(input) + return &out, nil +} + +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type DeviceImportance string + +const ( + DeviceImportanceHigh DeviceImportance = "High" + DeviceImportanceLow DeviceImportance = "Low" + DeviceImportanceNormal DeviceImportance = "Normal" + DeviceImportanceUnknown DeviceImportance = "Unknown" +) + +func PossibleValuesForDeviceImportance() []string { + return []string{ + string(DeviceImportanceHigh), + string(DeviceImportanceLow), + string(DeviceImportanceNormal), + string(DeviceImportanceUnknown), + } +} + +func (s *DeviceImportance) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeviceImportance(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeviceImportance(input string) (*DeviceImportance, error) { + vals := map[string]DeviceImportance{ + "high": DeviceImportanceHigh, + "low": DeviceImportanceLow, + "normal": DeviceImportanceNormal, + "unknown": DeviceImportanceUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeviceImportance(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKind string const ( @@ -33,7 +557,7 @@ const ( EntityKindSecurityAlert EntityKind = "SecurityAlert" EntityKindSecurityGroup EntityKind = "SecurityGroup" EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" + EntityKindURL EntityKind = "Url" ) func PossibleValuesForEntityKind() []string { @@ -59,7 +583,7 @@ func PossibleValuesForEntityKind() []string { string(EntityKindSecurityAlert), string(EntityKindSecurityGroup), string(EntityKindSubmissionMail), - string(EntityKindUrl), + string(EntityKindURL), } } @@ -99,7 +623,7 @@ func parseEntityKind(input string) (*EntityKind, error) { "securityalert": EntityKindSecurityAlert, "securitygroup": EntityKindSecurityGroup, "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, + "url": EntityKindURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -109,3 +633,351 @@ func parseEntityKind(input string) (*EntityKind, error) { out := EntityKind(input) return &out, nil } + +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + +type IncidentSeverity string + +const ( + IncidentSeverityHigh IncidentSeverity = "High" + IncidentSeverityInformational IncidentSeverity = "Informational" + IncidentSeverityLow IncidentSeverity = "Low" + IncidentSeverityMedium IncidentSeverity = "Medium" +) + +func PossibleValuesForIncidentSeverity() []string { + return []string{ + string(IncidentSeverityHigh), + string(IncidentSeverityInformational), + string(IncidentSeverityLow), + string(IncidentSeverityMedium), + } +} + +func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIncidentSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIncidentSeverity(input string) (*IncidentSeverity, error) { + vals := map[string]IncidentSeverity{ + "high": IncidentSeverityHigh, + "informational": IncidentSeverityInformational, + "low": IncidentSeverityLow, + "medium": IncidentSeverityMedium, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IncidentSeverity(input) + return &out, nil +} + +type KillChainIntent string + +const ( + KillChainIntentCollection KillChainIntent = "Collection" + KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" + KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" + KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" + KillChainIntentDiscovery KillChainIntent = "Discovery" + KillChainIntentExecution KillChainIntent = "Execution" + KillChainIntentExfiltration KillChainIntent = "Exfiltration" + KillChainIntentExploitation KillChainIntent = "Exploitation" + KillChainIntentImpact KillChainIntent = "Impact" + KillChainIntentLateralMovement KillChainIntent = "LateralMovement" + KillChainIntentPersistence KillChainIntent = "Persistence" + KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" + KillChainIntentProbing KillChainIntent = "Probing" + KillChainIntentUnknown KillChainIntent = "Unknown" +) + +func PossibleValuesForKillChainIntent() []string { + return []string{ + string(KillChainIntentCollection), + string(KillChainIntentCommandAndControl), + string(KillChainIntentCredentialAccess), + string(KillChainIntentDefenseEvasion), + string(KillChainIntentDiscovery), + string(KillChainIntentExecution), + string(KillChainIntentExfiltration), + string(KillChainIntentExploitation), + string(KillChainIntentImpact), + string(KillChainIntentLateralMovement), + string(KillChainIntentPersistence), + string(KillChainIntentPrivilegeEscalation), + string(KillChainIntentProbing), + string(KillChainIntentUnknown), + } +} + +func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseKillChainIntent(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseKillChainIntent(input string) (*KillChainIntent, error) { + vals := map[string]KillChainIntent{ + "collection": KillChainIntentCollection, + "commandandcontrol": KillChainIntentCommandAndControl, + "credentialaccess": KillChainIntentCredentialAccess, + "defenseevasion": KillChainIntentDefenseEvasion, + "discovery": KillChainIntentDiscovery, + "execution": KillChainIntentExecution, + "exfiltration": KillChainIntentExfiltration, + "exploitation": KillChainIntentExploitation, + "impact": KillChainIntentImpact, + "lateralmovement": KillChainIntentLateralMovement, + "persistence": KillChainIntentPersistence, + "privilegeescalation": KillChainIntentPrivilegeEscalation, + "probing": KillChainIntentProbing, + "unknown": KillChainIntentUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KillChainIntent(input) + return &out, nil +} + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_accountentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_accountentity.go new file mode 100644 index 00000000000..c9b1caf9299 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_accountentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_accountentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_accountentityproperties.go new file mode 100644 index 00000000000..30b40c2c559 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_azureresourceentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_azureresourceentity.go new file mode 100644 index 00000000000..1cfac264fa5 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..786ba16f1f3 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_bookmarkexpandresponsevalue.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_bookmarkexpandresponsevalue.go index 7da54595645..e1cd51b0237 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_bookmarkexpandresponsevalue.go +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_bookmarkexpandresponsevalue.go @@ -1,5 +1,10 @@ package bookmark +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -7,3 +12,40 @@ type BookmarkExpandResponseValue struct { Edges *[]ConnectedEntity `json:"edges,omitempty"` Entities *[]Entity `json:"entities,omitempty"` } + +var _ json.Unmarshaler = &BookmarkExpandResponseValue{} + +func (s *BookmarkExpandResponseValue) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Edges *[]ConnectedEntity `json:"edges,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Edges = decoded.Edges + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling BookmarkExpandResponseValue into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["entities"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Entities into list []json.RawMessage: %+v", err) + } + + output := make([]Entity, 0) + for i, val := range listTemp { + impl, err := UnmarshalEntityImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Entities' for 'BookmarkExpandResponseValue': %+v", i, err) + } + output = append(output, impl) + } + s.Entities = &output + } + + return nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_cloudapplicationentity.go new file mode 100644 index 00000000000..5d22accdf67 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..83e693f386f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_dnsentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_dnsentity.go new file mode 100644 index 00000000000..ed13fc1d66f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_dnsentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_dnsentityproperties.go new file mode 100644 index 00000000000..d9b84908bd4 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_entity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_entity.go index dd7f8959d78..9a1d2ba6873 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_entity.go +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_entity.go @@ -1,16 +1,249 @@ package bookmark import ( + "encoding/json" + "fmt" + "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type Entity struct { +type Entity interface { + Entity() BaseEntityImpl +} + +var _ Entity = BaseEntityImpl{} + +type BaseEntityImpl struct { Id *string `json:"id,omitempty"` Kind EntityKind `json:"kind"` Name *string `json:"name,omitempty"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +func (s BaseEntityImpl) Entity() BaseEntityImpl { + return s +} + +var _ Entity = RawEntityImpl{} + +// RawEntityImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawEntityImpl struct { + entity BaseEntityImpl + Type string + Values map[string]interface{} +} + +func (s RawEntityImpl) Entity() BaseEntityImpl { + return s.entity +} + +func UnmarshalEntityImplementation(input []byte) (Entity, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["kind"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Bookmark") { + var out HuntingBookmark + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Nic") { + var out NicEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into NicEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SecurityAlert") { + var out SecurityAlert + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + + var parent BaseEntityImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) + } + + return RawEntityImpl{ + entity: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_fileentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_fileentity.go new file mode 100644 index 00000000000..55d33e05113 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_fileentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_fileentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_fileentityproperties.go new file mode 100644 index 00000000000..c8c2ebd2344 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_filehashentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_filehashentity.go new file mode 100644 index 00000000000..3ead8e0e187 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_filehashentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_filehashentityproperties.go new file mode 100644 index 00000000000..9e843001732 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_geolocation.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_geolocation.go new file mode 100644 index 00000000000..bc856e9144c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_geolocation.go @@ -0,0 +1,14 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_hostentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_hostentity.go new file mode 100644 index 00000000000..42f44bb1398 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_hostentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_hostentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_hostentityproperties.go new file mode 100644 index 00000000000..c47a056cccb --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_huntingbookmark.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_huntingbookmark.go new file mode 100644 index 00000000000..f6b37263879 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_huntingbookmark.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HuntingBookmark{} + +type HuntingBookmark struct { + Properties *HuntingBookmarkProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HuntingBookmark) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HuntingBookmark{} + +func (s HuntingBookmark) MarshalJSON() ([]byte, error) { + type wrapper HuntingBookmark + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) + } + + decoded["kind"] = "Bookmark" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_huntingbookmarkproperties.go new file mode 100644 index 00000000000..9e825e36d00 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_huntingbookmarkproperties.go @@ -0,0 +1,62 @@ +package bookmark + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HuntingBookmarkProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Created *string `json:"created,omitempty"` + CreatedBy *UserInfo `json:"createdBy,omitempty"` + DisplayName string `json:"displayName"` + EventTime *string `json:"eventTime,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` + Labels *[]string `json:"labels,omitempty"` + Notes *string `json:"notes,omitempty"` + Query string `json:"query"` + QueryResult *string `json:"queryResult,omitempty"` + Updated *string `json:"updated,omitempty"` + UpdatedBy *UserInfo `json:"updatedBy,omitempty"` +} + +func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { + if o.Created == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") +} + +func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Created = &formatted +} + +func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { + if o.EventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EventTime = &formatted +} + +func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { + if o.Updated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") +} + +func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Updated = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_incidentinfo.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_incidentinfo.go new file mode 100644 index 00000000000..655afdc9a1a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_incidentinfo.go @@ -0,0 +1,11 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IncidentInfo struct { + IncidentId *string `json:"incidentId,omitempty"` + RelationName *string `json:"relationName,omitempty"` + Severity *IncidentSeverity `json:"severity,omitempty"` + Title *string `json:"title,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_iotdeviceentity.go new file mode 100644 index 00000000000..120197bcd09 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..c89a850b9e2 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_iotdeviceentityproperties.go @@ -0,0 +1,37 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceSubType *string `json:"deviceSubType,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + Importance *DeviceImportance `json:"importance,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + IsAuthorized *bool `json:"isAuthorized,omitempty"` + IsProgramming *bool `json:"isProgramming,omitempty"` + IsScanner *bool `json:"isScanner,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + NicEntityIds *[]string `json:"nicEntityIds,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Owners *[]string `json:"owners,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + PurdueLayer *string `json:"purdueLayer,omitempty"` + Sensor *string `json:"sensor,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Site *string `json:"site,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` + Zone *string `json:"zone,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_ipentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_ipentity.go new file mode 100644 index 00000000000..1f32a84e858 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_ipentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_ipentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_ipentityproperties.go new file mode 100644 index 00000000000..36a9ae01402 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailboxentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailboxentity.go new file mode 100644 index 00000000000..985e7619711 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailboxentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailboxentityproperties.go new file mode 100644 index 00000000000..423fd73669b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailclusterentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailclusterentity.go new file mode 100644 index 00000000000..429e95dbfce --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..558ca24b475 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package bookmark + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailmessageentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailmessageentity.go new file mode 100644 index 00000000000..ae8828b2b2a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..caf1e13c76b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package bookmark + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_malwareentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_malwareentity.go new file mode 100644 index 00000000000..1fd43c55caf --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_malwareentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_malwareentityproperties.go new file mode 100644 index 00000000000..929451bce27 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_nicentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_nicentity.go new file mode 100644 index 00000000000..fbfccce4757 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_nicentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = NicEntity{} + +type NicEntity struct { + Properties *NicEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s NicEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = NicEntity{} + +func (s NicEntity) MarshalJSON() ([]byte, error) { + type wrapper NicEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling NicEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling NicEntity: %+v", err) + } + + decoded["kind"] = "Nic" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling NicEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_nicentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_nicentityproperties.go new file mode 100644 index 00000000000..735813c2e16 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_nicentityproperties.go @@ -0,0 +1,12 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Vlans *[]string `json:"vlans,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_processentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_processentity.go new file mode 100644 index 00000000000..e0c28be4c69 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_processentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_processentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_processentityproperties.go new file mode 100644 index 00000000000..6c9a7431784 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_processentityproperties.go @@ -0,0 +1,36 @@ +package bookmark + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registrykeyentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registrykeyentity.go new file mode 100644 index 00000000000..d7325389191 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..3fac48738d7 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registryvalueentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registryvalueentity.go new file mode 100644 index 00000000000..d174ac7bc0b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..d5d7993cec7 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalert.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalert.go new file mode 100644 index 00000000000..2193d7716e1 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalert.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityAlert{} + +type SecurityAlert struct { + Properties *SecurityAlertProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityAlert) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityAlert{} + +func (s SecurityAlert) MarshalJSON() ([]byte, error) { + type wrapper SecurityAlert + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) + } + + decoded["kind"] = "SecurityAlert" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalertproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalertproperties.go new file mode 100644 index 00000000000..73fb7c2d2eb --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalertproperties.go @@ -0,0 +1,88 @@ +package bookmark + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityAlertProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AlertDisplayName *string `json:"alertDisplayName,omitempty"` + AlertLink *string `json:"alertLink,omitempty"` + AlertType *string `json:"alertType,omitempty"` + CompromisedEntity *string `json:"compromisedEntity,omitempty"` + ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` + ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` + ConfidenceScore *float64 `json:"confidenceScore,omitempty"` + ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` + Description *string `json:"description,omitempty"` + EndTimeUtc *string `json:"endTimeUtc,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Intent *KillChainIntent `json:"intent,omitempty"` + ProcessingEndTime *string `json:"processingEndTime,omitempty"` + ProductComponentName *string `json:"productComponentName,omitempty"` + ProductName *string `json:"productName,omitempty"` + ProductVersion *string `json:"productVersion,omitempty"` + ProviderAlertId *string `json:"providerAlertId,omitempty"` + RemediationSteps *[]string `json:"remediationSteps,omitempty"` + ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + StartTimeUtc *string `json:"startTimeUtc,omitempty"` + Status *AlertStatus `json:"status,omitempty"` + SystemAlertId *string `json:"systemAlertId,omitempty"` + Tactics *[]AttackTactic `json:"tactics,omitempty"` + TimeGenerated *string `json:"timeGenerated,omitempty"` + VendorName *string `json:"vendorName,omitempty"` +} + +func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { + if o.EndTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTimeUtc = &formatted +} + +func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { + if o.ProcessingEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ProcessingEndTime = &formatted +} + +func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { + if o.StartTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTimeUtc = &formatted +} + +func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { + if o.TimeGenerated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") +} + +func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeGenerated = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalertpropertiesconfidencereasonsinlined.go new file mode 100644 index 00000000000..72b66ae6fb8 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securityalertpropertiesconfidencereasonsinlined.go @@ -0,0 +1,9 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityAlertPropertiesConfidenceReasonsInlined struct { + Reason *string `json:"reason,omitempty"` + ReasonType *string `json:"reasonType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securitygroupentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securitygroupentity.go new file mode 100644 index 00000000000..e4efc0a422c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..b334d7599bb --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_submissionmailentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_submissionmailentity.go new file mode 100644 index 00000000000..c8f1aeabb67 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..2c822250bb0 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package bookmark + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_threatintelligence.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_threatintelligence.go new file mode 100644 index 00000000000..0e492455e25 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_threatintelligence.go @@ -0,0 +1,13 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_urlentity.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_urlentity.go new file mode 100644 index 00000000000..80d40d76860 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_urlentity.go @@ -0,0 +1,60 @@ +package bookmark + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_urlentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_urlentityproperties.go new file mode 100644 index 00000000000..0256807ceb0 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_userinfo.go b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_userinfo.go new file mode 100644 index 00000000000..435bbd53d90 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/bookmark/model_userinfo.go @@ -0,0 +1,10 @@ +package bookmark + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserInfo struct { + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + ObjectId *string `json:"objectId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/dataconnectors/model_awss3dataconnectorproperties.go b/resource-manager/securityinsights/2022-10-01-preview/dataconnectors/model_awss3dataconnectorproperties.go index cfa37011a38..bdb416c872f 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/dataconnectors/model_awss3dataconnectorproperties.go +++ b/resource-manager/securityinsights/2022-10-01-preview/dataconnectors/model_awss3dataconnectorproperties.go @@ -7,5 +7,5 @@ type AwsS3DataConnectorProperties struct { DataTypes AwsS3DataConnectorDataTypes `json:"dataTypes"` DestinationTable string `json:"destinationTable"` RoleArn string `json:"roleArn"` - SqsUrls []string `json:"sqsUrls"` + SqsURLs []string `json:"sqsUrls"` } diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/constants.go b/resource-manager/securityinsights/2022-10-01-preview/entities/constants.go index 440bec40ce5..275d92e0514 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/entities/constants.go +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/constants.go @@ -56,6 +56,483 @@ func parseAlertSeverity(input string) (*AlertSeverity, error) { return &out, nil } +type AlertStatus string + +const ( + AlertStatusDismissed AlertStatus = "Dismissed" + AlertStatusInProgress AlertStatus = "InProgress" + AlertStatusNew AlertStatus = "New" + AlertStatusResolved AlertStatus = "Resolved" + AlertStatusUnknown AlertStatus = "Unknown" +) + +func PossibleValuesForAlertStatus() []string { + return []string{ + string(AlertStatusDismissed), + string(AlertStatusInProgress), + string(AlertStatusNew), + string(AlertStatusResolved), + string(AlertStatusUnknown), + } +} + +func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAlertStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAlertStatus(input string) (*AlertStatus, error) { + vals := map[string]AlertStatus{ + "dismissed": AlertStatusDismissed, + "inprogress": AlertStatusInProgress, + "new": AlertStatusNew, + "resolved": AlertStatusResolved, + "unknown": AlertStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AlertStatus(input) + return &out, nil +} + +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + +type AttackTactic string + +const ( + AttackTacticCollection AttackTactic = "Collection" + AttackTacticCommandAndControl AttackTactic = "CommandAndControl" + AttackTacticCredentialAccess AttackTactic = "CredentialAccess" + AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" + AttackTacticDiscovery AttackTactic = "Discovery" + AttackTacticExecution AttackTactic = "Execution" + AttackTacticExfiltration AttackTactic = "Exfiltration" + AttackTacticImpact AttackTactic = "Impact" + AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" + AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" + AttackTacticInitialAccess AttackTactic = "InitialAccess" + AttackTacticLateralMovement AttackTactic = "LateralMovement" + AttackTacticPersistence AttackTactic = "Persistence" + AttackTacticPreAttack AttackTactic = "PreAttack" + AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" + AttackTacticReconnaissance AttackTactic = "Reconnaissance" + AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" +) + +func PossibleValuesForAttackTactic() []string { + return []string{ + string(AttackTacticCollection), + string(AttackTacticCommandAndControl), + string(AttackTacticCredentialAccess), + string(AttackTacticDefenseEvasion), + string(AttackTacticDiscovery), + string(AttackTacticExecution), + string(AttackTacticExfiltration), + string(AttackTacticImpact), + string(AttackTacticImpairProcessControl), + string(AttackTacticInhibitResponseFunction), + string(AttackTacticInitialAccess), + string(AttackTacticLateralMovement), + string(AttackTacticPersistence), + string(AttackTacticPreAttack), + string(AttackTacticPrivilegeEscalation), + string(AttackTacticReconnaissance), + string(AttackTacticResourceDevelopment), + } +} + +func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAttackTactic(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAttackTactic(input string) (*AttackTactic, error) { + vals := map[string]AttackTactic{ + "collection": AttackTacticCollection, + "commandandcontrol": AttackTacticCommandAndControl, + "credentialaccess": AttackTacticCredentialAccess, + "defenseevasion": AttackTacticDefenseEvasion, + "discovery": AttackTacticDiscovery, + "execution": AttackTacticExecution, + "exfiltration": AttackTacticExfiltration, + "impact": AttackTacticImpact, + "impairprocesscontrol": AttackTacticImpairProcessControl, + "inhibitresponsefunction": AttackTacticInhibitResponseFunction, + "initialaccess": AttackTacticInitialAccess, + "lateralmovement": AttackTacticLateralMovement, + "persistence": AttackTacticPersistence, + "preattack": AttackTacticPreAttack, + "privilegeescalation": AttackTacticPrivilegeEscalation, + "reconnaissance": AttackTacticReconnaissance, + "resourcedevelopment": AttackTacticResourceDevelopment, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AttackTactic(input) + return &out, nil +} + +type ConfidenceLevel string + +const ( + ConfidenceLevelHigh ConfidenceLevel = "High" + ConfidenceLevelLow ConfidenceLevel = "Low" + ConfidenceLevelUnknown ConfidenceLevel = "Unknown" +) + +func PossibleValuesForConfidenceLevel() []string { + return []string{ + string(ConfidenceLevelHigh), + string(ConfidenceLevelLow), + string(ConfidenceLevelUnknown), + } +} + +func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConfidenceLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { + vals := map[string]ConfidenceLevel{ + "high": ConfidenceLevelHigh, + "low": ConfidenceLevelLow, + "unknown": ConfidenceLevelUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConfidenceLevel(input) + return &out, nil +} + +type ConfidenceScoreStatus string + +const ( + ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" + ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" + ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" + ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" +) + +func PossibleValuesForConfidenceScoreStatus() []string { + return []string{ + string(ConfidenceScoreStatusFinal), + string(ConfidenceScoreStatusInProcess), + string(ConfidenceScoreStatusNotApplicable), + string(ConfidenceScoreStatusNotFinal), + } +} + +func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConfidenceScoreStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { + vals := map[string]ConfidenceScoreStatus{ + "final": ConfidenceScoreStatusFinal, + "inprocess": ConfidenceScoreStatusInProcess, + "notapplicable": ConfidenceScoreStatusNotApplicable, + "notfinal": ConfidenceScoreStatusNotFinal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConfidenceScoreStatus(input) + return &out, nil +} + +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type DeviceImportance string + +const ( + DeviceImportanceHigh DeviceImportance = "High" + DeviceImportanceLow DeviceImportance = "Low" + DeviceImportanceNormal DeviceImportance = "Normal" + DeviceImportanceUnknown DeviceImportance = "Unknown" +) + +func PossibleValuesForDeviceImportance() []string { + return []string{ + string(DeviceImportanceHigh), + string(DeviceImportanceLow), + string(DeviceImportanceNormal), + string(DeviceImportanceUnknown), + } +} + +func (s *DeviceImportance) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeviceImportance(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeviceImportance(input string) (*DeviceImportance, error) { + vals := map[string]DeviceImportance{ + "high": DeviceImportanceHigh, + "low": DeviceImportanceLow, + "normal": DeviceImportanceNormal, + "unknown": DeviceImportanceUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeviceImportance(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityItemQueryKind string const ( @@ -118,7 +595,7 @@ const ( EntityKindSecurityAlert EntityKind = "SecurityAlert" EntityKindSecurityGroup EntityKind = "SecurityGroup" EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" + EntityKindURL EntityKind = "Url" ) func PossibleValuesForEntityKind() []string { @@ -144,7 +621,7 @@ func PossibleValuesForEntityKind() []string { string(EntityKindSecurityAlert), string(EntityKindSecurityGroup), string(EntityKindSubmissionMail), - string(EntityKindUrl), + string(EntityKindURL), } } @@ -184,7 +661,7 @@ func parseEntityKind(input string) (*EntityKind, error) { "securityalert": EntityKindSecurityAlert, "securitygroup": EntityKindSecurityGroup, "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, + "url": EntityKindURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -387,6 +864,56 @@ func parseEntityType(input string) (*EntityType, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type GetInsightsError string const ( @@ -425,6 +952,53 @@ func parseGetInsightsError(input string) (*GetInsightsError, error) { return &out, nil } +type IncidentSeverity string + +const ( + IncidentSeverityHigh IncidentSeverity = "High" + IncidentSeverityInformational IncidentSeverity = "Informational" + IncidentSeverityLow IncidentSeverity = "Low" + IncidentSeverityMedium IncidentSeverity = "Medium" +) + +func PossibleValuesForIncidentSeverity() []string { + return []string{ + string(IncidentSeverityHigh), + string(IncidentSeverityInformational), + string(IncidentSeverityLow), + string(IncidentSeverityMedium), + } +} + +func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIncidentSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIncidentSeverity(input string) (*IncidentSeverity, error) { + vals := map[string]IncidentSeverity{ + "high": IncidentSeverityHigh, + "informational": IncidentSeverityInformational, + "low": IncidentSeverityLow, + "medium": IncidentSeverityMedium, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IncidentSeverity(input) + return &out, nil +} + type KillChainIntent string const ( @@ -502,6 +1076,56 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { return &out, nil } +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + type OutputType string const ( @@ -548,3 +1172,127 @@ func parseOutputType(input string) (*OutputType, error) { out := OutputType(input) return &out, nil } + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/method_get.go b/resource-manager/securityinsights/2022-10-01-preview/entities/method_get.go index 9bdedc5ab43..c8499d9ca29 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/entities/method_get.go +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/method_get.go @@ -2,6 +2,7 @@ package entities import ( "context" + "encoding/json" "net/http" "github.com/hashicorp/go-azure-sdk/sdk/client" @@ -14,7 +15,7 @@ import ( type GetOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *Entity + Model Entity } // Get ... @@ -43,11 +44,15 @@ func (c EntitiesClient) Get(ctx context.Context, id EntityId) (result GetOperati return } - var model Entity - result.Model = &model - if err = resp.Unmarshal(result.Model); err != nil { + var respObj json.RawMessage + if err = resp.Unmarshal(&respObj); err != nil { return } + model, err := UnmarshalEntityImplementation(respObj) + if err != nil { + return + } + result.Model = model return } diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/method_list.go b/resource-manager/securityinsights/2022-10-01-preview/entities/method_list.go index a77faeb381c..01f993b2450 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/entities/method_list.go +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/method_list.go @@ -2,6 +2,7 @@ package entities import ( "context" + "encoding/json" "fmt" "net/http" @@ -63,13 +64,24 @@ func (c EntitiesClient) List(ctx context.Context, id WorkspaceId) (result ListOp } var values struct { - Values *[]Entity `json:"value"` + Values *[]json.RawMessage `json:"value"` } if err = resp.Unmarshal(&values); err != nil { return } - result.Model = values.Values + temp := make([]Entity, 0) + if values.Values != nil { + for i, v := range *values.Values { + val, err := UnmarshalEntityImplementation(v) + if err != nil { + err = fmt.Errorf("unmarshalling item %d for Entity (%q): %+v", i, v, err) + return result, err + } + temp = append(temp, val) + } + } + result.Model = &temp return } diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_accountentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_accountentity.go new file mode 100644 index 00000000000..b15a7a5fa5e --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_accountentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_accountentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_accountentityproperties.go new file mode 100644 index 00000000000..0d9f467d0c0 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_azureresourceentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_azureresourceentity.go new file mode 100644 index 00000000000..48fc7026777 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..a73435ac05e --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_cloudapplicationentity.go new file mode 100644 index 00000000000..9115b4c349b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..322580e2568 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_dnsentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_dnsentity.go new file mode 100644 index 00000000000..be9fd85ce66 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_dnsentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_dnsentityproperties.go new file mode 100644 index 00000000000..45d39a95cba --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_entity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_entity.go index 414ade6a61f..d1c68d3210c 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/entities/model_entity.go +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_entity.go @@ -1,16 +1,249 @@ package entities import ( + "encoding/json" + "fmt" + "strings" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" ) // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type Entity struct { +type Entity interface { + Entity() BaseEntityImpl +} + +var _ Entity = BaseEntityImpl{} + +type BaseEntityImpl struct { Id *string `json:"id,omitempty"` Kind EntityKind `json:"kind"` Name *string `json:"name,omitempty"` SystemData *systemdata.SystemData `json:"systemData,omitempty"` Type *string `json:"type,omitempty"` } + +func (s BaseEntityImpl) Entity() BaseEntityImpl { + return s +} + +var _ Entity = RawEntityImpl{} + +// RawEntityImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawEntityImpl struct { + entity BaseEntityImpl + Type string + Values map[string]interface{} +} + +func (s RawEntityImpl) Entity() BaseEntityImpl { + return s.entity +} + +func UnmarshalEntityImplementation(input []byte) (Entity, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["kind"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Bookmark") { + var out HuntingBookmark + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Nic") { + var out NicEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into NicEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SecurityAlert") { + var out SecurityAlert + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + + var parent BaseEntityImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) + } + + return RawEntityImpl{ + entity: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_entityexpandresponsevalue.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_entityexpandresponsevalue.go index 7d2a9e3d68a..0ea4a702f2e 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/entities/model_entityexpandresponsevalue.go +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_entityexpandresponsevalue.go @@ -1,5 +1,10 @@ package entities +import ( + "encoding/json" + "fmt" +) + // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. @@ -7,3 +12,40 @@ type EntityExpandResponseValue struct { Edges *[]EntityEdges `json:"edges,omitempty"` Entities *[]Entity `json:"entities,omitempty"` } + +var _ json.Unmarshaler = &EntityExpandResponseValue{} + +func (s *EntityExpandResponseValue) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Edges *[]EntityEdges `json:"edges,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Edges = decoded.Edges + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling EntityExpandResponseValue into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["entities"]; ok { + var listTemp []json.RawMessage + if err := json.Unmarshal(v, &listTemp); err != nil { + return fmt.Errorf("unmarshaling Entities into list []json.RawMessage: %+v", err) + } + + output := make([]Entity, 0) + for i, val := range listTemp { + impl, err := UnmarshalEntityImplementation(val) + if err != nil { + return fmt.Errorf("unmarshaling index %d field 'Entities' for 'EntityExpandResponseValue': %+v", i, err) + } + output = append(output, impl) + } + s.Entities = &output + } + + return nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_fileentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_fileentity.go new file mode 100644 index 00000000000..0393633124c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_fileentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_fileentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_fileentityproperties.go new file mode 100644 index 00000000000..5b36a99b46c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_filehashentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_filehashentity.go new file mode 100644 index 00000000000..6483136acd3 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_filehashentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_filehashentityproperties.go new file mode 100644 index 00000000000..831d3d78427 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_geolocation.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_geolocation.go new file mode 100644 index 00000000000..061f900bb4e --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_geolocation.go @@ -0,0 +1,14 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_hostentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_hostentity.go new file mode 100644 index 00000000000..6205248e43c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_hostentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_hostentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_hostentityproperties.go new file mode 100644 index 00000000000..a7a0a8034fd --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_huntingbookmark.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_huntingbookmark.go new file mode 100644 index 00000000000..89fa554fa2f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_huntingbookmark.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HuntingBookmark{} + +type HuntingBookmark struct { + Properties *HuntingBookmarkProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HuntingBookmark) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HuntingBookmark{} + +func (s HuntingBookmark) MarshalJSON() ([]byte, error) { + type wrapper HuntingBookmark + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) + } + + decoded["kind"] = "Bookmark" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_huntingbookmarkproperties.go new file mode 100644 index 00000000000..fb6a986a111 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_huntingbookmarkproperties.go @@ -0,0 +1,62 @@ +package entities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HuntingBookmarkProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Created *string `json:"created,omitempty"` + CreatedBy *UserInfo `json:"createdBy,omitempty"` + DisplayName string `json:"displayName"` + EventTime *string `json:"eventTime,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` + Labels *[]string `json:"labels,omitempty"` + Notes *string `json:"notes,omitempty"` + Query string `json:"query"` + QueryResult *string `json:"queryResult,omitempty"` + Updated *string `json:"updated,omitempty"` + UpdatedBy *UserInfo `json:"updatedBy,omitempty"` +} + +func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { + if o.Created == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") +} + +func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Created = &formatted +} + +func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { + if o.EventTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EventTime = &formatted +} + +func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { + if o.Updated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") +} + +func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Updated = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_incidentinfo.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_incidentinfo.go new file mode 100644 index 00000000000..d0295dc52b8 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_incidentinfo.go @@ -0,0 +1,11 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IncidentInfo struct { + IncidentId *string `json:"incidentId,omitempty"` + RelationName *string `json:"relationName,omitempty"` + Severity *IncidentSeverity `json:"severity,omitempty"` + Title *string `json:"title,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_iotdeviceentity.go new file mode 100644 index 00000000000..8156cbb9b37 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..cb0914aa1f4 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_iotdeviceentityproperties.go @@ -0,0 +1,37 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceSubType *string `json:"deviceSubType,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + Importance *DeviceImportance `json:"importance,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + IsAuthorized *bool `json:"isAuthorized,omitempty"` + IsProgramming *bool `json:"isProgramming,omitempty"` + IsScanner *bool `json:"isScanner,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + NicEntityIds *[]string `json:"nicEntityIds,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Owners *[]string `json:"owners,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + PurdueLayer *string `json:"purdueLayer,omitempty"` + Sensor *string `json:"sensor,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Site *string `json:"site,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` + Zone *string `json:"zone,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_ipentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_ipentity.go new file mode 100644 index 00000000000..5746275ed71 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_ipentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_ipentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_ipentityproperties.go new file mode 100644 index 00000000000..3b334dac578 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailboxentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailboxentity.go new file mode 100644 index 00000000000..bcbcf181d21 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailboxentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailboxentityproperties.go new file mode 100644 index 00000000000..e5e32621a75 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailclusterentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailclusterentity.go new file mode 100644 index 00000000000..348c99945fb --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..e8d730b5a9f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package entities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailmessageentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailmessageentity.go new file mode 100644 index 00000000000..d988a68542d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..dea9aab70e1 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package entities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_malwareentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_malwareentity.go new file mode 100644 index 00000000000..43d2fa11f3c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_malwareentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_malwareentityproperties.go new file mode 100644 index 00000000000..b1aaa63e8cb --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_nicentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_nicentity.go new file mode 100644 index 00000000000..978b7d81cfa --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_nicentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = NicEntity{} + +type NicEntity struct { + Properties *NicEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s NicEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = NicEntity{} + +func (s NicEntity) MarshalJSON() ([]byte, error) { + type wrapper NicEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling NicEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling NicEntity: %+v", err) + } + + decoded["kind"] = "Nic" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling NicEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_nicentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_nicentityproperties.go new file mode 100644 index 00000000000..0de22f1c820 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_nicentityproperties.go @@ -0,0 +1,12 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Vlans *[]string `json:"vlans,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_processentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_processentity.go new file mode 100644 index 00000000000..20f9a40ce10 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_processentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_processentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_processentityproperties.go new file mode 100644 index 00000000000..e2820b80fb9 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_processentityproperties.go @@ -0,0 +1,36 @@ +package entities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_registrykeyentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_registrykeyentity.go new file mode 100644 index 00000000000..3156be7cfe1 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..611f26701f4 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_registryvalueentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_registryvalueentity.go new file mode 100644 index 00000000000..ec550590714 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..b8316b96db3 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalert.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalert.go new file mode 100644 index 00000000000..86a6fc7e7f2 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalert.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityAlert{} + +type SecurityAlert struct { + Properties *SecurityAlertProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityAlert) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityAlert{} + +func (s SecurityAlert) MarshalJSON() ([]byte, error) { + type wrapper SecurityAlert + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) + } + + decoded["kind"] = "SecurityAlert" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalertproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalertproperties.go new file mode 100644 index 00000000000..d0e112763f3 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalertproperties.go @@ -0,0 +1,88 @@ +package entities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityAlertProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AlertDisplayName *string `json:"alertDisplayName,omitempty"` + AlertLink *string `json:"alertLink,omitempty"` + AlertType *string `json:"alertType,omitempty"` + CompromisedEntity *string `json:"compromisedEntity,omitempty"` + ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` + ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` + ConfidenceScore *float64 `json:"confidenceScore,omitempty"` + ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` + Description *string `json:"description,omitempty"` + EndTimeUtc *string `json:"endTimeUtc,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Intent *KillChainIntent `json:"intent,omitempty"` + ProcessingEndTime *string `json:"processingEndTime,omitempty"` + ProductComponentName *string `json:"productComponentName,omitempty"` + ProductName *string `json:"productName,omitempty"` + ProductVersion *string `json:"productVersion,omitempty"` + ProviderAlertId *string `json:"providerAlertId,omitempty"` + RemediationSteps *[]string `json:"remediationSteps,omitempty"` + ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` + Severity *AlertSeverity `json:"severity,omitempty"` + StartTimeUtc *string `json:"startTimeUtc,omitempty"` + Status *AlertStatus `json:"status,omitempty"` + SystemAlertId *string `json:"systemAlertId,omitempty"` + Tactics *[]AttackTactic `json:"tactics,omitempty"` + TimeGenerated *string `json:"timeGenerated,omitempty"` + VendorName *string `json:"vendorName,omitempty"` +} + +func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { + if o.EndTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.EndTimeUtc = &formatted +} + +func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { + if o.ProcessingEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ProcessingEndTime = &formatted +} + +func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { + if o.StartTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.StartTimeUtc = &formatted +} + +func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { + if o.TimeGenerated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") +} + +func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeGenerated = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalertpropertiesconfidencereasonsinlined.go new file mode 100644 index 00000000000..651876e9648 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securityalertpropertiesconfidencereasonsinlined.go @@ -0,0 +1,9 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityAlertPropertiesConfidenceReasonsInlined struct { + Reason *string `json:"reason,omitempty"` + ReasonType *string `json:"reasonType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_securitygroupentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securitygroupentity.go new file mode 100644 index 00000000000..113d2380fff --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..85433af42fa --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_submissionmailentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_submissionmailentity.go new file mode 100644 index 00000000000..7517425ce04 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..5df15384e27 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package entities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_threatintelligence.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_threatintelligence.go new file mode 100644 index 00000000000..55cb2fe74bb --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_threatintelligence.go @@ -0,0 +1,13 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_urlentity.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_urlentity.go new file mode 100644 index 00000000000..2c2f4acec69 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_urlentity.go @@ -0,0 +1,60 @@ +package entities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/model_urlentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/entities/model_urlentityproperties.go new file mode 100644 index 00000000000..47260dac7e2 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package entities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/entities/predicates.go b/resource-manager/securityinsights/2022-10-01-preview/entities/predicates.go index f0f983c5e68..69320f46610 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/entities/predicates.go +++ b/resource-manager/securityinsights/2022-10-01-preview/entities/predicates.go @@ -4,24 +4,9 @@ package entities // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type EntityOperationPredicate struct { - Id *string - Name *string - Type *string } func (p EntityOperationPredicate) Matches(input Entity) bool { - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - return true } diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/constants.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/constants.go index 5d286095967..53ceea5de83 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/constants.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,209 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type DeviceImportance string + +const ( + DeviceImportanceHigh DeviceImportance = "High" + DeviceImportanceLow DeviceImportance = "Low" + DeviceImportanceNormal DeviceImportance = "Normal" + DeviceImportanceUnknown DeviceImportance = "Unknown" +) + +func PossibleValuesForDeviceImportance() []string { + return []string{ + string(DeviceImportanceHigh), + string(DeviceImportanceLow), + string(DeviceImportanceNormal), + string(DeviceImportanceUnknown), + } +} + +func (s *DeviceImportance) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeviceImportance(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeviceImportance(input string) (*DeviceImportance, error) { + vals := map[string]DeviceImportance{ + "high": DeviceImportanceHigh, + "low": DeviceImportanceLow, + "normal": DeviceImportanceNormal, + "unknown": DeviceImportanceUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeviceImportance(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKind string const ( @@ -307,7 +557,7 @@ const ( EntityKindSecurityAlert EntityKind = "SecurityAlert" EntityKindSecurityGroup EntityKind = "SecurityGroup" EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" + EntityKindURL EntityKind = "Url" ) func PossibleValuesForEntityKind() []string { @@ -333,7 +583,7 @@ func PossibleValuesForEntityKind() []string { string(EntityKindSecurityAlert), string(EntityKindSecurityGroup), string(EntityKindSubmissionMail), - string(EntityKindUrl), + string(EntityKindURL), } } @@ -373,7 +623,7 @@ func parseEntityKind(input string) (*EntityKind, error) { "securityalert": EntityKindSecurityAlert, "securitygroup": EntityKindSecurityGroup, "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, + "url": EntityKindURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -384,6 +634,56 @@ func parseEntityKind(input string) (*EntityKind, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -507,3 +807,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_accountentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_accountentity.go new file mode 100644 index 00000000000..6b48fb0e311 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_accountentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_accountentityproperties.go new file mode 100644 index 00000000000..bea9c6688c2 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_azureresourceentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_azureresourceentity.go new file mode 100644 index 00000000000..f4b8ecba95b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..5cff8e6e036 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_cloudapplicationentity.go new file mode 100644 index 00000000000..0fca6a3994f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..76fa08b95a3 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_dnsentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_dnsentity.go new file mode 100644 index 00000000000..379770bf006 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_dnsentityproperties.go new file mode 100644 index 00000000000..09bddcc3c1d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_entity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_entity.go index f9bca79937b..ba5a5895da6 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_entity.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,86 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Nic") { + var out NicEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into NicEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +211,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_fileentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_fileentity.go new file mode 100644 index 00000000000..945f6d433b2 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_fileentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_fileentityproperties.go new file mode 100644 index 00000000000..5be66cedd3a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_filehashentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_filehashentity.go new file mode 100644 index 00000000000..30fca275686 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_filehashentityproperties.go new file mode 100644 index 00000000000..217a5c82ea4 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_geolocation.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_geolocation.go new file mode 100644 index 00000000000..898225b3df8 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_hostentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_hostentity.go new file mode 100644 index 00000000000..d4cf4541fc4 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_hostentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_hostentityproperties.go new file mode 100644 index 00000000000..cb32a85ac54 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_iotdeviceentity.go new file mode 100644 index 00000000000..ef40e395804 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..477c6f9af8c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_iotdeviceentityproperties.go @@ -0,0 +1,37 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceSubType *string `json:"deviceSubType,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + Importance *DeviceImportance `json:"importance,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + IsAuthorized *bool `json:"isAuthorized,omitempty"` + IsProgramming *bool `json:"isProgramming,omitempty"` + IsScanner *bool `json:"isScanner,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + NicEntityIds *[]string `json:"nicEntityIds,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Owners *[]string `json:"owners,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + PurdueLayer *string `json:"purdueLayer,omitempty"` + Sensor *string `json:"sensor,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Site *string `json:"site,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` + Zone *string `json:"zone,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_ipentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_ipentity.go new file mode 100644 index 00000000000..4f0fa45388e --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_ipentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_ipentityproperties.go new file mode 100644 index 00000000000..06f095e8b80 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailboxentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailboxentity.go new file mode 100644 index 00000000000..f2612ef6aca --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailboxentityproperties.go new file mode 100644 index 00000000000..c6a5ba8ede4 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailclusterentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailclusterentity.go new file mode 100644 index 00000000000..53ee32d7b3a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..9686f0be9fe --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailmessageentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailmessageentity.go new file mode 100644 index 00000000000..4a6ac421d2b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..5d3504977c7 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_malwareentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_malwareentity.go new file mode 100644 index 00000000000..700e177c42e --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_malwareentityproperties.go new file mode 100644 index 00000000000..6c6be031d30 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_nicentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_nicentity.go new file mode 100644 index 00000000000..86acd99f96d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_nicentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = NicEntity{} + +type NicEntity struct { + Properties *NicEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s NicEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = NicEntity{} + +func (s NicEntity) MarshalJSON() ([]byte, error) { + type wrapper NicEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling NicEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling NicEntity: %+v", err) + } + + decoded["kind"] = "Nic" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling NicEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_nicentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_nicentityproperties.go new file mode 100644 index 00000000000..14f9d50a891 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_nicentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Vlans *[]string `json:"vlans,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_processentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_processentity.go new file mode 100644 index 00000000000..f556aa4337f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_processentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_processentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_processentityproperties.go new file mode 100644 index 00000000000..17eaa2f563d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registrykeyentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registrykeyentity.go new file mode 100644 index 00000000000..1b538257a10 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..142c523838a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registryvalueentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registryvalueentity.go new file mode 100644 index 00000000000..daf28c31334 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..8d450105818 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_securitygroupentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_securitygroupentity.go new file mode 100644 index 00000000000..b68c1fda32d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..39efb87c8fa --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_submissionmailentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_submissionmailentity.go new file mode 100644 index 00000000000..44c27e58930 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..a58834a943a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_threatintelligence.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_threatintelligence.go new file mode 100644 index 00000000000..3eb0e546118 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_urlentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_urlentity.go new file mode 100644 index 00000000000..5e69a4a6a9d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_urlentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_urlentityproperties.go new file mode 100644 index 00000000000..a2b6bebe4fd --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentalerts/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/constants.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/constants.go index 1731dc01ffe..67a7e8124f4 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/constants.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,209 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type DeviceImportance string + +const ( + DeviceImportanceHigh DeviceImportance = "High" + DeviceImportanceLow DeviceImportance = "Low" + DeviceImportanceNormal DeviceImportance = "Normal" + DeviceImportanceUnknown DeviceImportance = "Unknown" +) + +func PossibleValuesForDeviceImportance() []string { + return []string{ + string(DeviceImportanceHigh), + string(DeviceImportanceLow), + string(DeviceImportanceNormal), + string(DeviceImportanceUnknown), + } +} + +func (s *DeviceImportance) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeviceImportance(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeviceImportance(input string) (*DeviceImportance, error) { + vals := map[string]DeviceImportance{ + "high": DeviceImportanceHigh, + "low": DeviceImportanceLow, + "normal": DeviceImportanceNormal, + "unknown": DeviceImportanceUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeviceImportance(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKind string const ( @@ -307,7 +557,7 @@ const ( EntityKindSecurityAlert EntityKind = "SecurityAlert" EntityKindSecurityGroup EntityKind = "SecurityGroup" EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" + EntityKindURL EntityKind = "Url" ) func PossibleValuesForEntityKind() []string { @@ -333,7 +583,7 @@ func PossibleValuesForEntityKind() []string { string(EntityKindSecurityAlert), string(EntityKindSecurityGroup), string(EntityKindSubmissionMail), - string(EntityKindUrl), + string(EntityKindURL), } } @@ -373,7 +623,7 @@ func parseEntityKind(input string) (*EntityKind, error) { "securityalert": EntityKindSecurityAlert, "securitygroup": EntityKindSecurityGroup, "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, + "url": EntityKindURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -384,6 +634,56 @@ func parseEntityKind(input string) (*EntityKind, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -507,3 +807,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_accountentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_accountentity.go new file mode 100644 index 00000000000..d64b6d9681c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_accountentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_accountentityproperties.go new file mode 100644 index 00000000000..b13c03c7627 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_azureresourceentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_azureresourceentity.go new file mode 100644 index 00000000000..977a2509205 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..41965d40066 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_cloudapplicationentity.go new file mode 100644 index 00000000000..3befdbd516b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..6bb7154af33 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_dnsentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_dnsentity.go new file mode 100644 index 00000000000..06dd0b50d2d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_dnsentityproperties.go new file mode 100644 index 00000000000..a670857ebdc --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_entity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_entity.go index a15324f896d..ca25e30b346 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_entity.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,86 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Nic") { + var out NicEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into NicEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +211,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_fileentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_fileentity.go new file mode 100644 index 00000000000..cc0165587fa --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_fileentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_fileentityproperties.go new file mode 100644 index 00000000000..9b38ca6b70d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_filehashentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_filehashentity.go new file mode 100644 index 00000000000..d5fa97c03c7 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_filehashentityproperties.go new file mode 100644 index 00000000000..faab857b3c3 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_geolocation.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_geolocation.go new file mode 100644 index 00000000000..8d991bfadbe --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_hostentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_hostentity.go new file mode 100644 index 00000000000..30804906146 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_hostentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_hostentityproperties.go new file mode 100644 index 00000000000..f18b13c2a92 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_iotdeviceentity.go new file mode 100644 index 00000000000..4a70f3241ec --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..8e91affea88 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_iotdeviceentityproperties.go @@ -0,0 +1,37 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceSubType *string `json:"deviceSubType,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + Importance *DeviceImportance `json:"importance,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + IsAuthorized *bool `json:"isAuthorized,omitempty"` + IsProgramming *bool `json:"isProgramming,omitempty"` + IsScanner *bool `json:"isScanner,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + NicEntityIds *[]string `json:"nicEntityIds,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Owners *[]string `json:"owners,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + PurdueLayer *string `json:"purdueLayer,omitempty"` + Sensor *string `json:"sensor,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Site *string `json:"site,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` + Zone *string `json:"zone,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_ipentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_ipentity.go new file mode 100644 index 00000000000..7488f32bc3d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_ipentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_ipentityproperties.go new file mode 100644 index 00000000000..b8f9205b617 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailboxentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailboxentity.go new file mode 100644 index 00000000000..10b473a8aff --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailboxentityproperties.go new file mode 100644 index 00000000000..2ef65bec27a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailclusterentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailclusterentity.go new file mode 100644 index 00000000000..b3350b33449 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..d48338571ae --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailmessageentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailmessageentity.go new file mode 100644 index 00000000000..a6364402df2 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..6e9d5ea8196 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_malwareentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_malwareentity.go new file mode 100644 index 00000000000..feb7bc7098e --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_malwareentityproperties.go new file mode 100644 index 00000000000..e1e088edd7f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_nicentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_nicentity.go new file mode 100644 index 00000000000..2ebab96952d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_nicentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = NicEntity{} + +type NicEntity struct { + Properties *NicEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s NicEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = NicEntity{} + +func (s NicEntity) MarshalJSON() ([]byte, error) { + type wrapper NicEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling NicEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling NicEntity: %+v", err) + } + + decoded["kind"] = "Nic" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling NicEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_nicentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_nicentityproperties.go new file mode 100644 index 00000000000..265417b80a6 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_nicentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Vlans *[]string `json:"vlans,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_processentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_processentity.go new file mode 100644 index 00000000000..189acb8b3d0 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_processentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_processentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_processentityproperties.go new file mode 100644 index 00000000000..aa48daa6670 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registrykeyentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registrykeyentity.go new file mode 100644 index 00000000000..fa468bc73d6 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..52f430f95ed --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registryvalueentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registryvalueentity.go new file mode 100644 index 00000000000..ed3b2d0e612 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..a92743b2653 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_securitygroupentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_securitygroupentity.go new file mode 100644 index 00000000000..6cd8dea230a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..64a0c390803 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_submissionmailentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_submissionmailentity.go new file mode 100644 index 00000000000..08ec298a100 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..e44c2ead063 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_threatintelligence.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_threatintelligence.go new file mode 100644 index 00000000000..f2b23759950 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_urlentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_urlentity.go new file mode 100644 index 00000000000..98367341f45 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_urlentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_urlentityproperties.go new file mode 100644 index 00000000000..42f90823058 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentbookmarks/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/constants.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/constants.go index 996bca7e8dc..f4430cb3c80 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidententities/constants.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,209 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type DeviceImportance string + +const ( + DeviceImportanceHigh DeviceImportance = "High" + DeviceImportanceLow DeviceImportance = "Low" + DeviceImportanceNormal DeviceImportance = "Normal" + DeviceImportanceUnknown DeviceImportance = "Unknown" +) + +func PossibleValuesForDeviceImportance() []string { + return []string{ + string(DeviceImportanceHigh), + string(DeviceImportanceLow), + string(DeviceImportanceNormal), + string(DeviceImportanceUnknown), + } +} + +func (s *DeviceImportance) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeviceImportance(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeviceImportance(input string) (*DeviceImportance, error) { + vals := map[string]DeviceImportance{ + "high": DeviceImportanceHigh, + "low": DeviceImportanceLow, + "normal": DeviceImportanceNormal, + "unknown": DeviceImportanceUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeviceImportance(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKind string const ( @@ -307,7 +557,7 @@ const ( EntityKindSecurityAlert EntityKind = "SecurityAlert" EntityKindSecurityGroup EntityKind = "SecurityGroup" EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" + EntityKindURL EntityKind = "Url" ) func PossibleValuesForEntityKind() []string { @@ -333,7 +583,7 @@ func PossibleValuesForEntityKind() []string { string(EntityKindSecurityAlert), string(EntityKindSecurityGroup), string(EntityKindSubmissionMail), - string(EntityKindUrl), + string(EntityKindURL), } } @@ -373,7 +623,7 @@ func parseEntityKind(input string) (*EntityKind, error) { "securityalert": EntityKindSecurityAlert, "securitygroup": EntityKindSecurityGroup, "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, + "url": EntityKindURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -384,6 +634,56 @@ func parseEntityKind(input string) (*EntityKind, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -507,3 +807,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_accountentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_accountentity.go new file mode 100644 index 00000000000..c41a2186c4e --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_accountentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_accountentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_accountentityproperties.go new file mode 100644 index 00000000000..5b0a3ae3126 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_azureresourceentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_azureresourceentity.go new file mode 100644 index 00000000000..b2e54631d77 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..9974c18dca0 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_cloudapplicationentity.go new file mode 100644 index 00000000000..1f8e665b4ec --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..4cb5d5e4089 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_dnsentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_dnsentity.go new file mode 100644 index 00000000000..a3ca50cc8d8 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_dnsentityproperties.go new file mode 100644 index 00000000000..e919d9284f8 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_entity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_entity.go index 7c3be13f7e8..5d21a46cb8a 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_entity.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,86 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Nic") { + var out NicEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into NicEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +211,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_fileentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_fileentity.go new file mode 100644 index 00000000000..5a3c531223c --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_fileentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_fileentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_fileentityproperties.go new file mode 100644 index 00000000000..392a0b4cd13 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_filehashentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_filehashentity.go new file mode 100644 index 00000000000..e429d5d4062 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_filehashentityproperties.go new file mode 100644 index 00000000000..b5214190c07 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_geolocation.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_geolocation.go new file mode 100644 index 00000000000..1873bfc3721 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_geolocation.go @@ -0,0 +1,14 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_hostentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_hostentity.go new file mode 100644 index 00000000000..5200f8cca01 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_hostentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_hostentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_hostentityproperties.go new file mode 100644 index 00000000000..6ab99b1567f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_iotdeviceentity.go new file mode 100644 index 00000000000..b16f172d1f0 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..8efe7b69041 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_iotdeviceentityproperties.go @@ -0,0 +1,37 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceSubType *string `json:"deviceSubType,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + Importance *DeviceImportance `json:"importance,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + IsAuthorized *bool `json:"isAuthorized,omitempty"` + IsProgramming *bool `json:"isProgramming,omitempty"` + IsScanner *bool `json:"isScanner,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + NicEntityIds *[]string `json:"nicEntityIds,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Owners *[]string `json:"owners,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + PurdueLayer *string `json:"purdueLayer,omitempty"` + Sensor *string `json:"sensor,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Site *string `json:"site,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` + Zone *string `json:"zone,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_ipentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_ipentity.go new file mode 100644 index 00000000000..5b46d6cb7b1 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_ipentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_ipentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_ipentityproperties.go new file mode 100644 index 00000000000..c45639329c3 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailboxentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailboxentity.go new file mode 100644 index 00000000000..507f22821d2 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailboxentityproperties.go new file mode 100644 index 00000000000..76bb706818b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailclusterentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailclusterentity.go new file mode 100644 index 00000000000..f105a0563a4 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..a0369aaea70 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailmessageentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailmessageentity.go new file mode 100644 index 00000000000..0484c58da84 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..7749df3a379 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_malwareentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_malwareentity.go new file mode 100644 index 00000000000..82afe18671f --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_malwareentityproperties.go new file mode 100644 index 00000000000..050ed004a26 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_nicentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_nicentity.go new file mode 100644 index 00000000000..5f2a05fd6b8 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_nicentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = NicEntity{} + +type NicEntity struct { + Properties *NicEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s NicEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = NicEntity{} + +func (s NicEntity) MarshalJSON() ([]byte, error) { + type wrapper NicEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling NicEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling NicEntity: %+v", err) + } + + decoded["kind"] = "Nic" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling NicEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_nicentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_nicentityproperties.go new file mode 100644 index 00000000000..d4cc57af338 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_nicentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Vlans *[]string `json:"vlans,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_processentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_processentity.go new file mode 100644 index 00000000000..9fe748e44fd --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_processentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_processentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_processentityproperties.go new file mode 100644 index 00000000000..9925af5f68e --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registrykeyentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registrykeyentity.go new file mode 100644 index 00000000000..f2634c79611 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..2cf5e550a3b --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registryvalueentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registryvalueentity.go new file mode 100644 index 00000000000..27430f75575 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..50c0977987d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_securitygroupentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_securitygroupentity.go new file mode 100644 index 00000000000..133e2ae93df --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..7cfd2f42392 --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_submissionmailentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_submissionmailentity.go new file mode 100644 index 00000000000..4dfcc04881d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..7b758af6c9d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_threatintelligence.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_threatintelligence.go new file mode 100644 index 00000000000..83d6e3b356a --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_urlentity.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_urlentity.go new file mode 100644 index 00000000000..4eb9ccfe2aa --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_urlentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKind `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_urlentityproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_urlentityproperties.go new file mode 100644 index 00000000000..759e236694d --- /dev/null +++ b/resource-manager/securityinsights/2022-10-01-preview/incidententities/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidents/model_incidentadditionaldata.go b/resource-manager/securityinsights/2022-10-01-preview/incidents/model_incidentadditionaldata.go index 47c0b6b4f9e..dffeb8890fa 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidents/model_incidentadditionaldata.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidents/model_incidentadditionaldata.go @@ -8,7 +8,7 @@ type IncidentAdditionalData struct { AlertsCount *int64 `json:"alertsCount,omitempty"` BookmarksCount *int64 `json:"bookmarksCount,omitempty"` CommentsCount *int64 `json:"commentsCount,omitempty"` - ProviderIncidentUrl *string `json:"providerIncidentUrl,omitempty"` + ProviderIncidentURL *string `json:"providerIncidentUrl,omitempty"` Tactics *[]AttackTactic `json:"tactics,omitempty"` Techniques *[]string `json:"techniques,omitempty"` } diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidents/model_incidentproperties.go b/resource-manager/securityinsights/2022-10-01-preview/incidents/model_incidentproperties.go index 8ecfb7aa260..64c8b29501d 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidents/model_incidentproperties.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidents/model_incidentproperties.go @@ -18,7 +18,7 @@ type IncidentProperties struct { Description *string `json:"description,omitempty"` FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"` IncidentNumber *int64 `json:"incidentNumber,omitempty"` - IncidentUrl *string `json:"incidentUrl,omitempty"` + IncidentURL *string `json:"incidentUrl,omitempty"` Labels *[]IncidentLabel `json:"labels,omitempty"` LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"` LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidents/model_teaminformation.go b/resource-manager/securityinsights/2022-10-01-preview/incidents/model_teaminformation.go index 2ce83593a2a..8b256544e57 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidents/model_teaminformation.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidents/model_teaminformation.go @@ -12,7 +12,7 @@ import ( type TeamInformation struct { Description *string `json:"description,omitempty"` Name *string `json:"name,omitempty"` - PrimaryChannelUrl *string `json:"primaryChannelUrl,omitempty"` + PrimaryChannelURL *string `json:"primaryChannelUrl,omitempty"` TeamCreationTimeUtc *string `json:"teamCreationTimeUtc,omitempty"` TeamId *string `json:"teamId,omitempty"` } diff --git a/resource-manager/securityinsights/2022-10-01-preview/incidentteam/model_teaminformation.go b/resource-manager/securityinsights/2022-10-01-preview/incidentteam/model_teaminformation.go index b3e84ff0fc7..3d06948a539 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/incidentteam/model_teaminformation.go +++ b/resource-manager/securityinsights/2022-10-01-preview/incidentteam/model_teaminformation.go @@ -12,7 +12,7 @@ import ( type TeamInformation struct { Description *string `json:"description,omitempty"` Name *string `json:"name,omitempty"` - PrimaryChannelUrl *string `json:"primaryChannelUrl,omitempty"` + PrimaryChannelURL *string `json:"primaryChannelUrl,omitempty"` TeamCreationTimeUtc *string `json:"teamCreationTimeUtc,omitempty"` TeamId *string `json:"teamId,omitempty"` } diff --git a/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/README.md b/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/README.md index f6bc9bbfa14..66121e988f1 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/README.md +++ b/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") payload := securitymlanalyticssettings.SecurityMLAnalyticsSetting{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting.go b/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting.go index 664c157d691..18bac933415 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting.go +++ b/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting.go @@ -125,7 +125,7 @@ func (id SecurityMLAnalyticsSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticSecurityMLAnalyticsSettings", "securityMLAnalyticsSettings", "securityMLAnalyticsSettings"), - resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "settingsResourceName"), + resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "securityMLAnalyticsSettingName"), } } diff --git a/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go b/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go index f815f97f834..87ffe04f752 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go +++ b/resource-manager/securityinsights/2022-10-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityMLAnalyticsSettingId{} func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { - id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") + id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.SecurityMLAnalyticsSettingName != "settingsResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "settingsResourceName") + if id.SecurityMLAnalyticsSettingName != "securityMLAnalyticsSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "securityMLAnalyticsSettingName") } } func TestFormatSecurityMLAnalyticsSettingID(t *testing.T) { - actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName" + actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseSecurityMLAnalyticsSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseSecurityMLAnalyticsSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - SecurityMLAnalyticsSettingName: "sEtTiNgSrEsOuRcEnAmE", + SecurityMLAnalyticsSettingName: "sEcUrItYmLaNaLyTiCsSeTtInGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/README.md b/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/README.md index c6c92789c0a..d41b303559e 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/README.md +++ b/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") payload := sentinelonboardingstates.SentinelOnboardingState{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/id_onboardingstate.go b/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/id_onboardingstate.go index ea535534399..4e285b13c5c 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/id_onboardingstate.go +++ b/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/id_onboardingstate.go @@ -125,7 +125,7 @@ func (id OnboardingStateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticOnboardingStates", "onboardingStates", "onboardingStates"), - resourceids.UserSpecifiedSegment("onboardingStateName", "sentinelOnboardingStateName"), + resourceids.UserSpecifiedSegment("onboardingStateName", "onboardingStateName"), } } diff --git a/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/id_onboardingstate_test.go b/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/id_onboardingstate_test.go index a601d0b8cb2..53228c86aad 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/id_onboardingstate_test.go +++ b/resource-manager/securityinsights/2022-10-01-preview/sentinelonboardingstates/id_onboardingstate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OnboardingStateId{} func TestNewOnboardingStateID(t *testing.T) { - id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") + id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOnboardingStateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OnboardingStateName != "sentinelOnboardingStateName" { - t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "sentinelOnboardingStateName") + if id.OnboardingStateName != "onboardingStateName" { + t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "onboardingStateName") } } func TestFormatOnboardingStateID(t *testing.T) { - actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName" + actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseOnboardingStateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseOnboardingStateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OnboardingStateName: "sEnTiNeLoNbOaRdInGsTaTeNaMe", + OnboardingStateName: "oNbOaRdInGsTaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2022-10-01-preview/settings/README.md b/resource-manager/securityinsights/2022-10-01-preview/settings/README.md index 7b1d1a54dff..ed6242c61bf 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/settings/README.md +++ b/resource-manager/securityinsights/2022-10-01-preview/settings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsName") +id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingName") read, err := client.ProductSettingsDelete(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsName") +id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingName") read, err := client.ProductSettingsGet(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsName") +id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingName") payload := settings.Settings{ // ... diff --git a/resource-manager/securityinsights/2022-10-01-preview/settings/id_setting.go b/resource-manager/securityinsights/2022-10-01-preview/settings/id_setting.go index 5d3f34a7064..731b0406254 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/settings/id_setting.go +++ b/resource-manager/securityinsights/2022-10-01-preview/settings/id_setting.go @@ -125,7 +125,7 @@ func (id SettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticSettings", "settings", "settings"), - resourceids.UserSpecifiedSegment("settingName", "settingsName"), + resourceids.UserSpecifiedSegment("settingName", "settingName"), } } diff --git a/resource-manager/securityinsights/2022-10-01-preview/settings/id_setting_test.go b/resource-manager/securityinsights/2022-10-01-preview/settings/id_setting_test.go index 32c2541a34f..ff8e4fe12bf 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/settings/id_setting_test.go +++ b/resource-manager/securityinsights/2022-10-01-preview/settings/id_setting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SettingId{} func TestNewSettingID(t *testing.T) { - id := NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsName") + id := NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.SettingName != "settingsName" { - t.Fatalf("Expected %q but got %q for Segment 'SettingName'", id.SettingName, "settingsName") + if id.SettingName != "settingName" { + t.Fatalf("Expected %q but got %q for Segment 'SettingName'", id.SettingName, "settingName") } } func TestFormatSettingID(t *testing.T) { - actual := NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingsName" + actual := NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingName", Expected: &SettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SettingName: "settingsName", + SettingName: "settingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingName", Expected: &SettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SettingName: "settingsName", + SettingName: "settingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/settings/settingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS/sEtTiNgSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS/sEtTiNgNaMe", Expected: &SettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - SettingName: "sEtTiNgSnAmE", + SettingName: "sEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS/sEtTiNgSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS/sEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_deployment.go b/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_deployment.go index 11a744036f1..452ba50d746 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_deployment.go +++ b/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_deployment.go @@ -11,7 +11,7 @@ import ( type Deployment struct { DeploymentId *string `json:"deploymentId,omitempty"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` DeploymentResult *DeploymentResult `json:"deploymentResult,omitempty"` DeploymentState *DeploymentState `json:"deploymentState,omitempty"` DeploymentTime *string `json:"deploymentTime,omitempty"` diff --git a/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_repository.go b/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_repository.go index fc80c1eb57b..507cd40086f 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_repository.go +++ b/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_repository.go @@ -5,8 +5,8 @@ package sourcecontrols type Repository struct { Branch *string `json:"branch,omitempty"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` - DisplayUrl *string `json:"displayUrl,omitempty"` + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` + DisplayURL *string `json:"displayUrl,omitempty"` PathMapping *[]ContentPathMap `json:"pathMapping,omitempty"` Url *string `json:"url,omitempty"` } diff --git a/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_webhook.go b/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_webhook.go index 413967f4740..ee5a0295eb7 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_webhook.go +++ b/resource-manager/securityinsights/2022-10-01-preview/sourcecontrols/model_webhook.go @@ -7,5 +7,5 @@ type Webhook struct { RotateWebhookSecret *bool `json:"rotateWebhookSecret,omitempty"` WebhookId *string `json:"webhookId,omitempty"` WebhookSecretUpdateTime *string `json:"webhookSecretUpdateTime,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/README.md b/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/README.md index c804517a032..d872579c8f5 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/README.md +++ b/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceAppendTags{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorDelete(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorGet(ctx, id) if err != nil { @@ -157,7 +157,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... diff --git a/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/id_indicator.go b/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/id_indicator.go index 315e21dcecd..11f98e1c5be 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/id_indicator.go +++ b/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/id_indicator.go @@ -127,7 +127,7 @@ func (id IndicatorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), resourceids.StaticSegment("staticMain", "main", "main"), resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "name"), + resourceids.UserSpecifiedSegment("indicatorName", "indicatorName"), } } diff --git a/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/id_indicator_test.go b/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/id_indicator_test.go index becb280f28f..4ead61bfafa 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/id_indicator_test.go +++ b/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/id_indicator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IndicatorId{} func TestNewIndicatorID(t *testing.T) { - id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewIndicatorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.IndicatorName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "name") + if id.IndicatorName != "indicatorName" { + t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "indicatorName") } } func TestFormatIndicatorID(t *testing.T) { - actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name" + actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -117,17 +117,17 @@ func TestParseIndicatorID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, } @@ -308,32 +308,32 @@ func TestParseIndicatorIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - IndicatorName: "nAmE", + IndicatorName: "iNdIcAtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go b/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go index 49660ed5792..693411b27a2 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go +++ b/resource-manager/securityinsights/2022-10-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go @@ -11,7 +11,7 @@ type ThreatIntelligenceIndicatorProperties struct { Defanged *bool `json:"defanged,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` + Extensions *map[string]interface{} `json:"extensions,omitempty"` ExternalId *string `json:"externalId,omitempty"` ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` diff --git a/resource-manager/securityinsights/2022-10-01-preview/watchlistitems/model_watchlistitemproperties.go b/resource-manager/securityinsights/2022-10-01-preview/watchlistitems/model_watchlistitemproperties.go index 77f219a0cce..55288f9fe50 100644 --- a/resource-manager/securityinsights/2022-10-01-preview/watchlistitems/model_watchlistitemproperties.go +++ b/resource-manager/securityinsights/2022-10-01-preview/watchlistitems/model_watchlistitemproperties.go @@ -10,16 +10,16 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WatchlistItemProperties struct { - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - EntityMapping *interface{} `json:"entityMapping,omitempty"` - IsDeleted *bool `json:"isDeleted,omitempty"` - ItemsKeyValue interface{} `json:"itemsKeyValue"` - TenantId *string `json:"tenantId,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - WatchlistItemId *string `json:"watchlistItemId,omitempty"` - WatchlistItemType *string `json:"watchlistItemType,omitempty"` + Created *string `json:"created,omitempty"` + CreatedBy *UserInfo `json:"createdBy,omitempty"` + EntityMapping *map[string]interface{} `json:"entityMapping,omitempty"` + IsDeleted *bool `json:"isDeleted,omitempty"` + ItemsKeyValue map[string]interface{} `json:"itemsKeyValue"` + TenantId *string `json:"tenantId,omitempty"` + Updated *string `json:"updated,omitempty"` + UpdatedBy *UserInfo `json:"updatedBy,omitempty"` + WatchlistItemId *string `json:"watchlistItemId,omitempty"` + WatchlistItemType *string `json:"watchlistItemType,omitempty"` } func (o *WatchlistItemProperties) GetCreatedAsTime() (*time.Time, error) { diff --git a/resource-manager/securityinsights/2022-11-01/automationrules/constants.go b/resource-manager/securityinsights/2022-11-01/automationrules/constants.go index 71480e3d3d7..2c49497d0dc 100644 --- a/resource-manager/securityinsights/2022-11-01/automationrules/constants.go +++ b/resource-manager/securityinsights/2022-11-01/automationrules/constants.go @@ -337,7 +337,7 @@ const ( AutomationRulePropertyConditionSupportedPropertyProcessId AutomationRulePropertyConditionSupportedProperty = "ProcessId" AutomationRulePropertyConditionSupportedPropertyRegistryKey AutomationRulePropertyConditionSupportedProperty = "RegistryKey" AutomationRulePropertyConditionSupportedPropertyRegistryValueData AutomationRulePropertyConditionSupportedProperty = "RegistryValueData" - AutomationRulePropertyConditionSupportedPropertyUrl AutomationRulePropertyConditionSupportedProperty = "Url" + AutomationRulePropertyConditionSupportedPropertyURL AutomationRulePropertyConditionSupportedProperty = "Url" ) func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []string { @@ -397,7 +397,7 @@ func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []strin string(AutomationRulePropertyConditionSupportedPropertyProcessId), string(AutomationRulePropertyConditionSupportedPropertyRegistryKey), string(AutomationRulePropertyConditionSupportedPropertyRegistryValueData), - string(AutomationRulePropertyConditionSupportedPropertyUrl), + string(AutomationRulePropertyConditionSupportedPropertyURL), } } @@ -471,7 +471,7 @@ func parseAutomationRulePropertyConditionSupportedProperty(input string) (*Autom "processid": AutomationRulePropertyConditionSupportedPropertyProcessId, "registrykey": AutomationRulePropertyConditionSupportedPropertyRegistryKey, "registryvaluedata": AutomationRulePropertyConditionSupportedPropertyRegistryValueData, - "url": AutomationRulePropertyConditionSupportedPropertyUrl, + "url": AutomationRulePropertyConditionSupportedPropertyURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/constants.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/constants.go index 3673d5b1163..e2637e80b46 100644 --- a/resource-manager/securityinsights/2022-11-01/incidentalerts/constants.go +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_accountentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_accountentity.go new file mode 100644 index 00000000000..f7d9562b9e5 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_accountentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_accountentityproperties.go new file mode 100644 index 00000000000..bea9c6688c2 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_azureresourceentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_azureresourceentity.go new file mode 100644 index 00000000000..0ed5f71a2b7 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..5cff8e6e036 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_cloudapplicationentity.go new file mode 100644 index 00000000000..c7c3714cbf5 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..76fa08b95a3 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_dnsentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_dnsentity.go new file mode 100644 index 00000000000..13fd09f04f5 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_dnsentityproperties.go new file mode 100644 index 00000000000..09bddcc3c1d --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_entity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_entity.go index da1973b0de5..175f65e0b19 100644 --- a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_entity.go +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_fileentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_fileentity.go new file mode 100644 index 00000000000..2a22db96248 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_fileentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_fileentityproperties.go new file mode 100644 index 00000000000..5be66cedd3a --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_filehashentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_filehashentity.go new file mode 100644 index 00000000000..765bfbf9335 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_filehashentityproperties.go new file mode 100644 index 00000000000..217a5c82ea4 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_geolocation.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_geolocation.go new file mode 100644 index 00000000000..898225b3df8 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_hostentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_hostentity.go new file mode 100644 index 00000000000..34387f6e2cd --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_hostentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_hostentityproperties.go new file mode 100644 index 00000000000..cb32a85ac54 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_iotdeviceentity.go new file mode 100644 index 00000000000..29c5828334d --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..726f5766faf --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_ipentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_ipentity.go new file mode 100644 index 00000000000..b1368edbff0 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_ipentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_ipentityproperties.go new file mode 100644 index 00000000000..06f095e8b80 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailboxentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailboxentity.go new file mode 100644 index 00000000000..e270892a274 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailboxentityproperties.go new file mode 100644 index 00000000000..c6a5ba8ede4 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailclusterentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailclusterentity.go new file mode 100644 index 00000000000..3a9bfb3df79 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..9686f0be9fe --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailmessageentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailmessageentity.go new file mode 100644 index 00000000000..dbc8b5b62bb --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..5d3504977c7 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_malwareentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_malwareentity.go new file mode 100644 index 00000000000..01fd019eac5 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_malwareentityproperties.go new file mode 100644 index 00000000000..6c6be031d30 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_processentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_processentity.go new file mode 100644 index 00000000000..fe219b87ac9 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_processentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_processentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_processentityproperties.go new file mode 100644 index 00000000000..17eaa2f563d --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registrykeyentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registrykeyentity.go new file mode 100644 index 00000000000..8e9cc7cbf61 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..142c523838a --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registryvalueentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registryvalueentity.go new file mode 100644 index 00000000000..fd4acdd59c0 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..8d450105818 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_securitygroupentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_securitygroupentity.go new file mode 100644 index 00000000000..7409aedd8e0 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..39efb87c8fa --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_submissionmailentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_submissionmailentity.go new file mode 100644 index 00000000000..c9a35517027 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..a58834a943a --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_threatintelligence.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_threatintelligence.go new file mode 100644 index 00000000000..3eb0e546118 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_urlentity.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_urlentity.go new file mode 100644 index 00000000000..5a73366e76e --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentalerts/model_urlentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_urlentityproperties.go new file mode 100644 index 00000000000..a2b6bebe4fd --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentalerts/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/constants.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/constants.go index 27f31cfcc5e..2047359314a 100644 --- a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/constants.go +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_accountentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_accountentity.go new file mode 100644 index 00000000000..56abba96e36 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_accountentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_accountentityproperties.go new file mode 100644 index 00000000000..b13c03c7627 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_azureresourceentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_azureresourceentity.go new file mode 100644 index 00000000000..7bf0ab8b62b --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..41965d40066 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_cloudapplicationentity.go new file mode 100644 index 00000000000..4c9e8ce6194 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..6bb7154af33 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_dnsentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_dnsentity.go new file mode 100644 index 00000000000..f1b1b8b4f3b --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_dnsentityproperties.go new file mode 100644 index 00000000000..a670857ebdc --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_entity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_entity.go index 434e71e0224..7a2cc57097c 100644 --- a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_entity.go +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_fileentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_fileentity.go new file mode 100644 index 00000000000..11e19dd2e3b --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_fileentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_fileentityproperties.go new file mode 100644 index 00000000000..9b38ca6b70d --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_filehashentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_filehashentity.go new file mode 100644 index 00000000000..a858827d61f --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_filehashentityproperties.go new file mode 100644 index 00000000000..faab857b3c3 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_geolocation.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_geolocation.go new file mode 100644 index 00000000000..8d991bfadbe --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_hostentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_hostentity.go new file mode 100644 index 00000000000..5caa2ae5640 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_hostentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_hostentityproperties.go new file mode 100644 index 00000000000..f18b13c2a92 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_iotdeviceentity.go new file mode 100644 index 00000000000..e97507c0a74 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..4c0ffac5a7f --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_ipentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_ipentity.go new file mode 100644 index 00000000000..47b72c121f0 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_ipentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_ipentityproperties.go new file mode 100644 index 00000000000..b8f9205b617 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailboxentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailboxentity.go new file mode 100644 index 00000000000..191641d99bc --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailboxentityproperties.go new file mode 100644 index 00000000000..2ef65bec27a --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailclusterentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailclusterentity.go new file mode 100644 index 00000000000..7c2a004bae0 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..d48338571ae --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailmessageentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailmessageentity.go new file mode 100644 index 00000000000..a4135331b74 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..6e9d5ea8196 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_malwareentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_malwareentity.go new file mode 100644 index 00000000000..3b22fe0c93e --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_malwareentityproperties.go new file mode 100644 index 00000000000..e1e088edd7f --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_processentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_processentity.go new file mode 100644 index 00000000000..2e254bf02d2 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_processentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_processentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_processentityproperties.go new file mode 100644 index 00000000000..aa48daa6670 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registrykeyentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registrykeyentity.go new file mode 100644 index 00000000000..3407bb232c9 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..52f430f95ed --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registryvalueentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registryvalueentity.go new file mode 100644 index 00000000000..871dc3b1c32 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..a92743b2653 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_securitygroupentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_securitygroupentity.go new file mode 100644 index 00000000000..c31a0c66785 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..64a0c390803 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_submissionmailentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_submissionmailentity.go new file mode 100644 index 00000000000..7c284b24777 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..e44c2ead063 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_threatintelligence.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_threatintelligence.go new file mode 100644 index 00000000000..f2b23759950 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_urlentity.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_urlentity.go new file mode 100644 index 00000000000..cf8e6e9a3a0 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_urlentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_urlentityproperties.go new file mode 100644 index 00000000000..42f90823058 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidentbookmarks/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/constants.go b/resource-manager/securityinsights/2022-11-01/incidententities/constants.go index a1d54eb28d0..69f307e9f5e 100644 --- a/resource-manager/securityinsights/2022-11-01/incidententities/constants.go +++ b/resource-manager/securityinsights/2022-11-01/incidententities/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_accountentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_accountentity.go new file mode 100644 index 00000000000..5a33b83b2fb --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_accountentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_accountentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_accountentityproperties.go new file mode 100644 index 00000000000..5b0a3ae3126 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_azureresourceentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_azureresourceentity.go new file mode 100644 index 00000000000..ff6f76c4686 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..9974c18dca0 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_cloudapplicationentity.go new file mode 100644 index 00000000000..5cc38003f9c --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..4cb5d5e4089 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_dnsentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_dnsentity.go new file mode 100644 index 00000000000..161832ab67f --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_dnsentityproperties.go new file mode 100644 index 00000000000..e919d9284f8 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_entity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_entity.go index e1d1670419a..6dde8c8e453 100644 --- a/resource-manager/securityinsights/2022-11-01/incidententities/model_entity.go +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_fileentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_fileentity.go new file mode 100644 index 00000000000..c2df39d994f --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_fileentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_fileentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_fileentityproperties.go new file mode 100644 index 00000000000..392a0b4cd13 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_filehashentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_filehashentity.go new file mode 100644 index 00000000000..77b77f1654b --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_filehashentityproperties.go new file mode 100644 index 00000000000..b5214190c07 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_geolocation.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_geolocation.go new file mode 100644 index 00000000000..1873bfc3721 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_geolocation.go @@ -0,0 +1,14 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_hostentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_hostentity.go new file mode 100644 index 00000000000..23c931b09f9 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_hostentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_hostentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_hostentityproperties.go new file mode 100644 index 00000000000..6ab99b1567f --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_iotdeviceentity.go new file mode 100644 index 00000000000..8b451847561 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..0818a3fad7c --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_ipentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_ipentity.go new file mode 100644 index 00000000000..6fde828d140 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_ipentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_ipentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_ipentityproperties.go new file mode 100644 index 00000000000..c45639329c3 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_mailboxentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailboxentity.go new file mode 100644 index 00000000000..5fbc2dbe211 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailboxentityproperties.go new file mode 100644 index 00000000000..76bb706818b --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_mailclusterentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailclusterentity.go new file mode 100644 index 00000000000..3d1c7ade2dd --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..a0369aaea70 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_mailmessageentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailmessageentity.go new file mode 100644 index 00000000000..c5b5370a1ef --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..7749df3a379 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_malwareentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_malwareentity.go new file mode 100644 index 00000000000..5ddeaf637bf --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_malwareentityproperties.go new file mode 100644 index 00000000000..050ed004a26 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_processentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_processentity.go new file mode 100644 index 00000000000..01cd7b87ca0 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_processentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_processentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_processentityproperties.go new file mode 100644 index 00000000000..9925af5f68e --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_registrykeyentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_registrykeyentity.go new file mode 100644 index 00000000000..c047ecde648 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..2cf5e550a3b --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_registryvalueentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_registryvalueentity.go new file mode 100644 index 00000000000..2fab2915b49 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..50c0977987d --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_securitygroupentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_securitygroupentity.go new file mode 100644 index 00000000000..5e4dc8e1acc --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..7cfd2f42392 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_submissionmailentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_submissionmailentity.go new file mode 100644 index 00000000000..53ed1950b15 --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..7b758af6c9d --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_threatintelligence.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_threatintelligence.go new file mode 100644 index 00000000000..83d6e3b356a --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_urlentity.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_urlentity.go new file mode 100644 index 00000000000..0aa89b96ffc --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_urlentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2022-11-01/incidententities/model_urlentityproperties.go b/resource-manager/securityinsights/2022-11-01/incidententities/model_urlentityproperties.go new file mode 100644 index 00000000000..759e236694d --- /dev/null +++ b/resource-manager/securityinsights/2022-11-01/incidententities/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2022-11-01/incidents/model_incidentproperties.go b/resource-manager/securityinsights/2022-11-01/incidents/model_incidentproperties.go index 1a910a42d0d..2980c8cd4e7 100644 --- a/resource-manager/securityinsights/2022-11-01/incidents/model_incidentproperties.go +++ b/resource-manager/securityinsights/2022-11-01/incidents/model_incidentproperties.go @@ -18,7 +18,7 @@ type IncidentProperties struct { Description *string `json:"description,omitempty"` FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"` IncidentNumber *int64 `json:"incidentNumber,omitempty"` - IncidentUrl *string `json:"incidentUrl,omitempty"` + IncidentURL *string `json:"incidentUrl,omitempty"` Labels *[]IncidentLabel `json:"labels,omitempty"` LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"` LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` diff --git a/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md b/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md index 38acc86130c..22323973180 100644 --- a/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md +++ b/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") payload := securitymlanalyticssettings.SecurityMLAnalyticsSetting{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go b/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go index 664c157d691..18bac933415 100644 --- a/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go +++ b/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go @@ -125,7 +125,7 @@ func (id SecurityMLAnalyticsSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticSecurityMLAnalyticsSettings", "securityMLAnalyticsSettings", "securityMLAnalyticsSettings"), - resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "settingsResourceName"), + resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "securityMLAnalyticsSettingName"), } } diff --git a/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go b/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go index f815f97f834..87ffe04f752 100644 --- a/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go +++ b/resource-manager/securityinsights/2022-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityMLAnalyticsSettingId{} func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { - id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") + id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.SecurityMLAnalyticsSettingName != "settingsResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "settingsResourceName") + if id.SecurityMLAnalyticsSettingName != "securityMLAnalyticsSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "securityMLAnalyticsSettingName") } } func TestFormatSecurityMLAnalyticsSettingID(t *testing.T) { - actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName" + actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseSecurityMLAnalyticsSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseSecurityMLAnalyticsSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - SecurityMLAnalyticsSettingName: "sEtTiNgSrEsOuRcEnAmE", + SecurityMLAnalyticsSettingName: "sEcUrItYmLaNaLyTiCsSeTtInGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/README.md b/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/README.md index dc4ae6f8a97..deb4a636d05 100644 --- a/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/README.md +++ b/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") payload := sentinelonboardingstates.SentinelOnboardingState{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/id_onboardingstate.go b/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/id_onboardingstate.go index ea535534399..4e285b13c5c 100644 --- a/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/id_onboardingstate.go +++ b/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/id_onboardingstate.go @@ -125,7 +125,7 @@ func (id OnboardingStateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticOnboardingStates", "onboardingStates", "onboardingStates"), - resourceids.UserSpecifiedSegment("onboardingStateName", "sentinelOnboardingStateName"), + resourceids.UserSpecifiedSegment("onboardingStateName", "onboardingStateName"), } } diff --git a/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/id_onboardingstate_test.go b/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/id_onboardingstate_test.go index a601d0b8cb2..53228c86aad 100644 --- a/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/id_onboardingstate_test.go +++ b/resource-manager/securityinsights/2022-11-01/sentinelonboardingstates/id_onboardingstate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OnboardingStateId{} func TestNewOnboardingStateID(t *testing.T) { - id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") + id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOnboardingStateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OnboardingStateName != "sentinelOnboardingStateName" { - t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "sentinelOnboardingStateName") + if id.OnboardingStateName != "onboardingStateName" { + t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "onboardingStateName") } } func TestFormatOnboardingStateID(t *testing.T) { - actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName" + actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseOnboardingStateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseOnboardingStateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OnboardingStateName: "sEnTiNeLoNbOaRdInGsTaTeNaMe", + OnboardingStateName: "oNbOaRdInGsTaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md b/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md index 91b854d3782..0b79788a4dd 100644 --- a/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md +++ b/resource-manager/securityinsights/2022-11-01/threatintelligence/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceAppendTags{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorDelete(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorGet(ctx, id) if err != nil { @@ -157,7 +157,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... diff --git a/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go b/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go index 315e21dcecd..11f98e1c5be 100644 --- a/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go +++ b/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator.go @@ -127,7 +127,7 @@ func (id IndicatorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), resourceids.StaticSegment("staticMain", "main", "main"), resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "name"), + resourceids.UserSpecifiedSegment("indicatorName", "indicatorName"), } } diff --git a/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator_test.go b/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator_test.go index becb280f28f..4ead61bfafa 100644 --- a/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator_test.go +++ b/resource-manager/securityinsights/2022-11-01/threatintelligence/id_indicator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IndicatorId{} func TestNewIndicatorID(t *testing.T) { - id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewIndicatorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.IndicatorName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "name") + if id.IndicatorName != "indicatorName" { + t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "indicatorName") } } func TestFormatIndicatorID(t *testing.T) { - actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name" + actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -117,17 +117,17 @@ func TestParseIndicatorID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, } @@ -308,32 +308,32 @@ func TestParseIndicatorIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - IndicatorName: "nAmE", + IndicatorName: "iNdIcAtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go b/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go index 49660ed5792..693411b27a2 100644 --- a/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go +++ b/resource-manager/securityinsights/2022-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go @@ -11,7 +11,7 @@ type ThreatIntelligenceIndicatorProperties struct { Defanged *bool `json:"defanged,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` + Extensions *map[string]interface{} `json:"extensions,omitempty"` ExternalId *string `json:"externalId,omitempty"` ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` diff --git a/resource-manager/securityinsights/2023-02-01/automationrules/constants.go b/resource-manager/securityinsights/2023-02-01/automationrules/constants.go index 71480e3d3d7..2c49497d0dc 100644 --- a/resource-manager/securityinsights/2023-02-01/automationrules/constants.go +++ b/resource-manager/securityinsights/2023-02-01/automationrules/constants.go @@ -337,7 +337,7 @@ const ( AutomationRulePropertyConditionSupportedPropertyProcessId AutomationRulePropertyConditionSupportedProperty = "ProcessId" AutomationRulePropertyConditionSupportedPropertyRegistryKey AutomationRulePropertyConditionSupportedProperty = "RegistryKey" AutomationRulePropertyConditionSupportedPropertyRegistryValueData AutomationRulePropertyConditionSupportedProperty = "RegistryValueData" - AutomationRulePropertyConditionSupportedPropertyUrl AutomationRulePropertyConditionSupportedProperty = "Url" + AutomationRulePropertyConditionSupportedPropertyURL AutomationRulePropertyConditionSupportedProperty = "Url" ) func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []string { @@ -397,7 +397,7 @@ func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []strin string(AutomationRulePropertyConditionSupportedPropertyProcessId), string(AutomationRulePropertyConditionSupportedPropertyRegistryKey), string(AutomationRulePropertyConditionSupportedPropertyRegistryValueData), - string(AutomationRulePropertyConditionSupportedPropertyUrl), + string(AutomationRulePropertyConditionSupportedPropertyURL), } } @@ -471,7 +471,7 @@ func parseAutomationRulePropertyConditionSupportedProperty(input string) (*Autom "processid": AutomationRulePropertyConditionSupportedPropertyProcessId, "registrykey": AutomationRulePropertyConditionSupportedPropertyRegistryKey, "registryvaluedata": AutomationRulePropertyConditionSupportedPropertyRegistryValueData, - "url": AutomationRulePropertyConditionSupportedPropertyUrl, + "url": AutomationRulePropertyConditionSupportedPropertyURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/constants.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/constants.go index 3673d5b1163..e2637e80b46 100644 --- a/resource-manager/securityinsights/2023-02-01/incidentalerts/constants.go +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_accountentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_accountentity.go new file mode 100644 index 00000000000..f7d9562b9e5 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_accountentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_accountentityproperties.go new file mode 100644 index 00000000000..95e8c7c53d9 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_azureresourceentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_azureresourceentity.go new file mode 100644 index 00000000000..0ed5f71a2b7 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..8330e17735c --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_cloudapplicationentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_cloudapplicationentity.go new file mode 100644 index 00000000000..c7c3714cbf5 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..d2c0e47210d --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_dnsentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_dnsentity.go new file mode 100644 index 00000000000..13fd09f04f5 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_dnsentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_dnsentityproperties.go new file mode 100644 index 00000000000..110d09978cf --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_entity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_entity.go index da1973b0de5..175f65e0b19 100644 --- a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_entity.go +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_fileentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_fileentity.go new file mode 100644 index 00000000000..2a22db96248 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_fileentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_fileentityproperties.go new file mode 100644 index 00000000000..8d4114bb662 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_filehashentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_filehashentity.go new file mode 100644 index 00000000000..765bfbf9335 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_filehashentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_filehashentityproperties.go new file mode 100644 index 00000000000..bce0abb81bb --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_geolocation.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_geolocation.go new file mode 100644 index 00000000000..898225b3df8 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_hostentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_hostentity.go new file mode 100644 index 00000000000..34387f6e2cd --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_hostentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_hostentityproperties.go new file mode 100644 index 00000000000..8e568412923 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_iotdeviceentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_iotdeviceentity.go new file mode 100644 index 00000000000..29c5828334d --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..f9f3459091c --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_ipentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_ipentity.go new file mode 100644 index 00000000000..b1368edbff0 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_ipentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_ipentityproperties.go new file mode 100644 index 00000000000..6349274f795 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailboxentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailboxentity.go new file mode 100644 index 00000000000..e270892a274 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailboxentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailboxentityproperties.go new file mode 100644 index 00000000000..cfec407c644 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailclusterentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailclusterentity.go new file mode 100644 index 00000000000..3a9bfb3df79 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..77fae37505c --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailmessageentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailmessageentity.go new file mode 100644 index 00000000000..dbc8b5b62bb --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..ce180f49397 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_malwareentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_malwareentity.go new file mode 100644 index 00000000000..01fd019eac5 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_malwareentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_malwareentityproperties.go new file mode 100644 index 00000000000..fb8735141e4 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_processentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_processentity.go new file mode 100644 index 00000000000..fe219b87ac9 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_processentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_processentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_processentityproperties.go new file mode 100644 index 00000000000..401f8cec926 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registrykeyentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registrykeyentity.go new file mode 100644 index 00000000000..8e9cc7cbf61 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..58e169d2aac --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registryvalueentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registryvalueentity.go new file mode 100644 index 00000000000..fd4acdd59c0 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..1a02a1f29a1 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_securitygroupentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_securitygroupentity.go new file mode 100644 index 00000000000..7409aedd8e0 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..35655ad7610 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_submissionmailentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_submissionmailentity.go new file mode 100644 index 00000000000..c9a35517027 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..7b92257de5d --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_threatintelligence.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_threatintelligence.go new file mode 100644 index 00000000000..3eb0e546118 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_urlentity.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_urlentity.go new file mode 100644 index 00000000000..5a73366e76e --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentalerts/model_urlentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_urlentityproperties.go new file mode 100644 index 00000000000..29a6fa25cd9 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentalerts/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/constants.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/constants.go index 27f31cfcc5e..2047359314a 100644 --- a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/constants.go +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_accountentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_accountentity.go new file mode 100644 index 00000000000..56abba96e36 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_accountentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_accountentityproperties.go new file mode 100644 index 00000000000..c55c43f2525 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_azureresourceentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_azureresourceentity.go new file mode 100644 index 00000000000..7bf0ab8b62b --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..c09bf1c4d3f --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_cloudapplicationentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_cloudapplicationentity.go new file mode 100644 index 00000000000..4c9e8ce6194 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..bef31fda55e --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_dnsentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_dnsentity.go new file mode 100644 index 00000000000..f1b1b8b4f3b --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_dnsentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_dnsentityproperties.go new file mode 100644 index 00000000000..ec46759cbd6 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_entity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_entity.go index 434e71e0224..7a2cc57097c 100644 --- a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_entity.go +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_fileentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_fileentity.go new file mode 100644 index 00000000000..11e19dd2e3b --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_fileentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_fileentityproperties.go new file mode 100644 index 00000000000..7a9c24b3505 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_filehashentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_filehashentity.go new file mode 100644 index 00000000000..a858827d61f --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_filehashentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_filehashentityproperties.go new file mode 100644 index 00000000000..a61a35a1a68 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_geolocation.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_geolocation.go new file mode 100644 index 00000000000..8d991bfadbe --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_hostentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_hostentity.go new file mode 100644 index 00000000000..5caa2ae5640 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_hostentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_hostentityproperties.go new file mode 100644 index 00000000000..050e6030ebb --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_iotdeviceentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_iotdeviceentity.go new file mode 100644 index 00000000000..e97507c0a74 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..5c1fd5e963e --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_ipentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_ipentity.go new file mode 100644 index 00000000000..47b72c121f0 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_ipentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_ipentityproperties.go new file mode 100644 index 00000000000..6db5073f063 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailboxentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailboxentity.go new file mode 100644 index 00000000000..191641d99bc --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailboxentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailboxentityproperties.go new file mode 100644 index 00000000000..58bddee162c --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailclusterentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailclusterentity.go new file mode 100644 index 00000000000..7c2a004bae0 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..1155dc4b5ab --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailmessageentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailmessageentity.go new file mode 100644 index 00000000000..a4135331b74 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..78b5653d29f --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_malwareentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_malwareentity.go new file mode 100644 index 00000000000..3b22fe0c93e --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_malwareentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_malwareentityproperties.go new file mode 100644 index 00000000000..b675eddf31c --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_processentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_processentity.go new file mode 100644 index 00000000000..2e254bf02d2 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_processentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_processentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_processentityproperties.go new file mode 100644 index 00000000000..931d0a4fa98 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registrykeyentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registrykeyentity.go new file mode 100644 index 00000000000..3407bb232c9 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..94b02370b6b --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registryvalueentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registryvalueentity.go new file mode 100644 index 00000000000..871dc3b1c32 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..def30680f7c --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_securitygroupentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_securitygroupentity.go new file mode 100644 index 00000000000..c31a0c66785 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..5cffe7c38b2 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_submissionmailentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_submissionmailentity.go new file mode 100644 index 00000000000..7c284b24777 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..dfd00e5aa38 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_threatintelligence.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_threatintelligence.go new file mode 100644 index 00000000000..f2b23759950 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_urlentity.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_urlentity.go new file mode 100644 index 00000000000..cf8e6e9a3a0 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_urlentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_urlentityproperties.go new file mode 100644 index 00000000000..c5aa8f80ac1 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidentbookmarks/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/constants.go b/resource-manager/securityinsights/2023-02-01/incidententities/constants.go index a1d54eb28d0..69f307e9f5e 100644 --- a/resource-manager/securityinsights/2023-02-01/incidententities/constants.go +++ b/resource-manager/securityinsights/2023-02-01/incidententities/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_accountentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_accountentity.go new file mode 100644 index 00000000000..5a33b83b2fb --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_accountentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_accountentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_accountentityproperties.go new file mode 100644 index 00000000000..528a54127a4 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_azureresourceentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_azureresourceentity.go new file mode 100644 index 00000000000..ff6f76c4686 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..69816915b53 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_cloudapplicationentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_cloudapplicationentity.go new file mode 100644 index 00000000000..5cc38003f9c --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..4b2f11d322b --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_dnsentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_dnsentity.go new file mode 100644 index 00000000000..161832ab67f --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_dnsentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_dnsentityproperties.go new file mode 100644 index 00000000000..b27096f1113 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_entity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_entity.go index e1d1670419a..6dde8c8e453 100644 --- a/resource-manager/securityinsights/2023-02-01/incidententities/model_entity.go +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_fileentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_fileentity.go new file mode 100644 index 00000000000..c2df39d994f --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_fileentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_fileentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_fileentityproperties.go new file mode 100644 index 00000000000..fc783e91bfa --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_filehashentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_filehashentity.go new file mode 100644 index 00000000000..77b77f1654b --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_filehashentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_filehashentityproperties.go new file mode 100644 index 00000000000..1a76366f7e2 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_geolocation.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_geolocation.go new file mode 100644 index 00000000000..1873bfc3721 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_geolocation.go @@ -0,0 +1,14 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_hostentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_hostentity.go new file mode 100644 index 00000000000..23c931b09f9 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_hostentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_hostentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_hostentityproperties.go new file mode 100644 index 00000000000..309ef661071 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_iotdeviceentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_iotdeviceentity.go new file mode 100644 index 00000000000..8b451847561 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..c7f83841c0d --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_ipentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_ipentity.go new file mode 100644 index 00000000000..6fde828d140 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_ipentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_ipentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_ipentityproperties.go new file mode 100644 index 00000000000..bb3da9667bd --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_mailboxentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailboxentity.go new file mode 100644 index 00000000000..5fbc2dbe211 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_mailboxentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailboxentityproperties.go new file mode 100644 index 00000000000..c973db65df5 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_mailclusterentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailclusterentity.go new file mode 100644 index 00000000000..3d1c7ade2dd --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..1394f0cd969 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_mailmessageentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailmessageentity.go new file mode 100644 index 00000000000..c5b5370a1ef --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..bd17fdbd83c --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_malwareentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_malwareentity.go new file mode 100644 index 00000000000..5ddeaf637bf --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_malwareentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_malwareentityproperties.go new file mode 100644 index 00000000000..552fa12bb80 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_processentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_processentity.go new file mode 100644 index 00000000000..01cd7b87ca0 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_processentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_processentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_processentityproperties.go new file mode 100644 index 00000000000..ae9f7910c57 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_registrykeyentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_registrykeyentity.go new file mode 100644 index 00000000000..c047ecde648 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..607a196df8f --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_registryvalueentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_registryvalueentity.go new file mode 100644 index 00000000000..2fab2915b49 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..747cb9c6ea3 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_securitygroupentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_securitygroupentity.go new file mode 100644 index 00000000000..5e4dc8e1acc --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..62aeeb5ba45 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_submissionmailentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_submissionmailentity.go new file mode 100644 index 00000000000..53ed1950b15 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..db8531a70c6 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_threatintelligence.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_threatintelligence.go new file mode 100644 index 00000000000..83d6e3b356a --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_urlentity.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_urlentity.go new file mode 100644 index 00000000000..0aa89b96ffc --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_urlentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-02-01/incidententities/model_urlentityproperties.go b/resource-manager/securityinsights/2023-02-01/incidententities/model_urlentityproperties.go new file mode 100644 index 00000000000..57e56ad4b48 --- /dev/null +++ b/resource-manager/securityinsights/2023-02-01/incidententities/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-02-01/incidents/model_incidentadditionaldata.go b/resource-manager/securityinsights/2023-02-01/incidents/model_incidentadditionaldata.go index 51b13e3a495..507d3b005a4 100644 --- a/resource-manager/securityinsights/2023-02-01/incidents/model_incidentadditionaldata.go +++ b/resource-manager/securityinsights/2023-02-01/incidents/model_incidentadditionaldata.go @@ -8,6 +8,6 @@ type IncidentAdditionalData struct { AlertsCount *int64 `json:"alertsCount,omitempty"` BookmarksCount *int64 `json:"bookmarksCount,omitempty"` CommentsCount *int64 `json:"commentsCount,omitempty"` - ProviderIncidentUrl *string `json:"providerIncidentUrl,omitempty"` + ProviderIncidentURL *string `json:"providerIncidentUrl,omitempty"` Tactics *[]AttackTactic `json:"tactics,omitempty"` } diff --git a/resource-manager/securityinsights/2023-02-01/incidents/model_incidentproperties.go b/resource-manager/securityinsights/2023-02-01/incidents/model_incidentproperties.go index fc00cd6b1ac..0608720d453 100644 --- a/resource-manager/securityinsights/2023-02-01/incidents/model_incidentproperties.go +++ b/resource-manager/securityinsights/2023-02-01/incidents/model_incidentproperties.go @@ -18,7 +18,7 @@ type IncidentProperties struct { Description *string `json:"description,omitempty"` FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"` IncidentNumber *int64 `json:"incidentNumber,omitempty"` - IncidentUrl *string `json:"incidentUrl,omitempty"` + IncidentURL *string `json:"incidentUrl,omitempty"` Labels *[]IncidentLabel `json:"labels,omitempty"` LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"` LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` diff --git a/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/README.md b/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/README.md index 6875681114b..f552c6b642b 100644 --- a/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/README.md +++ b/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") payload := securitymlanalyticssettings.SecurityMLAnalyticsSetting{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go b/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go index 664c157d691..18bac933415 100644 --- a/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go +++ b/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go @@ -125,7 +125,7 @@ func (id SecurityMLAnalyticsSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticSecurityMLAnalyticsSettings", "securityMLAnalyticsSettings", "securityMLAnalyticsSettings"), - resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "settingsResourceName"), + resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "securityMLAnalyticsSettingName"), } } diff --git a/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go b/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go index f815f97f834..87ffe04f752 100644 --- a/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go +++ b/resource-manager/securityinsights/2023-02-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityMLAnalyticsSettingId{} func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { - id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") + id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.SecurityMLAnalyticsSettingName != "settingsResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "settingsResourceName") + if id.SecurityMLAnalyticsSettingName != "securityMLAnalyticsSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "securityMLAnalyticsSettingName") } } func TestFormatSecurityMLAnalyticsSettingID(t *testing.T) { - actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName" + actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseSecurityMLAnalyticsSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseSecurityMLAnalyticsSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - SecurityMLAnalyticsSettingName: "sEtTiNgSrEsOuRcEnAmE", + SecurityMLAnalyticsSettingName: "sEcUrItYmLaNaLyTiCsSeTtInGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/README.md b/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/README.md index b9fb726dd88..f09d5414a2f 100644 --- a/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/README.md +++ b/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") payload := sentinelonboardingstates.SentinelOnboardingState{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/id_onboardingstate.go b/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/id_onboardingstate.go index ea535534399..4e285b13c5c 100644 --- a/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/id_onboardingstate.go +++ b/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/id_onboardingstate.go @@ -125,7 +125,7 @@ func (id OnboardingStateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticOnboardingStates", "onboardingStates", "onboardingStates"), - resourceids.UserSpecifiedSegment("onboardingStateName", "sentinelOnboardingStateName"), + resourceids.UserSpecifiedSegment("onboardingStateName", "onboardingStateName"), } } diff --git a/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/id_onboardingstate_test.go b/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/id_onboardingstate_test.go index a601d0b8cb2..53228c86aad 100644 --- a/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/id_onboardingstate_test.go +++ b/resource-manager/securityinsights/2023-02-01/sentinelonboardingstates/id_onboardingstate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OnboardingStateId{} func TestNewOnboardingStateID(t *testing.T) { - id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") + id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOnboardingStateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OnboardingStateName != "sentinelOnboardingStateName" { - t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "sentinelOnboardingStateName") + if id.OnboardingStateName != "onboardingStateName" { + t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "onboardingStateName") } } func TestFormatOnboardingStateID(t *testing.T) { - actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName" + actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseOnboardingStateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseOnboardingStateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OnboardingStateName: "sEnTiNeLoNbOaRdInGsTaTeNaMe", + OnboardingStateName: "oNbOaRdInGsTaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2023-02-01/threatintelligence/README.md b/resource-manager/securityinsights/2023-02-01/threatintelligence/README.md index c3d22492695..3721ca78ef3 100644 --- a/resource-manager/securityinsights/2023-02-01/threatintelligence/README.md +++ b/resource-manager/securityinsights/2023-02-01/threatintelligence/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceAppendTags{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorDelete(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorGet(ctx, id) if err != nil { @@ -157,7 +157,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... diff --git a/resource-manager/securityinsights/2023-02-01/threatintelligence/id_indicator.go b/resource-manager/securityinsights/2023-02-01/threatintelligence/id_indicator.go index 315e21dcecd..11f98e1c5be 100644 --- a/resource-manager/securityinsights/2023-02-01/threatintelligence/id_indicator.go +++ b/resource-manager/securityinsights/2023-02-01/threatintelligence/id_indicator.go @@ -127,7 +127,7 @@ func (id IndicatorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), resourceids.StaticSegment("staticMain", "main", "main"), resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "name"), + resourceids.UserSpecifiedSegment("indicatorName", "indicatorName"), } } diff --git a/resource-manager/securityinsights/2023-02-01/threatintelligence/id_indicator_test.go b/resource-manager/securityinsights/2023-02-01/threatintelligence/id_indicator_test.go index becb280f28f..4ead61bfafa 100644 --- a/resource-manager/securityinsights/2023-02-01/threatintelligence/id_indicator_test.go +++ b/resource-manager/securityinsights/2023-02-01/threatintelligence/id_indicator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IndicatorId{} func TestNewIndicatorID(t *testing.T) { - id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewIndicatorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.IndicatorName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "name") + if id.IndicatorName != "indicatorName" { + t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "indicatorName") } } func TestFormatIndicatorID(t *testing.T) { - actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name" + actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -117,17 +117,17 @@ func TestParseIndicatorID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, } @@ -308,32 +308,32 @@ func TestParseIndicatorIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - IndicatorName: "nAmE", + IndicatorName: "iNdIcAtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2023-02-01/threatintelligence/model_threatintelligenceindicatorproperties.go b/resource-manager/securityinsights/2023-02-01/threatintelligence/model_threatintelligenceindicatorproperties.go index 1a40488054a..82d00a009ce 100644 --- a/resource-manager/securityinsights/2023-02-01/threatintelligence/model_threatintelligenceindicatorproperties.go +++ b/resource-manager/securityinsights/2023-02-01/threatintelligence/model_threatintelligenceindicatorproperties.go @@ -11,7 +11,7 @@ type ThreatIntelligenceIndicatorProperties struct { Defanged *bool `json:"defanged,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` + Extensions *map[string]interface{} `json:"extensions,omitempty"` ExternalId *string `json:"externalId,omitempty"` ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` diff --git a/resource-manager/securityinsights/2023-11-01/automationrules/constants.go b/resource-manager/securityinsights/2023-11-01/automationrules/constants.go index 71480e3d3d7..2c49497d0dc 100644 --- a/resource-manager/securityinsights/2023-11-01/automationrules/constants.go +++ b/resource-manager/securityinsights/2023-11-01/automationrules/constants.go @@ -337,7 +337,7 @@ const ( AutomationRulePropertyConditionSupportedPropertyProcessId AutomationRulePropertyConditionSupportedProperty = "ProcessId" AutomationRulePropertyConditionSupportedPropertyRegistryKey AutomationRulePropertyConditionSupportedProperty = "RegistryKey" AutomationRulePropertyConditionSupportedPropertyRegistryValueData AutomationRulePropertyConditionSupportedProperty = "RegistryValueData" - AutomationRulePropertyConditionSupportedPropertyUrl AutomationRulePropertyConditionSupportedProperty = "Url" + AutomationRulePropertyConditionSupportedPropertyURL AutomationRulePropertyConditionSupportedProperty = "Url" ) func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []string { @@ -397,7 +397,7 @@ func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []strin string(AutomationRulePropertyConditionSupportedPropertyProcessId), string(AutomationRulePropertyConditionSupportedPropertyRegistryKey), string(AutomationRulePropertyConditionSupportedPropertyRegistryValueData), - string(AutomationRulePropertyConditionSupportedPropertyUrl), + string(AutomationRulePropertyConditionSupportedPropertyURL), } } @@ -471,7 +471,7 @@ func parseAutomationRulePropertyConditionSupportedProperty(input string) (*Autom "processid": AutomationRulePropertyConditionSupportedPropertyProcessId, "registrykey": AutomationRulePropertyConditionSupportedPropertyRegistryKey, "registryvaluedata": AutomationRulePropertyConditionSupportedPropertyRegistryValueData, - "url": AutomationRulePropertyConditionSupportedPropertyUrl, + "url": AutomationRulePropertyConditionSupportedPropertyURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/constants.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/constants.go index 3673d5b1163..e2637e80b46 100644 --- a/resource-manager/securityinsights/2023-11-01/incidentalerts/constants.go +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_accountentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_accountentity.go new file mode 100644 index 00000000000..f7d9562b9e5 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_accountentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_accountentityproperties.go new file mode 100644 index 00000000000..95e8c7c53d9 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_azureresourceentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_azureresourceentity.go new file mode 100644 index 00000000000..0ed5f71a2b7 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..8330e17735c --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_cloudapplicationentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_cloudapplicationentity.go new file mode 100644 index 00000000000..c7c3714cbf5 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..d2c0e47210d --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_dnsentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_dnsentity.go new file mode 100644 index 00000000000..13fd09f04f5 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_dnsentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_dnsentityproperties.go new file mode 100644 index 00000000000..110d09978cf --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_entity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_entity.go index da1973b0de5..175f65e0b19 100644 --- a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_entity.go +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_fileentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_fileentity.go new file mode 100644 index 00000000000..2a22db96248 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_fileentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_fileentityproperties.go new file mode 100644 index 00000000000..8d4114bb662 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_filehashentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_filehashentity.go new file mode 100644 index 00000000000..765bfbf9335 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_filehashentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_filehashentityproperties.go new file mode 100644 index 00000000000..bce0abb81bb --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_geolocation.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_geolocation.go new file mode 100644 index 00000000000..898225b3df8 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_hostentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_hostentity.go new file mode 100644 index 00000000000..34387f6e2cd --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_hostentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_hostentityproperties.go new file mode 100644 index 00000000000..8e568412923 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_iotdeviceentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_iotdeviceentity.go new file mode 100644 index 00000000000..29c5828334d --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..f9f3459091c --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_ipentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_ipentity.go new file mode 100644 index 00000000000..b1368edbff0 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_ipentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_ipentityproperties.go new file mode 100644 index 00000000000..6349274f795 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailboxentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailboxentity.go new file mode 100644 index 00000000000..e270892a274 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailboxentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailboxentityproperties.go new file mode 100644 index 00000000000..cfec407c644 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailclusterentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailclusterentity.go new file mode 100644 index 00000000000..3a9bfb3df79 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..77fae37505c --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailmessageentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailmessageentity.go new file mode 100644 index 00000000000..dbc8b5b62bb --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..ce180f49397 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_malwareentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_malwareentity.go new file mode 100644 index 00000000000..01fd019eac5 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_malwareentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_malwareentityproperties.go new file mode 100644 index 00000000000..fb8735141e4 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_processentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_processentity.go new file mode 100644 index 00000000000..fe219b87ac9 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_processentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_processentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_processentityproperties.go new file mode 100644 index 00000000000..401f8cec926 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registrykeyentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registrykeyentity.go new file mode 100644 index 00000000000..8e9cc7cbf61 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..58e169d2aac --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registryvalueentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registryvalueentity.go new file mode 100644 index 00000000000..fd4acdd59c0 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..1a02a1f29a1 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_securitygroupentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_securitygroupentity.go new file mode 100644 index 00000000000..7409aedd8e0 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..35655ad7610 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_submissionmailentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_submissionmailentity.go new file mode 100644 index 00000000000..c9a35517027 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..7b92257de5d --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_threatintelligence.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_threatintelligence.go new file mode 100644 index 00000000000..3eb0e546118 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_urlentity.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_urlentity.go new file mode 100644 index 00000000000..5a73366e76e --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentalerts/model_urlentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_urlentityproperties.go new file mode 100644 index 00000000000..29a6fa25cd9 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentalerts/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/constants.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/constants.go index 27f31cfcc5e..2047359314a 100644 --- a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/constants.go +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_accountentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_accountentity.go new file mode 100644 index 00000000000..56abba96e36 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_accountentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_accountentityproperties.go new file mode 100644 index 00000000000..c55c43f2525 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_azureresourceentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_azureresourceentity.go new file mode 100644 index 00000000000..7bf0ab8b62b --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..c09bf1c4d3f --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_cloudapplicationentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_cloudapplicationentity.go new file mode 100644 index 00000000000..4c9e8ce6194 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..bef31fda55e --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_dnsentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_dnsentity.go new file mode 100644 index 00000000000..f1b1b8b4f3b --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_dnsentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_dnsentityproperties.go new file mode 100644 index 00000000000..ec46759cbd6 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_entity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_entity.go index 434e71e0224..7a2cc57097c 100644 --- a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_entity.go +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_fileentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_fileentity.go new file mode 100644 index 00000000000..11e19dd2e3b --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_fileentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_fileentityproperties.go new file mode 100644 index 00000000000..7a9c24b3505 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_filehashentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_filehashentity.go new file mode 100644 index 00000000000..a858827d61f --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_filehashentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_filehashentityproperties.go new file mode 100644 index 00000000000..a61a35a1a68 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_geolocation.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_geolocation.go new file mode 100644 index 00000000000..8d991bfadbe --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_hostentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_hostentity.go new file mode 100644 index 00000000000..5caa2ae5640 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_hostentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_hostentityproperties.go new file mode 100644 index 00000000000..050e6030ebb --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_iotdeviceentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_iotdeviceentity.go new file mode 100644 index 00000000000..e97507c0a74 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..5c1fd5e963e --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_ipentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_ipentity.go new file mode 100644 index 00000000000..47b72c121f0 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_ipentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_ipentityproperties.go new file mode 100644 index 00000000000..6db5073f063 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailboxentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailboxentity.go new file mode 100644 index 00000000000..191641d99bc --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailboxentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailboxentityproperties.go new file mode 100644 index 00000000000..58bddee162c --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailclusterentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailclusterentity.go new file mode 100644 index 00000000000..7c2a004bae0 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..1155dc4b5ab --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailmessageentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailmessageentity.go new file mode 100644 index 00000000000..a4135331b74 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..78b5653d29f --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_malwareentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_malwareentity.go new file mode 100644 index 00000000000..3b22fe0c93e --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_malwareentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_malwareentityproperties.go new file mode 100644 index 00000000000..b675eddf31c --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_processentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_processentity.go new file mode 100644 index 00000000000..2e254bf02d2 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_processentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_processentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_processentityproperties.go new file mode 100644 index 00000000000..931d0a4fa98 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registrykeyentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registrykeyentity.go new file mode 100644 index 00000000000..3407bb232c9 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..94b02370b6b --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registryvalueentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registryvalueentity.go new file mode 100644 index 00000000000..871dc3b1c32 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..def30680f7c --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_securitygroupentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_securitygroupentity.go new file mode 100644 index 00000000000..c31a0c66785 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..5cffe7c38b2 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_submissionmailentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_submissionmailentity.go new file mode 100644 index 00000000000..7c284b24777 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..dfd00e5aa38 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_threatintelligence.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_threatintelligence.go new file mode 100644 index 00000000000..f2b23759950 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_urlentity.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_urlentity.go new file mode 100644 index 00000000000..cf8e6e9a3a0 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_urlentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_urlentityproperties.go new file mode 100644 index 00000000000..c5aa8f80ac1 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidentbookmarks/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/constants.go b/resource-manager/securityinsights/2023-11-01/incidententities/constants.go index a1d54eb28d0..69f307e9f5e 100644 --- a/resource-manager/securityinsights/2023-11-01/incidententities/constants.go +++ b/resource-manager/securityinsights/2023-11-01/incidententities/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_accountentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_accountentity.go new file mode 100644 index 00000000000..5a33b83b2fb --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_accountentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_accountentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_accountentityproperties.go new file mode 100644 index 00000000000..528a54127a4 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_azureresourceentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_azureresourceentity.go new file mode 100644 index 00000000000..ff6f76c4686 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..69816915b53 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_cloudapplicationentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_cloudapplicationentity.go new file mode 100644 index 00000000000..5cc38003f9c --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..4b2f11d322b --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_dnsentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_dnsentity.go new file mode 100644 index 00000000000..161832ab67f --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_dnsentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_dnsentityproperties.go new file mode 100644 index 00000000000..b27096f1113 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_entity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_entity.go index e1d1670419a..6dde8c8e453 100644 --- a/resource-manager/securityinsights/2023-11-01/incidententities/model_entity.go +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_fileentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_fileentity.go new file mode 100644 index 00000000000..c2df39d994f --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_fileentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_fileentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_fileentityproperties.go new file mode 100644 index 00000000000..fc783e91bfa --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_filehashentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_filehashentity.go new file mode 100644 index 00000000000..77b77f1654b --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_filehashentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_filehashentityproperties.go new file mode 100644 index 00000000000..1a76366f7e2 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_geolocation.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_geolocation.go new file mode 100644 index 00000000000..1873bfc3721 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_geolocation.go @@ -0,0 +1,14 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_hostentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_hostentity.go new file mode 100644 index 00000000000..23c931b09f9 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_hostentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_hostentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_hostentityproperties.go new file mode 100644 index 00000000000..309ef661071 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_iotdeviceentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_iotdeviceentity.go new file mode 100644 index 00000000000..8b451847561 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..c7f83841c0d --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_ipentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_ipentity.go new file mode 100644 index 00000000000..6fde828d140 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_ipentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_ipentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_ipentityproperties.go new file mode 100644 index 00000000000..bb3da9667bd --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_mailboxentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailboxentity.go new file mode 100644 index 00000000000..5fbc2dbe211 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_mailboxentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailboxentityproperties.go new file mode 100644 index 00000000000..c973db65df5 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_mailclusterentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailclusterentity.go new file mode 100644 index 00000000000..3d1c7ade2dd --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..1394f0cd969 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_mailmessageentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailmessageentity.go new file mode 100644 index 00000000000..c5b5370a1ef --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..bd17fdbd83c --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_malwareentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_malwareentity.go new file mode 100644 index 00000000000..5ddeaf637bf --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_malwareentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_malwareentityproperties.go new file mode 100644 index 00000000000..552fa12bb80 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_processentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_processentity.go new file mode 100644 index 00000000000..01cd7b87ca0 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_processentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_processentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_processentityproperties.go new file mode 100644 index 00000000000..ae9f7910c57 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_registrykeyentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_registrykeyentity.go new file mode 100644 index 00000000000..c047ecde648 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..607a196df8f --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_registryvalueentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_registryvalueentity.go new file mode 100644 index 00000000000..2fab2915b49 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..747cb9c6ea3 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_securitygroupentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_securitygroupentity.go new file mode 100644 index 00000000000..5e4dc8e1acc --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..62aeeb5ba45 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_submissionmailentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_submissionmailentity.go new file mode 100644 index 00000000000..53ed1950b15 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..db8531a70c6 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_threatintelligence.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_threatintelligence.go new file mode 100644 index 00000000000..83d6e3b356a --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_urlentity.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_urlentity.go new file mode 100644 index 00000000000..0aa89b96ffc --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_urlentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2023-11-01/incidententities/model_urlentityproperties.go b/resource-manager/securityinsights/2023-11-01/incidententities/model_urlentityproperties.go new file mode 100644 index 00000000000..57e56ad4b48 --- /dev/null +++ b/resource-manager/securityinsights/2023-11-01/incidententities/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2023-11-01/incidents/model_incidentadditionaldata.go b/resource-manager/securityinsights/2023-11-01/incidents/model_incidentadditionaldata.go index 51b13e3a495..507d3b005a4 100644 --- a/resource-manager/securityinsights/2023-11-01/incidents/model_incidentadditionaldata.go +++ b/resource-manager/securityinsights/2023-11-01/incidents/model_incidentadditionaldata.go @@ -8,6 +8,6 @@ type IncidentAdditionalData struct { AlertsCount *int64 `json:"alertsCount,omitempty"` BookmarksCount *int64 `json:"bookmarksCount,omitempty"` CommentsCount *int64 `json:"commentsCount,omitempty"` - ProviderIncidentUrl *string `json:"providerIncidentUrl,omitempty"` + ProviderIncidentURL *string `json:"providerIncidentUrl,omitempty"` Tactics *[]AttackTactic `json:"tactics,omitempty"` } diff --git a/resource-manager/securityinsights/2023-11-01/incidents/model_incidentproperties.go b/resource-manager/securityinsights/2023-11-01/incidents/model_incidentproperties.go index fc00cd6b1ac..0608720d453 100644 --- a/resource-manager/securityinsights/2023-11-01/incidents/model_incidentproperties.go +++ b/resource-manager/securityinsights/2023-11-01/incidents/model_incidentproperties.go @@ -18,7 +18,7 @@ type IncidentProperties struct { Description *string `json:"description,omitempty"` FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"` IncidentNumber *int64 `json:"incidentNumber,omitempty"` - IncidentUrl *string `json:"incidentUrl,omitempty"` + IncidentURL *string `json:"incidentUrl,omitempty"` Labels *[]IncidentLabel `json:"labels,omitempty"` LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"` LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` diff --git a/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/README.md b/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/README.md index dc33d5a5596..29603419a4c 100644 --- a/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/README.md +++ b/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") payload := securitymlanalyticssettings.SecurityMLAnalyticsSetting{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go b/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go index 664c157d691..18bac933415 100644 --- a/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go +++ b/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go @@ -125,7 +125,7 @@ func (id SecurityMLAnalyticsSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticSecurityMLAnalyticsSettings", "securityMLAnalyticsSettings", "securityMLAnalyticsSettings"), - resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "settingsResourceName"), + resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "securityMLAnalyticsSettingName"), } } diff --git a/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go b/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go index f815f97f834..87ffe04f752 100644 --- a/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go +++ b/resource-manager/securityinsights/2023-11-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityMLAnalyticsSettingId{} func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { - id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") + id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.SecurityMLAnalyticsSettingName != "settingsResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "settingsResourceName") + if id.SecurityMLAnalyticsSettingName != "securityMLAnalyticsSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "securityMLAnalyticsSettingName") } } func TestFormatSecurityMLAnalyticsSettingID(t *testing.T) { - actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName" + actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseSecurityMLAnalyticsSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseSecurityMLAnalyticsSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - SecurityMLAnalyticsSettingName: "sEtTiNgSrEsOuRcEnAmE", + SecurityMLAnalyticsSettingName: "sEcUrItYmLaNaLyTiCsSeTtInGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/README.md b/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/README.md index 15c51811f1c..0c6356de2d8 100644 --- a/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/README.md +++ b/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") payload := sentinelonboardingstates.SentinelOnboardingState{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/id_onboardingstate.go b/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/id_onboardingstate.go index ea535534399..4e285b13c5c 100644 --- a/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/id_onboardingstate.go +++ b/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/id_onboardingstate.go @@ -125,7 +125,7 @@ func (id OnboardingStateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticOnboardingStates", "onboardingStates", "onboardingStates"), - resourceids.UserSpecifiedSegment("onboardingStateName", "sentinelOnboardingStateName"), + resourceids.UserSpecifiedSegment("onboardingStateName", "onboardingStateName"), } } diff --git a/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/id_onboardingstate_test.go b/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/id_onboardingstate_test.go index a601d0b8cb2..53228c86aad 100644 --- a/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/id_onboardingstate_test.go +++ b/resource-manager/securityinsights/2023-11-01/sentinelonboardingstates/id_onboardingstate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OnboardingStateId{} func TestNewOnboardingStateID(t *testing.T) { - id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") + id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOnboardingStateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OnboardingStateName != "sentinelOnboardingStateName" { - t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "sentinelOnboardingStateName") + if id.OnboardingStateName != "onboardingStateName" { + t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "onboardingStateName") } } func TestFormatOnboardingStateID(t *testing.T) { - actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName" + actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseOnboardingStateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseOnboardingStateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OnboardingStateName: "sEnTiNeLoNbOaRdInGsTaTeNaMe", + OnboardingStateName: "oNbOaRdInGsTaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_deployment.go b/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_deployment.go index 11a744036f1..452ba50d746 100644 --- a/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_deployment.go +++ b/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_deployment.go @@ -11,7 +11,7 @@ import ( type Deployment struct { DeploymentId *string `json:"deploymentId,omitempty"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` DeploymentResult *DeploymentResult `json:"deploymentResult,omitempty"` DeploymentState *DeploymentState `json:"deploymentState,omitempty"` DeploymentTime *string `json:"deploymentTime,omitempty"` diff --git a/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_repository.go b/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_repository.go index da49f2c4c5c..ec8410d4387 100644 --- a/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_repository.go +++ b/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_repository.go @@ -5,7 +5,7 @@ package sourcecontrols type Repository struct { Branch string `json:"branch"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` - DisplayUrl *string `json:"displayUrl,omitempty"` + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` + DisplayURL *string `json:"displayUrl,omitempty"` Url string `json:"url"` } diff --git a/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_webhook.go b/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_webhook.go index 40e0e1b6970..9aa2b07d7e8 100644 --- a/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_webhook.go +++ b/resource-manager/securityinsights/2023-11-01/sourcecontrols/model_webhook.go @@ -13,7 +13,7 @@ type Webhook struct { RotateWebhookSecret *bool `json:"rotateWebhookSecret,omitempty"` WebhookId *string `json:"webhookId,omitempty"` WebhookSecretUpdateTime *string `json:"webhookSecretUpdateTime,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } func (o *Webhook) GetWebhookSecretUpdateTimeAsTime() (*time.Time, error) { diff --git a/resource-manager/securityinsights/2023-11-01/threatintelligence/README.md b/resource-manager/securityinsights/2023-11-01/threatintelligence/README.md index 9f404354bde..49f86525fca 100644 --- a/resource-manager/securityinsights/2023-11-01/threatintelligence/README.md +++ b/resource-manager/securityinsights/2023-11-01/threatintelligence/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceAppendTags{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorDelete(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorGet(ctx, id) if err != nil { @@ -157,7 +157,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... diff --git a/resource-manager/securityinsights/2023-11-01/threatintelligence/id_indicator.go b/resource-manager/securityinsights/2023-11-01/threatintelligence/id_indicator.go index 315e21dcecd..11f98e1c5be 100644 --- a/resource-manager/securityinsights/2023-11-01/threatintelligence/id_indicator.go +++ b/resource-manager/securityinsights/2023-11-01/threatintelligence/id_indicator.go @@ -127,7 +127,7 @@ func (id IndicatorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), resourceids.StaticSegment("staticMain", "main", "main"), resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "name"), + resourceids.UserSpecifiedSegment("indicatorName", "indicatorName"), } } diff --git a/resource-manager/securityinsights/2023-11-01/threatintelligence/id_indicator_test.go b/resource-manager/securityinsights/2023-11-01/threatintelligence/id_indicator_test.go index becb280f28f..4ead61bfafa 100644 --- a/resource-manager/securityinsights/2023-11-01/threatintelligence/id_indicator_test.go +++ b/resource-manager/securityinsights/2023-11-01/threatintelligence/id_indicator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IndicatorId{} func TestNewIndicatorID(t *testing.T) { - id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewIndicatorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.IndicatorName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "name") + if id.IndicatorName != "indicatorName" { + t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "indicatorName") } } func TestFormatIndicatorID(t *testing.T) { - actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name" + actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -117,17 +117,17 @@ func TestParseIndicatorID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, } @@ -308,32 +308,32 @@ func TestParseIndicatorIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - IndicatorName: "nAmE", + IndicatorName: "iNdIcAtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2023-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go b/resource-manager/securityinsights/2023-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go index 1a40488054a..82d00a009ce 100644 --- a/resource-manager/securityinsights/2023-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go +++ b/resource-manager/securityinsights/2023-11-01/threatintelligence/model_threatintelligenceindicatorproperties.go @@ -11,7 +11,7 @@ type ThreatIntelligenceIndicatorProperties struct { Defanged *bool `json:"defanged,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` + Extensions *map[string]interface{} `json:"extensions,omitempty"` ExternalId *string `json:"externalId,omitempty"` ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` diff --git a/resource-manager/securityinsights/2024-03-01/automationrules/constants.go b/resource-manager/securityinsights/2024-03-01/automationrules/constants.go index 27a7cc6c03e..8e521489b02 100644 --- a/resource-manager/securityinsights/2024-03-01/automationrules/constants.go +++ b/resource-manager/securityinsights/2024-03-01/automationrules/constants.go @@ -462,7 +462,7 @@ const ( AutomationRulePropertyConditionSupportedPropertyProcessId AutomationRulePropertyConditionSupportedProperty = "ProcessId" AutomationRulePropertyConditionSupportedPropertyRegistryKey AutomationRulePropertyConditionSupportedProperty = "RegistryKey" AutomationRulePropertyConditionSupportedPropertyRegistryValueData AutomationRulePropertyConditionSupportedProperty = "RegistryValueData" - AutomationRulePropertyConditionSupportedPropertyUrl AutomationRulePropertyConditionSupportedProperty = "Url" + AutomationRulePropertyConditionSupportedPropertyURL AutomationRulePropertyConditionSupportedProperty = "Url" ) func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []string { @@ -524,7 +524,7 @@ func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []strin string(AutomationRulePropertyConditionSupportedPropertyProcessId), string(AutomationRulePropertyConditionSupportedPropertyRegistryKey), string(AutomationRulePropertyConditionSupportedPropertyRegistryValueData), - string(AutomationRulePropertyConditionSupportedPropertyUrl), + string(AutomationRulePropertyConditionSupportedPropertyURL), } } @@ -600,7 +600,7 @@ func parseAutomationRulePropertyConditionSupportedProperty(input string) (*Autom "processid": AutomationRulePropertyConditionSupportedPropertyProcessId, "registrykey": AutomationRulePropertyConditionSupportedPropertyRegistryKey, "registryvaluedata": AutomationRulePropertyConditionSupportedPropertyRegistryValueData, - "url": AutomationRulePropertyConditionSupportedPropertyUrl, + "url": AutomationRulePropertyConditionSupportedPropertyURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/constants.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/constants.go index 3673d5b1163..e2637e80b46 100644 --- a/resource-manager/securityinsights/2024-03-01/incidentalerts/constants.go +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_accountentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_accountentity.go new file mode 100644 index 00000000000..f7d9562b9e5 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_accountentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_accountentityproperties.go new file mode 100644 index 00000000000..95e8c7c53d9 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_azureresourceentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_azureresourceentity.go new file mode 100644 index 00000000000..0ed5f71a2b7 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..8330e17735c --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_cloudapplicationentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_cloudapplicationentity.go new file mode 100644 index 00000000000..c7c3714cbf5 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..d2c0e47210d --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_dnsentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_dnsentity.go new file mode 100644 index 00000000000..13fd09f04f5 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_dnsentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_dnsentityproperties.go new file mode 100644 index 00000000000..110d09978cf --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_entity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_entity.go index da1973b0de5..175f65e0b19 100644 --- a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_entity.go +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_fileentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_fileentity.go new file mode 100644 index 00000000000..2a22db96248 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_fileentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_fileentityproperties.go new file mode 100644 index 00000000000..8d4114bb662 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_filehashentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_filehashentity.go new file mode 100644 index 00000000000..765bfbf9335 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_filehashentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_filehashentityproperties.go new file mode 100644 index 00000000000..bce0abb81bb --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_geolocation.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_geolocation.go new file mode 100644 index 00000000000..898225b3df8 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_hostentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_hostentity.go new file mode 100644 index 00000000000..34387f6e2cd --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_hostentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_hostentityproperties.go new file mode 100644 index 00000000000..8e568412923 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_iotdeviceentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_iotdeviceentity.go new file mode 100644 index 00000000000..29c5828334d --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..f9f3459091c --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_ipentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_ipentity.go new file mode 100644 index 00000000000..b1368edbff0 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_ipentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_ipentityproperties.go new file mode 100644 index 00000000000..6349274f795 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailboxentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailboxentity.go new file mode 100644 index 00000000000..e270892a274 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailboxentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailboxentityproperties.go new file mode 100644 index 00000000000..cfec407c644 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailclusterentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailclusterentity.go new file mode 100644 index 00000000000..3a9bfb3df79 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..77fae37505c --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailmessageentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailmessageentity.go new file mode 100644 index 00000000000..dbc8b5b62bb --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..ce180f49397 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_malwareentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_malwareentity.go new file mode 100644 index 00000000000..01fd019eac5 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_malwareentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_malwareentityproperties.go new file mode 100644 index 00000000000..fb8735141e4 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_processentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_processentity.go new file mode 100644 index 00000000000..fe219b87ac9 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_processentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_processentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_processentityproperties.go new file mode 100644 index 00000000000..401f8cec926 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registrykeyentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registrykeyentity.go new file mode 100644 index 00000000000..8e9cc7cbf61 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..58e169d2aac --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registryvalueentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registryvalueentity.go new file mode 100644 index 00000000000..fd4acdd59c0 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..1a02a1f29a1 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_securitygroupentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_securitygroupentity.go new file mode 100644 index 00000000000..7409aedd8e0 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..35655ad7610 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_submissionmailentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_submissionmailentity.go new file mode 100644 index 00000000000..c9a35517027 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..7b92257de5d --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentalerts + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_threatintelligence.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_threatintelligence.go new file mode 100644 index 00000000000..3eb0e546118 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_urlentity.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_urlentity.go new file mode 100644 index 00000000000..5a73366e76e --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentalerts + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentalerts/model_urlentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_urlentityproperties.go new file mode 100644 index 00000000000..29a6fa25cd9 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentalerts/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentalerts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/constants.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/constants.go index 27f31cfcc5e..2047359314a 100644 --- a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/constants.go +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_accountentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_accountentity.go new file mode 100644 index 00000000000..56abba96e36 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_accountentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_accountentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_accountentityproperties.go new file mode 100644 index 00000000000..c55c43f2525 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_azureresourceentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_azureresourceentity.go new file mode 100644 index 00000000000..7bf0ab8b62b --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..c09bf1c4d3f --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_cloudapplicationentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_cloudapplicationentity.go new file mode 100644 index 00000000000..4c9e8ce6194 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..bef31fda55e --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_dnsentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_dnsentity.go new file mode 100644 index 00000000000..f1b1b8b4f3b --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_dnsentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_dnsentityproperties.go new file mode 100644 index 00000000000..ec46759cbd6 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_entity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_entity.go index 434e71e0224..7a2cc57097c 100644 --- a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_entity.go +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_fileentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_fileentity.go new file mode 100644 index 00000000000..11e19dd2e3b --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_fileentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_fileentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_fileentityproperties.go new file mode 100644 index 00000000000..7a9c24b3505 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_filehashentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_filehashentity.go new file mode 100644 index 00000000000..a858827d61f --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_filehashentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_filehashentityproperties.go new file mode 100644 index 00000000000..a61a35a1a68 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_geolocation.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_geolocation.go new file mode 100644 index 00000000000..8d991bfadbe --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_geolocation.go @@ -0,0 +1,14 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_hostentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_hostentity.go new file mode 100644 index 00000000000..5caa2ae5640 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_hostentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_hostentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_hostentityproperties.go new file mode 100644 index 00000000000..050e6030ebb --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_iotdeviceentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_iotdeviceentity.go new file mode 100644 index 00000000000..e97507c0a74 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..5c1fd5e963e --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_ipentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_ipentity.go new file mode 100644 index 00000000000..47b72c121f0 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_ipentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_ipentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_ipentityproperties.go new file mode 100644 index 00000000000..6db5073f063 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailboxentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailboxentity.go new file mode 100644 index 00000000000..191641d99bc --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailboxentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailboxentityproperties.go new file mode 100644 index 00000000000..58bddee162c --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailclusterentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailclusterentity.go new file mode 100644 index 00000000000..7c2a004bae0 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..1155dc4b5ab --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailmessageentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailmessageentity.go new file mode 100644 index 00000000000..a4135331b74 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..78b5653d29f --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_malwareentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_malwareentity.go new file mode 100644 index 00000000000..3b22fe0c93e --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_malwareentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_malwareentityproperties.go new file mode 100644 index 00000000000..b675eddf31c --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_processentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_processentity.go new file mode 100644 index 00000000000..2e254bf02d2 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_processentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_processentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_processentityproperties.go new file mode 100644 index 00000000000..931d0a4fa98 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registrykeyentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registrykeyentity.go new file mode 100644 index 00000000000..3407bb232c9 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..94b02370b6b --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registryvalueentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registryvalueentity.go new file mode 100644 index 00000000000..871dc3b1c32 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..def30680f7c --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_securitygroupentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_securitygroupentity.go new file mode 100644 index 00000000000..c31a0c66785 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..5cffe7c38b2 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_submissionmailentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_submissionmailentity.go new file mode 100644 index 00000000000..7c284b24777 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..dfd00e5aa38 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidentbookmarks + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_threatintelligence.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_threatintelligence.go new file mode 100644 index 00000000000..f2b23759950 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_urlentity.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_urlentity.go new file mode 100644 index 00000000000..cf8e6e9a3a0 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_urlentity.go @@ -0,0 +1,60 @@ +package incidentbookmarks + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_urlentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_urlentityproperties.go new file mode 100644 index 00000000000..c5aa8f80ac1 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidentbookmarks/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidentbookmarks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/constants.go b/resource-manager/securityinsights/2024-03-01/incidententities/constants.go index a1d54eb28d0..69f307e9f5e 100644 --- a/resource-manager/securityinsights/2024-03-01/incidententities/constants.go +++ b/resource-manager/securityinsights/2024-03-01/incidententities/constants.go @@ -106,6 +106,53 @@ func parseAlertStatus(input string) (*AlertStatus, error) { return &out, nil } +type AntispamMailDirection string + +const ( + AntispamMailDirectionInbound AntispamMailDirection = "Inbound" + AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" + AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" + AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" +) + +func PossibleValuesForAntispamMailDirection() []string { + return []string{ + string(AntispamMailDirectionInbound), + string(AntispamMailDirectionIntraorg), + string(AntispamMailDirectionOutbound), + string(AntispamMailDirectionUnknown), + } +} + +func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAntispamMailDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { + vals := map[string]AntispamMailDirection{ + "inbound": AntispamMailDirectionInbound, + "intraorg": AntispamMailDirectionIntraorg, + "outbound": AntispamMailDirectionOutbound, + "unknown": AntispamMailDirectionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AntispamMailDirection(input) + return &out, nil +} + type AttackTactic string const ( @@ -283,6 +330,162 @@ func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { return &out, nil } +type DeliveryAction string + +const ( + DeliveryActionBlocked DeliveryAction = "Blocked" + DeliveryActionDelivered DeliveryAction = "Delivered" + DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" + DeliveryActionReplaced DeliveryAction = "Replaced" + DeliveryActionUnknown DeliveryAction = "Unknown" +) + +func PossibleValuesForDeliveryAction() []string { + return []string{ + string(DeliveryActionBlocked), + string(DeliveryActionDelivered), + string(DeliveryActionDeliveredAsSpam), + string(DeliveryActionReplaced), + string(DeliveryActionUnknown), + } +} + +func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryAction(input string) (*DeliveryAction, error) { + vals := map[string]DeliveryAction{ + "blocked": DeliveryActionBlocked, + "delivered": DeliveryActionDelivered, + "deliveredasspam": DeliveryActionDeliveredAsSpam, + "replaced": DeliveryActionReplaced, + "unknown": DeliveryActionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryAction(input) + return &out, nil +} + +type DeliveryLocation string + +const ( + DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" + DeliveryLocationDropped DeliveryLocation = "Dropped" + DeliveryLocationExternal DeliveryLocation = "External" + DeliveryLocationFailed DeliveryLocation = "Failed" + DeliveryLocationForwarded DeliveryLocation = "Forwarded" + DeliveryLocationInbox DeliveryLocation = "Inbox" + DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" + DeliveryLocationQuarantine DeliveryLocation = "Quarantine" + DeliveryLocationUnknown DeliveryLocation = "Unknown" +) + +func PossibleValuesForDeliveryLocation() []string { + return []string{ + string(DeliveryLocationDeletedFolder), + string(DeliveryLocationDropped), + string(DeliveryLocationExternal), + string(DeliveryLocationFailed), + string(DeliveryLocationForwarded), + string(DeliveryLocationInbox), + string(DeliveryLocationJunkFolder), + string(DeliveryLocationQuarantine), + string(DeliveryLocationUnknown), + } +} + +func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeliveryLocation(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeliveryLocation(input string) (*DeliveryLocation, error) { + vals := map[string]DeliveryLocation{ + "deletedfolder": DeliveryLocationDeletedFolder, + "dropped": DeliveryLocationDropped, + "external": DeliveryLocationExternal, + "failed": DeliveryLocationFailed, + "forwarded": DeliveryLocationForwarded, + "inbox": DeliveryLocationInbox, + "junkfolder": DeliveryLocationJunkFolder, + "quarantine": DeliveryLocationQuarantine, + "unknown": DeliveryLocationUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeliveryLocation(input) + return &out, nil +} + +type ElevationToken string + +const ( + ElevationTokenDefault ElevationToken = "Default" + ElevationTokenFull ElevationToken = "Full" + ElevationTokenLimited ElevationToken = "Limited" +) + +func PossibleValuesForElevationToken() []string { + return []string{ + string(ElevationTokenDefault), + string(ElevationTokenFull), + string(ElevationTokenLimited), + } +} + +func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseElevationToken(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseElevationToken(input string) (*ElevationToken, error) { + vals := map[string]ElevationToken{ + "default": ElevationTokenDefault, + "full": ElevationTokenFull, + "limited": ElevationTokenLimited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ElevationToken(input) + return &out, nil +} + type EntityKindEnum string const ( @@ -306,7 +509,7 @@ const ( EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" + EntityKindEnumURL EntityKindEnum = "Url" ) func PossibleValuesForEntityKindEnum() []string { @@ -331,7 +534,7 @@ func PossibleValuesForEntityKindEnum() []string { string(EntityKindEnumSecurityAlert), string(EntityKindEnumSecurityGroup), string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), + string(EntityKindEnumURL), } } @@ -370,7 +573,7 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { "securityalert": EntityKindEnumSecurityAlert, "securitygroup": EntityKindEnumSecurityGroup, "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, + "url": EntityKindEnumURL, } if v, ok := vals[strings.ToLower(input)]; ok { return &v, nil @@ -381,6 +584,56 @@ func parseEntityKindEnum(input string) (*EntityKindEnum, error) { return &out, nil } +type FileHashAlgorithm string + +const ( + FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" + FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" + FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" + FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" + FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" +) + +func PossibleValuesForFileHashAlgorithm() []string { + return []string{ + string(FileHashAlgorithmMDFive), + string(FileHashAlgorithmSHAOne), + string(FileHashAlgorithmSHATwoFiveSix), + string(FileHashAlgorithmSHATwoFiveSixAC), + string(FileHashAlgorithmUnknown), + } +} + +func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileHashAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { + vals := map[string]FileHashAlgorithm{ + "md5": FileHashAlgorithmMDFive, + "sha1": FileHashAlgorithmSHAOne, + "sha256": FileHashAlgorithmSHATwoFiveSix, + "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, + "unknown": FileHashAlgorithmUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileHashAlgorithm(input) + return &out, nil +} + type IncidentSeverity string const ( @@ -504,3 +757,177 @@ func parseKillChainIntent(input string) (*KillChainIntent, error) { out := KillChainIntent(input) return &out, nil } + +type OSFamily string + +const ( + OSFamilyAndroid OSFamily = "Android" + OSFamilyIOS OSFamily = "IOS" + OSFamilyLinux OSFamily = "Linux" + OSFamilyUnknown OSFamily = "Unknown" + OSFamilyWindows OSFamily = "Windows" +) + +func PossibleValuesForOSFamily() []string { + return []string{ + string(OSFamilyAndroid), + string(OSFamilyIOS), + string(OSFamilyLinux), + string(OSFamilyUnknown), + string(OSFamilyWindows), + } +} + +func (s *OSFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOSFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOSFamily(input string) (*OSFamily, error) { + vals := map[string]OSFamily{ + "android": OSFamilyAndroid, + "ios": OSFamilyIOS, + "linux": OSFamilyLinux, + "unknown": OSFamilyUnknown, + "windows": OSFamilyWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OSFamily(input) + return &out, nil +} + +type RegistryHive string + +const ( + RegistryHiveHKEYA RegistryHive = "HKEY_A" + RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" + RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" + RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" + RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" + RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" + RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" + RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" + RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" + RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" +) + +func PossibleValuesForRegistryHive() []string { + return []string{ + string(RegistryHiveHKEYA), + string(RegistryHiveHKEYCLASSESROOT), + string(RegistryHiveHKEYCURRENTCONFIG), + string(RegistryHiveHKEYCURRENTUSER), + string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), + string(RegistryHiveHKEYLOCALMACHINE), + string(RegistryHiveHKEYPERFORMANCEDATA), + string(RegistryHiveHKEYPERFORMANCENLSTEXT), + string(RegistryHiveHKEYPERFORMANCETEXT), + string(RegistryHiveHKEYUSERS), + } +} + +func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryHive(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryHive(input string) (*RegistryHive, error) { + vals := map[string]RegistryHive{ + "hkey_a": RegistryHiveHKEYA, + "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, + "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, + "hkey_current_user": RegistryHiveHKEYCURRENTUSER, + "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, + "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, + "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, + "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, + "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, + "hkey_users": RegistryHiveHKEYUSERS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryHive(input) + return &out, nil +} + +type RegistryValueKind string + +const ( + RegistryValueKindBinary RegistryValueKind = "Binary" + RegistryValueKindDWord RegistryValueKind = "DWord" + RegistryValueKindExpandString RegistryValueKind = "ExpandString" + RegistryValueKindMultiString RegistryValueKind = "MultiString" + RegistryValueKindNone RegistryValueKind = "None" + RegistryValueKindQWord RegistryValueKind = "QWord" + RegistryValueKindString RegistryValueKind = "String" + RegistryValueKindUnknown RegistryValueKind = "Unknown" +) + +func PossibleValuesForRegistryValueKind() []string { + return []string{ + string(RegistryValueKindBinary), + string(RegistryValueKindDWord), + string(RegistryValueKindExpandString), + string(RegistryValueKindMultiString), + string(RegistryValueKindNone), + string(RegistryValueKindQWord), + string(RegistryValueKindString), + string(RegistryValueKindUnknown), + } +} + +func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegistryValueKind(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegistryValueKind(input string) (*RegistryValueKind, error) { + vals := map[string]RegistryValueKind{ + "binary": RegistryValueKindBinary, + "dword": RegistryValueKindDWord, + "expandstring": RegistryValueKindExpandString, + "multistring": RegistryValueKindMultiString, + "none": RegistryValueKindNone, + "qword": RegistryValueKindQWord, + "string": RegistryValueKindString, + "unknown": RegistryValueKindUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegistryValueKind(input) + return &out, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_accountentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_accountentity.go new file mode 100644 index 00000000000..5a33b83b2fb --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_accountentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AccountEntity{} + +type AccountEntity struct { + Properties *AccountEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AccountEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AccountEntity{} + +func (s AccountEntity) MarshalJSON() ([]byte, error) { + type wrapper AccountEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) + } + + decoded["kind"] = "Account" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_accountentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_accountentityproperties.go new file mode 100644 index 00000000000..528a54127a4 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_accountentityproperties.go @@ -0,0 +1,21 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEntityProperties struct { + AadTenantId *string `json:"aadTenantId,omitempty"` + AadUserId *string `json:"aadUserId,omitempty"` + AccountName *string `json:"accountName,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Puid *string `json:"puid,omitempty"` + Sid *string `json:"sid,omitempty"` + UpnSuffix *string `json:"upnSuffix,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_azureresourceentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_azureresourceentity.go new file mode 100644 index 00000000000..ff6f76c4686 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_azureresourceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = AzureResourceEntity{} + +type AzureResourceEntity struct { + Properties *AzureResourceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s AzureResourceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = AzureResourceEntity{} + +func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { + type wrapper AzureResourceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) + } + + decoded["kind"] = "AzureResource" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_azureresourceentityproperties.go new file mode 100644 index 00000000000..69816915b53 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_azureresourceentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureResourceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_cloudapplicationentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_cloudapplicationentity.go new file mode 100644 index 00000000000..5cc38003f9c --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_cloudapplicationentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = CloudApplicationEntity{} + +type CloudApplicationEntity struct { + Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s CloudApplicationEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = CloudApplicationEntity{} + +func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { + type wrapper CloudApplicationEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) + } + + decoded["kind"] = "CloudApplication" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_cloudapplicationentityproperties.go new file mode 100644 index 00000000000..4b2f11d322b --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_cloudapplicationentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudApplicationEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AppId *int64 `json:"appId,omitempty"` + AppName *string `json:"appName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InstanceName *string `json:"instanceName,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_dnsentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_dnsentity.go new file mode 100644 index 00000000000..161832ab67f --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_dnsentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = DnsEntity{} + +type DnsEntity struct { + Properties *DnsEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s DnsEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = DnsEntity{} + +func (s DnsEntity) MarshalJSON() ([]byte, error) { + type wrapper DnsEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) + } + + decoded["kind"] = "DnsResolution" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_dnsentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_dnsentityproperties.go new file mode 100644 index 00000000000..b27096f1113 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_dnsentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` + DomainName *string `json:"domainName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` + IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_entity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_entity.go index e1d1670419a..6dde8c8e453 100644 --- a/resource-manager/securityinsights/2024-03-01/incidententities/model_entity.go +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_entity.go @@ -59,6 +59,62 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "Account") { + var out AccountEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AzureResource") { + var out AzureResourceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "CloudApplication") { + var out CloudApplicationEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DnsResolution") { + var out DnsEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "File") { + var out FileEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "FileHash") { + var out FileHashEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "Bookmark") { var out HuntingBookmark if err := json.Unmarshal(input, &out); err != nil { @@ -67,6 +123,78 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "Ip") { + var out IPEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "IoTDevice") { + var out IoTDeviceEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailCluster") { + var out MailClusterEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "MailMessage") { + var out MailMessageEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Mailbox") { + var out MailboxEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Malware") { + var out MalwareEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Process") { + var out ProcessEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryKey") { + var out RegistryKeyEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "RegistryValue") { + var out RegistryValueEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) + } + return out, nil + } + if strings.EqualFold(value, "SecurityAlert") { var out SecurityAlert if err := json.Unmarshal(input, &out); err != nil { @@ -75,6 +203,30 @@ func UnmarshalEntityImplementation(input []byte) (Entity, error) { return out, nil } + if strings.EqualFold(value, "SecurityGroup") { + var out SecurityGroupEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SubmissionMail") { + var out SubmissionMailEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Url") { + var out URLEntity + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into URLEntity: %+v", err) + } + return out, nil + } + var parent BaseEntityImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseEntityImpl: %+v", err) diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_fileentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_fileentity.go new file mode 100644 index 00000000000..c2df39d994f --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_fileentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileEntity{} + +type FileEntity struct { + Properties *FileEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileEntity{} + +func (s FileEntity) MarshalJSON() ([]byte, error) { + type wrapper FileEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) + } + + decoded["kind"] = "File" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_fileentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_fileentityproperties.go new file mode 100644 index 00000000000..fc783e91bfa --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_fileentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Directory *string `json:"directory,omitempty"` + FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` + FileName *string `json:"fileName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_filehashentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_filehashentity.go new file mode 100644 index 00000000000..77b77f1654b --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_filehashentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = FileHashEntity{} + +type FileHashEntity struct { + Properties *FileHashEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s FileHashEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = FileHashEntity{} + +func (s FileHashEntity) MarshalJSON() ([]byte, error) { + type wrapper FileHashEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) + } + + decoded["kind"] = "FileHash" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_filehashentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_filehashentityproperties.go new file mode 100644 index 00000000000..1a76366f7e2 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_filehashentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FileHashEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HashValue *string `json:"hashValue,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_geolocation.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_geolocation.go new file mode 100644 index 00000000000..1873bfc3721 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_geolocation.go @@ -0,0 +1,14 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GeoLocation struct { + Asn *int64 `json:"asn,omitempty"` + City *string `json:"city,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + CountryName *string `json:"countryName,omitempty"` + Latitude *float64 `json:"latitude,omitempty"` + Longitude *float64 `json:"longitude,omitempty"` + State *string `json:"state,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_hostentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_hostentity.go new file mode 100644 index 00000000000..23c931b09f9 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_hostentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = HostEntity{} + +type HostEntity struct { + Properties *HostEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s HostEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = HostEntity{} + +func (s HostEntity) MarshalJSON() ([]byte, error) { + type wrapper HostEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) + } + + decoded["kind"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_hostentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_hostentityproperties.go new file mode 100644 index 00000000000..309ef661071 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_hostentityproperties.go @@ -0,0 +1,18 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AzureID *string `json:"azureID,omitempty"` + DnsDomain *string `json:"dnsDomain,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostName *string `json:"hostName,omitempty"` + IsDomainJoined *bool `json:"isDomainJoined,omitempty"` + NetBiosName *string `json:"netBiosName,omitempty"` + NtDomain *string `json:"ntDomain,omitempty"` + OmsAgentID *string `json:"omsAgentID,omitempty"` + OsFamily *OSFamily `json:"osFamily,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_iotdeviceentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_iotdeviceentity.go new file mode 100644 index 00000000000..8b451847561 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_iotdeviceentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IoTDeviceEntity{} + +type IoTDeviceEntity struct { + Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IoTDeviceEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IoTDeviceEntity{} + +func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { + type wrapper IoTDeviceEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) + } + + decoded["kind"] = "IoTDevice" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_iotdeviceentityproperties.go new file mode 100644 index 00000000000..c7f83841c0d --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_iotdeviceentityproperties.go @@ -0,0 +1,26 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IoTDeviceEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DeviceId *string `json:"deviceId,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + EdgeId *string `json:"edgeId,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` + IotHubEntityId *string `json:"iotHubEntityId,omitempty"` + IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Model *string `json:"model,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Protocols *[]string `json:"protocols,omitempty"` + SerialNumber *string `json:"serialNumber,omitempty"` + Source *string `json:"source,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_ipentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_ipentity.go new file mode 100644 index 00000000000..6fde828d140 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_ipentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = IPEntity{} + +type IPEntity struct { + Properties *IPEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s IPEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = IPEntity{} + +func (s IPEntity) MarshalJSON() ([]byte, error) { + type wrapper IPEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling IPEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) + } + + decoded["kind"] = "Ip" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_ipentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_ipentityproperties.go new file mode 100644 index 00000000000..bb3da9667bd --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_ipentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IPEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Address *string `json:"address,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Location *GeoLocation `json:"location,omitempty"` + ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_mailboxentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailboxentity.go new file mode 100644 index 00000000000..5fbc2dbe211 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailboxentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailboxEntity{} + +type MailboxEntity struct { + Properties *MailboxEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailboxEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailboxEntity{} + +func (s MailboxEntity) MarshalJSON() ([]byte, error) { + type wrapper MailboxEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) + } + + decoded["kind"] = "Mailbox" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_mailboxentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailboxentityproperties.go new file mode 100644 index 00000000000..c973db65df5 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailboxentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailboxEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` + Upn *string `json:"upn,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_mailclusterentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailclusterentity.go new file mode 100644 index 00000000000..3d1c7ade2dd --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailclusterentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailClusterEntity{} + +type MailClusterEntity struct { + Properties *MailClusterEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailClusterEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailClusterEntity{} + +func (s MailClusterEntity) MarshalJSON() ([]byte, error) { + type wrapper MailClusterEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) + } + + decoded["kind"] = "MailCluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailclusterentityproperties.go new file mode 100644 index 00000000000..1394f0cd969 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailclusterentityproperties.go @@ -0,0 +1,66 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailClusterEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + ClusterGroup *string `json:"clusterGroup,omitempty"` + ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` + ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` + ClusterSourceType *string `json:"clusterSourceType,omitempty"` + CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` + CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` + CountByThreatType *interface{} `json:"countByThreatType,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` + MailCount *int64 `json:"mailCount,omitempty"` + NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` + Query *string `json:"query,omitempty"` + QueryTime *string `json:"queryTime,omitempty"` + Source *string `json:"source,omitempty"` + Threats *[]string `json:"threats,omitempty"` +} + +func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { + if o.ClusterQueryEndTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryEndTime = &formatted +} + +func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { + if o.ClusterQueryStartTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ClusterQueryStartTime = &formatted +} + +func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { + if o.QueryTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.QueryTime = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_mailmessageentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailmessageentity.go new file mode 100644 index 00000000000..c5b5370a1ef --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailmessageentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MailMessageEntity{} + +type MailMessageEntity struct { + Properties *MailMessageEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MailMessageEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MailMessageEntity{} + +func (s MailMessageEntity) MarshalJSON() ([]byte, error) { + type wrapper MailMessageEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) + } + + decoded["kind"] = "MailMessage" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailmessageentityproperties.go new file mode 100644 index 00000000000..bd17fdbd83c --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_mailmessageentityproperties.go @@ -0,0 +1,52 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MailMessageEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` + BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` + BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` + BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` + BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + InternetMessageId *string `json:"internetMessageId,omitempty"` + Language *string `json:"language,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + P1Sender *string `json:"p1Sender,omitempty"` + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` + P1SenderDomain *string `json:"p1SenderDomain,omitempty"` + P2Sender *string `json:"p2Sender,omitempty"` + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` + P2SenderDomain *string `json:"p2SenderDomain,omitempty"` + ReceiveDate *string `json:"receiveDate,omitempty"` + Recipient *string `json:"recipient,omitempty"` + SenderIP *string `json:"senderIP,omitempty"` + Subject *string `json:"subject,omitempty"` + ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` + Threats *[]string `json:"threats,omitempty"` + Urls *[]string `json:"urls,omitempty"` +} + +func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { + if o.ReceiveDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ReceiveDate = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_malwareentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_malwareentity.go new file mode 100644 index 00000000000..5ddeaf637bf --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_malwareentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = MalwareEntity{} + +type MalwareEntity struct { + Properties *MalwareEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s MalwareEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = MalwareEntity{} + +func (s MalwareEntity) MarshalJSON() ([]byte, error) { + type wrapper MalwareEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) + } + + decoded["kind"] = "Malware" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_malwareentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_malwareentityproperties.go new file mode 100644 index 00000000000..552fa12bb80 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_malwareentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MalwareEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + Category *string `json:"category,omitempty"` + FileEntityIds *[]string `json:"fileEntityIds,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + MalwareName *string `json:"malwareName,omitempty"` + ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_processentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_processentity.go new file mode 100644 index 00000000000..01cd7b87ca0 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_processentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = ProcessEntity{} + +type ProcessEntity struct { + Properties *ProcessEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s ProcessEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = ProcessEntity{} + +func (s ProcessEntity) MarshalJSON() ([]byte, error) { + type wrapper ProcessEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) + } + + decoded["kind"] = "Process" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_processentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_processentityproperties.go new file mode 100644 index 00000000000..ae9f7910c57 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_processentityproperties.go @@ -0,0 +1,36 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProcessEntityProperties struct { + AccountEntityId *string `json:"accountEntityId,omitempty"` + AdditionalData *interface{} `json:"additionalData,omitempty"` + CommandLine *string `json:"commandLine,omitempty"` + CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` + ElevationToken *ElevationToken `json:"elevationToken,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HostEntityId *string `json:"hostEntityId,omitempty"` + HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` + ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` + ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` + ProcessId *string `json:"processId,omitempty"` +} + +func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { + if o.CreationTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeUtc = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_registrykeyentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_registrykeyentity.go new file mode 100644 index 00000000000..c047ecde648 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_registrykeyentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryKeyEntity{} + +type RegistryKeyEntity struct { + Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryKeyEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryKeyEntity{} + +func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryKeyEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) + } + + decoded["kind"] = "RegistryKey" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_registrykeyentityproperties.go new file mode 100644 index 00000000000..607a196df8f --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_registrykeyentityproperties.go @@ -0,0 +1,11 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryKeyEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Hive *RegistryHive `json:"hive,omitempty"` + Key *string `json:"key,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_registryvalueentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_registryvalueentity.go new file mode 100644 index 00000000000..2fab2915b49 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_registryvalueentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = RegistryValueEntity{} + +type RegistryValueEntity struct { + Properties *RegistryValueEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s RegistryValueEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = RegistryValueEntity{} + +func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { + type wrapper RegistryValueEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) + } + + decoded["kind"] = "RegistryValue" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_registryvalueentityproperties.go new file mode 100644 index 00000000000..747cb9c6ea3 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_registryvalueentityproperties.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryValueEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + KeyEntityId *string `json:"keyEntityId,omitempty"` + ValueData *string `json:"valueData,omitempty"` + ValueName *string `json:"valueName,omitempty"` + ValueType *RegistryValueKind `json:"valueType,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_securitygroupentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_securitygroupentity.go new file mode 100644 index 00000000000..5e4dc8e1acc --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_securitygroupentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SecurityGroupEntity{} + +type SecurityGroupEntity struct { + Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SecurityGroupEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SecurityGroupEntity{} + +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + type wrapper SecurityGroupEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) + } + + decoded["kind"] = "SecurityGroup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_securitygroupentityproperties.go new file mode 100644 index 00000000000..62aeeb5ba45 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_securitygroupentityproperties.go @@ -0,0 +1,12 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityGroupEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + DistinguishedName *string `json:"distinguishedName,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ObjectGuid *string `json:"objectGuid,omitempty"` + Sid *string `json:"sid,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_submissionmailentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_submissionmailentity.go new file mode 100644 index 00000000000..53ed1950b15 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_submissionmailentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = SubmissionMailEntity{} + +type SubmissionMailEntity struct { + Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s SubmissionMailEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = SubmissionMailEntity{} + +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + type wrapper SubmissionMailEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) + } + + decoded["kind"] = "SubmissionMail" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_submissionmailentityproperties.go new file mode 100644 index 00000000000..db8531a70c6 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_submissionmailentityproperties.go @@ -0,0 +1,49 @@ +package incidententities + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubmissionMailEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + NetworkMessageId *string `json:"networkMessageId,omitempty"` + Recipient *string `json:"recipient,omitempty"` + ReportType *string `json:"reportType,omitempty"` + Sender *string `json:"sender,omitempty"` + SenderIP *string `json:"senderIp,omitempty"` + Subject *string `json:"subject,omitempty"` + SubmissionDate *string `json:"submissionDate,omitempty"` + SubmissionId *string `json:"submissionId,omitempty"` + Submitter *string `json:"submitter,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { + if o.SubmissionDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.SubmissionDate = &formatted +} + +func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_threatintelligence.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_threatintelligence.go new file mode 100644 index 00000000000..83d6e3b356a --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_threatintelligence.go @@ -0,0 +1,13 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ThreatIntelligence struct { + Confidence *float64 `json:"confidence,omitempty"` + ProviderName *string `json:"providerName,omitempty"` + ReportLink *string `json:"reportLink,omitempty"` + ThreatDescription *string `json:"threatDescription,omitempty"` + ThreatName *string `json:"threatName,omitempty"` + ThreatType *string `json:"threatType,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_urlentity.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_urlentity.go new file mode 100644 index 00000000000..0aa89b96ffc --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_urlentity.go @@ -0,0 +1,60 @@ +package incidententities + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Entity = URLEntity{} + +type URLEntity struct { + Properties *URLEntityProperties `json:"properties,omitempty"` + + // Fields inherited from Entity + + Id *string `json:"id,omitempty"` + Kind EntityKindEnum `json:"kind"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (s URLEntity) Entity() BaseEntityImpl { + return BaseEntityImpl{ + Id: s.Id, + Kind: s.Kind, + Name: s.Name, + SystemData: s.SystemData, + Type: s.Type, + } +} + +var _ json.Marshaler = URLEntity{} + +func (s URLEntity) MarshalJSON() ([]byte, error) { + type wrapper URLEntity + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling URLEntity: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling URLEntity: %+v", err) + } + + decoded["kind"] = "Url" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling URLEntity: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/securityinsights/2024-03-01/incidententities/model_urlentityproperties.go b/resource-manager/securityinsights/2024-03-01/incidententities/model_urlentityproperties.go new file mode 100644 index 00000000000..57e56ad4b48 --- /dev/null +++ b/resource-manager/securityinsights/2024-03-01/incidententities/model_urlentityproperties.go @@ -0,0 +1,10 @@ +package incidententities + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type URLEntityProperties struct { + AdditionalData *interface{} `json:"additionalData,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + Url *string `json:"url,omitempty"` +} diff --git a/resource-manager/securityinsights/2024-03-01/incidents/model_incidentadditionaldata.go b/resource-manager/securityinsights/2024-03-01/incidents/model_incidentadditionaldata.go index 51b13e3a495..507d3b005a4 100644 --- a/resource-manager/securityinsights/2024-03-01/incidents/model_incidentadditionaldata.go +++ b/resource-manager/securityinsights/2024-03-01/incidents/model_incidentadditionaldata.go @@ -8,6 +8,6 @@ type IncidentAdditionalData struct { AlertsCount *int64 `json:"alertsCount,omitempty"` BookmarksCount *int64 `json:"bookmarksCount,omitempty"` CommentsCount *int64 `json:"commentsCount,omitempty"` - ProviderIncidentUrl *string `json:"providerIncidentUrl,omitempty"` + ProviderIncidentURL *string `json:"providerIncidentUrl,omitempty"` Tactics *[]AttackTactic `json:"tactics,omitempty"` } diff --git a/resource-manager/securityinsights/2024-03-01/incidents/model_incidentproperties.go b/resource-manager/securityinsights/2024-03-01/incidents/model_incidentproperties.go index fc00cd6b1ac..0608720d453 100644 --- a/resource-manager/securityinsights/2024-03-01/incidents/model_incidentproperties.go +++ b/resource-manager/securityinsights/2024-03-01/incidents/model_incidentproperties.go @@ -18,7 +18,7 @@ type IncidentProperties struct { Description *string `json:"description,omitempty"` FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"` IncidentNumber *int64 `json:"incidentNumber,omitempty"` - IncidentUrl *string `json:"incidentUrl,omitempty"` + IncidentURL *string `json:"incidentUrl,omitempty"` Labels *[]IncidentLabel `json:"labels,omitempty"` LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"` LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` diff --git a/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/README.md b/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/README.md index 337e5fca0a9..ba482b2169c 100644 --- a/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/README.md +++ b/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") payload := securitymlanalyticssettings.SecurityMLAnalyticsSetting{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") +id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go b/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go index 664c157d691..18bac933415 100644 --- a/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go +++ b/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/id_securitymlanalyticssetting.go @@ -125,7 +125,7 @@ func (id SecurityMLAnalyticsSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticSecurityMLAnalyticsSettings", "securityMLAnalyticsSettings", "securityMLAnalyticsSettings"), - resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "settingsResourceName"), + resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "securityMLAnalyticsSettingName"), } } diff --git a/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go b/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go index f815f97f834..87ffe04f752 100644 --- a/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go +++ b/resource-manager/securityinsights/2024-03-01/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SecurityMLAnalyticsSettingId{} func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { - id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName") + id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.SecurityMLAnalyticsSettingName != "settingsResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "settingsResourceName") + if id.SecurityMLAnalyticsSettingName != "securityMLAnalyticsSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "securityMLAnalyticsSettingName") } } func TestFormatSecurityMLAnalyticsSettingID(t *testing.T) { - actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "settingsResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName" + actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "securityMLAnalyticsSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseSecurityMLAnalyticsSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseSecurityMLAnalyticsSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - SecurityMLAnalyticsSettingName: "settingsResourceName", + SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/settingsResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE", Expected: &SecurityMLAnalyticsSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - SecurityMLAnalyticsSettingName: "sEtTiNgSrEsOuRcEnAmE", + SecurityMLAnalyticsSettingName: "sEcUrItYmLaNaLyTiCsSeTtInGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEtTiNgSrEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGnAmE/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/README.md b/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/README.md index 370238aa8ef..2947309476f 100644 --- a/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/README.md +++ b/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") payload := sentinelonboardingstates.SentinelOnboardingState{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") +id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/id_onboardingstate.go b/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/id_onboardingstate.go index ea535534399..4e285b13c5c 100644 --- a/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/id_onboardingstate.go +++ b/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/id_onboardingstate.go @@ -125,7 +125,7 @@ func (id OnboardingStateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders2", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), resourceids.StaticSegment("staticOnboardingStates", "onboardingStates", "onboardingStates"), - resourceids.UserSpecifiedSegment("onboardingStateName", "sentinelOnboardingStateName"), + resourceids.UserSpecifiedSegment("onboardingStateName", "onboardingStateName"), } } diff --git a/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/id_onboardingstate_test.go b/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/id_onboardingstate_test.go index a601d0b8cb2..53228c86aad 100644 --- a/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/id_onboardingstate_test.go +++ b/resource-manager/securityinsights/2024-03-01/sentinelonboardingstates/id_onboardingstate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OnboardingStateId{} func TestNewOnboardingStateID(t *testing.T) { - id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName") + id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOnboardingStateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.OnboardingStateName != "sentinelOnboardingStateName" { - t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "sentinelOnboardingStateName") + if id.OnboardingStateName != "onboardingStateName" { + t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "onboardingStateName") } } func TestFormatOnboardingStateID(t *testing.T) { - actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sentinelOnboardingStateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName" + actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "onboardingStateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -107,17 +107,17 @@ func TestParseOnboardingStateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, } @@ -278,32 +278,32 @@ func TestParseOnboardingStateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - OnboardingStateName: "sentinelOnboardingStateName", + OnboardingStateName: "onboardingStateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/sentinelOnboardingStateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe", Expected: &OnboardingStateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - OnboardingStateName: "sEnTiNeLoNbOaRdInGsTaTeNaMe", + OnboardingStateName: "oNbOaRdInGsTaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/sEnTiNeLoNbOaRdInGsTaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_deployment.go b/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_deployment.go index 11a744036f1..452ba50d746 100644 --- a/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_deployment.go +++ b/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_deployment.go @@ -11,7 +11,7 @@ import ( type Deployment struct { DeploymentId *string `json:"deploymentId,omitempty"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` DeploymentResult *DeploymentResult `json:"deploymentResult,omitempty"` DeploymentState *DeploymentState `json:"deploymentState,omitempty"` DeploymentTime *string `json:"deploymentTime,omitempty"` diff --git a/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_repository.go b/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_repository.go index da49f2c4c5c..ec8410d4387 100644 --- a/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_repository.go +++ b/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_repository.go @@ -5,7 +5,7 @@ package sourcecontrols type Repository struct { Branch string `json:"branch"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` - DisplayUrl *string `json:"displayUrl,omitempty"` + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` + DisplayURL *string `json:"displayUrl,omitempty"` Url string `json:"url"` } diff --git a/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_webhook.go b/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_webhook.go index 40e0e1b6970..9aa2b07d7e8 100644 --- a/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_webhook.go +++ b/resource-manager/securityinsights/2024-03-01/sourcecontrols/model_webhook.go @@ -13,7 +13,7 @@ type Webhook struct { RotateWebhookSecret *bool `json:"rotateWebhookSecret,omitempty"` WebhookId *string `json:"webhookId,omitempty"` WebhookSecretUpdateTime *string `json:"webhookSecretUpdateTime,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` + WebhookURL *string `json:"webhookUrl,omitempty"` } func (o *Webhook) GetWebhookSecretUpdateTimeAsTime() (*time.Time, error) { diff --git a/resource-manager/securityinsights/2024-03-01/threatintelligence/README.md b/resource-manager/securityinsights/2024-03-01/threatintelligence/README.md index cdd52c9af44..4c3676618b9 100644 --- a/resource-manager/securityinsights/2024-03-01/threatintelligence/README.md +++ b/resource-manager/securityinsights/2024-03-01/threatintelligence/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceAppendTags{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorDelete(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") read, err := client.IndicatorGet(ctx, id) if err != nil { @@ -157,7 +157,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") +id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") payload := threatintelligence.ThreatIntelligenceIndicatorModel{ // ... diff --git a/resource-manager/securityinsights/2024-03-01/threatintelligence/id_indicator.go b/resource-manager/securityinsights/2024-03-01/threatintelligence/id_indicator.go index 315e21dcecd..11f98e1c5be 100644 --- a/resource-manager/securityinsights/2024-03-01/threatintelligence/id_indicator.go +++ b/resource-manager/securityinsights/2024-03-01/threatintelligence/id_indicator.go @@ -127,7 +127,7 @@ func (id IndicatorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), resourceids.StaticSegment("staticMain", "main", "main"), resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "name"), + resourceids.UserSpecifiedSegment("indicatorName", "indicatorName"), } } diff --git a/resource-manager/securityinsights/2024-03-01/threatintelligence/id_indicator_test.go b/resource-manager/securityinsights/2024-03-01/threatintelligence/id_indicator_test.go index becb280f28f..4ead61bfafa 100644 --- a/resource-manager/securityinsights/2024-03-01/threatintelligence/id_indicator_test.go +++ b/resource-manager/securityinsights/2024-03-01/threatintelligence/id_indicator_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IndicatorId{} func TestNewIndicatorID(t *testing.T) { - id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name") + id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewIndicatorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.IndicatorName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "name") + if id.IndicatorName != "indicatorName" { + t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "indicatorName") } } func TestFormatIndicatorID(t *testing.T) { - actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name" + actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "indicatorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -117,17 +117,17 @@ func TestParseIndicatorID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, } @@ -308,32 +308,32 @@ func TestParseIndicatorIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - IndicatorName: "name", + IndicatorName: "indicatorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceName/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe", Expected: &IndicatorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - IndicatorName: "nAmE", + IndicatorName: "iNdIcAtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeNaMe/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/securityinsights/2024-03-01/threatintelligence/model_threatintelligenceindicatorproperties.go b/resource-manager/securityinsights/2024-03-01/threatintelligence/model_threatintelligenceindicatorproperties.go index 1a40488054a..82d00a009ce 100644 --- a/resource-manager/securityinsights/2024-03-01/threatintelligence/model_threatintelligenceindicatorproperties.go +++ b/resource-manager/securityinsights/2024-03-01/threatintelligence/model_threatintelligenceindicatorproperties.go @@ -11,7 +11,7 @@ type ThreatIntelligenceIndicatorProperties struct { Defanged *bool `json:"defanged,omitempty"` Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` + Extensions *map[string]interface{} `json:"extensions,omitempty"` ExternalId *string `json:"externalId,omitempty"` ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` diff --git a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/README.md b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/README.md index 50891123f99..0bba5f7134f 100644 --- a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/README.md +++ b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.BreakPairing(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.ArmDisasterRecovery{ // ... @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Delete(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.FailoverProperties{ // ... @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Get(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { @@ -168,7 +168,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") // alternatively `client.ListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.ListAuthorizationRulesComplete(ctx, id) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.ListKeys(ctx, id) if err != nil { diff --git a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go index d79ea87a231..30c61d42189 100644 --- a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 5c705b9c552..6982c5283c2 100644 --- a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go index 04d899e6626..325d105a163 100644 --- a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go +++ b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go @@ -129,7 +129,7 @@ func (id DisasterRecoveryConfigAuthorizationRuleId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go index 5b0dcf0e822..507174547f2 100644 --- a/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go +++ b/resource-manager/servicebus/2021-06-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigAuthorizationRuleId{} func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") + id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { } func TestFormatDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName" + actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/README.md b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/README.md index a58669d6759..6353a61b306 100644 --- a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/README.md +++ b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.BreakPairing(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.ArmDisasterRecovery{ // ... @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Delete(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.FailoverProperties{ // ... @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Get(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { @@ -168,7 +168,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") // alternatively `client.ListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.ListAuthorizationRulesComplete(ctx, id) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.ListKeys(ctx, id) if err != nil { diff --git a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go index d79ea87a231..30c61d42189 100644 --- a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 5c705b9c552..6982c5283c2 100644 --- a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go index 04d899e6626..325d105a163 100644 --- a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go +++ b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go @@ -129,7 +129,7 @@ func (id DisasterRecoveryConfigAuthorizationRuleId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go index 5b0dcf0e822..507174547f2 100644 --- a/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go +++ b/resource-manager/servicebus/2021-11-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigAuthorizationRuleId{} func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") + id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { } func TestFormatDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName" + actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/README.md b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/README.md index de05e8ef73f..ad5129f157a 100644 --- a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/README.md +++ b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.BreakPairing(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.ArmDisasterRecovery{ // ... @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Delete(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.FailoverProperties{ // ... @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Get(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { @@ -168,7 +168,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") // alternatively `client.ListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.ListAuthorizationRulesComplete(ctx, id) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.ListKeys(ctx, id) if err != nil { diff --git a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go index d79ea87a231..30c61d42189 100644 --- a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 5c705b9c552..6982c5283c2 100644 --- a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go index 04d899e6626..325d105a163 100644 --- a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go +++ b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go @@ -129,7 +129,7 @@ func (id DisasterRecoveryConfigAuthorizationRuleId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go index 5b0dcf0e822..507174547f2 100644 --- a/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go +++ b/resource-manager/servicebus/2022-01-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigAuthorizationRuleId{} func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") + id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { } func TestFormatDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName" + actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/README.md b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/README.md index 314f10e20df..ee2190d2b1e 100644 --- a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/README.md +++ b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.BreakPairing(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.ArmDisasterRecovery{ // ... @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Delete(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.FailoverProperties{ // ... @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Get(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { @@ -168,7 +168,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") // alternatively `client.ListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.ListAuthorizationRulesComplete(ctx, id) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.ListKeys(ctx, id) if err != nil { diff --git a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go index d79ea87a231..30c61d42189 100644 --- a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 5c705b9c552..6982c5283c2 100644 --- a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go index 04d899e6626..325d105a163 100644 --- a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go +++ b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go @@ -129,7 +129,7 @@ func (id DisasterRecoveryConfigAuthorizationRuleId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go index 5b0dcf0e822..507174547f2 100644 --- a/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go +++ b/resource-manager/servicebus/2022-10-01-preview/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigAuthorizationRuleId{} func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") + id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { } func TestFormatDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName" + actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/README.md b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/README.md index 2fa24e1f91f..fdf51676bc5 100644 --- a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/README.md +++ b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.BreakPairing(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.ArmDisasterRecovery{ // ... @@ -82,7 +82,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Delete(ctx, id) if err != nil { @@ -98,7 +98,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") payload := disasterrecoveryconfigs.FailoverProperties{ // ... @@ -119,7 +119,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") read, err := client.Get(ctx, id) if err != nil { @@ -135,7 +135,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.GetAuthorizationRule(ctx, id) if err != nil { @@ -168,7 +168,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") // alternatively `client.ListAuthorizationRules(ctx, id)` can be used to do batched pagination items, err := client.ListAuthorizationRulesComplete(ctx, id) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") +id := disasterrecoveryconfigs.NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") read, err := client.ListKeys(ctx, id) if err != nil { diff --git a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go index d79ea87a231..30c61d42189 100644 --- a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go +++ b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig.go @@ -123,7 +123,7 @@ func (id DisasterRecoveryConfigId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), } } diff --git a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go index 5c705b9c552..6982c5283c2 100644 --- a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go +++ b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfig_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigId{} func TestNewDisasterRecoveryConfigID(t *testing.T) { - id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias") + id := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDisasterRecoveryConfigID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } } func TestFormatDisasterRecoveryConfigID(t *testing.T) { - actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias" + actual := NewDisasterRecoveryConfigID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDisasterRecoveryConfigID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDisasterRecoveryConfigIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Expected: &DisasterRecoveryConfigId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go index 04d899e6626..325d105a163 100644 --- a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go +++ b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule.go @@ -129,7 +129,7 @@ func (id DisasterRecoveryConfigAuthorizationRuleId) Segments() []resourceids.Seg resourceids.StaticSegment("staticNamespaces", "namespaces", "namespaces"), resourceids.UserSpecifiedSegment("namespaceName", "namespaceName"), resourceids.StaticSegment("staticDisasterRecoveryConfigs", "disasterRecoveryConfigs", "disasterRecoveryConfigs"), - resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "alias"), + resourceids.UserSpecifiedSegment("disasterRecoveryConfigName", "disasterRecoveryConfigName"), resourceids.StaticSegment("staticAuthorizationRules", "authorizationRules", "authorizationRules"), resourceids.UserSpecifiedSegment("authorizationRuleName", "authorizationRuleName"), } diff --git a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go index 5b0dcf0e822..507174547f2 100644 --- a/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go +++ b/resource-manager/servicebus/2024-01-01/disasterrecoveryconfigs/id_disasterrecoveryconfigauthorizationrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DisasterRecoveryConfigAuthorizationRuleId{} func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName") + id := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'NamespaceName'", id.NamespaceName, "namespaceName") } - if id.DisasterRecoveryConfigName != "alias" { - t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "alias") + if id.DisasterRecoveryConfigName != "disasterRecoveryConfigName" { + t.Fatalf("Expected %q but got %q for Segment 'DisasterRecoveryConfigName'", id.DisasterRecoveryConfigName, "disasterRecoveryConfigName") } if id.AuthorizationRuleName != "authorizationRuleName" { @@ -36,8 +36,8 @@ func TestNewDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { } func TestFormatDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { - actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "alias", "authorizationRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName" + actual := NewDisasterRecoveryConfigAuthorizationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "namespaceName", "disasterRecoveryConfigName", "authorizationRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDisasterRecoveryConfigAuthorizationRuleIDInsensitively(t *testing. }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", NamespaceName: "namespaceName", - DisasterRecoveryConfigName: "alias", + DisasterRecoveryConfigName: "disasterRecoveryConfigName", AuthorizationRuleName: "authorizationRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/alias/authorizationRules/authorizationRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceBus/namespaces/namespaceName/disasterRecoveryConfigs/disasterRecoveryConfigName/authorizationRules/authorizationRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe", Expected: &DisasterRecoveryConfigAuthorizationRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", NamespaceName: "nAmEsPaCeNaMe", - DisasterRecoveryConfigName: "aLiAs", + DisasterRecoveryConfigName: "dIsAsTeRrEcOvErYcOnFiGnAmE", AuthorizationRuleName: "aUtHoRiZaTiOnRuLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/aLiAs/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeBuS/nAmEsPaCeS/nAmEsPaCeNaMe/dIsAsTeRrEcOvErYcOnFiGs/dIsAsTeRrEcOvErYcOnFiGnAmE/aUtHoRiZaTiOnRuLeS/aUtHoRiZaTiOnRuLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabric/2021-06-01/applicationtypeversion/README.md b/resource-manager/servicefabric/2021-06-01/applicationtypeversion/README.md index 1bba417da84..218ed529548 100644 --- a/resource-manager/servicefabric/2021-06-01/applicationtypeversion/README.md +++ b/resource-manager/servicefabric/2021-06-01/applicationtypeversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "versionName") payload := applicationtypeversion.ApplicationTypeVersionResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "versionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/servicefabric/2021-06-01/applicationtypeversion/id_version.go b/resource-manager/servicefabric/2021-06-01/applicationtypeversion/id_version.go index bf520eaa319..c4bb072c85b 100644 --- a/resource-manager/servicefabric/2021-06-01/applicationtypeversion/id_version.go +++ b/resource-manager/servicefabric/2021-06-01/applicationtypeversion/id_version.go @@ -131,7 +131,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/servicefabric/2021-06-01/applicationtypeversion/id_version_test.go b/resource-manager/servicefabric/2021-06-01/applicationtypeversion/id_version_test.go index fb407564f62..62eb87893c2 100644 --- a/resource-manager/servicefabric/2021-06-01/applicationtypeversion/id_version_test.go +++ b/resource-manager/servicefabric/2021-06-01/applicationtypeversion/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ApplicationTypeName'", id.ApplicationTypeName, "applicationTypeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ClusterName: "clusterName", ApplicationTypeName: "applicationTypeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/versionName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ClusterName: "clusterName", ApplicationTypeName: "applicationTypeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/clusters/clusterName/applicationTypes/applicationTypeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/cLuStErS/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/cLuStErS/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ClusterName: "cLuStErNaMe", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/cLuStErS/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/cLuStErS/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabric/2021-06-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go b/resource-manager/servicefabric/2021-06-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go index 85a525a924a..26abfdb0bd2 100644 --- a/resource-manager/servicefabric/2021-06-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go +++ b/resource-manager/servicefabric/2021-06-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go @@ -4,7 +4,7 @@ package applicationtypeversion // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationTypeVersionResourceProperties struct { - AppPackageUrl string `json:"appPackageUrl"` + AppPackageURL string `json:"appPackageUrl"` DefaultParameterList *map[string]string `json:"defaultParameterList,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/README.md b/resource-manager/servicefabric/2021-06-01/clusterversion/README.md index c507877dd85..c856685d3dd 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/README.md +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := clusterversion.NewClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") +id := clusterversion.NewClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "clusterVersionName") // alternatively `client.Get(ctx, id)` can be used to do batched pagination items, err := client.GetComplete(ctx, id) @@ -41,7 +41,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := clusterversion.NewEnvironmentClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "Linux", "clusterVersion") +id := clusterversion.NewEnvironmentClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "Linux", "clusterVersionName") // alternatively `client.GetByEnvironment(ctx, id)` can be used to do batched pagination items, err := client.GetByEnvironmentComplete(ctx, id) @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := clusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := clusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -75,7 +75,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := clusterversion.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "location", "Linux") +id := clusterversion.NewEnvironmentID("12345678-1234-9876-4563-123456789012", "locationName", "Linux") // alternatively `client.ListByEnvironment(ctx, id)` can be used to do batched pagination items, err := client.ListByEnvironmentComplete(ctx, id) diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/id_clusterversion.go b/resource-manager/servicefabric/2021-06-01/clusterversion/id_clusterversion.go index f7c5cac6077..4b46461e694 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/id_clusterversion.go +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/id_clusterversion.go @@ -113,9 +113,9 @@ func (id ClusterVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticClusterVersions", "clusterVersions", "clusterVersions"), - resourceids.UserSpecifiedSegment("clusterVersionName", "clusterVersion"), + resourceids.UserSpecifiedSegment("clusterVersionName", "clusterVersionName"), } } diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/id_clusterversion_test.go b/resource-manager/servicefabric/2021-06-01/clusterversion/id_clusterversion_test.go index 4aa3ff142db..21358e21c68 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/id_clusterversion_test.go +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/id_clusterversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &ClusterVersionId{} func TestNewClusterVersionID(t *testing.T) { - id := NewClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") + id := NewClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "clusterVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ClusterVersionName != "clusterVersion" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterVersionName'", id.ClusterVersionName, "clusterVersion") + if id.ClusterVersionName != "clusterVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'ClusterVersionName'", id.ClusterVersionName, "clusterVersionName") } } func TestFormatClusterVersionID(t *testing.T) { - actual := NewClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/clusterVersions/clusterVersion" + actual := NewClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "clusterVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/clusterVersions/clusterVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseClusterVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/clusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/clusterVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/clusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/clusterVersions/clusterVersionName", Expected: &ClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ClusterVersionName: "clusterVersion", + LocationName: "locationName", + ClusterVersionName: "clusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/clusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/clusterVersions/clusterVersionName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseClusterVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/clusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/clusterVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/cLuStErVeRsIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/cLuStErVeRsIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/clusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/clusterVersions/clusterVersionName", Expected: &ClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ClusterVersionName: "clusterVersion", + LocationName: "locationName", + ClusterVersionName: "clusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/clusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/clusterVersions/clusterVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/cLuStErVeRsIoNs/cLuStErVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/cLuStErVeRsIoNs/cLuStErVeRsIoNnAmE", Expected: &ClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ClusterVersionName: "cLuStErVeRsIoN", + LocationName: "lOcAtIoNnAmE", + ClusterVersionName: "cLuStErVeRsIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/cLuStErVeRsIoNs/cLuStErVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/cLuStErVeRsIoNs/cLuStErVeRsIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/id_environment.go b/resource-manager/servicefabric/2021-06-01/clusterversion/id_environment.go index 12b9e3db698..c684632f53a 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/id_environment.go +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/id_environment.go @@ -121,7 +121,7 @@ func (id EnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), resourceids.ConstantSegment("environment", PossibleValuesForClusterVersionsEnvironment(), "Linux"), } diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/id_environment_test.go b/resource-manager/servicefabric/2021-06-01/clusterversion/id_environment_test.go index fd6bc1c8046..aaf63572f63 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/id_environment_test.go +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/id_environment_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &EnvironmentId{} func TestNewEnvironmentID(t *testing.T) { - id := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "location", "Linux") + id := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "locationName", "Linux") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.Environment != "Linux" { @@ -28,8 +28,8 @@ func TestNewEnvironmentID(t *testing.T) { } func TestFormatEnvironmentID(t *testing.T) { - actual := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "location", "Linux").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux" + actual := NewEnvironmentID("12345678-1234-9876-4563-123456789012", "locationName", "Linux").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseEnvironmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", Environment: "Linux", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseEnvironmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", Environment: "Linux", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/lInUx", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/lInUx", Expected: &EnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", Environment: "Linux", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/lInUx/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/lInUx/extra", Error: true, }, } diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/id_environmentclusterversion.go b/resource-manager/servicefabric/2021-06-01/clusterversion/id_environmentclusterversion.go index 30b89640419..f19629c7761 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/id_environmentclusterversion.go +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/id_environmentclusterversion.go @@ -127,11 +127,11 @@ func (id EnvironmentClusterVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), resourceids.ConstantSegment("environment", PossibleValuesForClusterVersionsEnvironment(), "Linux"), resourceids.StaticSegment("staticClusterVersions", "clusterVersions", "clusterVersions"), - resourceids.UserSpecifiedSegment("clusterVersionName", "clusterVersion"), + resourceids.UserSpecifiedSegment("clusterVersionName", "clusterVersionName"), } } diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/id_environmentclusterversion_test.go b/resource-manager/servicefabric/2021-06-01/clusterversion/id_environmentclusterversion_test.go index a05ffafe1a2..cedf7ae095a 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/id_environmentclusterversion_test.go +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/id_environmentclusterversion_test.go @@ -12,28 +12,28 @@ import ( var _ resourceids.ResourceId = &EnvironmentClusterVersionId{} func TestNewEnvironmentClusterVersionID(t *testing.T) { - id := NewEnvironmentClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "Linux", "clusterVersion") + id := NewEnvironmentClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "Linux", "clusterVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.Environment != "Linux" { t.Fatalf("Expected %q but got %q for Segment 'Environment'", id.Environment, "Linux") } - if id.ClusterVersionName != "clusterVersion" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterVersionName'", id.ClusterVersionName, "clusterVersion") + if id.ClusterVersionName != "clusterVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'ClusterVersionName'", id.ClusterVersionName, "clusterVersionName") } } func TestFormatEnvironmentClusterVersionID(t *testing.T) { - actual := NewEnvironmentClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "Linux", "clusterVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/clusterVersions/clusterVersion" + actual := NewEnvironmentClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "Linux", "clusterVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/clusterVersions/clusterVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -77,37 +77,37 @@ func TestParseEnvironmentClusterVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/clusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/clusterVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/clusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/clusterVersions/clusterVersionName", Expected: &EnvironmentClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", Environment: "Linux", - ClusterVersionName: "clusterVersion", + ClusterVersionName: "clusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/clusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/clusterVersions/clusterVersionName/extra", Error: true, }, } @@ -208,72 +208,72 @@ func TestParseEnvironmentClusterVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/lInUx", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/lInUx", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/clusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/clusterVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/lInUx/cLuStErVeRsIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/lInUx/cLuStErVeRsIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/clusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/clusterVersions/clusterVersionName", Expected: &EnvironmentClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", Environment: "Linux", - ClusterVersionName: "clusterVersion", + ClusterVersionName: "clusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Linux/clusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Linux/clusterVersions/clusterVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/lInUx/cLuStErVeRsIoNs/cLuStErVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/lInUx/cLuStErVeRsIoNs/cLuStErVeRsIoNnAmE", Expected: &EnvironmentClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", Environment: "Linux", - ClusterVersionName: "cLuStErVeRsIoN", + ClusterVersionName: "cLuStErVeRsIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/lInUx/cLuStErVeRsIoNs/cLuStErVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/lInUx/cLuStErVeRsIoNs/cLuStErVeRsIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/id_location.go b/resource-manager/servicefabric/2021-06-01/clusterversion/id_location.go index 7644059bdb7..c1949c35c5e 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/id_location.go +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/servicefabric/2021-06-01/clusterversion/id_location_test.go b/resource-manager/servicefabric/2021-06-01/clusterversion/id_location_test.go index 629571fb8f5..f2c1e3c5628 100644 --- a/resource-manager/servicefabric/2021-06-01/clusterversion/id_location_test.go +++ b/resource-manager/servicefabric/2021-06-01/clusterversion/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/README.md b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/README.md index e7efa88237b..f37ca37e84c 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/README.md +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") payload := application.ApplicationResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := application.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") payload := application.ApplicationUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_application.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_application.go index 4cde8b4079e..a3336e0dc84 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_application.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_application_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_application_test.go index c3018a4b4ca..233c5f32b75 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_application_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_managedcluster.go index e533de43637..4c131079c6e 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_managedcluster_test.go index ab28c8d0c01..a8ece58d175 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/application/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/README.md b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/README.md index 6cfd4d28a33..95e2aeda0ff 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/README.md +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") payload := applicationtype.ApplicationTypeResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := applicationtype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") payload := applicationtype.ApplicationTypeUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_applicationtype.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_applicationtype.go index 463218b950f..4ebdecd4bd8 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_applicationtype.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_applicationtype.go @@ -121,7 +121,7 @@ func (id ApplicationTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_applicationtype_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_applicationtype_test.go index cb578ec555a..4a3f253137c 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_applicationtype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_applicationtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationTypeId{} func TestNewApplicationTypeID(t *testing.T) { - id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") + id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { @@ -32,8 +32,8 @@ func TestNewApplicationTypeID(t *testing.T) { } func TestFormatApplicationTypeID(t *testing.T) { - actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName" + actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_managedcluster.go index 19687d981d5..48953313515 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_managedcluster_test.go index 1907099c2ad..7dcf6147b57 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtype/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/README.md b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/README.md index 6ce94419929..a3347fce948 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/README.md +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") payload := applicationtypeversion.ApplicationTypeVersionResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtypeversion.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") // alternatively `client.ListByApplicationTypes(ctx, id)` can be used to do batched pagination items, err := client.ListByApplicationTypesComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") payload := applicationtypeversion.ApplicationTypeVersionUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_applicationtype.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_applicationtype.go index c60bb09e0c9..b2a342de542 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_applicationtype.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_applicationtype.go @@ -121,7 +121,7 @@ func (id ApplicationTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_applicationtype_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_applicationtype_test.go index 10a15b94d22..90228e8273e 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_applicationtype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_applicationtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationTypeId{} func TestNewApplicationTypeID(t *testing.T) { - id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") + id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { @@ -32,8 +32,8 @@ func TestNewApplicationTypeID(t *testing.T) { } func TestFormatApplicationTypeID(t *testing.T) { - actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName" + actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_version.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_version.go index 839bfe4e456..3e01c03be4d 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_version.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_version.go @@ -127,11 +127,11 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_version_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_version_test.go index 6059b9f92fd..b67cdda59af 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_version_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { t.Fatalf("Expected %q but got %q for Segment 'ApplicationTypeName'", id.ApplicationTypeName, "applicationTypeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go index a69c5a1fcfa..864270262a0 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go @@ -4,6 +4,6 @@ package applicationtypeversion // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationTypeVersionResourceProperties struct { - AppPackageUrl string `json:"appPackageUrl"` + AppPackageURL string `json:"appPackageUrl"` ProvisioningState *string `json:"provisioningState,omitempty"` } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/README.md b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/README.md index b1f14a60b45..a97c8338fec 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/README.md +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") payload := managedcluster.ManagedCluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") payload := managedcluster.ManagedClusterUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/id_managedcluster.go index 7a851f41447..13302c8ae79 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/id_managedcluster_test.go index 9e580f26305..c75c73e02b3 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedcluster/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/README.md b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/README.md index 8cbf2f00818..964df153706 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/README.md +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedclusterversion.NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") +id := managedclusterversion.NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") +id := managedclusterversion.NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") read, err := client.GetByEnvironment(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListByEnvironment(ctx, id) if err != nil { diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_environmentmanagedclusterversion.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_environmentmanagedclusterversion.go index aa7d5bb7265..7794f043b0a 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_environmentmanagedclusterversion.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_environmentmanagedclusterversion.go @@ -113,11 +113,11 @@ func (id EnvironmentManagedClusterVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), resourceids.StaticSegment("environment", "Windows", "Windows"), resourceids.StaticSegment("staticManagedClusterVersions", "managedClusterVersions", "managedClusterVersions"), - resourceids.UserSpecifiedSegment("managedClusterVersionName", "clusterVersion"), + resourceids.UserSpecifiedSegment("managedClusterVersionName", "managedClusterVersionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_environmentmanagedclusterversion_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_environmentmanagedclusterversion_test.go index 96414209833..7042671f9e0 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_environmentmanagedclusterversion_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_environmentmanagedclusterversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &EnvironmentManagedClusterVersionId{} func TestNewEnvironmentManagedClusterVersionID(t *testing.T) { - id := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") + id := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedClusterVersionName != "clusterVersion" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "clusterVersion") + if id.ManagedClusterVersionName != "managedClusterVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "managedClusterVersionName") } } func TestFormatEnvironmentManagedClusterVersionID(t *testing.T) { - actual := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion" + actual := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,36 +73,36 @@ func TestParseEnvironmentManagedClusterVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, } @@ -199,70 +199,70 @@ func TestParseEnvironmentManagedClusterVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedClusterVersionName: "cLuStErVeRsIoN", + LocationName: "lOcAtIoNnAmE", + ManagedClusterVersionName: "mAnAgEdClUsTeRvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_location.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_location.go index e530672af1e..a09259067eb 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_location.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_location_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_location_test.go index e060c89abc7..a358c6856b2 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_location_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_managedclusterversion.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_managedclusterversion.go index ec8d48bab41..0912aa98c26 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_managedclusterversion.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_managedclusterversion.go @@ -113,9 +113,9 @@ func (id ManagedClusterVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticManagedClusterVersions", "managedClusterVersions", "managedClusterVersions"), - resourceids.UserSpecifiedSegment("managedClusterVersionName", "clusterVersion"), + resourceids.UserSpecifiedSegment("managedClusterVersionName", "managedClusterVersionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_managedclusterversion_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_managedclusterversion_test.go index 7d7180e1db0..7747d2f17fb 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_managedclusterversion_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/managedclusterversion/id_managedclusterversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &ManagedClusterVersionId{} func TestNewManagedClusterVersionID(t *testing.T) { - id := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") + id := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedClusterVersionName != "clusterVersion" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "clusterVersion") + if id.ManagedClusterVersionName != "managedClusterVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "managedClusterVersionName") } } func TestFormatManagedClusterVersionID(t *testing.T) { - actual := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion" + actual := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseManagedClusterVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseManagedClusterVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedClusterVersionName: "cLuStErVeRsIoN", + LocationName: "lOcAtIoNnAmE", + ManagedClusterVersionName: "mAnAgEdClUsTeRvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/README.md b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/README.md index fad13d4578d..0c43b2804c2 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/README.md +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeType{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -70,7 +70,7 @@ if err := client.DeleteNodeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := nodetype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := nodetype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.ListByManagedClusters(ctx, id)` can be used to do batched pagination items, err := client.ListByManagedClustersComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -120,7 +120,7 @@ if err := client.ReimageThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -137,7 +137,7 @@ if err := client.RestartThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_managedcluster.go index e7defe95386..70321cbc223 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_managedcluster_test.go index 9c7e7e41642..a589e2613bb 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_nodetype.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_nodetype.go index ec806fd907a..0ff03300f41 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_nodetype.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_nodetype.go @@ -121,7 +121,7 @@ func (id NodeTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticNodeTypes", "nodeTypes", "nodeTypes"), resourceids.UserSpecifiedSegment("nodeTypeName", "nodeTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_nodetype_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_nodetype_test.go index 7ae8684eb14..e9b7ac886c7 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_nodetype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/id_nodetype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NodeTypeId{} func TestNewNodeTypeID(t *testing.T) { - id := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") + id := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNodeTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.NodeTypeName != "nodeTypeName" { @@ -32,8 +32,8 @@ func TestNewNodeTypeID(t *testing.T) { } func TestFormatNodeTypeID(t *testing.T) { - actual := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName" + actual := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNodeTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", NodeTypeName: "nodeTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNodeTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", NodeTypeName: "nodeTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs/nOdEtYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs/nOdEtYpEnAmE", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", NodeTypeName: "nOdEtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs/nOdEtYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs/nOdEtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/model_vaultcertificate.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/model_vaultcertificate.go index eff0354e640..b9a6347a4c2 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/model_vaultcertificate.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/nodetype/model_vaultcertificate.go @@ -5,5 +5,5 @@ package nodetype type VaultCertificate struct { CertificateStore string `json:"certificateStore"` - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/README.md b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/README.md index 294fbe8c48e..865aba3fae3 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/README.md +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") payload := service.ServiceResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := service.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := service.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") // alternatively `client.ListByApplications(ctx, id)` can be used to do batched pagination items, err := client.ListByApplicationsComplete(ctx, id) diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_application.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_application.go index 091640ed76f..e3dc9bba0ce 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_application.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_application_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_application_test.go index 34a1e55e138..66094f4bc28 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_application_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_service.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_service.go index 63a122ebcc3..35c3abb72fc 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_service.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_service.go @@ -127,7 +127,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_service_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_service_test.go index c591fd3466d..c2bc51a5669 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_service_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/service/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/services/README.md b/resource-manager/servicefabricmanagedcluster/2021-05-01/services/README.md index 11367c4df65..d02c2e9c59d 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/services/README.md +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := services.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") payload := services.ServiceUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/services/id_service.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/services/id_service.go index 3db6bf79465..8d13e346a0e 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/services/id_service.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/services/id_service.go @@ -127,7 +127,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/servicefabricmanagedcluster/2021-05-01/services/id_service_test.go b/resource-manager/servicefabricmanagedcluster/2021-05-01/services/id_service_test.go index 297bd152e15..e774c8136f5 100644 --- a/resource-manager/servicefabricmanagedcluster/2021-05-01/services/id_service_test.go +++ b/resource-manager/servicefabricmanagedcluster/2021-05-01/services/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/README.md index 66e97e32c8c..49bd323ed28 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") payload := application.ApplicationResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := application.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") payload := application.ApplicationUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_application.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_application.go index 4cde8b4079e..a3336e0dc84 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_application.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_application_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_application_test.go index c3018a4b4ca..233c5f32b75 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_application_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_managedcluster.go index e533de43637..4c131079c6e 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_managedcluster_test.go index ab28c8d0c01..a8ece58d175 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/application/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/README.md index 686dc017f69..388f0aa96a0 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") payload := applicationtype.ApplicationTypeResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := applicationtype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") payload := applicationtype.ApplicationTypeUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_applicationtype.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_applicationtype.go index 463218b950f..4ebdecd4bd8 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_applicationtype.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_applicationtype.go @@ -121,7 +121,7 @@ func (id ApplicationTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_applicationtype_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_applicationtype_test.go index cb578ec555a..4a3f253137c 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_applicationtype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_applicationtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationTypeId{} func TestNewApplicationTypeID(t *testing.T) { - id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") + id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { @@ -32,8 +32,8 @@ func TestNewApplicationTypeID(t *testing.T) { } func TestFormatApplicationTypeID(t *testing.T) { - actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName" + actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_managedcluster.go index 19687d981d5..48953313515 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_managedcluster_test.go index 1907099c2ad..7dcf6147b57 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtype/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/README.md index c5d82a43e22..4a95d3724f0 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") payload := applicationtypeversion.ApplicationTypeVersionResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtypeversion.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") // alternatively `client.ListByApplicationTypes(ctx, id)` can be used to do batched pagination items, err := client.ListByApplicationTypesComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") payload := applicationtypeversion.ApplicationTypeVersionUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_applicationtype.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_applicationtype.go index c60bb09e0c9..b2a342de542 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_applicationtype.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_applicationtype.go @@ -121,7 +121,7 @@ func (id ApplicationTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_applicationtype_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_applicationtype_test.go index 10a15b94d22..90228e8273e 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_applicationtype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_applicationtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationTypeId{} func TestNewApplicationTypeID(t *testing.T) { - id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") + id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { @@ -32,8 +32,8 @@ func TestNewApplicationTypeID(t *testing.T) { } func TestFormatApplicationTypeID(t *testing.T) { - actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName" + actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_version.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_version.go index 839bfe4e456..3e01c03be4d 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_version.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_version.go @@ -127,11 +127,11 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_version_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_version_test.go index 6059b9f92fd..b67cdda59af 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_version_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { t.Fatalf("Expected %q but got %q for Segment 'ApplicationTypeName'", id.ApplicationTypeName, "applicationTypeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go index a69c5a1fcfa..864270262a0 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go @@ -4,6 +4,6 @@ package applicationtypeversion // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationTypeVersionResourceProperties struct { - AppPackageUrl string `json:"appPackageUrl"` + AppPackageURL string `json:"appPackageUrl"` ProvisioningState *string `json:"provisioningState,omitempty"` } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/README.md index a0fed3c6682..147185af975 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") payload := managedcluster.ManagedCluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") payload := managedcluster.ManagedClusterUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/id_managedcluster.go index 7a851f41447..13302c8ae79 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/id_managedcluster_test.go index 9e580f26305..c75c73e02b3 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedcluster/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/README.md index 6d7783a081c..9fffc16b8db 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedclusterversion.NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") +id := managedclusterversion.NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") +id := managedclusterversion.NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") read, err := client.GetByEnvironment(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListByEnvironment(ctx, id) if err != nil { diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_environmentmanagedclusterversion.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_environmentmanagedclusterversion.go index aa7d5bb7265..7794f043b0a 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_environmentmanagedclusterversion.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_environmentmanagedclusterversion.go @@ -113,11 +113,11 @@ func (id EnvironmentManagedClusterVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), resourceids.StaticSegment("environment", "Windows", "Windows"), resourceids.StaticSegment("staticManagedClusterVersions", "managedClusterVersions", "managedClusterVersions"), - resourceids.UserSpecifiedSegment("managedClusterVersionName", "clusterVersion"), + resourceids.UserSpecifiedSegment("managedClusterVersionName", "managedClusterVersionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_environmentmanagedclusterversion_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_environmentmanagedclusterversion_test.go index 96414209833..7042671f9e0 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_environmentmanagedclusterversion_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_environmentmanagedclusterversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &EnvironmentManagedClusterVersionId{} func TestNewEnvironmentManagedClusterVersionID(t *testing.T) { - id := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") + id := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedClusterVersionName != "clusterVersion" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "clusterVersion") + if id.ManagedClusterVersionName != "managedClusterVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "managedClusterVersionName") } } func TestFormatEnvironmentManagedClusterVersionID(t *testing.T) { - actual := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion" + actual := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,36 +73,36 @@ func TestParseEnvironmentManagedClusterVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, } @@ -199,70 +199,70 @@ func TestParseEnvironmentManagedClusterVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedClusterVersionName: "cLuStErVeRsIoN", + LocationName: "lOcAtIoNnAmE", + ManagedClusterVersionName: "mAnAgEdClUsTeRvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_location.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_location.go index e530672af1e..a09259067eb 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_location.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_location_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_location_test.go index e060c89abc7..a358c6856b2 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_location_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_managedclusterversion.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_managedclusterversion.go index ec8d48bab41..0912aa98c26 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_managedclusterversion.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_managedclusterversion.go @@ -113,9 +113,9 @@ func (id ManagedClusterVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticManagedClusterVersions", "managedClusterVersions", "managedClusterVersions"), - resourceids.UserSpecifiedSegment("managedClusterVersionName", "clusterVersion"), + resourceids.UserSpecifiedSegment("managedClusterVersionName", "managedClusterVersionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_managedclusterversion_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_managedclusterversion_test.go index 7d7180e1db0..7747d2f17fb 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_managedclusterversion_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedclusterversion/id_managedclusterversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &ManagedClusterVersionId{} func TestNewManagedClusterVersionID(t *testing.T) { - id := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") + id := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedClusterVersionName != "clusterVersion" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "clusterVersion") + if id.ManagedClusterVersionName != "managedClusterVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "managedClusterVersionName") } } func TestFormatManagedClusterVersionID(t *testing.T) { - actual := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion" + actual := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseManagedClusterVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseManagedClusterVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedClusterVersionName: "cLuStErVeRsIoN", + LocationName: "lOcAtIoNnAmE", + ManagedClusterVersionName: "mAnAgEdClUsTeRvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/README.md index 03a554298c5..c7629cd8818 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedvmsizes.NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "location", "vmSize") +id := managedvmsizes.NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "locationName", "managedUnsupportedVMSizeName") read, err := client.ManagedUnsupportedVMSizesGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedvmsizes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedvmsizes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ManagedUnsupportedVMSizesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedUnsupportedVMSizesListComplete(ctx, id) diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_location.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_location.go index 3c305a93c23..f6128edf23a 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_location.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_location_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_location_test.go index f41a2d51d35..c618a9d5711 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_location_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_managedunsupportedvmsize.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_managedunsupportedvmsize.go index 6a71dfa208c..d388ab916e1 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_managedunsupportedvmsize.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_managedunsupportedvmsize.go @@ -113,9 +113,9 @@ func (id ManagedUnsupportedVMSizeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticManagedUnsupportedVMSizes", "managedUnsupportedVMSizes", "managedUnsupportedVMSizes"), - resourceids.UserSpecifiedSegment("managedUnsupportedVMSizeName", "vmSize"), + resourceids.UserSpecifiedSegment("managedUnsupportedVMSizeName", "managedUnsupportedVMSizeName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_managedunsupportedvmsize_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_managedunsupportedvmsize_test.go index 93efbae1e69..49b140662c1 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_managedunsupportedvmsize_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/managedvmsizes/id_managedunsupportedvmsize_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &ManagedUnsupportedVMSizeId{} func TestNewManagedUnsupportedVMSizeID(t *testing.T) { - id := NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "location", "vmSize") + id := NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "locationName", "managedUnsupportedVMSizeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedUnsupportedVMSizeName != "vmSize" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedUnsupportedVMSizeName'", id.ManagedUnsupportedVMSizeName, "vmSize") + if id.ManagedUnsupportedVMSizeName != "managedUnsupportedVMSizeName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedUnsupportedVMSizeName'", id.ManagedUnsupportedVMSizeName, "managedUnsupportedVMSizeName") } } func TestFormatManagedUnsupportedVMSizeID(t *testing.T) { - actual := NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "location", "vmSize").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize" + actual := NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "locationName", "managedUnsupportedVMSizeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseManagedUnsupportedVMSizeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName", Expected: &ManagedUnsupportedVMSizeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedUnsupportedVMSizeName: "vmSize", + LocationName: "locationName", + ManagedUnsupportedVMSizeName: "managedUnsupportedVMSizeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseManagedUnsupportedVMSizeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdUnSuPpOrTeDvMsIzEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdUnSuPpOrTeDvMsIzEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName", Expected: &ManagedUnsupportedVMSizeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedUnsupportedVMSizeName: "vmSize", + LocationName: "locationName", + ManagedUnsupportedVMSizeName: "managedUnsupportedVMSizeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdUnSuPpOrTeDvMsIzEs/vMsIzE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdUnSuPpOrTeDvMsIzEs/mAnAgEdUnSuPpOrTeDvMsIzEnAmE", Expected: &ManagedUnsupportedVMSizeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedUnsupportedVMSizeName: "vMsIzE", + LocationName: "lOcAtIoNnAmE", + ManagedUnsupportedVMSizeName: "mAnAgEdUnSuPpOrTeDvMsIzEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdUnSuPpOrTeDvMsIzEs/vMsIzE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdUnSuPpOrTeDvMsIzEs/mAnAgEdUnSuPpOrTeDvMsIzEnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/README.md index 23766714377..24391fed661 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeType{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -70,7 +70,7 @@ if err := client.DeleteNodeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := nodetype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := nodetype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.ListByManagedClusters(ctx, id)` can be used to do batched pagination items, err := client.ListByManagedClustersComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -120,7 +120,7 @@ if err := client.ReimageThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -137,7 +137,7 @@ if err := client.RestartThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") // alternatively `client.SkusList(ctx, id)` can be used to do batched pagination items, err := client.SkusListComplete(ctx, id) @@ -154,7 +154,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_managedcluster.go index e7defe95386..70321cbc223 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_managedcluster_test.go index 9c7e7e41642..a589e2613bb 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_nodetype.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_nodetype.go index ec806fd907a..0ff03300f41 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_nodetype.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_nodetype.go @@ -121,7 +121,7 @@ func (id NodeTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticNodeTypes", "nodeTypes", "nodeTypes"), resourceids.UserSpecifiedSegment("nodeTypeName", "nodeTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_nodetype_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_nodetype_test.go index 7ae8684eb14..e9b7ac886c7 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_nodetype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/id_nodetype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NodeTypeId{} func TestNewNodeTypeID(t *testing.T) { - id := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") + id := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNodeTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.NodeTypeName != "nodeTypeName" { @@ -32,8 +32,8 @@ func TestNewNodeTypeID(t *testing.T) { } func TestFormatNodeTypeID(t *testing.T) { - actual := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName" + actual := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNodeTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", NodeTypeName: "nodeTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNodeTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", NodeTypeName: "nodeTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs/nOdEtYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs/nOdEtYpEnAmE", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", NodeTypeName: "nOdEtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs/nOdEtYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs/nOdEtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/model_vaultcertificate.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/model_vaultcertificate.go index eff0354e640..b9a6347a4c2 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/model_vaultcertificate.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/nodetype/model_vaultcertificate.go @@ -5,5 +5,5 @@ package nodetype type VaultCertificate struct { CertificateStore string `json:"certificateStore"` - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/README.md index dd86c7f9f7e..26d34155ad5 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") payload := service.ServiceResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := service.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := service.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") // alternatively `client.ListByApplications(ctx, id)` can be used to do batched pagination items, err := client.ListByApplicationsComplete(ctx, id) diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_application.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_application.go index 091640ed76f..e3dc9bba0ce 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_application.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_application_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_application_test.go index 34a1e55e138..66094f4bc28 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_application_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_service.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_service.go index 63a122ebcc3..35c3abb72fc 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_service.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_service.go @@ -127,7 +127,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_service_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_service_test.go index c591fd3466d..c2bc51a5669 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_service_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/service/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/services/README.md b/resource-manager/servicefabricmanagedcluster/2022-01-01/services/README.md index c5be30b93fc..019fab3a8e1 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/services/README.md +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := services.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") payload := services.ServiceUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/services/id_service.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/services/id_service.go index 3db6bf79465..8d13e346a0e 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/services/id_service.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/services/id_service.go @@ -127,7 +127,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/servicefabricmanagedcluster/2022-01-01/services/id_service_test.go b/resource-manager/servicefabricmanagedcluster/2022-01-01/services/id_service_test.go index 297bd152e15..e774c8136f5 100644 --- a/resource-manager/servicefabricmanagedcluster/2022-01-01/services/id_service_test.go +++ b/resource-manager/servicefabricmanagedcluster/2022-01-01/services/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/README.md index 643ebc22c1d..bd323ea5ff7 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") payload := application.ApplicationResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := application.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := application.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if err := client.ReadUpgradeThenPoll(ctx, id); err != nil { // handle the error @@ -98,7 +98,7 @@ if err := client.ReadUpgradeThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") payload := application.RuntimeResumeApplicationUpgradeParameters{ // ... @@ -115,7 +115,7 @@ if err := client.ResumeUpgradeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if err := client.StartRollbackThenPoll(ctx, id); err != nil { // handle the error @@ -127,7 +127,7 @@ if err := client.StartRollbackThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := application.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") payload := application.ApplicationUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_application.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_application.go index 4cde8b4079e..a3336e0dc84 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_application.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_application_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_application_test.go index c3018a4b4ca..233c5f32b75 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_application_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_managedcluster.go index e533de43637..4c131079c6e 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_managedcluster_test.go index ab28c8d0c01..a8ece58d175 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/application/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/README.md index 9bde34293ca..154e9d8d192 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") payload := applicationtype.ApplicationTypeResource{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -57,7 +57,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := applicationtype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtype.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") payload := applicationtype.ApplicationTypeUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_applicationtype.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_applicationtype.go index 463218b950f..4ebdecd4bd8 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_applicationtype.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_applicationtype.go @@ -121,7 +121,7 @@ func (id ApplicationTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_applicationtype_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_applicationtype_test.go index cb578ec555a..4a3f253137c 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_applicationtype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_applicationtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationTypeId{} func TestNewApplicationTypeID(t *testing.T) { - id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") + id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { @@ -32,8 +32,8 @@ func TestNewApplicationTypeID(t *testing.T) { } func TestFormatApplicationTypeID(t *testing.T) { - actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName" + actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_managedcluster.go index 19687d981d5..48953313515 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_managedcluster_test.go index 1907099c2ad..7dcf6147b57 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtype/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/README.md index 055e6aa202f..ad627da935e 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") payload := applicationtypeversion.ApplicationTypeVersionResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := applicationtypeversion.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") +id := applicationtypeversion.NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") // alternatively `client.ListByApplicationTypes(ctx, id)` can be used to do batched pagination items, err := client.ListByApplicationTypesComplete(ctx, id) @@ -86,7 +86,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") +id := applicationtypeversion.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") payload := applicationtypeversion.ApplicationTypeVersionUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_applicationtype.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_applicationtype.go index c60bb09e0c9..b2a342de542 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_applicationtype.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_applicationtype.go @@ -121,7 +121,7 @@ func (id ApplicationTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_applicationtype_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_applicationtype_test.go index 10a15b94d22..90228e8273e 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_applicationtype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_applicationtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationTypeId{} func TestNewApplicationTypeID(t *testing.T) { - id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName") + id := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { @@ -32,8 +32,8 @@ func TestNewApplicationTypeID(t *testing.T) { } func TestFormatApplicationTypeID(t *testing.T) { - actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName" + actual := NewApplicationTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Expected: &ApplicationTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_version.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_version.go index 839bfe4e456..3e01c03be4d 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_version.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_version.go @@ -127,11 +127,11 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplicationTypes", "applicationTypes", "applicationTypes"), resourceids.UserSpecifiedSegment("applicationTypeName", "applicationTypeName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "version"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_version_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_version_test.go index 6059b9f92fd..b67cdda59af 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_version_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationTypeName != "applicationTypeName" { t.Fatalf("Expected %q but got %q for Segment 'ApplicationTypeName'", id.ApplicationTypeName, "applicationTypeName") } - if id.VersionName != "version" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "version") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationTypeName", "version").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationTypeName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationTypeName: "applicationTypeName", - VersionName: "version", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applicationTypes/applicationTypeName/versions/version/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applicationTypes/applicationTypeName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOn", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationTypeName: "aPpLiCaTiOnTyPeNaMe", - VersionName: "vErSiOn", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOn/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnTyPeS/aPpLiCaTiOnTyPeNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go index a69c5a1fcfa..864270262a0 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/applicationtypeversion/model_applicationtypeversionresourceproperties.go @@ -4,6 +4,6 @@ package applicationtypeversion // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApplicationTypeVersionResourceProperties struct { - AppPackageUrl string `json:"appPackageUrl"` + AppPackageURL string `json:"appPackageUrl"` ProvisioningState *string `json:"provisioningState,omitempty"` } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedapplymaintenancewindow/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedapplymaintenancewindow/id_managedcluster.go index 3d23c753a4d..10777b06473 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedapplymaintenancewindow/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedapplymaintenancewindow/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedapplymaintenancewindow/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedapplymaintenancewindow/id_managedcluster_test.go index fb17336d76d..6446df11fa2 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedapplymaintenancewindow/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedapplymaintenancewindow/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/README.md index 554c1bf7872..d8a58d1c982 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedazresiliencystatus.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedazresiliencystatus.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/id_managedcluster.go index 2843115d840..83a304c59c9 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/id_managedcluster_test.go index aab75c24215..ded8bcb3587 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedazresiliencystatus/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/README.md index 2988ccdcd54..67955e9b9c7 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") payload := managedcluster.ManagedCluster{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedcluster.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") payload := managedcluster.ManagedClusterUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/id_managedcluster.go index 7a851f41447..13302c8ae79 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/id_managedcluster_test.go index 9e580f26305..c75c73e02b3 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedcluster/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/README.md index 22738cd1014..8e361f1c5fc 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedclusterversion.NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") +id := managedclusterversion.NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") +id := managedclusterversion.NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") read, err := client.GetByEnvironment(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedclusterversion.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListByEnvironment(ctx, id) if err != nil { diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_environmentmanagedclusterversion.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_environmentmanagedclusterversion.go index aa7d5bb7265..7794f043b0a 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_environmentmanagedclusterversion.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_environmentmanagedclusterversion.go @@ -113,11 +113,11 @@ func (id EnvironmentManagedClusterVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticEnvironments", "environments", "environments"), resourceids.StaticSegment("environment", "Windows", "Windows"), resourceids.StaticSegment("staticManagedClusterVersions", "managedClusterVersions", "managedClusterVersions"), - resourceids.UserSpecifiedSegment("managedClusterVersionName", "clusterVersion"), + resourceids.UserSpecifiedSegment("managedClusterVersionName", "managedClusterVersionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_environmentmanagedclusterversion_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_environmentmanagedclusterversion_test.go index 96414209833..7042671f9e0 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_environmentmanagedclusterversion_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_environmentmanagedclusterversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &EnvironmentManagedClusterVersionId{} func TestNewEnvironmentManagedClusterVersionID(t *testing.T) { - id := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") + id := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedClusterVersionName != "clusterVersion" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "clusterVersion") + if id.ManagedClusterVersionName != "managedClusterVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "managedClusterVersionName") } } func TestFormatEnvironmentManagedClusterVersionID(t *testing.T) { - actual := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion" + actual := NewEnvironmentManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,36 +73,36 @@ func TestParseEnvironmentManagedClusterVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, } @@ -199,70 +199,70 @@ func TestParseEnvironmentManagedClusterVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/environments/Windows/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/environments/Windows/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe", Expected: &EnvironmentManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedClusterVersionName: "cLuStErVeRsIoN", + LocationName: "lOcAtIoNnAmE", + ManagedClusterVersionName: "mAnAgEdClUsTeRvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/eNvIrOnMeNtS/wInDoWs/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_location.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_location.go index e530672af1e..a09259067eb 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_location.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_location_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_location_test.go index e060c89abc7..a358c6856b2 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_location_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_managedclusterversion.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_managedclusterversion.go index ec8d48bab41..0912aa98c26 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_managedclusterversion.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_managedclusterversion.go @@ -113,9 +113,9 @@ func (id ManagedClusterVersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticManagedClusterVersions", "managedClusterVersions", "managedClusterVersions"), - resourceids.UserSpecifiedSegment("managedClusterVersionName", "clusterVersion"), + resourceids.UserSpecifiedSegment("managedClusterVersionName", "managedClusterVersionName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_managedclusterversion_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_managedclusterversion_test.go index 7d7180e1db0..7747d2f17fb 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_managedclusterversion_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedclusterversion/id_managedclusterversion_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &ManagedClusterVersionId{} func TestNewManagedClusterVersionID(t *testing.T) { - id := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion") + id := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedClusterVersionName != "clusterVersion" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "clusterVersion") + if id.ManagedClusterVersionName != "managedClusterVersionName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterVersionName'", id.ManagedClusterVersionName, "managedClusterVersionName") } } func TestFormatManagedClusterVersionID(t *testing.T) { - actual := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "location", "clusterVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion" + actual := NewManagedClusterVersionID("12345678-1234-9876-4563-123456789012", "locationName", "managedClusterVersionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseManagedClusterVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseManagedClusterVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedClusterVersionName: "clusterVersion", + LocationName: "locationName", + ManagedClusterVersionName: "managedClusterVersionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedClusterVersions/clusterVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedClusterVersions/managedClusterVersionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe", Expected: &ManagedClusterVersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedClusterVersionName: "cLuStErVeRsIoN", + LocationName: "lOcAtIoNnAmE", + ManagedClusterVersionName: "mAnAgEdClUsTeRvErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdClUsTeRvErSiOnS/cLuStErVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdClUsTeRvErSiOnS/mAnAgEdClUsTeRvErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/README.md index 50b0dd7ad4a..a79156a97d4 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedmaintenancewindowstatus.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := managedmaintenancewindowstatus.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/id_managedcluster.go index 93b0e165446..e5112e4c421 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/id_managedcluster_test.go index ead434dcad8..829ef1b87ce 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedmaintenancewindowstatus/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/README.md index 30fe37af7c3..104ac7734d0 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedvmsizes.NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "location", "vmSize") +id := managedvmsizes.NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "locationName", "managedUnsupportedVMSizeName") read, err := client.ManagedUnsupportedVMSizesGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedvmsizes.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedvmsizes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ManagedUnsupportedVMSizesList(ctx, id)` can be used to do batched pagination items, err := client.ManagedUnsupportedVMSizesListComplete(ctx, id) diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_location.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_location.go index 3c305a93c23..f6128edf23a 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_location.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_location_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_location_test.go index f41a2d51d35..c618a9d5711 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_location_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_managedunsupportedvmsize.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_managedunsupportedvmsize.go index 6a71dfa208c..d388ab916e1 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_managedunsupportedvmsize.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_managedunsupportedvmsize.go @@ -113,9 +113,9 @@ func (id ManagedUnsupportedVMSizeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticManagedUnsupportedVMSizes", "managedUnsupportedVMSizes", "managedUnsupportedVMSizes"), - resourceids.UserSpecifiedSegment("managedUnsupportedVMSizeName", "vmSize"), + resourceids.UserSpecifiedSegment("managedUnsupportedVMSizeName", "managedUnsupportedVMSizeName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_managedunsupportedvmsize_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_managedunsupportedvmsize_test.go index 93efbae1e69..49b140662c1 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_managedunsupportedvmsize_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/managedvmsizes/id_managedunsupportedvmsize_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &ManagedUnsupportedVMSizeId{} func TestNewManagedUnsupportedVMSizeID(t *testing.T) { - id := NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "location", "vmSize") + id := NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "locationName", "managedUnsupportedVMSizeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedUnsupportedVMSizeName != "vmSize" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedUnsupportedVMSizeName'", id.ManagedUnsupportedVMSizeName, "vmSize") + if id.ManagedUnsupportedVMSizeName != "managedUnsupportedVMSizeName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedUnsupportedVMSizeName'", id.ManagedUnsupportedVMSizeName, "managedUnsupportedVMSizeName") } } func TestFormatManagedUnsupportedVMSizeID(t *testing.T) { - actual := NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "location", "vmSize").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize" + actual := NewManagedUnsupportedVMSizeID("12345678-1234-9876-4563-123456789012", "locationName", "managedUnsupportedVMSizeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseManagedUnsupportedVMSizeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName", Expected: &ManagedUnsupportedVMSizeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedUnsupportedVMSizeName: "vmSize", + LocationName: "locationName", + ManagedUnsupportedVMSizeName: "managedUnsupportedVMSizeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseManagedUnsupportedVMSizeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdUnSuPpOrTeDvMsIzEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdUnSuPpOrTeDvMsIzEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName", Expected: &ManagedUnsupportedVMSizeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedUnsupportedVMSizeName: "vmSize", + LocationName: "locationName", + ManagedUnsupportedVMSizeName: "managedUnsupportedVMSizeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/location/managedUnsupportedVMSizes/vmSize/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ServiceFabric/locations/locationName/managedUnsupportedVMSizes/managedUnsupportedVMSizeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdUnSuPpOrTeDvMsIzEs/vMsIzE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdUnSuPpOrTeDvMsIzEs/mAnAgEdUnSuPpOrTeDvMsIzEnAmE", Expected: &ManagedUnsupportedVMSizeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedUnsupportedVMSizeName: "vMsIzE", + LocationName: "lOcAtIoNnAmE", + ManagedUnsupportedVMSizeName: "mAnAgEdUnSuPpOrTeDvMsIzEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoN/mAnAgEdUnSuPpOrTeDvMsIzEs/vMsIzE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdUnSuPpOrTeDvMsIzEs/mAnAgEdUnSuPpOrTeDvMsIzEnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/README.md index 28504111bec..453ab9ae3cd 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeType{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -70,7 +70,7 @@ if err := client.DeleteNodeThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") read, err := client.Get(ctx, id) if err != nil { @@ -86,7 +86,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := nodetype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") +id := nodetype.NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") // alternatively `client.ListByManagedClusters(ctx, id)` can be used to do batched pagination items, err := client.ListByManagedClustersComplete(ctx, id) @@ -103,7 +103,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -120,7 +120,7 @@ if err := client.ReimageThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeActionParameters{ // ... @@ -137,7 +137,7 @@ if err := client.RestartThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") // alternatively `client.SkusList(ctx, id)` can be used to do batched pagination items, err := client.SkusListComplete(ctx, id) @@ -154,7 +154,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") +id := nodetype.NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") payload := nodetype.NodeTypeUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_managedcluster.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_managedcluster.go index e7defe95386..70321cbc223 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_managedcluster.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_managedcluster.go @@ -115,7 +115,7 @@ func (id ManagedClusterId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), } } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_managedcluster_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_managedcluster_test.go index 9c7e7e41642..a589e2613bb 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_managedcluster_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_managedcluster_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedClusterId{} func TestNewManagedClusterID(t *testing.T) { - id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName") + id := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewManagedClusterID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } } func TestFormatManagedClusterID(t *testing.T) { - actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName" + actual := NewManagedClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseManagedClusterID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseManagedClusterIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Expected: &ManagedClusterId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_nodetype.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_nodetype.go index ec806fd907a..0ff03300f41 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_nodetype.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_nodetype.go @@ -121,7 +121,7 @@ func (id NodeTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticNodeTypes", "nodeTypes", "nodeTypes"), resourceids.UserSpecifiedSegment("nodeTypeName", "nodeTypeName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_nodetype_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_nodetype_test.go index 7ae8684eb14..e9b7ac886c7 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_nodetype_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/id_nodetype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NodeTypeId{} func TestNewNodeTypeID(t *testing.T) { - id := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName") + id := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNodeTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.NodeTypeName != "nodeTypeName" { @@ -32,8 +32,8 @@ func TestNewNodeTypeID(t *testing.T) { } func TestFormatNodeTypeID(t *testing.T) { - actual := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "nodeTypeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName" + actual := NewNodeTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "nodeTypeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNodeTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", NodeTypeName: "nodeTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNodeTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", NodeTypeName: "nodeTypeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/nodeTypes/nodeTypeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/nodeTypes/nodeTypeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs/nOdEtYpEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs/nOdEtYpEnAmE", Expected: &NodeTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", NodeTypeName: "nOdEtYpEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/nOdEtYpEs/nOdEtYpEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/nOdEtYpEs/nOdEtYpEnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/model_vaultcertificate.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/model_vaultcertificate.go index eff0354e640..b9a6347a4c2 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/model_vaultcertificate.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/nodetype/model_vaultcertificate.go @@ -5,5 +5,5 @@ package nodetype type VaultCertificate struct { CertificateStore string `json:"certificateStore"` - CertificateUrl string `json:"certificateUrl"` + CertificateURL string `json:"certificateUrl"` } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/README.md index 48b235b2707..20c93aa5550 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") payload := service.ServiceResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") read, err := client.Get(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := service.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") +id := service.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") // alternatively `client.ListByApplications(ctx, id)` can be used to do batched pagination items, err := client.ListByApplicationsComplete(ctx, id) diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_application.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_application.go index 091640ed76f..e3dc9bba0ce 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_application.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_application.go @@ -121,7 +121,7 @@ func (id ApplicationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_application_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_application_test.go index 34a1e55e138..66094f4bc28 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_application_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_application_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ApplicationId{} func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName") + id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewApplicationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -32,8 +32,8 @@ func TestNewApplicationID(t *testing.T) { } func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName" + actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseApplicationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseApplicationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Expected: &ApplicationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_service.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_service.go index 63a122ebcc3..35c3abb72fc 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_service.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_service.go @@ -127,7 +127,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_service_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_service_test.go index c591fd3466d..c2bc51a5669 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_service_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/service/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/services/README.md b/resource-manager/servicefabricmanagedcluster/2024-04-01/services/README.md index b6a88b9bd02..5cc59a55c64 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/services/README.md +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/services/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := services.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") +id := services.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") payload := services.ServiceUpdateParameters{ // ... diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/services/id_service.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/services/id_service.go index 3db6bf79465..8d13e346a0e 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/services/id_service.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/services/id_service.go @@ -127,7 +127,7 @@ func (id ServiceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceFabric", "Microsoft.ServiceFabric", "Microsoft.ServiceFabric"), resourceids.StaticSegment("staticManagedClusters", "managedClusters", "managedClusters"), - resourceids.UserSpecifiedSegment("managedClusterName", "clusterName"), + resourceids.UserSpecifiedSegment("managedClusterName", "managedClusterName"), resourceids.StaticSegment("staticApplications", "applications", "applications"), resourceids.UserSpecifiedSegment("applicationName", "applicationName"), resourceids.StaticSegment("staticServices", "services", "services"), diff --git a/resource-manager/servicefabricmanagedcluster/2024-04-01/services/id_service_test.go b/resource-manager/servicefabricmanagedcluster/2024-04-01/services/id_service_test.go index 297bd152e15..e774c8136f5 100644 --- a/resource-manager/servicefabricmanagedcluster/2024-04-01/services/id_service_test.go +++ b/resource-manager/servicefabricmanagedcluster/2024-04-01/services/id_service_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServiceId{} func TestNewServiceID(t *testing.T) { - id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName") + id := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewServiceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ManagedClusterName != "clusterName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "clusterName") + if id.ManagedClusterName != "managedClusterName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterName") } if id.ApplicationName != "applicationName" { @@ -36,8 +36,8 @@ func TestNewServiceID(t *testing.T) { } func TestFormatServiceID(t *testing.T) { - actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterName", "applicationName", "serviceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName" + actual := NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterName", "applicationName", "serviceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseServiceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseServiceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ManagedClusterName: "clusterName", + ManagedClusterName: "managedClusterName", ApplicationName: "applicationName", ServiceName: "serviceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/clusterName/applications/applicationName/services/serviceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceFabric/managedClusters/managedClusterName/applications/applicationName/services/serviceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe", Expected: &ServiceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "cLuStErNaMe", + ManagedClusterName: "mAnAgEdClUsTeRnAmE", ApplicationName: "aPpLiCaTiOnNaMe", ServiceName: "sErViCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/cLuStErNaMe/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeFaBrIc/mAnAgEdClUsTeRs/mAnAgEdClUsTeRnAmE/aPpLiCaTiOnS/aPpLiCaTiOnNaMe/sErViCeS/sErViCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicelinker/2022-05-01/client.go b/resource-manager/servicelinker/2022-05-01/client.go index a7320bd2cf9..63f47762de2 100644 --- a/resource-manager/servicelinker/2022-05-01/client.go +++ b/resource-manager/servicelinker/2022-05-01/client.go @@ -14,7 +14,7 @@ import ( type Client struct { Links *links.LinksClient - ServiceLinker *servicelinker.ServiceLinkerClient + Servicelinker *servicelinker.ServicelinkerClient } func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { @@ -24,14 +24,14 @@ func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanag } configureFunc(linksClient.Client) - serviceLinkerClient, err := servicelinker.NewServiceLinkerClientWithBaseURI(sdkApi) + servicelinkerClient, err := servicelinker.NewServicelinkerClientWithBaseURI(sdkApi) if err != nil { - return nil, fmt.Errorf("building ServiceLinker client: %+v", err) + return nil, fmt.Errorf("building Servicelinker client: %+v", err) } - configureFunc(serviceLinkerClient.Client) + configureFunc(servicelinkerClient.Client) return &Client{ Links: linksClient, - ServiceLinker: serviceLinkerClient, + Servicelinker: servicelinkerClient, }, nil } diff --git a/resource-manager/servicelinker/2022-05-01/servicelinker/README.md b/resource-manager/servicelinker/2022-05-01/servicelinker/README.md index a098a5fdd80..95942cf77da 100644 --- a/resource-manager/servicelinker/2022-05-01/servicelinker/README.md +++ b/resource-manager/servicelinker/2022-05-01/servicelinker/README.md @@ -16,12 +16,12 @@ import "github.com/hashicorp/go-azure-sdk/resource-manager/servicelinker/2022-05 ### Client Initialization ```go -client := servicelinker.NewServiceLinkerClientWithBaseURI("https://management.azure.com") +client := servicelinker.NewServicelinkerClientWithBaseURI("https://management.azure.com") client.Client.Authorizer = authorizer ``` -### Example Usage: `ServiceLinkerClient.LinkerCreateOrUpdate` +### Example Usage: `ServicelinkerClient.LinkerCreateOrUpdate` ```go ctx := context.TODO() @@ -38,7 +38,7 @@ if err := client.LinkerCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ``` -### Example Usage: `ServiceLinkerClient.LinkerGet` +### Example Usage: `ServicelinkerClient.LinkerGet` ```go ctx := context.TODO() @@ -54,7 +54,7 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ServiceLinkerClient.LinkerList` +### Example Usage: `ServicelinkerClient.LinkerList` ```go ctx := context.TODO() diff --git a/resource-manager/servicelinker/2022-05-01/servicelinker/client.go b/resource-manager/servicelinker/2022-05-01/servicelinker/client.go index bce1af86af4..4cad7709018 100644 --- a/resource-manager/servicelinker/2022-05-01/servicelinker/client.go +++ b/resource-manager/servicelinker/2022-05-01/servicelinker/client.go @@ -10,17 +10,17 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ServiceLinkerClient struct { +type ServicelinkerClient struct { Client *resourcemanager.Client } -func NewServiceLinkerClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceLinkerClient, error) { +func NewServicelinkerClientWithBaseURI(sdkApi sdkEnv.Api) (*ServicelinkerClient, error) { client, err := resourcemanager.NewClient(sdkApi, "servicelinker", defaultApiVersion) if err != nil { - return nil, fmt.Errorf("instantiating ServiceLinkerClient: %+v", err) + return nil, fmt.Errorf("instantiating ServicelinkerClient: %+v", err) } - return &ServiceLinkerClient{ + return &ServicelinkerClient{ Client: client, }, nil } diff --git a/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkercreateorupdate.go b/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkercreateorupdate.go index f1fad0ffad5..21566f496d2 100644 --- a/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkercreateorupdate.go +++ b/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkercreateorupdate.go @@ -22,7 +22,7 @@ type LinkerCreateOrUpdateOperationResponse struct { } // LinkerCreateOrUpdate ... -func (c ServiceLinkerClient) LinkerCreateOrUpdate(ctx context.Context, id ScopedLinkerId, input LinkerResource) (result LinkerCreateOrUpdateOperationResponse, err error) { +func (c ServicelinkerClient) LinkerCreateOrUpdate(ctx context.Context, id ScopedLinkerId, input LinkerResource) (result LinkerCreateOrUpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -61,7 +61,7 @@ func (c ServiceLinkerClient) LinkerCreateOrUpdate(ctx context.Context, id Scoped } // LinkerCreateOrUpdateThenPoll performs LinkerCreateOrUpdate then polls until it's completed -func (c ServiceLinkerClient) LinkerCreateOrUpdateThenPoll(ctx context.Context, id ScopedLinkerId, input LinkerResource) error { +func (c ServicelinkerClient) LinkerCreateOrUpdateThenPoll(ctx context.Context, id ScopedLinkerId, input LinkerResource) error { result, err := c.LinkerCreateOrUpdate(ctx, id, input) if err != nil { return fmt.Errorf("performing LinkerCreateOrUpdate: %+v", err) diff --git a/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkerget.go b/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkerget.go index 61f8cc1a830..0d78b25b361 100644 --- a/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkerget.go +++ b/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkerget.go @@ -18,7 +18,7 @@ type LinkerGetOperationResponse struct { } // LinkerGet ... -func (c ServiceLinkerClient) LinkerGet(ctx context.Context, id ScopedLinkerId) (result LinkerGetOperationResponse, err error) { +func (c ServicelinkerClient) LinkerGet(ctx context.Context, id ScopedLinkerId) (result LinkerGetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkerlist.go b/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkerlist.go index 83c2cfcd374..655f12945bb 100644 --- a/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkerlist.go +++ b/resource-manager/servicelinker/2022-05-01/servicelinker/method_linkerlist.go @@ -37,7 +37,7 @@ func (p *LinkerListCustomPager) NextPageLink() *odata.Link { } // LinkerList ... -func (c ServiceLinkerClient) LinkerList(ctx context.Context, id commonids.ScopeId) (result LinkerListOperationResponse, err error) { +func (c ServicelinkerClient) LinkerList(ctx context.Context, id commonids.ScopeId) (result LinkerListOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -76,12 +76,12 @@ func (c ServiceLinkerClient) LinkerList(ctx context.Context, id commonids.ScopeI } // LinkerListComplete retrieves all the results into a single object -func (c ServiceLinkerClient) LinkerListComplete(ctx context.Context, id commonids.ScopeId) (LinkerListCompleteResult, error) { +func (c ServicelinkerClient) LinkerListComplete(ctx context.Context, id commonids.ScopeId) (LinkerListCompleteResult, error) { return c.LinkerListCompleteMatchingPredicate(ctx, id, LinkerResourceOperationPredicate{}) } // LinkerListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceLinkerClient) LinkerListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate LinkerResourceOperationPredicate) (result LinkerListCompleteResult, err error) { +func (c ServicelinkerClient) LinkerListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate LinkerResourceOperationPredicate) (result LinkerListCompleteResult, err error) { items := make([]LinkerResource, 0) resp, err := c.LinkerList(ctx, id) diff --git a/resource-manager/servicelinker/2024-04-01/client.go b/resource-manager/servicelinker/2024-04-01/client.go index 73ffdaa0f38..ed1df2e1006 100644 --- a/resource-manager/servicelinker/2024-04-01/client.go +++ b/resource-manager/servicelinker/2024-04-01/client.go @@ -18,7 +18,7 @@ type Client struct { ConfigurationNames *configurationnames.ConfigurationNamesClient Connector *connector.ConnectorClient Linkers *linkers.LinkersClient - ServiceLinker *servicelinker.ServiceLinkerClient + Servicelinker *servicelinker.ServicelinkerClient } func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { @@ -40,16 +40,16 @@ func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanag } configureFunc(linkersClient.Client) - serviceLinkerClient, err := servicelinker.NewServiceLinkerClientWithBaseURI(sdkApi) + servicelinkerClient, err := servicelinker.NewServicelinkerClientWithBaseURI(sdkApi) if err != nil { - return nil, fmt.Errorf("building ServiceLinker client: %+v", err) + return nil, fmt.Errorf("building Servicelinker client: %+v", err) } - configureFunc(serviceLinkerClient.Client) + configureFunc(servicelinkerClient.Client) return &Client{ ConfigurationNames: configurationNamesClient, Connector: connectorClient, Linkers: linkersClient, - ServiceLinker: serviceLinkerClient, + Servicelinker: servicelinkerClient, }, nil } diff --git a/resource-manager/servicelinker/2024-04-01/connector/README.md b/resource-manager/servicelinker/2024-04-01/connector/README.md index 2f5a4e57452..b93426f3c94 100644 --- a/resource-manager/servicelinker/2024-04-01/connector/README.md +++ b/resource-manager/servicelinker/2024-04-01/connector/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := connector.NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "dryrunName") +id := connector.NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "dryrunName") payload := connector.DryrunResource{ // ... @@ -41,7 +41,7 @@ if err := client.CreateDryrunThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := connector.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName") +id := connector.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := connector.NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "dryrunName") +id := connector.NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "dryrunName") read, err := client.DeleteDryrun(ctx, id) if err != nil { @@ -69,7 +69,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connector.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName") +id := connector.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName") payload := connector.ConfigurationInfo{ // ... @@ -90,7 +90,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connector.NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "dryrunName") +id := connector.NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "dryrunName") read, err := client.GetDryrun(ctx, id) if err != nil { @@ -106,7 +106,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connector.NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := connector.NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ListDryrun(ctx, id)` can be used to do batched pagination items, err := client.ListDryrunComplete(ctx, id) @@ -123,7 +123,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := connector.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName") +id := connector.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName") payload := connector.LinkerPatch{ // ... @@ -140,7 +140,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := connector.NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "dryrunName") +id := connector.NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "dryrunName") payload := connector.DryrunPatch{ // ... @@ -157,7 +157,7 @@ if err := client.UpdateDryrunThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := connector.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName") +id := connector.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName") if err := client.ValidateThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/servicelinker/2024-04-01/connector/id_connector.go b/resource-manager/servicelinker/2024-04-01/connector/id_connector.go index ac18403e5cc..6829d4faa72 100644 --- a/resource-manager/servicelinker/2024-04-01/connector/id_connector.go +++ b/resource-manager/servicelinker/2024-04-01/connector/id_connector.go @@ -121,7 +121,7 @@ func (id ConnectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceLinker", "Microsoft.ServiceLinker", "Microsoft.ServiceLinker"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticConnectors", "connectors", "connectors"), resourceids.UserSpecifiedSegment("connectorName", "connectorName"), } diff --git a/resource-manager/servicelinker/2024-04-01/connector/id_connector_test.go b/resource-manager/servicelinker/2024-04-01/connector/id_connector_test.go index fcb94cb60aa..54c32021378 100644 --- a/resource-manager/servicelinker/2024-04-01/connector/id_connector_test.go +++ b/resource-manager/servicelinker/2024-04-01/connector/id_connector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectorId{} func TestNewConnectorID(t *testing.T) { - id := NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName") + id := NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConnectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.ConnectorName != "connectorName" { @@ -32,8 +32,8 @@ func TestNewConnectorID(t *testing.T) { } func TestFormatConnectorID(t *testing.T) { - actual := NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName" + actual := NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConnectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName", Expected: &ConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", ConnectorName: "connectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConnectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/cOnNeCtOrS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtOrS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName", Expected: &ConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", ConnectorName: "connectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/cOnNeCtOrS/cOnNeCtOrNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtOrS/cOnNeCtOrNaMe", Expected: &ConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", ConnectorName: "cOnNeCtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/cOnNeCtOrS/cOnNeCtOrNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtOrS/cOnNeCtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicelinker/2024-04-01/connector/id_dryrun.go b/resource-manager/servicelinker/2024-04-01/connector/id_dryrun.go index c570deded3c..36ace426f10 100644 --- a/resource-manager/servicelinker/2024-04-01/connector/id_dryrun.go +++ b/resource-manager/servicelinker/2024-04-01/connector/id_dryrun.go @@ -121,7 +121,7 @@ func (id DryrunId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceLinker", "Microsoft.ServiceLinker", "Microsoft.ServiceLinker"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDryruns", "dryruns", "dryruns"), resourceids.UserSpecifiedSegment("dryrunName", "dryrunName"), } diff --git a/resource-manager/servicelinker/2024-04-01/connector/id_dryrun_test.go b/resource-manager/servicelinker/2024-04-01/connector/id_dryrun_test.go index 68e26a60f98..83922b644b0 100644 --- a/resource-manager/servicelinker/2024-04-01/connector/id_dryrun_test.go +++ b/resource-manager/servicelinker/2024-04-01/connector/id_dryrun_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DryrunId{} func TestNewDryrunID(t *testing.T) { - id := NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "dryrunName") + id := NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "dryrunName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDryrunID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.DryrunName != "dryrunName" { @@ -32,8 +32,8 @@ func TestNewDryrunID(t *testing.T) { } func TestFormatDryrunID(t *testing.T) { - actual := NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "dryrunName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/dryruns/dryrunName" + actual := NewDryrunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "dryrunName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/dryruns/dryrunName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDryrunID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/dryruns", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/dryruns", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/dryruns/dryrunName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/dryruns/dryrunName", Expected: &DryrunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", DryrunName: "dryrunName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/dryruns/dryrunName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/dryruns/dryrunName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDryrunIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/dryruns", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/dryruns", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/dRyRuNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/dRyRuNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/dryruns/dryrunName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/dryruns/dryrunName", Expected: &DryrunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", DryrunName: "dryrunName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/dryruns/dryrunName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/dryruns/dryrunName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/dRyRuNs/dRyRuNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/dRyRuNs/dRyRuNnAmE", Expected: &DryrunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", DryrunName: "dRyRuNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/dRyRuNs/dRyRuNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/dRyRuNs/dRyRuNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicelinker/2024-04-01/connector/id_location.go b/resource-manager/servicelinker/2024-04-01/connector/id_location.go index 0bffd1e54eb..c212fba0f48 100644 --- a/resource-manager/servicelinker/2024-04-01/connector/id_location.go +++ b/resource-manager/servicelinker/2024-04-01/connector/id_location.go @@ -115,7 +115,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceLinker", "Microsoft.ServiceLinker", "Microsoft.ServiceLinker"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/servicelinker/2024-04-01/connector/id_location_test.go b/resource-manager/servicelinker/2024-04-01/connector/id_location_test.go index 97e00c7736b..7717af85a63 100644 --- a/resource-manager/servicelinker/2024-04-01/connector/id_location_test.go +++ b/resource-manager/servicelinker/2024-04-01/connector/id_location_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/README.md b/resource-manager/servicelinker/2024-04-01/servicelinker/README.md index b0024da6e56..2b68bac9ca4 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/README.md +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/README.md @@ -16,16 +16,16 @@ import "github.com/hashicorp/go-azure-sdk/resource-manager/servicelinker/2024-04 ### Client Initialization ```go -client := servicelinker.NewServiceLinkerClientWithBaseURI("https://management.azure.com") +client := servicelinker.NewServicelinkerClientWithBaseURI("https://management.azure.com") client.Client.Authorizer = authorizer ``` -### Example Usage: `ServiceLinkerClient.ConnectorCreateOrUpdate` +### Example Usage: `ServicelinkerClient.ConnectorCreateOrUpdate` ```go ctx := context.TODO() -id := servicelinker.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName") +id := servicelinker.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName") payload := servicelinker.LinkerResource{ // ... @@ -38,11 +38,11 @@ if err := client.ConnectorCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ``` -### Example Usage: `ServiceLinkerClient.ConnectorGet` +### Example Usage: `ServicelinkerClient.ConnectorGet` ```go ctx := context.TODO() -id := servicelinker.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName") +id := servicelinker.NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName") read, err := client.ConnectorGet(ctx, id) if err != nil { @@ -54,11 +54,11 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ServiceLinkerClient.ConnectorList` +### Example Usage: `ServicelinkerClient.ConnectorList` ```go ctx := context.TODO() -id := servicelinker.NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") +id := servicelinker.NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") // alternatively `client.ConnectorList(ctx, id)` can be used to do batched pagination items, err := client.ConnectorListComplete(ctx, id) @@ -71,7 +71,7 @@ for _, item := range items { ``` -### Example Usage: `ServiceLinkerClient.LinkerCreateOrUpdate` +### Example Usage: `ServicelinkerClient.LinkerCreateOrUpdate` ```go ctx := context.TODO() @@ -88,7 +88,7 @@ if err := client.LinkerCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ``` -### Example Usage: `ServiceLinkerClient.LinkerGet` +### Example Usage: `ServicelinkerClient.LinkerGet` ```go ctx := context.TODO() @@ -104,7 +104,7 @@ if model := read.Model; model != nil { ``` -### Example Usage: `ServiceLinkerClient.LinkerList` +### Example Usage: `ServicelinkerClient.LinkerList` ```go ctx := context.TODO() diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/client.go b/resource-manager/servicelinker/2024-04-01/servicelinker/client.go index bce1af86af4..4cad7709018 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/client.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/client.go @@ -10,17 +10,17 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ServiceLinkerClient struct { +type ServicelinkerClient struct { Client *resourcemanager.Client } -func NewServiceLinkerClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceLinkerClient, error) { +func NewServicelinkerClientWithBaseURI(sdkApi sdkEnv.Api) (*ServicelinkerClient, error) { client, err := resourcemanager.NewClient(sdkApi, "servicelinker", defaultApiVersion) if err != nil { - return nil, fmt.Errorf("instantiating ServiceLinkerClient: %+v", err) + return nil, fmt.Errorf("instantiating ServicelinkerClient: %+v", err) } - return &ServiceLinkerClient{ + return &ServicelinkerClient{ Client: client, }, nil } diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/id_connector.go b/resource-manager/servicelinker/2024-04-01/servicelinker/id_connector.go index fe72fde3441..d044ae37c9d 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/id_connector.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/id_connector.go @@ -121,7 +121,7 @@ func (id ConnectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceLinker", "Microsoft.ServiceLinker", "Microsoft.ServiceLinker"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticConnectors", "connectors", "connectors"), resourceids.UserSpecifiedSegment("connectorName", "connectorName"), } diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/id_connector_test.go b/resource-manager/servicelinker/2024-04-01/servicelinker/id_connector_test.go index d096848e0ad..2bc849a48bc 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/id_connector_test.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/id_connector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectorId{} func TestNewConnectorID(t *testing.T) { - id := NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName") + id := NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConnectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.ConnectorName != "connectorName" { @@ -32,8 +32,8 @@ func TestNewConnectorID(t *testing.T) { } func TestFormatConnectorID(t *testing.T) { - actual := NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location", "connectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName" + actual := NewConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "connectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseConnectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName", Expected: &ConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", ConnectorName: "connectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseConnectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/cOnNeCtOrS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtOrS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName", Expected: &ConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", ConnectorName: "connectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/connectors/connectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/connectors/connectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/cOnNeCtOrS/cOnNeCtOrNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtOrS/cOnNeCtOrNaMe", Expected: &ConnectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", ConnectorName: "cOnNeCtOrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/cOnNeCtOrS/cOnNeCtOrNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtOrS/cOnNeCtOrNaMe/extra", Error: true, }, } diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/id_location.go b/resource-manager/servicelinker/2024-04-01/servicelinker/id_location.go index 9d5d09f4c53..d17668dccf2 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/id_location.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/id_location.go @@ -115,7 +115,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftServiceLinker", "Microsoft.ServiceLinker", "Microsoft.ServiceLinker"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/id_location_test.go b/resource-manager/servicelinker/2024-04-01/servicelinker/id_location_test.go index 98944bbdc46..3a1c4319d8a 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/id_location_test.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/id_location_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLocationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ServiceLinker/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sErViCeLiNkEr/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorcreateorupdate.go b/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorcreateorupdate.go index ea616ac7641..09036de6aaa 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorcreateorupdate.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorcreateorupdate.go @@ -22,7 +22,7 @@ type ConnectorCreateOrUpdateOperationResponse struct { } // ConnectorCreateOrUpdate ... -func (c ServiceLinkerClient) ConnectorCreateOrUpdate(ctx context.Context, id ConnectorId, input LinkerResource) (result ConnectorCreateOrUpdateOperationResponse, err error) { +func (c ServicelinkerClient) ConnectorCreateOrUpdate(ctx context.Context, id ConnectorId, input LinkerResource) (result ConnectorCreateOrUpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -61,7 +61,7 @@ func (c ServiceLinkerClient) ConnectorCreateOrUpdate(ctx context.Context, id Con } // ConnectorCreateOrUpdateThenPoll performs ConnectorCreateOrUpdate then polls until it's completed -func (c ServiceLinkerClient) ConnectorCreateOrUpdateThenPoll(ctx context.Context, id ConnectorId, input LinkerResource) error { +func (c ServicelinkerClient) ConnectorCreateOrUpdateThenPoll(ctx context.Context, id ConnectorId, input LinkerResource) error { result, err := c.ConnectorCreateOrUpdate(ctx, id, input) if err != nil { return fmt.Errorf("performing ConnectorCreateOrUpdate: %+v", err) diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorget.go b/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorget.go index 563973d103c..48407691e7b 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorget.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorget.go @@ -18,7 +18,7 @@ type ConnectorGetOperationResponse struct { } // ConnectorGet ... -func (c ServiceLinkerClient) ConnectorGet(ctx context.Context, id ConnectorId) (result ConnectorGetOperationResponse, err error) { +func (c ServicelinkerClient) ConnectorGet(ctx context.Context, id ConnectorId) (result ConnectorGetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorlist.go b/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorlist.go index f725ae52c83..c15e5476669 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorlist.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/method_connectorlist.go @@ -36,7 +36,7 @@ func (p *ConnectorListCustomPager) NextPageLink() *odata.Link { } // ConnectorList ... -func (c ServiceLinkerClient) ConnectorList(ctx context.Context, id LocationId) (result ConnectorListOperationResponse, err error) { +func (c ServicelinkerClient) ConnectorList(ctx context.Context, id LocationId) (result ConnectorListOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -75,12 +75,12 @@ func (c ServiceLinkerClient) ConnectorList(ctx context.Context, id LocationId) ( } // ConnectorListComplete retrieves all the results into a single object -func (c ServiceLinkerClient) ConnectorListComplete(ctx context.Context, id LocationId) (ConnectorListCompleteResult, error) { +func (c ServicelinkerClient) ConnectorListComplete(ctx context.Context, id LocationId) (ConnectorListCompleteResult, error) { return c.ConnectorListCompleteMatchingPredicate(ctx, id, LinkerResourceOperationPredicate{}) } // ConnectorListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceLinkerClient) ConnectorListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate LinkerResourceOperationPredicate) (result ConnectorListCompleteResult, err error) { +func (c ServicelinkerClient) ConnectorListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate LinkerResourceOperationPredicate) (result ConnectorListCompleteResult, err error) { items := make([]LinkerResource, 0) resp, err := c.ConnectorList(ctx, id) diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkercreateorupdate.go b/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkercreateorupdate.go index f1fad0ffad5..21566f496d2 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkercreateorupdate.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkercreateorupdate.go @@ -22,7 +22,7 @@ type LinkerCreateOrUpdateOperationResponse struct { } // LinkerCreateOrUpdate ... -func (c ServiceLinkerClient) LinkerCreateOrUpdate(ctx context.Context, id ScopedLinkerId, input LinkerResource) (result LinkerCreateOrUpdateOperationResponse, err error) { +func (c ServicelinkerClient) LinkerCreateOrUpdate(ctx context.Context, id ScopedLinkerId, input LinkerResource) (result LinkerCreateOrUpdateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -61,7 +61,7 @@ func (c ServiceLinkerClient) LinkerCreateOrUpdate(ctx context.Context, id Scoped } // LinkerCreateOrUpdateThenPoll performs LinkerCreateOrUpdate then polls until it's completed -func (c ServiceLinkerClient) LinkerCreateOrUpdateThenPoll(ctx context.Context, id ScopedLinkerId, input LinkerResource) error { +func (c ServicelinkerClient) LinkerCreateOrUpdateThenPoll(ctx context.Context, id ScopedLinkerId, input LinkerResource) error { result, err := c.LinkerCreateOrUpdate(ctx, id, input) if err != nil { return fmt.Errorf("performing LinkerCreateOrUpdate: %+v", err) diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkerget.go b/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkerget.go index 61f8cc1a830..0d78b25b361 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkerget.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkerget.go @@ -18,7 +18,7 @@ type LinkerGetOperationResponse struct { } // LinkerGet ... -func (c ServiceLinkerClient) LinkerGet(ctx context.Context, id ScopedLinkerId) (result LinkerGetOperationResponse, err error) { +func (c ServicelinkerClient) LinkerGet(ctx context.Context, id ScopedLinkerId) (result LinkerGetOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkerlist.go b/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkerlist.go index 83c2cfcd374..655f12945bb 100644 --- a/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkerlist.go +++ b/resource-manager/servicelinker/2024-04-01/servicelinker/method_linkerlist.go @@ -37,7 +37,7 @@ func (p *LinkerListCustomPager) NextPageLink() *odata.Link { } // LinkerList ... -func (c ServiceLinkerClient) LinkerList(ctx context.Context, id commonids.ScopeId) (result LinkerListOperationResponse, err error) { +func (c ServicelinkerClient) LinkerList(ctx context.Context, id commonids.ScopeId) (result LinkerListOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -76,12 +76,12 @@ func (c ServiceLinkerClient) LinkerList(ctx context.Context, id commonids.ScopeI } // LinkerListComplete retrieves all the results into a single object -func (c ServiceLinkerClient) LinkerListComplete(ctx context.Context, id commonids.ScopeId) (LinkerListCompleteResult, error) { +func (c ServicelinkerClient) LinkerListComplete(ctx context.Context, id commonids.ScopeId) (LinkerListCompleteResult, error) { return c.LinkerListCompleteMatchingPredicate(ctx, id, LinkerResourceOperationPredicate{}) } // LinkerListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceLinkerClient) LinkerListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate LinkerResourceOperationPredicate) (result LinkerListCompleteResult, err error) { +func (c ServicelinkerClient) LinkerListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate LinkerResourceOperationPredicate) (result LinkerListCompleteResult, err error) { items := make([]LinkerResource, 0) resp, err := c.LinkerList(ctx, id) diff --git a/resource-manager/signalr/2023-02-01/signalr/README.md b/resource-manager/signalr/2023-02-01/signalr/README.md index 802e758f174..2457b4e148e 100644 --- a/resource-manager/signalr/2023-02-01/signalr/README.md +++ b/resource-manager/signalr/2023-02-01/signalr/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := signalr.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := signalr.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := signalr.NameAvailabilityParameters{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") payload := signalr.SignalRResource{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName") payload := signalr.CustomCertificate{ // ... @@ -80,7 +80,7 @@ if err := client.CustomCertificatesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName") read, err := client.CustomCertificatesDelete(ctx, id) if err != nil { @@ -96,7 +96,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName") read, err := client.CustomCertificatesGet(ctx, id) if err != nil { @@ -112,7 +112,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.CustomCertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CustomCertificatesListComplete(ctx, id) @@ -129,7 +129,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName") payload := signalr.CustomDomain{ // ... @@ -146,7 +146,7 @@ if err := client.CustomDomainsCreateOrUpdateThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName") if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -158,7 +158,7 @@ if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName") read, err := client.CustomDomainsGet(ctx, id) if err != nil { @@ -174,7 +174,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.CustomDomainsList(ctx, id)` can be used to do batched pagination items, err := client.CustomDomainsListComplete(ctx, id) @@ -191,7 +191,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") read, err := client.Get(ctx, id) if err != nil { @@ -253,7 +253,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -269,7 +269,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.ListSkus(ctx, id)` can be used to do batched pagination items, err := client.ListSkusComplete(ctx, id) @@ -286,7 +286,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName") if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -298,7 +298,7 @@ if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName") read, err := client.PrivateEndpointConnectionsGet(ctx, id) if err != nil { @@ -314,7 +314,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.PrivateEndpointConnectionsList(ctx, id)` can be used to do batched pagination items, err := client.PrivateEndpointConnectionsListComplete(ctx, id) @@ -331,7 +331,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName") payload := signalr.PrivateEndpointConnection{ // ... @@ -352,7 +352,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.PrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.PrivateLinkResourcesListComplete(ctx, id) @@ -369,7 +369,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") payload := signalr.RegenerateKeyParameters{ // ... @@ -386,7 +386,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -398,7 +398,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName") payload := signalr.SharedPrivateLinkResource{ // ... @@ -415,7 +415,7 @@ if err := client.SharedPrivateLinkResourcesCreateOrUpdateThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName") if err := client.SharedPrivateLinkResourcesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -427,7 +427,7 @@ if err := client.SharedPrivateLinkResourcesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName") read, err := client.SharedPrivateLinkResourcesGet(ctx, id) if err != nil { @@ -443,7 +443,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.SharedPrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.SharedPrivateLinkResourcesListComplete(ctx, id) @@ -460,7 +460,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") payload := signalr.SignalRResource{ // ... @@ -477,7 +477,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := signalr.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := signalr.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.UsagesList(ctx, id)` can be used to do batched pagination items, err := client.UsagesListComplete(ctx, id) diff --git a/resource-manager/signalr/2023-02-01/signalr/id_customcertificate.go b/resource-manager/signalr/2023-02-01/signalr/id_customcertificate.go index aa9014105a6..d615ebb4bfa 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_customcertificate.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_customcertificate.go @@ -121,9 +121,9 @@ func (id CustomCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticCustomCertificates", "customCertificates", "customCertificates"), - resourceids.UserSpecifiedSegment("customCertificateName", "certificateName"), + resourceids.UserSpecifiedSegment("customCertificateName", "customCertificateName"), } } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_customcertificate_test.go b/resource-manager/signalr/2023-02-01/signalr/id_customcertificate_test.go index e39c144eac0..efa01748778 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_customcertificate_test.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_customcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomCertificateId{} func TestNewCustomCertificateID(t *testing.T) { - id := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") + id := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } - if id.CustomCertificateName != "certificateName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomCertificateName'", id.CustomCertificateName, "certificateName") + if id.CustomCertificateName != "customCertificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomCertificateName'", id.CustomCertificateName, "customCertificateName") } } func TestFormatCustomCertificateID(t *testing.T) { - actual := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName" + actual := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", - CustomCertificateName: "certificateName", + SignalRName: "signalRName", + CustomCertificateName: "customCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", - CustomCertificateName: "certificateName", + SignalRName: "signalRName", + CustomCertificateName: "customCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMcErTiFiCaTeS/cUsToMcErTiFiCaTeNaMe", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", - CustomCertificateName: "cErTiFiCaTeNaMe", + SignalRName: "sIgNaLrNaMe", + CustomCertificateName: "cUsToMcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMcErTiFiCaTeS/cUsToMcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_customdomain.go b/resource-manager/signalr/2023-02-01/signalr/id_customdomain.go index 8c85fb094fe..702b7003852 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_customdomain.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_customdomain.go @@ -121,9 +121,9 @@ func (id CustomDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), - resourceids.UserSpecifiedSegment("customDomainName", "name"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainName"), } } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_customdomain_test.go b/resource-manager/signalr/2023-02-01/signalr/id_customdomain_test.go index e4bede5642b..9439c2a36c5 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_customdomain_test.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_customdomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomDomainId{} func TestNewCustomDomainID(t *testing.T) { - id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") + id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } - if id.CustomDomainName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "name") + if id.CustomDomainName != "customDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "customDomainName") } } func TestFormatCustomDomainID(t *testing.T) { - actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name" + actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", - CustomDomainName: "name", + SignalRName: "signalRName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMdOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMdOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", - CustomDomainName: "name", + SignalRName: "signalRName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMdOmAiNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMdOmAiNs/cUsToMdOmAiNnAmE", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", - CustomDomainName: "nAmE", + SignalRName: "sIgNaLrNaMe", + CustomDomainName: "cUsToMdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMdOmAiNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMdOmAiNs/cUsToMdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_location.go b/resource-manager/signalr/2023-02-01/signalr/id_location.go index d0bc29ecf7e..268f350264a 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_location.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_location_test.go b/resource-manager/signalr/2023-02-01/signalr/id_location_test.go index 75c0fe502b6..5a1181d132f 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_location_test.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_privateendpointconnection.go b/resource-manager/signalr/2023-02-01/signalr/id_privateendpointconnection.go index 8ff61f8ac1c..47fcbd1452f 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_privateendpointconnection.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_privateendpointconnection_test.go b/resource-manager/signalr/2023-02-01/signalr/id_privateendpointconnection_test.go index 187d7c1c9a7..f39a2684c85 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_privateendpointconnection_test.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", + SignalRName: "sIgNaLrNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_sharedprivatelinkresource.go b/resource-manager/signalr/2023-02-01/signalr/id_sharedprivatelinkresource.go index 8434a97dc98..b6f5261ca03 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_sharedprivatelinkresource.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_sharedprivatelinkresource.go @@ -121,7 +121,7 @@ func (id SharedPrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticSharedPrivateLinkResources", "sharedPrivateLinkResources", "sharedPrivateLinkResources"), resourceids.UserSpecifiedSegment("sharedPrivateLinkResourceName", "sharedPrivateLinkResourceName"), } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_sharedprivatelinkresource_test.go b/resource-manager/signalr/2023-02-01/signalr/id_sharedprivatelinkresource_test.go index 70e3b93570b..241fa44e7e7 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_sharedprivatelinkresource_test.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_sharedprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SharedPrivateLinkResourceId{} func TestNewSharedPrivateLinkResourceID(t *testing.T) { - id := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") + id := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSharedPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } if id.SharedPrivateLinkResourceName != "sharedPrivateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewSharedPrivateLinkResourceID(t *testing.T) { } func TestFormatSharedPrivateLinkResourceID(t *testing.T) { - actual := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" + actual := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSharedPrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSharedPrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/sHaReDpRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", + SignalRName: "sIgNaLrNaMe", SharedPrivateLinkResourceName: "sHaReDpRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_signalr.go b/resource-manager/signalr/2023-02-01/signalr/id_signalr.go index 355dc0b4f67..246c8928f86 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_signalr.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_signalr.go @@ -115,7 +115,7 @@ func (id SignalRId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), } } diff --git a/resource-manager/signalr/2023-02-01/signalr/id_signalr_test.go b/resource-manager/signalr/2023-02-01/signalr/id_signalr_test.go index 48667f19ee0..ac65f3e96ac 100644 --- a/resource-manager/signalr/2023-02-01/signalr/id_signalr_test.go +++ b/resource-manager/signalr/2023-02-01/signalr/id_signalr_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SignalRId{} func TestNewSignalRID(t *testing.T) { - id := NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewSignalRID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } } func TestFormatSignalRID(t *testing.T) { - actual := NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName" + actual := NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseSignalRID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Expected: &SignalRId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseSignalRIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Expected: &SignalRId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Expected: &SignalRId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", + SignalRName: "sIgNaLrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2024-03-01/signalr/README.md b/resource-manager/signalr/2024-03-01/signalr/README.md index 17b7ee92f81..d8aaa8c1d19 100644 --- a/resource-manager/signalr/2024-03-01/signalr/README.md +++ b/resource-manager/signalr/2024-03-01/signalr/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := signalr.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := signalr.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := signalr.NameAvailabilityParameters{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") payload := signalr.SignalRResource{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName") payload := signalr.CustomCertificate{ // ... @@ -80,7 +80,7 @@ if err := client.CustomCertificatesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName") read, err := client.CustomCertificatesDelete(ctx, id) if err != nil { @@ -96,7 +96,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := signalr.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName") read, err := client.CustomCertificatesGet(ctx, id) if err != nil { @@ -112,7 +112,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.CustomCertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CustomCertificatesListComplete(ctx, id) @@ -129,7 +129,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName") payload := signalr.CustomDomain{ // ... @@ -146,7 +146,7 @@ if err := client.CustomDomainsCreateOrUpdateThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName") if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -158,7 +158,7 @@ if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := signalr.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName") read, err := client.CustomDomainsGet(ctx, id) if err != nil { @@ -174,7 +174,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.CustomDomainsList(ctx, id)` can be used to do batched pagination items, err := client.CustomDomainsListComplete(ctx, id) @@ -191,7 +191,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") read, err := client.Get(ctx, id) if err != nil { @@ -253,7 +253,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -269,7 +269,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName") // alternatively `client.ListReplicaSkus(ctx, id)` can be used to do batched pagination items, err := client.ListReplicaSkusComplete(ctx, id) @@ -286,7 +286,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.ListSkus(ctx, id)` can be used to do batched pagination items, err := client.ListSkusComplete(ctx, id) @@ -303,7 +303,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName") if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -315,7 +315,7 @@ if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName") read, err := client.PrivateEndpointConnectionsGet(ctx, id) if err != nil { @@ -331,7 +331,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.PrivateEndpointConnectionsList(ctx, id)` can be used to do batched pagination items, err := client.PrivateEndpointConnectionsListComplete(ctx, id) @@ -348,7 +348,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := signalr.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName") payload := signalr.PrivateEndpointConnection{ // ... @@ -369,7 +369,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.PrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.PrivateLinkResourcesListComplete(ctx, id) @@ -386,7 +386,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") payload := signalr.RegenerateKeyParameters{ // ... @@ -403,7 +403,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := signalr.NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName", "sharedPrivateLinkResourceName") +id := signalr.NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName", "sharedPrivateLinkResourceName") payload := signalr.SharedPrivateLinkResource{ // ... @@ -420,7 +420,7 @@ if err := client.ReplicaSharedPrivateLinkResourcesCreateOrUpdateThenPoll(ctx, id ```go ctx := context.TODO() -id := signalr.NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName", "sharedPrivateLinkResourceName") +id := signalr.NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName", "sharedPrivateLinkResourceName") read, err := client.ReplicaSharedPrivateLinkResourcesGet(ctx, id) if err != nil { @@ -436,7 +436,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName") // alternatively `client.ReplicaSharedPrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.ReplicaSharedPrivateLinkResourcesListComplete(ctx, id) @@ -453,7 +453,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName") payload := signalr.Replica{ // ... @@ -470,7 +470,7 @@ if err := client.ReplicasCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName") read, err := client.ReplicasDelete(ctx, id) if err != nil { @@ -486,7 +486,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName") read, err := client.ReplicasGet(ctx, id) if err != nil { @@ -502,7 +502,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.ReplicasList(ctx, id)` can be used to do batched pagination items, err := client.ReplicasListComplete(ctx, id) @@ -519,7 +519,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName") if err := client.ReplicasRestartThenPoll(ctx, id); err != nil { // handle the error @@ -531,7 +531,7 @@ if err := client.ReplicasRestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := signalr.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName") payload := signalr.Replica{ // ... @@ -548,7 +548,7 @@ if err := client.ReplicasUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -560,7 +560,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName") payload := signalr.SharedPrivateLinkResource{ // ... @@ -577,7 +577,7 @@ if err := client.SharedPrivateLinkResourcesCreateOrUpdateThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName") if err := client.SharedPrivateLinkResourcesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -589,7 +589,7 @@ if err := client.SharedPrivateLinkResourcesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := signalr.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName") read, err := client.SharedPrivateLinkResourcesGet(ctx, id) if err != nil { @@ -605,7 +605,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") // alternatively `client.SharedPrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.SharedPrivateLinkResourcesListComplete(ctx, id) @@ -622,7 +622,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := signalr.NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") payload := signalr.SignalRResource{ // ... @@ -639,7 +639,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := signalr.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := signalr.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.UsagesList(ctx, id)` can be used to do batched pagination items, err := client.UsagesListComplete(ctx, id) diff --git a/resource-manager/signalr/2024-03-01/signalr/id_customcertificate.go b/resource-manager/signalr/2024-03-01/signalr/id_customcertificate.go index aa9014105a6..d615ebb4bfa 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_customcertificate.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_customcertificate.go @@ -121,9 +121,9 @@ func (id CustomCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticCustomCertificates", "customCertificates", "customCertificates"), - resourceids.UserSpecifiedSegment("customCertificateName", "certificateName"), + resourceids.UserSpecifiedSegment("customCertificateName", "customCertificateName"), } } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_customcertificate_test.go b/resource-manager/signalr/2024-03-01/signalr/id_customcertificate_test.go index e39c144eac0..efa01748778 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_customcertificate_test.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_customcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomCertificateId{} func TestNewCustomCertificateID(t *testing.T) { - id := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") + id := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } - if id.CustomCertificateName != "certificateName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomCertificateName'", id.CustomCertificateName, "certificateName") + if id.CustomCertificateName != "customCertificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomCertificateName'", id.CustomCertificateName, "customCertificateName") } } func TestFormatCustomCertificateID(t *testing.T) { - actual := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName" + actual := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", - CustomCertificateName: "certificateName", + SignalRName: "signalRName", + CustomCertificateName: "customCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", - CustomCertificateName: "certificateName", + SignalRName: "signalRName", + CustomCertificateName: "customCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customCertificates/customCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMcErTiFiCaTeS/cUsToMcErTiFiCaTeNaMe", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", - CustomCertificateName: "cErTiFiCaTeNaMe", + SignalRName: "sIgNaLrNaMe", + CustomCertificateName: "cUsToMcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMcErTiFiCaTeS/cUsToMcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_customdomain.go b/resource-manager/signalr/2024-03-01/signalr/id_customdomain.go index 8c85fb094fe..702b7003852 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_customdomain.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_customdomain.go @@ -121,9 +121,9 @@ func (id CustomDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), - resourceids.UserSpecifiedSegment("customDomainName", "name"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainName"), } } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_customdomain_test.go b/resource-manager/signalr/2024-03-01/signalr/id_customdomain_test.go index e4bede5642b..9439c2a36c5 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_customdomain_test.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_customdomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomDomainId{} func TestNewCustomDomainID(t *testing.T) { - id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") + id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } - if id.CustomDomainName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "name") + if id.CustomDomainName != "customDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "customDomainName") } } func TestFormatCustomDomainID(t *testing.T) { - actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name" + actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "customDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", - CustomDomainName: "name", + SignalRName: "signalRName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMdOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMdOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", - CustomDomainName: "name", + SignalRName: "signalRName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/customDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/customDomains/customDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMdOmAiNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMdOmAiNs/cUsToMdOmAiNnAmE", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", - CustomDomainName: "nAmE", + SignalRName: "sIgNaLrNaMe", + CustomDomainName: "cUsToMdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/cUsToMdOmAiNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/cUsToMdOmAiNs/cUsToMdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_location.go b/resource-manager/signalr/2024-03-01/signalr/id_location.go index d0bc29ecf7e..268f350264a 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_location.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_location_test.go b/resource-manager/signalr/2024-03-01/signalr/id_location_test.go index 75c0fe502b6..5a1181d132f 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_location_test.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_privateendpointconnection.go b/resource-manager/signalr/2024-03-01/signalr/id_privateendpointconnection.go index 8ff61f8ac1c..47fcbd1452f 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_privateendpointconnection.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_privateendpointconnection_test.go b/resource-manager/signalr/2024-03-01/signalr/id_privateendpointconnection_test.go index 187d7c1c9a7..f39a2684c85 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_privateendpointconnection_test.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", + SignalRName: "sIgNaLrNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_replica.go b/resource-manager/signalr/2024-03-01/signalr/id_replica.go index 76f1ebf82fc..71121eaa489 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_replica.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_replica.go @@ -121,7 +121,7 @@ func (id ReplicaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticReplicas", "replicas", "replicas"), resourceids.UserSpecifiedSegment("replicaName", "replicaName"), } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_replica_test.go b/resource-manager/signalr/2024-03-01/signalr/id_replica_test.go index 94cebd44b95..4b494f4584c 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_replica_test.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_replica_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicaId{} func TestNewReplicaID(t *testing.T) { - id := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") + id := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewReplicaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } if id.ReplicaName != "replicaName" { @@ -32,8 +32,8 @@ func TestNewReplicaID(t *testing.T) { } func TestFormatReplicaID(t *testing.T) { - actual := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName" + actual := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicaID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", ReplicaName: "replicaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicaIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/rEpLiCaS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/rEpLiCaS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", ReplicaName: "replicaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/rEpLiCaS/rEpLiCaNaMe", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", + SignalRName: "sIgNaLrNaMe", ReplicaName: "rEpLiCaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/rEpLiCaS/rEpLiCaNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_replicasharedprivatelinkresource.go b/resource-manager/signalr/2024-03-01/signalr/id_replicasharedprivatelinkresource.go index 500f268a22c..866bd581d8f 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_replicasharedprivatelinkresource.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_replicasharedprivatelinkresource.go @@ -127,7 +127,7 @@ func (id ReplicaSharedPrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticReplicas", "replicas", "replicas"), resourceids.UserSpecifiedSegment("replicaName", "replicaName"), resourceids.StaticSegment("staticSharedPrivateLinkResources", "sharedPrivateLinkResources", "sharedPrivateLinkResources"), diff --git a/resource-manager/signalr/2024-03-01/signalr/id_replicasharedprivatelinkresource_test.go b/resource-manager/signalr/2024-03-01/signalr/id_replicasharedprivatelinkresource_test.go index 87a73a41c78..5807f64b306 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_replicasharedprivatelinkresource_test.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_replicasharedprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicaSharedPrivateLinkResourceId{} func TestNewReplicaSharedPrivateLinkResourceID(t *testing.T) { - id := NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName", "sharedPrivateLinkResourceName") + id := NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName", "sharedPrivateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewReplicaSharedPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } if id.ReplicaName != "replicaName" { @@ -36,8 +36,8 @@ func TestNewReplicaSharedPrivateLinkResourceID(t *testing.T) { } func TestFormatReplicaSharedPrivateLinkResourceID(t *testing.T) { - actual := NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName", "sharedPrivateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" + actual := NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "replicaName", "sharedPrivateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicaSharedPrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/sharedPrivateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &ReplicaSharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", ReplicaName: "replicaName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicaSharedPrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/rEpLiCaS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/rEpLiCaS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/rEpLiCaS/rEpLiCaNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/sharedPrivateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &ReplicaSharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", ReplicaName: "replicaName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", Expected: &ReplicaSharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", + SignalRName: "sIgNaLrNaMe", ReplicaName: "rEpLiCaNaMe", SharedPrivateLinkResourceName: "sHaReDpRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_sharedprivatelinkresource.go b/resource-manager/signalr/2024-03-01/signalr/id_sharedprivatelinkresource.go index 8434a97dc98..b6f5261ca03 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_sharedprivatelinkresource.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_sharedprivatelinkresource.go @@ -121,7 +121,7 @@ func (id SharedPrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), resourceids.StaticSegment("staticSharedPrivateLinkResources", "sharedPrivateLinkResources", "sharedPrivateLinkResources"), resourceids.UserSpecifiedSegment("sharedPrivateLinkResourceName", "sharedPrivateLinkResourceName"), } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_sharedprivatelinkresource_test.go b/resource-manager/signalr/2024-03-01/signalr/id_sharedprivatelinkresource_test.go index 70e3b93570b..241fa44e7e7 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_sharedprivatelinkresource_test.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_sharedprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SharedPrivateLinkResourceId{} func TestNewSharedPrivateLinkResourceID(t *testing.T) { - id := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") + id := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSharedPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } if id.SharedPrivateLinkResourceName != "sharedPrivateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewSharedPrivateLinkResourceID(t *testing.T) { } func TestFormatSharedPrivateLinkResourceID(t *testing.T) { - actual := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" + actual := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName", "sharedPrivateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSharedPrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSharedPrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/sHaReDpRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", + SignalRName: "sIgNaLrNaMe", SharedPrivateLinkResourceName: "sHaReDpRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_signalr.go b/resource-manager/signalr/2024-03-01/signalr/id_signalr.go index 355dc0b4f67..246c8928f86 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_signalr.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_signalr.go @@ -115,7 +115,7 @@ func (id SignalRId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticSignalR", "signalR", "signalR"), - resourceids.UserSpecifiedSegment("signalRName", "resourceName"), + resourceids.UserSpecifiedSegment("signalRName", "signalRName"), } } diff --git a/resource-manager/signalr/2024-03-01/signalr/id_signalr_test.go b/resource-manager/signalr/2024-03-01/signalr/id_signalr_test.go index 48667f19ee0..ac65f3e96ac 100644 --- a/resource-manager/signalr/2024-03-01/signalr/id_signalr_test.go +++ b/resource-manager/signalr/2024-03-01/signalr/id_signalr_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SignalRId{} func TestNewSignalRID(t *testing.T) { - id := NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewSignalRID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SignalRName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "resourceName") + if id.SignalRName != "signalRName" { + t.Fatalf("Expected %q but got %q for Segment 'SignalRName'", id.SignalRName, "signalRName") } } func TestFormatSignalRID(t *testing.T) { - actual := NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName" + actual := NewSignalRID("12345678-1234-9876-4563-123456789012", "example-resource-group", "signalRName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseSignalRID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Expected: &SignalRId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseSignalRIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName", Expected: &SignalRId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SignalRName: "resourceName", + SignalRName: "signalRName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/signalR/signalRName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe", Expected: &SignalRId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SignalRName: "rEsOuRcEnAmE", + SignalRName: "sIgNaLrNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/sIgNaLr/sIgNaLrNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/datamaskingrules/README.md b/resource-manager/sql/2023-08-01-preview/datamaskingrules/README.md index 3aa65bac2ce..3503ec54775 100644 --- a/resource-manager/sql/2023-08-01-preview/datamaskingrules/README.md +++ b/resource-manager/sql/2023-08-01-preview/datamaskingrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datamaskingrules.NewDataMaskingPolicyRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName", "dataMaskingRuleName") +id := datamaskingrules.NewDataMaskingPolicyRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName", "ruleName") payload := datamaskingrules.DataMaskingRule{ // ... diff --git a/resource-manager/sql/2023-08-01-preview/datamaskingrules/id_datamaskingpolicyrule.go b/resource-manager/sql/2023-08-01-preview/datamaskingrules/id_datamaskingpolicyrule.go index 5490d30ae26..5cef2fdde04 100644 --- a/resource-manager/sql/2023-08-01-preview/datamaskingrules/id_datamaskingpolicyrule.go +++ b/resource-manager/sql/2023-08-01-preview/datamaskingrules/id_datamaskingpolicyrule.go @@ -133,7 +133,7 @@ func (id DataMaskingPolicyRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDataMaskingPolicies", "dataMaskingPolicies", "dataMaskingPolicies"), resourceids.StaticSegment("dataMaskingPolicyName", "default", "default"), resourceids.StaticSegment("staticRules", "rules", "rules"), - resourceids.UserSpecifiedSegment("ruleName", "dataMaskingRuleName"), + resourceids.UserSpecifiedSegment("ruleName", "ruleName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/datamaskingrules/id_datamaskingpolicyrule_test.go b/resource-manager/sql/2023-08-01-preview/datamaskingrules/id_datamaskingpolicyrule_test.go index 4cda13dc888..113a74c654a 100644 --- a/resource-manager/sql/2023-08-01-preview/datamaskingrules/id_datamaskingpolicyrule_test.go +++ b/resource-manager/sql/2023-08-01-preview/datamaskingrules/id_datamaskingpolicyrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataMaskingPolicyRuleId{} func TestNewDataMaskingPolicyRuleID(t *testing.T) { - id := NewDataMaskingPolicyRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName", "dataMaskingRuleName") + id := NewDataMaskingPolicyRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName", "ruleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewDataMaskingPolicyRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DatabaseName'", id.DatabaseName, "databaseName") } - if id.RuleName != "dataMaskingRuleName" { - t.Fatalf("Expected %q but got %q for Segment 'RuleName'", id.RuleName, "dataMaskingRuleName") + if id.RuleName != "ruleName" { + t.Fatalf("Expected %q but got %q for Segment 'RuleName'", id.RuleName, "ruleName") } } func TestFormatDataMaskingPolicyRuleID(t *testing.T) { - actual := NewDataMaskingPolicyRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName", "dataMaskingRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/dataMaskingRuleName" + actual := NewDataMaskingPolicyRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName", "ruleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/ruleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -121,18 +121,18 @@ func TestParseDataMaskingPolicyRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/dataMaskingRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/ruleName", Expected: &DataMaskingPolicyRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", DatabaseName: "databaseName", - RuleName: "dataMaskingRuleName", + RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/dataMaskingRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/ruleName/extra", Error: true, }, } @@ -317,34 +317,34 @@ func TestParseDataMaskingPolicyRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/dataMaskingRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/ruleName", Expected: &DataMaskingPolicyRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", DatabaseName: "databaseName", - RuleName: "dataMaskingRuleName", + RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/dataMaskingRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/databases/databaseName/dataMaskingPolicies/default/rules/ruleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/dAtAmAsKiNgPoLiCiEs/dEfAuLt/rUlEs/dAtAmAsKiNgRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/dAtAmAsKiNgPoLiCiEs/dEfAuLt/rUlEs/rUlEnAmE", Expected: &DataMaskingPolicyRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", DatabaseName: "dAtAbAsEnAmE", - RuleName: "dAtAmAsKiNgRuLeNaMe", + RuleName: "rUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/dAtAmAsKiNgPoLiCiEs/dEfAuLt/rUlEs/dAtAmAsKiNgRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/dAtAbAsEs/dAtAbAsEnAmE/dAtAmAsKiNgPoLiCiEs/dEfAuLt/rUlEs/rUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/endpointcertificates/README.md b/resource-manager/sql/2023-08-01-preview/endpointcertificates/README.md index d9e6ca560e1..6fc267a08f3 100644 --- a/resource-manager/sql/2023-08-01-preview/endpointcertificates/README.md +++ b/resource-manager/sql/2023-08-01-preview/endpointcertificates/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := endpointcertificates.NewEndpointCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "endpointType") +id := endpointcertificates.NewEndpointCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "endpointCertificateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/endpointcertificates/id_endpointcertificate.go b/resource-manager/sql/2023-08-01-preview/endpointcertificates/id_endpointcertificate.go index f722e2312c5..c08cbe18a55 100644 --- a/resource-manager/sql/2023-08-01-preview/endpointcertificates/id_endpointcertificate.go +++ b/resource-manager/sql/2023-08-01-preview/endpointcertificates/id_endpointcertificate.go @@ -123,7 +123,7 @@ func (id EndpointCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticManagedInstances", "managedInstances", "managedInstances"), resourceids.UserSpecifiedSegment("managedInstanceName", "managedInstanceName"), resourceids.StaticSegment("staticEndpointCertificates", "endpointCertificates", "endpointCertificates"), - resourceids.UserSpecifiedSegment("endpointCertificateName", "endpointType"), + resourceids.UserSpecifiedSegment("endpointCertificateName", "endpointCertificateName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/endpointcertificates/id_endpointcertificate_test.go b/resource-manager/sql/2023-08-01-preview/endpointcertificates/id_endpointcertificate_test.go index 93182b28be1..3b730994ea2 100644 --- a/resource-manager/sql/2023-08-01-preview/endpointcertificates/id_endpointcertificate_test.go +++ b/resource-manager/sql/2023-08-01-preview/endpointcertificates/id_endpointcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EndpointCertificateId{} func TestNewEndpointCertificateID(t *testing.T) { - id := NewEndpointCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "endpointType") + id := NewEndpointCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "endpointCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewEndpointCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ManagedInstanceName'", id.ManagedInstanceName, "managedInstanceName") } - if id.EndpointCertificateName != "endpointType" { - t.Fatalf("Expected %q but got %q for Segment 'EndpointCertificateName'", id.EndpointCertificateName, "endpointType") + if id.EndpointCertificateName != "endpointCertificateName" { + t.Fatalf("Expected %q but got %q for Segment 'EndpointCertificateName'", id.EndpointCertificateName, "endpointCertificateName") } } func TestFormatEndpointCertificateID(t *testing.T) { - actual := NewEndpointCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "endpointType").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointType" + actual := NewEndpointCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "endpointCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseEndpointCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointCertificateName", Expected: &EndpointCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ManagedInstanceName: "managedInstanceName", - EndpointCertificateName: "endpointType", + EndpointCertificateName: "endpointCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointCertificateName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseEndpointCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointCertificateName", Expected: &EndpointCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ManagedInstanceName: "managedInstanceName", - EndpointCertificateName: "endpointType", + EndpointCertificateName: "endpointCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointType/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/endpointCertificates/endpointCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/eNdPoInTcErTiFiCaTeS/eNdPoInTtYpE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/eNdPoInTcErTiFiCaTeS/eNdPoInTcErTiFiCaTeNaMe", Expected: &EndpointCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ManagedInstanceName: "mAnAgEdInStAnCeNaMe", - EndpointCertificateName: "eNdPoInTtYpE", + EndpointCertificateName: "eNdPoInTcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/eNdPoInTcErTiFiCaTeS/eNdPoInTtYpE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/eNdPoInTcErTiFiCaTeS/eNdPoInTcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/instancefailovergroups/README.md b/resource-manager/sql/2023-08-01-preview/instancefailovergroups/README.md index e45bf154d96..1f6412ba51f 100644 --- a/resource-manager/sql/2023-08-01-preview/instancefailovergroups/README.md +++ b/resource-manager/sql/2023-08-01-preview/instancefailovergroups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "failoverGroupName") +id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "instanceFailoverGroupName") payload := instancefailovergroups.InstanceFailoverGroup{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "failoverGroupName") +id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "instanceFailoverGroupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "failoverGroupName") +id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "instanceFailoverGroupName") if err := client.FailoverThenPoll(ctx, id); err != nil { // handle the error @@ -65,7 +65,7 @@ if err := client.FailoverThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "failoverGroupName") +id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "instanceFailoverGroupName") if err := client.ForceFailoverAllowDataLossThenPoll(ctx, id); err != nil { // handle the error @@ -77,7 +77,7 @@ if err := client.ForceFailoverAllowDataLossThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "failoverGroupName") +id := instancefailovergroups.NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "instanceFailoverGroupName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/instancefailovergroups/id_instancefailovergroup.go b/resource-manager/sql/2023-08-01-preview/instancefailovergroups/id_instancefailovergroup.go index 0a35e73b057..5cbaddc2165 100644 --- a/resource-manager/sql/2023-08-01-preview/instancefailovergroups/id_instancefailovergroup.go +++ b/resource-manager/sql/2023-08-01-preview/instancefailovergroups/id_instancefailovergroup.go @@ -123,7 +123,7 @@ func (id InstanceFailoverGroupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocations", "locations", "locations"), resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticInstanceFailoverGroups", "instanceFailoverGroups", "instanceFailoverGroups"), - resourceids.UserSpecifiedSegment("instanceFailoverGroupName", "failoverGroupName"), + resourceids.UserSpecifiedSegment("instanceFailoverGroupName", "instanceFailoverGroupName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/instancefailovergroups/id_instancefailovergroup_test.go b/resource-manager/sql/2023-08-01-preview/instancefailovergroups/id_instancefailovergroup_test.go index c82c05fd409..9199e8d65dc 100644 --- a/resource-manager/sql/2023-08-01-preview/instancefailovergroups/id_instancefailovergroup_test.go +++ b/resource-manager/sql/2023-08-01-preview/instancefailovergroups/id_instancefailovergroup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceFailoverGroupId{} func TestNewInstanceFailoverGroupID(t *testing.T) { - id := NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "failoverGroupName") + id := NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "instanceFailoverGroupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewInstanceFailoverGroupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.InstanceFailoverGroupName != "failoverGroupName" { - t.Fatalf("Expected %q but got %q for Segment 'InstanceFailoverGroupName'", id.InstanceFailoverGroupName, "failoverGroupName") + if id.InstanceFailoverGroupName != "instanceFailoverGroupName" { + t.Fatalf("Expected %q but got %q for Segment 'InstanceFailoverGroupName'", id.InstanceFailoverGroupName, "instanceFailoverGroupName") } } func TestFormatInstanceFailoverGroupID(t *testing.T) { - actual := NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "failoverGroupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/failoverGroupName" + actual := NewInstanceFailoverGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "instanceFailoverGroupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/instanceFailoverGroupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseInstanceFailoverGroupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/failoverGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/instanceFailoverGroupName", Expected: &InstanceFailoverGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", - InstanceFailoverGroupName: "failoverGroupName", + InstanceFailoverGroupName: "instanceFailoverGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/failoverGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/instanceFailoverGroupName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseInstanceFailoverGroupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/failoverGroupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/instanceFailoverGroupName", Expected: &InstanceFailoverGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", - InstanceFailoverGroupName: "failoverGroupName", + InstanceFailoverGroupName: "instanceFailoverGroupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/failoverGroupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/instanceFailoverGroups/instanceFailoverGroupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/iNsTaNcEfAiLoVeRgRoUpS/fAiLoVeRgRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/iNsTaNcEfAiLoVeRgRoUpS/iNsTaNcEfAiLoVeRgRoUpNaMe", Expected: &InstanceFailoverGroupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocationName: "lOcAtIoNnAmE", - InstanceFailoverGroupName: "fAiLoVeRgRoUpNaMe", + InstanceFailoverGroupName: "iNsTaNcEfAiLoVeRgRoUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/iNsTaNcEfAiLoVeRgRoUpS/fAiLoVeRgRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/iNsTaNcEfAiLoVeRgRoUpS/iNsTaNcEfAiLoVeRgRoUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/README.md b/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/README.md index a8e59c58a5b..ee163ae238a 100644 --- a/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/README.md +++ b/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := ipv6firewallrules.NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := ipv6firewallrules.NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "ipv6FirewallRuleName") payload := ipv6firewallrules.IPv6FirewallRule{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := ipv6firewallrules.NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := ipv6firewallrules.NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "ipv6FirewallRuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := ipv6firewallrules.NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") +id := ipv6firewallrules.NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "ipv6FirewallRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/id_ipv6firewallrule.go b/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/id_ipv6firewallrule.go index 6c8514a8058..7a8bc04abee 100644 --- a/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/id_ipv6firewallrule.go +++ b/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/id_ipv6firewallrule.go @@ -123,7 +123,7 @@ func (id IPv6FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticServers", "servers", "servers"), resourceids.UserSpecifiedSegment("serverName", "serverName"), resourceids.StaticSegment("staticIpv6FirewallRules", "ipv6FirewallRules", "ipv6FirewallRules"), - resourceids.UserSpecifiedSegment("ipv6FirewallRuleName", "firewallRuleName"), + resourceids.UserSpecifiedSegment("ipv6FirewallRuleName", "ipv6FirewallRuleName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/id_ipv6firewallrule_test.go b/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/id_ipv6firewallrule_test.go index dd5fa4d33e8..d56bbf6cbf5 100644 --- a/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/id_ipv6firewallrule_test.go +++ b/resource-manager/sql/2023-08-01-preview/ipv6firewallrules/id_ipv6firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &IPv6FirewallRuleId{} func TestNewIPv6FirewallRuleID(t *testing.T) { - id := NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName") + id := NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "ipv6FirewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewIPv6FirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServerName'", id.ServerName, "serverName") } - if id.Ipv6FirewallRuleName != "firewallRuleName" { - t.Fatalf("Expected %q but got %q for Segment 'Ipv6FirewallRuleName'", id.Ipv6FirewallRuleName, "firewallRuleName") + if id.Ipv6FirewallRuleName != "ipv6FirewallRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'Ipv6FirewallRuleName'", id.Ipv6FirewallRuleName, "ipv6FirewallRuleName") } } func TestFormatIPv6FirewallRuleID(t *testing.T) { - actual := NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "firewallRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/firewallRuleName" + actual := NewIPv6FirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "ipv6FirewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/ipv6FirewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseIPv6FirewallRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/ipv6FirewallRuleName", Expected: &IPv6FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - Ipv6FirewallRuleName: "firewallRuleName", + Ipv6FirewallRuleName: "ipv6FirewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/ipv6FirewallRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseIPv6FirewallRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/firewallRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/ipv6FirewallRuleName", Expected: &IPv6FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - Ipv6FirewallRuleName: "firewallRuleName", + Ipv6FirewallRuleName: "ipv6FirewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/firewallRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/ipv6FirewallRules/ipv6FirewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/iPv6fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/iPv6fIrEwAlLrUlEs/iPv6fIrEwAlLrUlEnAmE", Expected: &IPv6FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", - Ipv6FirewallRuleName: "fIrEwAlLrUlEnAmE", + Ipv6FirewallRuleName: "iPv6fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/iPv6fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/iPv6fIrEwAlLrUlEs/iPv6fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/jobsteps/README.md b/resource-manager/sql/2023-08-01-preview/jobsteps/README.md index f131a6e765a..e19473cdd33 100644 --- a/resource-manager/sql/2023-08-01-preview/jobsteps/README.md +++ b/resource-manager/sql/2023-08-01-preview/jobsteps/README.md @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := jobsteps.NewVersionStepID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion", "stepName") +id := jobsteps.NewVersionStepID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName", "stepName") read, err := client.GetByVersion(ctx, id) if err != nil { @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := jobsteps.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion") +id := jobsteps.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName") // alternatively `client.ListByVersion(ctx, id)` can be used to do batched pagination items, err := client.ListByVersionComplete(ctx, id) diff --git a/resource-manager/sql/2023-08-01-preview/jobsteps/id_version.go b/resource-manager/sql/2023-08-01-preview/jobsteps/id_version.go index 1f0aea50d69..a66cf6dfc0a 100644 --- a/resource-manager/sql/2023-08-01-preview/jobsteps/id_version.go +++ b/resource-manager/sql/2023-08-01-preview/jobsteps/id_version.go @@ -139,7 +139,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticJobs", "jobs", "jobs"), resourceids.UserSpecifiedSegment("jobName", "jobName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "jobVersion"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/jobsteps/id_version_test.go b/resource-manager/sql/2023-08-01-preview/jobsteps/id_version_test.go index 228c1e653a0..8a0387d811e 100644 --- a/resource-manager/sql/2023-08-01-preview/jobsteps/id_version_test.go +++ b/resource-manager/sql/2023-08-01-preview/jobsteps/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,14 +34,14 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } - if id.VersionName != "jobVersion" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "jobVersion") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -125,19 +125,19 @@ func TestParseVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", JobAgentName: "jobAgentName", JobName: "jobName", - VersionName: "jobVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/extra", Error: true, }, } @@ -326,36 +326,36 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", JobAgentName: "jobAgentName", JobName: "jobName", - VersionName: "jobVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/jObVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", JobAgentName: "jObAgEnTnAmE", JobName: "jObNaMe", - VersionName: "jObVeRsIoN", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/jObVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/jobsteps/id_versionstep.go b/resource-manager/sql/2023-08-01-preview/jobsteps/id_versionstep.go index 79344d4a5db..9391697e1af 100644 --- a/resource-manager/sql/2023-08-01-preview/jobsteps/id_versionstep.go +++ b/resource-manager/sql/2023-08-01-preview/jobsteps/id_versionstep.go @@ -145,7 +145,7 @@ func (id VersionStepId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticJobs", "jobs", "jobs"), resourceids.UserSpecifiedSegment("jobName", "jobName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "jobVersion"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), resourceids.StaticSegment("staticSteps", "steps", "steps"), resourceids.UserSpecifiedSegment("stepName", "stepName"), } diff --git a/resource-manager/sql/2023-08-01-preview/jobsteps/id_versionstep_test.go b/resource-manager/sql/2023-08-01-preview/jobsteps/id_versionstep_test.go index 7714ac661a3..d6438bf2d1b 100644 --- a/resource-manager/sql/2023-08-01-preview/jobsteps/id_versionstep_test.go +++ b/resource-manager/sql/2023-08-01-preview/jobsteps/id_versionstep_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionStepId{} func TestNewVersionStepID(t *testing.T) { - id := NewVersionStepID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion", "stepName") + id := NewVersionStepID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName", "stepName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,8 +34,8 @@ func TestNewVersionStepID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } - if id.VersionName != "jobVersion" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "jobVersion") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } if id.StepName != "stepName" { @@ -44,8 +44,8 @@ func TestNewVersionStepID(t *testing.T) { } func TestFormatVersionStepID(t *testing.T) { - actual := NewVersionStepID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion", "stepName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/steps/stepName" + actual := NewVersionStepID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName", "stepName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/steps/stepName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -129,30 +129,30 @@ func TestParseVersionStepID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/steps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/steps", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/steps/stepName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/steps/stepName", Expected: &VersionStepId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", JobAgentName: "jobAgentName", JobName: "jobName", - VersionName: "jobVersion", + VersionName: "versionName", StepName: "stepName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/steps/stepName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/steps/stepName/extra", Error: true, }, } @@ -345,58 +345,58 @@ func TestParseVersionStepIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/jObVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/vErSiOnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/steps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/steps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/jObVeRsIoN/sTePs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/vErSiOnNaMe/sTePs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/steps/stepName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/steps/stepName", Expected: &VersionStepId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", JobAgentName: "jobAgentName", JobName: "jobName", - VersionName: "jobVersion", + VersionName: "versionName", StepName: "stepName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/steps/stepName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/steps/stepName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/jObVeRsIoN/sTePs/sTePnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/vErSiOnNaMe/sTePs/sTePnAmE", Expected: &VersionStepId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", JobAgentName: "jObAgEnTnAmE", JobName: "jObNaMe", - VersionName: "jObVeRsIoN", + VersionName: "vErSiOnNaMe", StepName: "sTePnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/jObVeRsIoN/sTePs/sTePnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/vErSiOnNaMe/sTePs/sTePnAmE/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/jobversions/README.md b/resource-manager/sql/2023-08-01-preview/jobversions/README.md index e4cf608b599..489c560854a 100644 --- a/resource-manager/sql/2023-08-01-preview/jobversions/README.md +++ b/resource-manager/sql/2023-08-01-preview/jobversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := jobversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion") +id := jobversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/jobversions/id_version.go b/resource-manager/sql/2023-08-01-preview/jobversions/id_version.go index aaeb3f8ee1a..f7959fa39ea 100644 --- a/resource-manager/sql/2023-08-01-preview/jobversions/id_version.go +++ b/resource-manager/sql/2023-08-01-preview/jobversions/id_version.go @@ -139,7 +139,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticJobs", "jobs", "jobs"), resourceids.UserSpecifiedSegment("jobName", "jobName"), resourceids.StaticSegment("staticVersions", "versions", "versions"), - resourceids.UserSpecifiedSegment("versionName", "jobVersion"), + resourceids.UserSpecifiedSegment("versionName", "versionName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/jobversions/id_version_test.go b/resource-manager/sql/2023-08-01-preview/jobversions/id_version_test.go index 07d2fd82be3..269abce98da 100644 --- a/resource-manager/sql/2023-08-01-preview/jobversions/id_version_test.go +++ b/resource-manager/sql/2023-08-01-preview/jobversions/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,14 +34,14 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'JobName'", id.JobName, "jobName") } - if id.VersionName != "jobVersion" { - t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "jobVersion") + if id.VersionName != "versionName" { + t.Fatalf("Expected %q but got %q for Segment 'VersionName'", id.VersionName, "versionName") } } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "jobVersion").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "jobAgentName", "jobName", "versionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -125,19 +125,19 @@ func TestParseVersionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", JobAgentName: "jobAgentName", JobName: "jobName", - VersionName: "jobVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/extra", Error: true, }, } @@ -326,36 +326,36 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", JobAgentName: "jobAgentName", JobName: "jobName", - VersionName: "jobVersion", + VersionName: "versionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/jobVersion/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/jobAgents/jobAgentName/jobs/jobName/versions/versionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/jObVeRsIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/vErSiOnNaMe", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", JobAgentName: "jObAgEnTnAmE", JobName: "jObNaMe", - VersionName: "jObVeRsIoN", + VersionName: "vErSiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/jObVeRsIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/jObAgEnTs/jObAgEnTnAmE/jObS/jObNaMe/vErSiOnS/vErSiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/README.md b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/README.md index 1b5cab814e8..fc57993c78c 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/README.md +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") payload := longtermretentionbackups.ChangeLongTermRetentionBackupAccessTierParameters{ // ... @@ -41,7 +41,7 @@ if err := client.ChangeAccessTierThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") payload := longtermretentionbackups.ChangeLongTermRetentionBackupAccessTierParameters{ // ... @@ -58,7 +58,7 @@ if err := client.ChangeAccessTierByResourceGroupThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") payload := longtermretentionbackups.CopyLongTermRetentionBackupParameters{ // ... @@ -75,7 +75,7 @@ if err := client.CopyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") payload := longtermretentionbackups.CopyLongTermRetentionBackupParameters{ // ... @@ -92,7 +92,7 @@ if err := client.CopyByResourceGroupThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -104,7 +104,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") if err := client.DeleteByResourceGroupThenPoll(ctx, id); err != nil { // handle the error @@ -116,7 +116,7 @@ if err := client.DeleteByResourceGroupThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") read, err := client.Get(ctx, id) if err != nil { @@ -132,7 +132,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") read, err := client.GetByResourceGroup(ctx, id) if err != nil { @@ -250,7 +250,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") payload := longtermretentionbackups.UpdateLongTermRetentionBackupParameters{ // ... @@ -267,7 +267,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") +id := longtermretentionbackups.NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") payload := longtermretentionbackups.UpdateLongTermRetentionBackupParameters{ // ... diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentionbackup.go b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentionbackup.go index 0d9f289e1b1..1864404b59e 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentionbackup.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentionbackup.go @@ -131,7 +131,7 @@ func (id LongTermRetentionBackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLongTermRetentionDatabases", "longTermRetentionDatabases", "longTermRetentionDatabases"), resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "longTermRetentionDatabaseName"), resourceids.StaticSegment("staticLongTermRetentionBackups", "longTermRetentionBackups", "longTermRetentionBackups"), - resourceids.UserSpecifiedSegment("longTermRetentionBackupName", "backupName"), + resourceids.UserSpecifiedSegment("longTermRetentionBackupName", "longTermRetentionBackupName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentionbackup_test.go b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentionbackup_test.go index fc5f3116bdf..a3271e85484 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentionbackup_test.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentionbackup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LongTermRetentionBackupId{} func TestNewLongTermRetentionBackupID(t *testing.T) { - id := NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") + id := NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewLongTermRetentionBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "longTermRetentionDatabaseName") } - if id.LongTermRetentionBackupName != "backupName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionBackupName'", id.LongTermRetentionBackupName, "backupName") + if id.LongTermRetentionBackupName != "longTermRetentionBackupName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionBackupName'", id.LongTermRetentionBackupName, "longTermRetentionBackupName") } } func TestFormatLongTermRetentionBackupID(t *testing.T) { - actual := NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName" + actual := NewLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseLongTermRetentionBackupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName", Expected: &LongTermRetentionBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", LongTermRetentionServerName: "longTermRetentionServerName", LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", - LongTermRetentionBackupName: "backupName", + LongTermRetentionBackupName: "longTermRetentionBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName/extra", Error: true, }, } @@ -287,34 +287,34 @@ func TestParseLongTermRetentionBackupIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName", Expected: &LongTermRetentionBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", LongTermRetentionServerName: "longTermRetentionServerName", LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", - LongTermRetentionBackupName: "backupName", + LongTermRetentionBackupName: "longTermRetentionBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnSeRvErS/lOnGtErMrEtEnTiOnSeRvErNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnBaCkUpS/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnSeRvErS/lOnGtErMrEtEnTiOnSeRvErNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnBaCkUpS/lOnGtErMrEtEnTiOnBaCkUpNaMe", Expected: &LongTermRetentionBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "lOcAtIoNnAmE", LongTermRetentionServerName: "lOnGtErMrEtEnTiOnSeRvErNaMe", LongTermRetentionDatabaseName: "lOnGtErMrEtEnTiOnDaTaBaSeNaMe", - LongTermRetentionBackupName: "bAcKuPnAmE", + LongTermRetentionBackupName: "lOnGtErMrEtEnTiOnBaCkUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnSeRvErS/lOnGtErMrEtEnTiOnSeRvErNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnBaCkUpS/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnSeRvErS/lOnGtErMrEtEnTiOnSeRvErNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnBaCkUpS/lOnGtErMrEtEnTiOnBaCkUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentiondatabaselongtermretentionbackup.go b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentiondatabaselongtermretentionbackup.go index 4daee730de3..f8410275897 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentiondatabaselongtermretentionbackup.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentiondatabaselongtermretentionbackup.go @@ -139,7 +139,7 @@ func (id LongTermRetentionDatabaseLongTermRetentionBackupId) Segments() []resour resourceids.StaticSegment("staticLongTermRetentionDatabases", "longTermRetentionDatabases", "longTermRetentionDatabases"), resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "longTermRetentionDatabaseName"), resourceids.StaticSegment("staticLongTermRetentionBackups", "longTermRetentionBackups", "longTermRetentionBackups"), - resourceids.UserSpecifiedSegment("longTermRetentionBackupName", "backupName"), + resourceids.UserSpecifiedSegment("longTermRetentionBackupName", "longTermRetentionBackupName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentiondatabaselongtermretentionbackup_test.go b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentiondatabaselongtermretentionbackup_test.go index 72e70c08848..1966b8ffb88 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentiondatabaselongtermretentionbackup_test.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionbackups/id_longtermretentiondatabaselongtermretentionbackup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LongTermRetentionDatabaseLongTermRetentionBackupId{} func TestNewLongTermRetentionDatabaseLongTermRetentionBackupID(t *testing.T) { - id := NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName") + id := NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -34,14 +34,14 @@ func TestNewLongTermRetentionDatabaseLongTermRetentionBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "longTermRetentionDatabaseName") } - if id.LongTermRetentionBackupName != "backupName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionBackupName'", id.LongTermRetentionBackupName, "backupName") + if id.LongTermRetentionBackupName != "longTermRetentionBackupName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionBackupName'", id.LongTermRetentionBackupName, "longTermRetentionBackupName") } } func TestFormatLongTermRetentionDatabaseLongTermRetentionBackupID(t *testing.T) { - actual := NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName" + actual := NewLongTermRetentionDatabaseLongTermRetentionBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionServerName", "longTermRetentionDatabaseName", "longTermRetentionBackupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -125,19 +125,19 @@ func TestParseLongTermRetentionDatabaseLongTermRetentionBackupID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName", Expected: &LongTermRetentionDatabaseLongTermRetentionBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", LongTermRetentionServerName: "longTermRetentionServerName", LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", - LongTermRetentionBackupName: "backupName", + LongTermRetentionBackupName: "longTermRetentionBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName/extra", Error: true, }, } @@ -326,36 +326,36 @@ func TestParseLongTermRetentionDatabaseLongTermRetentionBackupIDInsensitively(t }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName", Expected: &LongTermRetentionDatabaseLongTermRetentionBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", LongTermRetentionServerName: "longTermRetentionServerName", LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", - LongTermRetentionBackupName: "backupName", + LongTermRetentionBackupName: "longTermRetentionBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionServers/longTermRetentionServerName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionBackups/longTermRetentionBackupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnSeRvErS/lOnGtErMrEtEnTiOnSeRvErNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnBaCkUpS/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnSeRvErS/lOnGtErMrEtEnTiOnSeRvErNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnBaCkUpS/lOnGtErMrEtEnTiOnBaCkUpNaMe", Expected: &LongTermRetentionDatabaseLongTermRetentionBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocationName: "lOcAtIoNnAmE", LongTermRetentionServerName: "lOnGtErMrEtEnTiOnSeRvErNaMe", LongTermRetentionDatabaseName: "lOnGtErMrEtEnTiOnDaTaBaSeNaMe", - LongTermRetentionBackupName: "bAcKuPnAmE", + LongTermRetentionBackupName: "lOnGtErMrEtEnTiOnBaCkUpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnSeRvErS/lOnGtErMrEtEnTiOnSeRvErNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnBaCkUpS/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnSeRvErS/lOnGtErMrEtEnTiOnSeRvErNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnBaCkUpS/lOnGtErMrEtEnTiOnBaCkUpNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/README.md b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/README.md index 3968443283b..fc20b0cd3c9 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/README.md +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := longtermretentionmanagedinstancebackups.NewLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName", "databaseName", "backupName") +id := longtermretentionmanagedinstancebackups.NewLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName", "longTermRetentionManagedInstanceBackupName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -36,7 +36,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := longtermretentionmanagedinstancebackups.NewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName", "databaseName", "backupName") +id := longtermretentionmanagedinstancebackups.NewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName", "longTermRetentionManagedInstanceBackupName") if err := client.DeleteByResourceGroupThenPoll(ctx, id); err != nil { // handle the error @@ -48,7 +48,7 @@ if err := client.DeleteByResourceGroupThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := longtermretentionmanagedinstancebackups.NewLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName", "databaseName", "backupName") +id := longtermretentionmanagedinstancebackups.NewLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName", "longTermRetentionManagedInstanceBackupName") read, err := client.Get(ctx, id) if err != nil { @@ -64,7 +64,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := longtermretentionmanagedinstancebackups.NewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName", "databaseName", "backupName") +id := longtermretentionmanagedinstancebackups.NewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName", "longTermRetentionManagedInstanceBackupName") read, err := client.GetByResourceGroup(ctx, id) if err != nil { @@ -80,7 +80,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := longtermretentionmanagedinstancebackups.NewLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName", "databaseName") +id := longtermretentionmanagedinstancebackups.NewLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName") // alternatively `client.ListByDatabase(ctx, id, longtermretentionmanagedinstancebackups.DefaultListByDatabaseOperationOptions())` can be used to do batched pagination items, err := client.ListByDatabaseComplete(ctx, id, longtermretentionmanagedinstancebackups.DefaultListByDatabaseOperationOptions()) @@ -97,7 +97,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := longtermretentionmanagedinstancebackups.NewLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName") +id := longtermretentionmanagedinstancebackups.NewLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName") // alternatively `client.ListByInstance(ctx, id, longtermretentionmanagedinstancebackups.DefaultListByInstanceOperationOptions())` can be used to do batched pagination items, err := client.ListByInstanceComplete(ctx, id, longtermretentionmanagedinstancebackups.DefaultListByInstanceOperationOptions()) @@ -131,7 +131,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := longtermretentionmanagedinstancebackups.NewLongTermRetentionManagedInstanceLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName", "databaseName") +id := longtermretentionmanagedinstancebackups.NewLongTermRetentionManagedInstanceLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName") // alternatively `client.ListByResourceGroupDatabase(ctx, id, longtermretentionmanagedinstancebackups.DefaultListByResourceGroupDatabaseOperationOptions())` can be used to do batched pagination items, err := client.ListByResourceGroupDatabaseComplete(ctx, id, longtermretentionmanagedinstancebackups.DefaultListByResourceGroupDatabaseOperationOptions()) @@ -148,7 +148,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := longtermretentionmanagedinstancebackups.NewLocationLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName") +id := longtermretentionmanagedinstancebackups.NewLocationLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName") // alternatively `client.ListByResourceGroupInstance(ctx, id, longtermretentionmanagedinstancebackups.DefaultListByResourceGroupInstanceOperationOptions())` can be used to do batched pagination items, err := client.ListByResourceGroupInstanceComplete(ctx, id, longtermretentionmanagedinstancebackups.DefaultListByResourceGroupInstanceOperationOptions()) diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_locationlongtermretentionmanagedinstance.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_locationlongtermretentionmanagedinstance.go index 7e5ea5bf2a7..805eb37ff92 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_locationlongtermretentionmanagedinstance.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_locationlongtermretentionmanagedinstance.go @@ -123,7 +123,7 @@ func (id LocationLongTermRetentionManagedInstanceId) Segments() []resourceids.Se resourceids.StaticSegment("staticLocations", "locations", "locations"), resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticLongTermRetentionManagedInstances", "longTermRetentionManagedInstances", "longTermRetentionManagedInstances"), - resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "managedInstanceName"), + resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "longTermRetentionManagedInstanceName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_locationlongtermretentionmanagedinstance_test.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_locationlongtermretentionmanagedinstance_test.go index 76f0a77ff18..5b4163e0669 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_locationlongtermretentionmanagedinstance_test.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_locationlongtermretentionmanagedinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocationLongTermRetentionManagedInstanceId{} func TestNewLocationLongTermRetentionManagedInstanceID(t *testing.T) { - id := NewLocationLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName") + id := NewLocationLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewLocationLongTermRetentionManagedInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.LongTermRetentionManagedInstanceName != "managedInstanceName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "managedInstanceName") + if id.LongTermRetentionManagedInstanceName != "longTermRetentionManagedInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "longTermRetentionManagedInstanceName") } } func TestFormatLocationLongTermRetentionManagedInstanceID(t *testing.T) { - actual := NewLocationLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName" + actual := NewLocationLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseLocationLongTermRetentionManagedInstanceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Expected: &LocationLongTermRetentionManagedInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseLocationLongTermRetentionManagedInstanceIDInsensitively(t *testing }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Expected: &LocationLongTermRetentionManagedInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", Expected: &LocationLongTermRetentionManagedInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocationName: "lOcAtIoNnAmE", - LongTermRetentionManagedInstanceName: "mAnAgEdInStAnCeNaMe", + LongTermRetentionManagedInstanceName: "lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabase.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabase.go index 24029368433..c7b7671f02e 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabase.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabase.go @@ -121,9 +121,9 @@ func (id LongTermRetentionDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocations", "locations", "locations"), resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticLongTermRetentionManagedInstances", "longTermRetentionManagedInstances", "longTermRetentionManagedInstances"), - resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "managedInstanceName"), + resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "longTermRetentionManagedInstanceName"), resourceids.StaticSegment("staticLongTermRetentionDatabases", "longTermRetentionDatabases", "longTermRetentionDatabases"), - resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "longTermRetentionDatabaseName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabase_test.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabase_test.go index 1c04ec23cdb..a5caeee809c 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabase_test.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LongTermRetentionDatabaseId{} func TestNewLongTermRetentionDatabaseID(t *testing.T) { - id := NewLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName", "databaseName") + id := NewLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewLongTermRetentionDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.LongTermRetentionManagedInstanceName != "managedInstanceName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "managedInstanceName") + if id.LongTermRetentionManagedInstanceName != "longTermRetentionManagedInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "longTermRetentionManagedInstanceName") } - if id.LongTermRetentionDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "databaseName") + if id.LongTermRetentionDatabaseName != "longTermRetentionDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "longTermRetentionDatabaseName") } } func TestFormatLongTermRetentionDatabaseID(t *testing.T) { - actual := NewLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName" + actual := NewLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLongTermRetentionDatabaseID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName", Expected: &LongTermRetentionDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", - LongTermRetentionDatabaseName: "databaseName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", + LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLongTermRetentionDatabaseIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName", Expected: &LongTermRetentionDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", - LongTermRetentionDatabaseName: "databaseName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", + LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe", Expected: &LongTermRetentionDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "lOcAtIoNnAmE", - LongTermRetentionManagedInstanceName: "mAnAgEdInStAnCeNaMe", - LongTermRetentionDatabaseName: "dAtAbAsEnAmE", + LongTermRetentionManagedInstanceName: "lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", + LongTermRetentionDatabaseName: "lOnGtErMrEtEnTiOnDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabaselongtermretentionmanagedinstancebackup.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabaselongtermretentionmanagedinstancebackup.go index 07d8c8797ca..58e7e784b09 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabaselongtermretentionmanagedinstancebackup.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabaselongtermretentionmanagedinstancebackup.go @@ -135,11 +135,11 @@ func (id LongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupId) Segm resourceids.StaticSegment("staticLocations", "locations", "locations"), resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticLongTermRetentionManagedInstances", "longTermRetentionManagedInstances", "longTermRetentionManagedInstances"), - resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "managedInstanceName"), + resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "longTermRetentionManagedInstanceName"), resourceids.StaticSegment("staticLongTermRetentionDatabases", "longTermRetentionDatabases", "longTermRetentionDatabases"), - resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "longTermRetentionDatabaseName"), resourceids.StaticSegment("staticLongTermRetentionManagedInstanceBackups", "longTermRetentionManagedInstanceBackups", "longTermRetentionManagedInstanceBackups"), - resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceBackupName", "backupName"), + resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceBackupName", "longTermRetentionManagedInstanceBackupName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabaselongtermretentionmanagedinstancebackup_test.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabaselongtermretentionmanagedinstancebackup_test.go index eb5402d752d..c0aadb986a4 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabaselongtermretentionmanagedinstancebackup_test.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentiondatabaselongtermretentionmanagedinstancebackup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupId{} func TestNewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID(t *testing.T) { - id := NewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName", "databaseName", "backupName") + id := NewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName", "longTermRetentionManagedInstanceBackupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,22 +26,22 @@ func TestNewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID(t t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.LongTermRetentionManagedInstanceName != "managedInstanceName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "managedInstanceName") + if id.LongTermRetentionManagedInstanceName != "longTermRetentionManagedInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "longTermRetentionManagedInstanceName") } - if id.LongTermRetentionDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "databaseName") + if id.LongTermRetentionDatabaseName != "longTermRetentionDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "longTermRetentionDatabaseName") } - if id.LongTermRetentionManagedInstanceBackupName != "backupName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceBackupName'", id.LongTermRetentionManagedInstanceBackupName, "backupName") + if id.LongTermRetentionManagedInstanceBackupName != "longTermRetentionManagedInstanceBackupName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceBackupName'", id.LongTermRetentionManagedInstanceBackupName, "longTermRetentionManagedInstanceBackupName") } } func TestFormatLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID(t *testing.T) { - actual := NewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName", "databaseName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName" + actual := NewLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName", "longTermRetentionManagedInstanceBackupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupID( }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName", Expected: &LongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", - LongTermRetentionDatabaseName: "databaseName", - LongTermRetentionManagedInstanceBackupName: "backupName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", + LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", + LongTermRetentionManagedInstanceBackupName: "longTermRetentionManagedInstanceBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseLongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupIDI }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName", Expected: &LongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", - LongTermRetentionDatabaseName: "databaseName", - LongTermRetentionManagedInstanceBackupName: "backupName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", + LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", + LongTermRetentionManagedInstanceBackupName: "longTermRetentionManagedInstanceBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPnAmE", Expected: &LongTermRetentionDatabaseLongTermRetentionManagedInstanceBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocationName: "lOcAtIoNnAmE", - LongTermRetentionManagedInstanceName: "mAnAgEdInStAnCeNaMe", - LongTermRetentionDatabaseName: "dAtAbAsEnAmE", - LongTermRetentionManagedInstanceBackupName: "bAcKuPnAmE", + LongTermRetentionManagedInstanceName: "lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", + LongTermRetentionDatabaseName: "lOnGtErMrEtEnTiOnDaTaBaSeNaMe", + LongTermRetentionManagedInstanceBackupName: "lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstance.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstance.go index b2b62ccab61..740b763d4d3 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstance.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstance.go @@ -115,7 +115,7 @@ func (id LongTermRetentionManagedInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticLocations", "locations", "locations"), resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticLongTermRetentionManagedInstances", "longTermRetentionManagedInstances", "longTermRetentionManagedInstances"), - resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "managedInstanceName"), + resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "longTermRetentionManagedInstanceName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstance_test.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstance_test.go index 2590c3fd7ea..ff6564e842e 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstance_test.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LongTermRetentionManagedInstanceId{} func TestNewLongTermRetentionManagedInstanceID(t *testing.T) { - id := NewLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName") + id := NewLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewLongTermRetentionManagedInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.LongTermRetentionManagedInstanceName != "managedInstanceName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "managedInstanceName") + if id.LongTermRetentionManagedInstanceName != "longTermRetentionManagedInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "longTermRetentionManagedInstanceName") } } func TestFormatLongTermRetentionManagedInstanceID(t *testing.T) { - actual := NewLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName" + actual := NewLongTermRetentionManagedInstanceID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseLongTermRetentionManagedInstanceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Expected: &LongTermRetentionManagedInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseLongTermRetentionManagedInstanceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Expected: &LongTermRetentionManagedInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", Expected: &LongTermRetentionManagedInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "lOcAtIoNnAmE", - LongTermRetentionManagedInstanceName: "mAnAgEdInStAnCeNaMe", + LongTermRetentionManagedInstanceName: "lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancebackup.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancebackup.go index 8ab33f839bc..3b3d731c1a7 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancebackup.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancebackup.go @@ -127,11 +127,11 @@ func (id LongTermRetentionManagedInstanceBackupId) Segments() []resourceids.Segm resourceids.StaticSegment("staticLocations", "locations", "locations"), resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticLongTermRetentionManagedInstances", "longTermRetentionManagedInstances", "longTermRetentionManagedInstances"), - resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "managedInstanceName"), + resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "longTermRetentionManagedInstanceName"), resourceids.StaticSegment("staticLongTermRetentionDatabases", "longTermRetentionDatabases", "longTermRetentionDatabases"), - resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "longTermRetentionDatabaseName"), resourceids.StaticSegment("staticLongTermRetentionManagedInstanceBackups", "longTermRetentionManagedInstanceBackups", "longTermRetentionManagedInstanceBackups"), - resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceBackupName", "backupName"), + resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceBackupName", "longTermRetentionManagedInstanceBackupName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancebackup_test.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancebackup_test.go index 3cbdfcfd88c..36426a0f2f3 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancebackup_test.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancebackup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LongTermRetentionManagedInstanceBackupId{} func TestNewLongTermRetentionManagedInstanceBackupID(t *testing.T) { - id := NewLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName", "databaseName", "backupName") + id := NewLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName", "longTermRetentionManagedInstanceBackupName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewLongTermRetentionManagedInstanceBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.LongTermRetentionManagedInstanceName != "managedInstanceName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "managedInstanceName") + if id.LongTermRetentionManagedInstanceName != "longTermRetentionManagedInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "longTermRetentionManagedInstanceName") } - if id.LongTermRetentionDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "databaseName") + if id.LongTermRetentionDatabaseName != "longTermRetentionDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "longTermRetentionDatabaseName") } - if id.LongTermRetentionManagedInstanceBackupName != "backupName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceBackupName'", id.LongTermRetentionManagedInstanceBackupName, "backupName") + if id.LongTermRetentionManagedInstanceBackupName != "longTermRetentionManagedInstanceBackupName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceBackupName'", id.LongTermRetentionManagedInstanceBackupName, "longTermRetentionManagedInstanceBackupName") } } func TestFormatLongTermRetentionManagedInstanceBackupID(t *testing.T) { - actual := NewLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "locationName", "managedInstanceName", "databaseName", "backupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName" + actual := NewLongTermRetentionManagedInstanceBackupID("12345678-1234-9876-4563-123456789012", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName", "longTermRetentionManagedInstanceBackupName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseLongTermRetentionManagedInstanceBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName", Expected: &LongTermRetentionManagedInstanceBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", - LongTermRetentionDatabaseName: "databaseName", - LongTermRetentionManagedInstanceBackupName: "backupName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", + LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", + LongTermRetentionManagedInstanceBackupName: "longTermRetentionManagedInstanceBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseLongTermRetentionManagedInstanceBackupIDInsensitively(t *testing.T }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName", Expected: &LongTermRetentionManagedInstanceBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", - LongTermRetentionDatabaseName: "databaseName", - LongTermRetentionManagedInstanceBackupName: "backupName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", + LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", + LongTermRetentionManagedInstanceBackupName: "longTermRetentionManagedInstanceBackupName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/longTermRetentionManagedInstanceBackups/backupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/longTermRetentionManagedInstanceBackups/longTermRetentionManagedInstanceBackupName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs/bAcKuPnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPnAmE", Expected: &LongTermRetentionManagedInstanceBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", LocationName: "lOcAtIoNnAmE", - LongTermRetentionManagedInstanceName: "mAnAgEdInStAnCeNaMe", - LongTermRetentionDatabaseName: "dAtAbAsEnAmE", - LongTermRetentionManagedInstanceBackupName: "bAcKuPnAmE", + LongTermRetentionManagedInstanceName: "lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", + LongTermRetentionDatabaseName: "lOnGtErMrEtEnTiOnDaTaBaSeNaMe", + LongTermRetentionManagedInstanceBackupName: "lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs/bAcKuPnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEbAcKuPnAmE/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancelongtermretentiondatabase.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancelongtermretentiondatabase.go index 1695aa5462e..ad834089454 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancelongtermretentiondatabase.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancelongtermretentiondatabase.go @@ -129,9 +129,9 @@ func (id LongTermRetentionManagedInstanceLongTermRetentionDatabaseId) Segments() resourceids.StaticSegment("staticLocations", "locations", "locations"), resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticLongTermRetentionManagedInstances", "longTermRetentionManagedInstances", "longTermRetentionManagedInstances"), - resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "managedInstanceName"), + resourceids.UserSpecifiedSegment("longTermRetentionManagedInstanceName", "longTermRetentionManagedInstanceName"), resourceids.StaticSegment("staticLongTermRetentionDatabases", "longTermRetentionDatabases", "longTermRetentionDatabases"), - resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("longTermRetentionDatabaseName", "longTermRetentionDatabaseName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancelongtermretentiondatabase_test.go b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancelongtermretentiondatabase_test.go index 652d7cfff24..8a82b5f12e2 100644 --- a/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancelongtermretentiondatabase_test.go +++ b/resource-manager/sql/2023-08-01-preview/longtermretentionmanagedinstancebackups/id_longtermretentionmanagedinstancelongtermretentiondatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LongTermRetentionManagedInstanceLongTermRetentionDatabaseId{} func TestNewLongTermRetentionManagedInstanceLongTermRetentionDatabaseID(t *testing.T) { - id := NewLongTermRetentionManagedInstanceLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName", "databaseName") + id := NewLongTermRetentionManagedInstanceLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewLongTermRetentionManagedInstanceLongTermRetentionDatabaseID(t *testi t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.LongTermRetentionManagedInstanceName != "managedInstanceName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "managedInstanceName") + if id.LongTermRetentionManagedInstanceName != "longTermRetentionManagedInstanceName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionManagedInstanceName'", id.LongTermRetentionManagedInstanceName, "longTermRetentionManagedInstanceName") } - if id.LongTermRetentionDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "databaseName") + if id.LongTermRetentionDatabaseName != "longTermRetentionDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'LongTermRetentionDatabaseName'", id.LongTermRetentionDatabaseName, "longTermRetentionDatabaseName") } } func TestFormatLongTermRetentionManagedInstanceLongTermRetentionDatabaseID(t *testing.T) { - actual := NewLongTermRetentionManagedInstanceLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "managedInstanceName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName" + actual := NewLongTermRetentionManagedInstanceLongTermRetentionDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "longTermRetentionManagedInstanceName", "longTermRetentionDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseLongTermRetentionManagedInstanceLongTermRetentionDatabaseID(t *tes }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName", Expected: &LongTermRetentionManagedInstanceLongTermRetentionDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", - LongTermRetentionDatabaseName: "databaseName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", + LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseLongTermRetentionManagedInstanceLongTermRetentionDatabaseIDInsensi }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName", Expected: &LongTermRetentionManagedInstanceLongTermRetentionDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", LocationName: "locationName", - LongTermRetentionManagedInstanceName: "managedInstanceName", - LongTermRetentionDatabaseName: "databaseName", + LongTermRetentionManagedInstanceName: "longTermRetentionManagedInstanceName", + LongTermRetentionDatabaseName: "longTermRetentionDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/managedInstanceName/longTermRetentionDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/locations/locationName/longTermRetentionManagedInstances/longTermRetentionManagedInstanceName/longTermRetentionDatabases/longTermRetentionDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe", Expected: &LongTermRetentionManagedInstanceLongTermRetentionDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", LocationName: "lOcAtIoNnAmE", - LongTermRetentionManagedInstanceName: "mAnAgEdInStAnCeNaMe", - LongTermRetentionDatabaseName: "dAtAbAsEnAmE", + LongTermRetentionManagedInstanceName: "lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE", + LongTermRetentionDatabaseName: "lOnGtErMrEtEnTiOnDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/mAnAgEdInStAnCeNaMe/lOnGtErMrEtEnTiOnDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/lOcAtIoNs/lOcAtIoNnAmE/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEs/lOnGtErMrEtEnTiOnMaNaGeDiNsTaNcEnAmE/lOnGtErMrEtEnTiOnDaTaBaSeS/lOnGtErMrEtEnTiOnDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/README.md b/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/README.md index 28c75a705aa..ff864ff0f8d 100644 --- a/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/README.md +++ b/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedinstanceprivatelinkresources.NewManagedInstancePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "groupName") +id := managedinstanceprivatelinkresources.NewManagedInstancePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/id_managedinstanceprivatelinkresource.go b/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/id_managedinstanceprivatelinkresource.go index e51a710535f..b901a21e3b5 100644 --- a/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/id_managedinstanceprivatelinkresource.go +++ b/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/id_managedinstanceprivatelinkresource.go @@ -123,7 +123,7 @@ func (id ManagedInstancePrivateLinkResourceId) Segments() []resourceids.Segment resourceids.StaticSegment("staticManagedInstances", "managedInstances", "managedInstances"), resourceids.UserSpecifiedSegment("managedInstanceName", "managedInstanceName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/id_managedinstanceprivatelinkresource_test.go b/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/id_managedinstanceprivatelinkresource_test.go index 66299b2dd2d..5ef154ab568 100644 --- a/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/id_managedinstanceprivatelinkresource_test.go +++ b/resource-manager/sql/2023-08-01-preview/managedinstanceprivatelinkresources/id_managedinstanceprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagedInstancePrivateLinkResourceId{} func TestNewManagedInstancePrivateLinkResourceID(t *testing.T) { - id := NewManagedInstancePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "groupName") + id := NewManagedInstancePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewManagedInstancePrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ManagedInstanceName'", id.ManagedInstanceName, "managedInstanceName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatManagedInstancePrivateLinkResourceID(t *testing.T) { - actual := NewManagedInstancePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/groupName" + actual := NewManagedInstancePrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseManagedInstancePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/privateLinkResourceName", Expected: &ManagedInstancePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ManagedInstanceName: "managedInstanceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseManagedInstancePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/privateLinkResourceName", Expected: &ManagedInstancePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ManagedInstanceName: "managedInstanceName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &ManagedInstancePrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ManagedInstanceName: "mAnAgEdInStAnCeNaMe", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/README.md b/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/README.md index 19bd5bcc2db..d27106af4e4 100644 --- a/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/README.md +++ b/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := networksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "nspConfigName") +id := networksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "networkSecurityPerimeterConfigurationName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := networksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "nspConfigName") +id := networksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "networkSecurityPerimeterConfigurationName") if err := client.ReconcileThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go b/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go index 052e01f02cc..5ca3f6e6c25 100644 --- a/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go +++ b/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go @@ -123,7 +123,7 @@ func (id NetworkSecurityPerimeterConfigurationId) Segments() []resourceids.Segme resourceids.StaticSegment("staticServers", "servers", "servers"), resourceids.UserSpecifiedSegment("serverName", "serverName"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), - resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "nspConfigName"), + resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go b/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go index 1350025b409..f3bcc888cdb 100644 --- a/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go +++ b/resource-manager/sql/2023-08-01-preview/networksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkSecurityPerimeterConfigurationId{} func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "nspConfigName") + id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "networkSecurityPerimeterConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServerName'", id.ServerName, "serverName") } - if id.NetworkSecurityPerimeterConfigurationName != "nspConfigName" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "nspConfigName") + if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityPerimeterConfigurationName'", id.NetworkSecurityPerimeterConfigurationName, "networkSecurityPerimeterConfigurationName") } } func TestFormatNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "nspConfigName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/nspConfigName" + actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/nspConfigName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - NetworkSecurityPerimeterConfigurationName: "nspConfigName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/nspConfigName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseNetworkSecurityPerimeterConfigurationIDInsensitively(t *testing.T) }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/nspConfigName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - NetworkSecurityPerimeterConfigurationName: "nspConfigName", + NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/nspConfigName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nSpCoNfIgNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", - NetworkSecurityPerimeterConfigurationName: "nSpCoNfIgNaMe", + NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nSpCoNfIgNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/README.md b/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/README.md index 86d75be6d4a..7bfc53537f7 100644 --- a/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/README.md +++ b/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := outboundfirewallrules.NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundRuleFqdn") +id := outboundfirewallrules.NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundFirewallRuleName") if err := client.CreateOrUpdateThenPoll(ctx, id); err != nil { // handle the error @@ -37,7 +37,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := outboundfirewallrules.NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundRuleFqdn") +id := outboundfirewallrules.NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundFirewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -49,7 +49,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := outboundfirewallrules.NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundRuleFqdn") +id := outboundfirewallrules.NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundFirewallRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/id_outboundfirewallrule.go b/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/id_outboundfirewallrule.go index bbf9a735979..aab0c4f9ed0 100644 --- a/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/id_outboundfirewallrule.go +++ b/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/id_outboundfirewallrule.go @@ -123,7 +123,7 @@ func (id OutboundFirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticServers", "servers", "servers"), resourceids.UserSpecifiedSegment("serverName", "serverName"), resourceids.StaticSegment("staticOutboundFirewallRules", "outboundFirewallRules", "outboundFirewallRules"), - resourceids.UserSpecifiedSegment("outboundFirewallRuleName", "outboundRuleFqdn"), + resourceids.UserSpecifiedSegment("outboundFirewallRuleName", "outboundFirewallRuleName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/id_outboundfirewallrule_test.go b/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/id_outboundfirewallrule_test.go index aa94c945671..dd62ec95a8a 100644 --- a/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/id_outboundfirewallrule_test.go +++ b/resource-manager/sql/2023-08-01-preview/outboundfirewallrules/id_outboundfirewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OutboundFirewallRuleId{} func TestNewOutboundFirewallRuleID(t *testing.T) { - id := NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundRuleFqdn") + id := NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundFirewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewOutboundFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServerName'", id.ServerName, "serverName") } - if id.OutboundFirewallRuleName != "outboundRuleFqdn" { - t.Fatalf("Expected %q but got %q for Segment 'OutboundFirewallRuleName'", id.OutboundFirewallRuleName, "outboundRuleFqdn") + if id.OutboundFirewallRuleName != "outboundFirewallRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'OutboundFirewallRuleName'", id.OutboundFirewallRuleName, "outboundFirewallRuleName") } } func TestFormatOutboundFirewallRuleID(t *testing.T) { - actual := NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundRuleFqdn").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundRuleFqdn" + actual := NewOutboundFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "outboundFirewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundFirewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseOutboundFirewallRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundRuleFqdn", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundFirewallRuleName", Expected: &OutboundFirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - OutboundFirewallRuleName: "outboundRuleFqdn", + OutboundFirewallRuleName: "outboundFirewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundRuleFqdn/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundFirewallRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseOutboundFirewallRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundRuleFqdn", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundFirewallRuleName", Expected: &OutboundFirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - OutboundFirewallRuleName: "outboundRuleFqdn", + OutboundFirewallRuleName: "outboundFirewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundRuleFqdn/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/outboundFirewallRules/outboundFirewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/oUtBoUnDfIrEwAlLrUlEs/oUtBoUnDrUlEfQdN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/oUtBoUnDfIrEwAlLrUlEs/oUtBoUnDfIrEwAlLrUlEnAmE", Expected: &OutboundFirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", - OutboundFirewallRuleName: "oUtBoUnDrUlEfQdN", + OutboundFirewallRuleName: "oUtBoUnDfIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/oUtBoUnDfIrEwAlLrUlEs/oUtBoUnDrUlEfQdN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/oUtBoUnDfIrEwAlLrUlEs/oUtBoUnDfIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/privatelinkresources/README.md b/resource-manager/sql/2023-08-01-preview/privatelinkresources/README.md index d7ef096cef0..823e42e658e 100644 --- a/resource-manager/sql/2023-08-01-preview/privatelinkresources/README.md +++ b/resource-manager/sql/2023-08-01-preview/privatelinkresources/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName") +id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateLinkResourceName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/privatelinkresources/id_privatelinkresource.go b/resource-manager/sql/2023-08-01-preview/privatelinkresources/id_privatelinkresource.go index 1dd2a3c6911..5e1cd1e6bfe 100644 --- a/resource-manager/sql/2023-08-01-preview/privatelinkresources/id_privatelinkresource.go +++ b/resource-manager/sql/2023-08-01-preview/privatelinkresources/id_privatelinkresource.go @@ -123,7 +123,7 @@ func (id PrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticServers", "servers", "servers"), resourceids.UserSpecifiedSegment("serverName", "serverName"), resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "groupName"), + resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/sql/2023-08-01-preview/privatelinkresources/id_privatelinkresource_test.go index fe7588ef736..b73a6040dd2 100644 --- a/resource-manager/sql/2023-08-01-preview/privatelinkresources/id_privatelinkresource_test.go +++ b/resource-manager/sql/2023-08-01-preview/privatelinkresources/id_privatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateLinkResourceId{} func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName") + id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServerName'", id.ServerName, "serverName") } - if id.PrivateLinkResourceName != "groupName" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "groupName") + if id.PrivateLinkResourceName != "privateLinkResourceName" { + t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceName") } } func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "groupName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/groupName" + actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "privateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/privateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParsePrivateLinkResourceID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/groupName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/privateLinkResourceName", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - PrivateLinkResourceName: "groupName", + PrivateLinkResourceName: "privateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/groupName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/privateLinkResources/privateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe", Expected: &PrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", - PrivateLinkResourceName: "gRoUpNaMe", + PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/gRoUpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/recoverabledatabases/README.md b/resource-manager/sql/2023-08-01-preview/recoverabledatabases/README.md index 42b02fd6f5d..3c3497a661a 100644 --- a/resource-manager/sql/2023-08-01-preview/recoverabledatabases/README.md +++ b/resource-manager/sql/2023-08-01-preview/recoverabledatabases/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverabledatabases.NewRecoverableDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") +id := recoverabledatabases.NewRecoverableDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "recoverableDatabaseName") read, err := client.Get(ctx, id, recoverabledatabases.DefaultGetOperationOptions()) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/recoverabledatabases/id_recoverabledatabase.go b/resource-manager/sql/2023-08-01-preview/recoverabledatabases/id_recoverabledatabase.go index b5c12902dfe..2f0603bf9d2 100644 --- a/resource-manager/sql/2023-08-01-preview/recoverabledatabases/id_recoverabledatabase.go +++ b/resource-manager/sql/2023-08-01-preview/recoverabledatabases/id_recoverabledatabase.go @@ -123,7 +123,7 @@ func (id RecoverableDatabaseId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticServers", "servers", "servers"), resourceids.UserSpecifiedSegment("serverName", "serverName"), resourceids.StaticSegment("staticRecoverableDatabases", "recoverableDatabases", "recoverableDatabases"), - resourceids.UserSpecifiedSegment("recoverableDatabaseName", "databaseName"), + resourceids.UserSpecifiedSegment("recoverableDatabaseName", "recoverableDatabaseName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/recoverabledatabases/id_recoverabledatabase_test.go b/resource-manager/sql/2023-08-01-preview/recoverabledatabases/id_recoverabledatabase_test.go index 74106eb4b62..6ee7539663f 100644 --- a/resource-manager/sql/2023-08-01-preview/recoverabledatabases/id_recoverabledatabase_test.go +++ b/resource-manager/sql/2023-08-01-preview/recoverabledatabases/id_recoverabledatabase_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoverableDatabaseId{} func TestNewRecoverableDatabaseID(t *testing.T) { - id := NewRecoverableDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName") + id := NewRecoverableDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "recoverableDatabaseName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRecoverableDatabaseID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ServerName'", id.ServerName, "serverName") } - if id.RecoverableDatabaseName != "databaseName" { - t.Fatalf("Expected %q but got %q for Segment 'RecoverableDatabaseName'", id.RecoverableDatabaseName, "databaseName") + if id.RecoverableDatabaseName != "recoverableDatabaseName" { + t.Fatalf("Expected %q but got %q for Segment 'RecoverableDatabaseName'", id.RecoverableDatabaseName, "recoverableDatabaseName") } } func TestFormatRecoverableDatabaseID(t *testing.T) { - actual := NewRecoverableDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "databaseName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/databaseName" + actual := NewRecoverableDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverName", "recoverableDatabaseName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/recoverableDatabaseName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRecoverableDatabaseID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/recoverableDatabaseName", Expected: &RecoverableDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - RecoverableDatabaseName: "databaseName", + RecoverableDatabaseName: "recoverableDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/recoverableDatabaseName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRecoverableDatabaseIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/databaseName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/recoverableDatabaseName", Expected: &RecoverableDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ServerName: "serverName", - RecoverableDatabaseName: "databaseName", + RecoverableDatabaseName: "recoverableDatabaseName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/databaseName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/servers/serverName/recoverableDatabases/recoverableDatabaseName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/rEcOvErAbLeDaTaBaSeS/dAtAbAsEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/rEcOvErAbLeDaTaBaSeS/rEcOvErAbLeDaTaBaSeNaMe", Expected: &RecoverableDatabaseId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ServerName: "sErVeRnAmE", - RecoverableDatabaseName: "dAtAbAsEnAmE", + RecoverableDatabaseName: "rEcOvErAbLeDaTaBaSeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/rEcOvErAbLeDaTaBaSeS/dAtAbAsEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/sErVeRs/sErVeRnAmE/rEcOvErAbLeDaTaBaSeS/rEcOvErAbLeDaTaBaSeNaMe/extra", Error: true, }, } diff --git a/resource-manager/sql/2023-08-01-preview/servertrustcertificates/README.md b/resource-manager/sql/2023-08-01-preview/servertrustcertificates/README.md index abaa8cead35..b51209fb280 100644 --- a/resource-manager/sql/2023-08-01-preview/servertrustcertificates/README.md +++ b/resource-manager/sql/2023-08-01-preview/servertrustcertificates/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := servertrustcertificates.NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "certificateName") +id := servertrustcertificates.NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "serverTrustCertificateName") payload := servertrustcertificates.ServerTrustCertificate{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := servertrustcertificates.NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "certificateName") +id := servertrustcertificates.NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "serverTrustCertificateName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := servertrustcertificates.NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "certificateName") +id := servertrustcertificates.NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "serverTrustCertificateName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/sql/2023-08-01-preview/servertrustcertificates/id_servertrustcertificate.go b/resource-manager/sql/2023-08-01-preview/servertrustcertificates/id_servertrustcertificate.go index a232af64a91..d9cd22edd26 100644 --- a/resource-manager/sql/2023-08-01-preview/servertrustcertificates/id_servertrustcertificate.go +++ b/resource-manager/sql/2023-08-01-preview/servertrustcertificates/id_servertrustcertificate.go @@ -123,7 +123,7 @@ func (id ServerTrustCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticManagedInstances", "managedInstances", "managedInstances"), resourceids.UserSpecifiedSegment("managedInstanceName", "managedInstanceName"), resourceids.StaticSegment("staticServerTrustCertificates", "serverTrustCertificates", "serverTrustCertificates"), - resourceids.UserSpecifiedSegment("serverTrustCertificateName", "certificateName"), + resourceids.UserSpecifiedSegment("serverTrustCertificateName", "serverTrustCertificateName"), } } diff --git a/resource-manager/sql/2023-08-01-preview/servertrustcertificates/id_servertrustcertificate_test.go b/resource-manager/sql/2023-08-01-preview/servertrustcertificates/id_servertrustcertificate_test.go index 6641e935360..d74b6b91dba 100644 --- a/resource-manager/sql/2023-08-01-preview/servertrustcertificates/id_servertrustcertificate_test.go +++ b/resource-manager/sql/2023-08-01-preview/servertrustcertificates/id_servertrustcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerTrustCertificateId{} func TestNewServerTrustCertificateID(t *testing.T) { - id := NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "certificateName") + id := NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "serverTrustCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewServerTrustCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ManagedInstanceName'", id.ManagedInstanceName, "managedInstanceName") } - if id.ServerTrustCertificateName != "certificateName" { - t.Fatalf("Expected %q but got %q for Segment 'ServerTrustCertificateName'", id.ServerTrustCertificateName, "certificateName") + if id.ServerTrustCertificateName != "serverTrustCertificateName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerTrustCertificateName'", id.ServerTrustCertificateName, "serverTrustCertificateName") } } func TestFormatServerTrustCertificateID(t *testing.T) { - actual := NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/certificateName" + actual := NewServerTrustCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedInstanceName", "serverTrustCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/serverTrustCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseServerTrustCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/serverTrustCertificateName", Expected: &ServerTrustCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ManagedInstanceName: "managedInstanceName", - ServerTrustCertificateName: "certificateName", + ServerTrustCertificateName: "serverTrustCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/serverTrustCertificateName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseServerTrustCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/serverTrustCertificateName", Expected: &ServerTrustCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ManagedInstanceName: "managedInstanceName", - ServerTrustCertificateName: "certificateName", + ServerTrustCertificateName: "serverTrustCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Sql/managedInstances/managedInstanceName/serverTrustCertificates/serverTrustCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/sErVeRtRuStCeRtIfIcAtEs/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/sErVeRtRuStCeRtIfIcAtEs/sErVeRtRuStCeRtIfIcAtEnAmE", Expected: &ServerTrustCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ManagedInstanceName: "mAnAgEdInStAnCeNaMe", - ServerTrustCertificateName: "cErTiFiCaTeNaMe", + ServerTrustCertificateName: "sErVeRtRuStCeRtIfIcAtEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/sErVeRtRuStCeRtIfIcAtEs/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sQl/mAnAgEdInStAnCeS/mAnAgEdInStAnCeNaMe/sErVeRtRuStCeRtIfIcAtEs/sErVeRtRuStCeRtIfIcAtEnAmE/extra", Error: true, }, } diff --git a/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachinegroups/model_wsfcdomainprofile.go b/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachinegroups/model_wsfcdomainprofile.go index bc07f543659..e9257a037c8 100644 --- a/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachinegroups/model_wsfcdomainprofile.go +++ b/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachinegroups/model_wsfcdomainprofile.go @@ -13,5 +13,5 @@ type WsfcDomainProfile struct { OuPath *string `json:"ouPath,omitempty"` SqlServiceAccount *string `json:"sqlServiceAccount,omitempty"` StorageAccountPrimaryKey *string `json:"storageAccountPrimaryKey,omitempty"` - StorageAccountUrl *string `json:"storageAccountUrl,omitempty"` + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` } diff --git a/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachines/model_autobackupsettings.go b/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachines/model_autobackupsettings.go index 250c4f55347..96ab1ba1526 100644 --- a/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachines/model_autobackupsettings.go +++ b/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachines/model_autobackupsettings.go @@ -16,6 +16,6 @@ type AutoBackupSettings struct { Password *string `json:"password,omitempty"` RetentionPeriod *int64 `json:"retentionPeriod,omitempty"` StorageAccessKey *string `json:"storageAccessKey,omitempty"` - StorageAccountUrl *string `json:"storageAccountUrl,omitempty"` + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` StorageContainerName *string `json:"storageContainerName,omitempty"` } diff --git a/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachines/model_keyvaultcredentialsettings.go b/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachines/model_keyvaultcredentialsettings.go index e5407cb7381..0ad5527e07d 100644 --- a/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachines/model_keyvaultcredentialsettings.go +++ b/resource-manager/sqlvirtualmachine/2023-10-01/sqlvirtualmachines/model_keyvaultcredentialsettings.go @@ -4,7 +4,7 @@ package sqlvirtualmachines // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultCredentialSettings struct { - AzureKeyVaultUrl *string `json:"azureKeyVaultUrl,omitempty"` + AzureKeyVaultURL *string `json:"azureKeyVaultUrl,omitempty"` CredentialName *string `json:"credentialName,omitempty"` Enable *bool `json:"enable,omitempty"` ServicePrincipalName *string `json:"servicePrincipalName,omitempty"` diff --git a/resource-manager/storage/2023-01-01/deletedaccounts/README.md b/resource-manager/storage/2023-01-01/deletedaccounts/README.md index b1e95e05eca..558e51d22a0 100644 --- a/resource-manager/storage/2023-01-01/deletedaccounts/README.md +++ b/resource-manager/storage/2023-01-01/deletedaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "deletedAccountName") +id := deletedaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "deletedAccountName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/storage/2023-01-01/deletedaccounts/id_deletedaccount.go b/resource-manager/storage/2023-01-01/deletedaccounts/id_deletedaccount.go index e2e845c203b..89afa1cfa39 100644 --- a/resource-manager/storage/2023-01-01/deletedaccounts/id_deletedaccount.go +++ b/resource-manager/storage/2023-01-01/deletedaccounts/id_deletedaccount.go @@ -113,7 +113,7 @@ func (id DeletedAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedAccounts", "deletedAccounts", "deletedAccounts"), resourceids.UserSpecifiedSegment("deletedAccountName", "deletedAccountName"), } diff --git a/resource-manager/storage/2023-01-01/deletedaccounts/id_deletedaccount_test.go b/resource-manager/storage/2023-01-01/deletedaccounts/id_deletedaccount_test.go index a615f3ab69d..0e4273a583d 100644 --- a/resource-manager/storage/2023-01-01/deletedaccounts/id_deletedaccount_test.go +++ b/resource-manager/storage/2023-01-01/deletedaccounts/id_deletedaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &DeletedAccountId{} func TestNewDeletedAccountID(t *testing.T) { - id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "deletedAccountName") + id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "deletedAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.DeletedAccountName != "deletedAccountName" { @@ -28,8 +28,8 @@ func TestNewDeletedAccountID(t *testing.T) { } func TestFormatDeletedAccountID(t *testing.T) { - actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "deletedAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName" + actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "deletedAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoN/dElEtEdAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoN/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", DeletedAccountName: "dElEtEdAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoN/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-01-01/encryptionscopes/README.md b/resource-manager/storage/2023-01-01/encryptionscopes/README.md index 5ea54ee3807..cca0f01c89b 100644 --- a/resource-manager/storage/2023-01-01/encryptionscopes/README.md +++ b/resource-manager/storage/2023-01-01/encryptionscopes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName") +id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName") +id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName") payload := encryptionscopes.EncryptionScope{ // ... @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName") +id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName") payload := encryptionscopes.EncryptionScope{ // ... diff --git a/resource-manager/storage/2023-01-01/encryptionscopes/id_encryptionscope.go b/resource-manager/storage/2023-01-01/encryptionscopes/id_encryptionscope.go index 89c250e57ba..13bf7630372 100644 --- a/resource-manager/storage/2023-01-01/encryptionscopes/id_encryptionscope.go +++ b/resource-manager/storage/2023-01-01/encryptionscopes/id_encryptionscope.go @@ -121,7 +121,7 @@ func (id EncryptionScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticEncryptionScopes", "encryptionScopes", "encryptionScopes"), resourceids.UserSpecifiedSegment("encryptionScopeName", "encryptionScopeName"), } diff --git a/resource-manager/storage/2023-01-01/encryptionscopes/id_encryptionscope_test.go b/resource-manager/storage/2023-01-01/encryptionscopes/id_encryptionscope_test.go index 08e60c0ae79..41cb75d5f46 100644 --- a/resource-manager/storage/2023-01-01/encryptionscopes/id_encryptionscope_test.go +++ b/resource-manager/storage/2023-01-01/encryptionscopes/id_encryptionscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EncryptionScopeId{} func TestNewEncryptionScopeID(t *testing.T) { - id := NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName") + id := NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewEncryptionScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.EncryptionScopeName != "encryptionScopeName" { @@ -32,8 +32,8 @@ func TestNewEncryptionScopeID(t *testing.T) { } func TestFormatEncryptionScopeID(t *testing.T) { - actual := NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName" + actual := NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseEncryptionScopeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName", Expected: &EncryptionScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", EncryptionScopeName: "encryptionScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseEncryptionScopeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/eNcRyPtIoNsCoPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/eNcRyPtIoNsCoPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName", Expected: &EncryptionScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", EncryptionScopeName: "encryptionScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/eNcRyPtIoNsCoPeS/eNcRyPtIoNsCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/eNcRyPtIoNsCoPeS/eNcRyPtIoNsCoPeNaMe", Expected: &EncryptionScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", EncryptionScopeName: "eNcRyPtIoNsCoPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/eNcRyPtIoNsCoPeS/eNcRyPtIoNsCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/eNcRyPtIoNsCoPeS/eNcRyPtIoNsCoPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-01-01/fileshares/README.md b/resource-manager/storage/2023-01-01/fileshares/README.md index 32e21208f16..7a74a6df26c 100644 --- a/resource-manager/storage/2023-01-01/fileshares/README.md +++ b/resource-manager/storage/2023-01-01/fileshares/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") payload := fileshares.FileShare{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") read, err := client.Delete(ctx, id, fileshares.DefaultDeleteOperationOptions()) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") read, err := client.Get(ctx, id, fileshares.DefaultGetOperationOptions()) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") payload := fileshares.LeaseShareRequest{ // ... @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") payload := fileshares.DeletedShare{ // ... @@ -137,7 +137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") payload := fileshares.FileShare{ // ... diff --git a/resource-manager/storage/2023-01-01/fileshares/id_share.go b/resource-manager/storage/2023-01-01/fileshares/id_share.go index 3b551884bcc..82d96a8a752 100644 --- a/resource-manager/storage/2023-01-01/fileshares/id_share.go +++ b/resource-manager/storage/2023-01-01/fileshares/id_share.go @@ -121,7 +121,7 @@ func (id ShareId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticFileServices", "fileServices", "fileServices"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticShares", "shares", "shares"), diff --git a/resource-manager/storage/2023-01-01/fileshares/id_share_test.go b/resource-manager/storage/2023-01-01/fileshares/id_share_test.go index c4b1c842b35..b1c6ee3d7d8 100644 --- a/resource-manager/storage/2023-01-01/fileshares/id_share_test.go +++ b/resource-manager/storage/2023-01-01/fileshares/id_share_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ShareId{} func TestNewShareID(t *testing.T) { - id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") + id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewShareID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.ShareName != "shareName" { @@ -32,8 +32,8 @@ func TestNewShareID(t *testing.T) { } func TestFormatShareID(t *testing.T) { - actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName" + actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseShareID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseShareIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS/dEfAuLt/sHaReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS/dEfAuLt/sHaReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS/dEfAuLt/sHaReS/sHaReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS/dEfAuLt/sHaReS/sHaReNaMe", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", ShareName: "sHaReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS/dEfAuLt/sHaReS/sHaReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS/dEfAuLt/sHaReS/sHaReNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-01-01/localusers/README.md b/resource-manager/storage/2023-01-01/localusers/README.md index e39aecabe05..7fb50f008c7 100644 --- a/resource-manager/storage/2023-01-01/localusers/README.md +++ b/resource-manager/storage/2023-01-01/localusers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") payload := localusers.LocalUser{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") read, err := client.Get(ctx, id) if err != nil { @@ -94,7 +94,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -110,7 +110,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") read, err := client.RegeneratePassword(ctx, id) if err != nil { diff --git a/resource-manager/storage/2023-01-01/localusers/id_localuser.go b/resource-manager/storage/2023-01-01/localusers/id_localuser.go index 972952de1ee..ea95afe55f6 100644 --- a/resource-manager/storage/2023-01-01/localusers/id_localuser.go +++ b/resource-manager/storage/2023-01-01/localusers/id_localuser.go @@ -121,9 +121,9 @@ func (id LocalUserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticLocalUsers", "localUsers", "localUsers"), - resourceids.UserSpecifiedSegment("localUserName", "username"), + resourceids.UserSpecifiedSegment("localUserName", "localUserName"), } } diff --git a/resource-manager/storage/2023-01-01/localusers/id_localuser_test.go b/resource-manager/storage/2023-01-01/localusers/id_localuser_test.go index 221765cd637..a8b93ce10d2 100644 --- a/resource-manager/storage/2023-01-01/localusers/id_localuser_test.go +++ b/resource-manager/storage/2023-01-01/localusers/id_localuser_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalUserId{} func TestNewLocalUserID(t *testing.T) { - id := NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") + id := NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewLocalUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } - if id.LocalUserName != "username" { - t.Fatalf("Expected %q but got %q for Segment 'LocalUserName'", id.LocalUserName, "username") + if id.LocalUserName != "localUserName" { + t.Fatalf("Expected %q but got %q for Segment 'LocalUserName'", id.LocalUserName, "localUserName") } } func TestFormatLocalUserID(t *testing.T) { - actual := NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username" + actual := NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLocalUserID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName", Expected: &LocalUserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", - LocalUserName: "username", + StorageAccountName: "storageAccountName", + LocalUserName: "localUserName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLocalUserIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/lOcAlUsErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/lOcAlUsErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName", Expected: &LocalUserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", - LocalUserName: "username", + StorageAccountName: "storageAccountName", + LocalUserName: "localUserName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/lOcAlUsErS/uSeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/lOcAlUsErS/lOcAlUsErNaMe", Expected: &LocalUserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", - LocalUserName: "uSeRnAmE", + StorageAccountName: "sToRaGeAcCoUnTnAmE", + LocalUserName: "lOcAlUsErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/lOcAlUsErS/uSeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/lOcAlUsErS/lOcAlUsErNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-01-01/objectreplicationpolicies/README.md b/resource-manager/storage/2023-01-01/objectreplicationpolicies/README.md index 5288f1c912a..c665fe457c9 100644 --- a/resource-manager/storage/2023-01-01/objectreplicationpolicies/README.md +++ b/resource-manager/storage/2023-01-01/objectreplicationpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId") +id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId") payload := objectreplicationpolicies.ObjectReplicationPolicy{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId") +id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId") +id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/storage/2023-01-01/objectreplicationpolicies/id_objectreplicationpolicy.go b/resource-manager/storage/2023-01-01/objectreplicationpolicies/id_objectreplicationpolicy.go index 037ef44e15c..668d239db3f 100644 --- a/resource-manager/storage/2023-01-01/objectreplicationpolicies/id_objectreplicationpolicy.go +++ b/resource-manager/storage/2023-01-01/objectreplicationpolicies/id_objectreplicationpolicy.go @@ -121,7 +121,7 @@ func (id ObjectReplicationPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticObjectReplicationPolicies", "objectReplicationPolicies", "objectReplicationPolicies"), resourceids.UserSpecifiedSegment("objectReplicationPolicyId", "objectReplicationPolicyId"), } diff --git a/resource-manager/storage/2023-01-01/objectreplicationpolicies/id_objectreplicationpolicy_test.go b/resource-manager/storage/2023-01-01/objectreplicationpolicies/id_objectreplicationpolicy_test.go index dcba0e08abb..f5d93d82730 100644 --- a/resource-manager/storage/2023-01-01/objectreplicationpolicies/id_objectreplicationpolicy_test.go +++ b/resource-manager/storage/2023-01-01/objectreplicationpolicies/id_objectreplicationpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ObjectReplicationPolicyId{} func TestNewObjectReplicationPolicyID(t *testing.T) { - id := NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId") + id := NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewObjectReplicationPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.ObjectReplicationPolicyId != "objectReplicationPolicyId" { @@ -32,8 +32,8 @@ func TestNewObjectReplicationPolicyID(t *testing.T) { } func TestFormatObjectReplicationPolicyID(t *testing.T) { - actual := NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId" + actual := NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseObjectReplicationPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId", Expected: &ObjectReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", ObjectReplicationPolicyId: "objectReplicationPolicyId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseObjectReplicationPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/oBjEcTrEpLiCaTiOnPoLiCiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/oBjEcTrEpLiCaTiOnPoLiCiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId", Expected: &ObjectReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", ObjectReplicationPolicyId: "objectReplicationPolicyId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/oBjEcTrEpLiCaTiOnPoLiCiEs/oBjEcTrEpLiCaTiOnPoLiCyId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/oBjEcTrEpLiCaTiOnPoLiCiEs/oBjEcTrEpLiCaTiOnPoLiCyId", Expected: &ObjectReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", ObjectReplicationPolicyId: "oBjEcTrEpLiCaTiOnPoLiCyId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/oBjEcTrEpLiCaTiOnPoLiCiEs/oBjEcTrEpLiCaTiOnPoLiCyId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/oBjEcTrEpLiCaTiOnPoLiCiEs/oBjEcTrEpLiCaTiOnPoLiCyId/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-01-01/privateendpointconnections/README.md b/resource-manager/storage/2023-01-01/privateendpointconnections/README.md index 3dec067e800..160fa4ad644 100644 --- a/resource-manager/storage/2023-01-01/privateendpointconnections/README.md +++ b/resource-manager/storage/2023-01-01/privateendpointconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName") read, err := client.Delete(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/storage/2023-01-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/storage/2023-01-01/privateendpointconnections/id_privateendpointconnection.go index d52b958b0d7..2568311edbb 100644 --- a/resource-manager/storage/2023-01-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/storage/2023-01-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/storage/2023-01-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/storage/2023-01-01/privateendpointconnections/id_privateendpointconnection_test.go index 2da414421b9..60fbfaa8e1b 100644 --- a/resource-manager/storage/2023-01-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/storage/2023-01-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-01-01/queueservice/README.md b/resource-manager/storage/2023-01-01/queueservice/README.md index c3f20467f07..eb67e909314 100644 --- a/resource-manager/storage/2023-01-01/queueservice/README.md +++ b/resource-manager/storage/2023-01-01/queueservice/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") +id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") payload := queueservice.StorageQueue{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") +id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") read, err := client.QueueDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") +id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") read, err := client.QueueGet(ctx, id) if err != nil { @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") +id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") payload := queueservice.StorageQueue{ // ... diff --git a/resource-manager/storage/2023-01-01/queueservice/id_queue.go b/resource-manager/storage/2023-01-01/queueservice/id_queue.go index fb990559096..ffa6e4c0686 100644 --- a/resource-manager/storage/2023-01-01/queueservice/id_queue.go +++ b/resource-manager/storage/2023-01-01/queueservice/id_queue.go @@ -121,7 +121,7 @@ func (id QueueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticQueueServices", "queueServices", "queueServices"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticQueues", "queues", "queues"), diff --git a/resource-manager/storage/2023-01-01/queueservice/id_queue_test.go b/resource-manager/storage/2023-01-01/queueservice/id_queue_test.go index 49e80e74092..55b8742c640 100644 --- a/resource-manager/storage/2023-01-01/queueservice/id_queue_test.go +++ b/resource-manager/storage/2023-01-01/queueservice/id_queue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &QueueId{} func TestNewQueueID(t *testing.T) { - id := NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") + id := NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewQueueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.QueueName != "queueName" { @@ -32,8 +32,8 @@ func TestNewQueueID(t *testing.T) { } func TestFormatQueueID(t *testing.T) { - actual := NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName" + actual := NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseQueueID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName", Expected: &QueueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", QueueName: "queueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseQueueIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs/dEfAuLt/qUeUeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs/dEfAuLt/qUeUeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName", Expected: &QueueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", QueueName: "queueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs/dEfAuLt/qUeUeS/qUeUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs/dEfAuLt/qUeUeS/qUeUeNaMe", Expected: &QueueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", QueueName: "qUeUeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs/dEfAuLt/qUeUeS/qUeUeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs/dEfAuLt/qUeUeS/qUeUeNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-01-01/tableservice/README.md b/resource-manager/storage/2023-01-01/tableservice/README.md index 6822425d480..d66554044a2 100644 --- a/resource-manager/storage/2023-01-01/tableservice/README.md +++ b/resource-manager/storage/2023-01-01/tableservice/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") payload := tableservice.Table{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") read, err := client.TableDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") read, err := client.TableGet(ctx, id) if err != nil { @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") payload := tableservice.Table{ // ... diff --git a/resource-manager/storage/2023-01-01/tableservice/id_table.go b/resource-manager/storage/2023-01-01/tableservice/id_table.go index 3c22dad82f9..64f49ef597b 100644 --- a/resource-manager/storage/2023-01-01/tableservice/id_table.go +++ b/resource-manager/storage/2023-01-01/tableservice/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticTableServices", "tableServices", "tableServices"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticTables", "tables", "tables"), diff --git a/resource-manager/storage/2023-01-01/tableservice/id_table_test.go b/resource-manager/storage/2023-01-01/tableservice/id_table_test.go index b91e6b185c7..0ee391f1f50 100644 --- a/resource-manager/storage/2023-01-01/tableservice/id_table_test.go +++ b/resource-manager/storage/2023-01-01/tableservice/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs/dEfAuLt/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs/dEfAuLt/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs/dEfAuLt/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs/dEfAuLt/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs/dEfAuLt/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs/dEfAuLt/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/deletedaccounts/README.md b/resource-manager/storage/2023-05-01/deletedaccounts/README.md index 1e7bda4177e..79e76cfb39f 100644 --- a/resource-manager/storage/2023-05-01/deletedaccounts/README.md +++ b/resource-manager/storage/2023-05-01/deletedaccounts/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "deletedAccountName") +id := deletedaccounts.NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "deletedAccountName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/storage/2023-05-01/deletedaccounts/id_deletedaccount.go b/resource-manager/storage/2023-05-01/deletedaccounts/id_deletedaccount.go index e2e845c203b..89afa1cfa39 100644 --- a/resource-manager/storage/2023-05-01/deletedaccounts/id_deletedaccount.go +++ b/resource-manager/storage/2023-05-01/deletedaccounts/id_deletedaccount.go @@ -113,7 +113,7 @@ func (id DeletedAccountId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedAccounts", "deletedAccounts", "deletedAccounts"), resourceids.UserSpecifiedSegment("deletedAccountName", "deletedAccountName"), } diff --git a/resource-manager/storage/2023-05-01/deletedaccounts/id_deletedaccount_test.go b/resource-manager/storage/2023-05-01/deletedaccounts/id_deletedaccount_test.go index a615f3ab69d..0e4273a583d 100644 --- a/resource-manager/storage/2023-05-01/deletedaccounts/id_deletedaccount_test.go +++ b/resource-manager/storage/2023-05-01/deletedaccounts/id_deletedaccount_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &DeletedAccountId{} func TestNewDeletedAccountID(t *testing.T) { - id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "deletedAccountName") + id := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "deletedAccountName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.DeletedAccountName != "deletedAccountName" { @@ -28,8 +28,8 @@ func TestNewDeletedAccountID(t *testing.T) { } func TestFormatDeletedAccountID(t *testing.T) { - actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "location", "deletedAccountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName" + actual := NewDeletedAccountID("12345678-1234-9876-4563-123456789012", "locationName", "deletedAccountName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseDeletedAccountID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseDeletedAccountIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoN/dElEtEdAcCoUnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdAcCoUnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedAccountName: "deletedAccountName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/location/deletedAccounts/deletedAccountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Storage/locations/locationName/deletedAccounts/deletedAccountName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoN/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE", Expected: &DeletedAccountId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", DeletedAccountName: "dElEtEdAcCoUnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoN/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGe/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdAcCoUnTs/dElEtEdAcCoUnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/encryptionscopes/README.md b/resource-manager/storage/2023-05-01/encryptionscopes/README.md index a36edcdfdd1..754cac7f268 100644 --- a/resource-manager/storage/2023-05-01/encryptionscopes/README.md +++ b/resource-manager/storage/2023-05-01/encryptionscopes/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName") +id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName") +id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName") payload := encryptionscopes.EncryptionScope{ // ... @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName") +id := encryptionscopes.NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName") payload := encryptionscopes.EncryptionScope{ // ... diff --git a/resource-manager/storage/2023-05-01/encryptionscopes/id_encryptionscope.go b/resource-manager/storage/2023-05-01/encryptionscopes/id_encryptionscope.go index 89c250e57ba..13bf7630372 100644 --- a/resource-manager/storage/2023-05-01/encryptionscopes/id_encryptionscope.go +++ b/resource-manager/storage/2023-05-01/encryptionscopes/id_encryptionscope.go @@ -121,7 +121,7 @@ func (id EncryptionScopeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticEncryptionScopes", "encryptionScopes", "encryptionScopes"), resourceids.UserSpecifiedSegment("encryptionScopeName", "encryptionScopeName"), } diff --git a/resource-manager/storage/2023-05-01/encryptionscopes/id_encryptionscope_test.go b/resource-manager/storage/2023-05-01/encryptionscopes/id_encryptionscope_test.go index 08e60c0ae79..41cb75d5f46 100644 --- a/resource-manager/storage/2023-05-01/encryptionscopes/id_encryptionscope_test.go +++ b/resource-manager/storage/2023-05-01/encryptionscopes/id_encryptionscope_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EncryptionScopeId{} func TestNewEncryptionScopeID(t *testing.T) { - id := NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName") + id := NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewEncryptionScopeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.EncryptionScopeName != "encryptionScopeName" { @@ -32,8 +32,8 @@ func TestNewEncryptionScopeID(t *testing.T) { } func TestFormatEncryptionScopeID(t *testing.T) { - actual := NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "encryptionScopeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName" + actual := NewEncryptionScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "encryptionScopeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseEncryptionScopeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName", Expected: &EncryptionScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", EncryptionScopeName: "encryptionScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseEncryptionScopeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/eNcRyPtIoNsCoPeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/eNcRyPtIoNsCoPeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName", Expected: &EncryptionScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", EncryptionScopeName: "encryptionScopeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/encryptionScopes/encryptionScopeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/encryptionScopes/encryptionScopeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/eNcRyPtIoNsCoPeS/eNcRyPtIoNsCoPeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/eNcRyPtIoNsCoPeS/eNcRyPtIoNsCoPeNaMe", Expected: &EncryptionScopeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", EncryptionScopeName: "eNcRyPtIoNsCoPeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/eNcRyPtIoNsCoPeS/eNcRyPtIoNsCoPeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/eNcRyPtIoNsCoPeS/eNcRyPtIoNsCoPeNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/fileshares/README.md b/resource-manager/storage/2023-05-01/fileshares/README.md index 024a6da4cc7..c6a987fd245 100644 --- a/resource-manager/storage/2023-05-01/fileshares/README.md +++ b/resource-manager/storage/2023-05-01/fileshares/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") payload := fileshares.FileShare{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") read, err := client.Delete(ctx, id, fileshares.DefaultDeleteOperationOptions()) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") read, err := client.Get(ctx, id, fileshares.DefaultGetOperationOptions()) if err != nil { @@ -78,7 +78,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") payload := fileshares.LeaseShareRequest{ // ... @@ -116,7 +116,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") payload := fileshares.DeletedShare{ // ... @@ -137,7 +137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") +id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") payload := fileshares.FileShare{ // ... diff --git a/resource-manager/storage/2023-05-01/fileshares/id_share.go b/resource-manager/storage/2023-05-01/fileshares/id_share.go index 3b551884bcc..82d96a8a752 100644 --- a/resource-manager/storage/2023-05-01/fileshares/id_share.go +++ b/resource-manager/storage/2023-05-01/fileshares/id_share.go @@ -121,7 +121,7 @@ func (id ShareId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticFileServices", "fileServices", "fileServices"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticShares", "shares", "shares"), diff --git a/resource-manager/storage/2023-05-01/fileshares/id_share_test.go b/resource-manager/storage/2023-05-01/fileshares/id_share_test.go index c4b1c842b35..b1c6ee3d7d8 100644 --- a/resource-manager/storage/2023-05-01/fileshares/id_share_test.go +++ b/resource-manager/storage/2023-05-01/fileshares/id_share_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ShareId{} func TestNewShareID(t *testing.T) { - id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName") + id := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewShareID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.ShareName != "shareName" { @@ -32,8 +32,8 @@ func TestNewShareID(t *testing.T) { } func TestFormatShareID(t *testing.T) { - actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "shareName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName" + actual := NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "shareName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseShareID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseShareIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS/dEfAuLt/sHaReS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS/dEfAuLt/sHaReS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", ShareName: "shareName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/fileServices/default/shares/shareName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/fileServices/default/shares/shareName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS/dEfAuLt/sHaReS/sHaReNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS/dEfAuLt/sHaReS/sHaReNaMe", Expected: &ShareId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", ShareName: "sHaReNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/fIlEsErViCeS/dEfAuLt/sHaReS/sHaReNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/fIlEsErViCeS/dEfAuLt/sHaReS/sHaReNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/localusers/README.md b/resource-manager/storage/2023-05-01/localusers/README.md index 4bedca58047..02f3c229539 100644 --- a/resource-manager/storage/2023-05-01/localusers/README.md +++ b/resource-manager/storage/2023-05-01/localusers/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") payload := localusers.LocalUser{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") read, err := client.Get(ctx, id) if err != nil { @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -111,7 +111,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") +id := localusers.NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") read, err := client.RegeneratePassword(ctx, id) if err != nil { diff --git a/resource-manager/storage/2023-05-01/localusers/id_localuser.go b/resource-manager/storage/2023-05-01/localusers/id_localuser.go index 972952de1ee..ea95afe55f6 100644 --- a/resource-manager/storage/2023-05-01/localusers/id_localuser.go +++ b/resource-manager/storage/2023-05-01/localusers/id_localuser.go @@ -121,9 +121,9 @@ func (id LocalUserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticLocalUsers", "localUsers", "localUsers"), - resourceids.UserSpecifiedSegment("localUserName", "username"), + resourceids.UserSpecifiedSegment("localUserName", "localUserName"), } } diff --git a/resource-manager/storage/2023-05-01/localusers/id_localuser_test.go b/resource-manager/storage/2023-05-01/localusers/id_localuser_test.go index 221765cd637..a8b93ce10d2 100644 --- a/resource-manager/storage/2023-05-01/localusers/id_localuser_test.go +++ b/resource-manager/storage/2023-05-01/localusers/id_localuser_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LocalUserId{} func TestNewLocalUserID(t *testing.T) { - id := NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username") + id := NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewLocalUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } - if id.LocalUserName != "username" { - t.Fatalf("Expected %q but got %q for Segment 'LocalUserName'", id.LocalUserName, "username") + if id.LocalUserName != "localUserName" { + t.Fatalf("Expected %q but got %q for Segment 'LocalUserName'", id.LocalUserName, "localUserName") } } func TestFormatLocalUserID(t *testing.T) { - actual := NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "username").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username" + actual := NewLocalUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "localUserName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLocalUserID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName", Expected: &LocalUserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", - LocalUserName: "username", + StorageAccountName: "storageAccountName", + LocalUserName: "localUserName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLocalUserIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/lOcAlUsErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/lOcAlUsErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName", Expected: &LocalUserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", - LocalUserName: "username", + StorageAccountName: "storageAccountName", + LocalUserName: "localUserName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/localUsers/username/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/localUsers/localUserName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/lOcAlUsErS/uSeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/lOcAlUsErS/lOcAlUsErNaMe", Expected: &LocalUserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", - LocalUserName: "uSeRnAmE", + StorageAccountName: "sToRaGeAcCoUnTnAmE", + LocalUserName: "lOcAlUsErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/lOcAlUsErS/uSeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/lOcAlUsErS/lOcAlUsErNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/objectreplicationpolicies/README.md b/resource-manager/storage/2023-05-01/objectreplicationpolicies/README.md index 259b53b9fbb..d3aafcedd0c 100644 --- a/resource-manager/storage/2023-05-01/objectreplicationpolicies/README.md +++ b/resource-manager/storage/2023-05-01/objectreplicationpolicies/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId") +id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId") payload := objectreplicationpolicies.ObjectReplicationPolicy{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId") +id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId") +id := objectreplicationpolicies.NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/storage/2023-05-01/objectreplicationpolicies/id_objectreplicationpolicy.go b/resource-manager/storage/2023-05-01/objectreplicationpolicies/id_objectreplicationpolicy.go index 037ef44e15c..668d239db3f 100644 --- a/resource-manager/storage/2023-05-01/objectreplicationpolicies/id_objectreplicationpolicy.go +++ b/resource-manager/storage/2023-05-01/objectreplicationpolicies/id_objectreplicationpolicy.go @@ -121,7 +121,7 @@ func (id ObjectReplicationPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticObjectReplicationPolicies", "objectReplicationPolicies", "objectReplicationPolicies"), resourceids.UserSpecifiedSegment("objectReplicationPolicyId", "objectReplicationPolicyId"), } diff --git a/resource-manager/storage/2023-05-01/objectreplicationpolicies/id_objectreplicationpolicy_test.go b/resource-manager/storage/2023-05-01/objectreplicationpolicies/id_objectreplicationpolicy_test.go index dcba0e08abb..f5d93d82730 100644 --- a/resource-manager/storage/2023-05-01/objectreplicationpolicies/id_objectreplicationpolicy_test.go +++ b/resource-manager/storage/2023-05-01/objectreplicationpolicies/id_objectreplicationpolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ObjectReplicationPolicyId{} func TestNewObjectReplicationPolicyID(t *testing.T) { - id := NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId") + id := NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewObjectReplicationPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.ObjectReplicationPolicyId != "objectReplicationPolicyId" { @@ -32,8 +32,8 @@ func TestNewObjectReplicationPolicyID(t *testing.T) { } func TestFormatObjectReplicationPolicyID(t *testing.T) { - actual := NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "objectReplicationPolicyId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId" + actual := NewObjectReplicationPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "objectReplicationPolicyId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseObjectReplicationPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId", Expected: &ObjectReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", ObjectReplicationPolicyId: "objectReplicationPolicyId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseObjectReplicationPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/oBjEcTrEpLiCaTiOnPoLiCiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/oBjEcTrEpLiCaTiOnPoLiCiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId", Expected: &ObjectReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", ObjectReplicationPolicyId: "objectReplicationPolicyId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/objectReplicationPolicies/objectReplicationPolicyId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/objectReplicationPolicies/objectReplicationPolicyId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/oBjEcTrEpLiCaTiOnPoLiCiEs/oBjEcTrEpLiCaTiOnPoLiCyId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/oBjEcTrEpLiCaTiOnPoLiCiEs/oBjEcTrEpLiCaTiOnPoLiCyId", Expected: &ObjectReplicationPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", ObjectReplicationPolicyId: "oBjEcTrEpLiCaTiOnPoLiCyId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/oBjEcTrEpLiCaTiOnPoLiCiEs/oBjEcTrEpLiCaTiOnPoLiCyId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/oBjEcTrEpLiCaTiOnPoLiCiEs/oBjEcTrEpLiCaTiOnPoLiCyId/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/privateendpointconnections/README.md b/resource-manager/storage/2023-05-01/privateendpointconnections/README.md index 89c76d3d0a3..e7c6c994daf 100644 --- a/resource-manager/storage/2023-05-01/privateendpointconnections/README.md +++ b/resource-manager/storage/2023-05-01/privateendpointconnections/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName") read, err := client.Delete(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") +id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName") payload := privateendpointconnections.PrivateEndpointConnection{ // ... diff --git a/resource-manager/storage/2023-05-01/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/storage/2023-05-01/privateendpointconnections/id_privateendpointconnection.go index d52b958b0d7..2568311edbb 100644 --- a/resource-manager/storage/2023-05-01/privateendpointconnections/id_privateendpointconnection.go +++ b/resource-manager/storage/2023-05-01/privateendpointconnections/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/storage/2023-05-01/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/storage/2023-05-01/privateendpointconnections/id_privateendpointconnection_test.go index 2da414421b9..60fbfaa8e1b 100644 --- a/resource-manager/storage/2023-05-01/privateendpointconnections/id_privateendpointconnection_test.go +++ b/resource-manager/storage/2023-05-01/privateendpointconnections/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/queueservice/README.md b/resource-manager/storage/2023-05-01/queueservice/README.md index d42a82baf1d..50622f4354a 100644 --- a/resource-manager/storage/2023-05-01/queueservice/README.md +++ b/resource-manager/storage/2023-05-01/queueservice/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") +id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") payload := queueservice.StorageQueue{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") +id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") read, err := client.QueueDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") +id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") read, err := client.QueueGet(ctx, id) if err != nil { @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") +id := queueservice.NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") payload := queueservice.StorageQueue{ // ... diff --git a/resource-manager/storage/2023-05-01/queueservice/id_queue.go b/resource-manager/storage/2023-05-01/queueservice/id_queue.go index fb990559096..ffa6e4c0686 100644 --- a/resource-manager/storage/2023-05-01/queueservice/id_queue.go +++ b/resource-manager/storage/2023-05-01/queueservice/id_queue.go @@ -121,7 +121,7 @@ func (id QueueId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticQueueServices", "queueServices", "queueServices"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticQueues", "queues", "queues"), diff --git a/resource-manager/storage/2023-05-01/queueservice/id_queue_test.go b/resource-manager/storage/2023-05-01/queueservice/id_queue_test.go index 49e80e74092..55b8742c640 100644 --- a/resource-manager/storage/2023-05-01/queueservice/id_queue_test.go +++ b/resource-manager/storage/2023-05-01/queueservice/id_queue_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &QueueId{} func TestNewQueueID(t *testing.T) { - id := NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName") + id := NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewQueueID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.QueueName != "queueName" { @@ -32,8 +32,8 @@ func TestNewQueueID(t *testing.T) { } func TestFormatQueueID(t *testing.T) { - actual := NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "queueName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName" + actual := NewQueueID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "queueName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseQueueID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName", Expected: &QueueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", QueueName: "queueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseQueueIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs/dEfAuLt/qUeUeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs/dEfAuLt/qUeUeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName", Expected: &QueueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", QueueName: "queueName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/queueServices/default/queues/queueName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/queueServices/default/queues/queueName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs/dEfAuLt/qUeUeS/qUeUeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs/dEfAuLt/qUeUeS/qUeUeNaMe", Expected: &QueueId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", QueueName: "qUeUeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/qUeUeSeRvIcEs/dEfAuLt/qUeUeS/qUeUeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/qUeUeSeRvIcEs/dEfAuLt/qUeUeS/qUeUeNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/README.md b/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/README.md index e4b1a730622..39e529923dd 100644 --- a/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/README.md +++ b/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storageaccountsnetworksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") +id := storageaccountsnetworksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "networkSecurityPerimeterConfigurationName") read, err := client.NetworkSecurityPerimeterConfigurationsGet(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := storageaccountsnetworksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") +id := storageaccountsnetworksecurityperimeterconfigurations.NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "networkSecurityPerimeterConfigurationName") if err := client.NetworkSecurityPerimeterConfigurationsReconcileThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go b/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go index 833b01ab542..89e3e946f24 100644 --- a/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go +++ b/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration.go @@ -121,7 +121,7 @@ func (id NetworkSecurityPerimeterConfigurationId) Segments() []resourceids.Segme resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticNetworkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations", "networkSecurityPerimeterConfigurations"), resourceids.UserSpecifiedSegment("networkSecurityPerimeterConfigurationName", "networkSecurityPerimeterConfigurationName"), } diff --git a/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go b/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go index 9cacc0f40f0..cc87e61b175 100644 --- a/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go +++ b/resource-manager/storage/2023-05-01/storageaccountsnetworksecurityperimeterconfigurations/id_networksecurityperimeterconfiguration_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkSecurityPerimeterConfigurationId{} func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { - id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName") + id := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "networkSecurityPerimeterConfigurationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.NetworkSecurityPerimeterConfigurationName != "networkSecurityPerimeterConfigurationName" { @@ -32,8 +32,8 @@ func TestNewNetworkSecurityPerimeterConfigurationID(t *testing.T) { } func TestFormatNetworkSecurityPerimeterConfigurationID(t *testing.T) { - actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "networkSecurityPerimeterConfigurationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" + actual := NewNetworkSecurityPerimeterConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "networkSecurityPerimeterConfigurationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkSecurityPerimeterConfigurationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/networkSecurityPerimeterConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/networkSecurityPerimeterConfigurations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkSecurityPerimeterConfigurationIDInsensitively(t *testing.T) }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/networkSecurityPerimeterConfigurations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/networkSecurityPerimeterConfigurations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", NetworkSecurityPerimeterConfigurationName: "networkSecurityPerimeterConfigurationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/networkSecurityPerimeterConfigurations/networkSecurityPerimeterConfigurationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", Expected: &NetworkSecurityPerimeterConfigurationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", NetworkSecurityPerimeterConfigurationName: "nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnS/nEtWoRkSeCuRiTyPeRiMeTeRcOnFiGuRaTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/storagetaskassignments/README.md b/resource-manager/storage/2023-05-01/storagetaskassignments/README.md index b6a2ea4ced6..1b2052747e8 100644 --- a/resource-manager/storage/2023-05-01/storagetaskassignments/README.md +++ b/resource-manager/storage/2023-05-01/storagetaskassignments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "storageTaskAssignmentName") +id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "storageTaskAssignmentName") payload := storagetaskassignments.StorageTaskAssignment{ // ... @@ -42,7 +42,7 @@ if err := client.CreateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "storageTaskAssignmentName") +id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "storageTaskAssignmentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "storageTaskAssignmentName") +id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "storageTaskAssignmentName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "storageTaskAssignmentName") +id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "storageTaskAssignmentName") // alternatively `client.StorageTaskAssignmentInstancesReportList(ctx, id, storagetaskassignments.DefaultStorageTaskAssignmentInstancesReportListOperationOptions())` can be used to do batched pagination items, err := client.StorageTaskAssignmentInstancesReportListComplete(ctx, id, storagetaskassignments.DefaultStorageTaskAssignmentInstancesReportListOperationOptions()) @@ -121,7 +121,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "storageTaskAssignmentName") +id := storagetaskassignments.NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "storageTaskAssignmentName") payload := storagetaskassignments.StorageTaskAssignmentUpdateParameters{ // ... diff --git a/resource-manager/storage/2023-05-01/storagetaskassignments/id_storagetaskassignment.go b/resource-manager/storage/2023-05-01/storagetaskassignments/id_storagetaskassignment.go index b6bf1c9a72e..36eb94e03d3 100644 --- a/resource-manager/storage/2023-05-01/storagetaskassignments/id_storagetaskassignment.go +++ b/resource-manager/storage/2023-05-01/storagetaskassignments/id_storagetaskassignment.go @@ -121,7 +121,7 @@ func (id StorageTaskAssignmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticStorageTaskAssignments", "storageTaskAssignments", "storageTaskAssignments"), resourceids.UserSpecifiedSegment("storageTaskAssignmentName", "storageTaskAssignmentName"), } diff --git a/resource-manager/storage/2023-05-01/storagetaskassignments/id_storagetaskassignment_test.go b/resource-manager/storage/2023-05-01/storagetaskassignments/id_storagetaskassignment_test.go index 3ae110604a6..d2deed62d5d 100644 --- a/resource-manager/storage/2023-05-01/storagetaskassignments/id_storagetaskassignment_test.go +++ b/resource-manager/storage/2023-05-01/storagetaskassignments/id_storagetaskassignment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StorageTaskAssignmentId{} func TestNewStorageTaskAssignmentID(t *testing.T) { - id := NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "storageTaskAssignmentName") + id := NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "storageTaskAssignmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStorageTaskAssignmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.StorageTaskAssignmentName != "storageTaskAssignmentName" { @@ -32,8 +32,8 @@ func TestNewStorageTaskAssignmentID(t *testing.T) { } func TestFormatStorageTaskAssignmentID(t *testing.T) { - actual := NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "storageTaskAssignmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/storageTaskAssignments/storageTaskAssignmentName" + actual := NewStorageTaskAssignmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "storageTaskAssignmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/storageTaskAssignments/storageTaskAssignmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStorageTaskAssignmentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/storageTaskAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/storageTaskAssignments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/storageTaskAssignments/storageTaskAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/storageTaskAssignments/storageTaskAssignmentName", Expected: &StorageTaskAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", StorageTaskAssignmentName: "storageTaskAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/storageTaskAssignments/storageTaskAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/storageTaskAssignments/storageTaskAssignmentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStorageTaskAssignmentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/storageTaskAssignments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/storageTaskAssignments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/sToRaGeTaSkAsSiGnMeNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/sToRaGeTaSkAsSiGnMeNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/storageTaskAssignments/storageTaskAssignmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/storageTaskAssignments/storageTaskAssignmentName", Expected: &StorageTaskAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", StorageTaskAssignmentName: "storageTaskAssignmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/storageTaskAssignments/storageTaskAssignmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/storageTaskAssignments/storageTaskAssignmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/sToRaGeTaSkAsSiGnMeNtS/sToRaGeTaSkAsSiGnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/sToRaGeTaSkAsSiGnMeNtS/sToRaGeTaSkAsSiGnMeNtNaMe", Expected: &StorageTaskAssignmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", StorageTaskAssignmentName: "sToRaGeTaSkAsSiGnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/sToRaGeTaSkAsSiGnMeNtS/sToRaGeTaSkAsSiGnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/sToRaGeTaSkAsSiGnMeNtS/sToRaGeTaSkAsSiGnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/storage/2023-05-01/tableservice/README.md b/resource-manager/storage/2023-05-01/tableservice/README.md index a1451d86e27..93f7b022c15 100644 --- a/resource-manager/storage/2023-05-01/tableservice/README.md +++ b/resource-manager/storage/2023-05-01/tableservice/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") payload := tableservice.Table{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") read, err := client.TableDelete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") read, err := client.TableGet(ctx, id) if err != nil { @@ -95,7 +95,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") +id := tableservice.NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") payload := tableservice.Table{ // ... diff --git a/resource-manager/storage/2023-05-01/tableservice/id_table.go b/resource-manager/storage/2023-05-01/tableservice/id_table.go index 3c22dad82f9..64f49ef597b 100644 --- a/resource-manager/storage/2023-05-01/tableservice/id_table.go +++ b/resource-manager/storage/2023-05-01/tableservice/id_table.go @@ -121,7 +121,7 @@ func (id TableId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorage", "Microsoft.Storage", "Microsoft.Storage"), resourceids.StaticSegment("staticStorageAccounts", "storageAccounts", "storageAccounts"), - resourceids.UserSpecifiedSegment("storageAccountName", "accountName"), + resourceids.UserSpecifiedSegment("storageAccountName", "storageAccountName"), resourceids.StaticSegment("staticTableServices", "tableServices", "tableServices"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticTables", "tables", "tables"), diff --git a/resource-manager/storage/2023-05-01/tableservice/id_table_test.go b/resource-manager/storage/2023-05-01/tableservice/id_table_test.go index b91e6b185c7..0ee391f1f50 100644 --- a/resource-manager/storage/2023-05-01/tableservice/id_table_test.go +++ b/resource-manager/storage/2023-05-01/tableservice/id_table_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TableId{} func TestNewTableID(t *testing.T) { - id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName") + id := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTableID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StorageAccountName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "accountName") + if id.StorageAccountName != "storageAccountName" { + t.Fatalf("Expected %q but got %q for Segment 'StorageAccountName'", id.StorageAccountName, "storageAccountName") } if id.TableName != "tableName" { @@ -32,8 +32,8 @@ func TestNewTableID(t *testing.T) { } func TestFormatTableID(t *testing.T) { - actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "tableName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName" + actual := NewTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageAccountName", "tableName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseTableID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseTableIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs/dEfAuLt/tAbLeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs/dEfAuLt/tAbLeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StorageAccountName: "accountName", + StorageAccountName: "storageAccountName", TableName: "tableName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/accountName/tableServices/default/tables/tableName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Storage/storageAccounts/storageAccountName/tableServices/default/tables/tableName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs/dEfAuLt/tAbLeS/tAbLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs/dEfAuLt/tAbLeS/tAbLeNaMe", Expected: &TableId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageAccountName: "aCcOuNtNaMe", + StorageAccountName: "sToRaGeAcCoUnTnAmE", TableName: "tAbLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/aCcOuNtNaMe/tAbLeSeRvIcEs/dEfAuLt/tAbLeS/tAbLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sToRaGe/sToRaGeAcCoUnTs/sToRaGeAcCoUnTnAmE/tAbLeSeRvIcEs/dEfAuLt/tAbLeS/tAbLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/storagecache/2023-05-01/amlfilesystems/model_keyvaultkeyreference.go b/resource-manager/storagecache/2023-05-01/amlfilesystems/model_keyvaultkeyreference.go index 475466a877d..21a213ae76d 100644 --- a/resource-manager/storagecache/2023-05-01/amlfilesystems/model_keyvaultkeyreference.go +++ b/resource-manager/storagecache/2023-05-01/amlfilesystems/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package amlfilesystems // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault KeyVaultKeyReferenceSourceVault `json:"sourceVault"` } diff --git a/resource-manager/storagecache/2023-05-01/ascusages/README.md b/resource-manager/storagecache/2023-05-01/ascusages/README.md index 3045f17ce26..8828bef841e 100644 --- a/resource-manager/storagecache/2023-05-01/ascusages/README.md +++ b/resource-manager/storagecache/2023-05-01/ascusages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := ascusages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := ascusages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/storagecache/2023-05-01/ascusages/id_location.go b/resource-manager/storagecache/2023-05-01/ascusages/id_location.go index 20c8a0b7271..28f4e741d05 100644 --- a/resource-manager/storagecache/2023-05-01/ascusages/id_location.go +++ b/resource-manager/storagecache/2023-05-01/ascusages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorageCache", "Microsoft.StorageCache", "Microsoft.StorageCache"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/storagecache/2023-05-01/ascusages/id_location_test.go b/resource-manager/storagecache/2023-05-01/ascusages/id_location_test.go index 871593c8280..f2268b44b39 100644 --- a/resource-manager/storagecache/2023-05-01/ascusages/id_location_test.go +++ b/resource-manager/storagecache/2023-05-01/ascusages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGeCaChE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGeCaChE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGeCaChE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGeCaChE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/storagecache/2023-05-01/caches/model_keyvaultkeyreference.go b/resource-manager/storagecache/2023-05-01/caches/model_keyvaultkeyreference.go index b5e432d0e6f..537ad4bbc24 100644 --- a/resource-manager/storagecache/2023-05-01/caches/model_keyvaultkeyreference.go +++ b/resource-manager/storagecache/2023-05-01/caches/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package caches // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault KeyVaultKeyReferenceSourceVault `json:"sourceVault"` } diff --git a/resource-manager/storagecache/2023-05-01/caches/model_primingjob.go b/resource-manager/storagecache/2023-05-01/caches/model_primingjob.go index 7050afae80c..403eaf2c9e6 100644 --- a/resource-manager/storagecache/2023-05-01/caches/model_primingjob.go +++ b/resource-manager/storagecache/2023-05-01/caches/model_primingjob.go @@ -10,5 +10,5 @@ type PrimingJob struct { PrimingJobPercentComplete *float64 `json:"primingJobPercentComplete,omitempty"` PrimingJobState *PrimingJobState `json:"primingJobState,omitempty"` PrimingJobStatus *string `json:"primingJobStatus,omitempty"` - PrimingManifestUrl string `json:"primingManifestUrl"` + PrimingManifestURL string `json:"primingManifestUrl"` } diff --git a/resource-manager/storagecache/2024-03-01/amlfilesystems/model_keyvaultkeyreference.go b/resource-manager/storagecache/2024-03-01/amlfilesystems/model_keyvaultkeyreference.go index 475466a877d..21a213ae76d 100644 --- a/resource-manager/storagecache/2024-03-01/amlfilesystems/model_keyvaultkeyreference.go +++ b/resource-manager/storagecache/2024-03-01/amlfilesystems/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package amlfilesystems // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault KeyVaultKeyReferenceSourceVault `json:"sourceVault"` } diff --git a/resource-manager/storagecache/2024-03-01/ascusages/README.md b/resource-manager/storagecache/2024-03-01/ascusages/README.md index 88a5a95ee86..14a1e43ee4f 100644 --- a/resource-manager/storagecache/2024-03-01/ascusages/README.md +++ b/resource-manager/storagecache/2024-03-01/ascusages/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := ascusages.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := ascusages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/storagecache/2024-03-01/ascusages/id_location.go b/resource-manager/storagecache/2024-03-01/ascusages/id_location.go index 20c8a0b7271..28f4e741d05 100644 --- a/resource-manager/storagecache/2024-03-01/ascusages/id_location.go +++ b/resource-manager/storagecache/2024-03-01/ascusages/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStorageCache", "Microsoft.StorageCache", "Microsoft.StorageCache"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/storagecache/2024-03-01/ascusages/id_location_test.go b/resource-manager/storagecache/2024-03-01/ascusages/id_location_test.go index 871593c8280..f2268b44b39 100644 --- a/resource-manager/storagecache/2024-03-01/ascusages/id_location_test.go +++ b/resource-manager/storagecache/2024-03-01/ascusages/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StorageCache/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGeCaChE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGeCaChE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGeCaChE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGeCaChE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/storagecache/2024-03-01/caches/model_keyvaultkeyreference.go b/resource-manager/storagecache/2024-03-01/caches/model_keyvaultkeyreference.go index b5e432d0e6f..537ad4bbc24 100644 --- a/resource-manager/storagecache/2024-03-01/caches/model_keyvaultkeyreference.go +++ b/resource-manager/storagecache/2024-03-01/caches/model_keyvaultkeyreference.go @@ -4,6 +4,6 @@ package caches // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type KeyVaultKeyReference struct { - KeyUrl string `json:"keyUrl"` + KeyURL string `json:"keyUrl"` SourceVault KeyVaultKeyReferenceSourceVault `json:"sourceVault"` } diff --git a/resource-manager/storagecache/2024-03-01/caches/model_primingjob.go b/resource-manager/storagecache/2024-03-01/caches/model_primingjob.go index 7050afae80c..403eaf2c9e6 100644 --- a/resource-manager/storagecache/2024-03-01/caches/model_primingjob.go +++ b/resource-manager/storagecache/2024-03-01/caches/model_primingjob.go @@ -10,5 +10,5 @@ type PrimingJob struct { PrimingJobPercentComplete *float64 `json:"primingJobPercentComplete,omitempty"` PrimingJobState *PrimingJobState `json:"primingJobState,omitempty"` PrimingJobStatus *string `json:"primingJobStatus,omitempty"` - PrimingManifestUrl string `json:"primingManifestUrl"` + PrimingManifestURL string `json:"primingManifestUrl"` } diff --git a/resource-manager/storagepool/2021-08-01/diskpoolzones/README.md b/resource-manager/storagepool/2021-08-01/diskpoolzones/README.md index d8b6c480717..701dbebc698 100644 --- a/resource-manager/storagepool/2021-08-01/diskpoolzones/README.md +++ b/resource-manager/storagepool/2021-08-01/diskpoolzones/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diskpoolzones.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := diskpoolzones.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/storagepool/2021-08-01/diskpoolzones/id_location.go b/resource-manager/storagepool/2021-08-01/diskpoolzones/id_location.go index a1f6df712d4..16d2acecbf6 100644 --- a/resource-manager/storagepool/2021-08-01/diskpoolzones/id_location.go +++ b/resource-manager/storagepool/2021-08-01/diskpoolzones/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStoragePool", "Microsoft.StoragePool", "Microsoft.StoragePool"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/storagepool/2021-08-01/diskpoolzones/id_location_test.go b/resource-manager/storagepool/2021-08-01/diskpoolzones/id_location_test.go index 52cd1e31b8f..6c2d3d43a9c 100644 --- a/resource-manager/storagepool/2021-08-01/diskpoolzones/id_location_test.go +++ b/resource-manager/storagepool/2021-08-01/diskpoolzones/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGePoOl/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGePoOl/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGePoOl/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGePoOl/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/storagepool/2021-08-01/resourceskus/README.md b/resource-manager/storagepool/2021-08-01/resourceskus/README.md index 71b7ce7496e..b636767bba4 100644 --- a/resource-manager/storagepool/2021-08-01/resourceskus/README.md +++ b/resource-manager/storagepool/2021-08-01/resourceskus/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := resourceskus.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := resourceskus.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.List(ctx, id)` can be used to do batched pagination items, err := client.ListComplete(ctx, id) diff --git a/resource-manager/storagepool/2021-08-01/resourceskus/id_location.go b/resource-manager/storagepool/2021-08-01/resourceskus/id_location.go index 6cdac049d74..a82cd926d01 100644 --- a/resource-manager/storagepool/2021-08-01/resourceskus/id_location.go +++ b/resource-manager/storagepool/2021-08-01/resourceskus/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStoragePool", "Microsoft.StoragePool", "Microsoft.StoragePool"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/storagepool/2021-08-01/resourceskus/id_location_test.go b/resource-manager/storagepool/2021-08-01/resourceskus/id_location_test.go index 1a7cc21fc18..790b1355290 100644 --- a/resource-manager/storagepool/2021-08-01/resourceskus/id_location_test.go +++ b/resource-manager/storagepool/2021-08-01/resourceskus/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StoragePool/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGePoOl/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGePoOl/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGePoOl/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sToRaGePoOl/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/functions/README.md b/resource-manager/streamanalytics/2020-03-01/functions/README.md index 6d08cdf1992..6485e0e84d4 100644 --- a/resource-manager/streamanalytics/2020-03-01/functions/README.md +++ b/resource-manager/streamanalytics/2020-03-01/functions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") payload := functions.Function{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := functions.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := functions.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") // alternatively `client.ListByStreamingJob(ctx, id, functions.DefaultListByStreamingJobOperationOptions())` can be used to do batched pagination items, err := client.ListByStreamingJobComplete(ctx, id, functions.DefaultListByStreamingJobOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") payload := functions.FunctionRetrieveDefaultDefinitionParameters{ // ... @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") payload := functions.Function{ // ... @@ -132,7 +132,7 @@ if err := client.TestThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") payload := functions.Function{ // ... diff --git a/resource-manager/streamanalytics/2020-03-01/functions/id_function.go b/resource-manager/streamanalytics/2020-03-01/functions/id_function.go index 198804bfbcf..e00f56aaef0 100644 --- a/resource-manager/streamanalytics/2020-03-01/functions/id_function.go +++ b/resource-manager/streamanalytics/2020-03-01/functions/id_function.go @@ -121,7 +121,7 @@ func (id FunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), } diff --git a/resource-manager/streamanalytics/2020-03-01/functions/id_function_test.go b/resource-manager/streamanalytics/2020-03-01/functions/id_function_test.go index 57333a1ed83..a9406fd6ae1 100644 --- a/resource-manager/streamanalytics/2020-03-01/functions/id_function_test.go +++ b/resource-manager/streamanalytics/2020-03-01/functions/id_function_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionId{} func TestNewFunctionID(t *testing.T) { - id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") + id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } if id.FunctionName != "functionName" { @@ -32,8 +32,8 @@ func TestNewFunctionID(t *testing.T) { } func TestFormatFunctionID(t *testing.T) { - actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName" + actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/fUnCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/fUnCtIoNs/fUnCtIoNnAmE", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/fUnCtIoNs/fUnCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/functions/id_streamingjob.go b/resource-manager/streamanalytics/2020-03-01/functions/id_streamingjob.go index 9e7caa027a7..c8afdd1b93b 100644 --- a/resource-manager/streamanalytics/2020-03-01/functions/id_streamingjob.go +++ b/resource-manager/streamanalytics/2020-03-01/functions/id_streamingjob.go @@ -115,7 +115,7 @@ func (id StreamingJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), } } diff --git a/resource-manager/streamanalytics/2020-03-01/functions/id_streamingjob_test.go b/resource-manager/streamanalytics/2020-03-01/functions/id_streamingjob_test.go index 2736efb3658..e911597babc 100644 --- a/resource-manager/streamanalytics/2020-03-01/functions/id_streamingjob_test.go +++ b/resource-manager/streamanalytics/2020-03-01/functions/id_streamingjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StreamingJobId{} func TestNewStreamingJobID(t *testing.T) { - id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") + id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStreamingJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } } func TestFormatStreamingJobID(t *testing.T) { - actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName" + actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStreamingJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStreamingJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/inputs/README.md b/resource-manager/streamanalytics/2020-03-01/inputs/README.md index 932039253e3..cd5ca5257e8 100644 --- a/resource-manager/streamanalytics/2020-03-01/inputs/README.md +++ b/resource-manager/streamanalytics/2020-03-01/inputs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") payload := inputs.Input{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inputs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := inputs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") // alternatively `client.ListByStreamingJob(ctx, id, inputs.DefaultListByStreamingJobOperationOptions())` can be used to do batched pagination items, err := client.ListByStreamingJobComplete(ctx, id, inputs.DefaultListByStreamingJobOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") payload := inputs.Input{ // ... @@ -111,7 +111,7 @@ if err := client.TestThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") payload := inputs.Input{ // ... diff --git a/resource-manager/streamanalytics/2020-03-01/inputs/id_input.go b/resource-manager/streamanalytics/2020-03-01/inputs/id_input.go index a6ebd09a833..9a00bcd3292 100644 --- a/resource-manager/streamanalytics/2020-03-01/inputs/id_input.go +++ b/resource-manager/streamanalytics/2020-03-01/inputs/id_input.go @@ -121,7 +121,7 @@ func (id InputId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), resourceids.StaticSegment("staticInputs", "inputs", "inputs"), resourceids.UserSpecifiedSegment("inputName", "inputName"), } diff --git a/resource-manager/streamanalytics/2020-03-01/inputs/id_input_test.go b/resource-manager/streamanalytics/2020-03-01/inputs/id_input_test.go index 647155a408d..c02c26379f2 100644 --- a/resource-manager/streamanalytics/2020-03-01/inputs/id_input_test.go +++ b/resource-manager/streamanalytics/2020-03-01/inputs/id_input_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InputId{} func TestNewInputID(t *testing.T) { - id := NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") + id := NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInputID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } if id.InputName != "inputName" { @@ -32,8 +32,8 @@ func TestNewInputID(t *testing.T) { } func TestFormatInputID(t *testing.T) { - actual := NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName" + actual := NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseInputID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName", Expected: &InputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", InputName: "inputName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseInputIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/iNpUtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/iNpUtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName", Expected: &InputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", InputName: "inputName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/iNpUtS/iNpUtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/iNpUtS/iNpUtNaMe", Expected: &InputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", InputName: "iNpUtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/iNpUtS/iNpUtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/iNpUtS/iNpUtNaMe/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/inputs/id_streamingjob.go b/resource-manager/streamanalytics/2020-03-01/inputs/id_streamingjob.go index 55b8f30c998..6da6edbabc2 100644 --- a/resource-manager/streamanalytics/2020-03-01/inputs/id_streamingjob.go +++ b/resource-manager/streamanalytics/2020-03-01/inputs/id_streamingjob.go @@ -115,7 +115,7 @@ func (id StreamingJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), } } diff --git a/resource-manager/streamanalytics/2020-03-01/inputs/id_streamingjob_test.go b/resource-manager/streamanalytics/2020-03-01/inputs/id_streamingjob_test.go index 0447a57b65c..0dfe02bb4bb 100644 --- a/resource-manager/streamanalytics/2020-03-01/inputs/id_streamingjob_test.go +++ b/resource-manager/streamanalytics/2020-03-01/inputs/id_streamingjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StreamingJobId{} func TestNewStreamingJobID(t *testing.T) { - id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") + id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStreamingJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } } func TestFormatStreamingJobID(t *testing.T) { - actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName" + actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStreamingJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStreamingJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/outputs/README.md b/resource-manager/streamanalytics/2020-03-01/outputs/README.md index 1b03fb37b03..e29b938ea2b 100644 --- a/resource-manager/streamanalytics/2020-03-01/outputs/README.md +++ b/resource-manager/streamanalytics/2020-03-01/outputs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") payload := outputs.Output{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := outputs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := outputs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") // alternatively `client.ListByStreamingJob(ctx, id, outputs.DefaultListByStreamingJobOperationOptions())` can be used to do batched pagination items, err := client.ListByStreamingJobComplete(ctx, id, outputs.DefaultListByStreamingJobOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") payload := outputs.Output{ // ... @@ -111,7 +111,7 @@ if err := client.TestThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") payload := outputs.Output{ // ... diff --git a/resource-manager/streamanalytics/2020-03-01/outputs/id_output.go b/resource-manager/streamanalytics/2020-03-01/outputs/id_output.go index 08b89c66985..4b80c0c7ad0 100644 --- a/resource-manager/streamanalytics/2020-03-01/outputs/id_output.go +++ b/resource-manager/streamanalytics/2020-03-01/outputs/id_output.go @@ -121,7 +121,7 @@ func (id OutputId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), resourceids.StaticSegment("staticOutputs", "outputs", "outputs"), resourceids.UserSpecifiedSegment("outputName", "outputName"), } diff --git a/resource-manager/streamanalytics/2020-03-01/outputs/id_output_test.go b/resource-manager/streamanalytics/2020-03-01/outputs/id_output_test.go index 2964057a31a..1463e18d684 100644 --- a/resource-manager/streamanalytics/2020-03-01/outputs/id_output_test.go +++ b/resource-manager/streamanalytics/2020-03-01/outputs/id_output_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OutputId{} func TestNewOutputID(t *testing.T) { - id := NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") + id := NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewOutputID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } if id.OutputName != "outputName" { @@ -32,8 +32,8 @@ func TestNewOutputID(t *testing.T) { } func TestFormatOutputID(t *testing.T) { - actual := NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName" + actual := NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseOutputID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName", Expected: &OutputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", OutputName: "outputName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseOutputIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/oUtPuTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/oUtPuTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName", Expected: &OutputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", OutputName: "outputName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/oUtPuTs/oUtPuTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/oUtPuTs/oUtPuTnAmE", Expected: &OutputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", OutputName: "oUtPuTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/oUtPuTs/oUtPuTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/oUtPuTs/oUtPuTnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/outputs/id_streamingjob.go b/resource-manager/streamanalytics/2020-03-01/outputs/id_streamingjob.go index d26b55fa98e..9f7600fb4eb 100644 --- a/resource-manager/streamanalytics/2020-03-01/outputs/id_streamingjob.go +++ b/resource-manager/streamanalytics/2020-03-01/outputs/id_streamingjob.go @@ -115,7 +115,7 @@ func (id StreamingJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), } } diff --git a/resource-manager/streamanalytics/2020-03-01/outputs/id_streamingjob_test.go b/resource-manager/streamanalytics/2020-03-01/outputs/id_streamingjob_test.go index 6d02f120e41..84bfab61b52 100644 --- a/resource-manager/streamanalytics/2020-03-01/outputs/id_streamingjob_test.go +++ b/resource-manager/streamanalytics/2020-03-01/outputs/id_streamingjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StreamingJobId{} func TestNewStreamingJobID(t *testing.T) { - id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") + id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStreamingJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } } func TestFormatStreamingJobID(t *testing.T) { - actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName" + actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStreamingJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStreamingJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/streamingjobs/README.md b/resource-manager/streamanalytics/2020-03-01/streamingjobs/README.md index 21bbc039456..511969cb771 100644 --- a/resource-manager/streamanalytics/2020-03-01/streamingjobs/README.md +++ b/resource-manager/streamanalytics/2020-03-01/streamingjobs/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") payload := streamingjobs.StreamingJob{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrReplaceThenPoll(ctx, id, payload, streamingjobs.Default ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") read, err := client.Get(ctx, id, streamingjobs.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") payload := streamingjobs.ScaleStreamingJobParameters{ // ... @@ -121,7 +121,7 @@ if err := client.ScaleThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") payload := streamingjobs.StartStreamingJobParameters{ // ... @@ -138,7 +138,7 @@ if err := client.StartThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if err := client.StopThenPoll(ctx, id); err != nil { // handle the error @@ -150,7 +150,7 @@ if err := client.StopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") payload := streamingjobs.StreamingJob{ // ... diff --git a/resource-manager/streamanalytics/2020-03-01/streamingjobs/id_streamingjob.go b/resource-manager/streamanalytics/2020-03-01/streamingjobs/id_streamingjob.go index dbf8cb09b9c..04eaca87e12 100644 --- a/resource-manager/streamanalytics/2020-03-01/streamingjobs/id_streamingjob.go +++ b/resource-manager/streamanalytics/2020-03-01/streamingjobs/id_streamingjob.go @@ -115,7 +115,7 @@ func (id StreamingJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), } } diff --git a/resource-manager/streamanalytics/2020-03-01/streamingjobs/id_streamingjob_test.go b/resource-manager/streamanalytics/2020-03-01/streamingjobs/id_streamingjob_test.go index 7007468702d..4ae02ab7447 100644 --- a/resource-manager/streamanalytics/2020-03-01/streamingjobs/id_streamingjob_test.go +++ b/resource-manager/streamanalytics/2020-03-01/streamingjobs/id_streamingjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StreamingJobId{} func TestNewStreamingJobID(t *testing.T) { - id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") + id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStreamingJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } } func TestFormatStreamingJobID(t *testing.T) { - actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName" + actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStreamingJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStreamingJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/subscriptions/README.md b/resource-manager/streamanalytics/2020-03-01/subscriptions/README.md index 355680dc1cc..623db651c9f 100644 --- a/resource-manager/streamanalytics/2020-03-01/subscriptions/README.md +++ b/resource-manager/streamanalytics/2020-03-01/subscriptions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListQuotas(ctx, id) if err != nil { diff --git a/resource-manager/streamanalytics/2020-03-01/subscriptions/id_location.go b/resource-manager/streamanalytics/2020-03-01/subscriptions/id_location.go index 8bb4b64ad39..db3d002e077 100644 --- a/resource-manager/streamanalytics/2020-03-01/subscriptions/id_location.go +++ b/resource-manager/streamanalytics/2020-03-01/subscriptions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/streamanalytics/2020-03-01/subscriptions/id_location_test.go b/resource-manager/streamanalytics/2020-03-01/subscriptions/id_location_test.go index 7e71efe99f1..879e8e87cb3 100644 --- a/resource-manager/streamanalytics/2020-03-01/subscriptions/id_location_test.go +++ b/resource-manager/streamanalytics/2020-03-01/subscriptions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2020-03-01/transformations/README.md b/resource-manager/streamanalytics/2020-03-01/transformations/README.md index 3f108b392de..4cfe05121f7 100644 --- a/resource-manager/streamanalytics/2020-03-01/transformations/README.md +++ b/resource-manager/streamanalytics/2020-03-01/transformations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName") +id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName") payload := transformations.Transformation{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName") +id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName") +id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName") payload := transformations.Transformation{ // ... diff --git a/resource-manager/streamanalytics/2020-03-01/transformations/id_transformation.go b/resource-manager/streamanalytics/2020-03-01/transformations/id_transformation.go index 02c1c8e756a..50ed62d0151 100644 --- a/resource-manager/streamanalytics/2020-03-01/transformations/id_transformation.go +++ b/resource-manager/streamanalytics/2020-03-01/transformations/id_transformation.go @@ -121,7 +121,7 @@ func (id TransformationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), resourceids.StaticSegment("staticTransformations", "transformations", "transformations"), resourceids.UserSpecifiedSegment("transformationName", "transformationName"), } diff --git a/resource-manager/streamanalytics/2020-03-01/transformations/id_transformation_test.go b/resource-manager/streamanalytics/2020-03-01/transformations/id_transformation_test.go index c97aef354f2..c53ba90a17d 100644 --- a/resource-manager/streamanalytics/2020-03-01/transformations/id_transformation_test.go +++ b/resource-manager/streamanalytics/2020-03-01/transformations/id_transformation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TransformationId{} func TestNewTransformationID(t *testing.T) { - id := NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName") + id := NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTransformationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } if id.TransformationName != "transformationName" { @@ -32,8 +32,8 @@ func TestNewTransformationID(t *testing.T) { } func TestFormatTransformationID(t *testing.T) { - actual := NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName" + actual := NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTransformationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName", Expected: &TransformationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", TransformationName: "transformationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTransformationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/tRaNsFoRmAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/tRaNsFoRmAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName", Expected: &TransformationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", TransformationName: "transformationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/tRaNsFoRmAtIoNs/tRaNsFoRmAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/tRaNsFoRmAtIoNs/tRaNsFoRmAtIoNnAmE", Expected: &TransformationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", TransformationName: "tRaNsFoRmAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/tRaNsFoRmAtIoNs/tRaNsFoRmAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/tRaNsFoRmAtIoNs/tRaNsFoRmAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/functions/README.md b/resource-manager/streamanalytics/2021-10-01-preview/functions/README.md index fff3d7c074c..e43f0677780 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/functions/README.md +++ b/resource-manager/streamanalytics/2021-10-01-preview/functions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") payload := functions.Function{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := functions.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := functions.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") // alternatively `client.ListByStreamingJob(ctx, id, functions.DefaultListByStreamingJobOperationOptions())` can be used to do batched pagination items, err := client.ListByStreamingJobComplete(ctx, id, functions.DefaultListByStreamingJobOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") payload := functions.FunctionRetrieveDefaultDefinitionParameters{ // ... @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") payload := functions.Function{ // ... @@ -132,7 +132,7 @@ if err := client.TestThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") +id := functions.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") payload := functions.Function{ // ... diff --git a/resource-manager/streamanalytics/2021-10-01-preview/functions/id_function.go b/resource-manager/streamanalytics/2021-10-01-preview/functions/id_function.go index 198804bfbcf..e00f56aaef0 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/functions/id_function.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/functions/id_function.go @@ -121,7 +121,7 @@ func (id FunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/functions/id_function_test.go b/resource-manager/streamanalytics/2021-10-01-preview/functions/id_function_test.go index 57333a1ed83..a9406fd6ae1 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/functions/id_function_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/functions/id_function_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionId{} func TestNewFunctionID(t *testing.T) { - id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName") + id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } if id.FunctionName != "functionName" { @@ -32,8 +32,8 @@ func TestNewFunctionID(t *testing.T) { } func TestFormatFunctionID(t *testing.T) { - actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "functionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName" + actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/fUnCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/fUnCtIoNs/fUnCtIoNnAmE", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/fUnCtIoNs/fUnCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/functions/id_streamingjob.go b/resource-manager/streamanalytics/2021-10-01-preview/functions/id_streamingjob.go index 9e7caa027a7..c8afdd1b93b 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/functions/id_streamingjob.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/functions/id_streamingjob.go @@ -115,7 +115,7 @@ func (id StreamingJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), } } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/functions/id_streamingjob_test.go b/resource-manager/streamanalytics/2021-10-01-preview/functions/id_streamingjob_test.go index 2736efb3658..e911597babc 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/functions/id_streamingjob_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/functions/id_streamingjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StreamingJobId{} func TestNewStreamingJobID(t *testing.T) { - id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") + id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStreamingJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } } func TestFormatStreamingJobID(t *testing.T) { - actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName" + actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStreamingJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStreamingJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/inputs/README.md b/resource-manager/streamanalytics/2021-10-01-preview/inputs/README.md index 26f67990967..57861b98ca9 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/inputs/README.md +++ b/resource-manager/streamanalytics/2021-10-01-preview/inputs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") payload := inputs.Input{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inputs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := inputs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") // alternatively `client.ListByStreamingJob(ctx, id, inputs.DefaultListByStreamingJobOperationOptions())` can be used to do batched pagination items, err := client.ListByStreamingJobComplete(ctx, id, inputs.DefaultListByStreamingJobOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") payload := inputs.Input{ // ... @@ -111,7 +111,7 @@ if err := client.TestThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") +id := inputs.NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") payload := inputs.Input{ // ... diff --git a/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_input.go b/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_input.go index a6ebd09a833..9a00bcd3292 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_input.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_input.go @@ -121,7 +121,7 @@ func (id InputId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), resourceids.StaticSegment("staticInputs", "inputs", "inputs"), resourceids.UserSpecifiedSegment("inputName", "inputName"), } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_input_test.go b/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_input_test.go index 647155a408d..c02c26379f2 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_input_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_input_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InputId{} func TestNewInputID(t *testing.T) { - id := NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName") + id := NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInputID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } if id.InputName != "inputName" { @@ -32,8 +32,8 @@ func TestNewInputID(t *testing.T) { } func TestFormatInputID(t *testing.T) { - actual := NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "inputName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName" + actual := NewInputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "inputName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseInputID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName", Expected: &InputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", InputName: "inputName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseInputIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/iNpUtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/iNpUtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName", Expected: &InputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", InputName: "inputName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/inputs/inputName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/inputs/inputName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/iNpUtS/iNpUtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/iNpUtS/iNpUtNaMe", Expected: &InputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", InputName: "iNpUtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/iNpUtS/iNpUtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/iNpUtS/iNpUtNaMe/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_streamingjob.go b/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_streamingjob.go index 55b8f30c998..6da6edbabc2 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_streamingjob.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_streamingjob.go @@ -115,7 +115,7 @@ func (id StreamingJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), } } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_streamingjob_test.go b/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_streamingjob_test.go index 0447a57b65c..0dfe02bb4bb 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_streamingjob_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/inputs/id_streamingjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StreamingJobId{} func TestNewStreamingJobID(t *testing.T) { - id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") + id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStreamingJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } } func TestFormatStreamingJobID(t *testing.T) { - actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName" + actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStreamingJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStreamingJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/outputs/README.md b/resource-manager/streamanalytics/2021-10-01-preview/outputs/README.md index a76215791ea..8055b983696 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/outputs/README.md +++ b/resource-manager/streamanalytics/2021-10-01-preview/outputs/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") payload := outputs.Output{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := outputs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := outputs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") // alternatively `client.ListByStreamingJob(ctx, id, outputs.DefaultListByStreamingJobOperationOptions())` can be used to do batched pagination items, err := client.ListByStreamingJobComplete(ctx, id, outputs.DefaultListByStreamingJobOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") payload := outputs.Output{ // ... @@ -111,7 +111,7 @@ if err := client.TestThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") +id := outputs.NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") payload := outputs.Output{ // ... diff --git a/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_output.go b/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_output.go index 08b89c66985..4b80c0c7ad0 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_output.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_output.go @@ -121,7 +121,7 @@ func (id OutputId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), resourceids.StaticSegment("staticOutputs", "outputs", "outputs"), resourceids.UserSpecifiedSegment("outputName", "outputName"), } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_output_test.go b/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_output_test.go index 2964057a31a..1463e18d684 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_output_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_output_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &OutputId{} func TestNewOutputID(t *testing.T) { - id := NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName") + id := NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewOutputID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } if id.OutputName != "outputName" { @@ -32,8 +32,8 @@ func TestNewOutputID(t *testing.T) { } func TestFormatOutputID(t *testing.T) { - actual := NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "outputName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName" + actual := NewOutputID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "outputName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseOutputID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName", Expected: &OutputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", OutputName: "outputName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseOutputIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/oUtPuTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/oUtPuTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName", Expected: &OutputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", OutputName: "outputName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/outputs/outputName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/outputs/outputName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/oUtPuTs/oUtPuTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/oUtPuTs/oUtPuTnAmE", Expected: &OutputId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", OutputName: "oUtPuTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/oUtPuTs/oUtPuTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/oUtPuTs/oUtPuTnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_streamingjob.go b/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_streamingjob.go index d26b55fa98e..9f7600fb4eb 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_streamingjob.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_streamingjob.go @@ -115,7 +115,7 @@ func (id StreamingJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), } } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_streamingjob_test.go b/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_streamingjob_test.go index 6d02f120e41..84bfab61b52 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_streamingjob_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/outputs/id_streamingjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StreamingJobId{} func TestNewStreamingJobID(t *testing.T) { - id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") + id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStreamingJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } } func TestFormatStreamingJobID(t *testing.T) { - actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName" + actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStreamingJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStreamingJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/README.md b/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/README.md index 264106ba56c..896541b5ebb 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/README.md +++ b/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") payload := streamingjobs.StreamingJob{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrReplaceThenPoll(ctx, id, payload, streamingjobs.Default ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") read, err := client.Get(ctx, id, streamingjobs.DefaultGetOperationOptions()) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") payload := streamingjobs.ScaleStreamingJobParameters{ // ... @@ -121,7 +121,7 @@ if err := client.ScaleThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") // alternatively `client.SkuList(ctx, id)` can be used to do batched pagination items, err := client.SkuListComplete(ctx, id) @@ -138,7 +138,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") payload := streamingjobs.StartStreamingJobParameters{ // ... @@ -155,7 +155,7 @@ if err := client.StartThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if err := client.StopThenPoll(ctx, id); err != nil { // handle the error @@ -167,7 +167,7 @@ if err := client.StopThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") +id := streamingjobs.NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") payload := streamingjobs.StreamingJob{ // ... diff --git a/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/id_streamingjob.go b/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/id_streamingjob.go index dbf8cb09b9c..04eaca87e12 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/id_streamingjob.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/id_streamingjob.go @@ -115,7 +115,7 @@ func (id StreamingJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), } } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/id_streamingjob_test.go b/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/id_streamingjob_test.go index 7007468702d..4ae02ab7447 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/id_streamingjob_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/streamingjobs/id_streamingjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StreamingJobId{} func TestNewStreamingJobID(t *testing.T) { - id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName") + id := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStreamingJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } } func TestFormatStreamingJobID(t *testing.T) { - actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName" + actual := NewStreamingJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStreamingJobID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStreamingJobIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Expected: &StreamingJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/README.md b/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/README.md index a3fd26a3eb5..844dbc60177 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/README.md +++ b/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := subscriptions.CompileQuery{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ListQuotas(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := subscriptions.SampleInput{ // ... @@ -78,7 +78,7 @@ if err := client.SampleInputThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := subscriptions.TestInput{ // ... @@ -95,7 +95,7 @@ if err := client.TestInputThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := subscriptions.TestOutput{ // ... @@ -112,7 +112,7 @@ if err := client.TestOutputThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := subscriptions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := subscriptions.TestQuery{ // ... diff --git a/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/id_location.go b/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/id_location.go index 8bb4b64ad39..db3d002e077 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/id_location.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/id_location_test.go b/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/id_location_test.go index 7e71efe99f1..879e8e87cb3 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/id_location_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.StreamAnalytics/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/model_sampleinputresult.go b/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/model_sampleinputresult.go index ce2ae0865e8..05095d69c42 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/model_sampleinputresult.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/subscriptions/model_sampleinputresult.go @@ -6,7 +6,7 @@ package subscriptions type SampleInputResult struct { Diagnostics *[]string `json:"diagnostics,omitempty"` Error *ErrorError `json:"error,omitempty"` - EventsDownloadUrl *string `json:"eventsDownloadUrl,omitempty"` + EventsDownloadURL *string `json:"eventsDownloadUrl,omitempty"` LastArrivalTime *string `json:"lastArrivalTime,omitempty"` Status *SampleInputResultStatus `json:"status,omitempty"` } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/transformations/README.md b/resource-manager/streamanalytics/2021-10-01-preview/transformations/README.md index 0963c1b027b..a18ae17e7f6 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/transformations/README.md +++ b/resource-manager/streamanalytics/2021-10-01-preview/transformations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName") +id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName") payload := transformations.Transformation{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName") +id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName") read, err := client.Get(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName") +id := transformations.NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName") payload := transformations.Transformation{ // ... diff --git a/resource-manager/streamanalytics/2021-10-01-preview/transformations/id_transformation.go b/resource-manager/streamanalytics/2021-10-01-preview/transformations/id_transformation.go index 02c1c8e756a..50ed62d0151 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/transformations/id_transformation.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/transformations/id_transformation.go @@ -121,7 +121,7 @@ func (id TransformationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftStreamAnalytics", "Microsoft.StreamAnalytics", "Microsoft.StreamAnalytics"), resourceids.StaticSegment("staticStreamingJobs", "streamingJobs", "streamingJobs"), - resourceids.UserSpecifiedSegment("streamingJobName", "jobName"), + resourceids.UserSpecifiedSegment("streamingJobName", "streamingJobName"), resourceids.StaticSegment("staticTransformations", "transformations", "transformations"), resourceids.UserSpecifiedSegment("transformationName", "transformationName"), } diff --git a/resource-manager/streamanalytics/2021-10-01-preview/transformations/id_transformation_test.go b/resource-manager/streamanalytics/2021-10-01-preview/transformations/id_transformation_test.go index c97aef354f2..c53ba90a17d 100644 --- a/resource-manager/streamanalytics/2021-10-01-preview/transformations/id_transformation_test.go +++ b/resource-manager/streamanalytics/2021-10-01-preview/transformations/id_transformation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TransformationId{} func TestNewTransformationID(t *testing.T) { - id := NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName") + id := NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTransformationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StreamingJobName != "jobName" { - t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "jobName") + if id.StreamingJobName != "streamingJobName" { + t.Fatalf("Expected %q but got %q for Segment 'StreamingJobName'", id.StreamingJobName, "streamingJobName") } if id.TransformationName != "transformationName" { @@ -32,8 +32,8 @@ func TestNewTransformationID(t *testing.T) { } func TestFormatTransformationID(t *testing.T) { - actual := NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "jobName", "transformationName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName" + actual := NewTransformationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "streamingJobName", "transformationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTransformationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName", Expected: &TransformationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", TransformationName: "transformationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTransformationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/tRaNsFoRmAtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/tRaNsFoRmAtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName", Expected: &TransformationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StreamingJobName: "jobName", + StreamingJobName: "streamingJobName", TransformationName: "transformationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/jobName/transformations/transformationName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.StreamAnalytics/streamingJobs/streamingJobName/transformations/transformationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/tRaNsFoRmAtIoNs/tRaNsFoRmAtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/tRaNsFoRmAtIoNs/tRaNsFoRmAtIoNnAmE", Expected: &TransformationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StreamingJobName: "jObNaMe", + StreamingJobName: "sTrEaMiNgJoBnAmE", TransformationName: "tRaNsFoRmAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/jObNaMe/tRaNsFoRmAtIoNs/tRaNsFoRmAtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sTrEaMaNaLyTiCs/sTrEaMiNgJoBs/sTrEaMiNgJoBnAmE/tRaNsFoRmAtIoNs/tRaNsFoRmAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/subscription/2021-10-01/subscriptions/model_subscriptionaliasresponseproperties.go b/resource-manager/subscription/2021-10-01/subscriptions/model_subscriptionaliasresponseproperties.go index 85942bc7777..a72986bc2ca 100644 --- a/resource-manager/subscription/2021-10-01/subscriptions/model_subscriptionaliasresponseproperties.go +++ b/resource-manager/subscription/2021-10-01/subscriptions/model_subscriptionaliasresponseproperties.go @@ -5,7 +5,7 @@ package subscriptions type SubscriptionAliasResponseProperties struct { AcceptOwnershipState *AcceptOwnership `json:"acceptOwnershipState,omitempty"` - AcceptOwnershipUrl *string `json:"acceptOwnershipUrl,omitempty"` + AcceptOwnershipURL *string `json:"acceptOwnershipUrl,omitempty"` BillingScope *string `json:"billingScope,omitempty"` CreatedTime *string `json:"createdTime,omitempty"` DisplayName *string `json:"displayName,omitempty"` diff --git a/resource-manager/synapse/2021-06-01/integrationruntime/model_cmdkeysetup.go b/resource-manager/synapse/2021-06-01/integrationruntime/model_cmdkeysetup.go new file mode 100644 index 00000000000..ac91286e8e2 --- /dev/null +++ b/resource-manager/synapse/2021-06-01/integrationruntime/model_cmdkeysetup.go @@ -0,0 +1,50 @@ +package integrationruntime + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CustomSetupBase = CmdkeySetup{} + +type CmdkeySetup struct { + TypeProperties CmdkeySetupTypeProperties `json:"typeProperties"` + + // Fields inherited from CustomSetupBase + + Type string `json:"type"` +} + +func (s CmdkeySetup) CustomSetupBase() BaseCustomSetupBaseImpl { + return BaseCustomSetupBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = CmdkeySetup{} + +func (s CmdkeySetup) MarshalJSON() ([]byte, error) { + type wrapper CmdkeySetup + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CmdkeySetup: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CmdkeySetup: %+v", err) + } + + decoded["type"] = "CmdkeySetup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CmdkeySetup: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/synapse/2021-06-01/integrationruntime/model_cmdkeysetuptypeproperties.go b/resource-manager/synapse/2021-06-01/integrationruntime/model_cmdkeysetuptypeproperties.go new file mode 100644 index 00000000000..1d42247bcf3 --- /dev/null +++ b/resource-manager/synapse/2021-06-01/integrationruntime/model_cmdkeysetuptypeproperties.go @@ -0,0 +1,45 @@ +package integrationruntime + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CmdkeySetupTypeProperties struct { + Password SecretBase `json:"password"` + TargetName interface{} `json:"targetName"` + UserName interface{} `json:"userName"` +} + +var _ json.Unmarshaler = &CmdkeySetupTypeProperties{} + +func (s *CmdkeySetupTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + TargetName interface{} `json:"targetName"` + UserName interface{} `json:"userName"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.TargetName = decoded.TargetName + s.UserName = decoded.UserName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling CmdkeySetupTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["password"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Password' for 'CmdkeySetupTypeProperties': %+v", err) + } + s.Password = impl + } + + return nil +} diff --git a/resource-manager/synapse/2021-06-01/integrationruntime/model_componentsetup.go b/resource-manager/synapse/2021-06-01/integrationruntime/model_componentsetup.go new file mode 100644 index 00000000000..9a27714e1ca --- /dev/null +++ b/resource-manager/synapse/2021-06-01/integrationruntime/model_componentsetup.go @@ -0,0 +1,50 @@ +package integrationruntime + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CustomSetupBase = ComponentSetup{} + +type ComponentSetup struct { + TypeProperties LicensedComponentSetupTypeProperties `json:"typeProperties"` + + // Fields inherited from CustomSetupBase + + Type string `json:"type"` +} + +func (s ComponentSetup) CustomSetupBase() BaseCustomSetupBaseImpl { + return BaseCustomSetupBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = ComponentSetup{} + +func (s ComponentSetup) MarshalJSON() ([]byte, error) { + type wrapper ComponentSetup + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ComponentSetup: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ComponentSetup: %+v", err) + } + + decoded["type"] = "ComponentSetup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ComponentSetup: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/synapse/2021-06-01/integrationruntime/model_customsetupbase.go b/resource-manager/synapse/2021-06-01/integrationruntime/model_customsetupbase.go index 1bc98350b0f..41c95e6fce3 100644 --- a/resource-manager/synapse/2021-06-01/integrationruntime/model_customsetupbase.go +++ b/resource-manager/synapse/2021-06-01/integrationruntime/model_customsetupbase.go @@ -3,6 +3,7 @@ package integrationruntime import ( "encoding/json" "fmt" + "strings" ) // Copyright (c) Microsoft Corporation. All rights reserved. @@ -52,6 +53,30 @@ func UnmarshalCustomSetupBaseImplementation(input []byte) (CustomSetupBase, erro value = fmt.Sprintf("%v", v) } + if strings.EqualFold(value, "CmdkeySetup") { + var out CmdkeySetup + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CmdkeySetup: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ComponentSetup") { + var out ComponentSetup + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ComponentSetup: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "EnvironmentVariableSetup") { + var out EnvironmentVariableSetup + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into EnvironmentVariableSetup: %+v", err) + } + return out, nil + } + var parent BaseCustomSetupBaseImpl if err := json.Unmarshal(input, &parent); err != nil { return nil, fmt.Errorf("unmarshaling into BaseCustomSetupBaseImpl: %+v", err) diff --git a/resource-manager/synapse/2021-06-01/integrationruntime/model_environmentvariablesetup.go b/resource-manager/synapse/2021-06-01/integrationruntime/model_environmentvariablesetup.go new file mode 100644 index 00000000000..5fa1e9a66de --- /dev/null +++ b/resource-manager/synapse/2021-06-01/integrationruntime/model_environmentvariablesetup.go @@ -0,0 +1,50 @@ +package integrationruntime + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ CustomSetupBase = EnvironmentVariableSetup{} + +type EnvironmentVariableSetup struct { + TypeProperties EnvironmentVariableSetupTypeProperties `json:"typeProperties"` + + // Fields inherited from CustomSetupBase + + Type string `json:"type"` +} + +func (s EnvironmentVariableSetup) CustomSetupBase() BaseCustomSetupBaseImpl { + return BaseCustomSetupBaseImpl{ + Type: s.Type, + } +} + +var _ json.Marshaler = EnvironmentVariableSetup{} + +func (s EnvironmentVariableSetup) MarshalJSON() ([]byte, error) { + type wrapper EnvironmentVariableSetup + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling EnvironmentVariableSetup: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling EnvironmentVariableSetup: %+v", err) + } + + decoded["type"] = "EnvironmentVariableSetup" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling EnvironmentVariableSetup: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/synapse/2021-06-01/integrationruntime/model_environmentvariablesetuptypeproperties.go b/resource-manager/synapse/2021-06-01/integrationruntime/model_environmentvariablesetuptypeproperties.go new file mode 100644 index 00000000000..8409818a664 --- /dev/null +++ b/resource-manager/synapse/2021-06-01/integrationruntime/model_environmentvariablesetuptypeproperties.go @@ -0,0 +1,9 @@ +package integrationruntime + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EnvironmentVariableSetupTypeProperties struct { + VariableName string `json:"variableName"` + VariableValue string `json:"variableValue"` +} diff --git a/resource-manager/synapse/2021-06-01/integrationruntime/model_licensedcomponentsetuptypeproperties.go b/resource-manager/synapse/2021-06-01/integrationruntime/model_licensedcomponentsetuptypeproperties.go new file mode 100644 index 00000000000..cb2cdbc797a --- /dev/null +++ b/resource-manager/synapse/2021-06-01/integrationruntime/model_licensedcomponentsetuptypeproperties.go @@ -0,0 +1,42 @@ +package integrationruntime + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LicensedComponentSetupTypeProperties struct { + ComponentName string `json:"componentName"` + LicenseKey SecretBase `json:"licenseKey"` +} + +var _ json.Unmarshaler = &LicensedComponentSetupTypeProperties{} + +func (s *LicensedComponentSetupTypeProperties) UnmarshalJSON(bytes []byte) error { + var decoded struct { + ComponentName string `json:"componentName"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.ComponentName = decoded.ComponentName + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling LicensedComponentSetupTypeProperties into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["licenseKey"]; ok { + impl, err := UnmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'LicenseKey' for 'LicensedComponentSetupTypeProperties': %+v", err) + } + s.LicenseKey = impl + } + + return nil +} diff --git a/resource-manager/synapse/2021-06-01/integrationruntime/model_selfhostedintegrationruntimestatustypeproperties.go b/resource-manager/synapse/2021-06-01/integrationruntime/model_selfhostedintegrationruntimestatustypeproperties.go index 70c1bb969f9..4b8ccbc9ad5 100644 --- a/resource-manager/synapse/2021-06-01/integrationruntime/model_selfhostedintegrationruntimestatustypeproperties.go +++ b/resource-manager/synapse/2021-06-01/integrationruntime/model_selfhostedintegrationruntimestatustypeproperties.go @@ -22,7 +22,7 @@ type SelfHostedIntegrationRuntimeStatusTypeProperties struct { Nodes *[]SelfHostedIntegrationRuntimeNode `json:"nodes,omitempty"` PushedVersion *string `json:"pushedVersion,omitempty"` ScheduledUpdateDate *string `json:"scheduledUpdateDate,omitempty"` - ServiceUrls *[]string `json:"serviceUrls,omitempty"` + ServiceURLs *[]string `json:"serviceUrls,omitempty"` TaskQueueId *string `json:"taskQueueId,omitempty"` UpdateDelayOffset *string `json:"updateDelayOffset,omitempty"` Version *string `json:"version,omitempty"` diff --git a/resource-manager/synapse/2021-06-01/ipfirewallrules/README.md b/resource-manager/synapse/2021-06-01/ipfirewallrules/README.md index e1bf2619953..a7e422bfd5f 100644 --- a/resource-manager/synapse/2021-06-01/ipfirewallrules/README.md +++ b/resource-manager/synapse/2021-06-01/ipfirewallrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := ipfirewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName") +id := ipfirewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "firewallRuleName") payload := ipfirewallrules.IPFirewallRuleInfo{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := ipfirewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName") +id := ipfirewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "firewallRuleName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := ipfirewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName") +id := ipfirewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "firewallRuleName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/synapse/2021-06-01/ipfirewallrules/id_firewallrule.go b/resource-manager/synapse/2021-06-01/ipfirewallrules/id_firewallrule.go index 309aded8a44..87e0230428c 100644 --- a/resource-manager/synapse/2021-06-01/ipfirewallrules/id_firewallrule.go +++ b/resource-manager/synapse/2021-06-01/ipfirewallrules/id_firewallrule.go @@ -123,7 +123,7 @@ func (id FirewallRuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), - resourceids.UserSpecifiedSegment("firewallRuleName", "ruleName"), + resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleName"), } } diff --git a/resource-manager/synapse/2021-06-01/ipfirewallrules/id_firewallrule_test.go b/resource-manager/synapse/2021-06-01/ipfirewallrules/id_firewallrule_test.go index ff1575a0d6d..0fb4fa8f301 100644 --- a/resource-manager/synapse/2021-06-01/ipfirewallrules/id_firewallrule_test.go +++ b/resource-manager/synapse/2021-06-01/ipfirewallrules/id_firewallrule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FirewallRuleId{} func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName") + id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "firewallRuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewFirewallRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.FirewallRuleName != "ruleName" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "ruleName") + if id.FirewallRuleName != "firewallRuleName" { + t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "firewallRuleName") } } func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "ruleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/ruleName" + actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "firewallRuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/firewallRuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseFirewallRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FirewallRuleName: "ruleName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/firewallRuleName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseFirewallRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/ruleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/firewallRuleName", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - FirewallRuleName: "ruleName", + FirewallRuleName: "firewallRuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/ruleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/firewallRules/firewallRuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/fIrEwAlLrUlEs/rUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE", Expected: &FirewallRuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - FirewallRuleName: "rUlEnAmE", + FirewallRuleName: "fIrEwAlLrUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/fIrEwAlLrUlEs/rUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/fIrEwAlLrUlEs/fIrEwAlLrUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/synapse/2021-06-01/keys/model_keyproperties.go b/resource-manager/synapse/2021-06-01/keys/model_keyproperties.go index 253fb70487f..2c23b64ec2c 100644 --- a/resource-manager/synapse/2021-06-01/keys/model_keyproperties.go +++ b/resource-manager/synapse/2021-06-01/keys/model_keyproperties.go @@ -5,5 +5,5 @@ package keys type KeyProperties struct { IsActiveCMK *bool `json:"isActiveCMK,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` } diff --git a/resource-manager/synapse/2021-06-01/recoverablesqlpools/README.md b/resource-manager/synapse/2021-06-01/recoverablesqlpools/README.md index ce4b00bfa24..bd60a72162c 100644 --- a/resource-manager/synapse/2021-06-01/recoverablesqlpools/README.md +++ b/resource-manager/synapse/2021-06-01/recoverablesqlpools/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := recoverablesqlpools.NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") +id := recoverablesqlpools.NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "recoverableSqlPoolName") read, err := client.WorkspaceManagedSqlServerRecoverableSqlPoolsGet(ctx, id) if err != nil { diff --git a/resource-manager/synapse/2021-06-01/recoverablesqlpools/id_recoverablesqlpool.go b/resource-manager/synapse/2021-06-01/recoverablesqlpools/id_recoverablesqlpool.go index 52ed9973f4a..4a6204ea855 100644 --- a/resource-manager/synapse/2021-06-01/recoverablesqlpools/id_recoverablesqlpool.go +++ b/resource-manager/synapse/2021-06-01/recoverablesqlpools/id_recoverablesqlpool.go @@ -123,7 +123,7 @@ func (id RecoverableSqlPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticRecoverableSqlPools", "recoverableSqlPools", "recoverableSqlPools"), - resourceids.UserSpecifiedSegment("recoverableSqlPoolName", "sqlPoolName"), + resourceids.UserSpecifiedSegment("recoverableSqlPoolName", "recoverableSqlPoolName"), } } diff --git a/resource-manager/synapse/2021-06-01/recoverablesqlpools/id_recoverablesqlpool_test.go b/resource-manager/synapse/2021-06-01/recoverablesqlpools/id_recoverablesqlpool_test.go index 37574426e91..a9de9485d61 100644 --- a/resource-manager/synapse/2021-06-01/recoverablesqlpools/id_recoverablesqlpool_test.go +++ b/resource-manager/synapse/2021-06-01/recoverablesqlpools/id_recoverablesqlpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoverableSqlPoolId{} func TestNewRecoverableSqlPoolID(t *testing.T) { - id := NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") + id := NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "recoverableSqlPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRecoverableSqlPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.RecoverableSqlPoolName != "sqlPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'RecoverableSqlPoolName'", id.RecoverableSqlPoolName, "sqlPoolName") + if id.RecoverableSqlPoolName != "recoverableSqlPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'RecoverableSqlPoolName'", id.RecoverableSqlPoolName, "recoverableSqlPoolName") } } func TestFormatRecoverableSqlPoolID(t *testing.T) { - actual := NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName" + actual := NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "recoverableSqlPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRecoverableSqlPoolID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName", Expected: &RecoverableSqlPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - RecoverableSqlPoolName: "sqlPoolName", + RecoverableSqlPoolName: "recoverableSqlPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRecoverableSqlPoolIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName", Expected: &RecoverableSqlPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - RecoverableSqlPoolName: "sqlPoolName", + RecoverableSqlPoolName: "recoverableSqlPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/rEcOvErAbLeSqLpOoLs/sQlPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/rEcOvErAbLeSqLpOoLs/rEcOvErAbLeSqLpOoLnAmE", Expected: &RecoverableSqlPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - RecoverableSqlPoolName: "sQlPoOlNaMe", + RecoverableSqlPoolName: "rEcOvErAbLeSqLpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/rEcOvErAbLeSqLpOoLs/sQlPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/rEcOvErAbLeSqLpOoLs/rEcOvErAbLeSqLpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/README.md b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/README.md index 233981c4af7..759e12157fe 100644 --- a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/README.md +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/README.md @@ -20,6 +20,43 @@ client.Client.Authorizer = authorizer ``` +### Example Usage: `SqlPoolsBlobAuditingClient.ExtendedSqlPoolBlobAuditingPoliciesCreateOrUpdate` + +```go +ctx := context.TODO() +id := sqlpoolsblobauditing.NewSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") + +payload := sqlpoolsblobauditing.ExtendedSqlPoolBlobAuditingPolicy{ + // ... +} + + +read, err := client.ExtendedSqlPoolBlobAuditingPoliciesCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SqlPoolsBlobAuditingClient.ExtendedSqlPoolBlobAuditingPoliciesGet` + +```go +ctx := context.TODO() +id := sqlpoolsblobauditing.NewSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") + +read, err := client.ExtendedSqlPoolBlobAuditingPoliciesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + ### Example Usage: `SqlPoolsBlobAuditingClient.ExtendedSqlPoolBlobAuditingPoliciesListBySqlPool` ```go @@ -35,3 +72,57 @@ for _, item := range items { // do something } ``` + + +### Example Usage: `SqlPoolsBlobAuditingClient.SqlPoolBlobAuditingPoliciesCreateOrUpdate` + +```go +ctx := context.TODO() +id := sqlpoolsblobauditing.NewSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") + +payload := sqlpoolsblobauditing.SqlPoolBlobAuditingPolicy{ + // ... +} + + +read, err := client.SqlPoolBlobAuditingPoliciesCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SqlPoolsBlobAuditingClient.SqlPoolBlobAuditingPoliciesGet` + +```go +ctx := context.TODO() +id := sqlpoolsblobauditing.NewSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") + +read, err := client.SqlPoolBlobAuditingPoliciesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SqlPoolsBlobAuditingClient.SqlPoolBlobAuditingPoliciesListBySqlPool` + +```go +ctx := context.TODO() +id := sqlpoolsblobauditing.NewSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") + +// alternatively `client.SqlPoolBlobAuditingPoliciesListBySqlPool(ctx, id)` can be used to do batched pagination +items, err := client.SqlPoolBlobAuditingPoliciesListBySqlPoolComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_extendedsqlpoolblobauditingpoliciescreateorupdate.go b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_extendedsqlpoolblobauditingpoliciescreateorupdate.go new file mode 100644 index 00000000000..223da88b7ea --- /dev/null +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_extendedsqlpoolblobauditingpoliciescreateorupdate.go @@ -0,0 +1,59 @@ +package sqlpoolsblobauditing + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedSqlPoolBlobAuditingPoliciesCreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ExtendedSqlPoolBlobAuditingPolicy +} + +// ExtendedSqlPoolBlobAuditingPoliciesCreateOrUpdate ... +func (c SqlPoolsBlobAuditingClient) ExtendedSqlPoolBlobAuditingPoliciesCreateOrUpdate(ctx context.Context, id SqlPoolId, input ExtendedSqlPoolBlobAuditingPolicy) (result ExtendedSqlPoolBlobAuditingPoliciesCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/extendedAuditingSettings/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model ExtendedSqlPoolBlobAuditingPolicy + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_extendedsqlpoolblobauditingpoliciesget.go b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_extendedsqlpoolblobauditingpoliciesget.go new file mode 100644 index 00000000000..cc0938a821b --- /dev/null +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_extendedsqlpoolblobauditingpoliciesget.go @@ -0,0 +1,54 @@ +package sqlpoolsblobauditing + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedSqlPoolBlobAuditingPoliciesGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ExtendedSqlPoolBlobAuditingPolicy +} + +// ExtendedSqlPoolBlobAuditingPoliciesGet ... +func (c SqlPoolsBlobAuditingClient) ExtendedSqlPoolBlobAuditingPoliciesGet(ctx context.Context, id SqlPoolId) (result ExtendedSqlPoolBlobAuditingPoliciesGetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/extendedAuditingSettings/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model ExtendedSqlPoolBlobAuditingPolicy + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpoliciescreateorupdate.go b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpoliciescreateorupdate.go new file mode 100644 index 00000000000..f54aacdfcb5 --- /dev/null +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpoliciescreateorupdate.go @@ -0,0 +1,59 @@ +package sqlpoolsblobauditing + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlPoolBlobAuditingPoliciesCreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SqlPoolBlobAuditingPolicy +} + +// SqlPoolBlobAuditingPoliciesCreateOrUpdate ... +func (c SqlPoolsBlobAuditingClient) SqlPoolBlobAuditingPoliciesCreateOrUpdate(ctx context.Context, id SqlPoolId, input SqlPoolBlobAuditingPolicy) (result SqlPoolBlobAuditingPoliciesCreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/auditingSettings/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model SqlPoolBlobAuditingPolicy + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpoliciesget.go b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpoliciesget.go new file mode 100644 index 00000000000..1a6e44a27c3 --- /dev/null +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpoliciesget.go @@ -0,0 +1,54 @@ +package sqlpoolsblobauditing + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlPoolBlobAuditingPoliciesGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SqlPoolBlobAuditingPolicy +} + +// SqlPoolBlobAuditingPoliciesGet ... +func (c SqlPoolsBlobAuditingClient) SqlPoolBlobAuditingPoliciesGet(ctx context.Context, id SqlPoolId) (result SqlPoolBlobAuditingPoliciesGetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/auditingSettings/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model SqlPoolBlobAuditingPolicy + result.Model = &model + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpolicieslistbysqlpool.go b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpolicieslistbysqlpool.go new file mode 100644 index 00000000000..349e05e349a --- /dev/null +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/method_sqlpoolblobauditingpolicieslistbysqlpool.go @@ -0,0 +1,105 @@ +package sqlpoolsblobauditing + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlPoolBlobAuditingPoliciesListBySqlPoolOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]SqlPoolBlobAuditingPolicy +} + +type SqlPoolBlobAuditingPoliciesListBySqlPoolCompleteResult struct { + LatestHttpResponse *http.Response + Items []SqlPoolBlobAuditingPolicy +} + +type SqlPoolBlobAuditingPoliciesListBySqlPoolCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *SqlPoolBlobAuditingPoliciesListBySqlPoolCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// SqlPoolBlobAuditingPoliciesListBySqlPool ... +func (c SqlPoolsBlobAuditingClient) SqlPoolBlobAuditingPoliciesListBySqlPool(ctx context.Context, id SqlPoolId) (result SqlPoolBlobAuditingPoliciesListBySqlPoolOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &SqlPoolBlobAuditingPoliciesListBySqlPoolCustomPager{}, + Path: fmt.Sprintf("%s/auditingSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]SqlPoolBlobAuditingPolicy `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// SqlPoolBlobAuditingPoliciesListBySqlPoolComplete retrieves all the results into a single object +func (c SqlPoolsBlobAuditingClient) SqlPoolBlobAuditingPoliciesListBySqlPoolComplete(ctx context.Context, id SqlPoolId) (SqlPoolBlobAuditingPoliciesListBySqlPoolCompleteResult, error) { + return c.SqlPoolBlobAuditingPoliciesListBySqlPoolCompleteMatchingPredicate(ctx, id, SqlPoolBlobAuditingPolicyOperationPredicate{}) +} + +// SqlPoolBlobAuditingPoliciesListBySqlPoolCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c SqlPoolsBlobAuditingClient) SqlPoolBlobAuditingPoliciesListBySqlPoolCompleteMatchingPredicate(ctx context.Context, id SqlPoolId, predicate SqlPoolBlobAuditingPolicyOperationPredicate) (result SqlPoolBlobAuditingPoliciesListBySqlPoolCompleteResult, err error) { + items := make([]SqlPoolBlobAuditingPolicy, 0) + + resp, err := c.SqlPoolBlobAuditingPoliciesListBySqlPool(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = SqlPoolBlobAuditingPoliciesListBySqlPoolCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/model_sqlpoolblobauditingpolicy.go b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/model_sqlpoolblobauditingpolicy.go new file mode 100644 index 00000000000..121c6db1e70 --- /dev/null +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/model_sqlpoolblobauditingpolicy.go @@ -0,0 +1,12 @@ +package sqlpoolsblobauditing + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlPoolBlobAuditingPolicy struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SqlPoolBlobAuditingPolicyProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/model_sqlpoolblobauditingpolicyproperties.go b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/model_sqlpoolblobauditingpolicyproperties.go new file mode 100644 index 00000000000..69e5fd0895e --- /dev/null +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/model_sqlpoolblobauditingpolicyproperties.go @@ -0,0 +1,15 @@ +package sqlpoolsblobauditing + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SqlPoolBlobAuditingPolicyProperties struct { + AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"` + IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"` + RetentionDays *int64 `json:"retentionDays,omitempty"` + State BlobAuditingPolicyState `json:"state"` + StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` + StorageAccountSubscriptionId *string `json:"storageAccountSubscriptionId,omitempty"` + StorageEndpoint *string `json:"storageEndpoint,omitempty"` +} diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/predicates.go b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/predicates.go index 6ed0f55329f..d559d2c386f 100644 --- a/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/predicates.go +++ b/resource-manager/synapse/2021-06-01/sqlpoolsblobauditing/predicates.go @@ -25,3 +25,31 @@ func (p ExtendedSqlPoolBlobAuditingPolicyOperationPredicate) Matches(input Exten return true } + +type SqlPoolBlobAuditingPolicyOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p SqlPoolBlobAuditingPolicyOperationPredicate) Matches(input SqlPoolBlobAuditingPolicy) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/README.md b/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/README.md index 47525c76df1..c449d54b89f 100644 --- a/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/README.md +++ b/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sqlpoolsdatamaskingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName", "dataMaskingRuleName") +id := sqlpoolsdatamaskingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName", "ruleName") payload := sqlpoolsdatamaskingrules.DataMaskingRule{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := sqlpoolsdatamaskingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName", "dataMaskingRuleName") +id := sqlpoolsdatamaskingrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName", "ruleName") read, err := client.DataMaskingRulesGet(ctx, id) if err != nil { diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/id_rule.go b/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/id_rule.go index ddf6e80e59c..a3b78ef11e3 100644 --- a/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/id_rule.go +++ b/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/id_rule.go @@ -133,7 +133,7 @@ func (id RuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDataMaskingPolicies", "dataMaskingPolicies", "dataMaskingPolicies"), resourceids.StaticSegment("dataMaskingPolicyName", "default", "default"), resourceids.StaticSegment("staticRules", "rules", "rules"), - resourceids.UserSpecifiedSegment("ruleName", "dataMaskingRuleName"), + resourceids.UserSpecifiedSegment("ruleName", "ruleName"), } } diff --git a/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/id_rule_test.go b/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/id_rule_test.go index b19d1082499..e59cd9ca75b 100644 --- a/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/id_rule_test.go +++ b/resource-manager/synapse/2021-06-01/sqlpoolsdatamaskingrules/id_rule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RuleId{} func TestNewRuleID(t *testing.T) { - id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName", "dataMaskingRuleName") + id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName", "ruleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewRuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SqlPoolName'", id.SqlPoolName, "sqlPoolName") } - if id.RuleName != "dataMaskingRuleName" { - t.Fatalf("Expected %q but got %q for Segment 'RuleName'", id.RuleName, "dataMaskingRuleName") + if id.RuleName != "ruleName" { + t.Fatalf("Expected %q but got %q for Segment 'RuleName'", id.RuleName, "ruleName") } } func TestFormatRuleID(t *testing.T) { - actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName", "dataMaskingRuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/dataMaskingRuleName" + actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName", "ruleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/ruleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -121,18 +121,18 @@ func TestParseRuleID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/dataMaskingRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", SqlPoolName: "sqlPoolName", - RuleName: "dataMaskingRuleName", + RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/dataMaskingRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/ruleName/extra", Error: true, }, } @@ -317,34 +317,34 @@ func TestParseRuleIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/dataMaskingRuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/ruleName", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", SqlPoolName: "sqlPoolName", - RuleName: "dataMaskingRuleName", + RuleName: "ruleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/dataMaskingRuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/sqlPools/sqlPoolName/dataMaskingPolicies/default/rules/ruleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/sQlPoOlS/sQlPoOlNaMe/dAtAmAsKiNgPoLiCiEs/dEfAuLt/rUlEs/dAtAmAsKiNgRuLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/sQlPoOlS/sQlPoOlNaMe/dAtAmAsKiNgPoLiCiEs/dEfAuLt/rUlEs/rUlEnAmE", Expected: &RuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", SqlPoolName: "sQlPoOlNaMe", - RuleName: "dAtAmAsKiNgRuLeNaMe", + RuleName: "rUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/sQlPoOlS/sQlPoOlNaMe/dAtAmAsKiNgPoLiCiEs/dEfAuLt/rUlEs/dAtAmAsKiNgRuLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/sQlPoOlS/sQlPoOlNaMe/dAtAmAsKiNgPoLiCiEs/dEfAuLt/rUlEs/rUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/README.md b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/README.md index 8aa473ff9db..145d3473235 100644 --- a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/README.md +++ b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspacemanagedsqlserver.NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") +id := workspacemanagedsqlserver.NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "recoverableSqlPoolName") read, err := client.RecoverableSqlPoolsGet(ctx, id) if err != nil { diff --git a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/id_recoverablesqlpool.go b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/id_recoverablesqlpool.go index 3174943e57c..ac598b02aaf 100644 --- a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/id_recoverablesqlpool.go +++ b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/id_recoverablesqlpool.go @@ -123,7 +123,7 @@ func (id RecoverableSqlPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticRecoverableSqlPools", "recoverableSqlPools", "recoverableSqlPools"), - resourceids.UserSpecifiedSegment("recoverableSqlPoolName", "sqlPoolName"), + resourceids.UserSpecifiedSegment("recoverableSqlPoolName", "recoverableSqlPoolName"), } } diff --git a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/id_recoverablesqlpool_test.go b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/id_recoverablesqlpool_test.go index 7a93ee7c521..2e808552898 100644 --- a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/id_recoverablesqlpool_test.go +++ b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserver/id_recoverablesqlpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RecoverableSqlPoolId{} func TestNewRecoverableSqlPoolID(t *testing.T) { - id := NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName") + id := NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "recoverableSqlPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRecoverableSqlPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.RecoverableSqlPoolName != "sqlPoolName" { - t.Fatalf("Expected %q but got %q for Segment 'RecoverableSqlPoolName'", id.RecoverableSqlPoolName, "sqlPoolName") + if id.RecoverableSqlPoolName != "recoverableSqlPoolName" { + t.Fatalf("Expected %q but got %q for Segment 'RecoverableSqlPoolName'", id.RecoverableSqlPoolName, "recoverableSqlPoolName") } } func TestFormatRecoverableSqlPoolID(t *testing.T) { - actual := NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "sqlPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName" + actual := NewRecoverableSqlPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "recoverableSqlPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRecoverableSqlPoolID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName", Expected: &RecoverableSqlPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - RecoverableSqlPoolName: "sqlPoolName", + RecoverableSqlPoolName: "recoverableSqlPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRecoverableSqlPoolIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName", Expected: &RecoverableSqlPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - RecoverableSqlPoolName: "sqlPoolName", + RecoverableSqlPoolName: "recoverableSqlPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/sqlPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/recoverableSqlPools/recoverableSqlPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/rEcOvErAbLeSqLpOoLs/sQlPoOlNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/rEcOvErAbLeSqLpOoLs/rEcOvErAbLeSqLpOoLnAmE", Expected: &RecoverableSqlPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - RecoverableSqlPoolName: "sQlPoOlNaMe", + RecoverableSqlPoolName: "rEcOvErAbLeSqLpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/rEcOvErAbLeSqLpOoLs/sQlPoOlNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/rEcOvErAbLeSqLpOoLs/rEcOvErAbLeSqLpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/README.md b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/README.md index 3be6060564d..bbab59c9aa9 100644 --- a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/README.md +++ b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workspacemanagedsqlserverdedicatedsqlminimaltlssettings.NewDedicatedSQLMinimalTLSSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dedicatedSQLminimalTlsSettingsName") +id := workspacemanagedsqlserverdedicatedsqlminimaltlssettings.NewDedicatedSQLMinimalTLSSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dedicatedSQLMinimalTLSSettingName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/id_dedicatedsqlminimaltlssetting.go b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/id_dedicatedsqlminimaltlssetting.go index 1fda2dd6370..aa68bcf0d14 100644 --- a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/id_dedicatedsqlminimaltlssetting.go +++ b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/id_dedicatedsqlminimaltlssetting.go @@ -123,7 +123,7 @@ func (id DedicatedSQLMinimalTLSSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), resourceids.StaticSegment("staticDedicatedSQLMinimalTLSSettings", "dedicatedSQLMinimalTLSSettings", "dedicatedSQLMinimalTLSSettings"), - resourceids.UserSpecifiedSegment("dedicatedSQLMinimalTLSSettingName", "dedicatedSQLminimalTlsSettingsName"), + resourceids.UserSpecifiedSegment("dedicatedSQLMinimalTLSSettingName", "dedicatedSQLMinimalTLSSettingName"), } } diff --git a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/id_dedicatedsqlminimaltlssetting_test.go b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/id_dedicatedsqlminimaltlssetting_test.go index be80102bf52..59c81354b7c 100644 --- a/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/id_dedicatedsqlminimaltlssetting_test.go +++ b/resource-manager/synapse/2021-06-01/workspacemanagedsqlserverdedicatedsqlminimaltlssettings/id_dedicatedsqlminimaltlssetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DedicatedSQLMinimalTLSSettingId{} func TestNewDedicatedSQLMinimalTLSSettingID(t *testing.T) { - id := NewDedicatedSQLMinimalTLSSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dedicatedSQLminimalTlsSettingsName") + id := NewDedicatedSQLMinimalTLSSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dedicatedSQLMinimalTLSSettingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDedicatedSQLMinimalTLSSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") } - if id.DedicatedSQLMinimalTLSSettingName != "dedicatedSQLminimalTlsSettingsName" { - t.Fatalf("Expected %q but got %q for Segment 'DedicatedSQLMinimalTLSSettingName'", id.DedicatedSQLMinimalTLSSettingName, "dedicatedSQLminimalTlsSettingsName") + if id.DedicatedSQLMinimalTLSSettingName != "dedicatedSQLMinimalTLSSettingName" { + t.Fatalf("Expected %q but got %q for Segment 'DedicatedSQLMinimalTLSSettingName'", id.DedicatedSQLMinimalTLSSettingName, "dedicatedSQLMinimalTLSSettingName") } } func TestFormatDedicatedSQLMinimalTLSSettingID(t *testing.T) { - actual := NewDedicatedSQLMinimalTLSSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dedicatedSQLminimalTlsSettingsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLminimalTlsSettingsName" + actual := NewDedicatedSQLMinimalTLSSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "dedicatedSQLMinimalTLSSettingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLMinimalTLSSettingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDedicatedSQLMinimalTLSSettingID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLminimalTlsSettingsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLMinimalTLSSettingName", Expected: &DedicatedSQLMinimalTLSSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DedicatedSQLMinimalTLSSettingName: "dedicatedSQLminimalTlsSettingsName", + DedicatedSQLMinimalTLSSettingName: "dedicatedSQLMinimalTLSSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLminimalTlsSettingsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLMinimalTLSSettingName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDedicatedSQLMinimalTLSSettingIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLminimalTlsSettingsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLMinimalTLSSettingName", Expected: &DedicatedSQLMinimalTLSSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", WorkspaceName: "workspaceName", - DedicatedSQLMinimalTLSSettingName: "dedicatedSQLminimalTlsSettingsName", + DedicatedSQLMinimalTLSSettingName: "dedicatedSQLMinimalTLSSettingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLminimalTlsSettingsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Synapse/workspaces/workspaceName/dedicatedSQLMinimalTLSSettings/dedicatedSQLMinimalTLSSettingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/dEdIcAtEdSqLmInImAlTlSsEtTiNgS/dEdIcAtEdSqLmInImAlTlSsEtTiNgSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/dEdIcAtEdSqLmInImAlTlSsEtTiNgS/dEdIcAtEdSqLmInImAlTlSsEtTiNgNaMe", Expected: &DedicatedSQLMinimalTLSSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", WorkspaceName: "wOrKsPaCeNaMe", - DedicatedSQLMinimalTLSSettingName: "dEdIcAtEdSqLmInImAlTlSsEtTiNgSnAmE", + DedicatedSQLMinimalTLSSettingName: "dEdIcAtEdSqLmInImAlTlSsEtTiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/dEdIcAtEdSqLmInImAlTlSsEtTiNgS/dEdIcAtEdSqLmInImAlTlSsEtTiNgSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sYnApSe/wOrKsPaCeS/wOrKsPaCeNaMe/dEdIcAtEdSqLmInImAlTlSsEtTiNgS/dEdIcAtEdSqLmInImAlTlSsEtTiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/synapse/2021-06-01/workspaces/model_datalakestorageaccountdetails.go b/resource-manager/synapse/2021-06-01/workspaces/model_datalakestorageaccountdetails.go index 2e986cadb83..982a9085703 100644 --- a/resource-manager/synapse/2021-06-01/workspaces/model_datalakestorageaccountdetails.go +++ b/resource-manager/synapse/2021-06-01/workspaces/model_datalakestorageaccountdetails.go @@ -4,7 +4,7 @@ package workspaces // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type DataLakeStorageAccountDetails struct { - AccountUrl *string `json:"accountUrl,omitempty"` + AccountURL *string `json:"accountUrl,omitempty"` CreateManagedPrivateEndpoint *bool `json:"createManagedPrivateEndpoint,omitempty"` Filesystem *string `json:"filesystem,omitempty"` ResourceId *string `json:"resourceId,omitempty"` diff --git a/resource-manager/synapse/2021-06-01/workspaces/model_workspacekeydetails.go b/resource-manager/synapse/2021-06-01/workspaces/model_workspacekeydetails.go index 991c15f69c9..f4981818b77 100644 --- a/resource-manager/synapse/2021-06-01/workspaces/model_workspacekeydetails.go +++ b/resource-manager/synapse/2021-06-01/workspaces/model_workspacekeydetails.go @@ -4,6 +4,6 @@ package workspaces // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WorkspaceKeyDetails struct { - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` Name *string `json:"name,omitempty"` } diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/README.md b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/README.md index 722c37d0ab7..b2468de3335 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/README.md +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") payload := availabilitysets.AvailabilitySet{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") if err := client.DeleteThenPoll(ctx, id, availabilitysets.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, availabilitysets.DefaultDeleteOperation ```go ctx := context.TODO() -id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") payload := availabilitysets.AvailabilitySetTagsUpdate{ // ... diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset.go b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset.go index f775bce5ea9..8fd9d1dcc78 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset.go +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset.go @@ -115,7 +115,7 @@ func (id AvailabilitySetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), resourceids.StaticSegment("staticAvailabilitySets", "availabilitySets", "availabilitySets"), - resourceids.UserSpecifiedSegment("availabilitySetName", "availabilitySetResourceName"), + resourceids.UserSpecifiedSegment("availabilitySetName", "availabilitySetName"), } } diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset_test.go b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset_test.go index a37e7c6557a..712cfc8b3ed 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset_test.go +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AvailabilitySetId{} func TestNewAvailabilitySetID(t *testing.T) { - id := NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") + id := NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAvailabilitySetID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AvailabilitySetName != "availabilitySetResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'AvailabilitySetName'", id.AvailabilitySetName, "availabilitySetResourceName") + if id.AvailabilitySetName != "availabilitySetName" { + t.Fatalf("Expected %q but got %q for Segment 'AvailabilitySetName'", id.AvailabilitySetName, "availabilitySetName") } } func TestFormatAvailabilitySetID(t *testing.T) { - actual := NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName" + actual := NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAvailabilitySetID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName", Expected: &AvailabilitySetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AvailabilitySetName: "availabilitySetResourceName", + AvailabilitySetName: "availabilitySetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAvailabilitySetIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName", Expected: &AvailabilitySetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AvailabilitySetName: "availabilitySetResourceName", + AvailabilitySetName: "availabilitySetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/aVaIlAbIlItYsEtS/aVaIlAbIlItYsEtReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/aVaIlAbIlItYsEtS/aVaIlAbIlItYsEtNaMe", Expected: &AvailabilitySetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AvailabilitySetName: "aVaIlAbIlItYsEtReSoUrCeNaMe", + AvailabilitySetName: "aVaIlAbIlItYsEtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/aVaIlAbIlItYsEtS/aVaIlAbIlItYsEtReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/aVaIlAbIlItYsEtS/aVaIlAbIlItYsEtNaMe/extra", Error: true, }, } diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/README.md b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/README.md index 4c9869cdd2e..ed84d9c06fa 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/README.md +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") payload := clouds.Cloud{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") if err := client.DeleteThenPoll(ctx, id, clouds.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, clouds.DefaultDeleteOperationOptions()) ```go ctx := context.TODO() -id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") payload := clouds.CloudTagsUpdate{ // ... diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud.go b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud.go index abfdcf93409..7409bf64687 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud.go +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud.go @@ -115,7 +115,7 @@ func (id CloudId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), resourceids.StaticSegment("staticClouds", "clouds", "clouds"), - resourceids.UserSpecifiedSegment("cloudName", "cloudResourceName"), + resourceids.UserSpecifiedSegment("cloudName", "cloudName"), } } diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud_test.go b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud_test.go index 6d122fe16f1..a9bff2b84b7 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud_test.go +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CloudId{} func TestNewCloudID(t *testing.T) { - id := NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") + id := NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCloudID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudName != "cloudResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'CloudName'", id.CloudName, "cloudResourceName") + if id.CloudName != "cloudName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudName'", id.CloudName, "cloudName") } } func TestFormatCloudID(t *testing.T) { - actual := NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName" + actual := NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCloudID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName", Expected: &CloudId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudName: "cloudResourceName", + CloudName: "cloudName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCloudIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName", Expected: &CloudId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudName: "cloudResourceName", + CloudName: "cloudName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/cLoUdS/cLoUdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/cLoUdS/cLoUdNaMe", Expected: &CloudId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudName: "cLoUdReSoUrCeNaMe", + CloudName: "cLoUdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/cLoUdS/cLoUdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/cLoUdS/cLoUdNaMe/extra", Error: true, }, } diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/README.md b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/README.md index b00dfcb6eca..91993853fc5 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/README.md +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName") payload := inventoryitems.InventoryItem{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem.go b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem.go index 39a388561f4..4d8be24e322 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem.go +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem.go @@ -123,7 +123,7 @@ func (id InventoryItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVmmServers", "vmmServers", "vmmServers"), resourceids.UserSpecifiedSegment("vmmServerName", "vmmServerName"), resourceids.StaticSegment("staticInventoryItems", "inventoryItems", "inventoryItems"), - resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemResourceName"), + resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemName"), } } diff --git a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem_test.go b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem_test.go index 79ef5491b5b..6126684898b 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem_test.go +++ b/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InventoryItemId{} func TestNewInventoryItemID(t *testing.T) { - id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName") + id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewInventoryItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VmmServerName'", id.VmmServerName, "vmmServerName") } - if id.InventoryItemName != "inventoryItemResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'InventoryItemName'", id.InventoryItemName, "inventoryItemResourceName") + if id.InventoryItemName != "inventoryItemName" { + t.Fatalf("Expected %q but got %q for Segment 'InventoryItemName'", id.InventoryItemName, "inventoryItemName") } } func TestFormatInventoryItemID(t *testing.T) { - actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName" + actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseInventoryItemID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VmmServerName: "vmmServerName", - InventoryItemName: "inventoryItemResourceName", + InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VmmServerName: "vmmServerName", - InventoryItemName: "inventoryItemResourceName", + InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/vMmSeRvErS/vMmSeRvErNaMe/iNvEnToRyItEmS/iNvEnToRyItEmReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/vMmSeRvErS/vMmSeRvErNaMe/iNvEnToRyItEmS/iNvEnToRyItEmNaMe", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VmmServerName: "vMmSeRvErNaMe", - InventoryItemName: "iNvEnToRyItEmReSoUrCeNaMe", + InventoryItemName: "iNvEnToRyItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/vMmSeRvErS/vMmSeRvErNaMe/iNvEnToRyItEmS/iNvEnToRyItEmReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/vMmSeRvErS/vMmSeRvErNaMe/iNvEnToRyItEmS/iNvEnToRyItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/README.md b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/README.md index d13afa848b3..8614e7ec127 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/README.md +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") payload := availabilitysets.AvailabilitySet{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") if err := client.DeleteThenPoll(ctx, id, availabilitysets.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, availabilitysets.DefaultDeleteOperation ```go ctx := context.TODO() -id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") payload := availabilitysets.AvailabilitySetTagsUpdate{ // ... diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/id_availabilityset.go b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/id_availabilityset.go index f775bce5ea9..8fd9d1dcc78 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/id_availabilityset.go +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/id_availabilityset.go @@ -115,7 +115,7 @@ func (id AvailabilitySetId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), resourceids.StaticSegment("staticAvailabilitySets", "availabilitySets", "availabilitySets"), - resourceids.UserSpecifiedSegment("availabilitySetName", "availabilitySetResourceName"), + resourceids.UserSpecifiedSegment("availabilitySetName", "availabilitySetName"), } } diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/id_availabilityset_test.go b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/id_availabilityset_test.go index a37e7c6557a..712cfc8b3ed 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/id_availabilityset_test.go +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/availabilitysets/id_availabilityset_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AvailabilitySetId{} func TestNewAvailabilitySetID(t *testing.T) { - id := NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName") + id := NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewAvailabilitySetID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.AvailabilitySetName != "availabilitySetResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'AvailabilitySetName'", id.AvailabilitySetName, "availabilitySetResourceName") + if id.AvailabilitySetName != "availabilitySetName" { + t.Fatalf("Expected %q but got %q for Segment 'AvailabilitySetName'", id.AvailabilitySetName, "availabilitySetName") } } func TestFormatAvailabilitySetID(t *testing.T) { - actual := NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName" + actual := NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseAvailabilitySetID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName", Expected: &AvailabilitySetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AvailabilitySetName: "availabilitySetResourceName", + AvailabilitySetName: "availabilitySetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseAvailabilitySetIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName", Expected: &AvailabilitySetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - AvailabilitySetName: "availabilitySetResourceName", + AvailabilitySetName: "availabilitySetName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/availabilitySets/availabilitySetName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/aVaIlAbIlItYsEtS/aVaIlAbIlItYsEtReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/aVaIlAbIlItYsEtS/aVaIlAbIlItYsEtNaMe", Expected: &AvailabilitySetId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AvailabilitySetName: "aVaIlAbIlItYsEtReSoUrCeNaMe", + AvailabilitySetName: "aVaIlAbIlItYsEtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/aVaIlAbIlItYsEtS/aVaIlAbIlItYsEtReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/aVaIlAbIlItYsEtS/aVaIlAbIlItYsEtNaMe/extra", Error: true, }, } diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/README.md b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/README.md index 94f3d469def..becc1fdadd0 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/README.md +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") payload := clouds.Cloud{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") if err := client.DeleteThenPoll(ctx, id, clouds.DefaultDeleteOperationOptions()); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id, clouds.DefaultDeleteOperationOptions()) ```go ctx := context.TODO() -id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") payload := clouds.CloudTagsUpdate{ // ... diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/id_cloud.go b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/id_cloud.go index abfdcf93409..7409bf64687 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/id_cloud.go +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/id_cloud.go @@ -115,7 +115,7 @@ func (id CloudId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), resourceids.StaticSegment("staticClouds", "clouds", "clouds"), - resourceids.UserSpecifiedSegment("cloudName", "cloudResourceName"), + resourceids.UserSpecifiedSegment("cloudName", "cloudName"), } } diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/id_cloud_test.go b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/id_cloud_test.go index 6d122fe16f1..a9bff2b84b7 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/id_cloud_test.go +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/clouds/id_cloud_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CloudId{} func TestNewCloudID(t *testing.T) { - id := NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName") + id := NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCloudID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CloudName != "cloudResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'CloudName'", id.CloudName, "cloudResourceName") + if id.CloudName != "cloudName" { + t.Fatalf("Expected %q but got %q for Segment 'CloudName'", id.CloudName, "cloudName") } } func TestFormatCloudID(t *testing.T) { - actual := NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName" + actual := NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCloudID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName", Expected: &CloudId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudName: "cloudResourceName", + CloudName: "cloudName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCloudIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName", Expected: &CloudId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CloudName: "cloudResourceName", + CloudName: "cloudName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/clouds/cloudName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/cLoUdS/cLoUdReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/cLoUdS/cLoUdNaMe", Expected: &CloudId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudName: "cLoUdReSoUrCeNaMe", + CloudName: "cLoUdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/cLoUdS/cLoUdReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/cLoUdS/cLoUdNaMe/extra", Error: true, }, } diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/README.md b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/README.md index 3298cd4b44b..b418476704f 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/README.md +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName") payload := inventoryitems.InventoryItem{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName") +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/id_inventoryitem.go b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/id_inventoryitem.go index 39a388561f4..4d8be24e322 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/id_inventoryitem.go +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/id_inventoryitem.go @@ -123,7 +123,7 @@ func (id InventoryItemId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticVmmServers", "vmmServers", "vmmServers"), resourceids.UserSpecifiedSegment("vmmServerName", "vmmServerName"), resourceids.StaticSegment("staticInventoryItems", "inventoryItems", "inventoryItems"), - resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemResourceName"), + resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemName"), } } diff --git a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/id_inventoryitem_test.go b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/id_inventoryitem_test.go index 79ef5491b5b..6126684898b 100644 --- a/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/id_inventoryitem_test.go +++ b/resource-manager/systemcentervirtualmachinemanager/2024-06-01/inventoryitems/id_inventoryitem_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InventoryItemId{} func TestNewInventoryItemID(t *testing.T) { - id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName") + id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewInventoryItemID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'VmmServerName'", id.VmmServerName, "vmmServerName") } - if id.InventoryItemName != "inventoryItemResourceName" { - t.Fatalf("Expected %q but got %q for Segment 'InventoryItemName'", id.InventoryItemName, "inventoryItemResourceName") + if id.InventoryItemName != "inventoryItemName" { + t.Fatalf("Expected %q but got %q for Segment 'InventoryItemName'", id.InventoryItemName, "inventoryItemName") } } func TestFormatInventoryItemID(t *testing.T) { - actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName" + actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerName", "inventoryItemName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseInventoryItemID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VmmServerName: "vmmServerName", - InventoryItemName: "inventoryItemResourceName", + InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseInventoryItemIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", VmmServerName: "vmmServerName", - InventoryItemName: "inventoryItemResourceName", + InventoryItemName: "inventoryItemName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ScVmm/vmmServers/vmmServerName/inventoryItems/inventoryItemName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/vMmSeRvErS/vMmSeRvErNaMe/iNvEnToRyItEmS/iNvEnToRyItEmReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/vMmSeRvErS/vMmSeRvErNaMe/iNvEnToRyItEmS/iNvEnToRyItEmNaMe", Expected: &InventoryItemId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", VmmServerName: "vMmSeRvErNaMe", - InventoryItemName: "iNvEnToRyItEmReSoUrCeNaMe", + InventoryItemName: "iNvEnToRyItEmNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/vMmSeRvErS/vMmSeRvErNaMe/iNvEnToRyItEmS/iNvEnToRyItEmReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sCvMm/vMmSeRvErS/vMmSeRvErNaMe/iNvEnToRyItEmS/iNvEnToRyItEmNaMe/extra", Error: true, }, } diff --git a/resource-manager/trafficmanager/2022-04-01/endpoints/README.md b/resource-manager/trafficmanager/2022-04-01/endpoints/README.md index dac602d57cf..985be492fdd 100644 --- a/resource-manager/trafficmanager/2022-04-01/endpoints/README.md +++ b/resource-manager/trafficmanager/2022-04-01/endpoints/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := endpoints.NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "AzureEndpoints", "endpointName") +id := endpoints.NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName", "AzureEndpoints", "endpointName") payload := endpoints.Endpoint{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := endpoints.NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "AzureEndpoints", "endpointName") +id := endpoints.NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName", "AzureEndpoints", "endpointName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := endpoints.NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "AzureEndpoints", "endpointName") +id := endpoints.NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName", "AzureEndpoints", "endpointName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := endpoints.NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "AzureEndpoints", "endpointName") +id := endpoints.NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName", "AzureEndpoints", "endpointName") payload := endpoints.Endpoint{ // ... diff --git a/resource-manager/trafficmanager/2022-04-01/endpoints/id_endpointtype.go b/resource-manager/trafficmanager/2022-04-01/endpoints/id_endpointtype.go index fcd00b443ee..c670b322d9a 100644 --- a/resource-manager/trafficmanager/2022-04-01/endpoints/id_endpointtype.go +++ b/resource-manager/trafficmanager/2022-04-01/endpoints/id_endpointtype.go @@ -135,7 +135,7 @@ func (id EndpointTypeId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticTrafficManagerProfiles", "trafficManagerProfiles", "trafficManagerProfiles"), - resourceids.UserSpecifiedSegment("trafficManagerProfileName", "profileName"), + resourceids.UserSpecifiedSegment("trafficManagerProfileName", "trafficManagerProfileName"), resourceids.ConstantSegment("endpointType", PossibleValuesForEndpointType(), "AzureEndpoints"), resourceids.UserSpecifiedSegment("endpointName", "endpointName"), } diff --git a/resource-manager/trafficmanager/2022-04-01/endpoints/id_endpointtype_test.go b/resource-manager/trafficmanager/2022-04-01/endpoints/id_endpointtype_test.go index b4e949a2ef9..8834a6cf3b3 100644 --- a/resource-manager/trafficmanager/2022-04-01/endpoints/id_endpointtype_test.go +++ b/resource-manager/trafficmanager/2022-04-01/endpoints/id_endpointtype_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EndpointTypeId{} func TestNewEndpointTypeID(t *testing.T) { - id := NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "AzureEndpoints", "endpointName") + id := NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName", "AzureEndpoints", "endpointName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewEndpointTypeID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.TrafficManagerProfileName != "profileName" { - t.Fatalf("Expected %q but got %q for Segment 'TrafficManagerProfileName'", id.TrafficManagerProfileName, "profileName") + if id.TrafficManagerProfileName != "trafficManagerProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'TrafficManagerProfileName'", id.TrafficManagerProfileName, "trafficManagerProfileName") } if id.EndpointType != "AzureEndpoints" { @@ -36,8 +36,8 @@ func TestNewEndpointTypeID(t *testing.T) { } func TestFormatEndpointTypeID(t *testing.T) { - actual := NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName", "AzureEndpoints", "endpointName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/AzureEndpoints/endpointName" + actual := NewEndpointTypeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName", "AzureEndpoints", "endpointName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/AzureEndpoints/endpointName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,28 +91,28 @@ func TestParseEndpointTypeID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/AzureEndpoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/AzureEndpoints", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/AzureEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/AzureEndpoints/endpointName", Expected: &EndpointTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - TrafficManagerProfileName: "profileName", + TrafficManagerProfileName: "trafficManagerProfileName", EndpointType: "AzureEndpoints", EndpointName: "endpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/AzureEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/AzureEndpoints/endpointName/extra", Error: true, }, } @@ -237,54 +237,54 @@ func TestParseEndpointTypeIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/pRoFiLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/tRaFfIcMaNaGeRpRoFiLeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/AzureEndpoints", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/AzureEndpoints", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/pRoFiLeNaMe/aZuReEnDpOiNtS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/tRaFfIcMaNaGeRpRoFiLeNaMe/aZuReEnDpOiNtS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/AzureEndpoints/endpointName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/AzureEndpoints/endpointName", Expected: &EndpointTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - TrafficManagerProfileName: "profileName", + TrafficManagerProfileName: "trafficManagerProfileName", EndpointType: "AzureEndpoints", EndpointName: "endpointName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/AzureEndpoints/endpointName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/AzureEndpoints/endpointName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/pRoFiLeNaMe/aZuReEnDpOiNtS/eNdPoInTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/tRaFfIcMaNaGeRpRoFiLeNaMe/aZuReEnDpOiNtS/eNdPoInTnAmE", Expected: &EndpointTypeId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - TrafficManagerProfileName: "pRoFiLeNaMe", + TrafficManagerProfileName: "tRaFfIcMaNaGeRpRoFiLeNaMe", EndpointType: "AzureEndpoints", EndpointName: "eNdPoInTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/pRoFiLeNaMe/aZuReEnDpOiNtS/eNdPoInTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/tRaFfIcMaNaGeRpRoFiLeNaMe/aZuReEnDpOiNtS/eNdPoInTnAmE/extra", Error: true, }, } diff --git a/resource-manager/trafficmanager/2022-04-01/heatmaps/README.md b/resource-manager/trafficmanager/2022-04-01/heatmaps/README.md index 6f09c80faa8..48bdfbe9417 100644 --- a/resource-manager/trafficmanager/2022-04-01/heatmaps/README.md +++ b/resource-manager/trafficmanager/2022-04-01/heatmaps/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := heatmaps.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName") +id := heatmaps.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName") read, err := client.HeatMapGet(ctx, id, heatmaps.DefaultHeatMapGetOperationOptions()) if err != nil { diff --git a/resource-manager/trafficmanager/2022-04-01/heatmaps/id_trafficmanagerprofile.go b/resource-manager/trafficmanager/2022-04-01/heatmaps/id_trafficmanagerprofile.go index 940a37cca31..3f4f4e60331 100644 --- a/resource-manager/trafficmanager/2022-04-01/heatmaps/id_trafficmanagerprofile.go +++ b/resource-manager/trafficmanager/2022-04-01/heatmaps/id_trafficmanagerprofile.go @@ -115,7 +115,7 @@ func (id TrafficManagerProfileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticTrafficManagerProfiles", "trafficManagerProfiles", "trafficManagerProfiles"), - resourceids.UserSpecifiedSegment("trafficManagerProfileName", "profileName"), + resourceids.UserSpecifiedSegment("trafficManagerProfileName", "trafficManagerProfileName"), } } diff --git a/resource-manager/trafficmanager/2022-04-01/heatmaps/id_trafficmanagerprofile_test.go b/resource-manager/trafficmanager/2022-04-01/heatmaps/id_trafficmanagerprofile_test.go index bb9feac46e2..d2859b40f5c 100644 --- a/resource-manager/trafficmanager/2022-04-01/heatmaps/id_trafficmanagerprofile_test.go +++ b/resource-manager/trafficmanager/2022-04-01/heatmaps/id_trafficmanagerprofile_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TrafficManagerProfileId{} func TestNewTrafficManagerProfileID(t *testing.T) { - id := NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName") + id := NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewTrafficManagerProfileID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.TrafficManagerProfileName != "profileName" { - t.Fatalf("Expected %q but got %q for Segment 'TrafficManagerProfileName'", id.TrafficManagerProfileName, "profileName") + if id.TrafficManagerProfileName != "trafficManagerProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'TrafficManagerProfileName'", id.TrafficManagerProfileName, "trafficManagerProfileName") } } func TestFormatTrafficManagerProfileID(t *testing.T) { - actual := NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName" + actual := NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseTrafficManagerProfileID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName", Expected: &TrafficManagerProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - TrafficManagerProfileName: "profileName", + TrafficManagerProfileName: "trafficManagerProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseTrafficManagerProfileIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName", Expected: &TrafficManagerProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - TrafficManagerProfileName: "profileName", + TrafficManagerProfileName: "trafficManagerProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/pRoFiLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/tRaFfIcMaNaGeRpRoFiLeNaMe", Expected: &TrafficManagerProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - TrafficManagerProfileName: "pRoFiLeNaMe", + TrafficManagerProfileName: "tRaFfIcMaNaGeRpRoFiLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/pRoFiLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/tRaFfIcMaNaGeRpRoFiLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/trafficmanager/2022-04-01/profiles/README.md b/resource-manager/trafficmanager/2022-04-01/profiles/README.md index b2ebfafa9f2..ec2c57a5d23 100644 --- a/resource-manager/trafficmanager/2022-04-01/profiles/README.md +++ b/resource-manager/trafficmanager/2022-04-01/profiles/README.md @@ -66,7 +66,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := profiles.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName") +id := profiles.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName") payload := profiles.Profile{ // ... @@ -87,7 +87,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := profiles.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName") +id := profiles.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName") read, err := client.Delete(ctx, id) if err != nil { @@ -103,7 +103,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := profiles.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName") +id := profiles.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName") read, err := client.Get(ctx, id) if err != nil { @@ -151,7 +151,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := profiles.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName") +id := profiles.NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName") payload := profiles.Profile{ // ... diff --git a/resource-manager/trafficmanager/2022-04-01/profiles/id_trafficmanagerprofile.go b/resource-manager/trafficmanager/2022-04-01/profiles/id_trafficmanagerprofile.go index 78e9f9c802e..16c8c74bfed 100644 --- a/resource-manager/trafficmanager/2022-04-01/profiles/id_trafficmanagerprofile.go +++ b/resource-manager/trafficmanager/2022-04-01/profiles/id_trafficmanagerprofile.go @@ -115,7 +115,7 @@ func (id TrafficManagerProfileId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), resourceids.StaticSegment("staticTrafficManagerProfiles", "trafficManagerProfiles", "trafficManagerProfiles"), - resourceids.UserSpecifiedSegment("trafficManagerProfileName", "profileName"), + resourceids.UserSpecifiedSegment("trafficManagerProfileName", "trafficManagerProfileName"), } } diff --git a/resource-manager/trafficmanager/2022-04-01/profiles/id_trafficmanagerprofile_test.go b/resource-manager/trafficmanager/2022-04-01/profiles/id_trafficmanagerprofile_test.go index 695ccdb30e1..7165910c37d 100644 --- a/resource-manager/trafficmanager/2022-04-01/profiles/id_trafficmanagerprofile_test.go +++ b/resource-manager/trafficmanager/2022-04-01/profiles/id_trafficmanagerprofile_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TrafficManagerProfileId{} func TestNewTrafficManagerProfileID(t *testing.T) { - id := NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName") + id := NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewTrafficManagerProfileID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.TrafficManagerProfileName != "profileName" { - t.Fatalf("Expected %q but got %q for Segment 'TrafficManagerProfileName'", id.TrafficManagerProfileName, "profileName") + if id.TrafficManagerProfileName != "trafficManagerProfileName" { + t.Fatalf("Expected %q but got %q for Segment 'TrafficManagerProfileName'", id.TrafficManagerProfileName, "trafficManagerProfileName") } } func TestFormatTrafficManagerProfileID(t *testing.T) { - actual := NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "profileName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName" + actual := NewTrafficManagerProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "trafficManagerProfileName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseTrafficManagerProfileID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName", Expected: &TrafficManagerProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - TrafficManagerProfileName: "profileName", + TrafficManagerProfileName: "trafficManagerProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseTrafficManagerProfileIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName", Expected: &TrafficManagerProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - TrafficManagerProfileName: "profileName", + TrafficManagerProfileName: "trafficManagerProfileName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/profileName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/trafficManagerProfiles/trafficManagerProfileName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/pRoFiLeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/tRaFfIcMaNaGeRpRoFiLeNaMe", Expected: &TrafficManagerProfileId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - TrafficManagerProfileName: "pRoFiLeNaMe", + TrafficManagerProfileName: "tRaFfIcMaNaGeRpRoFiLeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/pRoFiLeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/tRaFfIcMaNaGeRpRoFiLeS/tRaFfIcMaNaGeRpRoFiLeNaMe/extra", Error: true, }, } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/README.md b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/README.md index 0449e65892c..e6af17a21c6 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/README.md +++ b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "edgeModuleName") +id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "edgeModuleName") payload := edgemodules.EdgeModuleEntity{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "edgeModuleName") +id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "edgeModuleName") read, err := client.Delete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "edgeModuleName") +id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "edgeModuleName") read, err := client.Get(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := edgemodules.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := edgemodules.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") // alternatively `client.List(ctx, id, edgemodules.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, edgemodules.DefaultListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "edgeModuleName") +id := edgemodules.NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "edgeModuleName") payload := edgemodules.ListProvisioningTokenInput{ // ... diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule.go b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule.go index 6862ba728ff..f34fe1cd97b 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule.go @@ -121,7 +121,7 @@ func (id EdgeModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"), resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"), - resourceids.UserSpecifiedSegment("videoAnalyzerName", "accountName"), + resourceids.UserSpecifiedSegment("videoAnalyzerName", "videoAnalyzerName"), resourceids.StaticSegment("staticEdgeModules", "edgeModules", "edgeModules"), resourceids.UserSpecifiedSegment("edgeModuleName", "edgeModuleName"), } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule_test.go b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule_test.go index 7340b89bd2e..08ba6afe7ce 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule_test.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_edgemodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &EdgeModuleId{} func TestNewEdgeModuleID(t *testing.T) { - id := NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "edgeModuleName") + id := NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "edgeModuleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewEdgeModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VideoAnalyzerName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "accountName") + if id.VideoAnalyzerName != "videoAnalyzerName" { + t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "videoAnalyzerName") } if id.EdgeModuleName != "edgeModuleName" { @@ -32,8 +32,8 @@ func TestNewEdgeModuleID(t *testing.T) { } func TestFormatEdgeModuleID(t *testing.T) { - actual := NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "edgeModuleName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/edgeModules/edgeModuleName" + actual := NewEdgeModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "edgeModuleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/edgeModules/edgeModuleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseEdgeModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/edgeModules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/edgeModules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/edgeModules/edgeModuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/edgeModules/edgeModuleName", Expected: &EdgeModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", EdgeModuleName: "edgeModuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/edgeModules/edgeModuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/edgeModules/edgeModuleName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseEdgeModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/edgeModules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/edgeModules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/eDgEmOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/eDgEmOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/edgeModules/edgeModuleName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/edgeModules/edgeModuleName", Expected: &EdgeModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", EdgeModuleName: "edgeModuleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/edgeModules/edgeModuleName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/edgeModules/edgeModuleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/eDgEmOdUlEs/eDgEmOdUlEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/eDgEmOdUlEs/eDgEmOdUlEnAmE", Expected: &EdgeModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VideoAnalyzerName: "aCcOuNtNaMe", + VideoAnalyzerName: "vIdEoAnAlYzErNaMe", EdgeModuleName: "eDgEmOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/eDgEmOdUlEs/eDgEmOdUlEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/eDgEmOdUlEs/eDgEmOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer.go b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer.go index b7cdaa76264..b753f8a57ed 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer.go @@ -115,7 +115,7 @@ func (id VideoAnalyzerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"), resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"), - resourceids.UserSpecifiedSegment("videoAnalyzerName", "accountName"), + resourceids.UserSpecifiedSegment("videoAnalyzerName", "videoAnalyzerName"), } } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer_test.go b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer_test.go index 273291aeb43..fd293814329 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer_test.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/edgemodules/id_videoanalyzer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VideoAnalyzerId{} func TestNewVideoAnalyzerID(t *testing.T) { - id := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVideoAnalyzerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VideoAnalyzerName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "accountName") + if id.VideoAnalyzerName != "videoAnalyzerName" { + t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "videoAnalyzerName") } } func TestFormatVideoAnalyzerID(t *testing.T) { - actual := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName" + actual := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVideoAnalyzerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVideoAnalyzerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VideoAnalyzerName: "aCcOuNtNaMe", + VideoAnalyzerName: "vIdEoAnAlYzErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/extra", Error: true, }, } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/README.md b/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/README.md index 18548702a80..703b78b2fa1 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/README.md +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/README.md @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") payload := videoanalyzers.VideoAnalyzer{ // ... @@ -67,7 +67,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") read, err := client.VideoAnalyzersDelete(ctx, id) if err != nil { @@ -83,7 +83,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") read, err := client.VideoAnalyzersGet(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") payload := videoanalyzers.SyncStorageKeysInput{ // ... @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := videoanalyzers.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") payload := videoanalyzers.VideoAnalyzerUpdate{ // ... diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer.go b/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer.go index c326b63631e..0b24231e0e4 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer.go @@ -115,7 +115,7 @@ func (id VideoAnalyzerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"), resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"), - resourceids.UserSpecifiedSegment("videoAnalyzerName", "accountName"), + resourceids.UserSpecifiedSegment("videoAnalyzerName", "videoAnalyzerName"), } } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer_test.go b/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer_test.go index 6ae3c6ca1f8..b29d9052f48 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer_test.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/id_videoanalyzer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VideoAnalyzerId{} func TestNewVideoAnalyzerID(t *testing.T) { - id := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVideoAnalyzerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VideoAnalyzerName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "accountName") + if id.VideoAnalyzerName != "videoAnalyzerName" { + t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "videoAnalyzerName") } } func TestFormatVideoAnalyzerID(t *testing.T) { - actual := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName" + actual := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVideoAnalyzerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVideoAnalyzerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VideoAnalyzerName: "aCcOuNtNaMe", + VideoAnalyzerName: "vIdEoAnAlYzErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/extra", Error: true, }, } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_endpoint.go b/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_endpoint.go index 22788237336..f2e9d1b1f3b 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_endpoint.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videoanalyzers/model_endpoint.go @@ -4,6 +4,6 @@ package videoanalyzers // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Endpoint struct { - EndpointUrl *string `json:"endpointUrl,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` Type VideoAnalyzerEndpointType `json:"type"` } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videos/README.md b/resource-manager/videoanalyzer/2021-05-01-preview/videos/README.md index 864819b245c..8b375e52482 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videos/README.md +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videos/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := videos.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "accessPolicyName") +id := videos.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "accessPolicyName") payload := videos.AccessPolicyEntity{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videos.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "accessPolicyName") +id := videos.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "accessPolicyName") read, err := client.AccessPoliciesDelete(ctx, id) if err != nil { @@ -61,7 +61,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videos.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "accessPolicyName") +id := videos.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "accessPolicyName") read, err := client.AccessPoliciesGet(ctx, id) if err != nil { @@ -77,7 +77,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videos.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := videos.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") // alternatively `client.AccessPoliciesList(ctx, id, videos.DefaultAccessPoliciesListOperationOptions())` can be used to do batched pagination items, err := client.AccessPoliciesListComplete(ctx, id, videos.DefaultAccessPoliciesListOperationOptions()) @@ -94,7 +94,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := videos.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "accessPolicyName") +id := videos.NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "accessPolicyName") payload := videos.AccessPolicyEntity{ // ... @@ -115,7 +115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "videoName") +id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "videoName") payload := videos.VideoEntity{ // ... @@ -136,7 +136,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "videoName") +id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "videoName") read, err := client.VideosDelete(ctx, id) if err != nil { @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "videoName") +id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "videoName") read, err := client.VideosGet(ctx, id) if err != nil { @@ -168,7 +168,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videos.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") +id := videos.NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") // alternatively `client.VideosList(ctx, id, videos.DefaultVideosListOperationOptions())` can be used to do batched pagination items, err := client.VideosListComplete(ctx, id, videos.DefaultVideosListOperationOptions()) @@ -185,7 +185,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "videoName") +id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "videoName") read, err := client.VideosListStreamingToken(ctx, id) if err != nil { @@ -201,7 +201,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "videoName") +id := videos.NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "videoName") payload := videos.VideoEntity{ // ... diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_accesspolicy.go b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_accesspolicy.go index f9d8c0f94b1..ff978d4010d 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_accesspolicy.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_accesspolicy.go @@ -121,7 +121,7 @@ func (id AccessPolicyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"), resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"), - resourceids.UserSpecifiedSegment("videoAnalyzerName", "accountName"), + resourceids.UserSpecifiedSegment("videoAnalyzerName", "videoAnalyzerName"), resourceids.StaticSegment("staticAccessPolicies", "accessPolicies", "accessPolicies"), resourceids.UserSpecifiedSegment("accessPolicyName", "accessPolicyName"), } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_accesspolicy_test.go b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_accesspolicy_test.go index 45855c507fb..fd8b4940c4a 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_accesspolicy_test.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_accesspolicy_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AccessPolicyId{} func TestNewAccessPolicyID(t *testing.T) { - id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "accessPolicyName") + id := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "accessPolicyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAccessPolicyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VideoAnalyzerName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "accountName") + if id.VideoAnalyzerName != "videoAnalyzerName" { + t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "videoAnalyzerName") } if id.AccessPolicyName != "accessPolicyName" { @@ -32,8 +32,8 @@ func TestNewAccessPolicyID(t *testing.T) { } func TestFormatAccessPolicyID(t *testing.T) { - actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "accessPolicyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/accessPolicies/accessPolicyName" + actual := NewAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "accessPolicyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/accessPolicies/accessPolicyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAccessPolicyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/accessPolicies", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/accessPolicies/accessPolicyName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAccessPolicyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/accessPolicies", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/accessPolicies", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/aCcEsSpOlIcIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/aCcEsSpOlIcIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/accessPolicies/accessPolicyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/accessPolicies/accessPolicyName", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", AccessPolicyName: "accessPolicyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/accessPolicies/accessPolicyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/accessPolicies/accessPolicyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE", Expected: &AccessPolicyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VideoAnalyzerName: "aCcOuNtNaMe", + VideoAnalyzerName: "vIdEoAnAlYzErNaMe", AccessPolicyName: "aCcEsSpOlIcYnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/aCcEsSpOlIcIeS/aCcEsSpOlIcYnAmE/extra", Error: true, }, } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_video.go b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_video.go index 76a8776b61c..aa583295318 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_video.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_video.go @@ -121,7 +121,7 @@ func (id VideoId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"), resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"), - resourceids.UserSpecifiedSegment("videoAnalyzerName", "accountName"), + resourceids.UserSpecifiedSegment("videoAnalyzerName", "videoAnalyzerName"), resourceids.StaticSegment("staticVideos", "videos", "videos"), resourceids.UserSpecifiedSegment("videoName", "videoName"), } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_video_test.go b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_video_test.go index 695e3f1a34b..da971470f3e 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_video_test.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_video_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VideoId{} func TestNewVideoID(t *testing.T) { - id := NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "videoName") + id := NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "videoName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVideoID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VideoAnalyzerName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "accountName") + if id.VideoAnalyzerName != "videoAnalyzerName" { + t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "videoAnalyzerName") } if id.VideoName != "videoName" { @@ -32,8 +32,8 @@ func TestNewVideoID(t *testing.T) { } func TestFormatVideoID(t *testing.T) { - actual := NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName", "videoName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/videos/videoName" + actual := NewVideoID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName", "videoName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/videos/videoName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVideoID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/videos", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/videos", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/videos/videoName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/videos/videoName", Expected: &VideoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", VideoName: "videoName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/videos/videoName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/videos/videoName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVideoIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/videos", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/videos", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/vIdEoS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/vIdEoS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/videos/videoName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/videos/videoName", Expected: &VideoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", VideoName: "videoName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/videos/videoName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/videos/videoName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/vIdEoS/vIdEoNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/vIdEoS/vIdEoNaMe", Expected: &VideoId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VideoAnalyzerName: "aCcOuNtNaMe", + VideoAnalyzerName: "vIdEoAnAlYzErNaMe", VideoName: "vIdEoNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/vIdEoS/vIdEoNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/vIdEoS/vIdEoNaMe/extra", Error: true, }, } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_videoanalyzer.go b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_videoanalyzer.go index 3b667efa80b..1ac9e79cd22 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_videoanalyzer.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_videoanalyzer.go @@ -115,7 +115,7 @@ func (id VideoAnalyzerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftMedia", "Microsoft.Media", "Microsoft.Media"), resourceids.StaticSegment("staticVideoAnalyzers", "videoAnalyzers", "videoAnalyzers"), - resourceids.UserSpecifiedSegment("videoAnalyzerName", "accountName"), + resourceids.UserSpecifiedSegment("videoAnalyzerName", "videoAnalyzerName"), } } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_videoanalyzer_test.go b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_videoanalyzer_test.go index 39d677f58e7..30b0ec2413b 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_videoanalyzer_test.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videos/id_videoanalyzer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VideoAnalyzerId{} func TestNewVideoAnalyzerID(t *testing.T) { - id := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName") + id := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewVideoAnalyzerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.VideoAnalyzerName != "accountName" { - t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "accountName") + if id.VideoAnalyzerName != "videoAnalyzerName" { + t.Fatalf("Expected %q but got %q for Segment 'VideoAnalyzerName'", id.VideoAnalyzerName, "videoAnalyzerName") } } func TestFormatVideoAnalyzerID(t *testing.T) { - actual := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName" + actual := NewVideoAnalyzerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "videoAnalyzerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseVideoAnalyzerID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseVideoAnalyzerIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - VideoAnalyzerName: "accountName", + VideoAnalyzerName: "videoAnalyzerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/accountName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Media/videoAnalyzers/videoAnalyzerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe", Expected: &VideoAnalyzerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VideoAnalyzerName: "aCcOuNtNaMe", + VideoAnalyzerName: "vIdEoAnAlYzErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/aCcOuNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mEdIa/vIdEoAnAlYzErS/vIdEoAnAlYzErNaMe/extra", Error: true, }, } diff --git a/resource-manager/videoanalyzer/2021-05-01-preview/videos/model_videostreaming.go b/resource-manager/videoanalyzer/2021-05-01-preview/videos/model_videostreaming.go index 3bbaf7f9b7d..613b0994ec5 100644 --- a/resource-manager/videoanalyzer/2021-05-01-preview/videos/model_videostreaming.go +++ b/resource-manager/videoanalyzer/2021-05-01-preview/videos/model_videostreaming.go @@ -4,5 +4,5 @@ package videos // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type VideoStreaming struct { - ArchiveBaseUrl *string `json:"archiveBaseUrl,omitempty"` + ArchiveBaseURL *string `json:"archiveBaseUrl,omitempty"` } diff --git a/resource-manager/vmware/2022-05-01/datastores/README.md b/resource-manager/vmware/2022-05-01/datastores/README.md index da17cb782b3..4580f54c235 100644 --- a/resource-manager/vmware/2022-05-01/datastores/README.md +++ b/resource-manager/vmware/2022-05-01/datastores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") payload := datastores.Datastore{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/vmware/2022-05-01/datastores/id_datastore.go b/resource-manager/vmware/2022-05-01/datastores/id_datastore.go index 29b8352d429..6de3c81a55c 100644 --- a/resource-manager/vmware/2022-05-01/datastores/id_datastore.go +++ b/resource-manager/vmware/2022-05-01/datastores/id_datastore.go @@ -131,7 +131,7 @@ func (id DataStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticClusters", "clusters", "clusters"), resourceids.UserSpecifiedSegment("clusterName", "clusterName"), resourceids.StaticSegment("staticDataStores", "dataStores", "dataStores"), - resourceids.UserSpecifiedSegment("dataStoreName", "datastoreName"), + resourceids.UserSpecifiedSegment("dataStoreName", "dataStoreName"), } } diff --git a/resource-manager/vmware/2022-05-01/datastores/id_datastore_test.go b/resource-manager/vmware/2022-05-01/datastores/id_datastore_test.go index 8f1bdee5f89..6272a2c891a 100644 --- a/resource-manager/vmware/2022-05-01/datastores/id_datastore_test.go +++ b/resource-manager/vmware/2022-05-01/datastores/id_datastore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataStoreId{} func TestNewDataStoreID(t *testing.T) { - id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") + id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewDataStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterName") } - if id.DataStoreName != "datastoreName" { - t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "datastoreName") + if id.DataStoreName != "dataStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "dataStoreName") } } func TestFormatDataStoreID(t *testing.T) { - actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName" + actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseDataStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", PrivateCloudName: "privateCloudName", ClusterName: "clusterName", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName/extra", Error: true, }, } @@ -287,18 +287,18 @@ func TestParseDataStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", PrivateCloudName: "privateCloudName", ClusterName: "clusterName", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName/extra", Error: true, }, { diff --git a/resource-manager/vmware/2022-05-01/locations/README.md b/resource-manager/vmware/2022-05-01/locations/README.md index df28a5ce17a..7ae9c459a49 100644 --- a/resource-manager/vmware/2022-05-01/locations/README.md +++ b/resource-manager/vmware/2022-05-01/locations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.CheckQuotaAvailability(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := locations.Sku{ // ... diff --git a/resource-manager/vmware/2022-05-01/locations/id_location.go b/resource-manager/vmware/2022-05-01/locations/id_location.go index 52ed59c61b2..0f51603b626 100644 --- a/resource-manager/vmware/2022-05-01/locations/id_location.go +++ b/resource-manager/vmware/2022-05-01/locations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAVS", "Microsoft.AVS", "Microsoft.AVS"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/vmware/2022-05-01/locations/id_location_test.go b/resource-manager/vmware/2022-05-01/locations/id_location_test.go index 6cf9835eda8..e5fb4f49584 100644 --- a/resource-manager/vmware/2022-05-01/locations/id_location_test.go +++ b/resource-manager/vmware/2022-05-01/locations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/vmware/2022-05-01/privateclouds/model_encryptionkeyvaultproperties.go b/resource-manager/vmware/2022-05-01/privateclouds/model_encryptionkeyvaultproperties.go index cbb978e8c0b..75ea7580feb 100644 --- a/resource-manager/vmware/2022-05-01/privateclouds/model_encryptionkeyvaultproperties.go +++ b/resource-manager/vmware/2022-05-01/privateclouds/model_encryptionkeyvaultproperties.go @@ -7,7 +7,7 @@ type EncryptionKeyVaultProperties struct { AutoDetectedKeyVersion *string `json:"autoDetectedKeyVersion,omitempty"` KeyName *string `json:"keyName,omitempty"` KeyState *EncryptionKeyStatus `json:"keyState,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` KeyVersion *string `json:"keyVersion,omitempty"` VersionType *EncryptionVersionType `json:"versionType,omitempty"` } diff --git a/resource-manager/vmware/2023-03-01/datastores/README.md b/resource-manager/vmware/2023-03-01/datastores/README.md index 9c814b5d758..9a29b2135bf 100644 --- a/resource-manager/vmware/2023-03-01/datastores/README.md +++ b/resource-manager/vmware/2023-03-01/datastores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") payload := datastores.Datastore{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/vmware/2023-03-01/datastores/id_datastore.go b/resource-manager/vmware/2023-03-01/datastores/id_datastore.go index 29b8352d429..6de3c81a55c 100644 --- a/resource-manager/vmware/2023-03-01/datastores/id_datastore.go +++ b/resource-manager/vmware/2023-03-01/datastores/id_datastore.go @@ -131,7 +131,7 @@ func (id DataStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticClusters", "clusters", "clusters"), resourceids.UserSpecifiedSegment("clusterName", "clusterName"), resourceids.StaticSegment("staticDataStores", "dataStores", "dataStores"), - resourceids.UserSpecifiedSegment("dataStoreName", "datastoreName"), + resourceids.UserSpecifiedSegment("dataStoreName", "dataStoreName"), } } diff --git a/resource-manager/vmware/2023-03-01/datastores/id_datastore_test.go b/resource-manager/vmware/2023-03-01/datastores/id_datastore_test.go index 8f1bdee5f89..6272a2c891a 100644 --- a/resource-manager/vmware/2023-03-01/datastores/id_datastore_test.go +++ b/resource-manager/vmware/2023-03-01/datastores/id_datastore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataStoreId{} func TestNewDataStoreID(t *testing.T) { - id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") + id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewDataStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterName") } - if id.DataStoreName != "datastoreName" { - t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "datastoreName") + if id.DataStoreName != "dataStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "dataStoreName") } } func TestFormatDataStoreID(t *testing.T) { - actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName" + actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseDataStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", PrivateCloudName: "privateCloudName", ClusterName: "clusterName", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName/extra", Error: true, }, } @@ -287,18 +287,18 @@ func TestParseDataStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", PrivateCloudName: "privateCloudName", ClusterName: "clusterName", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName/extra", Error: true, }, { diff --git a/resource-manager/vmware/2023-03-01/locations/README.md b/resource-manager/vmware/2023-03-01/locations/README.md index 2d7fe183d11..8b1caffe9d4 100644 --- a/resource-manager/vmware/2023-03-01/locations/README.md +++ b/resource-manager/vmware/2023-03-01/locations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.CheckQuotaAvailability(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := locations.Sku{ // ... diff --git a/resource-manager/vmware/2023-03-01/locations/id_location.go b/resource-manager/vmware/2023-03-01/locations/id_location.go index 52ed59c61b2..0f51603b626 100644 --- a/resource-manager/vmware/2023-03-01/locations/id_location.go +++ b/resource-manager/vmware/2023-03-01/locations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAVS", "Microsoft.AVS", "Microsoft.AVS"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/vmware/2023-03-01/locations/id_location_test.go b/resource-manager/vmware/2023-03-01/locations/id_location_test.go index 6cf9835eda8..e5fb4f49584 100644 --- a/resource-manager/vmware/2023-03-01/locations/id_location_test.go +++ b/resource-manager/vmware/2023-03-01/locations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/vmware/2023-03-01/privateclouds/model_encryptionkeyvaultproperties.go b/resource-manager/vmware/2023-03-01/privateclouds/model_encryptionkeyvaultproperties.go index cbb978e8c0b..75ea7580feb 100644 --- a/resource-manager/vmware/2023-03-01/privateclouds/model_encryptionkeyvaultproperties.go +++ b/resource-manager/vmware/2023-03-01/privateclouds/model_encryptionkeyvaultproperties.go @@ -7,7 +7,7 @@ type EncryptionKeyVaultProperties struct { AutoDetectedKeyVersion *string `json:"autoDetectedKeyVersion,omitempty"` KeyName *string `json:"keyName,omitempty"` KeyState *EncryptionKeyStatus `json:"keyState,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` KeyVersion *string `json:"keyVersion,omitempty"` VersionType *EncryptionVersionType `json:"versionType,omitempty"` } diff --git a/resource-manager/vmware/2023-09-01/datastores/README.md b/resource-manager/vmware/2023-09-01/datastores/README.md index 7baf0cda02e..35c93966ee9 100644 --- a/resource-manager/vmware/2023-09-01/datastores/README.md +++ b/resource-manager/vmware/2023-09-01/datastores/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") payload := datastores.Datastore{ // ... @@ -41,7 +41,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -53,7 +53,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") read, err := client.Get(ctx, id) if err != nil { diff --git a/resource-manager/vmware/2023-09-01/datastores/id_datastore.go b/resource-manager/vmware/2023-09-01/datastores/id_datastore.go index 29b8352d429..6de3c81a55c 100644 --- a/resource-manager/vmware/2023-09-01/datastores/id_datastore.go +++ b/resource-manager/vmware/2023-09-01/datastores/id_datastore.go @@ -131,7 +131,7 @@ func (id DataStoreId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticClusters", "clusters", "clusters"), resourceids.UserSpecifiedSegment("clusterName", "clusterName"), resourceids.StaticSegment("staticDataStores", "dataStores", "dataStores"), - resourceids.UserSpecifiedSegment("dataStoreName", "datastoreName"), + resourceids.UserSpecifiedSegment("dataStoreName", "dataStoreName"), } } diff --git a/resource-manager/vmware/2023-09-01/datastores/id_datastore_test.go b/resource-manager/vmware/2023-09-01/datastores/id_datastore_test.go index 8f1bdee5f89..6272a2c891a 100644 --- a/resource-manager/vmware/2023-09-01/datastores/id_datastore_test.go +++ b/resource-manager/vmware/2023-09-01/datastores/id_datastore_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DataStoreId{} func TestNewDataStoreID(t *testing.T) { - id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName") + id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -30,14 +30,14 @@ func TestNewDataStoreID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterName") } - if id.DataStoreName != "datastoreName" { - t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "datastoreName") + if id.DataStoreName != "dataStoreName" { + t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "dataStoreName") } } func TestFormatDataStoreID(t *testing.T) { - actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "datastoreName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName" + actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateCloudName", "clusterName", "dataStoreName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -111,18 +111,18 @@ func TestParseDataStoreID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", PrivateCloudName: "privateCloudName", ClusterName: "clusterName", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName/extra", Error: true, }, } @@ -287,18 +287,18 @@ func TestParseDataStoreIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName", Expected: &DataStoreId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", PrivateCloudName: "privateCloudName", ClusterName: "clusterName", - DataStoreName: "datastoreName", + DataStoreName: "dataStoreName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/datastoreName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AVS/privateClouds/privateCloudName/clusters/clusterName/dataStores/dataStoreName/extra", Error: true, }, { diff --git a/resource-manager/vmware/2023-09-01/locations/README.md b/resource-manager/vmware/2023-09-01/locations/README.md index c5ca13b47c7..3b5b5a3397c 100644 --- a/resource-manager/vmware/2023-09-01/locations/README.md +++ b/resource-manager/vmware/2023-09-01/locations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.CheckQuotaAvailability(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := locations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := locations.Sku{ // ... diff --git a/resource-manager/vmware/2023-09-01/locations/id_location.go b/resource-manager/vmware/2023-09-01/locations/id_location.go index 52ed59c61b2..0f51603b626 100644 --- a/resource-manager/vmware/2023-09-01/locations/id_location.go +++ b/resource-manager/vmware/2023-09-01/locations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftAVS", "Microsoft.AVS", "Microsoft.AVS"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/vmware/2023-09-01/locations/id_location_test.go b/resource-manager/vmware/2023-09-01/locations/id_location_test.go index 6cf9835eda8..e5fb4f49584 100644 --- a/resource-manager/vmware/2023-09-01/locations/id_location_test.go +++ b/resource-manager/vmware/2023-09-01/locations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.AVS/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.aVs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/vmware/2023-09-01/privateclouds/model_encryptionkeyvaultproperties.go b/resource-manager/vmware/2023-09-01/privateclouds/model_encryptionkeyvaultproperties.go index cbb978e8c0b..75ea7580feb 100644 --- a/resource-manager/vmware/2023-09-01/privateclouds/model_encryptionkeyvaultproperties.go +++ b/resource-manager/vmware/2023-09-01/privateclouds/model_encryptionkeyvaultproperties.go @@ -7,7 +7,7 @@ type EncryptionKeyVaultProperties struct { AutoDetectedKeyVersion *string `json:"autoDetectedKeyVersion,omitempty"` KeyName *string `json:"keyName,omitempty"` KeyState *EncryptionKeyStatus `json:"keyState,omitempty"` - KeyVaultUrl *string `json:"keyVaultUrl,omitempty"` + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` KeyVersion *string `json:"keyVersion,omitempty"` VersionType *EncryptionVersionType `json:"versionType,omitempty"` } diff --git a/resource-manager/voiceservices/2023-04-03/voiceservices/README.md b/resource-manager/voiceservices/2023-04-03/voiceservices/README.md index e5a23389e18..96598157803 100644 --- a/resource-manager/voiceservices/2023-04-03/voiceservices/README.md +++ b/resource-manager/voiceservices/2023-04-03/voiceservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := voiceservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := voiceservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := voiceservices.CheckNameAvailabilityRequest{ // ... diff --git a/resource-manager/voiceservices/2023-04-03/voiceservices/id_location.go b/resource-manager/voiceservices/2023-04-03/voiceservices/id_location.go index 00aa7b27b22..cc3a8d973bb 100644 --- a/resource-manager/voiceservices/2023-04-03/voiceservices/id_location.go +++ b/resource-manager/voiceservices/2023-04-03/voiceservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftVoiceServices", "Microsoft.VoiceServices", "Microsoft.VoiceServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/voiceservices/2023-04-03/voiceservices/id_location_test.go b/resource-manager/voiceservices/2023-04-03/voiceservices/id_location_test.go index 7c9c2dcc020..4c0e1f076b5 100644 --- a/resource-manager/voiceservices/2023-04-03/voiceservices/id_location_test.go +++ b/resource-manager/voiceservices/2023-04-03/voiceservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.vOiCeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.vOiCeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.vOiCeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.vOiCeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/voiceservices/2023-09-01/voiceservices/README.md b/resource-manager/voiceservices/2023-09-01/voiceservices/README.md index f49a1968b2b..1622310b0dc 100644 --- a/resource-manager/voiceservices/2023-09-01/voiceservices/README.md +++ b/resource-manager/voiceservices/2023-09-01/voiceservices/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := voiceservices.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := voiceservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := voiceservices.CheckNameAvailabilityRequest{ // ... diff --git a/resource-manager/voiceservices/2023-09-01/voiceservices/id_location.go b/resource-manager/voiceservices/2023-09-01/voiceservices/id_location.go index 00aa7b27b22..cc3a8d973bb 100644 --- a/resource-manager/voiceservices/2023-09-01/voiceservices/id_location.go +++ b/resource-manager/voiceservices/2023-09-01/voiceservices/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftVoiceServices", "Microsoft.VoiceServices", "Microsoft.VoiceServices"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/voiceservices/2023-09-01/voiceservices/id_location_test.go b/resource-manager/voiceservices/2023-09-01/voiceservices/id_location_test.go index 7c9c2dcc020..4c0e1f076b5 100644 --- a/resource-manager/voiceservices/2023-09-01/voiceservices/id_location_test.go +++ b/resource-manager/voiceservices/2023-09-01/voiceservices/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.VoiceServices/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.vOiCeSeRvIcEs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.vOiCeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.vOiCeSeRvIcEs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.vOiCeSeRvIcEs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2016-06-01/connectiongateways/README.md b/resource-manager/web/2016-06-01/connectiongateways/README.md index cea93f17fba..f8c59971764 100644 --- a/resource-manager/web/2016-06-01/connectiongateways/README.md +++ b/resource-manager/web/2016-06-01/connectiongateways/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := connectiongateways.NewConnectionGatewayInstallationID("12345678-1234-9876-4563-123456789012", "location", "gatewayId") +id := connectiongateways.NewConnectionGatewayInstallationID("12345678-1234-9876-4563-123456789012", "locationName", "gatewayId") read, err := client.ConnectionGatewayInstallationsGet(ctx, id) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := connectiongateways.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := connectiongateways.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.ConnectionGatewayInstallationsList(ctx, id) if err != nil { diff --git a/resource-manager/web/2016-06-01/connectiongateways/id_connectiongatewayinstallation.go b/resource-manager/web/2016-06-01/connectiongateways/id_connectiongatewayinstallation.go index 982bd10f369..0d545739524 100644 --- a/resource-manager/web/2016-06-01/connectiongateways/id_connectiongatewayinstallation.go +++ b/resource-manager/web/2016-06-01/connectiongateways/id_connectiongatewayinstallation.go @@ -113,7 +113,7 @@ func (id ConnectionGatewayInstallationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticConnectionGatewayInstallations", "connectionGatewayInstallations", "connectionGatewayInstallations"), resourceids.UserSpecifiedSegment("gatewayId", "gatewayId"), } diff --git a/resource-manager/web/2016-06-01/connectiongateways/id_connectiongatewayinstallation_test.go b/resource-manager/web/2016-06-01/connectiongateways/id_connectiongatewayinstallation_test.go index 5b771280e5a..714b92b189c 100644 --- a/resource-manager/web/2016-06-01/connectiongateways/id_connectiongatewayinstallation_test.go +++ b/resource-manager/web/2016-06-01/connectiongateways/id_connectiongatewayinstallation_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &ConnectionGatewayInstallationId{} func TestNewConnectionGatewayInstallationID(t *testing.T) { - id := NewConnectionGatewayInstallationID("12345678-1234-9876-4563-123456789012", "location", "gatewayId") + id := NewConnectionGatewayInstallationID("12345678-1234-9876-4563-123456789012", "locationName", "gatewayId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.GatewayId != "gatewayId" { @@ -28,8 +28,8 @@ func TestNewConnectionGatewayInstallationID(t *testing.T) { } func TestFormatConnectionGatewayInstallationID(t *testing.T) { - actual := NewConnectionGatewayInstallationID("12345678-1234-9876-4563-123456789012", "location", "gatewayId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/connectionGatewayInstallations/gatewayId" + actual := NewConnectionGatewayInstallationID("12345678-1234-9876-4563-123456789012", "locationName", "gatewayId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/connectionGatewayInstallations/gatewayId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseConnectionGatewayInstallationID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/connectionGatewayInstallations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/connectionGatewayInstallations", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/connectionGatewayInstallations/gatewayId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/connectionGatewayInstallations/gatewayId", Expected: &ConnectionGatewayInstallationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", GatewayId: "gatewayId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/connectionGatewayInstallations/gatewayId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/connectionGatewayInstallations/gatewayId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseConnectionGatewayInstallationIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/connectionGatewayInstallations", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/connectionGatewayInstallations", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/cOnNeCtIoNgAtEwAyInStAlLaTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtIoNgAtEwAyInStAlLaTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/connectionGatewayInstallations/gatewayId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/connectionGatewayInstallations/gatewayId", Expected: &ConnectionGatewayInstallationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", GatewayId: "gatewayId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/connectionGatewayInstallations/gatewayId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/connectionGatewayInstallations/gatewayId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/cOnNeCtIoNgAtEwAyInStAlLaTiOnS/gAtEwAyId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtIoNgAtEwAyInStAlLaTiOnS/gAtEwAyId", Expected: &ConnectionGatewayInstallationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", GatewayId: "gAtEwAyId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/cOnNeCtIoNgAtEwAyInStAlLaTiOnS/gAtEwAyId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/cOnNeCtIoNgAtEwAyInStAlLaTiOnS/gAtEwAyId/extra", Error: true, }, } diff --git a/resource-manager/web/2016-06-01/connectiongateways/id_location.go b/resource-manager/web/2016-06-01/connectiongateways/id_location.go index e344afc9bc9..c7019eb83f0 100644 --- a/resource-manager/web/2016-06-01/connectiongateways/id_location.go +++ b/resource-manager/web/2016-06-01/connectiongateways/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2016-06-01/connectiongateways/id_location_test.go b/resource-manager/web/2016-06-01/connectiongateways/id_location_test.go index 0b03d4a9acf..698c09646c7 100644 --- a/resource-manager/web/2016-06-01/connectiongateways/id_location_test.go +++ b/resource-manager/web/2016-06-01/connectiongateways/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2016-06-01/connections/model_consentlinkparameterdefinition.go b/resource-manager/web/2016-06-01/connections/model_consentlinkparameterdefinition.go index 250a5ef3070..6bbae2d7812 100644 --- a/resource-manager/web/2016-06-01/connections/model_consentlinkparameterdefinition.go +++ b/resource-manager/web/2016-06-01/connections/model_consentlinkparameterdefinition.go @@ -6,6 +6,6 @@ package connections type ConsentLinkParameterDefinition struct { ObjectId *string `json:"objectId,omitempty"` ParameterName *string `json:"parameterName,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` TenantId *string `json:"tenantId,omitempty"` } diff --git a/resource-manager/web/2016-06-01/customapis/README.md b/resource-manager/web/2016-06-01/customapis/README.md index 7b1aba801ba..90dea8b0de8 100644 --- a/resource-manager/web/2016-06-01/customapis/README.md +++ b/resource-manager/web/2016-06-01/customapis/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "apiName") +id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customApiName") payload := customapis.CustomApiDefinition{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "apiName") +id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customApiName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customapis.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := customapis.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := customapis.WsdlDefinition{ // ... @@ -83,7 +83,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "apiName") +id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customApiName") read, err := client.Get(ctx, id) if err != nil { @@ -131,7 +131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customapis.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := customapis.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := customapis.WsdlDefinition{ // ... @@ -152,7 +152,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "apiName") +id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customApiName") payload := customapis.CustomApiReference{ // ... @@ -173,7 +173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "apiName") +id := customapis.NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customApiName") payload := customapis.CustomApiDefinition{ // ... diff --git a/resource-manager/web/2016-06-01/customapis/id_customapi.go b/resource-manager/web/2016-06-01/customapis/id_customapi.go index 571967549e6..12bd27e872c 100644 --- a/resource-manager/web/2016-06-01/customapis/id_customapi.go +++ b/resource-manager/web/2016-06-01/customapis/id_customapi.go @@ -115,7 +115,7 @@ func (id CustomApiId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticCustomApis", "customApis", "customApis"), - resourceids.UserSpecifiedSegment("customApiName", "apiName"), + resourceids.UserSpecifiedSegment("customApiName", "customApiName"), } } diff --git a/resource-manager/web/2016-06-01/customapis/id_customapi_test.go b/resource-manager/web/2016-06-01/customapis/id_customapi_test.go index 8e219881640..83cfddd220c 100644 --- a/resource-manager/web/2016-06-01/customapis/id_customapi_test.go +++ b/resource-manager/web/2016-06-01/customapis/id_customapi_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomApiId{} func TestNewCustomApiID(t *testing.T) { - id := NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "apiName") + id := NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customApiName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCustomApiID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CustomApiName != "apiName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomApiName'", id.CustomApiName, "apiName") + if id.CustomApiName != "customApiName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomApiName'", id.CustomApiName, "customApiName") } } func TestFormatCustomApiID(t *testing.T) { - actual := NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "apiName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/apiName" + actual := NewCustomApiID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customApiName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/customApiName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCustomApiID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/customApiName", Expected: &CustomApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomApiName: "apiName", + CustomApiName: "customApiName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/customApiName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCustomApiIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/customApiName", Expected: &CustomApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CustomApiName: "apiName", + CustomApiName: "customApiName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/customApis/customApiName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cUsToMaPiS/aPiNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cUsToMaPiS/cUsToMaPiNaMe", Expected: &CustomApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CustomApiName: "aPiNaMe", + CustomApiName: "cUsToMaPiNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cUsToMaPiS/aPiNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cUsToMaPiS/cUsToMaPiNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2016-06-01/customapis/id_location.go b/resource-manager/web/2016-06-01/customapis/id_location.go index 70649e20769..6ea7747bbab 100644 --- a/resource-manager/web/2016-06-01/customapis/id_location.go +++ b/resource-manager/web/2016-06-01/customapis/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2016-06-01/customapis/id_location_test.go b/resource-manager/web/2016-06-01/customapis/id_location_test.go index 40fc1bc0f68..2c68bfac842 100644 --- a/resource-manager/web/2016-06-01/customapis/id_location_test.go +++ b/resource-manager/web/2016-06-01/customapis/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2016-06-01/customapis/model_apioauthsettings.go b/resource-manager/web/2016-06-01/customapis/model_apioauthsettings.go index 015f0a8cc2f..b45baa657e7 100644 --- a/resource-manager/web/2016-06-01/customapis/model_apioauthsettings.go +++ b/resource-manager/web/2016-06-01/customapis/model_apioauthsettings.go @@ -9,6 +9,6 @@ type ApiOAuthSettings struct { CustomParameters *map[string]ApiOAuthSettingsParameter `json:"customParameters,omitempty"` IdentityProvider *string `json:"identityProvider,omitempty"` Properties *interface{} `json:"properties,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` Scopes *[]string `json:"scopes,omitempty"` } diff --git a/resource-manager/web/2016-06-01/customapis/model_apiresourcebackendservice.go b/resource-manager/web/2016-06-01/customapis/model_apiresourcebackendservice.go index 5bfb6455e8a..1a2f8a5e1e5 100644 --- a/resource-manager/web/2016-06-01/customapis/model_apiresourcebackendservice.go +++ b/resource-manager/web/2016-06-01/customapis/model_apiresourcebackendservice.go @@ -4,5 +4,5 @@ package customapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceBackendService struct { - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/web/2016-06-01/customapis/model_apiresourcedefinitions.go b/resource-manager/web/2016-06-01/customapis/model_apiresourcedefinitions.go index 569dd87c9d8..6102080d34d 100644 --- a/resource-manager/web/2016-06-01/customapis/model_apiresourcedefinitions.go +++ b/resource-manager/web/2016-06-01/customapis/model_apiresourcedefinitions.go @@ -4,6 +4,6 @@ package customapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceDefinitions struct { - ModifiedSwaggerUrl *string `json:"modifiedSwaggerUrl,omitempty"` - OriginalSwaggerUrl *string `json:"originalSwaggerUrl,omitempty"` + ModifiedSwaggerURL *string `json:"modifiedSwaggerUrl,omitempty"` + OriginalSwaggerURL *string `json:"originalSwaggerUrl,omitempty"` } diff --git a/resource-manager/web/2016-06-01/customapis/model_customapipropertiesdefinition.go b/resource-manager/web/2016-06-01/customapis/model_customapipropertiesdefinition.go index 7ac0bb826dc..bbb48ea5c4d 100644 --- a/resource-manager/web/2016-06-01/customapis/model_customapipropertiesdefinition.go +++ b/resource-manager/web/2016-06-01/customapis/model_customapipropertiesdefinition.go @@ -13,7 +13,7 @@ type CustomApiPropertiesDefinition struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` IconUri *string `json:"iconUri,omitempty"` - RuntimeUrls *[]string `json:"runtimeUrls,omitempty"` + RuntimeURLs *[]string `json:"runtimeUrls,omitempty"` Swagger *interface{} `json:"swagger,omitempty"` WsdlDefinition *WsdlDefinition `json:"wsdlDefinition,omitempty"` } diff --git a/resource-manager/web/2016-06-01/managedapis/README.md b/resource-manager/web/2016-06-01/managedapis/README.md index 21799363741..c05fc7f10ce 100644 --- a/resource-manager/web/2016-06-01/managedapis/README.md +++ b/resource-manager/web/2016-06-01/managedapis/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := managedapis.NewManagedApiID("12345678-1234-9876-4563-123456789012", "location", "apiName") +id := managedapis.NewManagedApiID("12345678-1234-9876-4563-123456789012", "locationName", "managedApiName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := managedapis.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := managedapis.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") read, err := client.List(ctx, id) if err != nil { diff --git a/resource-manager/web/2016-06-01/managedapis/id_location.go b/resource-manager/web/2016-06-01/managedapis/id_location.go index e2b4e5f0f69..f57f0461350 100644 --- a/resource-manager/web/2016-06-01/managedapis/id_location.go +++ b/resource-manager/web/2016-06-01/managedapis/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2016-06-01/managedapis/id_location_test.go b/resource-manager/web/2016-06-01/managedapis/id_location_test.go index a4d714d334f..faa44faff4b 100644 --- a/resource-manager/web/2016-06-01/managedapis/id_location_test.go +++ b/resource-manager/web/2016-06-01/managedapis/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2016-06-01/managedapis/id_managedapi.go b/resource-manager/web/2016-06-01/managedapis/id_managedapi.go index 57881f147c9..afedb50d9f7 100644 --- a/resource-manager/web/2016-06-01/managedapis/id_managedapi.go +++ b/resource-manager/web/2016-06-01/managedapis/id_managedapi.go @@ -113,9 +113,9 @@ func (id ManagedApiId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticManagedApis", "managedApis", "managedApis"), - resourceids.UserSpecifiedSegment("managedApiName", "apiName"), + resourceids.UserSpecifiedSegment("managedApiName", "managedApiName"), } } diff --git a/resource-manager/web/2016-06-01/managedapis/id_managedapi_test.go b/resource-manager/web/2016-06-01/managedapis/id_managedapi_test.go index 6706d902d72..cfab5d6272d 100644 --- a/resource-manager/web/2016-06-01/managedapis/id_managedapi_test.go +++ b/resource-manager/web/2016-06-01/managedapis/id_managedapi_test.go @@ -12,24 +12,24 @@ import ( var _ resourceids.ResourceId = &ManagedApiId{} func TestNewManagedApiID(t *testing.T) { - id := NewManagedApiID("12345678-1234-9876-4563-123456789012", "location", "apiName") + id := NewManagedApiID("12345678-1234-9876-4563-123456789012", "locationName", "managedApiName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } - if id.ManagedApiName != "apiName" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedApiName'", id.ManagedApiName, "apiName") + if id.ManagedApiName != "managedApiName" { + t.Fatalf("Expected %q but got %q for Segment 'ManagedApiName'", id.ManagedApiName, "managedApiName") } } func TestFormatManagedApiID(t *testing.T) { - actual := NewManagedApiID("12345678-1234-9876-4563-123456789012", "location", "apiName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/managedApis/apiName" + actual := NewManagedApiID("12345678-1234-9876-4563-123456789012", "locationName", "managedApiName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/managedApis/managedApiName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseManagedApiID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/managedApis", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/managedApis", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/managedApis/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/managedApis/managedApiName", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedApiName: "apiName", + LocationName: "locationName", + ManagedApiName: "managedApiName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/managedApis/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/managedApis/managedApiName/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseManagedApiIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/managedApis", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/managedApis", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/mAnAgEdApIs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdApIs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/managedApis/apiName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/managedApis/managedApiName", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", - ManagedApiName: "apiName", + LocationName: "locationName", + ManagedApiName: "managedApiName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/managedApis/apiName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/managedApis/managedApiName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/mAnAgEdApIs/aPiNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdApIs/mAnAgEdApInAmE", Expected: &ManagedApiId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", - ManagedApiName: "aPiNaMe", + LocationName: "lOcAtIoNnAmE", + ManagedApiName: "mAnAgEdApInAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/mAnAgEdApIs/aPiNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/mAnAgEdApIs/mAnAgEdApInAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2016-06-01/managedapis/model_apioauthsettings.go b/resource-manager/web/2016-06-01/managedapis/model_apioauthsettings.go index 44096c56d0d..1f5dd98955d 100644 --- a/resource-manager/web/2016-06-01/managedapis/model_apioauthsettings.go +++ b/resource-manager/web/2016-06-01/managedapis/model_apioauthsettings.go @@ -9,6 +9,6 @@ type ApiOAuthSettings struct { CustomParameters *map[string]ApiOAuthSettingsParameter `json:"customParameters,omitempty"` IdentityProvider *string `json:"identityProvider,omitempty"` Properties *interface{} `json:"properties,omitempty"` - RedirectUrl *string `json:"redirectUrl,omitempty"` + RedirectURL *string `json:"redirectUrl,omitempty"` Scopes *[]string `json:"scopes,omitempty"` } diff --git a/resource-manager/web/2016-06-01/managedapis/model_apiresourcebackendservice.go b/resource-manager/web/2016-06-01/managedapis/model_apiresourcebackendservice.go index 32a46dfc3d8..add7a6e6696 100644 --- a/resource-manager/web/2016-06-01/managedapis/model_apiresourcebackendservice.go +++ b/resource-manager/web/2016-06-01/managedapis/model_apiresourcebackendservice.go @@ -4,5 +4,5 @@ package managedapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceBackendService struct { - ServiceUrl *string `json:"serviceUrl,omitempty"` + ServiceURL *string `json:"serviceUrl,omitempty"` } diff --git a/resource-manager/web/2016-06-01/managedapis/model_apiresourcedefinitions.go b/resource-manager/web/2016-06-01/managedapis/model_apiresourcedefinitions.go index 665603f9399..c117dcd598f 100644 --- a/resource-manager/web/2016-06-01/managedapis/model_apiresourcedefinitions.go +++ b/resource-manager/web/2016-06-01/managedapis/model_apiresourcedefinitions.go @@ -4,6 +4,6 @@ package managedapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceDefinitions struct { - ModifiedSwaggerUrl *string `json:"modifiedSwaggerUrl,omitempty"` - OriginalSwaggerUrl *string `json:"originalSwaggerUrl,omitempty"` + ModifiedSwaggerURL *string `json:"modifiedSwaggerUrl,omitempty"` + OriginalSwaggerURL *string `json:"originalSwaggerUrl,omitempty"` } diff --git a/resource-manager/web/2016-06-01/managedapis/model_apiresourcegeneralinformation.go b/resource-manager/web/2016-06-01/managedapis/model_apiresourcegeneralinformation.go index d80741da9fc..01e2ea504bd 100644 --- a/resource-manager/web/2016-06-01/managedapis/model_apiresourcegeneralinformation.go +++ b/resource-manager/web/2016-06-01/managedapis/model_apiresourcegeneralinformation.go @@ -6,7 +6,7 @@ package managedapis type ApiResourceGeneralInformation struct { Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` + IconURL *string `json:"iconUrl,omitempty"` ReleaseTag *string `json:"releaseTag,omitempty"` - TermsOfUseUrl *string `json:"termsOfUseUrl,omitempty"` + TermsOfUseURL *string `json:"termsOfUseUrl,omitempty"` } diff --git a/resource-manager/web/2016-06-01/managedapis/model_apiresourceproperties.go b/resource-manager/web/2016-06-01/managedapis/model_apiresourceproperties.go index 69ff1ac1dc2..e08f6db6d49 100644 --- a/resource-manager/web/2016-06-01/managedapis/model_apiresourceproperties.go +++ b/resource-manager/web/2016-06-01/managedapis/model_apiresourceproperties.go @@ -4,7 +4,7 @@ package managedapis // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ApiResourceProperties struct { - ApiDefinitionUrl *string `json:"apiDefinitionUrl,omitempty"` + ApiDefinitionURL *string `json:"apiDefinitionUrl,omitempty"` ApiDefinitions *ApiResourceDefinitions `json:"apiDefinitions,omitempty"` BackendService *ApiResourceBackendService `json:"backendService,omitempty"` Capabilities *[]string `json:"capabilities,omitempty"` @@ -13,6 +13,6 @@ type ApiResourceProperties struct { Metadata *ApiResourceMetadata `json:"metadata,omitempty"` Name *string `json:"name,omitempty"` Policies *ApiResourcePolicies `json:"policies,omitempty"` - RuntimeUrls *[]string `json:"runtimeUrls,omitempty"` + RuntimeURLs *[]string `json:"runtimeUrls,omitempty"` Swagger *interface{} `json:"swagger,omitempty"` } diff --git a/resource-manager/web/2022-09-01/appservicecertificateorders/README.md b/resource-manager/web/2022-09-01/appservicecertificateorders/README.md index 4f506faaf8c..d2e315ee45a 100644 --- a/resource-manager/web/2022-09-01/appservicecertificateorders/README.md +++ b/resource-manager/web/2022-09-01/appservicecertificateorders/README.md @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") payload := appservicecertificateorders.AppServiceCertificateResource{ // ... @@ -75,7 +75,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") read, err := client.DeleteCertificate(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") read, err := client.GetCertificate(ctx, id) if err != nil { @@ -327,7 +327,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") payload := appservicecertificateorders.AppServiceCertificatePatchResource{ // ... diff --git a/resource-manager/web/2023-12-01/appservicecertificateorders/id_certificate.go b/resource-manager/web/2022-09-01/appservicecertificateorders/id_certificateordercertificate.go similarity index 62% rename from resource-manager/web/2023-12-01/appservicecertificateorders/id_certificate.go rename to resource-manager/web/2022-09-01/appservicecertificateorders/id_certificateordercertificate.go index b68393bf88f..91835e730de 100644 --- a/resource-manager/web/2023-12-01/appservicecertificateorders/id_certificate.go +++ b/resource-manager/web/2022-09-01/appservicecertificateorders/id_certificateordercertificate.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&CertificateId{}) + recaser.RegisterResourceId(&CertificateOrderCertificateId{}) } -var _ resourceids.ResourceId = &CertificateId{} +var _ resourceids.ResourceId = &CertificateOrderCertificateId{} -// CertificateId is a struct representing the Resource ID for a Certificate -type CertificateId struct { +// CertificateOrderCertificateId is a struct representing the Resource ID for a Certificate Order Certificate +type CertificateOrderCertificateId struct { SubscriptionId string ResourceGroupName string CertificateOrderName string CertificateName string } -// NewCertificateID returns a new CertificateId struct -func NewCertificateID(subscriptionId string, resourceGroupName string, certificateOrderName string, certificateName string) CertificateId { - return CertificateId{ +// NewCertificateOrderCertificateID returns a new CertificateOrderCertificateId struct +func NewCertificateOrderCertificateID(subscriptionId string, resourceGroupName string, certificateOrderName string, certificateName string) CertificateOrderCertificateId { + return CertificateOrderCertificateId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, CertificateOrderName: certificateOrderName, @@ -35,15 +35,15 @@ func NewCertificateID(subscriptionId string, resourceGroupName string, certifica } } -// ParseCertificateID parses 'input' into a CertificateId -func ParseCertificateID(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) +// ParseCertificateOrderCertificateID parses 'input' into a CertificateOrderCertificateId +func ParseCertificateOrderCertificateID(input string) (*CertificateOrderCertificateId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderCertificateId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := CertificateId{} + id := CertificateOrderCertificateId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseCertificateID(input string) (*CertificateId, error) { return &id, nil } -// ParseCertificateIDInsensitively parses 'input' case-insensitively into a CertificateId +// ParseCertificateOrderCertificateIDInsensitively parses 'input' case-insensitively into a CertificateOrderCertificateId // note: this method should only be used for API response data and not user input -func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) +func ParseCertificateOrderCertificateIDInsensitively(input string) (*CertificateOrderCertificateId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderCertificateId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := CertificateId{} + id := CertificateOrderCertificateId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { return &id, nil } -func (id *CertificateId) FromParseResult(input resourceids.ParseResult) error { +func (id *CertificateOrderCertificateId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *CertificateId) FromParseResult(input resourceids.ParseResult) error { return nil } -// ValidateCertificateID checks that 'input' can be parsed as a Certificate ID -func ValidateCertificateID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateCertificateOrderCertificateID checks that 'input' can be parsed as a Certificate Order Certificate ID +func ValidateCertificateOrderCertificateID(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 := ParseCertificateID(v); err != nil { + if _, err := ParseCertificateOrderCertificateID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Certificate ID -func (id CertificateId) ID() string { +// ID returns the formatted Certificate Order Certificate ID +func (id CertificateOrderCertificateId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.CertificateRegistration/certificateOrders/%s/certificates/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CertificateOrderName, id.CertificateName) } -// Segments returns a slice of Resource ID Segments which comprise this Certificate ID -func (id CertificateId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Certificate Order Certificate ID +func (id CertificateOrderCertificateId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -123,17 +123,17 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticCertificateOrders", "certificateOrders", "certificateOrders"), resourceids.UserSpecifiedSegment("certificateOrderName", "certificateOrderName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } -// String returns a human-readable description of this Certificate ID -func (id CertificateId) String() string { +// String returns a human-readable description of this Certificate Order Certificate ID +func (id CertificateOrderCertificateId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Certificate Order Name: %q", id.CertificateOrderName), fmt.Sprintf("Certificate Name: %q", id.CertificateName), } - return fmt.Sprintf("Certificate (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Certificate Order Certificate (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2023-12-01/appservicecertificateorders/id_certificate_test.go b/resource-manager/web/2022-09-01/appservicecertificateorders/id_certificateordercertificate_test.go similarity index 87% rename from resource-manager/web/2023-12-01/appservicecertificateorders/id_certificate_test.go rename to resource-manager/web/2022-09-01/appservicecertificateorders/id_certificateordercertificate_test.go index 40bce391166..8b5bb4327c3 100644 --- a/resource-manager/web/2023-12-01/appservicecertificateorders/id_certificate_test.go +++ b/resource-manager/web/2022-09-01/appservicecertificateorders/id_certificateordercertificate_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &CertificateId{} +var _ resourceids.ResourceId = &CertificateOrderCertificateId{} -func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +func TestNewCertificateOrderCertificateID(t *testing.T) { + id := NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,24 +26,24 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'CertificateOrderName'", id.CertificateOrderName, "certificateOrderName") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } -func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name" +func TestFormatCertificateOrderCertificateID(t *testing.T) { + actual := NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseCertificateID(t *testing.T) { +func TestParseCertificateOrderCertificateID(t *testing.T) { testData := []struct { Input string Error bool - Expected *CertificateId + Expected *CertificateOrderCertificateId }{ { // Incomplete URI @@ -97,24 +97,24 @@ func TestParseCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name", - Expected: &CertificateId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseCertificateID(v.Input) + actual, err := ParseCertificateOrderCertificateID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseCertificateID(t *testing.T) { } } -func TestParseCertificateIDInsensitively(t *testing.T) { +func TestParseCertificateOrderCertificateIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *CertificateId + Expected *CertificateOrderCertificateId }{ { // Incomplete URI @@ -248,39 +248,39 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name", - Expected: &CertificateId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/nAmE", - Expected: &CertificateId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CertificateOrderName: "cErTiFiCaTeOrDeRnAmE", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseCertificateIDInsensitively(v.Input) + actual, err := ParseCertificateOrderCertificateIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseCertificateIDInsensitively(t *testing.T) { } } -func TestSegmentsForCertificateId(t *testing.T) { - segments := CertificateId{}.Segments() +func TestSegmentsForCertificateOrderCertificateId(t *testing.T) { + segments := CertificateOrderCertificateId{}.Segments() if len(segments) == 0 { - t.Fatalf("CertificateId has no segments") + t.Fatalf("CertificateOrderCertificateId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2022-09-01/appservicecertificateorders/method_createorupdatecertificate.go b/resource-manager/web/2022-09-01/appservicecertificateorders/method_createorupdatecertificate.go index f8d50a20ddc..013318e02e8 100644 --- a/resource-manager/web/2022-09-01/appservicecertificateorders/method_createorupdatecertificate.go +++ b/resource-manager/web/2022-09-01/appservicecertificateorders/method_createorupdatecertificate.go @@ -22,7 +22,7 @@ type CreateOrUpdateCertificateOperationResponse struct { } // CreateOrUpdateCertificate ... -func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context.Context, id CertificateId, input AppServiceCertificateResource) (result CreateOrUpdateCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificateResource) (result CreateOrUpdateCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -61,7 +61,7 @@ func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context } // CreateOrUpdateCertificateThenPoll performs CreateOrUpdateCertificate then polls until it's completed -func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificateThenPoll(ctx context.Context, id CertificateId, input AppServiceCertificateResource) error { +func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificateThenPoll(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificateResource) error { result, err := c.CreateOrUpdateCertificate(ctx, id, input) if err != nil { return fmt.Errorf("performing CreateOrUpdateCertificate: %+v", err) diff --git a/resource-manager/web/2022-09-01/appservicecertificateorders/method_deletecertificate.go b/resource-manager/web/2022-09-01/appservicecertificateorders/method_deletecertificate.go index 1bd00712f78..98b4359fd23 100644 --- a/resource-manager/web/2022-09-01/appservicecertificateorders/method_deletecertificate.go +++ b/resource-manager/web/2022-09-01/appservicecertificateorders/method_deletecertificate.go @@ -17,7 +17,7 @@ type DeleteCertificateOperationResponse struct { } // DeleteCertificate ... -func (c AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, id CertificateId) (result DeleteCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, id CertificateOrderCertificateId) (result DeleteCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2022-09-01/appservicecertificateorders/method_getcertificate.go b/resource-manager/web/2022-09-01/appservicecertificateorders/method_getcertificate.go index 0418d289349..712789271ae 100644 --- a/resource-manager/web/2022-09-01/appservicecertificateorders/method_getcertificate.go +++ b/resource-manager/web/2022-09-01/appservicecertificateorders/method_getcertificate.go @@ -18,7 +18,7 @@ type GetCertificateOperationResponse struct { } // GetCertificate ... -func (c AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, id CertificateId) (result GetCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, id CertificateOrderCertificateId) (result GetCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2022-09-01/appservicecertificateorders/method_updatecertificate.go b/resource-manager/web/2022-09-01/appservicecertificateorders/method_updatecertificate.go index 8ebfd637ea5..dbb5136b153 100644 --- a/resource-manager/web/2022-09-01/appservicecertificateorders/method_updatecertificate.go +++ b/resource-manager/web/2022-09-01/appservicecertificateorders/method_updatecertificate.go @@ -18,7 +18,7 @@ type UpdateCertificateOperationResponse struct { } // UpdateCertificate ... -func (c AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, id CertificateId, input AppServiceCertificatePatchResource) (result UpdateCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificatePatchResource) (result UpdateCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/README.md b/resource-manager/web/2022-09-01/appserviceenvironments/README.md index 0a1828c5106..0f51142c626 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/README.md +++ b/resource-manager/web/2022-09-01/appserviceenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") payload := appserviceenvironments.RemotePrivateEndpointConnectionARMResource{ // ... @@ -98,7 +98,7 @@ if err := client.CreateOrUpdateMultiRolePoolThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") payload := appserviceenvironments.WorkerPoolResource{ // ... @@ -143,7 +143,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName") +id := appserviceenvironments.NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName") read, err := client.GetDiagnosticsItem(ctx, id) if err != nil { @@ -269,7 +269,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -334,7 +334,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") read, err := client.GetWorkerPool(ctx, id) if err != nil { @@ -451,7 +451,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance") +id := appserviceenvironments.NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName") // alternatively `client.ListMultiRolePoolInstanceMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListMultiRolePoolInstanceMetricDefinitionsComplete(ctx, id) @@ -569,7 +569,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWebWorkerMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListWebWorkerMetricDefinitionsComplete(ctx, id) @@ -586,7 +586,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWebWorkerUsages(ctx, id)` can be used to do batched pagination items, err := client.ListWebWorkerUsagesComplete(ctx, id) @@ -603,7 +603,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance") +id := appserviceenvironments.NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName") // alternatively `client.ListWorkerPoolInstanceMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListWorkerPoolInstanceMetricDefinitionsComplete(ctx, id) @@ -620,7 +620,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWorkerPoolSkus(ctx, id)` can be used to do batched pagination items, err := client.ListWorkerPoolSkusComplete(ctx, id) @@ -804,7 +804,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") payload := appserviceenvironments.WorkerPoolResource{ // ... diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_defaultinstance.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_defaultinstance.go index c2d2d2a4659..88c10f8ab90 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_defaultinstance.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_defaultinstance.go @@ -121,11 +121,11 @@ func (id DefaultInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticMultiRolePools", "multiRolePools", "multiRolePools"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticInstances", "instances", "instances"), - resourceids.UserSpecifiedSegment("instanceName", "instance"), + resourceids.UserSpecifiedSegment("instanceName", "instanceName"), } } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_defaultinstance_test.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_defaultinstance_test.go index 69c92d45326..a260dfe3401 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_defaultinstance_test.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_defaultinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DefaultInstanceId{} func TestNewDefaultInstanceID(t *testing.T) { - id := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance") + id := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDefaultInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.InstanceName != "instance" { - t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instance") + if id.InstanceName != "instanceName" { + t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instanceName") } } func TestFormatDefaultInstanceID(t *testing.T) { - actual := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance" + actual := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseDefaultInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - InstanceName: "instance", + HostingEnvironmentName: "hostingEnvironmentName", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseDefaultInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - InstanceName: "instance", + HostingEnvironmentName: "hostingEnvironmentName", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcEnAmE", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", - InstanceName: "iNsTaNcE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", + InstanceName: "iNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go index f30c0af2108..9c0321e3f7a 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go @@ -121,9 +121,9 @@ func (id HostingEnvironmentDiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticsName"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go index 50a9f57decc..e998d9bcef1 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentDiagnosticId{} func TestNewHostingEnvironmentDiagnosticID(t *testing.T) { - id := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName") + id := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHostingEnvironmentDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.DiagnosticName != "diagnosticsName" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticsName") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatHostingEnvironmentDiagnosticID(t *testing.T) { - actual := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName" + actual := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentDiagnosticID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - DiagnosticName: "diagnosticsName", + HostingEnvironmentName: "hostingEnvironmentName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentDiagnosticIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - DiagnosticName: "diagnosticsName", + HostingEnvironmentName: "hostingEnvironmentName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs/dIaGnOsTiCsNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", - DiagnosticName: "dIaGnOsTiCsNaMe", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs/dIaGnOsTiCsNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go index 9e9e3ca4d87..415a31bdc7e 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go @@ -121,7 +121,7 @@ func (id HostingEnvironmentPrivateEndpointConnectionId) Segments() []resourceids resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go index 3fdc734c969..f343f7258e6 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentPrivateEndpointConnectionId{} func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { - id := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { } func TestFormatHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { - actual := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentPrivateEndpointConnectionIDInsensitively(t *test }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpool.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpool.go index e477a8499c2..dd10e8ad690 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpool.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpool.go @@ -121,7 +121,7 @@ func (id WorkerPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticWorkerPools", "workerPools", "workerPools"), resourceids.UserSpecifiedSegment("workerPoolName", "workerPoolName"), } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpool_test.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpool_test.go index 9796b8d8b07..df611010d06 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpool_test.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerPoolId{} func TestNewWorkerPoolID(t *testing.T) { - id := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") + id := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkerPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.WorkerPoolName != "workerPoolName" { @@ -32,8 +32,8 @@ func TestNewWorkerPoolID(t *testing.T) { } func TestFormatWorkerPoolID(t *testing.T) { - actual := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName" + actual := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkerPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkerPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", WorkerPoolName: "wOrKeRpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpoolinstance.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpoolinstance.go index be628dbc4e4..50a42965552 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpoolinstance.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpoolinstance.go @@ -127,11 +127,11 @@ func (id WorkerPoolInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticWorkerPools", "workerPools", "workerPools"), resourceids.UserSpecifiedSegment("workerPoolName", "workerPoolName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), - resourceids.UserSpecifiedSegment("instanceName", "instance"), + resourceids.UserSpecifiedSegment("instanceName", "instanceName"), } } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpoolinstance_test.go b/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpoolinstance_test.go index fd84259fbb8..b23611ebd58 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpoolinstance_test.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/id_workerpoolinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerPoolInstanceId{} func TestNewWorkerPoolInstanceID(t *testing.T) { - id := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance") + id := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewWorkerPoolInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.WorkerPoolName != "workerPoolName" { t.Fatalf("Expected %q but got %q for Segment 'WorkerPoolName'", id.WorkerPoolName, "workerPoolName") } - if id.InstanceName != "instance" { - t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instance") + if id.InstanceName != "instanceName" { + t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instanceName") } } func TestFormatWorkerPoolInstanceID(t *testing.T) { - actual := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance" + actual := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseWorkerPoolInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", - InstanceName: "instance", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseWorkerPoolInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", - InstanceName: "instance", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcEnAmE", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", WorkerPoolName: "wOrKeRpOoLnAmE", - InstanceName: "iNsTaNcE", + InstanceName: "iNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go b/resource-manager/web/2022-09-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go index 80ac53f7a52..54d57c9d118 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go @@ -4,7 +4,7 @@ package appserviceenvironments // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type CustomDnsSuffixConfigurationProperties struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` DnsSuffix *string `json:"dnsSuffix,omitempty"` KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` ProvisioningDetails *string `json:"provisioningDetails,omitempty"` diff --git a/resource-manager/web/2022-09-01/appserviceenvironments/model_rampuprule.go b/resource-manager/web/2022-09-01/appserviceenvironments/model_rampuprule.go index ace74b58d88..0db6bb0db58 100644 --- a/resource-manager/web/2022-09-01/appserviceenvironments/model_rampuprule.go +++ b/resource-manager/web/2022-09-01/appserviceenvironments/model_rampuprule.go @@ -5,7 +5,7 @@ package appserviceenvironments type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2022-09-01/appserviceplans/README.md b/resource-manager/web/2022-09-01/appserviceplans/README.md index 1de551b95ad..4a612da7f04 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/README.md +++ b/resource-manager/web/2022-09-01/appserviceplans/README.md @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") payload := appserviceplans.VnetRoute{ // ... @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnection(ctx, id) if err != nil { @@ -95,7 +95,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") read, err := client.DeleteVnetRoute(ctx, id) if err != nil { @@ -127,7 +127,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnection(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") read, err := client.GetRouteForVnet(ctx, id) if err != nil { @@ -191,7 +191,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") read, err := client.GetVnetFromServerFarm(ctx, id) if err != nil { @@ -207,7 +207,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetGateway(ctx, id) if err != nil { @@ -273,7 +273,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.ListHybridConnectionKeys(ctx, id) if err != nil { @@ -306,7 +306,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") read, err := client.ListRoutesForVnet(ctx, id) if err != nil { @@ -372,7 +372,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") // alternatively `client.ListWebAppsByHybridConnection(ctx, id)` can be used to do batched pagination items, err := client.ListWebAppsByHybridConnectionComplete(ctx, id) @@ -389,7 +389,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName") +id := appserviceplans.NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName") read, err := client.RebootWorker(ctx, id) if err != nil { @@ -442,7 +442,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") payload := appserviceplans.VnetGateway{ // ... @@ -463,7 +463,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") payload := appserviceplans.VnetRoute{ // ... diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_hybridconnectionnamespacerelay.go b/resource-manager/web/2022-09-01/appserviceplans/id_hybridconnectionnamespacerelay.go index a674a4cebd6..31cf0010bc4 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_hybridconnectionnamespacerelay.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_hybridconnectionnamespacerelay.go @@ -127,9 +127,9 @@ func (id HybridConnectionNamespaceRelayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go b/resource-manager/web/2022-09-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go index ac6e1d1f4b0..ca8a17b9536 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HybridConnectionNamespaceRelayId{} func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { - id := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") + id := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -36,8 +36,8 @@ func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { } func TestFormatHybridConnectionNamespaceRelayID(t *testing.T) { - actual := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseHybridConnectionNamespaceRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - HybridConnectionNamespaceName: "namespaceName", + ServerFarmName: "serverFarmName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseHybridConnectionNamespaceRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - HybridConnectionNamespaceName: "namespaceName", + ServerFarmName: "serverFarmName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + ServerFarmName: "sErVeRfArMnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_route.go b/resource-manager/web/2022-09-01/appserviceplans/id_route.go index 7b34860722d..4368f47c094 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_route.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_route.go @@ -127,9 +127,9 @@ func (id RouteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticRoutes", "routes", "routes"), resourceids.UserSpecifiedSegment("routeName", "routeName"), } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_route_test.go b/resource-manager/web/2022-09-01/appserviceplans/id_route_test.go index d313c62cf7d..ec524514b68 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_route_test.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_route_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteId{} func TestNewRouteID(t *testing.T) { - id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") + id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewRouteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.RouteName != "routeName" { @@ -36,8 +36,8 @@ func TestNewRouteID(t *testing.T) { } func TestFormatRouteID(t *testing.T) { - actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName" + actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRouteID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", RouteName: "routeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRouteIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", RouteName: "routeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS/rOuTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS/rOuTeNaMe", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", RouteName: "rOuTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS/rOuTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS/rOuTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go b/resource-manager/web/2022-09-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go index c2948bed06a..5d43668ff23 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go @@ -121,9 +121,9 @@ func (id ServerFarmVirtualNetworkConnectionId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go b/resource-manager/web/2022-09-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go index 13403b364d7..5601db88695 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerFarmVirtualNetworkConnectionId{} func TestNewServerFarmVirtualNetworkConnectionID(t *testing.T) { - id := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") + id := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewServerFarmVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatServerFarmVirtualNetworkConnectionID(t *testing.T) { - actual := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName" + actual := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServerFarmVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServerFarmVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_virtualnetworkconnectiongateway.go b/resource-manager/web/2022-09-01/appserviceplans/id_virtualnetworkconnectiongateway.go index aee31447cb0..4ccedb2d7ce 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_virtualnetworkconnectiongateway.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_virtualnetworkconnectiongateway.go @@ -127,9 +127,9 @@ func (id VirtualNetworkConnectionGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go b/resource-manager/web/2022-09-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go index 65d74773465..d542242e414 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkConnectionGatewayId{} func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { - id := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") + id := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -36,8 +36,8 @@ func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { } func TestFormatVirtualNetworkConnectionGatewayID(t *testing.T) { - actual := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVirtualNetworkConnectionGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVirtualNetworkConnectionGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_worker.go b/resource-manager/web/2022-09-01/appserviceplans/id_worker.go index f6e647697b7..31d71dbd008 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_worker.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_worker.go @@ -121,7 +121,7 @@ func (id WorkerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticWorkers", "workers", "workers"), resourceids.UserSpecifiedSegment("workerName", "workerName"), } diff --git a/resource-manager/web/2022-09-01/appserviceplans/id_worker_test.go b/resource-manager/web/2022-09-01/appserviceplans/id_worker_test.go index 3d0a5de85c5..9113edebceb 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/id_worker_test.go +++ b/resource-manager/web/2022-09-01/appserviceplans/id_worker_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerId{} func TestNewWorkerID(t *testing.T) { - id := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName") + id := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } if id.WorkerName != "workerName" { @@ -32,8 +32,8 @@ func TestNewWorkerID(t *testing.T) { } func TestFormatWorkerID(t *testing.T) { - actual := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName" + actual := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", + ServerFarmName: "serverFarmName", WorkerName: "workerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", + ServerFarmName: "serverFarmName", WorkerName: "workerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs/wOrKeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs/wOrKeRnAmE", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", + ServerFarmName: "sErVeRfArMnAmE", WorkerName: "wOrKeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs/wOrKeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs/wOrKeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/appserviceplans/model_rampuprule.go b/resource-manager/web/2022-09-01/appserviceplans/model_rampuprule.go index a8a0548b489..424344dba00 100644 --- a/resource-manager/web/2022-09-01/appserviceplans/model_rampuprule.go +++ b/resource-manager/web/2022-09-01/appserviceplans/model_rampuprule.go @@ -5,7 +5,7 @@ package appserviceplans type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2022-09-01/certificateordersdiagnostics/README.md b/resource-manager/web/2022-09-01/certificateordersdiagnostics/README.md index dee7094119e..8bb5869a451 100644 --- a/resource-manager/web/2022-09-01/certificateordersdiagnostics/README.md +++ b/resource-manager/web/2022-09-01/certificateordersdiagnostics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificateordersdiagnostics.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") +id := certificateordersdiagnostics.NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") read, err := client.GetAppServiceCertificateOrderDetectorResponse(ctx, id, certificateordersdiagnostics.DefaultGetAppServiceCertificateOrderDetectorResponseOperationOptions()) if err != nil { diff --git a/resource-manager/web/2023-01-01/certificateordersdiagnostics/id_detector.go b/resource-manager/web/2022-09-01/certificateordersdiagnostics/id_certificateorderdetector.go similarity index 63% rename from resource-manager/web/2023-01-01/certificateordersdiagnostics/id_detector.go rename to resource-manager/web/2022-09-01/certificateordersdiagnostics/id_certificateorderdetector.go index acee2df5ba1..cbb8826cb13 100644 --- a/resource-manager/web/2023-01-01/certificateordersdiagnostics/id_detector.go +++ b/resource-manager/web/2022-09-01/certificateordersdiagnostics/id_certificateorderdetector.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&DetectorId{}) + recaser.RegisterResourceId(&CertificateOrderDetectorId{}) } -var _ resourceids.ResourceId = &DetectorId{} +var _ resourceids.ResourceId = &CertificateOrderDetectorId{} -// DetectorId is a struct representing the Resource ID for a Detector -type DetectorId struct { +// CertificateOrderDetectorId is a struct representing the Resource ID for a Certificate Order Detector +type CertificateOrderDetectorId struct { SubscriptionId string ResourceGroupName string CertificateOrderName string DetectorName string } -// NewDetectorID returns a new DetectorId struct -func NewDetectorID(subscriptionId string, resourceGroupName string, certificateOrderName string, detectorName string) DetectorId { - return DetectorId{ +// NewCertificateOrderDetectorID returns a new CertificateOrderDetectorId struct +func NewCertificateOrderDetectorID(subscriptionId string, resourceGroupName string, certificateOrderName string, detectorName string) CertificateOrderDetectorId { + return CertificateOrderDetectorId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, CertificateOrderName: certificateOrderName, @@ -35,15 +35,15 @@ func NewDetectorID(subscriptionId string, resourceGroupName string, certificateO } } -// ParseDetectorID parses 'input' into a DetectorId -func ParseDetectorID(input string) (*DetectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DetectorId{}) +// ParseCertificateOrderDetectorID parses 'input' into a CertificateOrderDetectorId +func ParseCertificateOrderDetectorID(input string) (*CertificateOrderDetectorId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderDetectorId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DetectorId{} + id := CertificateOrderDetectorId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseDetectorID(input string) (*DetectorId, error) { return &id, nil } -// ParseDetectorIDInsensitively parses 'input' case-insensitively into a DetectorId +// ParseCertificateOrderDetectorIDInsensitively parses 'input' case-insensitively into a CertificateOrderDetectorId // note: this method should only be used for API response data and not user input -func ParseDetectorIDInsensitively(input string) (*DetectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DetectorId{}) +func ParseCertificateOrderDetectorIDInsensitively(input string) (*CertificateOrderDetectorId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderDetectorId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DetectorId{} + id := CertificateOrderDetectorId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseDetectorIDInsensitively(input string) (*DetectorId, error) { return &id, nil } -func (id *DetectorId) FromParseResult(input resourceids.ParseResult) error { +func (id *CertificateOrderDetectorId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *DetectorId) FromParseResult(input resourceids.ParseResult) error { return nil } -// ValidateDetectorID checks that 'input' can be parsed as a Detector ID -func ValidateDetectorID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateCertificateOrderDetectorID checks that 'input' can be parsed as a Certificate Order Detector ID +func ValidateCertificateOrderDetectorID(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 := ParseDetectorID(v); err != nil { + if _, err := ParseCertificateOrderDetectorID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Detector ID -func (id DetectorId) ID() string { +// ID returns the formatted Certificate Order Detector ID +func (id CertificateOrderDetectorId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.CertificateRegistration/certificateOrders/%s/detectors/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CertificateOrderName, id.DetectorName) } -// Segments returns a slice of Resource ID Segments which comprise this Detector ID -func (id DetectorId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Certificate Order Detector ID +func (id CertificateOrderDetectorId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -127,13 +127,13 @@ func (id DetectorId) Segments() []resourceids.Segment { } } -// String returns a human-readable description of this Detector ID -func (id DetectorId) String() string { +// String returns a human-readable description of this Certificate Order Detector ID +func (id CertificateOrderDetectorId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Certificate Order Name: %q", id.CertificateOrderName), fmt.Sprintf("Detector Name: %q", id.DetectorName), } - return fmt.Sprintf("Detector (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Certificate Order Detector (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2022-09-01/certificateordersdiagnostics/id_detector_test.go b/resource-manager/web/2022-09-01/certificateordersdiagnostics/id_certificateorderdetector_test.go similarity index 90% rename from resource-manager/web/2022-09-01/certificateordersdiagnostics/id_detector_test.go rename to resource-manager/web/2022-09-01/certificateordersdiagnostics/id_certificateorderdetector_test.go index 067f02845eb..b24ca655c01 100644 --- a/resource-manager/web/2022-09-01/certificateordersdiagnostics/id_detector_test.go +++ b/resource-manager/web/2022-09-01/certificateordersdiagnostics/id_certificateorderdetector_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &DetectorId{} +var _ resourceids.ResourceId = &CertificateOrderDetectorId{} -func TestNewDetectorID(t *testing.T) { - id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") +func TestNewCertificateOrderDetectorID(t *testing.T) { + id := NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -31,19 +31,19 @@ func TestNewDetectorID(t *testing.T) { } } -func TestFormatDetectorID(t *testing.T) { - actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName").ID() +func TestFormatCertificateOrderDetectorID(t *testing.T) { + actual := NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName").ID() expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseDetectorID(t *testing.T) { +func TestParseCertificateOrderDetectorID(t *testing.T) { testData := []struct { Input string Error bool - Expected *DetectorId + Expected *CertificateOrderDetectorId }{ { // Incomplete URI @@ -98,7 +98,7 @@ func TestParseDetectorID(t *testing.T) { { // Valid URI Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", @@ -114,7 +114,7 @@ func TestParseDetectorID(t *testing.T) { for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDetectorID(v.Input) + actual, err := ParseCertificateOrderDetectorID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseDetectorID(t *testing.T) { } } -func TestParseDetectorIDInsensitively(t *testing.T) { +func TestParseCertificateOrderDetectorIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *DetectorId + Expected *CertificateOrderDetectorId }{ { // Incomplete URI @@ -249,7 +249,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { { // Valid URI Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", @@ -264,7 +264,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { { // Valid URI (mIxEd CaSe since this is insensitive) Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/dEtEcToRs/dEtEcToRnAmE", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CertificateOrderName: "cErTiFiCaTeOrDeRnAmE", @@ -280,7 +280,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDetectorIDInsensitively(v.Input) + actual, err := ParseCertificateOrderDetectorIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseDetectorIDInsensitively(t *testing.T) { } } -func TestSegmentsForDetectorId(t *testing.T) { - segments := DetectorId{}.Segments() +func TestSegmentsForCertificateOrderDetectorId(t *testing.T) { + segments := CertificateOrderDetectorId{}.Segments() if len(segments) == 0 { - t.Fatalf("DetectorId has no segments") + t.Fatalf("CertificateOrderDetectorId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2022-09-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go b/resource-manager/web/2022-09-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go index 15ff71d98cd..c23cb352353 100644 --- a/resource-manager/web/2022-09-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go +++ b/resource-manager/web/2022-09-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go @@ -55,7 +55,7 @@ func (o GetAppServiceCertificateOrderDetectorResponseOperationOptions) ToQuery() } // GetAppServiceCertificateOrderDetectorResponse ... -func (c CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, id DetectorId, options GetAppServiceCertificateOrderDetectorResponseOperationOptions) (result GetAppServiceCertificateOrderDetectorResponseOperationResponse, err error) { +func (c CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, id CertificateOrderDetectorId, options GetAppServiceCertificateOrderDetectorResponseOperationOptions) (result GetAppServiceCertificateOrderDetectorResponseOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2022-09-01/certificates/README.md b/resource-manager/web/2022-09-01/certificates/README.md index 7a003607b45..1384da9d860 100644 --- a/resource-manager/web/2022-09-01/certificates/README.md +++ b/resource-manager/web/2022-09-01/certificates/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") payload := certificates.Certificate{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") payload := certificates.CertificatePatchResource{ // ... diff --git a/resource-manager/web/2022-09-01/certificates/id_certificate.go b/resource-manager/web/2022-09-01/certificates/id_certificate.go index 46aa8344efc..3ef853c576d 100644 --- a/resource-manager/web/2022-09-01/certificates/id_certificate.go +++ b/resource-manager/web/2022-09-01/certificates/id_certificate.go @@ -115,7 +115,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } diff --git a/resource-manager/web/2022-09-01/certificates/id_certificate_test.go b/resource-manager/web/2022-09-01/certificates/id_certificate_test.go index c64fa1af09e..b4d6ef8d3b8 100644 --- a/resource-manager/web/2022-09-01/certificates/id_certificate_test.go +++ b/resource-manager/web/2022-09-01/certificates/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/containerapps/README.md b/resource-manager/web/2022-09-01/containerapps/README.md index 4d10e253141..5028f15cda4 100644 --- a/resource-manager/web/2022-09-01/containerapps/README.md +++ b/resource-manager/web/2022-09-01/containerapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") payload := containerapps.ContainerApp{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "name") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName") read, err := client.ListSecrets(ctx, id) if err != nil { diff --git a/resource-manager/web/2022-09-01/containerapps/id_containerapp.go b/resource-manager/web/2022-09-01/containerapps/id_containerapp.go index 95fa925f7df..3f70ccac898 100644 --- a/resource-manager/web/2022-09-01/containerapps/id_containerapp.go +++ b/resource-manager/web/2022-09-01/containerapps/id_containerapp.go @@ -107,7 +107,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2022-09-01/containerapps/id_containerapp_test.go b/resource-manager/web/2022-09-01/containerapps/id_containerapp_test.go index d60d389bf8e..7117d5e1f72 100644 --- a/resource-manager/web/2022-09-01/containerapps/id_containerapp_test.go +++ b/resource-manager/web/2022-09-01/containerapps/id_containerapp_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "name") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/containerapps/id_providercontainerapp.go b/resource-manager/web/2022-09-01/containerapps/id_providercontainerapp.go index 8ce8585f832..b816f39ada9 100644 --- a/resource-manager/web/2022-09-01/containerapps/id_providercontainerapp.go +++ b/resource-manager/web/2022-09-01/containerapps/id_providercontainerapp.go @@ -115,7 +115,7 @@ func (id ProviderContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2022-09-01/containerapps/id_providercontainerapp_test.go b/resource-manager/web/2022-09-01/containerapps/id_providercontainerapp_test.go index 8b4bc22a85f..55188842290 100644 --- a/resource-manager/web/2022-09-01/containerapps/id_providercontainerapp_test.go +++ b/resource-manager/web/2022-09-01/containerapps/id_providercontainerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderContainerAppId{} func TestNewProviderContainerAppID(t *testing.T) { - id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatProviderContainerAppID(t *testing.T) { - actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name" + actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/containerappsrevisions/README.md b/resource-manager/web/2022-09-01/containerappsrevisions/README.md index 50107fde7cf..a83c18bdb87 100644 --- a/resource-manager/web/2022-09-01/containerappsrevisions/README.md +++ b/resource-manager/web/2022-09-01/containerappsrevisions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.ActivateRevision(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.DeactivateRevision(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.GetRevision(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerappsrevisions.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ListRevisions(ctx, id)` can be used to do batched pagination items, err := client.ListRevisionsComplete(ctx, id) @@ -89,7 +89,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.RestartRevision(ctx, id) if err != nil { diff --git a/resource-manager/web/2022-09-01/containerappsrevisions/id_providercontainerapp.go b/resource-manager/web/2022-09-01/containerappsrevisions/id_providercontainerapp.go index a590f83df39..b9383d30fbd 100644 --- a/resource-manager/web/2022-09-01/containerappsrevisions/id_providercontainerapp.go +++ b/resource-manager/web/2022-09-01/containerappsrevisions/id_providercontainerapp.go @@ -115,7 +115,7 @@ func (id ProviderContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2022-09-01/containerappsrevisions/id_providercontainerapp_test.go b/resource-manager/web/2022-09-01/containerappsrevisions/id_providercontainerapp_test.go index 79553ea3764..1ab5644f109 100644 --- a/resource-manager/web/2022-09-01/containerappsrevisions/id_providercontainerapp_test.go +++ b/resource-manager/web/2022-09-01/containerappsrevisions/id_providercontainerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderContainerAppId{} func TestNewProviderContainerAppID(t *testing.T) { - id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatProviderContainerAppID(t *testing.T) { - actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name" + actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/containerappsrevisions/id_revision.go b/resource-manager/web/2022-09-01/containerappsrevisions/id_revision.go index b6c364f9728..eee8b68dfe6 100644 --- a/resource-manager/web/2022-09-01/containerappsrevisions/id_revision.go +++ b/resource-manager/web/2022-09-01/containerappsrevisions/id_revision.go @@ -123,7 +123,7 @@ func (id RevisionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), resourceids.StaticSegment("staticRevisions", "revisions", "revisions"), - resourceids.UserSpecifiedSegment("revisionName", "name"), + resourceids.UserSpecifiedSegment("revisionName", "revisionName"), } } diff --git a/resource-manager/web/2022-09-01/containerappsrevisions/id_revision_test.go b/resource-manager/web/2022-09-01/containerappsrevisions/id_revision_test.go index bb958a5df26..224a34a6a98 100644 --- a/resource-manager/web/2022-09-01/containerappsrevisions/id_revision_test.go +++ b/resource-manager/web/2022-09-01/containerappsrevisions/id_revision_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RevisionId{} func TestNewRevisionID(t *testing.T) { - id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") + id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRevisionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } - if id.RevisionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RevisionName'", id.RevisionName, "name") + if id.RevisionName != "revisionName" { + t.Fatalf("Expected %q but got %q for Segment 'RevisionName'", id.RevisionName, "revisionName") } } func TestFormatRevisionID(t *testing.T) { - actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name" + actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRevisionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ContainerAppName: "containerAppName", - RevisionName: "name", + RevisionName: "revisionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRevisionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ContainerAppName: "containerAppName", - RevisionName: "name", + RevisionName: "revisionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ContainerAppName: "cOnTaInErApPnAmE", - RevisionName: "nAmE", + RevisionName: "rEvIsIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/deletedwebapps/README.md b/resource-manager/web/2022-09-01/deletedwebapps/README.md index 38d7886e50f..6de99fcad68 100644 --- a/resource-manager/web/2022-09-01/deletedwebapps/README.md +++ b/resource-manager/web/2022-09-01/deletedwebapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedwebapps.NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId") +id := deletedwebapps.NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId") read, err := client.GetDeletedWebAppByLocation(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedwebapps.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") +id := deletedwebapps.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/web/2022-09-01/deletedwebapps/id_locationdeletedsite.go b/resource-manager/web/2022-09-01/deletedwebapps/id_locationdeletedsite.go index 21f68459dcf..28780740879 100644 --- a/resource-manager/web/2022-09-01/deletedwebapps/id_locationdeletedsite.go +++ b/resource-manager/web/2022-09-01/deletedwebapps/id_locationdeletedsite.go @@ -113,7 +113,7 @@ func (id LocationDeletedSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedSites", "deletedSites", "deletedSites"), resourceids.UserSpecifiedSegment("deletedSiteId", "deletedSiteId"), } diff --git a/resource-manager/web/2022-09-01/deletedwebapps/id_locationdeletedsite_test.go b/resource-manager/web/2022-09-01/deletedwebapps/id_locationdeletedsite_test.go index 5747600bb4e..b406ec22fa2 100644 --- a/resource-manager/web/2022-09-01/deletedwebapps/id_locationdeletedsite_test.go +++ b/resource-manager/web/2022-09-01/deletedwebapps/id_locationdeletedsite_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LocationDeletedSiteId{} func TestNewLocationDeletedSiteID(t *testing.T) { - id := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId") + id := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.DeletedSiteId != "deletedSiteId" { @@ -28,8 +28,8 @@ func TestNewLocationDeletedSiteID(t *testing.T) { } func TestFormatLocationDeletedSiteID(t *testing.T) { - actual := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId" + actual := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseLocationDeletedSiteID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedSiteId: "deletedSiteId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseLocationDeletedSiteIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedSiteId: "deletedSiteId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS/dElEtEdSiTeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS/dElEtEdSiTeId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", DeletedSiteId: "dElEtEdSiTeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS/dElEtEdSiTeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS/dElEtEdSiTeId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/deletedwebapps/id_providerlocation.go b/resource-manager/web/2022-09-01/deletedwebapps/id_providerlocation.go index 43c0d30707e..ba6b4940392 100644 --- a/resource-manager/web/2022-09-01/deletedwebapps/id_providerlocation.go +++ b/resource-manager/web/2022-09-01/deletedwebapps/id_providerlocation.go @@ -107,7 +107,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2022-09-01/deletedwebapps/id_providerlocation_test.go b/resource-manager/web/2022-09-01/deletedwebapps/id_providerlocation_test.go index 4577f6b3b52..fb713255a98 100644 --- a/resource-manager/web/2022-09-01/deletedwebapps/id_providerlocation_test.go +++ b/resource-manager/web/2022-09-01/deletedwebapps/id_providerlocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/README.md b/resource-manager/web/2022-09-01/diagnostics/README.md index 07076e58fa5..c287f49a40c 100644 --- a/resource-manager/web/2022-09-01/diagnostics/README.md +++ b/resource-manager/web/2022-09-01/diagnostics/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") +id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") read, err := client.ExecuteSiteAnalysis(ctx, id, diagnostics.DefaultExecuteSiteAnalysisOperationOptions()) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") +id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") read, err := client.ExecuteSiteAnalysisSlot(ctx, id, diagnostics.DefaultExecuteSiteAnalysisSlotOperationOptions()) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") +id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") read, err := client.ExecuteSiteDetector(ctx, id, diagnostics.DefaultExecuteSiteDetectorOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") +id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") read, err := client.ExecuteSiteDetectorSlot(ctx, id, diagnostics.DefaultExecuteSiteDetectorSlotOperationOptions()) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName") +id := diagnostics.NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName") read, err := client.GetHostingEnvironmentDetectorResponse(ctx, id, diagnostics.DefaultGetHostingEnvironmentDetectorResponseOperationOptions()) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") +id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") read, err := client.GetSiteAnalysis(ctx, id) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") +id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") read, err := client.GetSiteAnalysisSlot(ctx, id) if err != nil { @@ -137,7 +137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") +id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") read, err := client.GetSiteDetector(ctx, id) if err != nil { @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName") +id := diagnostics.NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName") read, err := client.GetSiteDetectorResponseSlot(ctx, id, diagnostics.DefaultGetSiteDetectorResponseSlotOperationOptions()) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") +id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") read, err := client.GetSiteDetectorSlot(ctx, id) if err != nil { @@ -201,7 +201,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") read, err := client.GetSiteDiagnosticCategory(ctx, id) if err != nil { @@ -217,7 +217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") read, err := client.GetSiteDiagnosticCategorySlot(ctx, id) if err != nil { @@ -250,7 +250,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") // alternatively `client.ListSiteAnalyses(ctx, id)` can be used to do batched pagination items, err := client.ListSiteAnalysesComplete(ctx, id) @@ -267,7 +267,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") // alternatively `client.ListSiteAnalysesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteAnalysesSlotComplete(ctx, id) @@ -301,7 +301,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteDetectorResponsesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorResponsesSlotComplete(ctx, id) @@ -318,7 +318,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") // alternatively `client.ListSiteDetectors(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorsComplete(ctx, id) @@ -335,7 +335,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") // alternatively `client.ListSiteDetectorsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorsSlotComplete(ctx, id) @@ -369,7 +369,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteDiagnosticCategoriesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDiagnosticCategoriesSlotComplete(ctx, id) diff --git a/resource-manager/web/2022-09-01/diagnostics/id_analysis.go b/resource-manager/web/2022-09-01/diagnostics/id_analysis.go index e82e0c867c9..4ad7593663b 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_analysis.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_analysis.go @@ -129,7 +129,7 @@ func (id AnalysisId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticAnalyses", "analyses", "analyses"), resourceids.UserSpecifiedSegment("analysisName", "analysisName"), } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_analysis_test.go b/resource-manager/web/2022-09-01/diagnostics/id_analysis_test.go index fd7c0c72df7..b5a41dcb6b7 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_analysis_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_analysis_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AnalysisId{} func TestNewAnalysisID(t *testing.T) { - id := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") + id := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewAnalysisID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.AnalysisName != "analysisName" { @@ -36,8 +36,8 @@ func TestNewAnalysisID(t *testing.T) { } func TestFormatAnalysisID(t *testing.T) { - actual := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName" + actual := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseAnalysisID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseAnalysisIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", AnalysisName: "aNaLySiSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_diagnostic.go b/resource-manager/web/2022-09-01/diagnostics/id_diagnostic.go index 7efa9727df5..d8f916e4863 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_diagnostic.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_diagnostic.go @@ -123,7 +123,7 @@ func (id DiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_diagnostic_test.go b/resource-manager/web/2022-09-01/diagnostics/id_diagnostic_test.go index 80cf8522798..f75e156e5bb 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_diagnostic_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_diagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticId{} func TestNewDiagnosticID(t *testing.T) { - id := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") + id := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatDiagnosticID(t *testing.T) { - actual := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory" + actual := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDiagnosticID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDiagnosticIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_diagnosticanalysis.go b/resource-manager/web/2022-09-01/diagnostics/id_diagnosticanalysis.go index d3734f88b3d..c2a851a5780 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_diagnosticanalysis.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_diagnosticanalysis.go @@ -135,9 +135,9 @@ func (id DiagnosticAnalysisId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticAnalyses", "analyses", "analyses"), resourceids.UserSpecifiedSegment("analysisName", "analysisName"), } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_diagnosticanalysis_test.go b/resource-manager/web/2022-09-01/diagnostics/id_diagnosticanalysis_test.go index b6036055128..88593f85f7f 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_diagnosticanalysis_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_diagnosticanalysis_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticAnalysisId{} func TestNewDiagnosticAnalysisID(t *testing.T) { - id := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") + id := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewDiagnosticAnalysisID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.AnalysisName != "analysisName" { @@ -40,8 +40,8 @@ func TestNewDiagnosticAnalysisID(t *testing.T) { } func TestFormatDiagnosticAnalysisID(t *testing.T) { - actual := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName" + actual := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseDiagnosticAnalysisID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseDiagnosticAnalysisIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", AnalysisName: "aNaLySiSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_diagnosticdetector.go b/resource-manager/web/2022-09-01/diagnostics/id_diagnosticdetector.go index 6a09159ddae..cf131c1681f 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_diagnosticdetector.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_diagnosticdetector.go @@ -129,7 +129,7 @@ func (id DiagnosticDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_diagnosticdetector_test.go b/resource-manager/web/2022-09-01/diagnostics/id_diagnosticdetector_test.go index d2ebe8307c9..cd45a7927c0 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_diagnosticdetector_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_diagnosticdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticDetectorId{} func TestNewDiagnosticDetectorID(t *testing.T) { - id := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") + id := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDiagnosticDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.DetectorName != "detectorName" { @@ -36,8 +36,8 @@ func TestNewDiagnosticDetectorID(t *testing.T) { } func TestFormatDiagnosticDetectorID(t *testing.T) { - actual := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName" + actual := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDiagnosticDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDiagnosticDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_hostingenvironmentdetector.go b/resource-manager/web/2022-09-01/diagnostics/id_hostingenvironmentdetector.go index 0860c9bbbe7..617be4bec18 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_hostingenvironmentdetector.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_hostingenvironmentdetector.go @@ -121,7 +121,7 @@ func (id HostingEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_hostingenvironmentdetector_test.go b/resource-manager/web/2022-09-01/diagnostics/id_hostingenvironmentdetector_test.go index 79fa244b352..6063fa9cdc0 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_hostingenvironmentdetector_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_hostingenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentDetectorId{} func TestNewHostingEnvironmentDetectorID(t *testing.T) { - id := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName") + id := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHostingEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewHostingEnvironmentDetectorID(t *testing.T) { } func TestFormatHostingEnvironmentDetectorID(t *testing.T) { - actual := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName" + actual := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_slot.go b/resource-manager/web/2022-09-01/diagnostics/id_slot.go index 5196f574350..3458e4a3bca 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_slot.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_slot_test.go b/resource-manager/web/2022-09-01/diagnostics/id_slot_test.go index 9c49573511c..591c34ab7b7 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_slot_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_slotdetector.go b/resource-manager/web/2022-09-01/diagnostics/id_slotdetector.go index 29fdc9326fe..287984b0bc5 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_slotdetector.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_slotdetector.go @@ -129,7 +129,7 @@ func (id SlotDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_slotdetector_test.go b/resource-manager/web/2022-09-01/diagnostics/id_slotdetector_test.go index 173c66061d8..32e7f62003b 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_slotdetector_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_slotdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDetectorId{} func TestNewSlotDetectorID(t *testing.T) { - id := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName") + id := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewSlotDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.DetectorName != "detectorName" { @@ -36,8 +36,8 @@ func TestNewSlotDetectorID(t *testing.T) { } func TestFormatSlotDetectorID(t *testing.T) { - actual := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName" + actual := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSlotDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSlotDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnostic.go b/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnostic.go index 6a8e8318ffe..d94b24e79f8 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnostic.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnostic.go @@ -129,9 +129,9 @@ func (id SlotDiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnostic_test.go b/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnostic_test.go index 5e8a1a839e9..af97181d8ad 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnostic_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDiagnosticId{} func TestNewSlotDiagnosticID(t *testing.T) { - id := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") + id := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewSlotDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatSlotDiagnosticID(t *testing.T) { - actual := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory" + actual := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSlotDiagnosticID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSlotDiagnosticIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnosticdetector.go b/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnosticdetector.go index 90bf030bdb5..98ccbee3b33 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnosticdetector.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnosticdetector.go @@ -135,9 +135,9 @@ func (id SlotDiagnosticDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnosticdetector_test.go b/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnosticdetector_test.go index d3d59c9365f..bfb6c97fbd8 100644 --- a/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnosticdetector_test.go +++ b/resource-manager/web/2022-09-01/diagnostics/id_slotdiagnosticdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDiagnosticDetectorId{} func TestNewSlotDiagnosticDetectorID(t *testing.T) { - id := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") + id := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewSlotDiagnosticDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.DetectorName != "detectorName" { @@ -40,8 +40,8 @@ func TestNewSlotDiagnosticDetectorID(t *testing.T) { } func TestFormatSlotDiagnosticDetectorID(t *testing.T) { - actual := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName" + actual := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseSlotDiagnosticDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseSlotDiagnosticDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/domains/README.md b/resource-manager/web/2022-09-01/domains/README.md index 223682b5466..068c62f393e 100644 --- a/resource-manager/web/2022-09-01/domains/README.md +++ b/resource-manager/web/2022-09-01/domains/README.md @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") payload := domains.DomainOwnershipIdentifier{ // ... @@ -100,7 +100,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") read, err := client.DeleteOwnershipIdentifier(ctx, id) if err != nil { @@ -148,7 +148,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") read, err := client.GetOwnershipIdentifier(ctx, id) if err != nil { @@ -290,7 +290,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") payload := domains.DomainOwnershipIdentifier{ // ... diff --git a/resource-manager/web/2022-09-01/domains/id_domainownershipidentifier.go b/resource-manager/web/2022-09-01/domains/id_domainownershipidentifier.go index 3a7b36ae669..d15193f1a7b 100644 --- a/resource-manager/web/2022-09-01/domains/id_domainownershipidentifier.go +++ b/resource-manager/web/2022-09-01/domains/id_domainownershipidentifier.go @@ -123,7 +123,7 @@ func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), - resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "name"), + resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } } diff --git a/resource-manager/web/2022-09-01/domains/id_domainownershipidentifier_test.go b/resource-manager/web/2022-09-01/domains/id_domainownershipidentifier_test.go index f985e2aa509..14debd4f5fb 100644 --- a/resource-manager/web/2022-09-01/domains/id_domainownershipidentifier_test.go +++ b/resource-manager/web/2022-09-01/domains/id_domainownershipidentifier_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} func TestNewDomainOwnershipIdentifierID(t *testing.T) { - id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") + id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.DomainOwnershipIdentifierName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DomainOwnershipIdentifierName'", id.DomainOwnershipIdentifierName, "name") + if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { + t.Fatalf("Expected %q but got %q for Segment 'DomainOwnershipIdentifierName'", id.DomainOwnershipIdentifierName, "domainOwnershipIdentifierName") } } func TestFormatDomainOwnershipIdentifierID(t *testing.T) { - actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name" + actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - DomainOwnershipIdentifierName: "name", + DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - DomainOwnershipIdentifierName: "name", + DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", DomainName: "dOmAiNnAmE", - DomainOwnershipIdentifierName: "nAmE", + DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/kubeenvironments/README.md b/resource-manager/web/2022-09-01/kubeenvironments/README.md index 13951e64a49..35776f5b134 100644 --- a/resource-manager/web/2022-09-01/kubeenvironments/README.md +++ b/resource-manager/web/2022-09-01/kubeenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") payload := kubeenvironments.KubeEnvironment{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") payload := kubeenvironments.KubeEnvironmentPatchResource{ // ... diff --git a/resource-manager/web/2022-09-01/kubeenvironments/id_kubeenvironment.go b/resource-manager/web/2022-09-01/kubeenvironments/id_kubeenvironment.go index 6afa2b5aed9..73c1a578e48 100644 --- a/resource-manager/web/2022-09-01/kubeenvironments/id_kubeenvironment.go +++ b/resource-manager/web/2022-09-01/kubeenvironments/id_kubeenvironment.go @@ -115,7 +115,7 @@ func (id KubeEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticKubeEnvironments", "kubeEnvironments", "kubeEnvironments"), - resourceids.UserSpecifiedSegment("kubeEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("kubeEnvironmentName", "kubeEnvironmentName"), } } diff --git a/resource-manager/web/2022-09-01/kubeenvironments/id_kubeenvironment_test.go b/resource-manager/web/2022-09-01/kubeenvironments/id_kubeenvironment_test.go index a84ed9fa62d..e209728abab 100644 --- a/resource-manager/web/2022-09-01/kubeenvironments/id_kubeenvironment_test.go +++ b/resource-manager/web/2022-09-01/kubeenvironments/id_kubeenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KubeEnvironmentId{} func TestNewKubeEnvironmentID(t *testing.T) { - id := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewKubeEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.KubeEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'KubeEnvironmentName'", id.KubeEnvironmentName, "name") + if id.KubeEnvironmentName != "kubeEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'KubeEnvironmentName'", id.KubeEnvironmentName, "kubeEnvironmentName") } } func TestFormatKubeEnvironmentID(t *testing.T) { - actual := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name" + actual := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseKubeEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - KubeEnvironmentName: "name", + KubeEnvironmentName: "kubeEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseKubeEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - KubeEnvironmentName: "name", + KubeEnvironmentName: "kubeEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/kUbEeNvIrOnMeNtNaMe", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - KubeEnvironmentName: "nAmE", + KubeEnvironmentName: "kUbEeNvIrOnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/kUbEeNvIrOnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/provider/README.md b/resource-manager/web/2022-09-01/provider/README.md index 88d46dd27b5..042deb5035a 100644 --- a/resource-manager/web/2022-09-01/provider/README.md +++ b/resource-manager/web/2022-09-01/provider/README.md @@ -76,7 +76,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := provider.NewLocationID("location") +id := provider.NewLocationID("locationName") // alternatively `client.GetFunctionAppStacksForLocation(ctx, id, provider.DefaultGetFunctionAppStacksForLocationOperationOptions())` can be used to do batched pagination items, err := client.GetFunctionAppStacksForLocationComplete(ctx, id, provider.DefaultGetFunctionAppStacksForLocationOperationOptions()) @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := provider.NewLocationID("location") +id := provider.NewLocationID("locationName") // alternatively `client.GetWebAppStacksForLocation(ctx, id, provider.DefaultGetWebAppStacksForLocationOperationOptions())` can be used to do batched pagination items, err := client.GetWebAppStacksForLocationComplete(ctx, id, provider.DefaultGetWebAppStacksForLocationOperationOptions()) diff --git a/resource-manager/web/2022-09-01/provider/id_location.go b/resource-manager/web/2022-09-01/provider/id_location.go index b2c84698d9e..73ea1c40a58 100644 --- a/resource-manager/web/2022-09-01/provider/id_location.go +++ b/resource-manager/web/2022-09-01/provider/id_location.go @@ -99,7 +99,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2022-09-01/provider/id_location_test.go b/resource-manager/web/2022-09-01/provider/id_location_test.go index d870f55af25..e0391552ed6 100644 --- a/resource-manager/web/2022-09-01/provider/id_location_test.go +++ b/resource-manager/web/2022-09-01/provider/id_location_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("location") + id := NewLocationID("locationName") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("location").ID() - expected := "/providers/Microsoft.Web/locations/location" + actual := NewLocationID("locationName").ID() + expected := "/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/locations/location", + Input: "/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/locations/location/extra", + Input: "/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/locations/location", + Input: "/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/locations/location/extra", + Input: "/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/recommendations/README.md b/resource-manager/web/2022-09-01/recommendations/README.md index 656c1f5e6a9..85e0465eab6 100644 --- a/resource-manager/web/2022-09-01/recommendations/README.md +++ b/resource-manager/web/2022-09-01/recommendations/README.md @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") +id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") read, err := client.DisableRecommendationForHostingEnvironment(ctx, id, recommendations.DefaultDisableRecommendationForHostingEnvironmentOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") +id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") read, err := client.DisableRecommendationForSite(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewRecommendationID("12345678-1234-9876-4563-123456789012", "name") +id := recommendations.NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName") read, err := client.DisableRecommendationForSubscription(ctx, id) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") +id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") read, err := client.GetRuleDetailsByHostingEnvironment(ctx, id, recommendations.DefaultGetRuleDetailsByHostingEnvironmentOperationOptions()) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") +id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") read, err := client.GetRuleDetailsByWebApp(ctx, id, recommendations.DefaultGetRuleDetailsByWebAppOperationOptions()) if err != nil { diff --git a/resource-manager/web/2022-09-01/recommendations/id_hostingenvironmentrecommendation.go b/resource-manager/web/2022-09-01/recommendations/id_hostingenvironmentrecommendation.go index 2cdbbdb1c37..6c8bb19b20b 100644 --- a/resource-manager/web/2022-09-01/recommendations/id_hostingenvironmentrecommendation.go +++ b/resource-manager/web/2022-09-01/recommendations/id_hostingenvironmentrecommendation.go @@ -123,7 +123,7 @@ func (id HostingEnvironmentRecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2022-09-01/recommendations/id_hostingenvironmentrecommendation_test.go b/resource-manager/web/2022-09-01/recommendations/id_hostingenvironmentrecommendation_test.go index ec3b68f0c53..89a2959452d 100644 --- a/resource-manager/web/2022-09-01/recommendations/id_hostingenvironmentrecommendation_test.go +++ b/resource-manager/web/2022-09-01/recommendations/id_hostingenvironmentrecommendation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentRecommendationId{} func TestNewHostingEnvironmentRecommendationID(t *testing.T) { - id := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") + id := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHostingEnvironmentRecommendationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatHostingEnvironmentRecommendationID(t *testing.T) { - actual := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name" + actual := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHostingEnvironmentRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostingEnvironmentName: "hostingEnvironmentName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHostingEnvironmentRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostingEnvironmentName: "hostingEnvironmentName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/recommendations/id_recommendation.go b/resource-manager/web/2022-09-01/recommendations/id_recommendation.go index 25ebd90886f..b42bf6faa1d 100644 --- a/resource-manager/web/2022-09-01/recommendations/id_recommendation.go +++ b/resource-manager/web/2022-09-01/recommendations/id_recommendation.go @@ -107,7 +107,7 @@ func (id RecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2022-09-01/recommendations/id_recommendation_test.go b/resource-manager/web/2022-09-01/recommendations/id_recommendation_test.go index 2966eb11a4c..a6c44f1f14c 100644 --- a/resource-manager/web/2022-09-01/recommendations/id_recommendation_test.go +++ b/resource-manager/web/2022-09-01/recommendations/id_recommendation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &RecommendationId{} func TestNewRecommendationID(t *testing.T) { - id := NewRecommendationID("12345678-1234-9876-4563-123456789012", "name") + id := NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatRecommendationID(t *testing.T) { - actual := NewRecommendationID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name" + actual := NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/recommendations/id_siterecommendation.go b/resource-manager/web/2022-09-01/recommendations/id_siterecommendation.go index 596c056c92b..2876f7cd3e0 100644 --- a/resource-manager/web/2022-09-01/recommendations/id_siterecommendation.go +++ b/resource-manager/web/2022-09-01/recommendations/id_siterecommendation.go @@ -123,7 +123,7 @@ func (id SiteRecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2022-09-01/recommendations/id_siterecommendation_test.go b/resource-manager/web/2022-09-01/recommendations/id_siterecommendation_test.go index f1a3efaeb4c..5bf28fb326c 100644 --- a/resource-manager/web/2022-09-01/recommendations/id_siterecommendation_test.go +++ b/resource-manager/web/2022-09-01/recommendations/id_siterecommendation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteRecommendationId{} func TestNewSiteRecommendationID(t *testing.T) { - id := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") + id := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSiteRecommendationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatSiteRecommendationID(t *testing.T) { - actual := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name" + actual := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSiteRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSiteRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/resourcehealthmetadata/README.md b/resource-manager/web/2022-09-01/resourcehealthmetadata/README.md index 4f2abc8e7b4..6b05a2092e9 100644 --- a/resource-manager/web/2022-09-01/resourcehealthmetadata/README.md +++ b/resource-manager/web/2022-09-01/resourcehealthmetadata/README.md @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetBySiteSlot(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBySiteSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBySiteSlotComplete(ctx, id) diff --git a/resource-manager/web/2022-09-01/resourcehealthmetadata/id_slot.go b/resource-manager/web/2022-09-01/resourcehealthmetadata/id_slot.go index f588aa1069d..ef1e7ddf14c 100644 --- a/resource-manager/web/2022-09-01/resourcehealthmetadata/id_slot.go +++ b/resource-manager/web/2022-09-01/resourcehealthmetadata/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2022-09-01/resourcehealthmetadata/id_slot_test.go b/resource-manager/web/2022-09-01/resourcehealthmetadata/id_slot_test.go index 78664d5346e..1713ffbdc7d 100644 --- a/resource-manager/web/2022-09-01/resourcehealthmetadata/id_slot_test.go +++ b/resource-manager/web/2022-09-01/resourcehealthmetadata/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/resourceproviders/README.md b/resource-manager/web/2022-09-01/resourceproviders/README.md index 116b4fddac9..5e6c95612d5 100644 --- a/resource-manager/web/2022-09-01/resourceproviders/README.md +++ b/resource-manager/web/2022-09-01/resourceproviders/README.md @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceproviders.NewSourceControlID("sourceControlType") +id := resourceproviders.NewSourceControlID("sourceControlName") read, err := client.GetSourceControl(ctx, id) if err != nil { @@ -258,7 +258,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceproviders.NewSourceControlID("sourceControlType") +id := resourceproviders.NewSourceControlID("sourceControlName") payload := resourceproviders.SourceControl{ // ... diff --git a/resource-manager/web/2022-09-01/resourceproviders/id_sourcecontrol.go b/resource-manager/web/2022-09-01/resourceproviders/id_sourcecontrol.go index 1d19e0304d3..a78436e8801 100644 --- a/resource-manager/web/2022-09-01/resourceproviders/id_sourcecontrol.go +++ b/resource-manager/web/2022-09-01/resourceproviders/id_sourcecontrol.go @@ -99,7 +99,7 @@ func (id SourceControlId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), - resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlType"), + resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlName"), } } diff --git a/resource-manager/web/2022-09-01/resourceproviders/id_sourcecontrol_test.go b/resource-manager/web/2022-09-01/resourceproviders/id_sourcecontrol_test.go index 56f1a7f7d16..a64983484b3 100644 --- a/resource-manager/web/2022-09-01/resourceproviders/id_sourcecontrol_test.go +++ b/resource-manager/web/2022-09-01/resourceproviders/id_sourcecontrol_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &SourceControlId{} func TestNewSourceControlID(t *testing.T) { - id := NewSourceControlID("sourceControlType") + id := NewSourceControlID("sourceControlName") - if id.SourceControlName != "sourceControlType" { - t.Fatalf("Expected %q but got %q for Segment 'SourceControlName'", id.SourceControlName, "sourceControlType") + if id.SourceControlName != "sourceControlName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceControlName'", id.SourceControlName, "sourceControlName") } } func TestFormatSourceControlID(t *testing.T) { - actual := NewSourceControlID("sourceControlType").ID() - expected := "/providers/Microsoft.Web/sourceControls/sourceControlType" + actual := NewSourceControlID("sourceControlName").ID() + expected := "/providers/Microsoft.Web/sourceControls/sourceControlName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseSourceControlID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName", Expected: &SourceControlId{ - SourceControlName: "sourceControlType", + SourceControlName: "sourceControlName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType/extra", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseSourceControlIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName", Expected: &SourceControlId{ - SourceControlName: "sourceControlType", + SourceControlName: "sourceControlName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType/extra", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlTyPe", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlNaMe", Expected: &SourceControlId{ - SourceControlName: "sOuRcEcOnTrOlTyPe", + SourceControlName: "sOuRcEcOnTrOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlTyPe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/resourceproviders/model_customdnssuffixconfigurationproperties.go b/resource-manager/web/2022-09-01/resourceproviders/model_customdnssuffixconfigurationproperties.go index ba59ff8812d..cac2d224e58 100644 --- a/resource-manager/web/2022-09-01/resourceproviders/model_customdnssuffixconfigurationproperties.go +++ b/resource-manager/web/2022-09-01/resourceproviders/model_customdnssuffixconfigurationproperties.go @@ -4,7 +4,7 @@ package resourceproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type CustomDnsSuffixConfigurationProperties struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` DnsSuffix *string `json:"dnsSuffix,omitempty"` KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` ProvisioningDetails *string `json:"provisioningDetails,omitempty"` diff --git a/resource-manager/web/2022-09-01/resourceproviders/model_premieraddonofferproperties.go b/resource-manager/web/2022-09-01/resourceproviders/model_premieraddonofferproperties.go index 4dcce517ebe..4d6d6786360 100644 --- a/resource-manager/web/2022-09-01/resourceproviders/model_premieraddonofferproperties.go +++ b/resource-manager/web/2022-09-01/resourceproviders/model_premieraddonofferproperties.go @@ -4,10 +4,10 @@ package resourceproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PremierAddOnOfferProperties struct { - LegalTermsUrl *string `json:"legalTermsUrl,omitempty"` + LegalTermsURL *string `json:"legalTermsUrl,omitempty"` MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` - PrivacyPolicyUrl *string `json:"privacyPolicyUrl,omitempty"` + PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` Product *string `json:"product,omitempty"` PromoCodeRequired *bool `json:"promoCodeRequired,omitempty"` Quota *int64 `json:"quota,omitempty"` diff --git a/resource-manager/web/2022-09-01/resourceproviders/model_validateproperties.go b/resource-manager/web/2022-09-01/resourceproviders/model_validateproperties.go index 390aaea61b0..76c9b025d30 100644 --- a/resource-manager/web/2022-09-01/resourceproviders/model_validateproperties.go +++ b/resource-manager/web/2022-09-01/resourceproviders/model_validateproperties.go @@ -9,7 +9,7 @@ type ValidateProperties struct { ContainerImagePlatform *string `json:"containerImagePlatform,omitempty"` ContainerImageRepository *string `json:"containerImageRepository,omitempty"` ContainerImageTag *string `json:"containerImageTag,omitempty"` - ContainerRegistryBaseUrl *string `json:"containerRegistryBaseUrl,omitempty"` + ContainerRegistryBaseURL *string `json:"containerRegistryBaseUrl,omitempty"` ContainerRegistryPassword *string `json:"containerRegistryPassword,omitempty"` ContainerRegistryUsername *string `json:"containerRegistryUsername,omitempty"` HostingEnvironment *string `json:"hostingEnvironment,omitempty"` diff --git a/resource-manager/web/2022-09-01/staticsites/README.md b/resource-manager/web/2022-09-01/staticsites/README.md index 74fd8d58e1b..f91428347ec 100644 --- a/resource-manager/web/2022-09-01/staticsites/README.md +++ b/resource-manager/web/2022-09-01/staticsites/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") payload := staticsites.RemotePrivateEndpointConnectionARMResource{ // ... @@ -42,7 +42,7 @@ if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteBasicAuthPropertiesARMResource{ // ... @@ -63,7 +63,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") payload := staticsites.DatabaseConnection{ // ... @@ -84,7 +84,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") payload := staticsites.DatabaseConnection{ // ... @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteARMResource{ // ... @@ -122,7 +122,7 @@ if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StringDictionary{ // ... @@ -143,7 +143,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StringDictionary{ // ... @@ -164,7 +164,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StringDictionary{ // ... @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ // ... @@ -202,7 +202,7 @@ if err := client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StringDictionary{ // ... @@ -223,7 +223,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteUserInvitationRequestResource{ // ... @@ -244,7 +244,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteZipDeploymentARMResource{ // ... @@ -261,7 +261,7 @@ if err := client.CreateZipDeploymentForStaticSiteThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StaticSiteZipDeploymentARMResource{ // ... @@ -278,7 +278,7 @@ if err := client.CreateZipDeploymentForStaticSiteBuildThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.DeleteBuildDatabaseConnection(ctx, id) if err != nil { @@ -294,7 +294,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.DeleteDatabaseConnection(ctx, id) if err != nil { @@ -310,7 +310,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -322,7 +322,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if err := client.DeleteStaticSiteThenPoll(ctx, id); err != nil { // handle the error @@ -334,7 +334,7 @@ if err := client.DeleteStaticSiteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") if err := client.DeleteStaticSiteBuildThenPoll(ctx, id); err != nil { // handle the error @@ -346,7 +346,7 @@ if err := client.DeleteStaticSiteBuildThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") if err := client.DeleteStaticSiteCustomDomainThenPoll(ctx, id); err != nil { // handle the error @@ -358,7 +358,7 @@ if err := client.DeleteStaticSiteCustomDomainThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") read, err := client.DeleteStaticSiteUser(ctx, id) if err != nil { @@ -374,7 +374,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if err := client.DetachStaticSiteThenPoll(ctx, id); err != nil { // handle the error @@ -386,7 +386,7 @@ if err := client.DetachStaticSiteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") read, err := client.DetachUserProvidedFunctionAppFromStaticSite(ctx, id) if err != nil { @@ -402,7 +402,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") read, err := client.DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx, id) if err != nil { @@ -418,7 +418,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetBasicAuth(ctx, id) if err != nil { @@ -434,7 +434,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.GetBuildDatabaseConnection(ctx, id) if err != nil { @@ -450,7 +450,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.GetBuildDatabaseConnectionWithDetails(ctx, id) if err != nil { @@ -466,7 +466,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetBuildDatabaseConnections(ctx, id)` can be used to do batched pagination items, err := client.GetBuildDatabaseConnectionsComplete(ctx, id) @@ -483,7 +483,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetBuildDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination items, err := client.GetBuildDatabaseConnectionsWithDetailsComplete(ctx, id) @@ -500,7 +500,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.GetDatabaseConnection(ctx, id) if err != nil { @@ -516,7 +516,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.GetDatabaseConnectionWithDetails(ctx, id) if err != nil { @@ -532,7 +532,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetDatabaseConnections(ctx, id)` can be used to do batched pagination items, err := client.GetDatabaseConnectionsComplete(ctx, id) @@ -549,7 +549,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination items, err := client.GetDatabaseConnectionsWithDetailsComplete(ctx, id) @@ -566,7 +566,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") read, err := client.GetLinkedBackend(ctx, id) if err != nil { @@ -582,7 +582,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") read, err := client.GetLinkedBackendForBuild(ctx, id) if err != nil { @@ -598,7 +598,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetLinkedBackends(ctx, id)` can be used to do batched pagination items, err := client.GetLinkedBackendsComplete(ctx, id) @@ -615,7 +615,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetLinkedBackendsForBuild(ctx, id)` can be used to do batched pagination items, err := client.GetLinkedBackendsForBuildComplete(ctx, id) @@ -632,7 +632,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -648,7 +648,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetPrivateEndpointConnectionList(ctx, id)` can be used to do batched pagination items, err := client.GetPrivateEndpointConnectionListComplete(ctx, id) @@ -665,7 +665,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetPrivateLinkResources(ctx, id) if err != nil { @@ -681,7 +681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetStaticSite(ctx, id) if err != nil { @@ -697,7 +697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.GetStaticSiteBuild(ctx, id) if err != nil { @@ -713,7 +713,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetStaticSiteBuilds(ctx, id)` can be used to do batched pagination items, err := client.GetStaticSiteBuildsComplete(ctx, id) @@ -730,7 +730,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") read, err := client.GetStaticSiteCustomDomain(ctx, id) if err != nil { @@ -763,7 +763,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") read, err := client.GetUserProvidedFunctionAppForStaticSite(ctx, id) if err != nil { @@ -779,7 +779,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") read, err := client.GetUserProvidedFunctionAppForStaticSiteBuild(ctx, id) if err != nil { @@ -795,7 +795,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetUserProvidedFunctionAppsForStaticSite(ctx, id)` can be used to do batched pagination items, err := client.GetUserProvidedFunctionAppsForStaticSiteComplete(ctx, id) @@ -812,7 +812,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetUserProvidedFunctionAppsForStaticSiteBuild(ctx, id)` can be used to do batched pagination items, err := client.GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx, id) @@ -829,7 +829,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -846,7 +846,7 @@ if err := client.LinkBackendThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -880,7 +880,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListBasicAuth(ctx, id)` can be used to do batched pagination items, err := client.ListBasicAuthComplete(ctx, id) @@ -897,7 +897,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteAppSettings(ctx, id) if err != nil { @@ -913,7 +913,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.ListStaticSiteBuildAppSettings(ctx, id) if err != nil { @@ -929,7 +929,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.ListStaticSiteBuildFunctionAppSettings(ctx, id) if err != nil { @@ -945,7 +945,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.ListStaticSiteBuildFunctions(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteBuildFunctionsComplete(ctx, id) @@ -962,7 +962,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteConfiguredRoles(ctx, id) if err != nil { @@ -978,7 +978,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListStaticSiteCustomDomains(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteCustomDomainsComplete(ctx, id) @@ -995,7 +995,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteFunctionAppSettings(ctx, id) if err != nil { @@ -1011,7 +1011,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListStaticSiteFunctions(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteFunctionsComplete(ctx, id) @@ -1028,7 +1028,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteSecrets(ctx, id) if err != nil { @@ -1044,7 +1044,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider") +id := staticsites.NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName") // alternatively `client.ListStaticSiteUsers(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteUsersComplete(ctx, id) @@ -1061,7 +1061,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") +id := staticsites.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := staticsites.StaticSitesWorkflowPreviewRequest{ // ... @@ -1082,7 +1082,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ // ... @@ -1099,7 +1099,7 @@ if err := client.RegisterUserProvidedFunctionAppWithStaticSiteThenPoll(ctx, id, ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ // ... @@ -1116,7 +1116,7 @@ if err := client.RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll(ctx, ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteResetPropertiesARMResource{ // ... @@ -1137,7 +1137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") read, err := client.UnlinkBackend(ctx, id, staticsites.DefaultUnlinkBackendOperationOptions()) if err != nil { @@ -1153,7 +1153,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") read, err := client.UnlinkBackendFromBuild(ctx, id, staticsites.DefaultUnlinkBackendFromBuildOperationOptions()) if err != nil { @@ -1169,7 +1169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") payload := staticsites.DatabaseConnectionPatchRequest{ // ... @@ -1190,7 +1190,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") payload := staticsites.DatabaseConnectionPatchRequest{ // ... @@ -1211,7 +1211,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSitePatchResource{ // ... @@ -1232,7 +1232,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") payload := staticsites.StaticSiteUserARMResource{ // ... @@ -1253,7 +1253,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -1270,7 +1270,7 @@ if err := client.ValidateBackendThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -1287,7 +1287,7 @@ if err := client.ValidateBackendForBuildThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ // ... diff --git a/resource-manager/web/2022-09-01/staticsites/id_authprovider.go b/resource-manager/web/2022-09-01/staticsites/id_authprovider.go index 19115aee935..73ad2ff2650 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_authprovider.go +++ b/resource-manager/web/2022-09-01/staticsites/id_authprovider.go @@ -121,9 +121,9 @@ func (id AuthProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), - resourceids.UserSpecifiedSegment("authProviderName", "authprovider"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderName"), } } diff --git a/resource-manager/web/2022-09-01/staticsites/id_authprovider_test.go b/resource-manager/web/2022-09-01/staticsites/id_authprovider_test.go index 31016d1fa90..8ea5e3431e0 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_authprovider_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_authprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthProviderId{} func TestNewAuthProviderID(t *testing.T) { - id := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider") + id := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAuthProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.AuthProviderName != "authprovider" { - t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authprovider") + if id.AuthProviderName != "authProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authProviderName") } } func TestFormatAuthProviderID(t *testing.T) { - actual := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider" + actual := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAuthProviderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAuthProviderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - AuthProviderName: "aUtHpRoViDeR", + StaticSiteName: "sTaTiCsItEnAmE", + AuthProviderName: "aUtHpRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_build.go b/resource-manager/web/2022-09-01/staticsites/id_build.go index 112edc411df..9b2d3b3a03d 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_build.go +++ b/resource-manager/web/2022-09-01/staticsites/id_build.go @@ -121,9 +121,9 @@ func (id BuildId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), } } diff --git a/resource-manager/web/2022-09-01/staticsites/id_build_test.go b/resource-manager/web/2022-09-01/staticsites/id_build_test.go index 3f555f12a5c..9f08be01439 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_build_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_build_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildId{} func TestNewBuildID(t *testing.T) { - id := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") + id := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewBuildID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } } func TestFormatBuildID(t *testing.T) { - actual := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName" + actual := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBuildID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBuildIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_builddatabaseconnection.go b/resource-manager/web/2022-09-01/staticsites/id_builddatabaseconnection.go index c3e3d62bd53..660071b7aab 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_builddatabaseconnection.go +++ b/resource-manager/web/2022-09-01/staticsites/id_builddatabaseconnection.go @@ -127,9 +127,9 @@ func (id BuildDatabaseConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionName"), } diff --git a/resource-manager/web/2022-09-01/staticsites/id_builddatabaseconnection_test.go b/resource-manager/web/2022-09-01/staticsites/id_builddatabaseconnection_test.go index 0ef682da792..68f9cc60dd9 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_builddatabaseconnection_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_builddatabaseconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildDatabaseConnectionId{} func TestNewBuildDatabaseConnectionID(t *testing.T) { - id := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") + id := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewBuildDatabaseConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } if id.DatabaseConnectionName != "databaseConnectionName" { @@ -36,8 +36,8 @@ func TestNewBuildDatabaseConnectionID(t *testing.T) { } func TestFormatBuildDatabaseConnectionID(t *testing.T) { - actual := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName" + actual := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildDatabaseConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildDatabaseConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", DatabaseConnectionName: "dAtAbAsEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_buildlinkedbackend.go b/resource-manager/web/2022-09-01/staticsites/id_buildlinkedbackend.go index 448f74335ef..42b3fe8e789 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_buildlinkedbackend.go +++ b/resource-manager/web/2022-09-01/staticsites/id_buildlinkedbackend.go @@ -127,9 +127,9 @@ func (id BuildLinkedBackendId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendName"), } diff --git a/resource-manager/web/2022-09-01/staticsites/id_buildlinkedbackend_test.go b/resource-manager/web/2022-09-01/staticsites/id_buildlinkedbackend_test.go index ffd4e752932..e7a2cb9e253 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_buildlinkedbackend_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_buildlinkedbackend_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildLinkedBackendId{} func TestNewBuildLinkedBackendID(t *testing.T) { - id := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") + id := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewBuildLinkedBackendID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } if id.LinkedBackendName != "linkedBackendName" { @@ -36,8 +36,8 @@ func TestNewBuildLinkedBackendID(t *testing.T) { } func TestFormatBuildLinkedBackendID(t *testing.T) { - actual := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName" + actual := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildLinkedBackendID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildLinkedBackendIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", LinkedBackendName: "lInKeDbAcKeNdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_builduserprovidedfunctionapp.go b/resource-manager/web/2022-09-01/staticsites/id_builduserprovidedfunctionapp.go index 7b84e9b7fb6..23a557f57de 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_builduserprovidedfunctionapp.go +++ b/resource-manager/web/2022-09-01/staticsites/id_builduserprovidedfunctionapp.go @@ -127,11 +127,11 @@ func (id BuildUserProvidedFunctionAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), - resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "functionAppName"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppName"), } } diff --git a/resource-manager/web/2022-09-01/staticsites/id_builduserprovidedfunctionapp_test.go b/resource-manager/web/2022-09-01/staticsites/id_builduserprovidedfunctionapp_test.go index 12186ac2cb1..04e65c3a35b 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_builduserprovidedfunctionapp_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_builduserprovidedfunctionapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildUserProvidedFunctionAppId{} func TestNewBuildUserProvidedFunctionAppID(t *testing.T) { - id := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") + id := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewBuildUserProvidedFunctionAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } - if id.UserProvidedFunctionAppName != "functionAppName" { - t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "functionAppName") + if id.UserProvidedFunctionAppName != "userProvidedFunctionAppName" { + t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "userProvidedFunctionAppName") } } func TestFormatBuildUserProvidedFunctionAppID(t *testing.T) { - actual := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName" + actual := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildUserProvidedFunctionAppID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildUserProvidedFunctionAppIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", - UserProvidedFunctionAppName: "fUnCtIoNaPpNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", + UserProvidedFunctionAppName: "uSeRpRoViDeDfUnCtIoNaPpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_customdomain.go b/resource-manager/web/2022-09-01/staticsites/id_customdomain.go index 7e2c137ab15..52bb3f0abb2 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_customdomain.go +++ b/resource-manager/web/2022-09-01/staticsites/id_customdomain.go @@ -121,9 +121,9 @@ func (id CustomDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), - resourceids.UserSpecifiedSegment("customDomainName", "domainName"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainName"), } } diff --git a/resource-manager/web/2022-09-01/staticsites/id_customdomain_test.go b/resource-manager/web/2022-09-01/staticsites/id_customdomain_test.go index 3b3fa35ee88..64add194b56 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_customdomain_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_customdomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomDomainId{} func TestNewCustomDomainID(t *testing.T) { - id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") + id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.CustomDomainName != "domainName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "domainName") + if id.CustomDomainName != "customDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "customDomainName") } } func TestFormatCustomDomainID(t *testing.T) { - actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName" + actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - CustomDomainName: "domainName", + StaticSiteName: "staticSiteName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - CustomDomainName: "domainName", + StaticSiteName: "staticSiteName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs/dOmAiNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs/cUsToMdOmAiNnAmE", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - CustomDomainName: "dOmAiNnAmE", + StaticSiteName: "sTaTiCsItEnAmE", + CustomDomainName: "cUsToMdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs/dOmAiNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs/cUsToMdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_databaseconnection.go b/resource-manager/web/2022-09-01/staticsites/id_databaseconnection.go index c8977fff4ca..0646be22614 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_databaseconnection.go +++ b/resource-manager/web/2022-09-01/staticsites/id_databaseconnection.go @@ -121,7 +121,7 @@ func (id DatabaseConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionName"), } diff --git a/resource-manager/web/2022-09-01/staticsites/id_databaseconnection_test.go b/resource-manager/web/2022-09-01/staticsites/id_databaseconnection_test.go index f713ec31548..c91658ac616 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_databaseconnection_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_databaseconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseConnectionId{} func TestNewDatabaseConnectionID(t *testing.T) { - id := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") + id := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.DatabaseConnectionName != "databaseConnectionName" { @@ -32,8 +32,8 @@ func TestNewDatabaseConnectionID(t *testing.T) { } func TestFormatDatabaseConnectionID(t *testing.T) { - actual := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName" + actual := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", DatabaseConnectionName: "dAtAbAsEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_linkedbackend.go b/resource-manager/web/2022-09-01/staticsites/id_linkedbackend.go index affdec42c25..2db02661f88 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_linkedbackend.go +++ b/resource-manager/web/2022-09-01/staticsites/id_linkedbackend.go @@ -121,7 +121,7 @@ func (id LinkedBackendId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendName"), } diff --git a/resource-manager/web/2022-09-01/staticsites/id_linkedbackend_test.go b/resource-manager/web/2022-09-01/staticsites/id_linkedbackend_test.go index 8a21c27c9b0..bbbdc7a534f 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_linkedbackend_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_linkedbackend_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LinkedBackendId{} func TestNewLinkedBackendID(t *testing.T) { - id := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") + id := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewLinkedBackendID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.LinkedBackendName != "linkedBackendName" { @@ -32,8 +32,8 @@ func TestNewLinkedBackendID(t *testing.T) { } func TestFormatLinkedBackendID(t *testing.T) { - actual := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName" + actual := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLinkedBackendID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLinkedBackendIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", LinkedBackendName: "lInKeDbAcKeNdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_providerlocation.go b/resource-manager/web/2022-09-01/staticsites/id_providerlocation.go index ba0444d08c2..c53d10beaa5 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_providerlocation.go +++ b/resource-manager/web/2022-09-01/staticsites/id_providerlocation.go @@ -107,7 +107,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2022-09-01/staticsites/id_providerlocation_test.go b/resource-manager/web/2022-09-01/staticsites/id_providerlocation_test.go index f0354411445..e48b5f6c6d4 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_providerlocation_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_providerlocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_staticsite.go b/resource-manager/web/2022-09-01/staticsites/id_staticsite.go index 91e479c7d40..5b7df0899c4 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_staticsite.go +++ b/resource-manager/web/2022-09-01/staticsites/id_staticsite.go @@ -115,7 +115,7 @@ func (id StaticSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), } } diff --git a/resource-manager/web/2022-09-01/staticsites/id_staticsite_test.go b/resource-manager/web/2022-09-01/staticsites/id_staticsite_test.go index d17c986ce1e..429bdfeaed4 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_staticsite_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_staticsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StaticSiteId{} func TestNewStaticSiteID(t *testing.T) { - id := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStaticSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } } func TestFormatStaticSiteID(t *testing.T) { - actual := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name" + actual := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStaticSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStaticSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_staticsiteprivateendpointconnection.go b/resource-manager/web/2022-09-01/staticsites/id_staticsiteprivateendpointconnection.go index e08cf42aa3c..8c4c4fd7cb9 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_staticsiteprivateendpointconnection.go +++ b/resource-manager/web/2022-09-01/staticsites/id_staticsiteprivateendpointconnection.go @@ -121,7 +121,7 @@ func (id StaticSitePrivateEndpointConnectionId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2022-09-01/staticsites/id_staticsiteprivateendpointconnection_test.go b/resource-manager/web/2022-09-01/staticsites/id_staticsiteprivateendpointconnection_test.go index 9abe6707f50..aef661aa34c 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_staticsiteprivateendpointconnection_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_staticsiteprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StaticSitePrivateEndpointConnectionId{} func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { - id := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { } func TestFormatStaticSitePrivateEndpointConnectionID(t *testing.T) { - actual := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStaticSitePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStaticSitePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_user.go b/resource-manager/web/2022-09-01/staticsites/id_user.go index 9f4e54d1075..fe210ef0473 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_user.go +++ b/resource-manager/web/2022-09-01/staticsites/id_user.go @@ -127,11 +127,11 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), - resourceids.UserSpecifiedSegment("authProviderName", "authprovider"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "userid"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/web/2022-09-01/staticsites/id_user_test.go b/resource-manager/web/2022-09-01/staticsites/id_user_test.go index 10f68b3725b..e79e3a28959 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_user_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.AuthProviderName != "authprovider" { - t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authprovider") + if id.AuthProviderName != "authProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authProviderName") } - if id.UserName != "userid" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userid") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseUserID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", - UserName: "userid", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", - UserName: "userid", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs/uSeRiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - AuthProviderName: "aUtHpRoViDeR", - UserName: "uSeRiD", + StaticSiteName: "sTaTiCsItEnAmE", + AuthProviderName: "aUtHpRoViDeRnAmE", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs/uSeRiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/id_userprovidedfunctionapp.go b/resource-manager/web/2022-09-01/staticsites/id_userprovidedfunctionapp.go index 44e05595733..ff361f6c538 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_userprovidedfunctionapp.go +++ b/resource-manager/web/2022-09-01/staticsites/id_userprovidedfunctionapp.go @@ -121,9 +121,9 @@ func (id UserProvidedFunctionAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), - resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "functionAppName"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppName"), } } diff --git a/resource-manager/web/2022-09-01/staticsites/id_userprovidedfunctionapp_test.go b/resource-manager/web/2022-09-01/staticsites/id_userprovidedfunctionapp_test.go index fe429004412..038fecd6ba1 100644 --- a/resource-manager/web/2022-09-01/staticsites/id_userprovidedfunctionapp_test.go +++ b/resource-manager/web/2022-09-01/staticsites/id_userprovidedfunctionapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserProvidedFunctionAppId{} func TestNewUserProvidedFunctionAppID(t *testing.T) { - id := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") + id := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUserProvidedFunctionAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.UserProvidedFunctionAppName != "functionAppName" { - t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "functionAppName") + if id.UserProvidedFunctionAppName != "userProvidedFunctionAppName" { + t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "userProvidedFunctionAppName") } } func TestFormatUserProvidedFunctionAppID(t *testing.T) { - actual := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName" + actual := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUserProvidedFunctionAppID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUserProvidedFunctionAppIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - UserProvidedFunctionAppName: "fUnCtIoNaPpNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + UserProvidedFunctionAppName: "uSeRpRoViDeDfUnCtIoNaPpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/staticsites/model_staticsite.go b/resource-manager/web/2022-09-01/staticsites/model_staticsite.go index 9fad6989e54..04ffe0c1027 100644 --- a/resource-manager/web/2022-09-01/staticsites/model_staticsite.go +++ b/resource-manager/web/2022-09-01/staticsites/model_staticsite.go @@ -18,7 +18,7 @@ type StaticSite struct { Provider *string `json:"provider,omitempty"` PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` RepositoryToken *string `json:"repositoryToken,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` StagingEnvironmentPolicy *StagingEnvironmentPolicy `json:"stagingEnvironmentPolicy,omitempty"` TemplateProperties *StaticSiteTemplateOptions `json:"templateProperties,omitempty"` UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` diff --git a/resource-manager/web/2022-09-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go b/resource-manager/web/2022-09-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go index 80795463497..e413aa4a9c5 100644 --- a/resource-manager/web/2022-09-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go +++ b/resource-manager/web/2022-09-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go @@ -8,5 +8,5 @@ type StaticSiteBasicAuthPropertiesARMResourceProperties struct { Environments *[]string `json:"environments,omitempty"` Password *string `json:"password,omitempty"` SecretState *string `json:"secretState,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` } diff --git a/resource-manager/web/2022-09-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go b/resource-manager/web/2022-09-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go index bca5c553bc4..c3d04f76a6d 100644 --- a/resource-manager/web/2022-09-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go +++ b/resource-manager/web/2022-09-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go @@ -6,5 +6,5 @@ package staticsites type StaticSitesWorkflowPreviewRequestProperties struct { Branch *string `json:"branch,omitempty"` BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` } diff --git a/resource-manager/web/2022-09-01/staticsites/model_staticsitetemplateoptions.go b/resource-manager/web/2022-09-01/staticsites/model_staticsitetemplateoptions.go index 5afb0421afc..1f957ada652 100644 --- a/resource-manager/web/2022-09-01/staticsites/model_staticsitetemplateoptions.go +++ b/resource-manager/web/2022-09-01/staticsites/model_staticsitetemplateoptions.go @@ -8,5 +8,5 @@ type StaticSiteTemplateOptions struct { IsPrivate *bool `json:"isPrivate,omitempty"` Owner *string `json:"owner,omitempty"` RepositoryName *string `json:"repositoryName,omitempty"` - TemplateRepositoryUrl *string `json:"templateRepositoryUrl,omitempty"` + TemplateRepositoryURL *string `json:"templateRepositoryUrl,omitempty"` } diff --git a/resource-manager/web/2022-09-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go b/resource-manager/web/2022-09-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go index 674c99a3b50..57c9a2fb872 100644 --- a/resource-manager/web/2022-09-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go +++ b/resource-manager/web/2022-09-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go @@ -11,7 +11,7 @@ import ( type StaticSiteUserInvitationResponseResourceProperties struct { ExpiresOn *string `json:"expiresOn,omitempty"` - InvitationUrl *string `json:"invitationUrl,omitempty"` + InvitationURL *string `json:"invitationUrl,omitempty"` } func (o *StaticSiteUserInvitationResponseResourceProperties) GetExpiresOnAsTime() (*time.Time, error) { diff --git a/resource-manager/web/2022-09-01/staticsites/model_staticsitezipdeployment.go b/resource-manager/web/2022-09-01/staticsites/model_staticsitezipdeployment.go index 29435dc00a6..e91994bd766 100644 --- a/resource-manager/web/2022-09-01/staticsites/model_staticsitezipdeployment.go +++ b/resource-manager/web/2022-09-01/staticsites/model_staticsitezipdeployment.go @@ -4,8 +4,8 @@ package staticsites // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type StaticSiteZipDeployment struct { - ApiZipUrl *string `json:"apiZipUrl,omitempty"` - AppZipUrl *string `json:"appZipUrl,omitempty"` + ApiZipURL *string `json:"apiZipUrl,omitempty"` + AppZipURL *string `json:"appZipUrl,omitempty"` DeploymentTitle *string `json:"deploymentTitle,omitempty"` FunctionLanguage *string `json:"functionLanguage,omitempty"` Provider *string `json:"provider,omitempty"` diff --git a/resource-manager/web/2022-09-01/topleveldomains/README.md b/resource-manager/web/2022-09-01/topleveldomains/README.md index 9e15fab0bd7..7676e7798f2 100644 --- a/resource-manager/web/2022-09-01/topleveldomains/README.md +++ b/resource-manager/web/2022-09-01/topleveldomains/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") +id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") +id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") payload := topleveldomains.TopLevelDomainAgreementOption{ // ... diff --git a/resource-manager/web/2022-09-01/topleveldomains/id_topleveldomain.go b/resource-manager/web/2022-09-01/topleveldomains/id_topleveldomain.go index cbe8e0b3066..de4d3235874 100644 --- a/resource-manager/web/2022-09-01/topleveldomains/id_topleveldomain.go +++ b/resource-manager/web/2022-09-01/topleveldomains/id_topleveldomain.go @@ -107,7 +107,7 @@ func (id TopLevelDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDomainRegistration", "Microsoft.DomainRegistration", "Microsoft.DomainRegistration"), resourceids.StaticSegment("staticTopLevelDomains", "topLevelDomains", "topLevelDomains"), - resourceids.UserSpecifiedSegment("topLevelDomainName", "name"), + resourceids.UserSpecifiedSegment("topLevelDomainName", "topLevelDomainName"), } } diff --git a/resource-manager/web/2022-09-01/topleveldomains/id_topleveldomain_test.go b/resource-manager/web/2022-09-01/topleveldomains/id_topleveldomain_test.go index 196fe20d654..11f286ac04e 100644 --- a/resource-manager/web/2022-09-01/topleveldomains/id_topleveldomain_test.go +++ b/resource-manager/web/2022-09-01/topleveldomains/id_topleveldomain_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &TopLevelDomainId{} func TestNewTopLevelDomainID(t *testing.T) { - id := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") + id := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.TopLevelDomainName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'TopLevelDomainName'", id.TopLevelDomainName, "name") + if id.TopLevelDomainName != "topLevelDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'TopLevelDomainName'", id.TopLevelDomainName, "topLevelDomainName") } } func TestFormatTopLevelDomainID(t *testing.T) { - actual := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name" + actual := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseTopLevelDomainID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "name", + TopLevelDomainName: "topLevelDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseTopLevelDomainIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "name", + TopLevelDomainName: "topLevelDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/tOpLeVeLdOmAiNnAmE", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "nAmE", + TopLevelDomainName: "tOpLeVeLdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/tOpLeVeLdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/README.md b/resource-manager/web/2022-09-01/webapps/README.md index 3cd8b2eb10b..1b349814bb4 100644 --- a/resource-manager/web/2022-09-01/webapps/README.md +++ b/resource-manager/web/2022-09-01/webapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") payload := webapps.PremierAddOn{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") payload := webapps.PremierAddOn{ // ... @@ -83,7 +83,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.AnalyzeCustomHostnameSlot(ctx, id, webapps.DefaultAnalyzeCustomHostnameSlotOperationOptions()) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -141,7 +141,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") payload := webapps.RemotePrivateEndpointConnectionARMResource{ // ... @@ -158,7 +158,7 @@ if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") payload := webapps.RemotePrivateEndpointConnectionARMResource{ // ... @@ -196,7 +196,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.BackupRequest{ // ... @@ -217,7 +217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") payload := webapps.Deployment{ // ... @@ -238,7 +238,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") payload := webapps.Deployment{ // ... @@ -259,7 +259,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") payload := webapps.FunctionEnvelope{ // ... @@ -276,7 +276,7 @@ if err := client.CreateFunctionThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") payload := webapps.FunctionEnvelope{ // ... @@ -293,7 +293,7 @@ if err := client.CreateInstanceFunctionSlotThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") payload := webapps.MSDeploy{ // ... @@ -310,7 +310,7 @@ if err := client.CreateInstanceMSDeployOperationThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") payload := webapps.MSDeploy{ // ... @@ -344,7 +344,7 @@ if err := client.CreateMSDeployOperationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.MSDeploy{ // ... @@ -415,7 +415,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteConfigResource{ // ... @@ -436,7 +436,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -457,7 +457,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -478,7 +478,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") +id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") payload := webapps.KeyInfo{ // ... @@ -499,7 +499,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") +id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") payload := webapps.KeyInfo{ // ... @@ -520,7 +520,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") payload := webapps.HostNameBinding{ // ... @@ -541,7 +541,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") payload := webapps.HostNameBinding{ // ... @@ -562,7 +562,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") +id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") payload := webapps.KeyInfo{ // ... @@ -583,7 +583,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") +id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") payload := webapps.KeyInfo{ // ... @@ -604,7 +604,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -625,7 +625,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -646,7 +646,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") payload := webapps.PublicCertificate{ // ... @@ -667,7 +667,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") payload := webapps.PublicCertificate{ // ... @@ -688,7 +688,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -709,7 +709,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -730,7 +730,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.Site{ // ... @@ -764,7 +764,7 @@ if err := client.CreateOrUpdateSourceControlThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteSourceControl{ // ... @@ -802,7 +802,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SwiftVirtualNetwork{ // ... @@ -823,7 +823,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -844,7 +844,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -886,7 +886,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -923,7 +923,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") read, err := client.DeleteBackup(ctx, id) if err != nil { @@ -955,7 +955,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteBackupConfigurationSlot(ctx, id) if err != nil { @@ -971,7 +971,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") read, err := client.DeleteBackupSlot(ctx, id) if err != nil { @@ -987,7 +987,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.DeleteContinuousWebJob(ctx, id) if err != nil { @@ -1003,7 +1003,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.DeleteContinuousWebJobSlot(ctx, id) if err != nil { @@ -1019,7 +1019,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.DeleteDeployment(ctx, id) if err != nil { @@ -1035,7 +1035,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.DeleteDeploymentSlot(ctx, id) if err != nil { @@ -1051,7 +1051,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") read, err := client.DeleteDomainOwnershipIdentifier(ctx, id) if err != nil { @@ -1067,7 +1067,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") read, err := client.DeleteDomainOwnershipIdentifierSlot(ctx, id) if err != nil { @@ -1083,7 +1083,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.DeleteFunction(ctx, id) if err != nil { @@ -1099,7 +1099,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") +id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") read, err := client.DeleteFunctionSecret(ctx, id) if err != nil { @@ -1115,7 +1115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") +id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") read, err := client.DeleteFunctionSecretSlot(ctx, id) if err != nil { @@ -1131,7 +1131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") read, err := client.DeleteHostNameBinding(ctx, id) if err != nil { @@ -1147,7 +1147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") read, err := client.DeleteHostNameBindingSlot(ctx, id) if err != nil { @@ -1163,7 +1163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") +id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") read, err := client.DeleteHostSecret(ctx, id) if err != nil { @@ -1179,7 +1179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") +id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") read, err := client.DeleteHostSecretSlot(ctx, id) if err != nil { @@ -1195,7 +1195,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnection(ctx, id) if err != nil { @@ -1211,7 +1211,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnectionSlot(ctx, id) if err != nil { @@ -1227,7 +1227,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.DeleteInstanceFunctionSlot(ctx, id) if err != nil { @@ -1243,7 +1243,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.DeleteInstanceProcess(ctx, id) if err != nil { @@ -1259,7 +1259,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.DeleteInstanceProcessSlot(ctx, id) if err != nil { @@ -1275,7 +1275,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") read, err := client.DeletePremierAddOn(ctx, id) if err != nil { @@ -1291,7 +1291,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") read, err := client.DeletePremierAddOnSlot(ctx, id) if err != nil { @@ -1307,7 +1307,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -1319,7 +1319,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionSlotThenPoll(ctx, id); err != nil { // handle the error @@ -1331,7 +1331,7 @@ if err := client.DeletePrivateEndpointConnectionSlotThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.DeleteProcess(ctx, id) if err != nil { @@ -1347,7 +1347,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.DeleteProcessSlot(ctx, id) if err != nil { @@ -1363,7 +1363,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") read, err := client.DeletePublicCertificate(ctx, id) if err != nil { @@ -1379,7 +1379,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") read, err := client.DeletePublicCertificateSlot(ctx, id) if err != nil { @@ -1395,7 +1395,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") read, err := client.DeleteRelayServiceConnection(ctx, id) if err != nil { @@ -1411,7 +1411,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") read, err := client.DeleteRelayServiceConnectionSlot(ctx, id) if err != nil { @@ -1427,7 +1427,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") read, err := client.DeleteSiteExtension(ctx, id) if err != nil { @@ -1443,7 +1443,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") read, err := client.DeleteSiteExtensionSlot(ctx, id) if err != nil { @@ -1459,7 +1459,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSlot(ctx, id, webapps.DefaultDeleteSlotOperationOptions()) if err != nil { @@ -1491,7 +1491,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSourceControlSlot(ctx, id, webapps.DefaultDeleteSourceControlSlotOperationOptions()) if err != nil { @@ -1523,7 +1523,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSwiftVirtualNetworkSlot(ctx, id) if err != nil { @@ -1539,7 +1539,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.DeleteTriggeredWebJob(ctx, id) if err != nil { @@ -1555,7 +1555,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.DeleteTriggeredWebJobSlot(ctx, id) if err != nil { @@ -1571,7 +1571,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") read, err := client.DeleteVnetConnection(ctx, id) if err != nil { @@ -1587,7 +1587,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") read, err := client.DeleteVnetConnectionSlot(ctx, id) if err != nil { @@ -1624,7 +1624,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.WorkflowArtifacts{ // ... @@ -1666,7 +1666,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.RestoreRequest{ // ... @@ -1703,7 +1703,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GenerateNewSitePublishingPasswordSlot(ctx, id) if err != nil { @@ -1735,7 +1735,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey") +id := webapps.NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey") read, err := client.GetAppSettingKeyVaultReference(ctx, id) if err != nil { @@ -1751,7 +1751,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey") +id := webapps.NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey") read, err := client.GetAppSettingKeyVaultReferenceSlot(ctx, id) if err != nil { @@ -1784,7 +1784,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetAppSettingsKeyVaultReferencesSlot(ctx, id)` can be used to do batched pagination items, err := client.GetAppSettingsKeyVaultReferencesSlotComplete(ctx, id) @@ -1817,7 +1817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsSlot(ctx, id) if err != nil { @@ -1849,7 +1849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsV2Slot(ctx, id) if err != nil { @@ -1881,7 +1881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsV2WithoutSecretsSlot(ctx, id) if err != nil { @@ -1913,7 +1913,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetBackupConfigurationSlot(ctx, id) if err != nil { @@ -1929,7 +1929,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") read, err := client.GetBackupStatus(ctx, id) if err != nil { @@ -1945,7 +1945,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") read, err := client.GetBackupStatusSlot(ctx, id) if err != nil { @@ -1977,7 +1977,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetConfigurationSlot(ctx, id) if err != nil { @@ -1993,7 +1993,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") +id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") read, err := client.GetConfigurationSnapshot(ctx, id) if err != nil { @@ -2009,7 +2009,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") +id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") read, err := client.GetConfigurationSnapshotSlot(ctx, id) if err != nil { @@ -2041,7 +2041,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetContainerLogsZipSlot(ctx, id) if err != nil { @@ -2057,7 +2057,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.GetContinuousWebJob(ctx, id) if err != nil { @@ -2073,7 +2073,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.GetContinuousWebJobSlot(ctx, id) if err != nil { @@ -2089,7 +2089,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.GetDeployment(ctx, id) if err != nil { @@ -2105,7 +2105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.GetDeploymentSlot(ctx, id) if err != nil { @@ -2137,7 +2137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetDiagnosticLogsConfigurationSlot(ctx, id) if err != nil { @@ -2153,7 +2153,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") read, err := client.GetDomainOwnershipIdentifier(ctx, id) if err != nil { @@ -2169,7 +2169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") read, err := client.GetDomainOwnershipIdentifierSlot(ctx, id) if err != nil { @@ -2201,7 +2201,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetFtpAllowedSlot(ctx, id) if err != nil { @@ -2217,7 +2217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.GetFunction(ctx, id) if err != nil { @@ -2249,7 +2249,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetFunctionsAdminTokenSlot(ctx, id) if err != nil { @@ -2265,7 +2265,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") read, err := client.GetHostNameBinding(ctx, id) if err != nil { @@ -2281,7 +2281,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") read, err := client.GetHostNameBindingSlot(ctx, id) if err != nil { @@ -2297,7 +2297,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnection(ctx, id) if err != nil { @@ -2313,7 +2313,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnectionSlot(ctx, id) if err != nil { @@ -2329,7 +2329,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.GetInstanceFunctionSlot(ctx, id) if err != nil { @@ -2345,7 +2345,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceInfo(ctx, id) if err != nil { @@ -2361,7 +2361,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceInfoSlot(ctx, id) if err != nil { @@ -2377,7 +2377,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceMSDeployLog(ctx, id) if err != nil { @@ -2393,7 +2393,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceMSDeployLogSlot(ctx, id) if err != nil { @@ -2409,7 +2409,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceMsDeployStatus(ctx, id) if err != nil { @@ -2425,7 +2425,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceMsDeployStatusSlot(ctx, id) if err != nil { @@ -2441,7 +2441,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.GetInstanceProcess(ctx, id) if err != nil { @@ -2457,7 +2457,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.GetInstanceProcessDump(ctx, id) if err != nil { @@ -2473,7 +2473,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.GetInstanceProcessDumpSlot(ctx, id) if err != nil { @@ -2489,7 +2489,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress") +id := webapps.NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName") read, err := client.GetInstanceProcessModule(ctx, id) if err != nil { @@ -2505,7 +2505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress") +id := webapps.NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName") read, err := client.GetInstanceProcessModuleSlot(ctx, id) if err != nil { @@ -2521,7 +2521,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.GetInstanceProcessSlot(ctx, id) if err != nil { @@ -2537,7 +2537,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName") +id := webapps.NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName") read, err := client.GetInstanceWorkflowSlot(ctx, id) if err != nil { @@ -2569,7 +2569,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMSDeployLogSlot(ctx, id) if err != nil { @@ -2601,7 +2601,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMSDeployStatusSlot(ctx, id) if err != nil { @@ -2633,7 +2633,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMigrateMySqlStatusSlot(ctx, id) if err != nil { @@ -2649,7 +2649,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") +id := webapps.NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") read, err := client.GetNetworkTraces(ctx, id) if err != nil { @@ -2665,7 +2665,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") +id := webapps.NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") read, err := client.GetNetworkTracesSlot(ctx, id) if err != nil { @@ -2681,7 +2681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") +id := webapps.NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") read, err := client.GetNetworkTracesSlotV2(ctx, id) if err != nil { @@ -2697,7 +2697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") +id := webapps.NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") read, err := client.GetNetworkTracesV2(ctx, id) if err != nil { @@ -2729,7 +2729,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") read, err := client.GetPremierAddOn(ctx, id) if err != nil { @@ -2745,7 +2745,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") read, err := client.GetPremierAddOnSlot(ctx, id) if err != nil { @@ -2777,7 +2777,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetPrivateAccessSlot(ctx, id) if err != nil { @@ -2793,7 +2793,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -2826,7 +2826,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetPrivateEndpointConnectionListSlot(ctx, id)` can be used to do batched pagination items, err := client.GetPrivateEndpointConnectionListSlotComplete(ctx, id) @@ -2843,7 +2843,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnectionSlot(ctx, id) if err != nil { @@ -2875,7 +2875,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetPrivateLinkResourcesSlot(ctx, id) if err != nil { @@ -2891,7 +2891,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.GetProcess(ctx, id) if err != nil { @@ -2907,7 +2907,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.GetProcessDump(ctx, id) if err != nil { @@ -2923,7 +2923,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.GetProcessDumpSlot(ctx, id) if err != nil { @@ -2939,7 +2939,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress") +id := webapps.NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName") read, err := client.GetProcessModule(ctx, id) if err != nil { @@ -2955,7 +2955,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress") +id := webapps.NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName") read, err := client.GetProcessModuleSlot(ctx, id) if err != nil { @@ -2971,7 +2971,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.GetProcessSlot(ctx, id) if err != nil { @@ -2987,7 +2987,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") read, err := client.GetPublicCertificate(ctx, id) if err != nil { @@ -3003,7 +3003,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") read, err := client.GetPublicCertificateSlot(ctx, id) if err != nil { @@ -3019,7 +3019,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") read, err := client.GetRelayServiceConnection(ctx, id) if err != nil { @@ -3035,7 +3035,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") read, err := client.GetRelayServiceConnectionSlot(ctx, id) if err != nil { @@ -3067,7 +3067,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetScmAllowedSlot(ctx, id) if err != nil { @@ -3083,7 +3083,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey") +id := webapps.NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey") read, err := client.GetSiteConnectionStringKeyVaultReference(ctx, id) if err != nil { @@ -3099,7 +3099,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey") +id := webapps.NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey") read, err := client.GetSiteConnectionStringKeyVaultReferenceSlot(ctx, id) if err != nil { @@ -3132,7 +3132,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetSiteConnectionStringKeyVaultReferencesSlot(ctx, id)` can be used to do batched pagination items, err := client.GetSiteConnectionStringKeyVaultReferencesSlotComplete(ctx, id) @@ -3149,7 +3149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") read, err := client.GetSiteExtension(ctx, id) if err != nil { @@ -3165,7 +3165,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") read, err := client.GetSiteExtensionSlot(ctx, id) if err != nil { @@ -3197,7 +3197,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSitePhpErrorLogFlagSlot(ctx, id) if err != nil { @@ -3213,7 +3213,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSlot(ctx, id) if err != nil { @@ -3245,7 +3245,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSourceControlSlot(ctx, id) if err != nil { @@ -3277,7 +3277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSwiftVirtualNetworkConnectionSlot(ctx, id) if err != nil { @@ -3293,7 +3293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.GetTriggeredWebJob(ctx, id) if err != nil { @@ -3309,7 +3309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id") +id := webapps.NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName") read, err := client.GetTriggeredWebJobHistory(ctx, id) if err != nil { @@ -3325,7 +3325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id") +id := webapps.NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName") read, err := client.GetTriggeredWebJobHistorySlot(ctx, id) if err != nil { @@ -3341,7 +3341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.GetTriggeredWebJobSlot(ctx, id) if err != nil { @@ -3357,7 +3357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") read, err := client.GetVnetConnection(ctx, id) if err != nil { @@ -3373,7 +3373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetConnectionGateway(ctx, id) if err != nil { @@ -3389,7 +3389,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetConnectionGatewaySlot(ctx, id) if err != nil { @@ -3405,7 +3405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") read, err := client.GetVnetConnectionSlot(ctx, id) if err != nil { @@ -3421,7 +3421,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName") read, err := client.GetWebJob(ctx, id) if err != nil { @@ -3437,7 +3437,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName") read, err := client.GetWebJobSlot(ctx, id) if err != nil { @@ -3469,7 +3469,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetWebSiteContainerLogsSlot(ctx, id) if err != nil { @@ -3485,7 +3485,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := webapps.NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") read, err := client.GetWorkflow(ctx, id) if err != nil { @@ -3501,7 +3501,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") if err := client.InstallSiteExtensionThenPoll(ctx, id); err != nil { // handle the error @@ -3513,7 +3513,7 @@ if err := client.InstallSiteExtensionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") if err := client.InstallSiteExtensionSlotThenPoll(ctx, id); err != nil { // handle the error @@ -3541,7 +3541,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.IsCloneableSlot(ctx, id) if err != nil { @@ -3590,7 +3590,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListApplicationSettingsSlot(ctx, id) if err != nil { @@ -3622,7 +3622,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListAzureStorageAccountsSlot(ctx, id) if err != nil { @@ -3638,7 +3638,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") payload := webapps.BackupRequest{ // ... @@ -3659,7 +3659,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") payload := webapps.BackupRequest{ // ... @@ -3697,7 +3697,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBackupsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBackupsSlotComplete(ctx, id) @@ -3731,7 +3731,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBasicPublishingCredentialsPoliciesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBasicPublishingCredentialsPoliciesSlotComplete(ctx, id) @@ -3782,7 +3782,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListConfigurationSnapshotInfoSlot(ctx, id)` can be used to do batched pagination items, err := client.ListConfigurationSnapshotInfoSlotComplete(ctx, id) @@ -3816,7 +3816,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListConfigurationsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListConfigurationsSlotComplete(ctx, id) @@ -3849,7 +3849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListConnectionStringsSlot(ctx, id) if err != nil { @@ -3882,7 +3882,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListContinuousWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListContinuousWebJobsSlotComplete(ctx, id) @@ -3899,7 +3899,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.ListDeploymentLog(ctx, id) if err != nil { @@ -3915,7 +3915,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.ListDeploymentLogSlot(ctx, id) if err != nil { @@ -3948,7 +3948,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListDeploymentsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListDeploymentsSlotComplete(ctx, id) @@ -3982,7 +3982,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListDomainOwnershipIdentifiersSlot(ctx, id)` can be used to do batched pagination items, err := client.ListDomainOwnershipIdentifiersSlotComplete(ctx, id) @@ -3999,7 +3999,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.ListFunctionKeys(ctx, id) if err != nil { @@ -4015,7 +4015,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.ListFunctionKeysSlot(ctx, id) if err != nil { @@ -4031,7 +4031,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.ListFunctionSecrets(ctx, id) if err != nil { @@ -4047,7 +4047,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.ListFunctionSecretsSlot(ctx, id) if err != nil { @@ -4096,7 +4096,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListHostKeysSlot(ctx, id) if err != nil { @@ -4129,7 +4129,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListHostNameBindingsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListHostNameBindingsSlotComplete(ctx, id) @@ -4162,7 +4162,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListHybridConnectionsSlot(ctx, id) if err != nil { @@ -4178,7 +4178,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceFunctionsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceFunctionsSlotComplete(ctx, id) @@ -4212,7 +4212,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceIdentifiersSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceIdentifiersSlotComplete(ctx, id) @@ -4229,7 +4229,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") // alternatively `client.ListInstanceProcessModules(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessModulesComplete(ctx, id) @@ -4246,7 +4246,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") // alternatively `client.ListInstanceProcessModulesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessModulesSlotComplete(ctx, id) @@ -4263,7 +4263,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") // alternatively `client.ListInstanceProcessThreads(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessThreadsComplete(ctx, id) @@ -4280,7 +4280,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") // alternatively `client.ListInstanceProcessThreadsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessThreadsSlotComplete(ctx, id) @@ -4297,7 +4297,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") // alternatively `client.ListInstanceProcesses(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessesComplete(ctx, id) @@ -4314,7 +4314,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") // alternatively `client.ListInstanceProcessesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessesSlotComplete(ctx, id) @@ -4331,7 +4331,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceWorkflowsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceWorkflowsSlotComplete(ctx, id) @@ -4364,7 +4364,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListMetadataSlot(ctx, id) if err != nil { @@ -4380,7 +4380,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view") +id := webapps.NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName") read, err := client.ListNetworkFeatures(ctx, id) if err != nil { @@ -4396,7 +4396,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view") +id := webapps.NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName") read, err := client.ListNetworkFeaturesSlot(ctx, id) if err != nil { @@ -4429,7 +4429,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListPerfMonCountersSlot(ctx, id, webapps.DefaultListPerfMonCountersSlotOperationOptions())` can be used to do batched pagination items, err := client.ListPerfMonCountersSlotComplete(ctx, id, webapps.DefaultListPerfMonCountersSlotOperationOptions()) @@ -4462,7 +4462,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListPremierAddOnsSlot(ctx, id) if err != nil { @@ -4478,7 +4478,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") // alternatively `client.ListProcessModules(ctx, id)` can be used to do batched pagination items, err := client.ListProcessModulesComplete(ctx, id) @@ -4495,7 +4495,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") // alternatively `client.ListProcessModulesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessModulesSlotComplete(ctx, id) @@ -4512,7 +4512,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") // alternatively `client.ListProcessThreads(ctx, id)` can be used to do batched pagination items, err := client.ListProcessThreadsComplete(ctx, id) @@ -4529,7 +4529,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") // alternatively `client.ListProcessThreadsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessThreadsSlotComplete(ctx, id) @@ -4563,7 +4563,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListProcessesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessesSlotComplete(ctx, id) @@ -4614,7 +4614,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListPublicCertificatesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListPublicCertificatesSlotComplete(ctx, id) @@ -4643,7 +4643,7 @@ if err := client.ListPublishingCredentialsThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.ListPublishingCredentialsSlotThenPoll(ctx, id); err != nil { // handle the error @@ -4676,7 +4676,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingProfileOptions{ // ... @@ -4713,7 +4713,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListRelayServiceConnectionsSlot(ctx, id) if err != nil { @@ -4746,7 +4746,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteBackupsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteBackupsSlotComplete(ctx, id) @@ -4780,7 +4780,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteExtensionsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteExtensionsSlotComplete(ctx, id) @@ -4813,7 +4813,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSitePushSettingsSlot(ctx, id) if err != nil { @@ -4867,7 +4867,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -4889,7 +4889,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSlotSiteDeploymentStatusesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSlotSiteDeploymentStatusesSlotComplete(ctx, id) @@ -4957,7 +4957,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSnapshotsFromDRSecondarySlot(ctx, id)` can be used to do batched pagination items, err := client.ListSnapshotsFromDRSecondarySlotComplete(ctx, id) @@ -4974,7 +4974,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSnapshotsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSnapshotsSlotComplete(ctx, id) @@ -5007,7 +5007,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSyncFunctionTriggersSlot(ctx, id) if err != nil { @@ -5039,7 +5039,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSyncStatusSlot(ctx, id) if err != nil { @@ -5055,7 +5055,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") // alternatively `client.ListTriggeredWebJobHistory(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobHistoryComplete(ctx, id) @@ -5072,7 +5072,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") // alternatively `client.ListTriggeredWebJobHistorySlot(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobHistorySlotComplete(ctx, id) @@ -5106,7 +5106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListTriggeredWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobsSlotComplete(ctx, id) @@ -5140,7 +5140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListUsagesSlot(ctx, id, webapps.DefaultListUsagesSlotOperationOptions())` can be used to do batched pagination items, err := client.ListUsagesSlotComplete(ctx, id, webapps.DefaultListUsagesSlotOperationOptions()) @@ -5173,7 +5173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListVnetConnectionsSlot(ctx, id) if err != nil { @@ -5206,7 +5206,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListWebJobsSlotComplete(ctx, id) @@ -5256,7 +5256,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListWorkflowsConnectionsSlot(ctx, id) if err != nil { @@ -5327,7 +5327,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.PrivateAccess{ // ... @@ -5348,7 +5348,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") +id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") read, err := client.RecoverSiteConfigurationSnapshot(ctx, id) if err != nil { @@ -5364,7 +5364,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") +id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") read, err := client.RecoverSiteConfigurationSnapshotSlot(ctx, id) if err != nil { @@ -5396,7 +5396,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ResetSlotConfigurationSlot(ctx, id) if err != nil { @@ -5428,7 +5428,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.RestartSlot(ctx, id, webapps.DefaultRestartSlotOperationOptions()) if err != nil { @@ -5444,7 +5444,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") payload := webapps.RestoreRequest{ // ... @@ -5478,7 +5478,7 @@ if err := client.RestoreFromBackupBlobThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.RestoreRequest{ // ... @@ -5512,7 +5512,7 @@ if err := client.RestoreFromDeletedAppThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.DeletedAppRestoreRequest{ // ... @@ -5529,7 +5529,7 @@ if err := client.RestoreFromDeletedAppSlotThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") payload := webapps.RestoreRequest{ // ... @@ -5563,7 +5563,7 @@ if err := client.RestoreSnapshotThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SnapshotRestoreRequest{ // ... @@ -5580,7 +5580,7 @@ if err := client.RestoreSnapshotSlotThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.RunTriggeredWebJob(ctx, id) if err != nil { @@ -5596,7 +5596,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.RunTriggeredWebJobSlot(ctx, id) if err != nil { @@ -5628,7 +5628,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.StartContinuousWebJob(ctx, id) if err != nil { @@ -5644,7 +5644,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.StartContinuousWebJobSlot(ctx, id) if err != nil { @@ -5672,7 +5672,7 @@ if err := client.StartNetworkTraceThenPoll(ctx, id, webapps.DefaultStartNetworkT ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.StartNetworkTraceSlotThenPoll(ctx, id, webapps.DefaultStartNetworkTraceSlotOperationOptions()); err != nil { // handle the error @@ -5684,7 +5684,7 @@ if err := client.StartNetworkTraceSlotThenPoll(ctx, id, webapps.DefaultStartNetw ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StartSlot(ctx, id) if err != nil { @@ -5728,7 +5728,7 @@ if err := client.StartWebSiteNetworkTraceOperationThenPoll(ctx, id, webapps.Defa ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.StartWebSiteNetworkTraceOperationSlotThenPoll(ctx, id, webapps.DefaultStartWebSiteNetworkTraceOperationSlotOperationOptions()); err != nil { // handle the error @@ -5740,7 +5740,7 @@ if err := client.StartWebSiteNetworkTraceOperationSlotThenPoll(ctx, id, webapps. ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StartWebSiteNetworkTraceSlot(ctx, id, webapps.DefaultStartWebSiteNetworkTraceSlotOperationOptions()) if err != nil { @@ -5772,7 +5772,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.StopContinuousWebJob(ctx, id) if err != nil { @@ -5788,7 +5788,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.StopContinuousWebJobSlot(ctx, id) if err != nil { @@ -5820,7 +5820,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopNetworkTraceSlot(ctx, id) if err != nil { @@ -5836,7 +5836,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopSlot(ctx, id) if err != nil { @@ -5868,7 +5868,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopWebSiteNetworkTraceSlot(ctx, id) if err != nil { @@ -5884,7 +5884,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -5934,7 +5934,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncFunctionTriggersSlot(ctx, id) if err != nil { @@ -5966,7 +5966,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncFunctionsSlot(ctx, id) if err != nil { @@ -5998,7 +5998,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncRepositorySlot(ctx, id) if err != nil { @@ -6056,7 +6056,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.StringDictionary{ // ... @@ -6098,7 +6098,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteAuthSettings{ // ... @@ -6140,7 +6140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteAuthSettingsV2{ // ... @@ -6182,7 +6182,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.AzureStoragePropertyDictionaryResource{ // ... @@ -6224,7 +6224,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.BackupRequest{ // ... @@ -6266,7 +6266,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteConfigResource{ // ... @@ -6308,7 +6308,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.ConnectionStringDictionary{ // ... @@ -6350,7 +6350,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteLogsConfig{ // ... @@ -6371,7 +6371,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -6392,7 +6392,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -6434,7 +6434,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingCredentialsPoliciesEntity{ // ... @@ -6455,7 +6455,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -6476,7 +6476,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -6518,7 +6518,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.StringDictionary{ // ... @@ -6539,7 +6539,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") payload := webapps.PremierAddOnPatchResource{ // ... @@ -6560,7 +6560,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") payload := webapps.PremierAddOnPatchResource{ // ... @@ -6581,7 +6581,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -6602,7 +6602,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -6644,7 +6644,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingCredentialsPoliciesEntity{ // ... @@ -6686,7 +6686,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.PushSettings{ // ... @@ -6707,7 +6707,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SitePatchResource{ // ... @@ -6770,7 +6770,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteSourceControl{ // ... @@ -6812,7 +6812,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SwiftVirtualNetwork{ // ... @@ -6833,7 +6833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -6854,7 +6854,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -6875,7 +6875,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -6896,7 +6896,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... diff --git a/resource-manager/web/2022-09-01/webapps/id_appsetting.go b/resource-manager/web/2022-09-01/webapps/id_appsetting.go index 59084b46370..ecd9386b62d 100644 --- a/resource-manager/web/2022-09-01/webapps/id_appsetting.go +++ b/resource-manager/web/2022-09-01/webapps/id_appsetting.go @@ -121,7 +121,7 @@ func (id AppSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticAppSettings", "appSettings", "appSettings"), diff --git a/resource-manager/web/2022-09-01/webapps/id_appsetting_test.go b/resource-manager/web/2022-09-01/webapps/id_appsetting_test.go index 6dda19ec1e7..b7bbe12fe12 100644 --- a/resource-manager/web/2022-09-01/webapps/id_appsetting_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_appsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AppSettingId{} func TestNewAppSettingID(t *testing.T) { - id := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey") + id := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAppSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.AppSettingKey != "appSettingKey" { @@ -32,8 +32,8 @@ func TestNewAppSettingID(t *testing.T) { } func TestFormatAppSettingID(t *testing.T) { - actual := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey" + actual := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseAppSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseAppSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", AppSettingKey: "aPpSeTtInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_backup.go b/resource-manager/web/2022-09-01/webapps/id_backup.go index 3ef9859edca..84ecf422bfb 100644 --- a/resource-manager/web/2022-09-01/webapps/id_backup.go +++ b/resource-manager/web/2022-09-01/webapps/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupId", "backupId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_backup_test.go b/resource-manager/web/2022-09-01/webapps/id_backup_test.go index 02c1370b786..5e0f8fc3dab 100644 --- a/resource-manager/web/2022-09-01/webapps/id_backup_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.BackupId != "backupId" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs/bAcKuPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs/bAcKuPiD", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", BackupId: "bAcKuPiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs/bAcKuPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs/bAcKuPiD/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_configreferenceappsetting.go b/resource-manager/web/2022-09-01/webapps/id_configreferenceappsetting.go index 532f4c47969..0be15f20c3d 100644 --- a/resource-manager/web/2022-09-01/webapps/id_configreferenceappsetting.go +++ b/resource-manager/web/2022-09-01/webapps/id_configreferenceappsetting.go @@ -127,9 +127,9 @@ func (id ConfigReferenceAppSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticAppSettings", "appSettings", "appSettings"), diff --git a/resource-manager/web/2022-09-01/webapps/id_configreferenceappsetting_test.go b/resource-manager/web/2022-09-01/webapps/id_configreferenceappsetting_test.go index d27dfeb32ce..1b5073a3b78 100644 --- a/resource-manager/web/2022-09-01/webapps/id_configreferenceappsetting_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_configreferenceappsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigReferenceAppSettingId{} func TestNewConfigReferenceAppSettingID(t *testing.T) { - id := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey") + id := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewConfigReferenceAppSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.AppSettingKey != "appSettingKey" { @@ -36,8 +36,8 @@ func TestNewConfigReferenceAppSettingID(t *testing.T) { } func TestFormatConfigReferenceAppSettingID(t *testing.T) { - actual := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey" + actual := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseConfigReferenceAppSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseConfigReferenceAppSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", AppSettingKey: "aPpSeTtInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_configreferenceconnectionstring.go b/resource-manager/web/2022-09-01/webapps/id_configreferenceconnectionstring.go index 8d47f02f5a1..63353893f7d 100644 --- a/resource-manager/web/2022-09-01/webapps/id_configreferenceconnectionstring.go +++ b/resource-manager/web/2022-09-01/webapps/id_configreferenceconnectionstring.go @@ -127,9 +127,9 @@ func (id ConfigReferenceConnectionStringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticConnectionStrings", "connectionStrings", "connectionStrings"), diff --git a/resource-manager/web/2022-09-01/webapps/id_configreferenceconnectionstring_test.go b/resource-manager/web/2022-09-01/webapps/id_configreferenceconnectionstring_test.go index b1b2536a50e..a18b81f139f 100644 --- a/resource-manager/web/2022-09-01/webapps/id_configreferenceconnectionstring_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_configreferenceconnectionstring_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigReferenceConnectionStringId{} func TestNewConfigReferenceConnectionStringID(t *testing.T) { - id := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey") + id := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewConfigReferenceConnectionStringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ConnectionStringKey != "connectionStringKey" { @@ -36,8 +36,8 @@ func TestNewConfigReferenceConnectionStringID(t *testing.T) { } func TestFormatConfigReferenceConnectionStringID(t *testing.T) { - actual := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey" + actual := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseConfigReferenceConnectionStringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseConfigReferenceConnectionStringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ConnectionStringKey: "cOnNeCtIoNsTrInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_connectionstring.go b/resource-manager/web/2022-09-01/webapps/id_connectionstring.go index 15ab1745be8..5282e76e282 100644 --- a/resource-manager/web/2022-09-01/webapps/id_connectionstring.go +++ b/resource-manager/web/2022-09-01/webapps/id_connectionstring.go @@ -121,7 +121,7 @@ func (id ConnectionStringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticConnectionStrings", "connectionStrings", "connectionStrings"), diff --git a/resource-manager/web/2022-09-01/webapps/id_connectionstring_test.go b/resource-manager/web/2022-09-01/webapps/id_connectionstring_test.go index de1af457233..c4310a2bd0d 100644 --- a/resource-manager/web/2022-09-01/webapps/id_connectionstring_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_connectionstring_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionStringId{} func TestNewConnectionStringID(t *testing.T) { - id := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey") + id := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConnectionStringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ConnectionStringKey != "connectionStringKey" { @@ -32,8 +32,8 @@ func TestNewConnectionStringID(t *testing.T) { } func TestFormatConnectionStringID(t *testing.T) { - actual := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey" + actual := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseConnectionStringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseConnectionStringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ConnectionStringKey: "cOnNeCtIoNsTrInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_continuouswebjob.go b/resource-manager/web/2022-09-01/webapps/id_continuouswebjob.go index a9bf0269a2f..b25215a56ac 100644 --- a/resource-manager/web/2022-09-01/webapps/id_continuouswebjob.go +++ b/resource-manager/web/2022-09-01/webapps/id_continuouswebjob.go @@ -121,9 +121,9 @@ func (id ContinuousWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticContinuousWebJobs", "continuousWebJobs", "continuousWebJobs"), - resourceids.UserSpecifiedSegment("continuousWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("continuousWebJobName", "continuousWebJobName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_continuouswebjob_test.go b/resource-manager/web/2022-09-01/webapps/id_continuouswebjob_test.go index 9cf5e8d6b69..9dbfdc97ffc 100644 --- a/resource-manager/web/2022-09-01/webapps/id_continuouswebjob_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_continuouswebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContinuousWebJobId{} func TestNewContinuousWebJobID(t *testing.T) { - id := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewContinuousWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.ContinuousWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "webJobName") + if id.ContinuousWebJobName != "continuousWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "continuousWebJobName") } } func TestFormatContinuousWebJobID(t *testing.T) { - actual := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName" + actual := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseContinuousWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseContinuousWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - ContinuousWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + ContinuousWebJobName: "cOnTiNuOuSwEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_default.go b/resource-manager/web/2022-09-01/webapps/id_default.go index 254bc8a89a0..82b1628663d 100644 --- a/resource-manager/web/2022-09-01/webapps/id_default.go +++ b/resource-manager/web/2022-09-01/webapps/id_default.go @@ -127,10 +127,10 @@ func (id DefaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHost", "host", "host"), resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.UserSpecifiedSegment("defaultName", "keyType"), + resourceids.UserSpecifiedSegment("defaultName", "defaultName"), resourceids.UserSpecifiedSegment("keyName", "keyName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_default_test.go b/resource-manager/web/2022-09-01/webapps/id_default_test.go index ba20a5368c1..fb8f07676f0 100644 --- a/resource-manager/web/2022-09-01/webapps/id_default_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_default_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DefaultId{} func TestNewDefaultID(t *testing.T) { - id := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") + id := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewDefaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DefaultName != "keyType" { - t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "keyType") + if id.DefaultName != "defaultName" { + t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "defaultName") } if id.KeyName != "keyName" { @@ -36,8 +36,8 @@ func TestNewDefaultID(t *testing.T) { } func TestFormatDefaultID(t *testing.T) { - actual := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName" + actual := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseDefaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DefaultName: "keyType", + SiteName: "siteName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseDefaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DefaultName: "keyType", + SiteName: "siteName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - DefaultName: "kEyTyPe", + SiteName: "sItEnAmE", + DefaultName: "dEfAuLtNaMe", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_deployment.go b/resource-manager/web/2022-09-01/webapps/id_deployment.go index 5f0c95f64d3..6b9e4f1fdf3 100644 --- a/resource-manager/web/2022-09-01/webapps/id_deployment.go +++ b/resource-manager/web/2022-09-01/webapps/id_deployment.go @@ -121,9 +121,9 @@ func (id DeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), - resourceids.UserSpecifiedSegment("deploymentName", "id"), + resourceids.UserSpecifiedSegment("deploymentName", "deploymentName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_deployment_test.go b/resource-manager/web/2022-09-01/webapps/id_deployment_test.go index d25ecc8b37f..01e80a6d68b 100644 --- a/resource-manager/web/2022-09-01/webapps/id_deployment_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_deployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeploymentId{} func TestNewDeploymentID(t *testing.T) { - id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") + id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DeploymentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "id") + if id.DeploymentName != "deploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "deploymentName") } } func TestFormatDeploymentID(t *testing.T) { - actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id" + actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DeploymentName: "id", + SiteName: "siteName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DeploymentName: "id", + SiteName: "siteName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - DeploymentName: "iD", + SiteName: "sItEnAmE", + DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_function.go b/resource-manager/web/2022-09-01/webapps/id_function.go index f13ac6949c4..f616aeae83a 100644 --- a/resource-manager/web/2022-09-01/webapps/id_function.go +++ b/resource-manager/web/2022-09-01/webapps/id_function.go @@ -121,7 +121,7 @@ func (id FunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_function_test.go b/resource-manager/web/2022-09-01/webapps/id_function_test.go index 9380b24f46c..647ee45180b 100644 --- a/resource-manager/web/2022-09-01/webapps/id_function_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_function_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionId{} func TestNewFunctionID(t *testing.T) { - id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") + id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.FunctionName != "functionName" { @@ -32,8 +32,8 @@ func TestNewFunctionID(t *testing.T) { } func TestFormatFunctionID(t *testing.T) { - actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName" + actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_functionkey.go b/resource-manager/web/2022-09-01/webapps/id_functionkey.go index 6b146a6c1d6..2c5e6ac58da 100644 --- a/resource-manager/web/2022-09-01/webapps/id_functionkey.go +++ b/resource-manager/web/2022-09-01/webapps/id_functionkey.go @@ -133,9 +133,9 @@ func (id FunctionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), diff --git a/resource-manager/web/2022-09-01/webapps/id_functionkey_test.go b/resource-manager/web/2022-09-01/webapps/id_functionkey_test.go index c90a9b7f5bd..d5c2d17970d 100644 --- a/resource-manager/web/2022-09-01/webapps/id_functionkey_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_functionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionKeyId{} func TestNewFunctionKeyID(t *testing.T) { - id := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") + id := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewFunctionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.FunctionName != "functionName" { @@ -40,8 +40,8 @@ func TestNewFunctionKeyID(t *testing.T) { } func TestFormatFunctionKeyID(t *testing.T) { - actual := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName" + actual := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseFunctionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseFunctionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", FunctionName: "fUnCtIoNnAmE", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_gateway.go b/resource-manager/web/2022-09-01/webapps/id_gateway.go index aa57771776c..0d5dc900e0d 100644 --- a/resource-manager/web/2022-09-01/webapps/id_gateway.go +++ b/resource-manager/web/2022-09-01/webapps/id_gateway.go @@ -127,9 +127,9 @@ func (id GatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_gateway_test.go b/resource-manager/web/2022-09-01/webapps/id_gateway_test.go index b4b752195f7..7bbd4aac0a9 100644 --- a/resource-manager/web/2022-09-01/webapps/id_gateway_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_gateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GatewayId{} func TestNewGatewayID(t *testing.T) { - id := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") + id := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -36,8 +36,8 @@ func TestNewGatewayID(t *testing.T) { } func TestFormatGatewayID(t *testing.T) { - actual := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_history.go b/resource-manager/web/2022-09-01/webapps/id_history.go index 20c6af22958..c1cc260d497 100644 --- a/resource-manager/web/2022-09-01/webapps/id_history.go +++ b/resource-manager/web/2022-09-01/webapps/id_history.go @@ -127,11 +127,11 @@ func (id HistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), resourceids.StaticSegment("staticHistory", "history", "history"), - resourceids.UserSpecifiedSegment("historyName", "id"), + resourceids.UserSpecifiedSegment("historyName", "historyName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_history_test.go b/resource-manager/web/2022-09-01/webapps/id_history_test.go index 3289e52eac8..d3d2ed22f07 100644 --- a/resource-manager/web/2022-09-01/webapps/id_history_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_history_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HistoryId{} func TestNewHistoryID(t *testing.T) { - id := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id") + id := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } - if id.HistoryName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "id") + if id.HistoryName != "historyName" { + t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "historyName") } } func TestFormatHistoryID(t *testing.T) { - actual := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id" + actual := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - TriggeredWebJobName: "wEbJoBnAmE", - HistoryName: "iD", + SiteName: "sItEnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", + HistoryName: "hIsToRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_hostdefault.go b/resource-manager/web/2022-09-01/webapps/id_hostdefault.go index 980fea18eb4..d02b1ff58fb 100644 --- a/resource-manager/web/2022-09-01/webapps/id_hostdefault.go +++ b/resource-manager/web/2022-09-01/webapps/id_hostdefault.go @@ -133,12 +133,12 @@ func (id HostDefaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHost", "host", "host"), resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.UserSpecifiedSegment("defaultName", "keyType"), + resourceids.UserSpecifiedSegment("defaultName", "defaultName"), resourceids.UserSpecifiedSegment("keyName", "keyName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_hostdefault_test.go b/resource-manager/web/2022-09-01/webapps/id_hostdefault_test.go index 262ebd9947d..4f3bb7c417c 100644 --- a/resource-manager/web/2022-09-01/webapps/id_hostdefault_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_hostdefault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostDefaultId{} func TestNewHostDefaultID(t *testing.T) { - id := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") + id := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewHostDefaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DefaultName != "keyType" { - t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "keyType") + if id.DefaultName != "defaultName" { + t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "defaultName") } if id.KeyName != "keyName" { @@ -40,8 +40,8 @@ func TestNewHostDefaultID(t *testing.T) { } func TestFormatHostDefaultID(t *testing.T) { - actual := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName" + actual := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseHostDefaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DefaultName: "keyType", + SiteName: "siteName", + SlotName: "slotName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseHostDefaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DefaultName: "keyType", + SiteName: "siteName", + SlotName: "slotName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - DefaultName: "kEyTyPe", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + DefaultName: "dEfAuLtNaMe", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_hostnamebinding.go b/resource-manager/web/2022-09-01/webapps/id_hostnamebinding.go index 9959ddc39e8..56a4b8e3fba 100644 --- a/resource-manager/web/2022-09-01/webapps/id_hostnamebinding.go +++ b/resource-manager/web/2022-09-01/webapps/id_hostnamebinding.go @@ -121,9 +121,9 @@ func (id HostNameBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostNameBindings", "hostNameBindings", "hostNameBindings"), - resourceids.UserSpecifiedSegment("hostNameBindingName", "hostName"), + resourceids.UserSpecifiedSegment("hostNameBindingName", "hostNameBindingName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_hostnamebinding_test.go b/resource-manager/web/2022-09-01/webapps/id_hostnamebinding_test.go index ffa929dffdd..a3b55f6e522 100644 --- a/resource-manager/web/2022-09-01/webapps/id_hostnamebinding_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_hostnamebinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostNameBindingId{} func TestNewHostNameBindingID(t *testing.T) { - id := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") + id := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHostNameBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HostNameBindingName != "hostName" { - t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostName") + if id.HostNameBindingName != "hostNameBindingName" { + t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostNameBindingName") } } func TestFormatHostNameBindingID(t *testing.T) { - actual := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName" + actual := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostNameBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HostNameBindingName: "hostName", + SiteName: "siteName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostNameBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HostNameBindingName: "hostName", + SiteName: "siteName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS/hOsTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HostNameBindingName: "hOsTnAmE", + SiteName: "sItEnAmE", + HostNameBindingName: "hOsTnAmEbInDiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS/hOsTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_hybridconnection.go b/resource-manager/web/2022-09-01/webapps/id_hybridconnection.go index 02bb4f49003..643e1f811d9 100644 --- a/resource-manager/web/2022-09-01/webapps/id_hybridconnection.go +++ b/resource-manager/web/2022-09-01/webapps/id_hybridconnection.go @@ -121,9 +121,9 @@ func (id HybridConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHybridConnection", "hybridConnection", "hybridConnection"), - resourceids.UserSpecifiedSegment("hybridConnectionName", "entityName"), + resourceids.UserSpecifiedSegment("hybridConnectionName", "hybridConnectionName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_hybridconnection_test.go b/resource-manager/web/2022-09-01/webapps/id_hybridconnection_test.go index 5580974235b..db79679c1a3 100644 --- a/resource-manager/web/2022-09-01/webapps/id_hybridconnection_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_hybridconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HybridConnectionId{} func TestNewHybridConnectionID(t *testing.T) { - id := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") + id := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHybridConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HybridConnectionName != "entityName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "entityName") + if id.HybridConnectionName != "hybridConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "hybridConnectionName") } } func TestFormatHybridConnectionID(t *testing.T) { - actual := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName" + actual := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHybridConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionName: "entityName", + SiteName: "siteName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHybridConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionName: "entityName", + SiteName: "siteName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN/eNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HybridConnectionName: "eNtItYnAmE", + SiteName: "sItEnAmE", + HybridConnectionName: "hYbRiDcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN/eNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_instance.go b/resource-manager/web/2022-09-01/webapps/id_instance.go index 25203793a81..f43fc67da55 100644 --- a/resource-manager/web/2022-09-01/webapps/id_instance.go +++ b/resource-manager/web/2022-09-01/webapps/id_instance.go @@ -121,7 +121,7 @@ func (id InstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_instance_test.go b/resource-manager/web/2022-09-01/webapps/id_instance_test.go index c4429391ddb..34b663d63cc 100644 --- a/resource-manager/web/2022-09-01/webapps/id_instance_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_instance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceId{} func TestNewInstanceID(t *testing.T) { - id := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") + id := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -32,8 +32,8 @@ func TestNewInstanceID(t *testing.T) { } func TestFormatInstanceID(t *testing.T) { - actual := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId" + actual := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_instanceprocess.go b/resource-manager/web/2022-09-01/webapps/id_instanceprocess.go index 55adc768077..86610e6df3c 100644 --- a/resource-manager/web/2022-09-01/webapps/id_instanceprocess.go +++ b/resource-manager/web/2022-09-01/webapps/id_instanceprocess.go @@ -127,7 +127,7 @@ func (id InstanceProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), diff --git a/resource-manager/web/2022-09-01/webapps/id_instanceprocess_test.go b/resource-manager/web/2022-09-01/webapps/id_instanceprocess_test.go index 96f28a0d8b3..dbfed807250 100644 --- a/resource-manager/web/2022-09-01/webapps/id_instanceprocess_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_instanceprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceProcessId{} func TestNewInstanceProcessID(t *testing.T) { - id := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") + id := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -36,8 +36,8 @@ func TestNewInstanceProcessID(t *testing.T) { } func TestFormatInstanceProcessID(t *testing.T) { - actual := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId" + actual := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseInstanceProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseInstanceProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_instanceprocessmodule.go b/resource-manager/web/2022-09-01/webapps/id_instanceprocessmodule.go index 5b146947462..28225e030f5 100644 --- a/resource-manager/web/2022-09-01/webapps/id_instanceprocessmodule.go +++ b/resource-manager/web/2022-09-01/webapps/id_instanceprocessmodule.go @@ -133,13 +133,13 @@ func (id InstanceProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_instanceprocessmodule_test.go b/resource-manager/web/2022-09-01/webapps/id_instanceprocessmodule_test.go index 62ccb13e72d..7e118c5f387 100644 --- a/resource-manager/web/2022-09-01/webapps/id_instanceprocessmodule_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_instanceprocessmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceProcessModuleId{} func TestNewInstanceProcessModuleID(t *testing.T) { - id := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress") + id := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -34,14 +34,14 @@ func TestNewInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatInstanceProcessModuleID(t *testing.T) { - actual := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress" + actual := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseInstanceProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseInstanceProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_key.go b/resource-manager/web/2022-09-01/webapps/id_key.go index c0b37b03506..ca9170618d4 100644 --- a/resource-manager/web/2022-09-01/webapps/id_key.go +++ b/resource-manager/web/2022-09-01/webapps/id_key.go @@ -127,7 +127,7 @@ func (id KeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), diff --git a/resource-manager/web/2022-09-01/webapps/id_key_test.go b/resource-manager/web/2022-09-01/webapps/id_key_test.go index 7ebef22f14b..0d951499006 100644 --- a/resource-manager/web/2022-09-01/webapps/id_key_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_key_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KeyId{} func TestNewKeyID(t *testing.T) { - id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") + id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.FunctionName != "functionName" { @@ -36,8 +36,8 @@ func TestNewKeyID(t *testing.T) { } func TestFormatKeyID(t *testing.T) { - actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName" + actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", FunctionName: "fUnCtIoNnAmE", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_module.go b/resource-manager/web/2022-09-01/webapps/id_module.go index a4d421216a9..88421388b85 100644 --- a/resource-manager/web/2022-09-01/webapps/id_module.go +++ b/resource-manager/web/2022-09-01/webapps/id_module.go @@ -127,11 +127,11 @@ func (id ModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_module_test.go b/resource-manager/web/2022-09-01/webapps/id_module_test.go index d97537ae112..d5e57223ef0 100644 --- a/resource-manager/web/2022-09-01/webapps/id_module_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_module_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModuleId{} func TestNewModuleID(t *testing.T) { - id := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress") + id := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ProcessId != "processId" { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatModuleID(t *testing.T) { - actual := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress" + actual := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_networkfeature.go b/resource-manager/web/2022-09-01/webapps/id_networkfeature.go index fd2923f194e..dc1966efd90 100644 --- a/resource-manager/web/2022-09-01/webapps/id_networkfeature.go +++ b/resource-manager/web/2022-09-01/webapps/id_networkfeature.go @@ -121,9 +121,9 @@ func (id NetworkFeatureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkFeatures", "networkFeatures", "networkFeatures"), - resourceids.UserSpecifiedSegment("networkFeatureName", "view"), + resourceids.UserSpecifiedSegment("networkFeatureName", "networkFeatureName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_networkfeature_test.go b/resource-manager/web/2022-09-01/webapps/id_networkfeature_test.go index 3b6fe10b0f0..1c1bafc5113 100644 --- a/resource-manager/web/2022-09-01/webapps/id_networkfeature_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_networkfeature_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkFeatureId{} func TestNewNetworkFeatureID(t *testing.T) { - id := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view") + id := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewNetworkFeatureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.NetworkFeatureName != "view" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "view") + if id.NetworkFeatureName != "networkFeatureName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "networkFeatureName") } } func TestFormatNetworkFeatureID(t *testing.T) { - actual := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view" + actual := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkFeatureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - NetworkFeatureName: "view", + SiteName: "siteName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - NetworkFeatureName: "view", + SiteName: "siteName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs/vIeW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - NetworkFeatureName: "vIeW", + SiteName: "sItEnAmE", + NetworkFeatureName: "nEtWoRkFeAtUrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs/vIeW/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_networktrace.go b/resource-manager/web/2022-09-01/webapps/id_networktrace.go index 1e29b968bba..d7b89a69dd1 100644 --- a/resource-manager/web/2022-09-01/webapps/id_networktrace.go +++ b/resource-manager/web/2022-09-01/webapps/id_networktrace.go @@ -121,7 +121,7 @@ func (id NetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkTrace", "networkTrace", "networkTrace"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_networktrace_test.go b/resource-manager/web/2022-09-01/webapps/id_networktrace_test.go index 6147556e678..2ca9e11dd67 100644 --- a/resource-manager/web/2022-09-01/webapps/id_networktrace_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_networktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkTraceId{} func TestNewNetworkTraceID(t *testing.T) { - id := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") + id := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.OperationId != "operationId" { @@ -32,8 +32,8 @@ func TestNewNetworkTraceID(t *testing.T) { } func TestFormatNetworkTraceID(t *testing.T) { - actual := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId" + actual := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE/oPeRaTiOnId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_premieraddon.go b/resource-manager/web/2022-09-01/webapps/id_premieraddon.go index f926683223a..e2a7b5cf220 100644 --- a/resource-manager/web/2022-09-01/webapps/id_premieraddon.go +++ b/resource-manager/web/2022-09-01/webapps/id_premieraddon.go @@ -121,9 +121,9 @@ func (id PremierAddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPremierAddons", "premierAddons", "premierAddons"), - resourceids.UserSpecifiedSegment("premierAddonName", "premierAddOnName"), + resourceids.UserSpecifiedSegment("premierAddonName", "premierAddonName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_premieraddon_test.go b/resource-manager/web/2022-09-01/webapps/id_premieraddon_test.go index e14985cf82a..2c292945ce2 100644 --- a/resource-manager/web/2022-09-01/webapps/id_premieraddon_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_premieraddon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PremierAddonId{} func TestNewPremierAddonID(t *testing.T) { - id := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") + id := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPremierAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.PremierAddonName != "premierAddOnName" { - t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddOnName") + if id.PremierAddonName != "premierAddonName" { + t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddonName") } } func TestFormatPremierAddonID(t *testing.T) { - actual := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName" + actual := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePremierAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePremierAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PremierAddonName: "pReMiErAdDoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_privateendpointconnection.go b/resource-manager/web/2022-09-01/webapps/id_privateendpointconnection.go index 1504e2b3374..c7d9dfbd7e0 100644 --- a/resource-manager/web/2022-09-01/webapps/id_privateendpointconnection.go +++ b/resource-manager/web/2022-09-01/webapps/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_privateendpointconnection_test.go b/resource-manager/web/2022-09-01/webapps/id_privateendpointconnection_test.go index 9a552e2764d..b8561c67c85 100644 --- a/resource-manager/web/2022-09-01/webapps/id_privateendpointconnection_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_process.go b/resource-manager/web/2022-09-01/webapps/id_process.go index 1c2d61493cb..4bd04a2dc5a 100644 --- a/resource-manager/web/2022-09-01/webapps/id_process.go +++ b/resource-manager/web/2022-09-01/webapps/id_process.go @@ -121,7 +121,7 @@ func (id ProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_process_test.go b/resource-manager/web/2022-09-01/webapps/id_process_test.go index 3c86013b33b..01626642762 100644 --- a/resource-manager/web/2022-09-01/webapps/id_process_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_process_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProcessId{} func TestNewProcessID(t *testing.T) { - id := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") + id := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ProcessId != "processId" { @@ -32,8 +32,8 @@ func TestNewProcessID(t *testing.T) { } func TestFormatProcessID(t *testing.T) { - actual := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId" + actual := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_processmodule.go b/resource-manager/web/2022-09-01/webapps/id_processmodule.go index 87b5d659016..5219175f699 100644 --- a/resource-manager/web/2022-09-01/webapps/id_processmodule.go +++ b/resource-manager/web/2022-09-01/webapps/id_processmodule.go @@ -133,13 +133,13 @@ func (id ProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_processmodule_test.go b/resource-manager/web/2022-09-01/webapps/id_processmodule_test.go index 53e7e1765c4..de7af2c9000 100644 --- a/resource-manager/web/2022-09-01/webapps/id_processmodule_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_processmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProcessModuleId{} func TestNewProcessModuleID(t *testing.T) { - id := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress") + id := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ProcessId != "processId" { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatProcessModuleID(t *testing.T) { - actual := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress" + actual := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_publiccertificate.go b/resource-manager/web/2022-09-01/webapps/id_publiccertificate.go index 5addcaf8c22..ab810e6cab6 100644 --- a/resource-manager/web/2022-09-01/webapps/id_publiccertificate.go +++ b/resource-manager/web/2022-09-01/webapps/id_publiccertificate.go @@ -121,7 +121,7 @@ func (id PublicCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPublicCertificates", "publicCertificates", "publicCertificates"), resourceids.UserSpecifiedSegment("publicCertificateName", "publicCertificateName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_publiccertificate_test.go b/resource-manager/web/2022-09-01/webapps/id_publiccertificate_test.go index 53da52ea695..947dd952615 100644 --- a/resource-manager/web/2022-09-01/webapps/id_publiccertificate_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_publiccertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PublicCertificateId{} func TestNewPublicCertificateID(t *testing.T) { - id := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") + id := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPublicCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.PublicCertificateName != "publicCertificateName" { @@ -32,8 +32,8 @@ func TestNewPublicCertificateID(t *testing.T) { } func TestFormatPublicCertificateID(t *testing.T) { - actual := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName" + actual := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePublicCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePublicCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PublicCertificateName: "pUbLiCcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_relay.go b/resource-manager/web/2022-09-01/webapps/id_relay.go index 9396eaf87db..4af77542a26 100644 --- a/resource-manager/web/2022-09-01/webapps/id_relay.go +++ b/resource-manager/web/2022-09-01/webapps/id_relay.go @@ -127,9 +127,9 @@ func (id RelayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_relay_test.go b/resource-manager/web/2022-09-01/webapps/id_relay_test.go index 858e3cdec80..b0ca40050e1 100644 --- a/resource-manager/web/2022-09-01/webapps/id_relay_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_relay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RelayId{} func TestNewRelayID(t *testing.T) { - id := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") + id := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -36,8 +36,8 @@ func TestNewRelayID(t *testing.T) { } func TestFormatRelayID(t *testing.T) { - actual := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + SiteName: "sItEnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_domainownershipidentifier.go b/resource-manager/web/2022-09-01/webapps/id_sitedomainownershipidentifier.go similarity index 60% rename from resource-manager/web/2023-01-01/webapps/id_domainownershipidentifier.go rename to resource-manager/web/2022-09-01/webapps/id_sitedomainownershipidentifier.go index 3e940af260c..ff59f8417f2 100644 --- a/resource-manager/web/2023-01-01/webapps/id_domainownershipidentifier.go +++ b/resource-manager/web/2022-09-01/webapps/id_sitedomainownershipidentifier.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&DomainOwnershipIdentifierId{}) + recaser.RegisterResourceId(&SiteDomainOwnershipIdentifierId{}) } -var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} +var _ resourceids.ResourceId = &SiteDomainOwnershipIdentifierId{} -// DomainOwnershipIdentifierId is a struct representing the Resource ID for a Domain Ownership Identifier -type DomainOwnershipIdentifierId struct { +// SiteDomainOwnershipIdentifierId is a struct representing the Resource ID for a Site Domain Ownership Identifier +type SiteDomainOwnershipIdentifierId struct { SubscriptionId string ResourceGroupName string SiteName string DomainOwnershipIdentifierName string } -// NewDomainOwnershipIdentifierID returns a new DomainOwnershipIdentifierId struct -func NewDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName string, siteName string, domainOwnershipIdentifierName string) DomainOwnershipIdentifierId { - return DomainOwnershipIdentifierId{ +// NewSiteDomainOwnershipIdentifierID returns a new SiteDomainOwnershipIdentifierId struct +func NewSiteDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName string, siteName string, domainOwnershipIdentifierName string) SiteDomainOwnershipIdentifierId { + return SiteDomainOwnershipIdentifierId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, SiteName: siteName, @@ -35,15 +35,15 @@ func NewDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName str } } -// ParseDomainOwnershipIdentifierID parses 'input' into a DomainOwnershipIdentifierId -func ParseDomainOwnershipIdentifierID(input string) (*DomainOwnershipIdentifierId, error) { - parser := resourceids.NewParserFromResourceIdType(&DomainOwnershipIdentifierId{}) +// ParseSiteDomainOwnershipIdentifierID parses 'input' into a SiteDomainOwnershipIdentifierId +func ParseSiteDomainOwnershipIdentifierID(input string) (*SiteDomainOwnershipIdentifierId, error) { + parser := resourceids.NewParserFromResourceIdType(&SiteDomainOwnershipIdentifierId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DomainOwnershipIdentifierId{} + id := SiteDomainOwnershipIdentifierId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseDomainOwnershipIdentifierID(input string) (*DomainOwnershipIdentifierI return &id, nil } -// ParseDomainOwnershipIdentifierIDInsensitively parses 'input' case-insensitively into a DomainOwnershipIdentifierId +// ParseSiteDomainOwnershipIdentifierIDInsensitively parses 'input' case-insensitively into a SiteDomainOwnershipIdentifierId // note: this method should only be used for API response data and not user input -func ParseDomainOwnershipIdentifierIDInsensitively(input string) (*DomainOwnershipIdentifierId, error) { - parser := resourceids.NewParserFromResourceIdType(&DomainOwnershipIdentifierId{}) +func ParseSiteDomainOwnershipIdentifierIDInsensitively(input string) (*SiteDomainOwnershipIdentifierId, error) { + parser := resourceids.NewParserFromResourceIdType(&SiteDomainOwnershipIdentifierId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DomainOwnershipIdentifierId{} + id := SiteDomainOwnershipIdentifierId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseDomainOwnershipIdentifierIDInsensitively(input string) (*DomainOwnersh return &id, nil } -func (id *DomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseResult) error { +func (id *SiteDomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *DomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseRe return nil } -// ValidateDomainOwnershipIdentifierID checks that 'input' can be parsed as a Domain Ownership Identifier ID -func ValidateDomainOwnershipIdentifierID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateSiteDomainOwnershipIdentifierID checks that 'input' can be parsed as a Site Domain Ownership Identifier ID +func ValidateSiteDomainOwnershipIdentifierID(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 := ParseDomainOwnershipIdentifierID(v); err != nil { + if _, err := ParseSiteDomainOwnershipIdentifierID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) ID() string { +// ID returns the formatted Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/sites/%s/domainOwnershipIdentifiers/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.SiteName, id.DomainOwnershipIdentifierName) } -// Segments returns a slice of Resource ID Segments which comprise this Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -121,19 +121,19 @@ func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } } -// String returns a human-readable description of this Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) String() string { +// String returns a human-readable description of this Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Site Name: %q", id.SiteName), fmt.Sprintf("Domain Ownership Identifier Name: %q", id.DomainOwnershipIdentifierName), } - return fmt.Sprintf("Domain Ownership Identifier (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Site Domain Ownership Identifier (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2023-01-01/webapps/id_domainownershipidentifier_test.go b/resource-manager/web/2022-09-01/webapps/id_sitedomainownershipidentifier_test.go similarity index 82% rename from resource-manager/web/2023-01-01/webapps/id_domainownershipidentifier_test.go rename to resource-manager/web/2022-09-01/webapps/id_sitedomainownershipidentifier_test.go index fca70ae9b3a..db628c3f6c2 100644 --- a/resource-manager/web/2023-01-01/webapps/id_domainownershipidentifier_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_sitedomainownershipidentifier_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} +var _ resourceids.ResourceId = &SiteDomainOwnershipIdentifierId{} -func TestNewDomainOwnershipIdentifierID(t *testing.T) { - id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +func TestNewSiteDomainOwnershipIdentifierID(t *testing.T) { + id := NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { @@ -31,19 +31,19 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { } } -func TestFormatDomainOwnershipIdentifierID(t *testing.T) { - actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName" +func TestFormatSiteDomainOwnershipIdentifierID(t *testing.T) { + actual := NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseDomainOwnershipIdentifierID(t *testing.T) { +func TestParseSiteDomainOwnershipIdentifierID(t *testing.T) { testData := []struct { Input string Error bool - Expected *DomainOwnershipIdentifierId + Expected *SiteDomainOwnershipIdentifierId }{ { // Incomplete URI @@ -87,34 +87,34 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName", - Expected: &DomainOwnershipIdentifierId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDomainOwnershipIdentifierID(v.Input) + actual, err := ParseSiteDomainOwnershipIdentifierID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { } } -func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { +func TestParseSiteDomainOwnershipIdentifierIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *DomainOwnershipIdentifierId + Expected *SiteDomainOwnershipIdentifierId }{ { // Incomplete URI @@ -228,59 +228,59 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName", - Expected: &DomainOwnershipIdentifierId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", - Expected: &DomainOwnershipIdentifierId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDomainOwnershipIdentifierIDInsensitively(v.Input) + actual, err := ParseSiteDomainOwnershipIdentifierIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { } } -func TestSegmentsForDomainOwnershipIdentifierId(t *testing.T) { - segments := DomainOwnershipIdentifierId{}.Segments() +func TestSegmentsForSiteDomainOwnershipIdentifierId(t *testing.T) { + segments := SiteDomainOwnershipIdentifierId{}.Segments() if len(segments) == 0 { - t.Fatalf("DomainOwnershipIdentifierId has no segments") + t.Fatalf("SiteDomainOwnershipIdentifierId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2022-09-01/webapps/id_siteextension.go b/resource-manager/web/2022-09-01/webapps/id_siteextension.go index 17385289ef2..40c85eb38fe 100644 --- a/resource-manager/web/2022-09-01/webapps/id_siteextension.go +++ b/resource-manager/web/2022-09-01/webapps/id_siteextension.go @@ -121,7 +121,7 @@ func (id SiteExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSiteExtensions", "siteExtensions", "siteExtensions"), resourceids.UserSpecifiedSegment("siteExtensionId", "siteExtensionId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_siteextension_test.go b/resource-manager/web/2022-09-01/webapps/id_siteextension_test.go index 47dc5d50a4b..32a89aa57ab 100644 --- a/resource-manager/web/2022-09-01/webapps/id_siteextension_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_siteextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteExtensionId{} func TestNewSiteExtensionID(t *testing.T) { - id := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") + id := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSiteExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.SiteExtensionId != "siteExtensionId" { @@ -32,8 +32,8 @@ func TestNewSiteExtensionID(t *testing.T) { } func TestFormatSiteExtensionID(t *testing.T) { - actual := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId" + actual := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSiteExtensionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSiteExtensionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", SiteExtensionId: "sItEeXtEnSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_sitenetworktrace.go b/resource-manager/web/2022-09-01/webapps/id_sitenetworktrace.go index b281890243a..3274d10301d 100644 --- a/resource-manager/web/2022-09-01/webapps/id_sitenetworktrace.go +++ b/resource-manager/web/2022-09-01/webapps/id_sitenetworktrace.go @@ -121,7 +121,7 @@ func (id SiteNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkTraces", "networkTraces", "networkTraces"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_sitenetworktrace_test.go b/resource-manager/web/2022-09-01/webapps/id_sitenetworktrace_test.go index 29300cecd7f..92c51e2118f 100644 --- a/resource-manager/web/2022-09-01/webapps/id_sitenetworktrace_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_sitenetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteNetworkTraceId{} func TestNewSiteNetworkTraceID(t *testing.T) { - id := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") + id := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSiteNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.OperationId != "operationId" { @@ -32,8 +32,8 @@ func TestNewSiteNetworkTraceID(t *testing.T) { } func TestFormatSiteNetworkTraceID(t *testing.T) { - actual := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId" + actual := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSiteNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSiteNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs/oPeRaTiOnId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_siteslotnetworktrace.go b/resource-manager/web/2022-09-01/webapps/id_siteslotnetworktrace.go index e5bee7517a2..23fbbbb9eab 100644 --- a/resource-manager/web/2022-09-01/webapps/id_siteslotnetworktrace.go +++ b/resource-manager/web/2022-09-01/webapps/id_siteslotnetworktrace.go @@ -127,9 +127,9 @@ func (id SiteSlotNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkTraces", "networkTraces", "networkTraces"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_siteslotnetworktrace_test.go b/resource-manager/web/2022-09-01/webapps/id_siteslotnetworktrace_test.go index f3c78909b42..33e3ff66202 100644 --- a/resource-manager/web/2022-09-01/webapps/id_siteslotnetworktrace_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_siteslotnetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteSlotNetworkTraceId{} func TestNewSiteSlotNetworkTraceID(t *testing.T) { - id := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") + id := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSiteSlotNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.OperationId != "operationId" { @@ -36,8 +36,8 @@ func TestNewSiteSlotNetworkTraceID(t *testing.T) { } func TestFormatSiteSlotNetworkTraceID(t *testing.T) { - actual := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId" + actual := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSiteSlotNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSiteSlotNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs/oPeRaTiOnId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slot.go b/resource-manager/web/2022-09-01/webapps/id_slot.go index 8e908291c1b..620b8a931e0 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slot.go +++ b/resource-manager/web/2022-09-01/webapps/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slot_test.go b/resource-manager/web/2022-09-01/webapps/id_slot_test.go index 9c612d86b14..4ef0619f083 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slot_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotbackup.go b/resource-manager/web/2022-09-01/webapps/id_slotbackup.go index a528a2b155a..1aa5199ef05 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotbackup.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotbackup.go @@ -127,9 +127,9 @@ func (id SlotBackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupId", "backupId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotbackup_test.go b/resource-manager/web/2022-09-01/webapps/id_slotbackup_test.go index d6aa3483217..56eb5f5933f 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotbackup_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotbackup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotBackupId{} func TestNewSlotBackupID(t *testing.T) { - id := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") + id := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.BackupId != "backupId" { @@ -36,8 +36,8 @@ func TestNewSlotBackupID(t *testing.T) { } func TestFormatSlotBackupID(t *testing.T) { - actual := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId" + actual := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs/bAcKuPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs/bAcKuPiD", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", BackupId: "bAcKuPiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs/bAcKuPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs/bAcKuPiD/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotcontinuouswebjob.go b/resource-manager/web/2022-09-01/webapps/id_slotcontinuouswebjob.go index 949c806fd72..6ca39c98b2e 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotcontinuouswebjob.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotcontinuouswebjob.go @@ -127,11 +127,11 @@ func (id SlotContinuousWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticContinuousWebJobs", "continuousWebJobs", "continuousWebJobs"), - resourceids.UserSpecifiedSegment("continuousWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("continuousWebJobName", "continuousWebJobName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotcontinuouswebjob_test.go b/resource-manager/web/2022-09-01/webapps/id_slotcontinuouswebjob_test.go index 9392d248c38..94be6b075f1 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotcontinuouswebjob_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotcontinuouswebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotContinuousWebJobId{} func TestNewSlotContinuousWebJobID(t *testing.T) { - id := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotContinuousWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.ContinuousWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "webJobName") + if id.ContinuousWebJobName != "continuousWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "continuousWebJobName") } } func TestFormatSlotContinuousWebJobID(t *testing.T) { - actual := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName" + actual := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotContinuousWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotContinuousWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - ContinuousWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + ContinuousWebJobName: "cOnTiNuOuSwEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotdeployment.go b/resource-manager/web/2022-09-01/webapps/id_slotdeployment.go index a3dfd649a34..fe789dce200 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotdeployment.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotdeployment.go @@ -127,11 +127,11 @@ func (id SlotDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), - resourceids.UserSpecifiedSegment("deploymentName", "id"), + resourceids.UserSpecifiedSegment("deploymentName", "deploymentName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotdeployment_test.go b/resource-manager/web/2022-09-01/webapps/id_slotdeployment_test.go index aaeb2a4752e..2ddd1a03e78 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotdeployment_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDeploymentId{} func TestNewSlotDeploymentID(t *testing.T) { - id := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") + id := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DeploymentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "id") + if id.DeploymentName != "deploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "deploymentName") } } func TestFormatSlotDeploymentID(t *testing.T) { - actual := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id" + actual := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DeploymentName: "id", + SiteName: "siteName", + SlotName: "slotName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DeploymentName: "id", + SiteName: "siteName", + SlotName: "slotName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - DeploymentName: "iD", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotdomainownershipidentifier.go b/resource-manager/web/2022-09-01/webapps/id_slotdomainownershipidentifier.go index 2fc8d9e44ed..1dbb4307122 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotdomainownershipidentifier.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotdomainownershipidentifier.go @@ -127,9 +127,9 @@ func (id SlotDomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotdomainownershipidentifier_test.go b/resource-manager/web/2022-09-01/webapps/id_slotdomainownershipidentifier_test.go index 440a035b88d..7be0f127472 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotdomainownershipidentifier_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotdomainownershipidentifier_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDomainOwnershipIdentifierId{} func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { - id := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") + id := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { @@ -36,8 +36,8 @@ func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { } func TestFormatSlotDomainOwnershipIdentifierID(t *testing.T) { - actual := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName" + actual := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotDomainOwnershipIdentifierID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotfunction.go b/resource-manager/web/2022-09-01/webapps/id_slotfunction.go index 117c18780b1..2f9cba6eccc 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotfunction.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotfunction.go @@ -127,9 +127,9 @@ func (id SlotFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotfunction_test.go b/resource-manager/web/2022-09-01/webapps/id_slotfunction_test.go index 37def86173d..10315a35c83 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotfunction_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotFunctionId{} func TestNewSlotFunctionID(t *testing.T) { - id := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") + id := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.FunctionName != "functionName" { @@ -36,8 +36,8 @@ func TestNewSlotFunctionID(t *testing.T) { } func TestFormatSlotFunctionID(t *testing.T) { - actual := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName" + actual := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slothostnamebinding.go b/resource-manager/web/2022-09-01/webapps/id_slothostnamebinding.go index 23702df5875..590d01a4bae 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slothostnamebinding.go +++ b/resource-manager/web/2022-09-01/webapps/id_slothostnamebinding.go @@ -127,11 +127,11 @@ func (id SlotHostNameBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHostNameBindings", "hostNameBindings", "hostNameBindings"), - resourceids.UserSpecifiedSegment("hostNameBindingName", "hostName"), + resourceids.UserSpecifiedSegment("hostNameBindingName", "hostNameBindingName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slothostnamebinding_test.go b/resource-manager/web/2022-09-01/webapps/id_slothostnamebinding_test.go index fa3cbece3e1..d0e372c31e3 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slothostnamebinding_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slothostnamebinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHostNameBindingId{} func TestNewSlotHostNameBindingID(t *testing.T) { - id := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") + id := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotHostNameBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HostNameBindingName != "hostName" { - t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostName") + if id.HostNameBindingName != "hostNameBindingName" { + t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostNameBindingName") } } func TestFormatSlotHostNameBindingID(t *testing.T) { - actual := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName" + actual := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotHostNameBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HostNameBindingName: "hostName", + SiteName: "siteName", + SlotName: "slotName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotHostNameBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HostNameBindingName: "hostName", + SiteName: "siteName", + SlotName: "slotName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS/hOsTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HostNameBindingName: "hOsTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HostNameBindingName: "hOsTnAmEbInDiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS/hOsTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slothybridconnection.go b/resource-manager/web/2022-09-01/webapps/id_slothybridconnection.go index 798ce3487e9..c5a95c89142 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slothybridconnection.go +++ b/resource-manager/web/2022-09-01/webapps/id_slothybridconnection.go @@ -127,11 +127,11 @@ func (id SlotHybridConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHybridConnection", "hybridConnection", "hybridConnection"), - resourceids.UserSpecifiedSegment("hybridConnectionName", "entityName"), + resourceids.UserSpecifiedSegment("hybridConnectionName", "hybridConnectionName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slothybridconnection_test.go b/resource-manager/web/2022-09-01/webapps/id_slothybridconnection_test.go index 93c812ff478..30653e42594 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slothybridconnection_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slothybridconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHybridConnectionId{} func TestNewSlotHybridConnectionID(t *testing.T) { - id := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") + id := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotHybridConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HybridConnectionName != "entityName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "entityName") + if id.HybridConnectionName != "hybridConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "hybridConnectionName") } } func TestFormatSlotHybridConnectionID(t *testing.T) { - actual := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName" + actual := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotHybridConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionName: "entityName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotHybridConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionName: "entityName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN/eNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HybridConnectionName: "eNtItYnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HybridConnectionName: "hYbRiDcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN/eNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slothybridconnectionnamespacerelay.go b/resource-manager/web/2022-09-01/webapps/id_slothybridconnectionnamespacerelay.go index a371c335ce1..f2a53e559e0 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slothybridconnectionnamespacerelay.go +++ b/resource-manager/web/2022-09-01/webapps/id_slothybridconnectionnamespacerelay.go @@ -133,11 +133,11 @@ func (id SlotHybridConnectionNamespaceRelayId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slothybridconnectionnamespacerelay_test.go b/resource-manager/web/2022-09-01/webapps/id_slothybridconnectionnamespacerelay_test.go index 1f6db182908..c668d1e93bc 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slothybridconnectionnamespacerelay_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slothybridconnectionnamespacerelay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHybridConnectionNamespaceRelayId{} func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { - id := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") + id := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -40,8 +40,8 @@ func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { } func TestFormatSlotHybridConnectionNamespaceRelayID(t *testing.T) { - actual := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotHybridConnectionNamespaceRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotHybridConnectionNamespaceRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotinstance.go b/resource-manager/web/2022-09-01/webapps/id_slotinstance.go index d381e0805a5..f6a4b514211 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotinstance.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotinstance.go @@ -127,9 +127,9 @@ func (id SlotInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotinstance_test.go b/resource-manager/web/2022-09-01/webapps/id_slotinstance_test.go index 0474185ff1a..2bd26deb6ee 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotinstance_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceId{} func TestNewSlotInstanceID(t *testing.T) { - id := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") + id := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -36,8 +36,8 @@ func TestNewSlotInstanceID(t *testing.T) { } func TestFormatSlotInstanceID(t *testing.T) { - actual := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId" + actual := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocess.go b/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocess.go index c4580926136..7459e303aab 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocess.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocess.go @@ -133,9 +133,9 @@ func (id SlotInstanceProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), diff --git a/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocess_test.go b/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocess_test.go index 414ffd27054..c10bc2a0fc1 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocess_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceProcessId{} func TestNewSlotInstanceProcessID(t *testing.T) { - id := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") + id := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -40,8 +40,8 @@ func TestNewSlotInstanceProcessID(t *testing.T) { } func TestFormatSlotInstanceProcessID(t *testing.T) { - actual := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId" + actual := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotInstanceProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotInstanceProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocessmodule.go b/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocessmodule.go index a8a8a21466b..ec90a897094 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocessmodule.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocessmodule.go @@ -139,15 +139,15 @@ func (id SlotInstanceProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocessmodule_test.go b/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocessmodule_test.go index db39b7040d2..109eb72ff25 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocessmodule_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotinstanceprocessmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceProcessModuleId{} func TestNewSlotInstanceProcessModuleID(t *testing.T) { - id := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress") + id := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -38,14 +38,14 @@ func TestNewSlotInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatSlotInstanceProcessModuleID(t *testing.T) { - actual := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress" + actual := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseSlotInstanceProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseSlotInstanceProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotnetworkfeature.go b/resource-manager/web/2022-09-01/webapps/id_slotnetworkfeature.go index 4001e74bc53..507114a0bf1 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotnetworkfeature.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotnetworkfeature.go @@ -127,11 +127,11 @@ func (id SlotNetworkFeatureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkFeatures", "networkFeatures", "networkFeatures"), - resourceids.UserSpecifiedSegment("networkFeatureName", "view"), + resourceids.UserSpecifiedSegment("networkFeatureName", "networkFeatureName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotnetworkfeature_test.go b/resource-manager/web/2022-09-01/webapps/id_slotnetworkfeature_test.go index 81f6d914134..3b0cebea96b 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotnetworkfeature_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotnetworkfeature_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotNetworkFeatureId{} func TestNewSlotNetworkFeatureID(t *testing.T) { - id := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view") + id := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotNetworkFeatureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.NetworkFeatureName != "view" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "view") + if id.NetworkFeatureName != "networkFeatureName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "networkFeatureName") } } func TestFormatSlotNetworkFeatureID(t *testing.T) { - actual := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view" + actual := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotNetworkFeatureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - NetworkFeatureName: "view", + SiteName: "siteName", + SlotName: "slotName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotNetworkFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - NetworkFeatureName: "view", + SiteName: "siteName", + SlotName: "slotName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs/vIeW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - NetworkFeatureName: "vIeW", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + NetworkFeatureName: "nEtWoRkFeAtUrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs/vIeW/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotnetworktrace.go b/resource-manager/web/2022-09-01/webapps/id_slotnetworktrace.go index 6bdb88e307e..4e4dd73328e 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotnetworktrace.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotnetworktrace.go @@ -127,9 +127,9 @@ func (id SlotNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkTrace", "networkTrace", "networkTrace"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotnetworktrace_test.go b/resource-manager/web/2022-09-01/webapps/id_slotnetworktrace_test.go index f15a990c005..ef938f160c3 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotnetworktrace_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotnetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotNetworkTraceId{} func TestNewSlotNetworkTraceID(t *testing.T) { - id := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") + id := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.OperationId != "operationId" { @@ -36,8 +36,8 @@ func TestNewSlotNetworkTraceID(t *testing.T) { } func TestFormatSlotNetworkTraceID(t *testing.T) { - actual := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId" + actual := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE/oPeRaTiOnId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotpremieraddon.go b/resource-manager/web/2022-09-01/webapps/id_slotpremieraddon.go index f5dc8ec000c..ca4498c2e93 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotpremieraddon.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotpremieraddon.go @@ -127,11 +127,11 @@ func (id SlotPremierAddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPremierAddons", "premierAddons", "premierAddons"), - resourceids.UserSpecifiedSegment("premierAddonName", "premierAddOnName"), + resourceids.UserSpecifiedSegment("premierAddonName", "premierAddonName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotpremieraddon_test.go b/resource-manager/web/2022-09-01/webapps/id_slotpremieraddon_test.go index abc889fbb30..c6094e0240f 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotpremieraddon_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotpremieraddon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPremierAddonId{} func TestNewSlotPremierAddonID(t *testing.T) { - id := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") + id := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotPremierAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.PremierAddonName != "premierAddOnName" { - t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddOnName") + if id.PremierAddonName != "premierAddonName" { + t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddonName") } } func TestFormatSlotPremierAddonID(t *testing.T) { - actual := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName" + actual := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPremierAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + SlotName: "slotName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPremierAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + SlotName: "slotName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs/pReMiErAdDoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PremierAddonName: "pReMiErAdDoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotprivateendpointconnection.go b/resource-manager/web/2022-09-01/webapps/id_slotprivateendpointconnection.go index 0038074356f..7a29bd7cb8b 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotprivateendpointconnection.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotprivateendpointconnection.go @@ -127,9 +127,9 @@ func (id SlotPrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotprivateendpointconnection_test.go b/resource-manager/web/2022-09-01/webapps/id_slotprivateendpointconnection_test.go index 0315e7236cd..b7c1bd2958c 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotprivateendpointconnection_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPrivateEndpointConnectionId{} func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { - id := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") + id := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -36,8 +36,8 @@ func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { } func TestFormatSlotPrivateEndpointConnectionID(t *testing.T) { - actual := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName" + actual := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotprocess.go b/resource-manager/web/2022-09-01/webapps/id_slotprocess.go index 731a1ee2e66..98487bec6fc 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotprocess.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotprocess.go @@ -127,9 +127,9 @@ func (id SlotProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotprocess_test.go b/resource-manager/web/2022-09-01/webapps/id_slotprocess_test.go index 147a7d6c37a..79324e032ca 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotprocess_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotProcessId{} func TestNewSlotProcessID(t *testing.T) { - id := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") + id := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ProcessId != "processId" { @@ -36,8 +36,8 @@ func TestNewSlotProcessID(t *testing.T) { } func TestFormatSlotProcessID(t *testing.T) { - actual := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId" + actual := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotpubliccertificate.go b/resource-manager/web/2022-09-01/webapps/id_slotpubliccertificate.go index ae44caa811b..45ded508c35 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotpubliccertificate.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotpubliccertificate.go @@ -127,9 +127,9 @@ func (id SlotPublicCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPublicCertificates", "publicCertificates", "publicCertificates"), resourceids.UserSpecifiedSegment("publicCertificateName", "publicCertificateName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotpubliccertificate_test.go b/resource-manager/web/2022-09-01/webapps/id_slotpubliccertificate_test.go index bb6c2deaa4c..31f3e81c0fb 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotpubliccertificate_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotpubliccertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPublicCertificateId{} func TestNewSlotPublicCertificateID(t *testing.T) { - id := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") + id := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotPublicCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.PublicCertificateName != "publicCertificateName" { @@ -36,8 +36,8 @@ func TestNewSlotPublicCertificateID(t *testing.T) { } func TestFormatSlotPublicCertificateID(t *testing.T) { - actual := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName" + actual := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPublicCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPublicCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PublicCertificateName: "pUbLiCcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotsiteextension.go b/resource-manager/web/2022-09-01/webapps/id_slotsiteextension.go index 7c1f34a4ad9..5df295c09ba 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotsiteextension.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotsiteextension.go @@ -127,9 +127,9 @@ func (id SlotSiteExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticSiteExtensions", "siteExtensions", "siteExtensions"), resourceids.UserSpecifiedSegment("siteExtensionId", "siteExtensionId"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotsiteextension_test.go b/resource-manager/web/2022-09-01/webapps/id_slotsiteextension_test.go index bfd22d9db4a..732d09fb195 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotsiteextension_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotsiteextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotSiteExtensionId{} func TestNewSlotSiteExtensionID(t *testing.T) { - id := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") + id := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotSiteExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.SiteExtensionId != "siteExtensionId" { @@ -36,8 +36,8 @@ func TestNewSlotSiteExtensionID(t *testing.T) { } func TestFormatSlotSiteExtensionID(t *testing.T) { - actual := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId" + actual := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotSiteExtensionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotSiteExtensionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS/sItEeXtEnSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", SiteExtensionId: "sItEeXtEnSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slottriggeredwebjob.go b/resource-manager/web/2022-09-01/webapps/id_slottriggeredwebjob.go index f28f3ec88d1..48ba81d16d3 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slottriggeredwebjob.go +++ b/resource-manager/web/2022-09-01/webapps/id_slottriggeredwebjob.go @@ -127,11 +127,11 @@ func (id SlotTriggeredWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slottriggeredwebjob_test.go b/resource-manager/web/2022-09-01/webapps/id_slottriggeredwebjob_test.go index 5fa0bda4915..c7f66afaa1e 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slottriggeredwebjob_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slottriggeredwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotTriggeredWebJobId{} func TestNewSlotTriggeredWebJobID(t *testing.T) { - id := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotTriggeredWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } } func TestFormatSlotTriggeredWebJobID(t *testing.T) { - actual := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName" + actual := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotTriggeredWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotTriggeredWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - TriggeredWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnection.go b/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnection.go index fccaab21b92..637d36cce57 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnection.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnection.go @@ -127,11 +127,11 @@ func (id SlotVirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnection_test.go b/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnection_test.go index e5b2487668b..623d47d5691 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnection_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotVirtualNetworkConnectionId{} func TestNewSlotVirtualNetworkConnectionID(t *testing.T) { - id := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") + id := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatSlotVirtualNetworkConnectionID(t *testing.T) { - actual := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName" + actual := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnectiongateway.go b/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnectiongateway.go index bf748a07cfc..8f808a13188 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnectiongateway.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnectiongateway.go @@ -133,11 +133,11 @@ func (id SlotVirtualNetworkConnectionGatewayId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go b/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go index c577c8452f4..34baec3c9ca 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotVirtualNetworkConnectionGatewayId{} func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { - id := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") + id := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -40,8 +40,8 @@ func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { } func TestFormatSlotVirtualNetworkConnectionGatewayID(t *testing.T) { - actual := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotVirtualNetworkConnectionGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotVirtualNetworkConnectionGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotwebjob.go b/resource-manager/web/2022-09-01/webapps/id_slotwebjob.go index 0c98bdee120..e9ea5bb00fb 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotwebjob.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotwebjob.go @@ -127,9 +127,9 @@ func (id SlotWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticWebJobs", "webJobs", "webJobs"), resourceids.UserSpecifiedSegment("webJobName", "webJobName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotwebjob_test.go b/resource-manager/web/2022-09-01/webapps/id_slotwebjob_test.go index cce85f520c8..66396ef164e 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotwebjob_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotWebJobId{} func TestNewSlotWebJobID(t *testing.T) { - id := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.WebJobName != "webJobName" { @@ -36,8 +36,8 @@ func TestNewSlotWebJobID(t *testing.T) { } func TestFormatSlotWebJobID(t *testing.T) { - actual := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName" + actual := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs/wEbJoBnAmE", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", WebJobName: "wEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs/wEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotworkflow.go b/resource-manager/web/2022-09-01/webapps/id_slotworkflow.go index dd9b29180f7..a14291749c9 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotworkflow.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotworkflow.go @@ -127,9 +127,9 @@ func (id SlotWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticWorkflows", "workflows", "workflows"), resourceids.UserSpecifiedSegment("workflowName", "workflowName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_slotworkflow_test.go b/resource-manager/web/2022-09-01/webapps/id_slotworkflow_test.go index 07f0fdb4bd4..dea7721f260 100644 --- a/resource-manager/web/2022-09-01/webapps/id_slotworkflow_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_slotworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotWorkflowId{} func TestNewSlotWorkflowID(t *testing.T) { - id := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName") + id := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewSlotWorkflowID(t *testing.T) { } func TestFormatSlotWorkflowID(t *testing.T) { - actual := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName" + actual := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs/wOrKfLoWnAmE", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_snapshot.go b/resource-manager/web/2022-09-01/webapps/id_snapshot.go index cbfb755361d..4d03d32a391 100644 --- a/resource-manager/web/2022-09-01/webapps/id_snapshot.go +++ b/resource-manager/web/2022-09-01/webapps/id_snapshot.go @@ -121,7 +121,7 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticWeb", "web", "web"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/web/2022-09-01/webapps/id_snapshot_test.go b/resource-manager/web/2022-09-01/webapps/id_snapshot_test.go index 13b12663c83..266ebd16516 100644 --- a/resource-manager/web/2022-09-01/webapps/id_snapshot_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.SnapshotId != "snapshotId" { @@ -32,8 +32,8 @@ func TestNewSnapshotID(t *testing.T) { } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", SnapshotId: "sNaPsHoTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_triggeredwebjob.go b/resource-manager/web/2022-09-01/webapps/id_triggeredwebjob.go index 81955b7012a..54e4277f8e3 100644 --- a/resource-manager/web/2022-09-01/webapps/id_triggeredwebjob.go +++ b/resource-manager/web/2022-09-01/webapps/id_triggeredwebjob.go @@ -121,9 +121,9 @@ func (id TriggeredWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_triggeredwebjob_test.go b/resource-manager/web/2022-09-01/webapps/id_triggeredwebjob_test.go index 6d4534988a4..f3a39e32c7e 100644 --- a/resource-manager/web/2022-09-01/webapps/id_triggeredwebjob_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_triggeredwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggeredWebJobId{} func TestNewTriggeredWebJobID(t *testing.T) { - id := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTriggeredWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } } func TestFormatTriggeredWebJobID(t *testing.T) { - actual := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName" + actual := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTriggeredWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTriggeredWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - TriggeredWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_triggeredwebjobhistory.go b/resource-manager/web/2022-09-01/webapps/id_triggeredwebjobhistory.go index e9fa5c35137..d43eee154da 100644 --- a/resource-manager/web/2022-09-01/webapps/id_triggeredwebjobhistory.go +++ b/resource-manager/web/2022-09-01/webapps/id_triggeredwebjobhistory.go @@ -133,13 +133,13 @@ func (id TriggeredWebJobHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), resourceids.StaticSegment("staticHistory", "history", "history"), - resourceids.UserSpecifiedSegment("historyName", "id"), + resourceids.UserSpecifiedSegment("historyName", "historyName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_triggeredwebjobhistory_test.go b/resource-manager/web/2022-09-01/webapps/id_triggeredwebjobhistory_test.go index b9f5366fbee..cf92a965a0a 100644 --- a/resource-manager/web/2022-09-01/webapps/id_triggeredwebjobhistory_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_triggeredwebjobhistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggeredWebJobHistoryId{} func TestNewTriggeredWebJobHistoryID(t *testing.T) { - id := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id") + id := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewTriggeredWebJobHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } - if id.HistoryName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "id") + if id.HistoryName != "historyName" { + t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "historyName") } } func TestFormatTriggeredWebJobHistoryID(t *testing.T) { - actual := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id" + actual := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggeredWebJobHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggeredWebJobHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - TriggeredWebJobName: "wEbJoBnAmE", - HistoryName: "iD", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", + HistoryName: "hIsToRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_virtualnetworkconnection.go b/resource-manager/web/2022-09-01/webapps/id_virtualnetworkconnection.go index cfa8b7c17da..0ddc9e9dbc9 100644 --- a/resource-manager/web/2022-09-01/webapps/id_virtualnetworkconnection.go +++ b/resource-manager/web/2022-09-01/webapps/id_virtualnetworkconnection.go @@ -121,9 +121,9 @@ func (id VirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2022-09-01/webapps/id_virtualnetworkconnection_test.go b/resource-manager/web/2022-09-01/webapps/id_virtualnetworkconnection_test.go index 3a30898c989..0696a175e00 100644 --- a/resource-manager/web/2022-09-01/webapps/id_virtualnetworkconnection_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_virtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkConnectionId{} func TestNewVirtualNetworkConnectionID(t *testing.T) { - id := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") + id := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatVirtualNetworkConnectionID(t *testing.T) { - actual := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName" + actual := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_webjob.go b/resource-manager/web/2022-09-01/webapps/id_webjob.go index b7a3e4b53e6..b79bed51622 100644 --- a/resource-manager/web/2022-09-01/webapps/id_webjob.go +++ b/resource-manager/web/2022-09-01/webapps/id_webjob.go @@ -121,7 +121,7 @@ func (id WebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticWebJobs", "webJobs", "webJobs"), resourceids.UserSpecifiedSegment("webJobName", "webJobName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_webjob_test.go b/resource-manager/web/2022-09-01/webapps/id_webjob_test.go index 485279bdb97..092af0c8a38 100644 --- a/resource-manager/web/2022-09-01/webapps/id_webjob_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_webjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebJobId{} func TestNewWebJobID(t *testing.T) { - id := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WebJobName != "webJobName" { @@ -32,8 +32,8 @@ func TestNewWebJobID(t *testing.T) { } func TestFormatWebJobID(t *testing.T) { - actual := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName" + actual := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs/wEbJoBnAmE", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WebJobName: "wEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs/wEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_websnapshot.go b/resource-manager/web/2022-09-01/webapps/id_websnapshot.go index f6bdfdba30b..f878f0869f5 100644 --- a/resource-manager/web/2022-09-01/webapps/id_websnapshot.go +++ b/resource-manager/web/2022-09-01/webapps/id_websnapshot.go @@ -127,9 +127,9 @@ func (id WebSnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticWeb", "web", "web"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/web/2022-09-01/webapps/id_websnapshot_test.go b/resource-manager/web/2022-09-01/webapps/id_websnapshot_test.go index 6c2e08093c4..b63a5759cb5 100644 --- a/resource-manager/web/2022-09-01/webapps/id_websnapshot_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_websnapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebSnapshotId{} func TestNewWebSnapshotID(t *testing.T) { - id := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") + id := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewWebSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.SnapshotId != "snapshotId" { @@ -36,8 +36,8 @@ func TestNewWebSnapshotID(t *testing.T) { } func TestFormatWebSnapshotID(t *testing.T) { - actual := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId" + actual := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseWebSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseWebSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", SnapshotId: "sNaPsHoTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_workflow.go b/resource-manager/web/2022-09-01/webapps/id_workflow.go index 61de52f6bbe..b0bd85b2a72 100644 --- a/resource-manager/web/2022-09-01/webapps/id_workflow.go +++ b/resource-manager/web/2022-09-01/webapps/id_workflow.go @@ -121,7 +121,7 @@ func (id WorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticWorkflows", "workflows", "workflows"), resourceids.UserSpecifiedSegment("workflowName", "workflowName"), } diff --git a/resource-manager/web/2022-09-01/webapps/id_workflow_test.go b/resource-manager/web/2022-09-01/webapps/id_workflow_test.go index ae2138b67c4..c687bb8ce0f 100644 --- a/resource-manager/web/2022-09-01/webapps/id_workflow_test.go +++ b/resource-manager/web/2022-09-01/webapps/id_workflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkflowId{} func TestNewWorkflowID(t *testing.T) { - id := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewWorkflowID(t *testing.T) { } func TestFormatWorkflowID(t *testing.T) { - actual := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName" + actual := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs/wOrKfLoWnAmE", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/method_createorupdatedomainownershipidentifier.go b/resource-manager/web/2022-09-01/webapps/method_createorupdatedomainownershipidentifier.go index 54114dd7cb9..cf70725a9a9 100644 --- a/resource-manager/web/2022-09-01/webapps/method_createorupdatedomainownershipidentifier.go +++ b/resource-manager/web/2022-09-01/webapps/method_createorupdatedomainownershipidentifier.go @@ -18,7 +18,7 @@ type CreateOrUpdateDomainOwnershipIdentifierOperationResponse struct { } // CreateOrUpdateDomainOwnershipIdentifier ... -func (c WebAppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId, input Identifier) (result CreateOrUpdateDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId, input Identifier) (result CreateOrUpdateDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2022-09-01/webapps/method_deletedomainownershipidentifier.go b/resource-manager/web/2022-09-01/webapps/method_deletedomainownershipidentifier.go index c170a9280d7..06a3c4983b6 100644 --- a/resource-manager/web/2022-09-01/webapps/method_deletedomainownershipidentifier.go +++ b/resource-manager/web/2022-09-01/webapps/method_deletedomainownershipidentifier.go @@ -17,7 +17,7 @@ type DeleteDomainOwnershipIdentifierOperationResponse struct { } // DeleteDomainOwnershipIdentifier ... -func (c WebAppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId) (result DeleteDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId) (result DeleteDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2022-09-01/webapps/method_getdomainownershipidentifier.go b/resource-manager/web/2022-09-01/webapps/method_getdomainownershipidentifier.go index 44658be8e1a..bc014922e27 100644 --- a/resource-manager/web/2022-09-01/webapps/method_getdomainownershipidentifier.go +++ b/resource-manager/web/2022-09-01/webapps/method_getdomainownershipidentifier.go @@ -18,7 +18,7 @@ type GetDomainOwnershipIdentifierOperationResponse struct { } // GetDomainOwnershipIdentifier ... -func (c WebAppsClient) GetDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId) (result GetDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) GetDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId) (result GetDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2022-09-01/webapps/method_startnetworktrace.go b/resource-manager/web/2022-09-01/webapps/method_startnetworktrace.go index de35cae8c37..3b1246a0d11 100644 --- a/resource-manager/web/2022-09-01/webapps/method_startnetworktrace.go +++ b/resource-manager/web/2022-09-01/webapps/method_startnetworktrace.go @@ -25,7 +25,7 @@ type StartNetworkTraceOperationResponse struct { type StartNetworkTraceOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartNetworkTraceOperationOptions() StartNetworkTraceOperationOptions { @@ -52,8 +52,8 @@ func (o StartNetworkTraceOperationOptions) ToQuery() *client.QueryParams { if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2022-09-01/webapps/method_startnetworktraceslot.go b/resource-manager/web/2022-09-01/webapps/method_startnetworktraceslot.go index f4ecbb2878c..72c280deeef 100644 --- a/resource-manager/web/2022-09-01/webapps/method_startnetworktraceslot.go +++ b/resource-manager/web/2022-09-01/webapps/method_startnetworktraceslot.go @@ -24,7 +24,7 @@ type StartNetworkTraceSlotOperationResponse struct { type StartNetworkTraceSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartNetworkTraceSlotOperationOptions() StartNetworkTraceSlotOperationOptions { @@ -51,8 +51,8 @@ func (o StartNetworkTraceSlotOperationOptions) ToQuery() *client.QueryParams { if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktrace.go b/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktrace.go index c4aceaac67a..0feb53df65b 100644 --- a/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktrace.go +++ b/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktrace.go @@ -22,7 +22,7 @@ type StartWebSiteNetworkTraceOperationResponse struct { type StartWebSiteNetworkTraceOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationOptions() StartWebSiteNetworkTraceOperationOptions { @@ -49,8 +49,8 @@ func (o StartWebSiteNetworkTraceOperationOptions) ToQuery() *client.QueryParams if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceoperation.go b/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceoperation.go index c2f83e72964..1a67be6cba1 100644 --- a/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceoperation.go +++ b/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceoperation.go @@ -25,7 +25,7 @@ type StartWebSiteNetworkTraceOperationOperationResponse struct { type StartWebSiteNetworkTraceOperationOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationOperationOptions() StartWebSiteNetworkTraceOperationOperationOptions { @@ -52,8 +52,8 @@ func (o StartWebSiteNetworkTraceOperationOperationOptions) ToQuery() *client.Que if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceoperationslot.go b/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceoperationslot.go index ceb485a4310..90f4cda8f0d 100644 --- a/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceoperationslot.go +++ b/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceoperationslot.go @@ -24,7 +24,7 @@ type StartWebSiteNetworkTraceOperationSlotOperationResponse struct { type StartWebSiteNetworkTraceOperationSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationSlotOperationOptions() StartWebSiteNetworkTraceOperationSlotOperationOptions { @@ -51,8 +51,8 @@ func (o StartWebSiteNetworkTraceOperationSlotOperationOptions) ToQuery() *client if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceslot.go b/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceslot.go index 488181959e2..10467c0eda1 100644 --- a/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceslot.go +++ b/resource-manager/web/2022-09-01/webapps/method_startwebsitenetworktraceslot.go @@ -21,7 +21,7 @@ type StartWebSiteNetworkTraceSlotOperationResponse struct { type StartWebSiteNetworkTraceSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceSlotOperationOptions() StartWebSiteNetworkTraceSlotOperationOptions { @@ -48,8 +48,8 @@ func (o StartWebSiteNetworkTraceSlotOperationOptions) ToQuery() *client.QueryPar if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2022-09-01/webapps/method_updatedomainownershipidentifier.go b/resource-manager/web/2022-09-01/webapps/method_updatedomainownershipidentifier.go index e9926b92e04..8bb087cd8f8 100644 --- a/resource-manager/web/2022-09-01/webapps/method_updatedomainownershipidentifier.go +++ b/resource-manager/web/2022-09-01/webapps/method_updatedomainownershipidentifier.go @@ -18,7 +18,7 @@ type UpdateDomainOwnershipIdentifierOperationResponse struct { } // UpdateDomainOwnershipIdentifier ... -func (c WebAppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId, input Identifier) (result UpdateDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId, input Identifier) (result UpdateDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2022-09-01/webapps/model_azureblobstorageapplicationlogsconfig.go b/resource-manager/web/2022-09-01/webapps/model_azureblobstorageapplicationlogsconfig.go index d17b5f8ddb1..37a7b27b3e9 100644 --- a/resource-manager/web/2022-09-01/webapps/model_azureblobstorageapplicationlogsconfig.go +++ b/resource-manager/web/2022-09-01/webapps/model_azureblobstorageapplicationlogsconfig.go @@ -6,5 +6,5 @@ package webapps type AzureBlobStorageApplicationLogsConfig struct { Level *LogLevel `json:"level,omitempty"` RetentionInDays *int64 `json:"retentionInDays,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_azureblobstoragehttplogsconfig.go b/resource-manager/web/2022-09-01/webapps/model_azureblobstoragehttplogsconfig.go index 4bafbbd06e5..74820c0d5ac 100644 --- a/resource-manager/web/2022-09-01/webapps/model_azureblobstoragehttplogsconfig.go +++ b/resource-manager/web/2022-09-01/webapps/model_azureblobstoragehttplogsconfig.go @@ -6,5 +6,5 @@ package webapps type AzureBlobStorageHTTPLogsConfig struct { Enabled *bool `json:"enabled,omitempty"` RetentionInDays *int64 `json:"retentionInDays,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_azuretablestorageapplicationlogsconfig.go b/resource-manager/web/2022-09-01/webapps/model_azuretablestorageapplicationlogsconfig.go index 6a87bfc0dc9..8d8ca355fe4 100644 --- a/resource-manager/web/2022-09-01/webapps/model_azuretablestorageapplicationlogsconfig.go +++ b/resource-manager/web/2022-09-01/webapps/model_azuretablestorageapplicationlogsconfig.go @@ -5,5 +5,5 @@ package webapps type AzureTableStorageApplicationLogsConfig struct { Level *LogLevel `json:"level,omitempty"` - SasUrl string `json:"sasUrl"` + SasURL string `json:"sasUrl"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_backupitemproperties.go b/resource-manager/web/2022-09-01/webapps/model_backupitemproperties.go index 577e4eb1a23..b74153eec80 100644 --- a/resource-manager/web/2022-09-01/webapps/model_backupitemproperties.go +++ b/resource-manager/web/2022-09-01/webapps/model_backupitemproperties.go @@ -22,7 +22,7 @@ type BackupItemProperties struct { Scheduled *bool `json:"scheduled,omitempty"` SizeInBytes *int64 `json:"sizeInBytes,omitempty"` Status *BackupItemStatus `json:"status,omitempty"` - StorageAccountUrl *string `json:"storageAccountUrl,omitempty"` + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` WebsiteSizeInBytes *int64 `json:"websiteSizeInBytes,omitempty"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_backuprequestproperties.go b/resource-manager/web/2022-09-01/webapps/model_backuprequestproperties.go index 8a3f52e475f..0d0229d8c83 100644 --- a/resource-manager/web/2022-09-01/webapps/model_backuprequestproperties.go +++ b/resource-manager/web/2022-09-01/webapps/model_backuprequestproperties.go @@ -8,5 +8,5 @@ type BackupRequestProperties struct { BackupSchedule *BackupSchedule `json:"backupSchedule,omitempty"` Databases *[]DatabaseBackupSetting `json:"databases,omitempty"` Enabled *bool `json:"enabled,omitempty"` - StorageAccountUrl string `json:"storageAccountUrl"` + StorageAccountURL string `json:"storageAccountUrl"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_blobstoragetokenstore.go b/resource-manager/web/2022-09-01/webapps/model_blobstoragetokenstore.go index 002a55f2dad..2cbf67fbeae 100644 --- a/resource-manager/web/2022-09-01/webapps/model_blobstoragetokenstore.go +++ b/resource-manager/web/2022-09-01/webapps/model_blobstoragetokenstore.go @@ -4,5 +4,5 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type BlobStorageTokenStore struct { - SasUrlSettingName *string `json:"sasUrlSettingName,omitempty"` + SasURLSettingName *string `json:"sasUrlSettingName,omitempty"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_githubactioncontainerconfiguration.go b/resource-manager/web/2022-09-01/webapps/model_githubactioncontainerconfiguration.go index 0eb95a29ffb..db70b234959 100644 --- a/resource-manager/web/2022-09-01/webapps/model_githubactioncontainerconfiguration.go +++ b/resource-manager/web/2022-09-01/webapps/model_githubactioncontainerconfiguration.go @@ -6,6 +6,6 @@ package webapps type GitHubActionContainerConfiguration struct { ImageName *string `json:"imageName,omitempty"` Password *string `json:"password,omitempty"` - ServerUrl *string `json:"serverUrl,omitempty"` + ServerURL *string `json:"serverUrl,omitempty"` Username *string `json:"username,omitempty"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_login.go b/resource-manager/web/2022-09-01/webapps/model_login.go index a8fee3b25d9..3e8e040d421 100644 --- a/resource-manager/web/2022-09-01/webapps/model_login.go +++ b/resource-manager/web/2022-09-01/webapps/model_login.go @@ -4,10 +4,10 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Login struct { - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` CookieExpiration *CookieExpiration `json:"cookieExpiration,omitempty"` Nonce *Nonce `json:"nonce,omitempty"` - PreserveUrlFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` + PreserveURLFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` Routes *LoginRoutes `json:"routes,omitempty"` TokenStore *TokenStore `json:"tokenStore,omitempty"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_rampuprule.go b/resource-manager/web/2022-09-01/webapps/model_rampuprule.go index a99e19c5085..2688d09f601 100644 --- a/resource-manager/web/2022-09-01/webapps/model_rampuprule.go +++ b/resource-manager/web/2022-09-01/webapps/model_rampuprule.go @@ -5,7 +5,7 @@ package webapps type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2022-09-01/webapps/model_restorerequestproperties.go b/resource-manager/web/2022-09-01/webapps/model_restorerequestproperties.go index d352f67f61b..ea35e477253 100644 --- a/resource-manager/web/2022-09-01/webapps/model_restorerequestproperties.go +++ b/resource-manager/web/2022-09-01/webapps/model_restorerequestproperties.go @@ -14,5 +14,5 @@ type RestoreRequestProperties struct { OperationType *BackupRestoreOperationType `json:"operationType,omitempty"` Overwrite bool `json:"overwrite"` SiteName *string `json:"siteName,omitempty"` - StorageAccountUrl string `json:"storageAccountUrl"` + StorageAccountURL string `json:"storageAccountUrl"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_siteauthsettingsproperties.go b/resource-manager/web/2022-09-01/webapps/model_siteauthsettingsproperties.go index 46d05a77881..7ad71ad2704 100644 --- a/resource-manager/web/2022-09-01/webapps/model_siteauthsettingsproperties.go +++ b/resource-manager/web/2022-09-01/webapps/model_siteauthsettingsproperties.go @@ -7,7 +7,7 @@ type SiteAuthSettingsProperties struct { AadClaimsAuthorization *string `json:"aadClaimsAuthorization,omitempty"` AdditionalLoginParams *[]string `json:"additionalLoginParams,omitempty"` AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` AuthFilePath *string `json:"authFilePath,omitempty"` ClientId *string `json:"clientId,omitempty"` ClientSecret *string `json:"clientSecret,omitempty"` diff --git a/resource-manager/web/2022-09-01/webapps/model_sitesourcecontrolproperties.go b/resource-manager/web/2022-09-01/webapps/model_sitesourcecontrolproperties.go index f19c33a2a34..9634590165d 100644 --- a/resource-manager/web/2022-09-01/webapps/model_sitesourcecontrolproperties.go +++ b/resource-manager/web/2022-09-01/webapps/model_sitesourcecontrolproperties.go @@ -10,5 +10,5 @@ type SiteSourceControlProperties struct { IsGitHubAction *bool `json:"isGitHubAction,omitempty"` IsManualIntegration *bool `json:"isManualIntegration,omitempty"` IsMercurial *bool `json:"isMercurial,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` } diff --git a/resource-manager/web/2022-09-01/webapps/model_websiteinstancestatusproperties.go b/resource-manager/web/2022-09-01/webapps/model_websiteinstancestatusproperties.go index fac5b723630..f276d7e8f05 100644 --- a/resource-manager/web/2022-09-01/webapps/model_websiteinstancestatusproperties.go +++ b/resource-manager/web/2022-09-01/webapps/model_websiteinstancestatusproperties.go @@ -4,10 +4,10 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WebSiteInstanceStatusProperties struct { - ConsoleUrl *string `json:"consoleUrl,omitempty"` + ConsoleURL *string `json:"consoleUrl,omitempty"` Containers *map[string]ContainerInfo `json:"containers,omitempty"` - DetectorUrl *string `json:"detectorUrl,omitempty"` - HealthCheckUrl *string `json:"healthCheckUrl,omitempty"` + DetectorURL *string `json:"detectorUrl,omitempty"` + HealthCheckURL *string `json:"healthCheckUrl,omitempty"` State *SiteRuntimeState `json:"state,omitempty"` - StatusUrl *string `json:"statusUrl,omitempty"` + StatusURL *string `json:"statusUrl,omitempty"` } diff --git a/resource-manager/web/2022-09-01/workflowrunactions/README.md b/resource-manager/web/2022-09-01/workflowrunactions/README.md index 770264a3a18..5fe9cbfb778 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/README.md +++ b/resource-manager/web/2022-09-01/workflowrunactions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowrunactions.NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName") read, err := client.CopeRepetitionsGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.CopeRepetitionsList(ctx, id)` can be used to do batched pagination items, err := client.CopeRepetitionsListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowrunactions.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") // alternatively `client.List(ctx, id, workflowrunactions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowrunactions.DefaultListOperationOptions()) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.ListExpressionTraces(ctx, id)` can be used to do batched pagination items, err := client.ListExpressionTracesComplete(ctx, id) @@ -107,7 +107,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") read, err := client.WorkflowRunActionRepetitionsGet(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.WorkflowRunActionRepetitionsList(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsListComplete(ctx, id) @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") // alternatively `client.WorkflowRunActionRepetitionsListExpressionTraces(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsListExpressionTracesComplete(ctx, id) @@ -157,7 +157,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") +id := workflowrunactions.NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") read, err := client.WorkflowRunActionRepetitionsRequestHistoriesGet(ctx, id) if err != nil { @@ -173,7 +173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") // alternatively `client.WorkflowRunActionRepetitionsRequestHistoriesList(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsRequestHistoriesListComplete(ctx, id) diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_action.go b/resource-manager/web/2022-09-01/workflowrunactions/id_action.go index 33762ac4650..d8931531676 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_action.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_action.go @@ -133,7 +133,7 @@ func (id ActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_action_test.go b/resource-manager/web/2022-09-01/workflowrunactions/id_action_test.go index 66b951f306b..1a7cdb61b0c 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_action_test.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_action_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ActionId{} func TestNewActionID(t *testing.T) { - id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") + id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewActionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -40,8 +40,8 @@ func TestNewActionID(t *testing.T) { } func TestFormatActionID(t *testing.T) { - actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName" + actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,71 +95,71 @@ func TestParseActionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -167,7 +167,7 @@ func TestParseActionID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", Error: true, }, } @@ -296,131 +296,131 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -428,16 +428,16 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -445,7 +445,7 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_repetition.go b/resource-manager/web/2022-09-01/workflowrunactions/id_repetition.go index 086a2886207..eea587301e1 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_repetition.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_repetition.go @@ -139,7 +139,7 @@ func (id RepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_repetition_test.go b/resource-manager/web/2022-09-01/workflowrunactions/id_repetition_test.go index 5eaac6da4b7..9b2f3157fe9 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_repetition_test.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_repetition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RepetitionId{} func TestNewRepetitionID(t *testing.T) { - id := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") + id := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -44,8 +44,8 @@ func TestNewRepetitionID(t *testing.T) { } func TestFormatRepetitionID(t *testing.T) { - actual := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName" + actual := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,81 +99,81 @@ func TestParseRepetitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -182,7 +182,7 @@ func TestParseRepetitionID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", Error: true, }, } @@ -315,151 +315,151 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -468,16 +468,16 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -486,7 +486,7 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_requesthistory.go b/resource-manager/web/2022-09-01/workflowrunactions/id_requesthistory.go index f8185100bb8..d15a9523fb5 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_requesthistory.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_requesthistory.go @@ -145,7 +145,7 @@ func (id RequestHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_requesthistory_test.go b/resource-manager/web/2022-09-01/workflowrunactions/id_requesthistory_test.go index c90f9e01823..170be7c8e38 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_requesthistory_test.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_requesthistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RequestHistoryId{} func TestNewRequestHistoryID(t *testing.T) { - id := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") + id := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRequestHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -48,8 +48,8 @@ func TestNewRequestHistoryID(t *testing.T) { } func TestFormatRequestHistoryID(t *testing.T) { - actual := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName" + actual := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -103,91 +103,91 @@ func TestParseRequestHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -197,7 +197,7 @@ func TestParseRequestHistoryID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", Error: true, }, } @@ -334,171 +334,171 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -508,16 +508,16 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -527,7 +527,7 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_run.go b/resource-manager/web/2022-09-01/workflowrunactions/id_run.go index e2ca4c816ca..50398640cd1 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_run.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_run.go @@ -127,7 +127,7 @@ func (id RunId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_run_test.go b/resource-manager/web/2022-09-01/workflowrunactions/id_run_test.go index d5624eb4cef..5b5fc911ae0 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_run_test.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_run_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RunId{} func TestNewRunID(t *testing.T) { - id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") + id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRunID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewRunID(t *testing.T) { } func TestFormatRunID(t *testing.T) { - actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" + actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseRunID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseRunIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_scoperepetition.go b/resource-manager/web/2022-09-01/workflowrunactions/id_scoperepetition.go index 8582cd7f9ec..0e6e953b99e 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_scoperepetition.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_scoperepetition.go @@ -139,7 +139,7 @@ func (id ScopeRepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), @@ -153,7 +153,7 @@ func (id ScopeRepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticActions", "actions", "actions"), resourceids.UserSpecifiedSegment("actionName", "actionName"), resourceids.StaticSegment("staticScopeRepetitions", "scopeRepetitions", "scopeRepetitions"), - resourceids.UserSpecifiedSegment("scopeRepetitionName", "repetitionName"), + resourceids.UserSpecifiedSegment("scopeRepetitionName", "scopeRepetitionName"), } } diff --git a/resource-manager/web/2022-09-01/workflowrunactions/id_scoperepetition_test.go b/resource-manager/web/2022-09-01/workflowrunactions/id_scoperepetition_test.go index 6739a64f8b6..0b1db9c0160 100644 --- a/resource-manager/web/2022-09-01/workflowrunactions/id_scoperepetition_test.go +++ b/resource-manager/web/2022-09-01/workflowrunactions/id_scoperepetition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScopeRepetitionId{} func TestNewScopeRepetitionID(t *testing.T) { - id := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") + id := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewScopeRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -38,14 +38,14 @@ func TestNewScopeRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ActionName'", id.ActionName, "actionName") } - if id.ScopeRepetitionName != "repetitionName" { - t.Fatalf("Expected %q but got %q for Segment 'ScopeRepetitionName'", id.ScopeRepetitionName, "repetitionName") + if id.ScopeRepetitionName != "scopeRepetitionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScopeRepetitionName'", id.ScopeRepetitionName, "scopeRepetitionName") } } func TestFormatScopeRepetitionID(t *testing.T) { - actual := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName" + actual := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,90 +99,90 @@ func TestParseScopeRepetitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", - ScopeRepetitionName: "repetitionName", + ScopeRepetitionName: "scopeRepetitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName/extra", Error: true, }, } @@ -315,178 +315,178 @@ func TestParseScopeRepetitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", - ScopeRepetitionName: "repetitionName", + ScopeRepetitionName: "scopeRepetitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/sCoPeRePeTiTiOnNaMe", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", - ScopeRepetitionName: "rEpEtItIoNnAmE", + ScopeRepetitionName: "sCoPeRePeTiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/rEpEtItIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/sCoPeRePeTiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowruns/README.md b/resource-manager/web/2022-09-01/workflowruns/README.md index bbd9a4a7830..4160a970d1c 100644 --- a/resource-manager/web/2022-09-01/workflowruns/README.md +++ b/resource-manager/web/2022-09-01/workflowruns/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") read, err := client.Cancel(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowruns.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowruns.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowruns.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowruns.DefaultListOperationOptions()) diff --git a/resource-manager/web/2022-09-01/workflowruns/id_managementworkflow.go b/resource-manager/web/2022-09-01/workflowruns/id_managementworkflow.go index 2cb6856b6ec..b87857c4e6f 100644 --- a/resource-manager/web/2022-09-01/workflowruns/id_managementworkflow.go +++ b/resource-manager/web/2022-09-01/workflowruns/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowruns/id_managementworkflow_test.go b/resource-manager/web/2022-09-01/workflowruns/id_managementworkflow_test.go index 4a9b2de9f46..5895776d52c 100644 --- a/resource-manager/web/2022-09-01/workflowruns/id_managementworkflow_test.go +++ b/resource-manager/web/2022-09-01/workflowruns/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowruns/id_run.go b/resource-manager/web/2022-09-01/workflowruns/id_run.go index cbecca55f3c..968133f5c51 100644 --- a/resource-manager/web/2022-09-01/workflowruns/id_run.go +++ b/resource-manager/web/2022-09-01/workflowruns/id_run.go @@ -127,7 +127,7 @@ func (id RunId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowruns/id_run_test.go b/resource-manager/web/2022-09-01/workflowruns/id_run_test.go index a7fb428b8c2..abacc74a502 100644 --- a/resource-manager/web/2022-09-01/workflowruns/id_run_test.go +++ b/resource-manager/web/2022-09-01/workflowruns/id_run_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RunId{} func TestNewRunID(t *testing.T) { - id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") + id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRunID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewRunID(t *testing.T) { } func TestFormatRunID(t *testing.T) { - actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" + actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseRunID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseRunIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflows/README.md b/resource-manager/web/2022-09-01/workflows/README.md index 17dd7169872..bbc2a9c03e6 100644 --- a/resource-manager/web/2022-09-01/workflows/README.md +++ b/resource-manager/web/2022-09-01/workflows/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") payload := workflows.RegenerateActionParameter{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") payload := workflows.Workflow{ // ... diff --git a/resource-manager/web/2022-09-01/workflows/id_managementworkflow.go b/resource-manager/web/2022-09-01/workflows/id_managementworkflow.go index 7a774f3c589..47ad1eb715b 100644 --- a/resource-manager/web/2022-09-01/workflows/id_managementworkflow.go +++ b/resource-manager/web/2022-09-01/workflows/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflows/id_managementworkflow_test.go b/resource-manager/web/2022-09-01/workflows/id_managementworkflow_test.go index 8240e4e7088..8499136fb32 100644 --- a/resource-manager/web/2022-09-01/workflows/id_managementworkflow_test.go +++ b/resource-manager/web/2022-09-01/workflows/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowtriggerhistories/README.md b/resource-manager/web/2022-09-01/workflowtriggerhistories/README.md index a13eea13632..2050b47f6f1 100644 --- a/resource-manager/web/2022-09-01/workflowtriggerhistories/README.md +++ b/resource-manager/web/2022-09-01/workflowtriggerhistories/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") +id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggerhistories.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") // alternatively `client.List(ctx, id, workflowtriggerhistories.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowtriggerhistories.DefaultListOperationOptions()) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") +id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") if err := client.ResubmitThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/web/2022-09-01/workflowtriggerhistories/id_trigger.go b/resource-manager/web/2022-09-01/workflowtriggerhistories/id_trigger.go index 7746c2047d8..185a7964307 100644 --- a/resource-manager/web/2022-09-01/workflowtriggerhistories/id_trigger.go +++ b/resource-manager/web/2022-09-01/workflowtriggerhistories/id_trigger.go @@ -127,7 +127,7 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowtriggerhistories/id_trigger_test.go b/resource-manager/web/2022-09-01/workflowtriggerhistories/id_trigger_test.go index dd1a3ca80d4..a7e902f354d 100644 --- a/resource-manager/web/2022-09-01/workflowtriggerhistories/id_trigger_test.go +++ b/resource-manager/web/2022-09-01/workflowtriggerhistories/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowtriggerhistories/id_triggerhistory.go b/resource-manager/web/2022-09-01/workflowtriggerhistories/id_triggerhistory.go index f5391b27c47..248b48c2216 100644 --- a/resource-manager/web/2022-09-01/workflowtriggerhistories/id_triggerhistory.go +++ b/resource-manager/web/2022-09-01/workflowtriggerhistories/id_triggerhistory.go @@ -133,7 +133,7 @@ func (id TriggerHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowtriggerhistories/id_triggerhistory_test.go b/resource-manager/web/2022-09-01/workflowtriggerhistories/id_triggerhistory_test.go index bf48a873df6..9acaaf52faa 100644 --- a/resource-manager/web/2022-09-01/workflowtriggerhistories/id_triggerhistory_test.go +++ b/resource-manager/web/2022-09-01/workflowtriggerhistories/id_triggerhistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerHistoryId{} func TestNewTriggerHistoryID(t *testing.T) { - id := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") + id := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -40,8 +40,8 @@ func TestNewTriggerHistoryID(t *testing.T) { } func TestFormatTriggerHistoryID(t *testing.T) { - actual := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName" + actual := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,71 +95,71 @@ func TestParseTriggerHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", HistoryName: "historyName", @@ -167,7 +167,7 @@ func TestParseTriggerHistoryID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", Error: true, }, } @@ -296,131 +296,131 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", HistoryName: "historyName", @@ -428,16 +428,16 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", HistoryName: "hIsToRyNaMe", @@ -445,7 +445,7 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowtriggers/README.md b/resource-manager/web/2022-09-01/workflowtriggers/README.md index ab3394a77ee..b329748f2a6 100644 --- a/resource-manager/web/2022-09-01/workflowtriggers/README.md +++ b/resource-manager/web/2022-09-01/workflowtriggers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") read, err := client.GetSchemaJson(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowtriggers.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowtriggers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowtriggers.DefaultListOperationOptions()) @@ -69,13 +69,13 @@ for _, item := range items { ``` -### Example Usage: `WorkflowTriggersClient.ListCallbackUrl` +### Example Usage: `WorkflowTriggersClient.ListCallbackURL` ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") -read, err := client.ListCallbackUrl(ctx, id) +read, err := client.ListCallbackURL(ctx, id) if err != nil { // handle the error } @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if err := client.RunThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/web/2022-09-01/workflowtriggers/id_managementworkflow.go b/resource-manager/web/2022-09-01/workflowtriggers/id_managementworkflow.go index 192d552a278..7f55952af52 100644 --- a/resource-manager/web/2022-09-01/workflowtriggers/id_managementworkflow.go +++ b/resource-manager/web/2022-09-01/workflowtriggers/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowtriggers/id_managementworkflow_test.go b/resource-manager/web/2022-09-01/workflowtriggers/id_managementworkflow_test.go index 9eed841e8fe..1ca968f9de0 100644 --- a/resource-manager/web/2022-09-01/workflowtriggers/id_managementworkflow_test.go +++ b/resource-manager/web/2022-09-01/workflowtriggers/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowtriggers/id_trigger.go b/resource-manager/web/2022-09-01/workflowtriggers/id_trigger.go index e25ae7dccb1..3980bdfb0bc 100644 --- a/resource-manager/web/2022-09-01/workflowtriggers/id_trigger.go +++ b/resource-manager/web/2022-09-01/workflowtriggers/id_trigger.go @@ -127,7 +127,7 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowtriggers/id_trigger_test.go b/resource-manager/web/2022-09-01/workflowtriggers/id_trigger_test.go index 094cc4fce14..c101bbec5e7 100644 --- a/resource-manager/web/2022-09-01/workflowtriggers/id_trigger_test.go +++ b/resource-manager/web/2022-09-01/workflowtriggers/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowtriggers/method_listcallbackurl.go b/resource-manager/web/2022-09-01/workflowtriggers/method_listcallbackurl.go index 7e44f7f9763..4fa4045250d 100644 --- a/resource-manager/web/2022-09-01/workflowtriggers/method_listcallbackurl.go +++ b/resource-manager/web/2022-09-01/workflowtriggers/method_listcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListCallbackUrlOperationResponse struct { +type ListCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListCallbackUrl ... -func (c WorkflowTriggersClient) ListCallbackUrl(ctx context.Context, id TriggerId) (result ListCallbackUrlOperationResponse, err error) { +// ListCallbackURL ... +func (c WorkflowTriggersClient) ListCallbackURL(ctx context.Context, id TriggerId) (result ListCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c WorkflowTriggersClient) ListCallbackUrl(ctx context.Context, id TriggerI return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/web/2022-09-01/workflowtriggers/model_workflowtriggercallbackurl.go b/resource-manager/web/2022-09-01/workflowtriggers/model_workflowtriggercallbackurl.go index fd5a9082bd7..710a39b43aa 100644 --- a/resource-manager/web/2022-09-01/workflowtriggers/model_workflowtriggercallbackurl.go +++ b/resource-manager/web/2022-09-01/workflowtriggers/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package workflowtriggers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/web/2022-09-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/web/2022-09-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go index cc3b231968b..f4e969fd7ab 100644 --- a/resource-manager/web/2022-09-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/web/2022-09-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package workflowtriggers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/web/2022-09-01/workflowversions/README.md b/resource-manager/web/2022-09-01/workflowversions/README.md index 10038fced27..a4dad5ab967 100644 --- a/resource-manager/web/2022-09-01/workflowversions/README.md +++ b/resource-manager/web/2022-09-01/workflowversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId") +id := workflowversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowversions.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowversions.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowversions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowversions.DefaultListOperationOptions()) diff --git a/resource-manager/web/2022-09-01/workflowversions/id_managementworkflow.go b/resource-manager/web/2022-09-01/workflowversions/id_managementworkflow.go index 3c4187d53f9..29c5ebda9ab 100644 --- a/resource-manager/web/2022-09-01/workflowversions/id_managementworkflow.go +++ b/resource-manager/web/2022-09-01/workflowversions/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowversions/id_managementworkflow_test.go b/resource-manager/web/2022-09-01/workflowversions/id_managementworkflow_test.go index f90f2845f58..fb252bd145e 100644 --- a/resource-manager/web/2022-09-01/workflowversions/id_managementworkflow_test.go +++ b/resource-manager/web/2022-09-01/workflowversions/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/workflowversions/id_version.go b/resource-manager/web/2022-09-01/workflowversions/id_version.go index 03a60370e12..d1585eebfb1 100644 --- a/resource-manager/web/2022-09-01/workflowversions/id_version.go +++ b/resource-manager/web/2022-09-01/workflowversions/id_version.go @@ -127,7 +127,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2022-09-01/workflowversions/id_version_test.go b/resource-manager/web/2022-09-01/workflowversions/id_version_test.go index 232182dab8d..5398d232c03 100644 --- a/resource-manager/web/2022-09-01/workflowversions/id_version_test.go +++ b/resource-manager/web/2022-09-01/workflowversions/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewVersionID(t *testing.T) { } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", VersionId: "versionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", VersionId: "versionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", VersionId: "vErSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appservicecertificateorders/README.md b/resource-manager/web/2023-01-01/appservicecertificateorders/README.md index 6b58d2232b5..e943c9ab2d1 100644 --- a/resource-manager/web/2023-01-01/appservicecertificateorders/README.md +++ b/resource-manager/web/2023-01-01/appservicecertificateorders/README.md @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") payload := appservicecertificateorders.AppServiceCertificateResource{ // ... @@ -75,7 +75,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") read, err := client.DeleteCertificate(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") read, err := client.GetCertificate(ctx, id) if err != nil { @@ -327,7 +327,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") payload := appservicecertificateorders.AppServiceCertificatePatchResource{ // ... diff --git a/resource-manager/web/2022-09-01/appservicecertificateorders/id_certificate.go b/resource-manager/web/2023-01-01/appservicecertificateorders/id_certificateordercertificate.go similarity index 62% rename from resource-manager/web/2022-09-01/appservicecertificateorders/id_certificate.go rename to resource-manager/web/2023-01-01/appservicecertificateorders/id_certificateordercertificate.go index b68393bf88f..91835e730de 100644 --- a/resource-manager/web/2022-09-01/appservicecertificateorders/id_certificate.go +++ b/resource-manager/web/2023-01-01/appservicecertificateorders/id_certificateordercertificate.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&CertificateId{}) + recaser.RegisterResourceId(&CertificateOrderCertificateId{}) } -var _ resourceids.ResourceId = &CertificateId{} +var _ resourceids.ResourceId = &CertificateOrderCertificateId{} -// CertificateId is a struct representing the Resource ID for a Certificate -type CertificateId struct { +// CertificateOrderCertificateId is a struct representing the Resource ID for a Certificate Order Certificate +type CertificateOrderCertificateId struct { SubscriptionId string ResourceGroupName string CertificateOrderName string CertificateName string } -// NewCertificateID returns a new CertificateId struct -func NewCertificateID(subscriptionId string, resourceGroupName string, certificateOrderName string, certificateName string) CertificateId { - return CertificateId{ +// NewCertificateOrderCertificateID returns a new CertificateOrderCertificateId struct +func NewCertificateOrderCertificateID(subscriptionId string, resourceGroupName string, certificateOrderName string, certificateName string) CertificateOrderCertificateId { + return CertificateOrderCertificateId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, CertificateOrderName: certificateOrderName, @@ -35,15 +35,15 @@ func NewCertificateID(subscriptionId string, resourceGroupName string, certifica } } -// ParseCertificateID parses 'input' into a CertificateId -func ParseCertificateID(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) +// ParseCertificateOrderCertificateID parses 'input' into a CertificateOrderCertificateId +func ParseCertificateOrderCertificateID(input string) (*CertificateOrderCertificateId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderCertificateId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := CertificateId{} + id := CertificateOrderCertificateId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseCertificateID(input string) (*CertificateId, error) { return &id, nil } -// ParseCertificateIDInsensitively parses 'input' case-insensitively into a CertificateId +// ParseCertificateOrderCertificateIDInsensitively parses 'input' case-insensitively into a CertificateOrderCertificateId // note: this method should only be used for API response data and not user input -func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) +func ParseCertificateOrderCertificateIDInsensitively(input string) (*CertificateOrderCertificateId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderCertificateId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := CertificateId{} + id := CertificateOrderCertificateId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { return &id, nil } -func (id *CertificateId) FromParseResult(input resourceids.ParseResult) error { +func (id *CertificateOrderCertificateId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *CertificateId) FromParseResult(input resourceids.ParseResult) error { return nil } -// ValidateCertificateID checks that 'input' can be parsed as a Certificate ID -func ValidateCertificateID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateCertificateOrderCertificateID checks that 'input' can be parsed as a Certificate Order Certificate ID +func ValidateCertificateOrderCertificateID(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 := ParseCertificateID(v); err != nil { + if _, err := ParseCertificateOrderCertificateID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Certificate ID -func (id CertificateId) ID() string { +// ID returns the formatted Certificate Order Certificate ID +func (id CertificateOrderCertificateId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.CertificateRegistration/certificateOrders/%s/certificates/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CertificateOrderName, id.CertificateName) } -// Segments returns a slice of Resource ID Segments which comprise this Certificate ID -func (id CertificateId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Certificate Order Certificate ID +func (id CertificateOrderCertificateId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -123,17 +123,17 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticCertificateOrders", "certificateOrders", "certificateOrders"), resourceids.UserSpecifiedSegment("certificateOrderName", "certificateOrderName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } -// String returns a human-readable description of this Certificate ID -func (id CertificateId) String() string { +// String returns a human-readable description of this Certificate Order Certificate ID +func (id CertificateOrderCertificateId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Certificate Order Name: %q", id.CertificateOrderName), fmt.Sprintf("Certificate Name: %q", id.CertificateName), } - return fmt.Sprintf("Certificate (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Certificate Order Certificate (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2023-01-01/appservicecertificateorders/id_certificate_test.go b/resource-manager/web/2023-01-01/appservicecertificateorders/id_certificateordercertificate_test.go similarity index 87% rename from resource-manager/web/2023-01-01/appservicecertificateorders/id_certificate_test.go rename to resource-manager/web/2023-01-01/appservicecertificateorders/id_certificateordercertificate_test.go index 40bce391166..8b5bb4327c3 100644 --- a/resource-manager/web/2023-01-01/appservicecertificateorders/id_certificate_test.go +++ b/resource-manager/web/2023-01-01/appservicecertificateorders/id_certificateordercertificate_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &CertificateId{} +var _ resourceids.ResourceId = &CertificateOrderCertificateId{} -func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +func TestNewCertificateOrderCertificateID(t *testing.T) { + id := NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,24 +26,24 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'CertificateOrderName'", id.CertificateOrderName, "certificateOrderName") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } -func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name" +func TestFormatCertificateOrderCertificateID(t *testing.T) { + actual := NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseCertificateID(t *testing.T) { +func TestParseCertificateOrderCertificateID(t *testing.T) { testData := []struct { Input string Error bool - Expected *CertificateId + Expected *CertificateOrderCertificateId }{ { // Incomplete URI @@ -97,24 +97,24 @@ func TestParseCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name", - Expected: &CertificateId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseCertificateID(v.Input) + actual, err := ParseCertificateOrderCertificateID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseCertificateID(t *testing.T) { } } -func TestParseCertificateIDInsensitively(t *testing.T) { +func TestParseCertificateOrderCertificateIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *CertificateId + Expected *CertificateOrderCertificateId }{ { // Incomplete URI @@ -248,39 +248,39 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name", - Expected: &CertificateId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/nAmE", - Expected: &CertificateId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CertificateOrderName: "cErTiFiCaTeOrDeRnAmE", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseCertificateIDInsensitively(v.Input) + actual, err := ParseCertificateOrderCertificateIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseCertificateIDInsensitively(t *testing.T) { } } -func TestSegmentsForCertificateId(t *testing.T) { - segments := CertificateId{}.Segments() +func TestSegmentsForCertificateOrderCertificateId(t *testing.T) { + segments := CertificateOrderCertificateId{}.Segments() if len(segments) == 0 { - t.Fatalf("CertificateId has no segments") + t.Fatalf("CertificateOrderCertificateId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2023-01-01/appservicecertificateorders/method_createorupdatecertificate.go b/resource-manager/web/2023-01-01/appservicecertificateorders/method_createorupdatecertificate.go index f8d50a20ddc..013318e02e8 100644 --- a/resource-manager/web/2023-01-01/appservicecertificateorders/method_createorupdatecertificate.go +++ b/resource-manager/web/2023-01-01/appservicecertificateorders/method_createorupdatecertificate.go @@ -22,7 +22,7 @@ type CreateOrUpdateCertificateOperationResponse struct { } // CreateOrUpdateCertificate ... -func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context.Context, id CertificateId, input AppServiceCertificateResource) (result CreateOrUpdateCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificateResource) (result CreateOrUpdateCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -61,7 +61,7 @@ func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context } // CreateOrUpdateCertificateThenPoll performs CreateOrUpdateCertificate then polls until it's completed -func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificateThenPoll(ctx context.Context, id CertificateId, input AppServiceCertificateResource) error { +func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificateThenPoll(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificateResource) error { result, err := c.CreateOrUpdateCertificate(ctx, id, input) if err != nil { return fmt.Errorf("performing CreateOrUpdateCertificate: %+v", err) diff --git a/resource-manager/web/2023-01-01/appservicecertificateorders/method_deletecertificate.go b/resource-manager/web/2023-01-01/appservicecertificateorders/method_deletecertificate.go index 1bd00712f78..98b4359fd23 100644 --- a/resource-manager/web/2023-01-01/appservicecertificateorders/method_deletecertificate.go +++ b/resource-manager/web/2023-01-01/appservicecertificateorders/method_deletecertificate.go @@ -17,7 +17,7 @@ type DeleteCertificateOperationResponse struct { } // DeleteCertificate ... -func (c AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, id CertificateId) (result DeleteCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, id CertificateOrderCertificateId) (result DeleteCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-01-01/appservicecertificateorders/method_getcertificate.go b/resource-manager/web/2023-01-01/appservicecertificateorders/method_getcertificate.go index 0418d289349..712789271ae 100644 --- a/resource-manager/web/2023-01-01/appservicecertificateorders/method_getcertificate.go +++ b/resource-manager/web/2023-01-01/appservicecertificateorders/method_getcertificate.go @@ -18,7 +18,7 @@ type GetCertificateOperationResponse struct { } // GetCertificate ... -func (c AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, id CertificateId) (result GetCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, id CertificateOrderCertificateId) (result GetCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-01-01/appservicecertificateorders/method_updatecertificate.go b/resource-manager/web/2023-01-01/appservicecertificateorders/method_updatecertificate.go index 8ebfd637ea5..dbb5136b153 100644 --- a/resource-manager/web/2023-01-01/appservicecertificateorders/method_updatecertificate.go +++ b/resource-manager/web/2023-01-01/appservicecertificateorders/method_updatecertificate.go @@ -18,7 +18,7 @@ type UpdateCertificateOperationResponse struct { } // UpdateCertificate ... -func (c AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, id CertificateId, input AppServiceCertificatePatchResource) (result UpdateCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificatePatchResource) (result UpdateCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/README.md b/resource-manager/web/2023-01-01/appserviceenvironments/README.md index 81387f91d77..4e7c3245ed4 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/README.md +++ b/resource-manager/web/2023-01-01/appserviceenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") payload := appserviceenvironments.RemotePrivateEndpointConnectionARMResource{ // ... @@ -98,7 +98,7 @@ if err := client.CreateOrUpdateMultiRolePoolThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") payload := appserviceenvironments.WorkerPoolResource{ // ... @@ -143,7 +143,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName") +id := appserviceenvironments.NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName") read, err := client.GetDiagnosticsItem(ctx, id) if err != nil { @@ -269,7 +269,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -334,7 +334,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") read, err := client.GetWorkerPool(ctx, id) if err != nil { @@ -451,7 +451,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance") +id := appserviceenvironments.NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName") // alternatively `client.ListMultiRolePoolInstanceMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListMultiRolePoolInstanceMetricDefinitionsComplete(ctx, id) @@ -569,7 +569,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWebWorkerMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListWebWorkerMetricDefinitionsComplete(ctx, id) @@ -586,7 +586,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWebWorkerUsages(ctx, id)` can be used to do batched pagination items, err := client.ListWebWorkerUsagesComplete(ctx, id) @@ -603,7 +603,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance") +id := appserviceenvironments.NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName") // alternatively `client.ListWorkerPoolInstanceMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListWorkerPoolInstanceMetricDefinitionsComplete(ctx, id) @@ -620,7 +620,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWorkerPoolSkus(ctx, id)` can be used to do batched pagination items, err := client.ListWorkerPoolSkusComplete(ctx, id) @@ -804,7 +804,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") payload := appserviceenvironments.WorkerPoolResource{ // ... diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_defaultinstance.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_defaultinstance.go index c2d2d2a4659..88c10f8ab90 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_defaultinstance.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_defaultinstance.go @@ -121,11 +121,11 @@ func (id DefaultInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticMultiRolePools", "multiRolePools", "multiRolePools"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticInstances", "instances", "instances"), - resourceids.UserSpecifiedSegment("instanceName", "instance"), + resourceids.UserSpecifiedSegment("instanceName", "instanceName"), } } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_defaultinstance_test.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_defaultinstance_test.go index 69c92d45326..a260dfe3401 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_defaultinstance_test.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_defaultinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DefaultInstanceId{} func TestNewDefaultInstanceID(t *testing.T) { - id := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance") + id := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDefaultInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.InstanceName != "instance" { - t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instance") + if id.InstanceName != "instanceName" { + t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instanceName") } } func TestFormatDefaultInstanceID(t *testing.T) { - actual := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance" + actual := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseDefaultInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - InstanceName: "instance", + HostingEnvironmentName: "hostingEnvironmentName", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseDefaultInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - InstanceName: "instance", + HostingEnvironmentName: "hostingEnvironmentName", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcEnAmE", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", - InstanceName: "iNsTaNcE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", + InstanceName: "iNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go index f30c0af2108..9c0321e3f7a 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go @@ -121,9 +121,9 @@ func (id HostingEnvironmentDiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticsName"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go index 50a9f57decc..e998d9bcef1 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentDiagnosticId{} func TestNewHostingEnvironmentDiagnosticID(t *testing.T) { - id := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName") + id := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHostingEnvironmentDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.DiagnosticName != "diagnosticsName" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticsName") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatHostingEnvironmentDiagnosticID(t *testing.T) { - actual := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName" + actual := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentDiagnosticID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - DiagnosticName: "diagnosticsName", + HostingEnvironmentName: "hostingEnvironmentName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentDiagnosticIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - DiagnosticName: "diagnosticsName", + HostingEnvironmentName: "hostingEnvironmentName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs/dIaGnOsTiCsNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", - DiagnosticName: "dIaGnOsTiCsNaMe", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs/dIaGnOsTiCsNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go index 9e9e3ca4d87..415a31bdc7e 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go @@ -121,7 +121,7 @@ func (id HostingEnvironmentPrivateEndpointConnectionId) Segments() []resourceids resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go index 3fdc734c969..f343f7258e6 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentPrivateEndpointConnectionId{} func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { - id := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { } func TestFormatHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { - actual := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentPrivateEndpointConnectionIDInsensitively(t *test }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpool.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpool.go index e477a8499c2..dd10e8ad690 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpool.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpool.go @@ -121,7 +121,7 @@ func (id WorkerPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticWorkerPools", "workerPools", "workerPools"), resourceids.UserSpecifiedSegment("workerPoolName", "workerPoolName"), } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpool_test.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpool_test.go index 9796b8d8b07..df611010d06 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpool_test.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerPoolId{} func TestNewWorkerPoolID(t *testing.T) { - id := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") + id := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkerPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.WorkerPoolName != "workerPoolName" { @@ -32,8 +32,8 @@ func TestNewWorkerPoolID(t *testing.T) { } func TestFormatWorkerPoolID(t *testing.T) { - actual := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName" + actual := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkerPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkerPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", WorkerPoolName: "wOrKeRpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpoolinstance.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpoolinstance.go index be628dbc4e4..50a42965552 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpoolinstance.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpoolinstance.go @@ -127,11 +127,11 @@ func (id WorkerPoolInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticWorkerPools", "workerPools", "workerPools"), resourceids.UserSpecifiedSegment("workerPoolName", "workerPoolName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), - resourceids.UserSpecifiedSegment("instanceName", "instance"), + resourceids.UserSpecifiedSegment("instanceName", "instanceName"), } } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpoolinstance_test.go b/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpoolinstance_test.go index fd84259fbb8..b23611ebd58 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpoolinstance_test.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/id_workerpoolinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerPoolInstanceId{} func TestNewWorkerPoolInstanceID(t *testing.T) { - id := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance") + id := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewWorkerPoolInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.WorkerPoolName != "workerPoolName" { t.Fatalf("Expected %q but got %q for Segment 'WorkerPoolName'", id.WorkerPoolName, "workerPoolName") } - if id.InstanceName != "instance" { - t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instance") + if id.InstanceName != "instanceName" { + t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instanceName") } } func TestFormatWorkerPoolInstanceID(t *testing.T) { - actual := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance" + actual := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseWorkerPoolInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", - InstanceName: "instance", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseWorkerPoolInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", - InstanceName: "instance", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcEnAmE", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", WorkerPoolName: "wOrKeRpOoLnAmE", - InstanceName: "iNsTaNcE", + InstanceName: "iNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go b/resource-manager/web/2023-01-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go index 80ac53f7a52..54d57c9d118 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go @@ -4,7 +4,7 @@ package appserviceenvironments // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type CustomDnsSuffixConfigurationProperties struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` DnsSuffix *string `json:"dnsSuffix,omitempty"` KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` ProvisioningDetails *string `json:"provisioningDetails,omitempty"` diff --git a/resource-manager/web/2023-01-01/appserviceenvironments/model_rampuprule.go b/resource-manager/web/2023-01-01/appserviceenvironments/model_rampuprule.go index ace74b58d88..0db6bb0db58 100644 --- a/resource-manager/web/2023-01-01/appserviceenvironments/model_rampuprule.go +++ b/resource-manager/web/2023-01-01/appserviceenvironments/model_rampuprule.go @@ -5,7 +5,7 @@ package appserviceenvironments type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2023-01-01/appserviceplans/README.md b/resource-manager/web/2023-01-01/appserviceplans/README.md index 4bca00e2db4..60654e5b812 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/README.md +++ b/resource-manager/web/2023-01-01/appserviceplans/README.md @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") payload := appserviceplans.VnetRoute{ // ... @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnection(ctx, id) if err != nil { @@ -95,7 +95,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") read, err := client.DeleteVnetRoute(ctx, id) if err != nil { @@ -127,7 +127,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnection(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") read, err := client.GetRouteForVnet(ctx, id) if err != nil { @@ -191,7 +191,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") read, err := client.GetVnetFromServerFarm(ctx, id) if err != nil { @@ -207,7 +207,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetGateway(ctx, id) if err != nil { @@ -273,7 +273,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.ListHybridConnectionKeys(ctx, id) if err != nil { @@ -306,7 +306,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") read, err := client.ListRoutesForVnet(ctx, id) if err != nil { @@ -372,7 +372,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") // alternatively `client.ListWebAppsByHybridConnection(ctx, id)` can be used to do batched pagination items, err := client.ListWebAppsByHybridConnectionComplete(ctx, id) @@ -389,7 +389,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName") +id := appserviceplans.NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName") read, err := client.RebootWorker(ctx, id) if err != nil { @@ -442,7 +442,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") payload := appserviceplans.VnetGateway{ // ... @@ -463,7 +463,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") payload := appserviceplans.VnetRoute{ // ... diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_hybridconnectionnamespacerelay.go b/resource-manager/web/2023-01-01/appserviceplans/id_hybridconnectionnamespacerelay.go index a674a4cebd6..31cf0010bc4 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_hybridconnectionnamespacerelay.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_hybridconnectionnamespacerelay.go @@ -127,9 +127,9 @@ func (id HybridConnectionNamespaceRelayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go b/resource-manager/web/2023-01-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go index ac6e1d1f4b0..ca8a17b9536 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HybridConnectionNamespaceRelayId{} func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { - id := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") + id := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -36,8 +36,8 @@ func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { } func TestFormatHybridConnectionNamespaceRelayID(t *testing.T) { - actual := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseHybridConnectionNamespaceRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - HybridConnectionNamespaceName: "namespaceName", + ServerFarmName: "serverFarmName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseHybridConnectionNamespaceRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - HybridConnectionNamespaceName: "namespaceName", + ServerFarmName: "serverFarmName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + ServerFarmName: "sErVeRfArMnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_route.go b/resource-manager/web/2023-01-01/appserviceplans/id_route.go index 7b34860722d..4368f47c094 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_route.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_route.go @@ -127,9 +127,9 @@ func (id RouteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticRoutes", "routes", "routes"), resourceids.UserSpecifiedSegment("routeName", "routeName"), } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_route_test.go b/resource-manager/web/2023-01-01/appserviceplans/id_route_test.go index d313c62cf7d..ec524514b68 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_route_test.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_route_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteId{} func TestNewRouteID(t *testing.T) { - id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") + id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewRouteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.RouteName != "routeName" { @@ -36,8 +36,8 @@ func TestNewRouteID(t *testing.T) { } func TestFormatRouteID(t *testing.T) { - actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName" + actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRouteID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", RouteName: "routeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRouteIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", RouteName: "routeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS/rOuTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS/rOuTeNaMe", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", RouteName: "rOuTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS/rOuTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS/rOuTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go b/resource-manager/web/2023-01-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go index c2948bed06a..5d43668ff23 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go @@ -121,9 +121,9 @@ func (id ServerFarmVirtualNetworkConnectionId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go b/resource-manager/web/2023-01-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go index 13403b364d7..5601db88695 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerFarmVirtualNetworkConnectionId{} func TestNewServerFarmVirtualNetworkConnectionID(t *testing.T) { - id := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") + id := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewServerFarmVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatServerFarmVirtualNetworkConnectionID(t *testing.T) { - actual := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName" + actual := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServerFarmVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServerFarmVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_virtualnetworkconnectiongateway.go b/resource-manager/web/2023-01-01/appserviceplans/id_virtualnetworkconnectiongateway.go index aee31447cb0..4ccedb2d7ce 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_virtualnetworkconnectiongateway.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_virtualnetworkconnectiongateway.go @@ -127,9 +127,9 @@ func (id VirtualNetworkConnectionGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go b/resource-manager/web/2023-01-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go index 65d74773465..d542242e414 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkConnectionGatewayId{} func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { - id := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") + id := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -36,8 +36,8 @@ func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { } func TestFormatVirtualNetworkConnectionGatewayID(t *testing.T) { - actual := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVirtualNetworkConnectionGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVirtualNetworkConnectionGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_worker.go b/resource-manager/web/2023-01-01/appserviceplans/id_worker.go index f6e647697b7..31d71dbd008 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_worker.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_worker.go @@ -121,7 +121,7 @@ func (id WorkerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticWorkers", "workers", "workers"), resourceids.UserSpecifiedSegment("workerName", "workerName"), } diff --git a/resource-manager/web/2023-01-01/appserviceplans/id_worker_test.go b/resource-manager/web/2023-01-01/appserviceplans/id_worker_test.go index 3d0a5de85c5..9113edebceb 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/id_worker_test.go +++ b/resource-manager/web/2023-01-01/appserviceplans/id_worker_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerId{} func TestNewWorkerID(t *testing.T) { - id := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName") + id := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } if id.WorkerName != "workerName" { @@ -32,8 +32,8 @@ func TestNewWorkerID(t *testing.T) { } func TestFormatWorkerID(t *testing.T) { - actual := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName" + actual := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", + ServerFarmName: "serverFarmName", WorkerName: "workerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", + ServerFarmName: "serverFarmName", WorkerName: "workerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs/wOrKeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs/wOrKeRnAmE", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", + ServerFarmName: "sErVeRfArMnAmE", WorkerName: "wOrKeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs/wOrKeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs/wOrKeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/appserviceplans/model_rampuprule.go b/resource-manager/web/2023-01-01/appserviceplans/model_rampuprule.go index a8a0548b489..424344dba00 100644 --- a/resource-manager/web/2023-01-01/appserviceplans/model_rampuprule.go +++ b/resource-manager/web/2023-01-01/appserviceplans/model_rampuprule.go @@ -5,7 +5,7 @@ package appserviceplans type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2023-01-01/certificateordersdiagnostics/README.md b/resource-manager/web/2023-01-01/certificateordersdiagnostics/README.md index 1d9e27e7bfa..b23bec5e127 100644 --- a/resource-manager/web/2023-01-01/certificateordersdiagnostics/README.md +++ b/resource-manager/web/2023-01-01/certificateordersdiagnostics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificateordersdiagnostics.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") +id := certificateordersdiagnostics.NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") read, err := client.GetAppServiceCertificateOrderDetectorResponse(ctx, id, certificateordersdiagnostics.DefaultGetAppServiceCertificateOrderDetectorResponseOperationOptions()) if err != nil { diff --git a/resource-manager/web/2023-12-01/certificateordersdiagnostics/id_detector.go b/resource-manager/web/2023-01-01/certificateordersdiagnostics/id_certificateorderdetector.go similarity index 63% rename from resource-manager/web/2023-12-01/certificateordersdiagnostics/id_detector.go rename to resource-manager/web/2023-01-01/certificateordersdiagnostics/id_certificateorderdetector.go index acee2df5ba1..cbb8826cb13 100644 --- a/resource-manager/web/2023-12-01/certificateordersdiagnostics/id_detector.go +++ b/resource-manager/web/2023-01-01/certificateordersdiagnostics/id_certificateorderdetector.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&DetectorId{}) + recaser.RegisterResourceId(&CertificateOrderDetectorId{}) } -var _ resourceids.ResourceId = &DetectorId{} +var _ resourceids.ResourceId = &CertificateOrderDetectorId{} -// DetectorId is a struct representing the Resource ID for a Detector -type DetectorId struct { +// CertificateOrderDetectorId is a struct representing the Resource ID for a Certificate Order Detector +type CertificateOrderDetectorId struct { SubscriptionId string ResourceGroupName string CertificateOrderName string DetectorName string } -// NewDetectorID returns a new DetectorId struct -func NewDetectorID(subscriptionId string, resourceGroupName string, certificateOrderName string, detectorName string) DetectorId { - return DetectorId{ +// NewCertificateOrderDetectorID returns a new CertificateOrderDetectorId struct +func NewCertificateOrderDetectorID(subscriptionId string, resourceGroupName string, certificateOrderName string, detectorName string) CertificateOrderDetectorId { + return CertificateOrderDetectorId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, CertificateOrderName: certificateOrderName, @@ -35,15 +35,15 @@ func NewDetectorID(subscriptionId string, resourceGroupName string, certificateO } } -// ParseDetectorID parses 'input' into a DetectorId -func ParseDetectorID(input string) (*DetectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DetectorId{}) +// ParseCertificateOrderDetectorID parses 'input' into a CertificateOrderDetectorId +func ParseCertificateOrderDetectorID(input string) (*CertificateOrderDetectorId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderDetectorId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DetectorId{} + id := CertificateOrderDetectorId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseDetectorID(input string) (*DetectorId, error) { return &id, nil } -// ParseDetectorIDInsensitively parses 'input' case-insensitively into a DetectorId +// ParseCertificateOrderDetectorIDInsensitively parses 'input' case-insensitively into a CertificateOrderDetectorId // note: this method should only be used for API response data and not user input -func ParseDetectorIDInsensitively(input string) (*DetectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DetectorId{}) +func ParseCertificateOrderDetectorIDInsensitively(input string) (*CertificateOrderDetectorId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderDetectorId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DetectorId{} + id := CertificateOrderDetectorId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseDetectorIDInsensitively(input string) (*DetectorId, error) { return &id, nil } -func (id *DetectorId) FromParseResult(input resourceids.ParseResult) error { +func (id *CertificateOrderDetectorId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *DetectorId) FromParseResult(input resourceids.ParseResult) error { return nil } -// ValidateDetectorID checks that 'input' can be parsed as a Detector ID -func ValidateDetectorID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateCertificateOrderDetectorID checks that 'input' can be parsed as a Certificate Order Detector ID +func ValidateCertificateOrderDetectorID(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 := ParseDetectorID(v); err != nil { + if _, err := ParseCertificateOrderDetectorID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Detector ID -func (id DetectorId) ID() string { +// ID returns the formatted Certificate Order Detector ID +func (id CertificateOrderDetectorId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.CertificateRegistration/certificateOrders/%s/detectors/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CertificateOrderName, id.DetectorName) } -// Segments returns a slice of Resource ID Segments which comprise this Detector ID -func (id DetectorId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Certificate Order Detector ID +func (id CertificateOrderDetectorId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -127,13 +127,13 @@ func (id DetectorId) Segments() []resourceids.Segment { } } -// String returns a human-readable description of this Detector ID -func (id DetectorId) String() string { +// String returns a human-readable description of this Certificate Order Detector ID +func (id CertificateOrderDetectorId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Certificate Order Name: %q", id.CertificateOrderName), fmt.Sprintf("Detector Name: %q", id.DetectorName), } - return fmt.Sprintf("Detector (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Certificate Order Detector (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2023-12-01/certificateordersdiagnostics/id_detector_test.go b/resource-manager/web/2023-01-01/certificateordersdiagnostics/id_certificateorderdetector_test.go similarity index 90% rename from resource-manager/web/2023-12-01/certificateordersdiagnostics/id_detector_test.go rename to resource-manager/web/2023-01-01/certificateordersdiagnostics/id_certificateorderdetector_test.go index 067f02845eb..b24ca655c01 100644 --- a/resource-manager/web/2023-12-01/certificateordersdiagnostics/id_detector_test.go +++ b/resource-manager/web/2023-01-01/certificateordersdiagnostics/id_certificateorderdetector_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &DetectorId{} +var _ resourceids.ResourceId = &CertificateOrderDetectorId{} -func TestNewDetectorID(t *testing.T) { - id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") +func TestNewCertificateOrderDetectorID(t *testing.T) { + id := NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -31,19 +31,19 @@ func TestNewDetectorID(t *testing.T) { } } -func TestFormatDetectorID(t *testing.T) { - actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName").ID() +func TestFormatCertificateOrderDetectorID(t *testing.T) { + actual := NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName").ID() expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseDetectorID(t *testing.T) { +func TestParseCertificateOrderDetectorID(t *testing.T) { testData := []struct { Input string Error bool - Expected *DetectorId + Expected *CertificateOrderDetectorId }{ { // Incomplete URI @@ -98,7 +98,7 @@ func TestParseDetectorID(t *testing.T) { { // Valid URI Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", @@ -114,7 +114,7 @@ func TestParseDetectorID(t *testing.T) { for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDetectorID(v.Input) + actual, err := ParseCertificateOrderDetectorID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseDetectorID(t *testing.T) { } } -func TestParseDetectorIDInsensitively(t *testing.T) { +func TestParseCertificateOrderDetectorIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *DetectorId + Expected *CertificateOrderDetectorId }{ { // Incomplete URI @@ -249,7 +249,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { { // Valid URI Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", @@ -264,7 +264,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { { // Valid URI (mIxEd CaSe since this is insensitive) Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/dEtEcToRs/dEtEcToRnAmE", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CertificateOrderName: "cErTiFiCaTeOrDeRnAmE", @@ -280,7 +280,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDetectorIDInsensitively(v.Input) + actual, err := ParseCertificateOrderDetectorIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseDetectorIDInsensitively(t *testing.T) { } } -func TestSegmentsForDetectorId(t *testing.T) { - segments := DetectorId{}.Segments() +func TestSegmentsForCertificateOrderDetectorId(t *testing.T) { + segments := CertificateOrderDetectorId{}.Segments() if len(segments) == 0 { - t.Fatalf("DetectorId has no segments") + t.Fatalf("CertificateOrderDetectorId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2023-01-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go b/resource-manager/web/2023-01-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go index 15ff71d98cd..c23cb352353 100644 --- a/resource-manager/web/2023-01-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go +++ b/resource-manager/web/2023-01-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go @@ -55,7 +55,7 @@ func (o GetAppServiceCertificateOrderDetectorResponseOperationOptions) ToQuery() } // GetAppServiceCertificateOrderDetectorResponse ... -func (c CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, id DetectorId, options GetAppServiceCertificateOrderDetectorResponseOperationOptions) (result GetAppServiceCertificateOrderDetectorResponseOperationResponse, err error) { +func (c CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, id CertificateOrderDetectorId, options GetAppServiceCertificateOrderDetectorResponseOperationOptions) (result GetAppServiceCertificateOrderDetectorResponseOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-01-01/certificates/README.md b/resource-manager/web/2023-01-01/certificates/README.md index 04515852fa5..bcc98859e94 100644 --- a/resource-manager/web/2023-01-01/certificates/README.md +++ b/resource-manager/web/2023-01-01/certificates/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") payload := certificates.Certificate{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") payload := certificates.CertificatePatchResource{ // ... diff --git a/resource-manager/web/2023-01-01/certificates/id_certificate.go b/resource-manager/web/2023-01-01/certificates/id_certificate.go index 46aa8344efc..3ef853c576d 100644 --- a/resource-manager/web/2023-01-01/certificates/id_certificate.go +++ b/resource-manager/web/2023-01-01/certificates/id_certificate.go @@ -115,7 +115,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } diff --git a/resource-manager/web/2023-01-01/certificates/id_certificate_test.go b/resource-manager/web/2023-01-01/certificates/id_certificate_test.go index c64fa1af09e..b4d6ef8d3b8 100644 --- a/resource-manager/web/2023-01-01/certificates/id_certificate_test.go +++ b/resource-manager/web/2023-01-01/certificates/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/containerapps/README.md b/resource-manager/web/2023-01-01/containerapps/README.md index 575ad476c57..039a5a74c2b 100644 --- a/resource-manager/web/2023-01-01/containerapps/README.md +++ b/resource-manager/web/2023-01-01/containerapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") payload := containerapps.ContainerApp{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "name") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName") read, err := client.ListSecrets(ctx, id) if err != nil { diff --git a/resource-manager/web/2023-01-01/containerapps/id_containerapp.go b/resource-manager/web/2023-01-01/containerapps/id_containerapp.go index 95fa925f7df..3f70ccac898 100644 --- a/resource-manager/web/2023-01-01/containerapps/id_containerapp.go +++ b/resource-manager/web/2023-01-01/containerapps/id_containerapp.go @@ -107,7 +107,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2023-01-01/containerapps/id_containerapp_test.go b/resource-manager/web/2023-01-01/containerapps/id_containerapp_test.go index d60d389bf8e..7117d5e1f72 100644 --- a/resource-manager/web/2023-01-01/containerapps/id_containerapp_test.go +++ b/resource-manager/web/2023-01-01/containerapps/id_containerapp_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "name") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/containerapps/id_providercontainerapp.go b/resource-manager/web/2023-01-01/containerapps/id_providercontainerapp.go index 8ce8585f832..b816f39ada9 100644 --- a/resource-manager/web/2023-01-01/containerapps/id_providercontainerapp.go +++ b/resource-manager/web/2023-01-01/containerapps/id_providercontainerapp.go @@ -115,7 +115,7 @@ func (id ProviderContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2023-01-01/containerapps/id_providercontainerapp_test.go b/resource-manager/web/2023-01-01/containerapps/id_providercontainerapp_test.go index 8b4bc22a85f..55188842290 100644 --- a/resource-manager/web/2023-01-01/containerapps/id_providercontainerapp_test.go +++ b/resource-manager/web/2023-01-01/containerapps/id_providercontainerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderContainerAppId{} func TestNewProviderContainerAppID(t *testing.T) { - id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatProviderContainerAppID(t *testing.T) { - actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name" + actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/containerappsrevisions/README.md b/resource-manager/web/2023-01-01/containerappsrevisions/README.md index d0cd9afbd4b..67aada41a89 100644 --- a/resource-manager/web/2023-01-01/containerappsrevisions/README.md +++ b/resource-manager/web/2023-01-01/containerappsrevisions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.ActivateRevision(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.DeactivateRevision(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.GetRevision(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerappsrevisions.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ListRevisions(ctx, id)` can be used to do batched pagination items, err := client.ListRevisionsComplete(ctx, id) @@ -89,7 +89,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.RestartRevision(ctx, id) if err != nil { diff --git a/resource-manager/web/2023-01-01/containerappsrevisions/id_providercontainerapp.go b/resource-manager/web/2023-01-01/containerappsrevisions/id_providercontainerapp.go index a590f83df39..b9383d30fbd 100644 --- a/resource-manager/web/2023-01-01/containerappsrevisions/id_providercontainerapp.go +++ b/resource-manager/web/2023-01-01/containerappsrevisions/id_providercontainerapp.go @@ -115,7 +115,7 @@ func (id ProviderContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2023-01-01/containerappsrevisions/id_providercontainerapp_test.go b/resource-manager/web/2023-01-01/containerappsrevisions/id_providercontainerapp_test.go index 79553ea3764..1ab5644f109 100644 --- a/resource-manager/web/2023-01-01/containerappsrevisions/id_providercontainerapp_test.go +++ b/resource-manager/web/2023-01-01/containerappsrevisions/id_providercontainerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderContainerAppId{} func TestNewProviderContainerAppID(t *testing.T) { - id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatProviderContainerAppID(t *testing.T) { - actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name" + actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/containerappsrevisions/id_revision.go b/resource-manager/web/2023-01-01/containerappsrevisions/id_revision.go index b6c364f9728..eee8b68dfe6 100644 --- a/resource-manager/web/2023-01-01/containerappsrevisions/id_revision.go +++ b/resource-manager/web/2023-01-01/containerappsrevisions/id_revision.go @@ -123,7 +123,7 @@ func (id RevisionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), resourceids.StaticSegment("staticRevisions", "revisions", "revisions"), - resourceids.UserSpecifiedSegment("revisionName", "name"), + resourceids.UserSpecifiedSegment("revisionName", "revisionName"), } } diff --git a/resource-manager/web/2023-01-01/containerappsrevisions/id_revision_test.go b/resource-manager/web/2023-01-01/containerappsrevisions/id_revision_test.go index bb958a5df26..224a34a6a98 100644 --- a/resource-manager/web/2023-01-01/containerappsrevisions/id_revision_test.go +++ b/resource-manager/web/2023-01-01/containerappsrevisions/id_revision_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RevisionId{} func TestNewRevisionID(t *testing.T) { - id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") + id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRevisionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } - if id.RevisionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RevisionName'", id.RevisionName, "name") + if id.RevisionName != "revisionName" { + t.Fatalf("Expected %q but got %q for Segment 'RevisionName'", id.RevisionName, "revisionName") } } func TestFormatRevisionID(t *testing.T) { - actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name" + actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRevisionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ContainerAppName: "containerAppName", - RevisionName: "name", + RevisionName: "revisionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRevisionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ContainerAppName: "containerAppName", - RevisionName: "name", + RevisionName: "revisionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ContainerAppName: "cOnTaInErApPnAmE", - RevisionName: "nAmE", + RevisionName: "rEvIsIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/deletedwebapps/README.md b/resource-manager/web/2023-01-01/deletedwebapps/README.md index 68b47530989..5b1ef98eabf 100644 --- a/resource-manager/web/2023-01-01/deletedwebapps/README.md +++ b/resource-manager/web/2023-01-01/deletedwebapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedwebapps.NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId") +id := deletedwebapps.NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId") read, err := client.GetDeletedWebAppByLocation(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedwebapps.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") +id := deletedwebapps.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/web/2023-01-01/deletedwebapps/id_locationdeletedsite.go b/resource-manager/web/2023-01-01/deletedwebapps/id_locationdeletedsite.go index 21f68459dcf..28780740879 100644 --- a/resource-manager/web/2023-01-01/deletedwebapps/id_locationdeletedsite.go +++ b/resource-manager/web/2023-01-01/deletedwebapps/id_locationdeletedsite.go @@ -113,7 +113,7 @@ func (id LocationDeletedSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedSites", "deletedSites", "deletedSites"), resourceids.UserSpecifiedSegment("deletedSiteId", "deletedSiteId"), } diff --git a/resource-manager/web/2023-01-01/deletedwebapps/id_locationdeletedsite_test.go b/resource-manager/web/2023-01-01/deletedwebapps/id_locationdeletedsite_test.go index 5747600bb4e..b406ec22fa2 100644 --- a/resource-manager/web/2023-01-01/deletedwebapps/id_locationdeletedsite_test.go +++ b/resource-manager/web/2023-01-01/deletedwebapps/id_locationdeletedsite_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LocationDeletedSiteId{} func TestNewLocationDeletedSiteID(t *testing.T) { - id := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId") + id := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.DeletedSiteId != "deletedSiteId" { @@ -28,8 +28,8 @@ func TestNewLocationDeletedSiteID(t *testing.T) { } func TestFormatLocationDeletedSiteID(t *testing.T) { - actual := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId" + actual := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseLocationDeletedSiteID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedSiteId: "deletedSiteId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseLocationDeletedSiteIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedSiteId: "deletedSiteId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS/dElEtEdSiTeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS/dElEtEdSiTeId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", DeletedSiteId: "dElEtEdSiTeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS/dElEtEdSiTeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS/dElEtEdSiTeId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/deletedwebapps/id_providerlocation.go b/resource-manager/web/2023-01-01/deletedwebapps/id_providerlocation.go index 43c0d30707e..ba6b4940392 100644 --- a/resource-manager/web/2023-01-01/deletedwebapps/id_providerlocation.go +++ b/resource-manager/web/2023-01-01/deletedwebapps/id_providerlocation.go @@ -107,7 +107,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2023-01-01/deletedwebapps/id_providerlocation_test.go b/resource-manager/web/2023-01-01/deletedwebapps/id_providerlocation_test.go index 4577f6b3b52..fb713255a98 100644 --- a/resource-manager/web/2023-01-01/deletedwebapps/id_providerlocation_test.go +++ b/resource-manager/web/2023-01-01/deletedwebapps/id_providerlocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/README.md b/resource-manager/web/2023-01-01/diagnostics/README.md index 06fddabe106..c7ad7553f54 100644 --- a/resource-manager/web/2023-01-01/diagnostics/README.md +++ b/resource-manager/web/2023-01-01/diagnostics/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") +id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") read, err := client.ExecuteSiteAnalysis(ctx, id, diagnostics.DefaultExecuteSiteAnalysisOperationOptions()) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") +id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") read, err := client.ExecuteSiteAnalysisSlot(ctx, id, diagnostics.DefaultExecuteSiteAnalysisSlotOperationOptions()) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") +id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") read, err := client.ExecuteSiteDetector(ctx, id, diagnostics.DefaultExecuteSiteDetectorOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") +id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") read, err := client.ExecuteSiteDetectorSlot(ctx, id, diagnostics.DefaultExecuteSiteDetectorSlotOperationOptions()) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName") +id := diagnostics.NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName") read, err := client.GetHostingEnvironmentDetectorResponse(ctx, id, diagnostics.DefaultGetHostingEnvironmentDetectorResponseOperationOptions()) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") +id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") read, err := client.GetSiteAnalysis(ctx, id) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") +id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") read, err := client.GetSiteAnalysisSlot(ctx, id) if err != nil { @@ -137,7 +137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") +id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") read, err := client.GetSiteDetector(ctx, id) if err != nil { @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName") +id := diagnostics.NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName") read, err := client.GetSiteDetectorResponseSlot(ctx, id, diagnostics.DefaultGetSiteDetectorResponseSlotOperationOptions()) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") +id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") read, err := client.GetSiteDetectorSlot(ctx, id) if err != nil { @@ -201,7 +201,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") read, err := client.GetSiteDiagnosticCategory(ctx, id) if err != nil { @@ -217,7 +217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") read, err := client.GetSiteDiagnosticCategorySlot(ctx, id) if err != nil { @@ -250,7 +250,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") // alternatively `client.ListSiteAnalyses(ctx, id)` can be used to do batched pagination items, err := client.ListSiteAnalysesComplete(ctx, id) @@ -267,7 +267,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") // alternatively `client.ListSiteAnalysesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteAnalysesSlotComplete(ctx, id) @@ -301,7 +301,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteDetectorResponsesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorResponsesSlotComplete(ctx, id) @@ -318,7 +318,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") // alternatively `client.ListSiteDetectors(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorsComplete(ctx, id) @@ -335,7 +335,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") // alternatively `client.ListSiteDetectorsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorsSlotComplete(ctx, id) @@ -369,7 +369,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteDiagnosticCategoriesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDiagnosticCategoriesSlotComplete(ctx, id) diff --git a/resource-manager/web/2023-01-01/diagnostics/id_analysis.go b/resource-manager/web/2023-01-01/diagnostics/id_analysis.go index e82e0c867c9..4ad7593663b 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_analysis.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_analysis.go @@ -129,7 +129,7 @@ func (id AnalysisId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticAnalyses", "analyses", "analyses"), resourceids.UserSpecifiedSegment("analysisName", "analysisName"), } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_analysis_test.go b/resource-manager/web/2023-01-01/diagnostics/id_analysis_test.go index fd7c0c72df7..b5a41dcb6b7 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_analysis_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_analysis_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AnalysisId{} func TestNewAnalysisID(t *testing.T) { - id := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") + id := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewAnalysisID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.AnalysisName != "analysisName" { @@ -36,8 +36,8 @@ func TestNewAnalysisID(t *testing.T) { } func TestFormatAnalysisID(t *testing.T) { - actual := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName" + actual := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseAnalysisID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseAnalysisIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", AnalysisName: "aNaLySiSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_diagnostic.go b/resource-manager/web/2023-01-01/diagnostics/id_diagnostic.go index 7efa9727df5..d8f916e4863 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_diagnostic.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_diagnostic.go @@ -123,7 +123,7 @@ func (id DiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_diagnostic_test.go b/resource-manager/web/2023-01-01/diagnostics/id_diagnostic_test.go index 80cf8522798..f75e156e5bb 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_diagnostic_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_diagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticId{} func TestNewDiagnosticID(t *testing.T) { - id := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") + id := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatDiagnosticID(t *testing.T) { - actual := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory" + actual := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDiagnosticID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDiagnosticIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_diagnosticanalysis.go b/resource-manager/web/2023-01-01/diagnostics/id_diagnosticanalysis.go index d3734f88b3d..c2a851a5780 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_diagnosticanalysis.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_diagnosticanalysis.go @@ -135,9 +135,9 @@ func (id DiagnosticAnalysisId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticAnalyses", "analyses", "analyses"), resourceids.UserSpecifiedSegment("analysisName", "analysisName"), } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_diagnosticanalysis_test.go b/resource-manager/web/2023-01-01/diagnostics/id_diagnosticanalysis_test.go index b6036055128..88593f85f7f 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_diagnosticanalysis_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_diagnosticanalysis_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticAnalysisId{} func TestNewDiagnosticAnalysisID(t *testing.T) { - id := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") + id := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewDiagnosticAnalysisID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.AnalysisName != "analysisName" { @@ -40,8 +40,8 @@ func TestNewDiagnosticAnalysisID(t *testing.T) { } func TestFormatDiagnosticAnalysisID(t *testing.T) { - actual := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName" + actual := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseDiagnosticAnalysisID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseDiagnosticAnalysisIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", AnalysisName: "aNaLySiSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_diagnosticdetector.go b/resource-manager/web/2023-01-01/diagnostics/id_diagnosticdetector.go index 6a09159ddae..cf131c1681f 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_diagnosticdetector.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_diagnosticdetector.go @@ -129,7 +129,7 @@ func (id DiagnosticDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_diagnosticdetector_test.go b/resource-manager/web/2023-01-01/diagnostics/id_diagnosticdetector_test.go index d2ebe8307c9..cd45a7927c0 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_diagnosticdetector_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_diagnosticdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticDetectorId{} func TestNewDiagnosticDetectorID(t *testing.T) { - id := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") + id := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDiagnosticDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.DetectorName != "detectorName" { @@ -36,8 +36,8 @@ func TestNewDiagnosticDetectorID(t *testing.T) { } func TestFormatDiagnosticDetectorID(t *testing.T) { - actual := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName" + actual := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDiagnosticDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDiagnosticDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_hostingenvironmentdetector.go b/resource-manager/web/2023-01-01/diagnostics/id_hostingenvironmentdetector.go index 0860c9bbbe7..617be4bec18 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_hostingenvironmentdetector.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_hostingenvironmentdetector.go @@ -121,7 +121,7 @@ func (id HostingEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_hostingenvironmentdetector_test.go b/resource-manager/web/2023-01-01/diagnostics/id_hostingenvironmentdetector_test.go index 79fa244b352..6063fa9cdc0 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_hostingenvironmentdetector_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_hostingenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentDetectorId{} func TestNewHostingEnvironmentDetectorID(t *testing.T) { - id := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName") + id := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHostingEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewHostingEnvironmentDetectorID(t *testing.T) { } func TestFormatHostingEnvironmentDetectorID(t *testing.T) { - actual := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName" + actual := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_slot.go b/resource-manager/web/2023-01-01/diagnostics/id_slot.go index 5196f574350..3458e4a3bca 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_slot.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_slot_test.go b/resource-manager/web/2023-01-01/diagnostics/id_slot_test.go index 9c49573511c..591c34ab7b7 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_slot_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_slotdetector.go b/resource-manager/web/2023-01-01/diagnostics/id_slotdetector.go index 29fdc9326fe..287984b0bc5 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_slotdetector.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_slotdetector.go @@ -129,7 +129,7 @@ func (id SlotDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_slotdetector_test.go b/resource-manager/web/2023-01-01/diagnostics/id_slotdetector_test.go index 173c66061d8..32e7f62003b 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_slotdetector_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_slotdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDetectorId{} func TestNewSlotDetectorID(t *testing.T) { - id := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName") + id := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewSlotDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.DetectorName != "detectorName" { @@ -36,8 +36,8 @@ func TestNewSlotDetectorID(t *testing.T) { } func TestFormatSlotDetectorID(t *testing.T) { - actual := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName" + actual := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSlotDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSlotDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnostic.go b/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnostic.go index 6a8e8318ffe..d94b24e79f8 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnostic.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnostic.go @@ -129,9 +129,9 @@ func (id SlotDiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnostic_test.go b/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnostic_test.go index 5e8a1a839e9..af97181d8ad 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnostic_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDiagnosticId{} func TestNewSlotDiagnosticID(t *testing.T) { - id := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") + id := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewSlotDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatSlotDiagnosticID(t *testing.T) { - actual := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory" + actual := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSlotDiagnosticID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSlotDiagnosticIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnosticdetector.go b/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnosticdetector.go index 90bf030bdb5..98ccbee3b33 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnosticdetector.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnosticdetector.go @@ -135,9 +135,9 @@ func (id SlotDiagnosticDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnosticdetector_test.go b/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnosticdetector_test.go index d3d59c9365f..bfb6c97fbd8 100644 --- a/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnosticdetector_test.go +++ b/resource-manager/web/2023-01-01/diagnostics/id_slotdiagnosticdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDiagnosticDetectorId{} func TestNewSlotDiagnosticDetectorID(t *testing.T) { - id := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") + id := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewSlotDiagnosticDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.DetectorName != "detectorName" { @@ -40,8 +40,8 @@ func TestNewSlotDiagnosticDetectorID(t *testing.T) { } func TestFormatSlotDiagnosticDetectorID(t *testing.T) { - actual := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName" + actual := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseSlotDiagnosticDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseSlotDiagnosticDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/domains/README.md b/resource-manager/web/2023-01-01/domains/README.md index 57bde6220cd..471a0af6604 100644 --- a/resource-manager/web/2023-01-01/domains/README.md +++ b/resource-manager/web/2023-01-01/domains/README.md @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") payload := domains.DomainOwnershipIdentifier{ // ... @@ -100,7 +100,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") read, err := client.DeleteOwnershipIdentifier(ctx, id) if err != nil { @@ -148,7 +148,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") read, err := client.GetOwnershipIdentifier(ctx, id) if err != nil { @@ -290,7 +290,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") payload := domains.DomainOwnershipIdentifier{ // ... diff --git a/resource-manager/web/2023-01-01/domains/id_domainownershipidentifier.go b/resource-manager/web/2023-01-01/domains/id_domainownershipidentifier.go index 3a7b36ae669..d15193f1a7b 100644 --- a/resource-manager/web/2023-01-01/domains/id_domainownershipidentifier.go +++ b/resource-manager/web/2023-01-01/domains/id_domainownershipidentifier.go @@ -123,7 +123,7 @@ func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), - resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "name"), + resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } } diff --git a/resource-manager/web/2023-01-01/domains/id_domainownershipidentifier_test.go b/resource-manager/web/2023-01-01/domains/id_domainownershipidentifier_test.go index f985e2aa509..14debd4f5fb 100644 --- a/resource-manager/web/2023-01-01/domains/id_domainownershipidentifier_test.go +++ b/resource-manager/web/2023-01-01/domains/id_domainownershipidentifier_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} func TestNewDomainOwnershipIdentifierID(t *testing.T) { - id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") + id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.DomainOwnershipIdentifierName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DomainOwnershipIdentifierName'", id.DomainOwnershipIdentifierName, "name") + if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { + t.Fatalf("Expected %q but got %q for Segment 'DomainOwnershipIdentifierName'", id.DomainOwnershipIdentifierName, "domainOwnershipIdentifierName") } } func TestFormatDomainOwnershipIdentifierID(t *testing.T) { - actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name" + actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - DomainOwnershipIdentifierName: "name", + DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - DomainOwnershipIdentifierName: "name", + DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", DomainName: "dOmAiNnAmE", - DomainOwnershipIdentifierName: "nAmE", + DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/kubeenvironments/README.md b/resource-manager/web/2023-01-01/kubeenvironments/README.md index 8dd9299fe67..80d3c60ab80 100644 --- a/resource-manager/web/2023-01-01/kubeenvironments/README.md +++ b/resource-manager/web/2023-01-01/kubeenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") payload := kubeenvironments.KubeEnvironment{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") payload := kubeenvironments.KubeEnvironmentPatchResource{ // ... diff --git a/resource-manager/web/2023-01-01/kubeenvironments/id_kubeenvironment.go b/resource-manager/web/2023-01-01/kubeenvironments/id_kubeenvironment.go index 6afa2b5aed9..73c1a578e48 100644 --- a/resource-manager/web/2023-01-01/kubeenvironments/id_kubeenvironment.go +++ b/resource-manager/web/2023-01-01/kubeenvironments/id_kubeenvironment.go @@ -115,7 +115,7 @@ func (id KubeEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticKubeEnvironments", "kubeEnvironments", "kubeEnvironments"), - resourceids.UserSpecifiedSegment("kubeEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("kubeEnvironmentName", "kubeEnvironmentName"), } } diff --git a/resource-manager/web/2023-01-01/kubeenvironments/id_kubeenvironment_test.go b/resource-manager/web/2023-01-01/kubeenvironments/id_kubeenvironment_test.go index a84ed9fa62d..e209728abab 100644 --- a/resource-manager/web/2023-01-01/kubeenvironments/id_kubeenvironment_test.go +++ b/resource-manager/web/2023-01-01/kubeenvironments/id_kubeenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KubeEnvironmentId{} func TestNewKubeEnvironmentID(t *testing.T) { - id := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewKubeEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.KubeEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'KubeEnvironmentName'", id.KubeEnvironmentName, "name") + if id.KubeEnvironmentName != "kubeEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'KubeEnvironmentName'", id.KubeEnvironmentName, "kubeEnvironmentName") } } func TestFormatKubeEnvironmentID(t *testing.T) { - actual := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name" + actual := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseKubeEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - KubeEnvironmentName: "name", + KubeEnvironmentName: "kubeEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseKubeEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - KubeEnvironmentName: "name", + KubeEnvironmentName: "kubeEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/kUbEeNvIrOnMeNtNaMe", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - KubeEnvironmentName: "nAmE", + KubeEnvironmentName: "kUbEeNvIrOnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/kUbEeNvIrOnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/provider/README.md b/resource-manager/web/2023-01-01/provider/README.md index 5424d94f494..b1945673229 100644 --- a/resource-manager/web/2023-01-01/provider/README.md +++ b/resource-manager/web/2023-01-01/provider/README.md @@ -76,7 +76,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := provider.NewLocationID("location") +id := provider.NewLocationID("locationName") // alternatively `client.GetFunctionAppStacksForLocation(ctx, id, provider.DefaultGetFunctionAppStacksForLocationOperationOptions())` can be used to do batched pagination items, err := client.GetFunctionAppStacksForLocationComplete(ctx, id, provider.DefaultGetFunctionAppStacksForLocationOperationOptions()) @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := provider.NewLocationID("location") +id := provider.NewLocationID("locationName") // alternatively `client.GetWebAppStacksForLocation(ctx, id, provider.DefaultGetWebAppStacksForLocationOperationOptions())` can be used to do batched pagination items, err := client.GetWebAppStacksForLocationComplete(ctx, id, provider.DefaultGetWebAppStacksForLocationOperationOptions()) diff --git a/resource-manager/web/2023-01-01/provider/id_location.go b/resource-manager/web/2023-01-01/provider/id_location.go index b2c84698d9e..73ea1c40a58 100644 --- a/resource-manager/web/2023-01-01/provider/id_location.go +++ b/resource-manager/web/2023-01-01/provider/id_location.go @@ -99,7 +99,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2023-01-01/provider/id_location_test.go b/resource-manager/web/2023-01-01/provider/id_location_test.go index d870f55af25..e0391552ed6 100644 --- a/resource-manager/web/2023-01-01/provider/id_location_test.go +++ b/resource-manager/web/2023-01-01/provider/id_location_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("location") + id := NewLocationID("locationName") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("location").ID() - expected := "/providers/Microsoft.Web/locations/location" + actual := NewLocationID("locationName").ID() + expected := "/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/locations/location", + Input: "/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/locations/location/extra", + Input: "/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/locations/location", + Input: "/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/locations/location/extra", + Input: "/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/recommendations/README.md b/resource-manager/web/2023-01-01/recommendations/README.md index f05f55dc5ae..49838c9d63b 100644 --- a/resource-manager/web/2023-01-01/recommendations/README.md +++ b/resource-manager/web/2023-01-01/recommendations/README.md @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") +id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") read, err := client.DisableRecommendationForHostingEnvironment(ctx, id, recommendations.DefaultDisableRecommendationForHostingEnvironmentOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") +id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") read, err := client.DisableRecommendationForSite(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewRecommendationID("12345678-1234-9876-4563-123456789012", "name") +id := recommendations.NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName") read, err := client.DisableRecommendationForSubscription(ctx, id) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") +id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") read, err := client.GetRuleDetailsByHostingEnvironment(ctx, id, recommendations.DefaultGetRuleDetailsByHostingEnvironmentOperationOptions()) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") +id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") read, err := client.GetRuleDetailsByWebApp(ctx, id, recommendations.DefaultGetRuleDetailsByWebAppOperationOptions()) if err != nil { diff --git a/resource-manager/web/2023-01-01/recommendations/id_hostingenvironmentrecommendation.go b/resource-manager/web/2023-01-01/recommendations/id_hostingenvironmentrecommendation.go index 2cdbbdb1c37..6c8bb19b20b 100644 --- a/resource-manager/web/2023-01-01/recommendations/id_hostingenvironmentrecommendation.go +++ b/resource-manager/web/2023-01-01/recommendations/id_hostingenvironmentrecommendation.go @@ -123,7 +123,7 @@ func (id HostingEnvironmentRecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2023-01-01/recommendations/id_hostingenvironmentrecommendation_test.go b/resource-manager/web/2023-01-01/recommendations/id_hostingenvironmentrecommendation_test.go index ec3b68f0c53..89a2959452d 100644 --- a/resource-manager/web/2023-01-01/recommendations/id_hostingenvironmentrecommendation_test.go +++ b/resource-manager/web/2023-01-01/recommendations/id_hostingenvironmentrecommendation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentRecommendationId{} func TestNewHostingEnvironmentRecommendationID(t *testing.T) { - id := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") + id := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHostingEnvironmentRecommendationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatHostingEnvironmentRecommendationID(t *testing.T) { - actual := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name" + actual := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHostingEnvironmentRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostingEnvironmentName: "hostingEnvironmentName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHostingEnvironmentRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostingEnvironmentName: "hostingEnvironmentName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/recommendations/id_recommendation.go b/resource-manager/web/2023-01-01/recommendations/id_recommendation.go index 25ebd90886f..b42bf6faa1d 100644 --- a/resource-manager/web/2023-01-01/recommendations/id_recommendation.go +++ b/resource-manager/web/2023-01-01/recommendations/id_recommendation.go @@ -107,7 +107,7 @@ func (id RecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2023-01-01/recommendations/id_recommendation_test.go b/resource-manager/web/2023-01-01/recommendations/id_recommendation_test.go index 2966eb11a4c..a6c44f1f14c 100644 --- a/resource-manager/web/2023-01-01/recommendations/id_recommendation_test.go +++ b/resource-manager/web/2023-01-01/recommendations/id_recommendation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &RecommendationId{} func TestNewRecommendationID(t *testing.T) { - id := NewRecommendationID("12345678-1234-9876-4563-123456789012", "name") + id := NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatRecommendationID(t *testing.T) { - actual := NewRecommendationID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name" + actual := NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/recommendations/id_siterecommendation.go b/resource-manager/web/2023-01-01/recommendations/id_siterecommendation.go index 596c056c92b..2876f7cd3e0 100644 --- a/resource-manager/web/2023-01-01/recommendations/id_siterecommendation.go +++ b/resource-manager/web/2023-01-01/recommendations/id_siterecommendation.go @@ -123,7 +123,7 @@ func (id SiteRecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2023-01-01/recommendations/id_siterecommendation_test.go b/resource-manager/web/2023-01-01/recommendations/id_siterecommendation_test.go index f1a3efaeb4c..5bf28fb326c 100644 --- a/resource-manager/web/2023-01-01/recommendations/id_siterecommendation_test.go +++ b/resource-manager/web/2023-01-01/recommendations/id_siterecommendation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteRecommendationId{} func TestNewSiteRecommendationID(t *testing.T) { - id := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") + id := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSiteRecommendationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatSiteRecommendationID(t *testing.T) { - actual := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name" + actual := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSiteRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSiteRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/resourcehealthmetadata/README.md b/resource-manager/web/2023-01-01/resourcehealthmetadata/README.md index 62ea761e1ef..31fdce9c24d 100644 --- a/resource-manager/web/2023-01-01/resourcehealthmetadata/README.md +++ b/resource-manager/web/2023-01-01/resourcehealthmetadata/README.md @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetBySiteSlot(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBySiteSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBySiteSlotComplete(ctx, id) diff --git a/resource-manager/web/2023-01-01/resourcehealthmetadata/id_slot.go b/resource-manager/web/2023-01-01/resourcehealthmetadata/id_slot.go index f588aa1069d..ef1e7ddf14c 100644 --- a/resource-manager/web/2023-01-01/resourcehealthmetadata/id_slot.go +++ b/resource-manager/web/2023-01-01/resourcehealthmetadata/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2023-01-01/resourcehealthmetadata/id_slot_test.go b/resource-manager/web/2023-01-01/resourcehealthmetadata/id_slot_test.go index 78664d5346e..1713ffbdc7d 100644 --- a/resource-manager/web/2023-01-01/resourcehealthmetadata/id_slot_test.go +++ b/resource-manager/web/2023-01-01/resourcehealthmetadata/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/resourceproviders/README.md b/resource-manager/web/2023-01-01/resourceproviders/README.md index dd0e2159416..97ab93b4e95 100644 --- a/resource-manager/web/2023-01-01/resourceproviders/README.md +++ b/resource-manager/web/2023-01-01/resourceproviders/README.md @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceproviders.NewSourceControlID("sourceControlType") +id := resourceproviders.NewSourceControlID("sourceControlName") read, err := client.GetSourceControl(ctx, id) if err != nil { @@ -94,7 +94,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceproviders.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") +id := resourceproviders.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.GetUsagesInLocationlist(ctx, id)` can be used to do batched pagination items, err := client.GetUsagesInLocationlistComplete(ctx, id) @@ -292,7 +292,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceproviders.NewSourceControlID("sourceControlType") +id := resourceproviders.NewSourceControlID("sourceControlName") payload := resourceproviders.SourceControl{ // ... diff --git a/resource-manager/web/2023-01-01/resourceproviders/id_providerlocation.go b/resource-manager/web/2023-01-01/resourceproviders/id_providerlocation.go index fa3481d95ca..93f55de2bf3 100644 --- a/resource-manager/web/2023-01-01/resourceproviders/id_providerlocation.go +++ b/resource-manager/web/2023-01-01/resourceproviders/id_providerlocation.go @@ -107,7 +107,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2023-01-01/resourceproviders/id_providerlocation_test.go b/resource-manager/web/2023-01-01/resourceproviders/id_providerlocation_test.go index bcf968e0624..4d560e91917 100644 --- a/resource-manager/web/2023-01-01/resourceproviders/id_providerlocation_test.go +++ b/resource-manager/web/2023-01-01/resourceproviders/id_providerlocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/resourceproviders/id_sourcecontrol.go b/resource-manager/web/2023-01-01/resourceproviders/id_sourcecontrol.go index 1d19e0304d3..a78436e8801 100644 --- a/resource-manager/web/2023-01-01/resourceproviders/id_sourcecontrol.go +++ b/resource-manager/web/2023-01-01/resourceproviders/id_sourcecontrol.go @@ -99,7 +99,7 @@ func (id SourceControlId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), - resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlType"), + resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlName"), } } diff --git a/resource-manager/web/2023-01-01/resourceproviders/id_sourcecontrol_test.go b/resource-manager/web/2023-01-01/resourceproviders/id_sourcecontrol_test.go index 56f1a7f7d16..a64983484b3 100644 --- a/resource-manager/web/2023-01-01/resourceproviders/id_sourcecontrol_test.go +++ b/resource-manager/web/2023-01-01/resourceproviders/id_sourcecontrol_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &SourceControlId{} func TestNewSourceControlID(t *testing.T) { - id := NewSourceControlID("sourceControlType") + id := NewSourceControlID("sourceControlName") - if id.SourceControlName != "sourceControlType" { - t.Fatalf("Expected %q but got %q for Segment 'SourceControlName'", id.SourceControlName, "sourceControlType") + if id.SourceControlName != "sourceControlName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceControlName'", id.SourceControlName, "sourceControlName") } } func TestFormatSourceControlID(t *testing.T) { - actual := NewSourceControlID("sourceControlType").ID() - expected := "/providers/Microsoft.Web/sourceControls/sourceControlType" + actual := NewSourceControlID("sourceControlName").ID() + expected := "/providers/Microsoft.Web/sourceControls/sourceControlName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseSourceControlID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName", Expected: &SourceControlId{ - SourceControlName: "sourceControlType", + SourceControlName: "sourceControlName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType/extra", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseSourceControlIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName", Expected: &SourceControlId{ - SourceControlName: "sourceControlType", + SourceControlName: "sourceControlName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType/extra", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlTyPe", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlNaMe", Expected: &SourceControlId{ - SourceControlName: "sOuRcEcOnTrOlTyPe", + SourceControlName: "sOuRcEcOnTrOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlTyPe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/resourceproviders/model_customdnssuffixconfigurationproperties.go b/resource-manager/web/2023-01-01/resourceproviders/model_customdnssuffixconfigurationproperties.go index ba59ff8812d..cac2d224e58 100644 --- a/resource-manager/web/2023-01-01/resourceproviders/model_customdnssuffixconfigurationproperties.go +++ b/resource-manager/web/2023-01-01/resourceproviders/model_customdnssuffixconfigurationproperties.go @@ -4,7 +4,7 @@ package resourceproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type CustomDnsSuffixConfigurationProperties struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` DnsSuffix *string `json:"dnsSuffix,omitempty"` KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` ProvisioningDetails *string `json:"provisioningDetails,omitempty"` diff --git a/resource-manager/web/2023-01-01/resourceproviders/model_premieraddonofferproperties.go b/resource-manager/web/2023-01-01/resourceproviders/model_premieraddonofferproperties.go index 4dcce517ebe..4d6d6786360 100644 --- a/resource-manager/web/2023-01-01/resourceproviders/model_premieraddonofferproperties.go +++ b/resource-manager/web/2023-01-01/resourceproviders/model_premieraddonofferproperties.go @@ -4,10 +4,10 @@ package resourceproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PremierAddOnOfferProperties struct { - LegalTermsUrl *string `json:"legalTermsUrl,omitempty"` + LegalTermsURL *string `json:"legalTermsUrl,omitempty"` MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` - PrivacyPolicyUrl *string `json:"privacyPolicyUrl,omitempty"` + PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` Product *string `json:"product,omitempty"` PromoCodeRequired *bool `json:"promoCodeRequired,omitempty"` Quota *int64 `json:"quota,omitempty"` diff --git a/resource-manager/web/2023-01-01/resourceproviders/model_validateproperties.go b/resource-manager/web/2023-01-01/resourceproviders/model_validateproperties.go index 390aaea61b0..76c9b025d30 100644 --- a/resource-manager/web/2023-01-01/resourceproviders/model_validateproperties.go +++ b/resource-manager/web/2023-01-01/resourceproviders/model_validateproperties.go @@ -9,7 +9,7 @@ type ValidateProperties struct { ContainerImagePlatform *string `json:"containerImagePlatform,omitempty"` ContainerImageRepository *string `json:"containerImageRepository,omitempty"` ContainerImageTag *string `json:"containerImageTag,omitempty"` - ContainerRegistryBaseUrl *string `json:"containerRegistryBaseUrl,omitempty"` + ContainerRegistryBaseURL *string `json:"containerRegistryBaseUrl,omitempty"` ContainerRegistryPassword *string `json:"containerRegistryPassword,omitempty"` ContainerRegistryUsername *string `json:"containerRegistryUsername,omitempty"` HostingEnvironment *string `json:"hostingEnvironment,omitempty"` diff --git a/resource-manager/web/2023-01-01/staticsites/README.md b/resource-manager/web/2023-01-01/staticsites/README.md index b6236a15dc3..20f9f65d980 100644 --- a/resource-manager/web/2023-01-01/staticsites/README.md +++ b/resource-manager/web/2023-01-01/staticsites/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") payload := staticsites.RemotePrivateEndpointConnectionARMResource{ // ... @@ -42,7 +42,7 @@ if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteBasicAuthPropertiesARMResource{ // ... @@ -63,7 +63,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") payload := staticsites.DatabaseConnection{ // ... @@ -84,7 +84,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") payload := staticsites.DatabaseConnection{ // ... @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteARMResource{ // ... @@ -122,7 +122,7 @@ if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StringDictionary{ // ... @@ -143,7 +143,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StringDictionary{ // ... @@ -164,7 +164,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StringDictionary{ // ... @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ // ... @@ -202,7 +202,7 @@ if err := client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StringDictionary{ // ... @@ -223,7 +223,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteUserInvitationRequestResource{ // ... @@ -244,7 +244,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteZipDeploymentARMResource{ // ... @@ -261,7 +261,7 @@ if err := client.CreateZipDeploymentForStaticSiteThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StaticSiteZipDeploymentARMResource{ // ... @@ -278,7 +278,7 @@ if err := client.CreateZipDeploymentForStaticSiteBuildThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.DeleteBuildDatabaseConnection(ctx, id) if err != nil { @@ -294,7 +294,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.DeleteDatabaseConnection(ctx, id) if err != nil { @@ -310,7 +310,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -322,7 +322,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if err := client.DeleteStaticSiteThenPoll(ctx, id); err != nil { // handle the error @@ -334,7 +334,7 @@ if err := client.DeleteStaticSiteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") if err := client.DeleteStaticSiteBuildThenPoll(ctx, id); err != nil { // handle the error @@ -346,7 +346,7 @@ if err := client.DeleteStaticSiteBuildThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") if err := client.DeleteStaticSiteCustomDomainThenPoll(ctx, id); err != nil { // handle the error @@ -358,7 +358,7 @@ if err := client.DeleteStaticSiteCustomDomainThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") read, err := client.DeleteStaticSiteUser(ctx, id) if err != nil { @@ -374,7 +374,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if err := client.DetachStaticSiteThenPoll(ctx, id); err != nil { // handle the error @@ -386,7 +386,7 @@ if err := client.DetachStaticSiteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") read, err := client.DetachUserProvidedFunctionAppFromStaticSite(ctx, id) if err != nil { @@ -402,7 +402,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") read, err := client.DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx, id) if err != nil { @@ -418,7 +418,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetBasicAuth(ctx, id) if err != nil { @@ -434,7 +434,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.GetBuildDatabaseConnection(ctx, id) if err != nil { @@ -450,7 +450,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.GetBuildDatabaseConnectionWithDetails(ctx, id) if err != nil { @@ -466,7 +466,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetBuildDatabaseConnections(ctx, id)` can be used to do batched pagination items, err := client.GetBuildDatabaseConnectionsComplete(ctx, id) @@ -483,7 +483,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetBuildDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination items, err := client.GetBuildDatabaseConnectionsWithDetailsComplete(ctx, id) @@ -500,7 +500,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.GetDatabaseConnection(ctx, id) if err != nil { @@ -516,7 +516,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.GetDatabaseConnectionWithDetails(ctx, id) if err != nil { @@ -532,7 +532,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetDatabaseConnections(ctx, id)` can be used to do batched pagination items, err := client.GetDatabaseConnectionsComplete(ctx, id) @@ -549,7 +549,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination items, err := client.GetDatabaseConnectionsWithDetailsComplete(ctx, id) @@ -566,7 +566,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") read, err := client.GetLinkedBackend(ctx, id) if err != nil { @@ -582,7 +582,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") read, err := client.GetLinkedBackendForBuild(ctx, id) if err != nil { @@ -598,7 +598,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetLinkedBackends(ctx, id)` can be used to do batched pagination items, err := client.GetLinkedBackendsComplete(ctx, id) @@ -615,7 +615,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetLinkedBackendsForBuild(ctx, id)` can be used to do batched pagination items, err := client.GetLinkedBackendsForBuildComplete(ctx, id) @@ -632,7 +632,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -648,7 +648,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetPrivateEndpointConnectionList(ctx, id)` can be used to do batched pagination items, err := client.GetPrivateEndpointConnectionListComplete(ctx, id) @@ -665,7 +665,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetPrivateLinkResources(ctx, id) if err != nil { @@ -681,7 +681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetStaticSite(ctx, id) if err != nil { @@ -697,7 +697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.GetStaticSiteBuild(ctx, id) if err != nil { @@ -713,7 +713,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetStaticSiteBuilds(ctx, id)` can be used to do batched pagination items, err := client.GetStaticSiteBuildsComplete(ctx, id) @@ -730,7 +730,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") read, err := client.GetStaticSiteCustomDomain(ctx, id) if err != nil { @@ -763,7 +763,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") read, err := client.GetUserProvidedFunctionAppForStaticSite(ctx, id) if err != nil { @@ -779,7 +779,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") read, err := client.GetUserProvidedFunctionAppForStaticSiteBuild(ctx, id) if err != nil { @@ -795,7 +795,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetUserProvidedFunctionAppsForStaticSite(ctx, id)` can be used to do batched pagination items, err := client.GetUserProvidedFunctionAppsForStaticSiteComplete(ctx, id) @@ -812,7 +812,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetUserProvidedFunctionAppsForStaticSiteBuild(ctx, id)` can be used to do batched pagination items, err := client.GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx, id) @@ -829,7 +829,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -846,7 +846,7 @@ if err := client.LinkBackendThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -880,7 +880,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListBasicAuth(ctx, id)` can be used to do batched pagination items, err := client.ListBasicAuthComplete(ctx, id) @@ -897,7 +897,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteAppSettings(ctx, id) if err != nil { @@ -913,7 +913,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.ListStaticSiteBuildAppSettings(ctx, id) if err != nil { @@ -929,7 +929,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.ListStaticSiteBuildFunctionAppSettings(ctx, id) if err != nil { @@ -945,7 +945,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.ListStaticSiteBuildFunctions(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteBuildFunctionsComplete(ctx, id) @@ -962,7 +962,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteConfiguredRoles(ctx, id) if err != nil { @@ -978,7 +978,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListStaticSiteCustomDomains(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteCustomDomainsComplete(ctx, id) @@ -995,7 +995,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteFunctionAppSettings(ctx, id) if err != nil { @@ -1011,7 +1011,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListStaticSiteFunctions(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteFunctionsComplete(ctx, id) @@ -1028,7 +1028,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteSecrets(ctx, id) if err != nil { @@ -1044,7 +1044,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider") +id := staticsites.NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName") // alternatively `client.ListStaticSiteUsers(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteUsersComplete(ctx, id) @@ -1061,7 +1061,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") +id := staticsites.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := staticsites.StaticSitesWorkflowPreviewRequest{ // ... @@ -1082,7 +1082,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ // ... @@ -1099,7 +1099,7 @@ if err := client.RegisterUserProvidedFunctionAppWithStaticSiteThenPoll(ctx, id, ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ // ... @@ -1116,7 +1116,7 @@ if err := client.RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll(ctx, ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteResetPropertiesARMResource{ // ... @@ -1137,7 +1137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") read, err := client.UnlinkBackend(ctx, id, staticsites.DefaultUnlinkBackendOperationOptions()) if err != nil { @@ -1153,7 +1153,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") read, err := client.UnlinkBackendFromBuild(ctx, id, staticsites.DefaultUnlinkBackendFromBuildOperationOptions()) if err != nil { @@ -1169,7 +1169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") payload := staticsites.DatabaseConnectionPatchRequest{ // ... @@ -1190,7 +1190,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") payload := staticsites.DatabaseConnectionPatchRequest{ // ... @@ -1211,7 +1211,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSitePatchResource{ // ... @@ -1232,7 +1232,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") payload := staticsites.StaticSiteUserARMResource{ // ... @@ -1253,7 +1253,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -1270,7 +1270,7 @@ if err := client.ValidateBackendThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -1287,7 +1287,7 @@ if err := client.ValidateBackendForBuildThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ // ... diff --git a/resource-manager/web/2023-01-01/staticsites/id_authprovider.go b/resource-manager/web/2023-01-01/staticsites/id_authprovider.go index 19115aee935..73ad2ff2650 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_authprovider.go +++ b/resource-manager/web/2023-01-01/staticsites/id_authprovider.go @@ -121,9 +121,9 @@ func (id AuthProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), - resourceids.UserSpecifiedSegment("authProviderName", "authprovider"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderName"), } } diff --git a/resource-manager/web/2023-01-01/staticsites/id_authprovider_test.go b/resource-manager/web/2023-01-01/staticsites/id_authprovider_test.go index 31016d1fa90..8ea5e3431e0 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_authprovider_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_authprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthProviderId{} func TestNewAuthProviderID(t *testing.T) { - id := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider") + id := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAuthProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.AuthProviderName != "authprovider" { - t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authprovider") + if id.AuthProviderName != "authProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authProviderName") } } func TestFormatAuthProviderID(t *testing.T) { - actual := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider" + actual := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAuthProviderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAuthProviderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - AuthProviderName: "aUtHpRoViDeR", + StaticSiteName: "sTaTiCsItEnAmE", + AuthProviderName: "aUtHpRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_build.go b/resource-manager/web/2023-01-01/staticsites/id_build.go index 112edc411df..9b2d3b3a03d 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_build.go +++ b/resource-manager/web/2023-01-01/staticsites/id_build.go @@ -121,9 +121,9 @@ func (id BuildId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), } } diff --git a/resource-manager/web/2023-01-01/staticsites/id_build_test.go b/resource-manager/web/2023-01-01/staticsites/id_build_test.go index 3f555f12a5c..9f08be01439 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_build_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_build_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildId{} func TestNewBuildID(t *testing.T) { - id := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") + id := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewBuildID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } } func TestFormatBuildID(t *testing.T) { - actual := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName" + actual := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBuildID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBuildIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go b/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go index c3e3d62bd53..660071b7aab 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go +++ b/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go @@ -127,9 +127,9 @@ func (id BuildDatabaseConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionName"), } diff --git a/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection_test.go b/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection_test.go index 0ef682da792..68f9cc60dd9 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildDatabaseConnectionId{} func TestNewBuildDatabaseConnectionID(t *testing.T) { - id := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") + id := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewBuildDatabaseConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } if id.DatabaseConnectionName != "databaseConnectionName" { @@ -36,8 +36,8 @@ func TestNewBuildDatabaseConnectionID(t *testing.T) { } func TestFormatBuildDatabaseConnectionID(t *testing.T) { - actual := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName" + actual := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildDatabaseConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildDatabaseConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", DatabaseConnectionName: "dAtAbAsEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go b/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go index 448f74335ef..42b3fe8e789 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go +++ b/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go @@ -127,9 +127,9 @@ func (id BuildLinkedBackendId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendName"), } diff --git a/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend_test.go b/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend_test.go index ffd4e752932..e7a2cb9e253 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildLinkedBackendId{} func TestNewBuildLinkedBackendID(t *testing.T) { - id := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") + id := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewBuildLinkedBackendID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } if id.LinkedBackendName != "linkedBackendName" { @@ -36,8 +36,8 @@ func TestNewBuildLinkedBackendID(t *testing.T) { } func TestFormatBuildLinkedBackendID(t *testing.T) { - actual := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName" + actual := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildLinkedBackendID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildLinkedBackendIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", LinkedBackendName: "lInKeDbAcKeNdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go b/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go index 7b84e9b7fb6..23a557f57de 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go +++ b/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go @@ -127,11 +127,11 @@ func (id BuildUserProvidedFunctionAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), - resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "functionAppName"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppName"), } } diff --git a/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp_test.go b/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp_test.go index 12186ac2cb1..04e65c3a35b 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildUserProvidedFunctionAppId{} func TestNewBuildUserProvidedFunctionAppID(t *testing.T) { - id := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") + id := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewBuildUserProvidedFunctionAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } - if id.UserProvidedFunctionAppName != "functionAppName" { - t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "functionAppName") + if id.UserProvidedFunctionAppName != "userProvidedFunctionAppName" { + t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "userProvidedFunctionAppName") } } func TestFormatBuildUserProvidedFunctionAppID(t *testing.T) { - actual := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName" + actual := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildUserProvidedFunctionAppID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildUserProvidedFunctionAppIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", - UserProvidedFunctionAppName: "fUnCtIoNaPpNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", + UserProvidedFunctionAppName: "uSeRpRoViDeDfUnCtIoNaPpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_customdomain.go b/resource-manager/web/2023-01-01/staticsites/id_customdomain.go index 7e2c137ab15..52bb3f0abb2 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_customdomain.go +++ b/resource-manager/web/2023-01-01/staticsites/id_customdomain.go @@ -121,9 +121,9 @@ func (id CustomDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), - resourceids.UserSpecifiedSegment("customDomainName", "domainName"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainName"), } } diff --git a/resource-manager/web/2023-01-01/staticsites/id_customdomain_test.go b/resource-manager/web/2023-01-01/staticsites/id_customdomain_test.go index 3b3fa35ee88..64add194b56 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_customdomain_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_customdomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomDomainId{} func TestNewCustomDomainID(t *testing.T) { - id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") + id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.CustomDomainName != "domainName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "domainName") + if id.CustomDomainName != "customDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "customDomainName") } } func TestFormatCustomDomainID(t *testing.T) { - actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName" + actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - CustomDomainName: "domainName", + StaticSiteName: "staticSiteName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - CustomDomainName: "domainName", + StaticSiteName: "staticSiteName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs/dOmAiNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs/cUsToMdOmAiNnAmE", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - CustomDomainName: "dOmAiNnAmE", + StaticSiteName: "sTaTiCsItEnAmE", + CustomDomainName: "cUsToMdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs/dOmAiNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs/cUsToMdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go b/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go index c8977fff4ca..0646be22614 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go +++ b/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go @@ -121,7 +121,7 @@ func (id DatabaseConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionName"), } diff --git a/resource-manager/web/2023-01-01/staticsites/id_databaseconnection_test.go b/resource-manager/web/2023-01-01/staticsites/id_databaseconnection_test.go index f713ec31548..c91658ac616 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_databaseconnection_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_databaseconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseConnectionId{} func TestNewDatabaseConnectionID(t *testing.T) { - id := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") + id := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.DatabaseConnectionName != "databaseConnectionName" { @@ -32,8 +32,8 @@ func TestNewDatabaseConnectionID(t *testing.T) { } func TestFormatDatabaseConnectionID(t *testing.T) { - actual := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName" + actual := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", DatabaseConnectionName: "dAtAbAsEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go b/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go index affdec42c25..2db02661f88 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go +++ b/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go @@ -121,7 +121,7 @@ func (id LinkedBackendId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendName"), } diff --git a/resource-manager/web/2023-01-01/staticsites/id_linkedbackend_test.go b/resource-manager/web/2023-01-01/staticsites/id_linkedbackend_test.go index 8a21c27c9b0..bbbdc7a534f 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_linkedbackend_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_linkedbackend_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LinkedBackendId{} func TestNewLinkedBackendID(t *testing.T) { - id := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") + id := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewLinkedBackendID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.LinkedBackendName != "linkedBackendName" { @@ -32,8 +32,8 @@ func TestNewLinkedBackendID(t *testing.T) { } func TestFormatLinkedBackendID(t *testing.T) { - actual := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName" + actual := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLinkedBackendID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLinkedBackendIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", LinkedBackendName: "lInKeDbAcKeNdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go b/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go index ba0444d08c2..c53d10beaa5 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go +++ b/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go @@ -107,7 +107,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2023-01-01/staticsites/id_providerlocation_test.go b/resource-manager/web/2023-01-01/staticsites/id_providerlocation_test.go index f0354411445..e48b5f6c6d4 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_providerlocation_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_providerlocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_staticsite.go b/resource-manager/web/2023-01-01/staticsites/id_staticsite.go index 91e479c7d40..5b7df0899c4 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_staticsite.go +++ b/resource-manager/web/2023-01-01/staticsites/id_staticsite.go @@ -115,7 +115,7 @@ func (id StaticSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), } } diff --git a/resource-manager/web/2023-01-01/staticsites/id_staticsite_test.go b/resource-manager/web/2023-01-01/staticsites/id_staticsite_test.go index d17c986ce1e..429bdfeaed4 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_staticsite_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_staticsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StaticSiteId{} func TestNewStaticSiteID(t *testing.T) { - id := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStaticSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } } func TestFormatStaticSiteID(t *testing.T) { - actual := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name" + actual := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStaticSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStaticSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go b/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go index e08cf42aa3c..8c4c4fd7cb9 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go +++ b/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go @@ -121,7 +121,7 @@ func (id StaticSitePrivateEndpointConnectionId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection_test.go b/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection_test.go index 9abe6707f50..aef661aa34c 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StaticSitePrivateEndpointConnectionId{} func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { - id := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { } func TestFormatStaticSitePrivateEndpointConnectionID(t *testing.T) { - actual := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStaticSitePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStaticSitePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_user.go b/resource-manager/web/2023-01-01/staticsites/id_user.go index 9f4e54d1075..fe210ef0473 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_user.go +++ b/resource-manager/web/2023-01-01/staticsites/id_user.go @@ -127,11 +127,11 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), - resourceids.UserSpecifiedSegment("authProviderName", "authprovider"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "userid"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/web/2023-01-01/staticsites/id_user_test.go b/resource-manager/web/2023-01-01/staticsites/id_user_test.go index 10f68b3725b..e79e3a28959 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_user_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.AuthProviderName != "authprovider" { - t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authprovider") + if id.AuthProviderName != "authProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authProviderName") } - if id.UserName != "userid" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userid") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseUserID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", - UserName: "userid", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", - UserName: "userid", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs/uSeRiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - AuthProviderName: "aUtHpRoViDeR", - UserName: "uSeRiD", + StaticSiteName: "sTaTiCsItEnAmE", + AuthProviderName: "aUtHpRoViDeRnAmE", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs/uSeRiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go b/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go index 44e05595733..ff361f6c538 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go +++ b/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go @@ -121,9 +121,9 @@ func (id UserProvidedFunctionAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), - resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "functionAppName"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppName"), } } diff --git a/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp_test.go b/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp_test.go index fe429004412..038fecd6ba1 100644 --- a/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp_test.go +++ b/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserProvidedFunctionAppId{} func TestNewUserProvidedFunctionAppID(t *testing.T) { - id := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") + id := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUserProvidedFunctionAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.UserProvidedFunctionAppName != "functionAppName" { - t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "functionAppName") + if id.UserProvidedFunctionAppName != "userProvidedFunctionAppName" { + t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "userProvidedFunctionAppName") } } func TestFormatUserProvidedFunctionAppID(t *testing.T) { - actual := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName" + actual := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUserProvidedFunctionAppID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUserProvidedFunctionAppIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - UserProvidedFunctionAppName: "fUnCtIoNaPpNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + UserProvidedFunctionAppName: "uSeRpRoViDeDfUnCtIoNaPpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/staticsites/model_staticsite.go b/resource-manager/web/2023-01-01/staticsites/model_staticsite.go index 9fad6989e54..04ffe0c1027 100644 --- a/resource-manager/web/2023-01-01/staticsites/model_staticsite.go +++ b/resource-manager/web/2023-01-01/staticsites/model_staticsite.go @@ -18,7 +18,7 @@ type StaticSite struct { Provider *string `json:"provider,omitempty"` PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` RepositoryToken *string `json:"repositoryToken,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` StagingEnvironmentPolicy *StagingEnvironmentPolicy `json:"stagingEnvironmentPolicy,omitempty"` TemplateProperties *StaticSiteTemplateOptions `json:"templateProperties,omitempty"` UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` diff --git a/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go b/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go index 80795463497..e413aa4a9c5 100644 --- a/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go +++ b/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go @@ -8,5 +8,5 @@ type StaticSiteBasicAuthPropertiesARMResourceProperties struct { Environments *[]string `json:"environments,omitempty"` Password *string `json:"password,omitempty"` SecretState *string `json:"secretState,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` } diff --git a/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go b/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go index bca5c553bc4..c3d04f76a6d 100644 --- a/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go +++ b/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go @@ -6,5 +6,5 @@ package staticsites type StaticSitesWorkflowPreviewRequestProperties struct { Branch *string `json:"branch,omitempty"` BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` } diff --git a/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go b/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go index 5afb0421afc..1f957ada652 100644 --- a/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go +++ b/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go @@ -8,5 +8,5 @@ type StaticSiteTemplateOptions struct { IsPrivate *bool `json:"isPrivate,omitempty"` Owner *string `json:"owner,omitempty"` RepositoryName *string `json:"repositoryName,omitempty"` - TemplateRepositoryUrl *string `json:"templateRepositoryUrl,omitempty"` + TemplateRepositoryURL *string `json:"templateRepositoryUrl,omitempty"` } diff --git a/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go b/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go index 674c99a3b50..57c9a2fb872 100644 --- a/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go +++ b/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go @@ -11,7 +11,7 @@ import ( type StaticSiteUserInvitationResponseResourceProperties struct { ExpiresOn *string `json:"expiresOn,omitempty"` - InvitationUrl *string `json:"invitationUrl,omitempty"` + InvitationURL *string `json:"invitationUrl,omitempty"` } func (o *StaticSiteUserInvitationResponseResourceProperties) GetExpiresOnAsTime() (*time.Time, error) { diff --git a/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go b/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go index 29435dc00a6..e91994bd766 100644 --- a/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go +++ b/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go @@ -4,8 +4,8 @@ package staticsites // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type StaticSiteZipDeployment struct { - ApiZipUrl *string `json:"apiZipUrl,omitempty"` - AppZipUrl *string `json:"appZipUrl,omitempty"` + ApiZipURL *string `json:"apiZipUrl,omitempty"` + AppZipURL *string `json:"appZipUrl,omitempty"` DeploymentTitle *string `json:"deploymentTitle,omitempty"` FunctionLanguage *string `json:"functionLanguage,omitempty"` Provider *string `json:"provider,omitempty"` diff --git a/resource-manager/web/2023-01-01/topleveldomains/README.md b/resource-manager/web/2023-01-01/topleveldomains/README.md index 6a70808f6b5..557d983b783 100644 --- a/resource-manager/web/2023-01-01/topleveldomains/README.md +++ b/resource-manager/web/2023-01-01/topleveldomains/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") +id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") +id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") payload := topleveldomains.TopLevelDomainAgreementOption{ // ... diff --git a/resource-manager/web/2023-01-01/topleveldomains/id_topleveldomain.go b/resource-manager/web/2023-01-01/topleveldomains/id_topleveldomain.go index cbe8e0b3066..de4d3235874 100644 --- a/resource-manager/web/2023-01-01/topleveldomains/id_topleveldomain.go +++ b/resource-manager/web/2023-01-01/topleveldomains/id_topleveldomain.go @@ -107,7 +107,7 @@ func (id TopLevelDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDomainRegistration", "Microsoft.DomainRegistration", "Microsoft.DomainRegistration"), resourceids.StaticSegment("staticTopLevelDomains", "topLevelDomains", "topLevelDomains"), - resourceids.UserSpecifiedSegment("topLevelDomainName", "name"), + resourceids.UserSpecifiedSegment("topLevelDomainName", "topLevelDomainName"), } } diff --git a/resource-manager/web/2023-01-01/topleveldomains/id_topleveldomain_test.go b/resource-manager/web/2023-01-01/topleveldomains/id_topleveldomain_test.go index 196fe20d654..11f286ac04e 100644 --- a/resource-manager/web/2023-01-01/topleveldomains/id_topleveldomain_test.go +++ b/resource-manager/web/2023-01-01/topleveldomains/id_topleveldomain_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &TopLevelDomainId{} func TestNewTopLevelDomainID(t *testing.T) { - id := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") + id := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.TopLevelDomainName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'TopLevelDomainName'", id.TopLevelDomainName, "name") + if id.TopLevelDomainName != "topLevelDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'TopLevelDomainName'", id.TopLevelDomainName, "topLevelDomainName") } } func TestFormatTopLevelDomainID(t *testing.T) { - actual := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name" + actual := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseTopLevelDomainID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "name", + TopLevelDomainName: "topLevelDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseTopLevelDomainIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "name", + TopLevelDomainName: "topLevelDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/tOpLeVeLdOmAiNnAmE", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "nAmE", + TopLevelDomainName: "tOpLeVeLdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/tOpLeVeLdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/README.md b/resource-manager/web/2023-01-01/webapps/README.md index 7b8170b95d0..77219c50d96 100644 --- a/resource-manager/web/2023-01-01/webapps/README.md +++ b/resource-manager/web/2023-01-01/webapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") payload := webapps.PremierAddOn{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") payload := webapps.PremierAddOn{ // ... @@ -83,7 +83,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.AnalyzeCustomHostnameSlot(ctx, id, webapps.DefaultAnalyzeCustomHostnameSlotOperationOptions()) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -141,7 +141,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") payload := webapps.RemotePrivateEndpointConnectionARMResource{ // ... @@ -158,7 +158,7 @@ if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") payload := webapps.RemotePrivateEndpointConnectionARMResource{ // ... @@ -196,7 +196,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.BackupRequest{ // ... @@ -217,7 +217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") payload := webapps.Deployment{ // ... @@ -238,7 +238,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") payload := webapps.Deployment{ // ... @@ -259,7 +259,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") payload := webapps.FunctionEnvelope{ // ... @@ -276,7 +276,7 @@ if err := client.CreateFunctionThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") payload := webapps.FunctionEnvelope{ // ... @@ -293,7 +293,7 @@ if err := client.CreateInstanceFunctionSlotThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") payload := webapps.MSDeploy{ // ... @@ -310,7 +310,7 @@ if err := client.CreateInstanceMSDeployOperationThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") payload := webapps.MSDeploy{ // ... @@ -344,7 +344,7 @@ if err := client.CreateMSDeployOperationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.MSDeploy{ // ... @@ -415,7 +415,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteConfigResource{ // ... @@ -436,7 +436,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -457,7 +457,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -478,7 +478,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") +id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") payload := webapps.KeyInfo{ // ... @@ -499,7 +499,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") +id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") payload := webapps.KeyInfo{ // ... @@ -520,7 +520,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") payload := webapps.HostNameBinding{ // ... @@ -541,7 +541,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") payload := webapps.HostNameBinding{ // ... @@ -562,7 +562,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") +id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") payload := webapps.KeyInfo{ // ... @@ -583,7 +583,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") +id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") payload := webapps.KeyInfo{ // ... @@ -604,7 +604,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -625,7 +625,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -646,7 +646,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") payload := webapps.PublicCertificate{ // ... @@ -667,7 +667,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") payload := webapps.PublicCertificate{ // ... @@ -688,7 +688,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -709,7 +709,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -730,7 +730,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.Site{ // ... @@ -764,7 +764,7 @@ if err := client.CreateOrUpdateSourceControlThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteSourceControl{ // ... @@ -802,7 +802,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SwiftVirtualNetwork{ // ... @@ -823,7 +823,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -844,7 +844,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -886,7 +886,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -923,7 +923,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") read, err := client.DeleteBackup(ctx, id) if err != nil { @@ -955,7 +955,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteBackupConfigurationSlot(ctx, id) if err != nil { @@ -971,7 +971,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") read, err := client.DeleteBackupSlot(ctx, id) if err != nil { @@ -987,7 +987,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.DeleteContinuousWebJob(ctx, id) if err != nil { @@ -1003,7 +1003,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.DeleteContinuousWebJobSlot(ctx, id) if err != nil { @@ -1019,7 +1019,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.DeleteDeployment(ctx, id) if err != nil { @@ -1035,7 +1035,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.DeleteDeploymentSlot(ctx, id) if err != nil { @@ -1051,7 +1051,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") read, err := client.DeleteDomainOwnershipIdentifier(ctx, id) if err != nil { @@ -1067,7 +1067,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") read, err := client.DeleteDomainOwnershipIdentifierSlot(ctx, id) if err != nil { @@ -1083,7 +1083,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.DeleteFunction(ctx, id) if err != nil { @@ -1099,7 +1099,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") +id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") read, err := client.DeleteFunctionSecret(ctx, id) if err != nil { @@ -1115,7 +1115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") +id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") read, err := client.DeleteFunctionSecretSlot(ctx, id) if err != nil { @@ -1131,7 +1131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") read, err := client.DeleteHostNameBinding(ctx, id) if err != nil { @@ -1147,7 +1147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") read, err := client.DeleteHostNameBindingSlot(ctx, id) if err != nil { @@ -1163,7 +1163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") +id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") read, err := client.DeleteHostSecret(ctx, id) if err != nil { @@ -1179,7 +1179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") +id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") read, err := client.DeleteHostSecretSlot(ctx, id) if err != nil { @@ -1195,7 +1195,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnection(ctx, id) if err != nil { @@ -1211,7 +1211,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnectionSlot(ctx, id) if err != nil { @@ -1227,7 +1227,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.DeleteInstanceFunctionSlot(ctx, id) if err != nil { @@ -1243,7 +1243,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.DeleteInstanceProcess(ctx, id) if err != nil { @@ -1259,7 +1259,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.DeleteInstanceProcessSlot(ctx, id) if err != nil { @@ -1275,7 +1275,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") read, err := client.DeletePremierAddOn(ctx, id) if err != nil { @@ -1291,7 +1291,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") read, err := client.DeletePremierAddOnSlot(ctx, id) if err != nil { @@ -1307,7 +1307,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -1319,7 +1319,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionSlotThenPoll(ctx, id); err != nil { // handle the error @@ -1331,7 +1331,7 @@ if err := client.DeletePrivateEndpointConnectionSlotThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.DeleteProcess(ctx, id) if err != nil { @@ -1347,7 +1347,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.DeleteProcessSlot(ctx, id) if err != nil { @@ -1363,7 +1363,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") read, err := client.DeletePublicCertificate(ctx, id) if err != nil { @@ -1379,7 +1379,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") read, err := client.DeletePublicCertificateSlot(ctx, id) if err != nil { @@ -1395,7 +1395,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") read, err := client.DeleteRelayServiceConnection(ctx, id) if err != nil { @@ -1411,7 +1411,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") read, err := client.DeleteRelayServiceConnectionSlot(ctx, id) if err != nil { @@ -1427,7 +1427,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") read, err := client.DeleteSiteExtension(ctx, id) if err != nil { @@ -1443,7 +1443,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") read, err := client.DeleteSiteExtensionSlot(ctx, id) if err != nil { @@ -1459,7 +1459,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSlot(ctx, id, webapps.DefaultDeleteSlotOperationOptions()) if err != nil { @@ -1491,7 +1491,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSourceControlSlot(ctx, id, webapps.DefaultDeleteSourceControlSlotOperationOptions()) if err != nil { @@ -1523,7 +1523,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSwiftVirtualNetworkSlot(ctx, id) if err != nil { @@ -1539,7 +1539,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.DeleteTriggeredWebJob(ctx, id) if err != nil { @@ -1555,7 +1555,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.DeleteTriggeredWebJobSlot(ctx, id) if err != nil { @@ -1571,7 +1571,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") read, err := client.DeleteVnetConnection(ctx, id) if err != nil { @@ -1587,7 +1587,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") read, err := client.DeleteVnetConnectionSlot(ctx, id) if err != nil { @@ -1624,7 +1624,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.WorkflowArtifacts{ // ... @@ -1666,7 +1666,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.RestoreRequest{ // ... @@ -1703,7 +1703,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GenerateNewSitePublishingPasswordSlot(ctx, id) if err != nil { @@ -1735,7 +1735,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey") +id := webapps.NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey") read, err := client.GetAppSettingKeyVaultReference(ctx, id) if err != nil { @@ -1751,7 +1751,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey") +id := webapps.NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey") read, err := client.GetAppSettingKeyVaultReferenceSlot(ctx, id) if err != nil { @@ -1784,7 +1784,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetAppSettingsKeyVaultReferencesSlot(ctx, id)` can be used to do batched pagination items, err := client.GetAppSettingsKeyVaultReferencesSlotComplete(ctx, id) @@ -1817,7 +1817,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsSlot(ctx, id) if err != nil { @@ -1849,7 +1849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsV2Slot(ctx, id) if err != nil { @@ -1881,7 +1881,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsV2WithoutSecretsSlot(ctx, id) if err != nil { @@ -1913,7 +1913,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetBackupConfigurationSlot(ctx, id) if err != nil { @@ -1929,7 +1929,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") read, err := client.GetBackupStatus(ctx, id) if err != nil { @@ -1945,7 +1945,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") read, err := client.GetBackupStatusSlot(ctx, id) if err != nil { @@ -1977,7 +1977,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetConfigurationSlot(ctx, id) if err != nil { @@ -1993,7 +1993,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") +id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") read, err := client.GetConfigurationSnapshot(ctx, id) if err != nil { @@ -2009,7 +2009,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") +id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") read, err := client.GetConfigurationSnapshotSlot(ctx, id) if err != nil { @@ -2041,7 +2041,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetContainerLogsZipSlot(ctx, id) if err != nil { @@ -2057,7 +2057,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.GetContinuousWebJob(ctx, id) if err != nil { @@ -2073,7 +2073,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.GetContinuousWebJobSlot(ctx, id) if err != nil { @@ -2089,7 +2089,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.GetDeployment(ctx, id) if err != nil { @@ -2105,7 +2105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.GetDeploymentSlot(ctx, id) if err != nil { @@ -2137,7 +2137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetDiagnosticLogsConfigurationSlot(ctx, id) if err != nil { @@ -2153,7 +2153,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") read, err := client.GetDomainOwnershipIdentifier(ctx, id) if err != nil { @@ -2169,7 +2169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") read, err := client.GetDomainOwnershipIdentifierSlot(ctx, id) if err != nil { @@ -2201,7 +2201,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetFtpAllowedSlot(ctx, id) if err != nil { @@ -2217,7 +2217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.GetFunction(ctx, id) if err != nil { @@ -2249,7 +2249,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetFunctionsAdminTokenSlot(ctx, id) if err != nil { @@ -2265,7 +2265,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") read, err := client.GetHostNameBinding(ctx, id) if err != nil { @@ -2281,7 +2281,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") read, err := client.GetHostNameBindingSlot(ctx, id) if err != nil { @@ -2297,7 +2297,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnection(ctx, id) if err != nil { @@ -2313,7 +2313,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnectionSlot(ctx, id) if err != nil { @@ -2329,7 +2329,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.GetInstanceFunctionSlot(ctx, id) if err != nil { @@ -2345,7 +2345,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceInfo(ctx, id) if err != nil { @@ -2361,7 +2361,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceInfoSlot(ctx, id) if err != nil { @@ -2377,7 +2377,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceMSDeployLog(ctx, id) if err != nil { @@ -2393,7 +2393,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceMSDeployLogSlot(ctx, id) if err != nil { @@ -2409,7 +2409,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceMsDeployStatus(ctx, id) if err != nil { @@ -2425,7 +2425,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceMsDeployStatusSlot(ctx, id) if err != nil { @@ -2441,7 +2441,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.GetInstanceProcess(ctx, id) if err != nil { @@ -2457,7 +2457,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.GetInstanceProcessDump(ctx, id) if err != nil { @@ -2473,7 +2473,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.GetInstanceProcessDumpSlot(ctx, id) if err != nil { @@ -2489,7 +2489,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress") +id := webapps.NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName") read, err := client.GetInstanceProcessModule(ctx, id) if err != nil { @@ -2505,7 +2505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress") +id := webapps.NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName") read, err := client.GetInstanceProcessModuleSlot(ctx, id) if err != nil { @@ -2521,7 +2521,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.GetInstanceProcessSlot(ctx, id) if err != nil { @@ -2537,7 +2537,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName") +id := webapps.NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName") read, err := client.GetInstanceWorkflowSlot(ctx, id) if err != nil { @@ -2569,7 +2569,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMSDeployLogSlot(ctx, id) if err != nil { @@ -2601,7 +2601,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMSDeployStatusSlot(ctx, id) if err != nil { @@ -2633,7 +2633,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMigrateMySqlStatusSlot(ctx, id) if err != nil { @@ -2649,7 +2649,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") +id := webapps.NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") read, err := client.GetNetworkTraces(ctx, id) if err != nil { @@ -2665,7 +2665,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") +id := webapps.NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") read, err := client.GetNetworkTracesSlot(ctx, id) if err != nil { @@ -2681,7 +2681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") +id := webapps.NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") read, err := client.GetNetworkTracesSlotV2(ctx, id) if err != nil { @@ -2697,7 +2697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") +id := webapps.NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") read, err := client.GetNetworkTracesV2(ctx, id) if err != nil { @@ -2729,7 +2729,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") read, err := client.GetPremierAddOn(ctx, id) if err != nil { @@ -2745,7 +2745,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") read, err := client.GetPremierAddOnSlot(ctx, id) if err != nil { @@ -2777,7 +2777,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetPrivateAccessSlot(ctx, id) if err != nil { @@ -2793,7 +2793,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -2826,7 +2826,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetPrivateEndpointConnectionListSlot(ctx, id)` can be used to do batched pagination items, err := client.GetPrivateEndpointConnectionListSlotComplete(ctx, id) @@ -2843,7 +2843,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnectionSlot(ctx, id) if err != nil { @@ -2875,7 +2875,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetPrivateLinkResourcesSlot(ctx, id) if err != nil { @@ -2891,7 +2891,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.GetProcess(ctx, id) if err != nil { @@ -2907,7 +2907,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.GetProcessDump(ctx, id) if err != nil { @@ -2923,7 +2923,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.GetProcessDumpSlot(ctx, id) if err != nil { @@ -2939,7 +2939,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress") +id := webapps.NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName") read, err := client.GetProcessModule(ctx, id) if err != nil { @@ -2955,7 +2955,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress") +id := webapps.NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName") read, err := client.GetProcessModuleSlot(ctx, id) if err != nil { @@ -2971,7 +2971,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.GetProcessSlot(ctx, id) if err != nil { @@ -2987,7 +2987,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") read, err := client.GetPublicCertificate(ctx, id) if err != nil { @@ -3003,7 +3003,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") read, err := client.GetPublicCertificateSlot(ctx, id) if err != nil { @@ -3019,7 +3019,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") read, err := client.GetRelayServiceConnection(ctx, id) if err != nil { @@ -3035,7 +3035,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") read, err := client.GetRelayServiceConnectionSlot(ctx, id) if err != nil { @@ -3067,7 +3067,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetScmAllowedSlot(ctx, id) if err != nil { @@ -3083,7 +3083,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey") +id := webapps.NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey") read, err := client.GetSiteConnectionStringKeyVaultReference(ctx, id) if err != nil { @@ -3099,7 +3099,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey") +id := webapps.NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey") read, err := client.GetSiteConnectionStringKeyVaultReferenceSlot(ctx, id) if err != nil { @@ -3132,7 +3132,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetSiteConnectionStringKeyVaultReferencesSlot(ctx, id)` can be used to do batched pagination items, err := client.GetSiteConnectionStringKeyVaultReferencesSlotComplete(ctx, id) @@ -3149,7 +3149,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") read, err := client.GetSiteExtension(ctx, id) if err != nil { @@ -3165,7 +3165,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") read, err := client.GetSiteExtensionSlot(ctx, id) if err != nil { @@ -3197,7 +3197,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSitePhpErrorLogFlagSlot(ctx, id) if err != nil { @@ -3213,7 +3213,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSlot(ctx, id) if err != nil { @@ -3245,7 +3245,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSourceControlSlot(ctx, id) if err != nil { @@ -3277,7 +3277,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSwiftVirtualNetworkConnectionSlot(ctx, id) if err != nil { @@ -3293,7 +3293,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.GetTriggeredWebJob(ctx, id) if err != nil { @@ -3309,7 +3309,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id") +id := webapps.NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName") read, err := client.GetTriggeredWebJobHistory(ctx, id) if err != nil { @@ -3325,7 +3325,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id") +id := webapps.NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName") read, err := client.GetTriggeredWebJobHistorySlot(ctx, id) if err != nil { @@ -3341,7 +3341,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.GetTriggeredWebJobSlot(ctx, id) if err != nil { @@ -3357,7 +3357,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") read, err := client.GetVnetConnection(ctx, id) if err != nil { @@ -3373,7 +3373,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetConnectionGateway(ctx, id) if err != nil { @@ -3389,7 +3389,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetConnectionGatewaySlot(ctx, id) if err != nil { @@ -3405,7 +3405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") read, err := client.GetVnetConnectionSlot(ctx, id) if err != nil { @@ -3421,7 +3421,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName") read, err := client.GetWebJob(ctx, id) if err != nil { @@ -3437,7 +3437,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName") read, err := client.GetWebJobSlot(ctx, id) if err != nil { @@ -3469,7 +3469,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetWebSiteContainerLogsSlot(ctx, id) if err != nil { @@ -3485,7 +3485,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := webapps.NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") read, err := client.GetWorkflow(ctx, id) if err != nil { @@ -3501,7 +3501,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") if err := client.InstallSiteExtensionThenPoll(ctx, id); err != nil { // handle the error @@ -3513,7 +3513,7 @@ if err := client.InstallSiteExtensionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") if err := client.InstallSiteExtensionSlotThenPoll(ctx, id); err != nil { // handle the error @@ -3541,7 +3541,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.IsCloneableSlot(ctx, id) if err != nil { @@ -3590,7 +3590,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListApplicationSettingsSlot(ctx, id) if err != nil { @@ -3622,7 +3622,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListAzureStorageAccountsSlot(ctx, id) if err != nil { @@ -3638,7 +3638,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") payload := webapps.BackupRequest{ // ... @@ -3659,7 +3659,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") payload := webapps.BackupRequest{ // ... @@ -3697,7 +3697,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBackupsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBackupsSlotComplete(ctx, id) @@ -3731,7 +3731,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBasicPublishingCredentialsPoliciesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBasicPublishingCredentialsPoliciesSlotComplete(ctx, id) @@ -3782,7 +3782,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListConfigurationSnapshotInfoSlot(ctx, id)` can be used to do batched pagination items, err := client.ListConfigurationSnapshotInfoSlotComplete(ctx, id) @@ -3816,7 +3816,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListConfigurationsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListConfigurationsSlotComplete(ctx, id) @@ -3849,7 +3849,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListConnectionStringsSlot(ctx, id) if err != nil { @@ -3882,7 +3882,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListContinuousWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListContinuousWebJobsSlotComplete(ctx, id) @@ -3899,7 +3899,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.ListDeploymentLog(ctx, id) if err != nil { @@ -3915,7 +3915,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.ListDeploymentLogSlot(ctx, id) if err != nil { @@ -3948,7 +3948,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListDeploymentsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListDeploymentsSlotComplete(ctx, id) @@ -3982,7 +3982,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListDomainOwnershipIdentifiersSlot(ctx, id)` can be used to do batched pagination items, err := client.ListDomainOwnershipIdentifiersSlotComplete(ctx, id) @@ -3999,7 +3999,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.ListFunctionKeys(ctx, id) if err != nil { @@ -4015,7 +4015,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.ListFunctionKeysSlot(ctx, id) if err != nil { @@ -4031,7 +4031,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.ListFunctionSecrets(ctx, id) if err != nil { @@ -4047,7 +4047,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.ListFunctionSecretsSlot(ctx, id) if err != nil { @@ -4096,7 +4096,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListHostKeysSlot(ctx, id) if err != nil { @@ -4129,7 +4129,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListHostNameBindingsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListHostNameBindingsSlotComplete(ctx, id) @@ -4162,7 +4162,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListHybridConnectionsSlot(ctx, id) if err != nil { @@ -4178,7 +4178,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceFunctionsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceFunctionsSlotComplete(ctx, id) @@ -4212,7 +4212,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceIdentifiersSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceIdentifiersSlotComplete(ctx, id) @@ -4229,7 +4229,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") // alternatively `client.ListInstanceProcessModules(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessModulesComplete(ctx, id) @@ -4246,7 +4246,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") // alternatively `client.ListInstanceProcessModulesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessModulesSlotComplete(ctx, id) @@ -4263,7 +4263,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") // alternatively `client.ListInstanceProcessThreads(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessThreadsComplete(ctx, id) @@ -4280,7 +4280,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") // alternatively `client.ListInstanceProcessThreadsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessThreadsSlotComplete(ctx, id) @@ -4297,7 +4297,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") // alternatively `client.ListInstanceProcesses(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessesComplete(ctx, id) @@ -4314,7 +4314,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") // alternatively `client.ListInstanceProcessesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessesSlotComplete(ctx, id) @@ -4331,7 +4331,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceWorkflowsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceWorkflowsSlotComplete(ctx, id) @@ -4364,7 +4364,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListMetadataSlot(ctx, id) if err != nil { @@ -4380,7 +4380,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view") +id := webapps.NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName") read, err := client.ListNetworkFeatures(ctx, id) if err != nil { @@ -4396,7 +4396,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view") +id := webapps.NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName") read, err := client.ListNetworkFeaturesSlot(ctx, id) if err != nil { @@ -4429,7 +4429,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListPerfMonCountersSlot(ctx, id, webapps.DefaultListPerfMonCountersSlotOperationOptions())` can be used to do batched pagination items, err := client.ListPerfMonCountersSlotComplete(ctx, id, webapps.DefaultListPerfMonCountersSlotOperationOptions()) @@ -4462,7 +4462,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListPremierAddOnsSlot(ctx, id) if err != nil { @@ -4478,7 +4478,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") // alternatively `client.ListProcessModules(ctx, id)` can be used to do batched pagination items, err := client.ListProcessModulesComplete(ctx, id) @@ -4495,7 +4495,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") // alternatively `client.ListProcessModulesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessModulesSlotComplete(ctx, id) @@ -4512,7 +4512,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") // alternatively `client.ListProcessThreads(ctx, id)` can be used to do batched pagination items, err := client.ListProcessThreadsComplete(ctx, id) @@ -4529,7 +4529,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") // alternatively `client.ListProcessThreadsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessThreadsSlotComplete(ctx, id) @@ -4563,7 +4563,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListProcessesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessesSlotComplete(ctx, id) @@ -4614,7 +4614,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListPublicCertificatesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListPublicCertificatesSlotComplete(ctx, id) @@ -4643,7 +4643,7 @@ if err := client.ListPublishingCredentialsThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.ListPublishingCredentialsSlotThenPoll(ctx, id); err != nil { // handle the error @@ -4676,7 +4676,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingProfileOptions{ // ... @@ -4713,7 +4713,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListRelayServiceConnectionsSlot(ctx, id) if err != nil { @@ -4746,7 +4746,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteBackupsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteBackupsSlotComplete(ctx, id) @@ -4780,7 +4780,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteExtensionsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteExtensionsSlotComplete(ctx, id) @@ -4813,7 +4813,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSitePushSettingsSlot(ctx, id) if err != nil { @@ -4867,7 +4867,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -4889,7 +4889,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSlotSiteDeploymentStatusesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSlotSiteDeploymentStatusesSlotComplete(ctx, id) @@ -4957,7 +4957,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSnapshotsFromDRSecondarySlot(ctx, id)` can be used to do batched pagination items, err := client.ListSnapshotsFromDRSecondarySlotComplete(ctx, id) @@ -4974,7 +4974,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSnapshotsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSnapshotsSlotComplete(ctx, id) @@ -5007,7 +5007,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSyncFunctionTriggersSlot(ctx, id) if err != nil { @@ -5039,7 +5039,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSyncStatusSlot(ctx, id) if err != nil { @@ -5055,7 +5055,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") // alternatively `client.ListTriggeredWebJobHistory(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobHistoryComplete(ctx, id) @@ -5072,7 +5072,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") // alternatively `client.ListTriggeredWebJobHistorySlot(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobHistorySlotComplete(ctx, id) @@ -5106,7 +5106,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListTriggeredWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobsSlotComplete(ctx, id) @@ -5140,7 +5140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListUsagesSlot(ctx, id, webapps.DefaultListUsagesSlotOperationOptions())` can be used to do batched pagination items, err := client.ListUsagesSlotComplete(ctx, id, webapps.DefaultListUsagesSlotOperationOptions()) @@ -5173,7 +5173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListVnetConnectionsSlot(ctx, id) if err != nil { @@ -5206,7 +5206,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListWebJobsSlotComplete(ctx, id) @@ -5256,7 +5256,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListWorkflowsConnectionsSlot(ctx, id) if err != nil { @@ -5327,7 +5327,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.PrivateAccess{ // ... @@ -5348,7 +5348,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") +id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") read, err := client.RecoverSiteConfigurationSnapshot(ctx, id) if err != nil { @@ -5364,7 +5364,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") +id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") read, err := client.RecoverSiteConfigurationSnapshotSlot(ctx, id) if err != nil { @@ -5396,7 +5396,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ResetSlotConfigurationSlot(ctx, id) if err != nil { @@ -5428,7 +5428,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.RestartSlot(ctx, id, webapps.DefaultRestartSlotOperationOptions()) if err != nil { @@ -5444,7 +5444,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") payload := webapps.RestoreRequest{ // ... @@ -5478,7 +5478,7 @@ if err := client.RestoreFromBackupBlobThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.RestoreRequest{ // ... @@ -5512,7 +5512,7 @@ if err := client.RestoreFromDeletedAppThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.DeletedAppRestoreRequest{ // ... @@ -5529,7 +5529,7 @@ if err := client.RestoreFromDeletedAppSlotThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") payload := webapps.RestoreRequest{ // ... @@ -5563,7 +5563,7 @@ if err := client.RestoreSnapshotThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SnapshotRestoreRequest{ // ... @@ -5580,7 +5580,7 @@ if err := client.RestoreSnapshotSlotThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.RunTriggeredWebJob(ctx, id) if err != nil { @@ -5596,7 +5596,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.RunTriggeredWebJobSlot(ctx, id) if err != nil { @@ -5628,7 +5628,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.StartContinuousWebJob(ctx, id) if err != nil { @@ -5644,7 +5644,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.StartContinuousWebJobSlot(ctx, id) if err != nil { @@ -5672,7 +5672,7 @@ if err := client.StartNetworkTraceThenPoll(ctx, id, webapps.DefaultStartNetworkT ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.StartNetworkTraceSlotThenPoll(ctx, id, webapps.DefaultStartNetworkTraceSlotOperationOptions()); err != nil { // handle the error @@ -5684,7 +5684,7 @@ if err := client.StartNetworkTraceSlotThenPoll(ctx, id, webapps.DefaultStartNetw ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StartSlot(ctx, id) if err != nil { @@ -5728,7 +5728,7 @@ if err := client.StartWebSiteNetworkTraceOperationThenPoll(ctx, id, webapps.Defa ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.StartWebSiteNetworkTraceOperationSlotThenPoll(ctx, id, webapps.DefaultStartWebSiteNetworkTraceOperationSlotOperationOptions()); err != nil { // handle the error @@ -5740,7 +5740,7 @@ if err := client.StartWebSiteNetworkTraceOperationSlotThenPoll(ctx, id, webapps. ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StartWebSiteNetworkTraceSlot(ctx, id, webapps.DefaultStartWebSiteNetworkTraceSlotOperationOptions()) if err != nil { @@ -5772,7 +5772,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.StopContinuousWebJob(ctx, id) if err != nil { @@ -5788,7 +5788,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.StopContinuousWebJobSlot(ctx, id) if err != nil { @@ -5820,7 +5820,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopNetworkTraceSlot(ctx, id) if err != nil { @@ -5836,7 +5836,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopSlot(ctx, id) if err != nil { @@ -5868,7 +5868,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopWebSiteNetworkTraceSlot(ctx, id) if err != nil { @@ -5884,7 +5884,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -5934,7 +5934,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncFunctionTriggersSlot(ctx, id) if err != nil { @@ -5966,7 +5966,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncFunctionsSlot(ctx, id) if err != nil { @@ -5998,7 +5998,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncRepositorySlot(ctx, id) if err != nil { @@ -6056,7 +6056,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.StringDictionary{ // ... @@ -6098,7 +6098,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteAuthSettings{ // ... @@ -6140,7 +6140,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteAuthSettingsV2{ // ... @@ -6182,7 +6182,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.AzureStoragePropertyDictionaryResource{ // ... @@ -6224,7 +6224,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.BackupRequest{ // ... @@ -6266,7 +6266,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteConfigResource{ // ... @@ -6308,7 +6308,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.ConnectionStringDictionary{ // ... @@ -6350,7 +6350,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteLogsConfig{ // ... @@ -6371,7 +6371,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -6392,7 +6392,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -6434,7 +6434,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingCredentialsPoliciesEntity{ // ... @@ -6455,7 +6455,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -6476,7 +6476,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -6518,7 +6518,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.StringDictionary{ // ... @@ -6539,7 +6539,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") payload := webapps.PremierAddOnPatchResource{ // ... @@ -6560,7 +6560,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") payload := webapps.PremierAddOnPatchResource{ // ... @@ -6581,7 +6581,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -6602,7 +6602,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -6644,7 +6644,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingCredentialsPoliciesEntity{ // ... @@ -6686,7 +6686,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.PushSettings{ // ... @@ -6707,7 +6707,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SitePatchResource{ // ... @@ -6770,7 +6770,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteSourceControl{ // ... @@ -6812,7 +6812,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SwiftVirtualNetwork{ // ... @@ -6833,7 +6833,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -6854,7 +6854,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -6875,7 +6875,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -6896,7 +6896,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... diff --git a/resource-manager/web/2023-01-01/webapps/id_appsetting.go b/resource-manager/web/2023-01-01/webapps/id_appsetting.go index 59084b46370..ecd9386b62d 100644 --- a/resource-manager/web/2023-01-01/webapps/id_appsetting.go +++ b/resource-manager/web/2023-01-01/webapps/id_appsetting.go @@ -121,7 +121,7 @@ func (id AppSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticAppSettings", "appSettings", "appSettings"), diff --git a/resource-manager/web/2023-01-01/webapps/id_appsetting_test.go b/resource-manager/web/2023-01-01/webapps/id_appsetting_test.go index 6dda19ec1e7..b7bbe12fe12 100644 --- a/resource-manager/web/2023-01-01/webapps/id_appsetting_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_appsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AppSettingId{} func TestNewAppSettingID(t *testing.T) { - id := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey") + id := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAppSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.AppSettingKey != "appSettingKey" { @@ -32,8 +32,8 @@ func TestNewAppSettingID(t *testing.T) { } func TestFormatAppSettingID(t *testing.T) { - actual := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey" + actual := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseAppSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseAppSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", AppSettingKey: "aPpSeTtInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_backup.go b/resource-manager/web/2023-01-01/webapps/id_backup.go index 3ef9859edca..84ecf422bfb 100644 --- a/resource-manager/web/2023-01-01/webapps/id_backup.go +++ b/resource-manager/web/2023-01-01/webapps/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupId", "backupId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_backup_test.go b/resource-manager/web/2023-01-01/webapps/id_backup_test.go index 02c1370b786..5e0f8fc3dab 100644 --- a/resource-manager/web/2023-01-01/webapps/id_backup_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.BackupId != "backupId" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs/bAcKuPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs/bAcKuPiD", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", BackupId: "bAcKuPiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs/bAcKuPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs/bAcKuPiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_configreferenceappsetting.go b/resource-manager/web/2023-01-01/webapps/id_configreferenceappsetting.go index 532f4c47969..0be15f20c3d 100644 --- a/resource-manager/web/2023-01-01/webapps/id_configreferenceappsetting.go +++ b/resource-manager/web/2023-01-01/webapps/id_configreferenceappsetting.go @@ -127,9 +127,9 @@ func (id ConfigReferenceAppSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticAppSettings", "appSettings", "appSettings"), diff --git a/resource-manager/web/2023-01-01/webapps/id_configreferenceappsetting_test.go b/resource-manager/web/2023-01-01/webapps/id_configreferenceappsetting_test.go index d27dfeb32ce..1b5073a3b78 100644 --- a/resource-manager/web/2023-01-01/webapps/id_configreferenceappsetting_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_configreferenceappsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigReferenceAppSettingId{} func TestNewConfigReferenceAppSettingID(t *testing.T) { - id := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey") + id := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewConfigReferenceAppSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.AppSettingKey != "appSettingKey" { @@ -36,8 +36,8 @@ func TestNewConfigReferenceAppSettingID(t *testing.T) { } func TestFormatConfigReferenceAppSettingID(t *testing.T) { - actual := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey" + actual := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseConfigReferenceAppSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseConfigReferenceAppSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", AppSettingKey: "aPpSeTtInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_configreferenceconnectionstring.go b/resource-manager/web/2023-01-01/webapps/id_configreferenceconnectionstring.go index 8d47f02f5a1..63353893f7d 100644 --- a/resource-manager/web/2023-01-01/webapps/id_configreferenceconnectionstring.go +++ b/resource-manager/web/2023-01-01/webapps/id_configreferenceconnectionstring.go @@ -127,9 +127,9 @@ func (id ConfigReferenceConnectionStringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticConnectionStrings", "connectionStrings", "connectionStrings"), diff --git a/resource-manager/web/2023-01-01/webapps/id_configreferenceconnectionstring_test.go b/resource-manager/web/2023-01-01/webapps/id_configreferenceconnectionstring_test.go index b1b2536a50e..a18b81f139f 100644 --- a/resource-manager/web/2023-01-01/webapps/id_configreferenceconnectionstring_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_configreferenceconnectionstring_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigReferenceConnectionStringId{} func TestNewConfigReferenceConnectionStringID(t *testing.T) { - id := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey") + id := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewConfigReferenceConnectionStringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ConnectionStringKey != "connectionStringKey" { @@ -36,8 +36,8 @@ func TestNewConfigReferenceConnectionStringID(t *testing.T) { } func TestFormatConfigReferenceConnectionStringID(t *testing.T) { - actual := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey" + actual := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseConfigReferenceConnectionStringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseConfigReferenceConnectionStringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ConnectionStringKey: "cOnNeCtIoNsTrInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_connectionstring.go b/resource-manager/web/2023-01-01/webapps/id_connectionstring.go index 15ab1745be8..5282e76e282 100644 --- a/resource-manager/web/2023-01-01/webapps/id_connectionstring.go +++ b/resource-manager/web/2023-01-01/webapps/id_connectionstring.go @@ -121,7 +121,7 @@ func (id ConnectionStringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticConnectionStrings", "connectionStrings", "connectionStrings"), diff --git a/resource-manager/web/2023-01-01/webapps/id_connectionstring_test.go b/resource-manager/web/2023-01-01/webapps/id_connectionstring_test.go index de1af457233..c4310a2bd0d 100644 --- a/resource-manager/web/2023-01-01/webapps/id_connectionstring_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_connectionstring_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionStringId{} func TestNewConnectionStringID(t *testing.T) { - id := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey") + id := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConnectionStringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ConnectionStringKey != "connectionStringKey" { @@ -32,8 +32,8 @@ func TestNewConnectionStringID(t *testing.T) { } func TestFormatConnectionStringID(t *testing.T) { - actual := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey" + actual := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseConnectionStringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseConnectionStringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ConnectionStringKey: "cOnNeCtIoNsTrInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_continuouswebjob.go b/resource-manager/web/2023-01-01/webapps/id_continuouswebjob.go index a9bf0269a2f..b25215a56ac 100644 --- a/resource-manager/web/2023-01-01/webapps/id_continuouswebjob.go +++ b/resource-manager/web/2023-01-01/webapps/id_continuouswebjob.go @@ -121,9 +121,9 @@ func (id ContinuousWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticContinuousWebJobs", "continuousWebJobs", "continuousWebJobs"), - resourceids.UserSpecifiedSegment("continuousWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("continuousWebJobName", "continuousWebJobName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_continuouswebjob_test.go b/resource-manager/web/2023-01-01/webapps/id_continuouswebjob_test.go index 9cf5e8d6b69..9dbfdc97ffc 100644 --- a/resource-manager/web/2023-01-01/webapps/id_continuouswebjob_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_continuouswebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContinuousWebJobId{} func TestNewContinuousWebJobID(t *testing.T) { - id := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewContinuousWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.ContinuousWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "webJobName") + if id.ContinuousWebJobName != "continuousWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "continuousWebJobName") } } func TestFormatContinuousWebJobID(t *testing.T) { - actual := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName" + actual := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseContinuousWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseContinuousWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - ContinuousWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + ContinuousWebJobName: "cOnTiNuOuSwEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_default.go b/resource-manager/web/2023-01-01/webapps/id_default.go index 254bc8a89a0..82b1628663d 100644 --- a/resource-manager/web/2023-01-01/webapps/id_default.go +++ b/resource-manager/web/2023-01-01/webapps/id_default.go @@ -127,10 +127,10 @@ func (id DefaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHost", "host", "host"), resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.UserSpecifiedSegment("defaultName", "keyType"), + resourceids.UserSpecifiedSegment("defaultName", "defaultName"), resourceids.UserSpecifiedSegment("keyName", "keyName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_default_test.go b/resource-manager/web/2023-01-01/webapps/id_default_test.go index ba20a5368c1..fb8f07676f0 100644 --- a/resource-manager/web/2023-01-01/webapps/id_default_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_default_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DefaultId{} func TestNewDefaultID(t *testing.T) { - id := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") + id := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewDefaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DefaultName != "keyType" { - t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "keyType") + if id.DefaultName != "defaultName" { + t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "defaultName") } if id.KeyName != "keyName" { @@ -36,8 +36,8 @@ func TestNewDefaultID(t *testing.T) { } func TestFormatDefaultID(t *testing.T) { - actual := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName" + actual := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseDefaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DefaultName: "keyType", + SiteName: "siteName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseDefaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DefaultName: "keyType", + SiteName: "siteName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - DefaultName: "kEyTyPe", + SiteName: "sItEnAmE", + DefaultName: "dEfAuLtNaMe", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_deployment.go b/resource-manager/web/2023-01-01/webapps/id_deployment.go index 5f0c95f64d3..6b9e4f1fdf3 100644 --- a/resource-manager/web/2023-01-01/webapps/id_deployment.go +++ b/resource-manager/web/2023-01-01/webapps/id_deployment.go @@ -121,9 +121,9 @@ func (id DeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), - resourceids.UserSpecifiedSegment("deploymentName", "id"), + resourceids.UserSpecifiedSegment("deploymentName", "deploymentName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_deployment_test.go b/resource-manager/web/2023-01-01/webapps/id_deployment_test.go index d25ecc8b37f..01e80a6d68b 100644 --- a/resource-manager/web/2023-01-01/webapps/id_deployment_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_deployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeploymentId{} func TestNewDeploymentID(t *testing.T) { - id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") + id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DeploymentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "id") + if id.DeploymentName != "deploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "deploymentName") } } func TestFormatDeploymentID(t *testing.T) { - actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id" + actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DeploymentName: "id", + SiteName: "siteName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DeploymentName: "id", + SiteName: "siteName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - DeploymentName: "iD", + SiteName: "sItEnAmE", + DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_function.go b/resource-manager/web/2023-01-01/webapps/id_function.go index f13ac6949c4..f616aeae83a 100644 --- a/resource-manager/web/2023-01-01/webapps/id_function.go +++ b/resource-manager/web/2023-01-01/webapps/id_function.go @@ -121,7 +121,7 @@ func (id FunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_function_test.go b/resource-manager/web/2023-01-01/webapps/id_function_test.go index 9380b24f46c..647ee45180b 100644 --- a/resource-manager/web/2023-01-01/webapps/id_function_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_function_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionId{} func TestNewFunctionID(t *testing.T) { - id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") + id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.FunctionName != "functionName" { @@ -32,8 +32,8 @@ func TestNewFunctionID(t *testing.T) { } func TestFormatFunctionID(t *testing.T) { - actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName" + actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_functionkey.go b/resource-manager/web/2023-01-01/webapps/id_functionkey.go index 6b146a6c1d6..2c5e6ac58da 100644 --- a/resource-manager/web/2023-01-01/webapps/id_functionkey.go +++ b/resource-manager/web/2023-01-01/webapps/id_functionkey.go @@ -133,9 +133,9 @@ func (id FunctionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), diff --git a/resource-manager/web/2023-01-01/webapps/id_functionkey_test.go b/resource-manager/web/2023-01-01/webapps/id_functionkey_test.go index c90a9b7f5bd..d5c2d17970d 100644 --- a/resource-manager/web/2023-01-01/webapps/id_functionkey_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_functionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionKeyId{} func TestNewFunctionKeyID(t *testing.T) { - id := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") + id := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewFunctionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.FunctionName != "functionName" { @@ -40,8 +40,8 @@ func TestNewFunctionKeyID(t *testing.T) { } func TestFormatFunctionKeyID(t *testing.T) { - actual := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName" + actual := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseFunctionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseFunctionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", FunctionName: "fUnCtIoNnAmE", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_gateway.go b/resource-manager/web/2023-01-01/webapps/id_gateway.go index aa57771776c..0d5dc900e0d 100644 --- a/resource-manager/web/2023-01-01/webapps/id_gateway.go +++ b/resource-manager/web/2023-01-01/webapps/id_gateway.go @@ -127,9 +127,9 @@ func (id GatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_gateway_test.go b/resource-manager/web/2023-01-01/webapps/id_gateway_test.go index b4b752195f7..7bbd4aac0a9 100644 --- a/resource-manager/web/2023-01-01/webapps/id_gateway_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_gateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GatewayId{} func TestNewGatewayID(t *testing.T) { - id := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") + id := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -36,8 +36,8 @@ func TestNewGatewayID(t *testing.T) { } func TestFormatGatewayID(t *testing.T) { - actual := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_history.go b/resource-manager/web/2023-01-01/webapps/id_history.go index 20c6af22958..c1cc260d497 100644 --- a/resource-manager/web/2023-01-01/webapps/id_history.go +++ b/resource-manager/web/2023-01-01/webapps/id_history.go @@ -127,11 +127,11 @@ func (id HistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), resourceids.StaticSegment("staticHistory", "history", "history"), - resourceids.UserSpecifiedSegment("historyName", "id"), + resourceids.UserSpecifiedSegment("historyName", "historyName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_history_test.go b/resource-manager/web/2023-01-01/webapps/id_history_test.go index 3289e52eac8..d3d2ed22f07 100644 --- a/resource-manager/web/2023-01-01/webapps/id_history_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_history_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HistoryId{} func TestNewHistoryID(t *testing.T) { - id := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id") + id := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } - if id.HistoryName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "id") + if id.HistoryName != "historyName" { + t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "historyName") } } func TestFormatHistoryID(t *testing.T) { - actual := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id" + actual := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - TriggeredWebJobName: "wEbJoBnAmE", - HistoryName: "iD", + SiteName: "sItEnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", + HistoryName: "hIsToRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_hostdefault.go b/resource-manager/web/2023-01-01/webapps/id_hostdefault.go index 980fea18eb4..d02b1ff58fb 100644 --- a/resource-manager/web/2023-01-01/webapps/id_hostdefault.go +++ b/resource-manager/web/2023-01-01/webapps/id_hostdefault.go @@ -133,12 +133,12 @@ func (id HostDefaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHost", "host", "host"), resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.UserSpecifiedSegment("defaultName", "keyType"), + resourceids.UserSpecifiedSegment("defaultName", "defaultName"), resourceids.UserSpecifiedSegment("keyName", "keyName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_hostdefault_test.go b/resource-manager/web/2023-01-01/webapps/id_hostdefault_test.go index 262ebd9947d..4f3bb7c417c 100644 --- a/resource-manager/web/2023-01-01/webapps/id_hostdefault_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_hostdefault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostDefaultId{} func TestNewHostDefaultID(t *testing.T) { - id := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") + id := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewHostDefaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DefaultName != "keyType" { - t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "keyType") + if id.DefaultName != "defaultName" { + t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "defaultName") } if id.KeyName != "keyName" { @@ -40,8 +40,8 @@ func TestNewHostDefaultID(t *testing.T) { } func TestFormatHostDefaultID(t *testing.T) { - actual := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName" + actual := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseHostDefaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DefaultName: "keyType", + SiteName: "siteName", + SlotName: "slotName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseHostDefaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DefaultName: "keyType", + SiteName: "siteName", + SlotName: "slotName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - DefaultName: "kEyTyPe", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + DefaultName: "dEfAuLtNaMe", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_hostnamebinding.go b/resource-manager/web/2023-01-01/webapps/id_hostnamebinding.go index 9959ddc39e8..56a4b8e3fba 100644 --- a/resource-manager/web/2023-01-01/webapps/id_hostnamebinding.go +++ b/resource-manager/web/2023-01-01/webapps/id_hostnamebinding.go @@ -121,9 +121,9 @@ func (id HostNameBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostNameBindings", "hostNameBindings", "hostNameBindings"), - resourceids.UserSpecifiedSegment("hostNameBindingName", "hostName"), + resourceids.UserSpecifiedSegment("hostNameBindingName", "hostNameBindingName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_hostnamebinding_test.go b/resource-manager/web/2023-01-01/webapps/id_hostnamebinding_test.go index ffa929dffdd..a3b55f6e522 100644 --- a/resource-manager/web/2023-01-01/webapps/id_hostnamebinding_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_hostnamebinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostNameBindingId{} func TestNewHostNameBindingID(t *testing.T) { - id := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") + id := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHostNameBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HostNameBindingName != "hostName" { - t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostName") + if id.HostNameBindingName != "hostNameBindingName" { + t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostNameBindingName") } } func TestFormatHostNameBindingID(t *testing.T) { - actual := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName" + actual := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostNameBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HostNameBindingName: "hostName", + SiteName: "siteName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostNameBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HostNameBindingName: "hostName", + SiteName: "siteName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS/hOsTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HostNameBindingName: "hOsTnAmE", + SiteName: "sItEnAmE", + HostNameBindingName: "hOsTnAmEbInDiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS/hOsTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_hybridconnection.go b/resource-manager/web/2023-01-01/webapps/id_hybridconnection.go index 02bb4f49003..643e1f811d9 100644 --- a/resource-manager/web/2023-01-01/webapps/id_hybridconnection.go +++ b/resource-manager/web/2023-01-01/webapps/id_hybridconnection.go @@ -121,9 +121,9 @@ func (id HybridConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHybridConnection", "hybridConnection", "hybridConnection"), - resourceids.UserSpecifiedSegment("hybridConnectionName", "entityName"), + resourceids.UserSpecifiedSegment("hybridConnectionName", "hybridConnectionName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_hybridconnection_test.go b/resource-manager/web/2023-01-01/webapps/id_hybridconnection_test.go index 5580974235b..db79679c1a3 100644 --- a/resource-manager/web/2023-01-01/webapps/id_hybridconnection_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_hybridconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HybridConnectionId{} func TestNewHybridConnectionID(t *testing.T) { - id := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") + id := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHybridConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HybridConnectionName != "entityName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "entityName") + if id.HybridConnectionName != "hybridConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "hybridConnectionName") } } func TestFormatHybridConnectionID(t *testing.T) { - actual := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName" + actual := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHybridConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionName: "entityName", + SiteName: "siteName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHybridConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionName: "entityName", + SiteName: "siteName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN/eNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HybridConnectionName: "eNtItYnAmE", + SiteName: "sItEnAmE", + HybridConnectionName: "hYbRiDcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN/eNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_instance.go b/resource-manager/web/2023-01-01/webapps/id_instance.go index 25203793a81..f43fc67da55 100644 --- a/resource-manager/web/2023-01-01/webapps/id_instance.go +++ b/resource-manager/web/2023-01-01/webapps/id_instance.go @@ -121,7 +121,7 @@ func (id InstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_instance_test.go b/resource-manager/web/2023-01-01/webapps/id_instance_test.go index c4429391ddb..34b663d63cc 100644 --- a/resource-manager/web/2023-01-01/webapps/id_instance_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_instance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceId{} func TestNewInstanceID(t *testing.T) { - id := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") + id := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -32,8 +32,8 @@ func TestNewInstanceID(t *testing.T) { } func TestFormatInstanceID(t *testing.T) { - actual := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId" + actual := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_instanceprocess.go b/resource-manager/web/2023-01-01/webapps/id_instanceprocess.go index 55adc768077..86610e6df3c 100644 --- a/resource-manager/web/2023-01-01/webapps/id_instanceprocess.go +++ b/resource-manager/web/2023-01-01/webapps/id_instanceprocess.go @@ -127,7 +127,7 @@ func (id InstanceProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), diff --git a/resource-manager/web/2023-01-01/webapps/id_instanceprocess_test.go b/resource-manager/web/2023-01-01/webapps/id_instanceprocess_test.go index 96f28a0d8b3..dbfed807250 100644 --- a/resource-manager/web/2023-01-01/webapps/id_instanceprocess_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_instanceprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceProcessId{} func TestNewInstanceProcessID(t *testing.T) { - id := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") + id := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -36,8 +36,8 @@ func TestNewInstanceProcessID(t *testing.T) { } func TestFormatInstanceProcessID(t *testing.T) { - actual := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId" + actual := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseInstanceProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseInstanceProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_instanceprocessmodule.go b/resource-manager/web/2023-01-01/webapps/id_instanceprocessmodule.go index 5b146947462..28225e030f5 100644 --- a/resource-manager/web/2023-01-01/webapps/id_instanceprocessmodule.go +++ b/resource-manager/web/2023-01-01/webapps/id_instanceprocessmodule.go @@ -133,13 +133,13 @@ func (id InstanceProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_instanceprocessmodule_test.go b/resource-manager/web/2023-01-01/webapps/id_instanceprocessmodule_test.go index 62ccb13e72d..7e118c5f387 100644 --- a/resource-manager/web/2023-01-01/webapps/id_instanceprocessmodule_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_instanceprocessmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceProcessModuleId{} func TestNewInstanceProcessModuleID(t *testing.T) { - id := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress") + id := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -34,14 +34,14 @@ func TestNewInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatInstanceProcessModuleID(t *testing.T) { - actual := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress" + actual := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseInstanceProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseInstanceProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_key.go b/resource-manager/web/2023-01-01/webapps/id_key.go index c0b37b03506..ca9170618d4 100644 --- a/resource-manager/web/2023-01-01/webapps/id_key.go +++ b/resource-manager/web/2023-01-01/webapps/id_key.go @@ -127,7 +127,7 @@ func (id KeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), diff --git a/resource-manager/web/2023-01-01/webapps/id_key_test.go b/resource-manager/web/2023-01-01/webapps/id_key_test.go index 7ebef22f14b..0d951499006 100644 --- a/resource-manager/web/2023-01-01/webapps/id_key_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_key_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KeyId{} func TestNewKeyID(t *testing.T) { - id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") + id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.FunctionName != "functionName" { @@ -36,8 +36,8 @@ func TestNewKeyID(t *testing.T) { } func TestFormatKeyID(t *testing.T) { - actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName" + actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", FunctionName: "fUnCtIoNnAmE", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_module.go b/resource-manager/web/2023-01-01/webapps/id_module.go index a4d421216a9..88421388b85 100644 --- a/resource-manager/web/2023-01-01/webapps/id_module.go +++ b/resource-manager/web/2023-01-01/webapps/id_module.go @@ -127,11 +127,11 @@ func (id ModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_module_test.go b/resource-manager/web/2023-01-01/webapps/id_module_test.go index d97537ae112..d5e57223ef0 100644 --- a/resource-manager/web/2023-01-01/webapps/id_module_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_module_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModuleId{} func TestNewModuleID(t *testing.T) { - id := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress") + id := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ProcessId != "processId" { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatModuleID(t *testing.T) { - actual := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress" + actual := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_networkfeature.go b/resource-manager/web/2023-01-01/webapps/id_networkfeature.go index fd2923f194e..dc1966efd90 100644 --- a/resource-manager/web/2023-01-01/webapps/id_networkfeature.go +++ b/resource-manager/web/2023-01-01/webapps/id_networkfeature.go @@ -121,9 +121,9 @@ func (id NetworkFeatureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkFeatures", "networkFeatures", "networkFeatures"), - resourceids.UserSpecifiedSegment("networkFeatureName", "view"), + resourceids.UserSpecifiedSegment("networkFeatureName", "networkFeatureName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_networkfeature_test.go b/resource-manager/web/2023-01-01/webapps/id_networkfeature_test.go index 3b6fe10b0f0..1c1bafc5113 100644 --- a/resource-manager/web/2023-01-01/webapps/id_networkfeature_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_networkfeature_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkFeatureId{} func TestNewNetworkFeatureID(t *testing.T) { - id := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view") + id := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewNetworkFeatureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.NetworkFeatureName != "view" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "view") + if id.NetworkFeatureName != "networkFeatureName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "networkFeatureName") } } func TestFormatNetworkFeatureID(t *testing.T) { - actual := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view" + actual := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkFeatureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - NetworkFeatureName: "view", + SiteName: "siteName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - NetworkFeatureName: "view", + SiteName: "siteName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs/vIeW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - NetworkFeatureName: "vIeW", + SiteName: "sItEnAmE", + NetworkFeatureName: "nEtWoRkFeAtUrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs/vIeW/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_networktrace.go b/resource-manager/web/2023-01-01/webapps/id_networktrace.go index 1e29b968bba..d7b89a69dd1 100644 --- a/resource-manager/web/2023-01-01/webapps/id_networktrace.go +++ b/resource-manager/web/2023-01-01/webapps/id_networktrace.go @@ -121,7 +121,7 @@ func (id NetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkTrace", "networkTrace", "networkTrace"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_networktrace_test.go b/resource-manager/web/2023-01-01/webapps/id_networktrace_test.go index 6147556e678..2ca9e11dd67 100644 --- a/resource-manager/web/2023-01-01/webapps/id_networktrace_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_networktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkTraceId{} func TestNewNetworkTraceID(t *testing.T) { - id := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") + id := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.OperationId != "operationId" { @@ -32,8 +32,8 @@ func TestNewNetworkTraceID(t *testing.T) { } func TestFormatNetworkTraceID(t *testing.T) { - actual := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId" + actual := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE/oPeRaTiOnId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_premieraddon.go b/resource-manager/web/2023-01-01/webapps/id_premieraddon.go index f926683223a..e2a7b5cf220 100644 --- a/resource-manager/web/2023-01-01/webapps/id_premieraddon.go +++ b/resource-manager/web/2023-01-01/webapps/id_premieraddon.go @@ -121,9 +121,9 @@ func (id PremierAddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPremierAddons", "premierAddons", "premierAddons"), - resourceids.UserSpecifiedSegment("premierAddonName", "premierAddOnName"), + resourceids.UserSpecifiedSegment("premierAddonName", "premierAddonName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_premieraddon_test.go b/resource-manager/web/2023-01-01/webapps/id_premieraddon_test.go index e14985cf82a..2c292945ce2 100644 --- a/resource-manager/web/2023-01-01/webapps/id_premieraddon_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_premieraddon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PremierAddonId{} func TestNewPremierAddonID(t *testing.T) { - id := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") + id := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPremierAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.PremierAddonName != "premierAddOnName" { - t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddOnName") + if id.PremierAddonName != "premierAddonName" { + t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddonName") } } func TestFormatPremierAddonID(t *testing.T) { - actual := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName" + actual := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePremierAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePremierAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PremierAddonName: "pReMiErAdDoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_privateendpointconnection.go b/resource-manager/web/2023-01-01/webapps/id_privateendpointconnection.go index 1504e2b3374..c7d9dfbd7e0 100644 --- a/resource-manager/web/2023-01-01/webapps/id_privateendpointconnection.go +++ b/resource-manager/web/2023-01-01/webapps/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_privateendpointconnection_test.go b/resource-manager/web/2023-01-01/webapps/id_privateendpointconnection_test.go index 9a552e2764d..b8561c67c85 100644 --- a/resource-manager/web/2023-01-01/webapps/id_privateendpointconnection_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_process.go b/resource-manager/web/2023-01-01/webapps/id_process.go index 1c2d61493cb..4bd04a2dc5a 100644 --- a/resource-manager/web/2023-01-01/webapps/id_process.go +++ b/resource-manager/web/2023-01-01/webapps/id_process.go @@ -121,7 +121,7 @@ func (id ProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_process_test.go b/resource-manager/web/2023-01-01/webapps/id_process_test.go index 3c86013b33b..01626642762 100644 --- a/resource-manager/web/2023-01-01/webapps/id_process_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_process_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProcessId{} func TestNewProcessID(t *testing.T) { - id := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") + id := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ProcessId != "processId" { @@ -32,8 +32,8 @@ func TestNewProcessID(t *testing.T) { } func TestFormatProcessID(t *testing.T) { - actual := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId" + actual := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_processmodule.go b/resource-manager/web/2023-01-01/webapps/id_processmodule.go index 87b5d659016..5219175f699 100644 --- a/resource-manager/web/2023-01-01/webapps/id_processmodule.go +++ b/resource-manager/web/2023-01-01/webapps/id_processmodule.go @@ -133,13 +133,13 @@ func (id ProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_processmodule_test.go b/resource-manager/web/2023-01-01/webapps/id_processmodule_test.go index 53e7e1765c4..de7af2c9000 100644 --- a/resource-manager/web/2023-01-01/webapps/id_processmodule_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_processmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProcessModuleId{} func TestNewProcessModuleID(t *testing.T) { - id := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress") + id := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ProcessId != "processId" { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatProcessModuleID(t *testing.T) { - actual := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress" + actual := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_publiccertificate.go b/resource-manager/web/2023-01-01/webapps/id_publiccertificate.go index 5addcaf8c22..ab810e6cab6 100644 --- a/resource-manager/web/2023-01-01/webapps/id_publiccertificate.go +++ b/resource-manager/web/2023-01-01/webapps/id_publiccertificate.go @@ -121,7 +121,7 @@ func (id PublicCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPublicCertificates", "publicCertificates", "publicCertificates"), resourceids.UserSpecifiedSegment("publicCertificateName", "publicCertificateName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_publiccertificate_test.go b/resource-manager/web/2023-01-01/webapps/id_publiccertificate_test.go index 53da52ea695..947dd952615 100644 --- a/resource-manager/web/2023-01-01/webapps/id_publiccertificate_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_publiccertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PublicCertificateId{} func TestNewPublicCertificateID(t *testing.T) { - id := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") + id := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPublicCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.PublicCertificateName != "publicCertificateName" { @@ -32,8 +32,8 @@ func TestNewPublicCertificateID(t *testing.T) { } func TestFormatPublicCertificateID(t *testing.T) { - actual := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName" + actual := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePublicCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePublicCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PublicCertificateName: "pUbLiCcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_relay.go b/resource-manager/web/2023-01-01/webapps/id_relay.go index 9396eaf87db..4af77542a26 100644 --- a/resource-manager/web/2023-01-01/webapps/id_relay.go +++ b/resource-manager/web/2023-01-01/webapps/id_relay.go @@ -127,9 +127,9 @@ func (id RelayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_relay_test.go b/resource-manager/web/2023-01-01/webapps/id_relay_test.go index 858e3cdec80..b0ca40050e1 100644 --- a/resource-manager/web/2023-01-01/webapps/id_relay_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_relay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RelayId{} func TestNewRelayID(t *testing.T) { - id := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") + id := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -36,8 +36,8 @@ func TestNewRelayID(t *testing.T) { } func TestFormatRelayID(t *testing.T) { - actual := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + SiteName: "sItEnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_domainownershipidentifier.go b/resource-manager/web/2023-01-01/webapps/id_sitedomainownershipidentifier.go similarity index 60% rename from resource-manager/web/2023-12-01/webapps/id_domainownershipidentifier.go rename to resource-manager/web/2023-01-01/webapps/id_sitedomainownershipidentifier.go index 3e940af260c..ff59f8417f2 100644 --- a/resource-manager/web/2023-12-01/webapps/id_domainownershipidentifier.go +++ b/resource-manager/web/2023-01-01/webapps/id_sitedomainownershipidentifier.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&DomainOwnershipIdentifierId{}) + recaser.RegisterResourceId(&SiteDomainOwnershipIdentifierId{}) } -var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} +var _ resourceids.ResourceId = &SiteDomainOwnershipIdentifierId{} -// DomainOwnershipIdentifierId is a struct representing the Resource ID for a Domain Ownership Identifier -type DomainOwnershipIdentifierId struct { +// SiteDomainOwnershipIdentifierId is a struct representing the Resource ID for a Site Domain Ownership Identifier +type SiteDomainOwnershipIdentifierId struct { SubscriptionId string ResourceGroupName string SiteName string DomainOwnershipIdentifierName string } -// NewDomainOwnershipIdentifierID returns a new DomainOwnershipIdentifierId struct -func NewDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName string, siteName string, domainOwnershipIdentifierName string) DomainOwnershipIdentifierId { - return DomainOwnershipIdentifierId{ +// NewSiteDomainOwnershipIdentifierID returns a new SiteDomainOwnershipIdentifierId struct +func NewSiteDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName string, siteName string, domainOwnershipIdentifierName string) SiteDomainOwnershipIdentifierId { + return SiteDomainOwnershipIdentifierId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, SiteName: siteName, @@ -35,15 +35,15 @@ func NewDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName str } } -// ParseDomainOwnershipIdentifierID parses 'input' into a DomainOwnershipIdentifierId -func ParseDomainOwnershipIdentifierID(input string) (*DomainOwnershipIdentifierId, error) { - parser := resourceids.NewParserFromResourceIdType(&DomainOwnershipIdentifierId{}) +// ParseSiteDomainOwnershipIdentifierID parses 'input' into a SiteDomainOwnershipIdentifierId +func ParseSiteDomainOwnershipIdentifierID(input string) (*SiteDomainOwnershipIdentifierId, error) { + parser := resourceids.NewParserFromResourceIdType(&SiteDomainOwnershipIdentifierId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DomainOwnershipIdentifierId{} + id := SiteDomainOwnershipIdentifierId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseDomainOwnershipIdentifierID(input string) (*DomainOwnershipIdentifierI return &id, nil } -// ParseDomainOwnershipIdentifierIDInsensitively parses 'input' case-insensitively into a DomainOwnershipIdentifierId +// ParseSiteDomainOwnershipIdentifierIDInsensitively parses 'input' case-insensitively into a SiteDomainOwnershipIdentifierId // note: this method should only be used for API response data and not user input -func ParseDomainOwnershipIdentifierIDInsensitively(input string) (*DomainOwnershipIdentifierId, error) { - parser := resourceids.NewParserFromResourceIdType(&DomainOwnershipIdentifierId{}) +func ParseSiteDomainOwnershipIdentifierIDInsensitively(input string) (*SiteDomainOwnershipIdentifierId, error) { + parser := resourceids.NewParserFromResourceIdType(&SiteDomainOwnershipIdentifierId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DomainOwnershipIdentifierId{} + id := SiteDomainOwnershipIdentifierId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseDomainOwnershipIdentifierIDInsensitively(input string) (*DomainOwnersh return &id, nil } -func (id *DomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseResult) error { +func (id *SiteDomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *DomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseRe return nil } -// ValidateDomainOwnershipIdentifierID checks that 'input' can be parsed as a Domain Ownership Identifier ID -func ValidateDomainOwnershipIdentifierID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateSiteDomainOwnershipIdentifierID checks that 'input' can be parsed as a Site Domain Ownership Identifier ID +func ValidateSiteDomainOwnershipIdentifierID(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 := ParseDomainOwnershipIdentifierID(v); err != nil { + if _, err := ParseSiteDomainOwnershipIdentifierID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) ID() string { +// ID returns the formatted Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/sites/%s/domainOwnershipIdentifiers/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.SiteName, id.DomainOwnershipIdentifierName) } -// Segments returns a slice of Resource ID Segments which comprise this Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -121,19 +121,19 @@ func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } } -// String returns a human-readable description of this Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) String() string { +// String returns a human-readable description of this Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Site Name: %q", id.SiteName), fmt.Sprintf("Domain Ownership Identifier Name: %q", id.DomainOwnershipIdentifierName), } - return fmt.Sprintf("Domain Ownership Identifier (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Site Domain Ownership Identifier (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2023-12-01/webapps/id_domainownershipidentifier_test.go b/resource-manager/web/2023-01-01/webapps/id_sitedomainownershipidentifier_test.go similarity index 82% rename from resource-manager/web/2023-12-01/webapps/id_domainownershipidentifier_test.go rename to resource-manager/web/2023-01-01/webapps/id_sitedomainownershipidentifier_test.go index fca70ae9b3a..db628c3f6c2 100644 --- a/resource-manager/web/2023-12-01/webapps/id_domainownershipidentifier_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_sitedomainownershipidentifier_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} +var _ resourceids.ResourceId = &SiteDomainOwnershipIdentifierId{} -func TestNewDomainOwnershipIdentifierID(t *testing.T) { - id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +func TestNewSiteDomainOwnershipIdentifierID(t *testing.T) { + id := NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { @@ -31,19 +31,19 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { } } -func TestFormatDomainOwnershipIdentifierID(t *testing.T) { - actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName" +func TestFormatSiteDomainOwnershipIdentifierID(t *testing.T) { + actual := NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseDomainOwnershipIdentifierID(t *testing.T) { +func TestParseSiteDomainOwnershipIdentifierID(t *testing.T) { testData := []struct { Input string Error bool - Expected *DomainOwnershipIdentifierId + Expected *SiteDomainOwnershipIdentifierId }{ { // Incomplete URI @@ -87,34 +87,34 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName", - Expected: &DomainOwnershipIdentifierId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDomainOwnershipIdentifierID(v.Input) + actual, err := ParseSiteDomainOwnershipIdentifierID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { } } -func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { +func TestParseSiteDomainOwnershipIdentifierIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *DomainOwnershipIdentifierId + Expected *SiteDomainOwnershipIdentifierId }{ { // Incomplete URI @@ -228,59 +228,59 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName", - Expected: &DomainOwnershipIdentifierId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", - Expected: &DomainOwnershipIdentifierId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDomainOwnershipIdentifierIDInsensitively(v.Input) + actual, err := ParseSiteDomainOwnershipIdentifierIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { } } -func TestSegmentsForDomainOwnershipIdentifierId(t *testing.T) { - segments := DomainOwnershipIdentifierId{}.Segments() +func TestSegmentsForSiteDomainOwnershipIdentifierId(t *testing.T) { + segments := SiteDomainOwnershipIdentifierId{}.Segments() if len(segments) == 0 { - t.Fatalf("DomainOwnershipIdentifierId has no segments") + t.Fatalf("SiteDomainOwnershipIdentifierId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2023-01-01/webapps/id_siteextension.go b/resource-manager/web/2023-01-01/webapps/id_siteextension.go index 17385289ef2..40c85eb38fe 100644 --- a/resource-manager/web/2023-01-01/webapps/id_siteextension.go +++ b/resource-manager/web/2023-01-01/webapps/id_siteextension.go @@ -121,7 +121,7 @@ func (id SiteExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSiteExtensions", "siteExtensions", "siteExtensions"), resourceids.UserSpecifiedSegment("siteExtensionId", "siteExtensionId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_siteextension_test.go b/resource-manager/web/2023-01-01/webapps/id_siteextension_test.go index 47dc5d50a4b..32a89aa57ab 100644 --- a/resource-manager/web/2023-01-01/webapps/id_siteextension_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_siteextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteExtensionId{} func TestNewSiteExtensionID(t *testing.T) { - id := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") + id := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSiteExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.SiteExtensionId != "siteExtensionId" { @@ -32,8 +32,8 @@ func TestNewSiteExtensionID(t *testing.T) { } func TestFormatSiteExtensionID(t *testing.T) { - actual := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId" + actual := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSiteExtensionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSiteExtensionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", SiteExtensionId: "sItEeXtEnSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_sitenetworktrace.go b/resource-manager/web/2023-01-01/webapps/id_sitenetworktrace.go index b281890243a..3274d10301d 100644 --- a/resource-manager/web/2023-01-01/webapps/id_sitenetworktrace.go +++ b/resource-manager/web/2023-01-01/webapps/id_sitenetworktrace.go @@ -121,7 +121,7 @@ func (id SiteNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkTraces", "networkTraces", "networkTraces"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_sitenetworktrace_test.go b/resource-manager/web/2023-01-01/webapps/id_sitenetworktrace_test.go index 29300cecd7f..92c51e2118f 100644 --- a/resource-manager/web/2023-01-01/webapps/id_sitenetworktrace_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_sitenetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteNetworkTraceId{} func TestNewSiteNetworkTraceID(t *testing.T) { - id := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") + id := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSiteNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.OperationId != "operationId" { @@ -32,8 +32,8 @@ func TestNewSiteNetworkTraceID(t *testing.T) { } func TestFormatSiteNetworkTraceID(t *testing.T) { - actual := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId" + actual := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSiteNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSiteNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs/oPeRaTiOnId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_siteslotnetworktrace.go b/resource-manager/web/2023-01-01/webapps/id_siteslotnetworktrace.go index e5bee7517a2..23fbbbb9eab 100644 --- a/resource-manager/web/2023-01-01/webapps/id_siteslotnetworktrace.go +++ b/resource-manager/web/2023-01-01/webapps/id_siteslotnetworktrace.go @@ -127,9 +127,9 @@ func (id SiteSlotNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkTraces", "networkTraces", "networkTraces"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_siteslotnetworktrace_test.go b/resource-manager/web/2023-01-01/webapps/id_siteslotnetworktrace_test.go index f3c78909b42..33e3ff66202 100644 --- a/resource-manager/web/2023-01-01/webapps/id_siteslotnetworktrace_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_siteslotnetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteSlotNetworkTraceId{} func TestNewSiteSlotNetworkTraceID(t *testing.T) { - id := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") + id := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSiteSlotNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.OperationId != "operationId" { @@ -36,8 +36,8 @@ func TestNewSiteSlotNetworkTraceID(t *testing.T) { } func TestFormatSiteSlotNetworkTraceID(t *testing.T) { - actual := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId" + actual := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSiteSlotNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSiteSlotNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs/oPeRaTiOnId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slot.go b/resource-manager/web/2023-01-01/webapps/id_slot.go index 8e908291c1b..620b8a931e0 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slot.go +++ b/resource-manager/web/2023-01-01/webapps/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slot_test.go b/resource-manager/web/2023-01-01/webapps/id_slot_test.go index 9c612d86b14..4ef0619f083 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slot_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotbackup.go b/resource-manager/web/2023-01-01/webapps/id_slotbackup.go index a528a2b155a..1aa5199ef05 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotbackup.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotbackup.go @@ -127,9 +127,9 @@ func (id SlotBackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupId", "backupId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotbackup_test.go b/resource-manager/web/2023-01-01/webapps/id_slotbackup_test.go index d6aa3483217..56eb5f5933f 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotbackup_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotbackup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotBackupId{} func TestNewSlotBackupID(t *testing.T) { - id := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") + id := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.BackupId != "backupId" { @@ -36,8 +36,8 @@ func TestNewSlotBackupID(t *testing.T) { } func TestFormatSlotBackupID(t *testing.T) { - actual := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId" + actual := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs/bAcKuPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs/bAcKuPiD", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", BackupId: "bAcKuPiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs/bAcKuPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs/bAcKuPiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotcontinuouswebjob.go b/resource-manager/web/2023-01-01/webapps/id_slotcontinuouswebjob.go index 949c806fd72..6ca39c98b2e 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotcontinuouswebjob.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotcontinuouswebjob.go @@ -127,11 +127,11 @@ func (id SlotContinuousWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticContinuousWebJobs", "continuousWebJobs", "continuousWebJobs"), - resourceids.UserSpecifiedSegment("continuousWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("continuousWebJobName", "continuousWebJobName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotcontinuouswebjob_test.go b/resource-manager/web/2023-01-01/webapps/id_slotcontinuouswebjob_test.go index 9392d248c38..94be6b075f1 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotcontinuouswebjob_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotcontinuouswebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotContinuousWebJobId{} func TestNewSlotContinuousWebJobID(t *testing.T) { - id := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotContinuousWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.ContinuousWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "webJobName") + if id.ContinuousWebJobName != "continuousWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "continuousWebJobName") } } func TestFormatSlotContinuousWebJobID(t *testing.T) { - actual := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName" + actual := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotContinuousWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotContinuousWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - ContinuousWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + ContinuousWebJobName: "cOnTiNuOuSwEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotdeployment.go b/resource-manager/web/2023-01-01/webapps/id_slotdeployment.go index a3dfd649a34..fe789dce200 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotdeployment.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotdeployment.go @@ -127,11 +127,11 @@ func (id SlotDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), - resourceids.UserSpecifiedSegment("deploymentName", "id"), + resourceids.UserSpecifiedSegment("deploymentName", "deploymentName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotdeployment_test.go b/resource-manager/web/2023-01-01/webapps/id_slotdeployment_test.go index aaeb2a4752e..2ddd1a03e78 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotdeployment_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDeploymentId{} func TestNewSlotDeploymentID(t *testing.T) { - id := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") + id := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DeploymentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "id") + if id.DeploymentName != "deploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "deploymentName") } } func TestFormatSlotDeploymentID(t *testing.T) { - actual := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id" + actual := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DeploymentName: "id", + SiteName: "siteName", + SlotName: "slotName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DeploymentName: "id", + SiteName: "siteName", + SlotName: "slotName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - DeploymentName: "iD", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotdomainownershipidentifier.go b/resource-manager/web/2023-01-01/webapps/id_slotdomainownershipidentifier.go index 2fc8d9e44ed..1dbb4307122 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotdomainownershipidentifier.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotdomainownershipidentifier.go @@ -127,9 +127,9 @@ func (id SlotDomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotdomainownershipidentifier_test.go b/resource-manager/web/2023-01-01/webapps/id_slotdomainownershipidentifier_test.go index 440a035b88d..7be0f127472 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotdomainownershipidentifier_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotdomainownershipidentifier_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDomainOwnershipIdentifierId{} func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { - id := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") + id := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { @@ -36,8 +36,8 @@ func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { } func TestFormatSlotDomainOwnershipIdentifierID(t *testing.T) { - actual := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName" + actual := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotDomainOwnershipIdentifierID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotfunction.go b/resource-manager/web/2023-01-01/webapps/id_slotfunction.go index 117c18780b1..2f9cba6eccc 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotfunction.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotfunction.go @@ -127,9 +127,9 @@ func (id SlotFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotfunction_test.go b/resource-manager/web/2023-01-01/webapps/id_slotfunction_test.go index 37def86173d..10315a35c83 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotfunction_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotFunctionId{} func TestNewSlotFunctionID(t *testing.T) { - id := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") + id := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.FunctionName != "functionName" { @@ -36,8 +36,8 @@ func TestNewSlotFunctionID(t *testing.T) { } func TestFormatSlotFunctionID(t *testing.T) { - actual := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName" + actual := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slothostnamebinding.go b/resource-manager/web/2023-01-01/webapps/id_slothostnamebinding.go index 23702df5875..590d01a4bae 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slothostnamebinding.go +++ b/resource-manager/web/2023-01-01/webapps/id_slothostnamebinding.go @@ -127,11 +127,11 @@ func (id SlotHostNameBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHostNameBindings", "hostNameBindings", "hostNameBindings"), - resourceids.UserSpecifiedSegment("hostNameBindingName", "hostName"), + resourceids.UserSpecifiedSegment("hostNameBindingName", "hostNameBindingName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slothostnamebinding_test.go b/resource-manager/web/2023-01-01/webapps/id_slothostnamebinding_test.go index fa3cbece3e1..d0e372c31e3 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slothostnamebinding_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slothostnamebinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHostNameBindingId{} func TestNewSlotHostNameBindingID(t *testing.T) { - id := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") + id := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotHostNameBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HostNameBindingName != "hostName" { - t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostName") + if id.HostNameBindingName != "hostNameBindingName" { + t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostNameBindingName") } } func TestFormatSlotHostNameBindingID(t *testing.T) { - actual := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName" + actual := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotHostNameBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HostNameBindingName: "hostName", + SiteName: "siteName", + SlotName: "slotName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotHostNameBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HostNameBindingName: "hostName", + SiteName: "siteName", + SlotName: "slotName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS/hOsTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HostNameBindingName: "hOsTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HostNameBindingName: "hOsTnAmEbInDiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS/hOsTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slothybridconnection.go b/resource-manager/web/2023-01-01/webapps/id_slothybridconnection.go index 798ce3487e9..c5a95c89142 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slothybridconnection.go +++ b/resource-manager/web/2023-01-01/webapps/id_slothybridconnection.go @@ -127,11 +127,11 @@ func (id SlotHybridConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHybridConnection", "hybridConnection", "hybridConnection"), - resourceids.UserSpecifiedSegment("hybridConnectionName", "entityName"), + resourceids.UserSpecifiedSegment("hybridConnectionName", "hybridConnectionName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slothybridconnection_test.go b/resource-manager/web/2023-01-01/webapps/id_slothybridconnection_test.go index 93c812ff478..30653e42594 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slothybridconnection_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slothybridconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHybridConnectionId{} func TestNewSlotHybridConnectionID(t *testing.T) { - id := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") + id := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotHybridConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HybridConnectionName != "entityName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "entityName") + if id.HybridConnectionName != "hybridConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "hybridConnectionName") } } func TestFormatSlotHybridConnectionID(t *testing.T) { - actual := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName" + actual := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotHybridConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionName: "entityName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotHybridConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionName: "entityName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN/eNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HybridConnectionName: "eNtItYnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HybridConnectionName: "hYbRiDcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN/eNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slothybridconnectionnamespacerelay.go b/resource-manager/web/2023-01-01/webapps/id_slothybridconnectionnamespacerelay.go index a371c335ce1..f2a53e559e0 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slothybridconnectionnamespacerelay.go +++ b/resource-manager/web/2023-01-01/webapps/id_slothybridconnectionnamespacerelay.go @@ -133,11 +133,11 @@ func (id SlotHybridConnectionNamespaceRelayId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slothybridconnectionnamespacerelay_test.go b/resource-manager/web/2023-01-01/webapps/id_slothybridconnectionnamespacerelay_test.go index 1f6db182908..c668d1e93bc 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slothybridconnectionnamespacerelay_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slothybridconnectionnamespacerelay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHybridConnectionNamespaceRelayId{} func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { - id := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") + id := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -40,8 +40,8 @@ func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { } func TestFormatSlotHybridConnectionNamespaceRelayID(t *testing.T) { - actual := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotHybridConnectionNamespaceRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotHybridConnectionNamespaceRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotinstance.go b/resource-manager/web/2023-01-01/webapps/id_slotinstance.go index d381e0805a5..f6a4b514211 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotinstance.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotinstance.go @@ -127,9 +127,9 @@ func (id SlotInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotinstance_test.go b/resource-manager/web/2023-01-01/webapps/id_slotinstance_test.go index 0474185ff1a..2bd26deb6ee 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotinstance_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceId{} func TestNewSlotInstanceID(t *testing.T) { - id := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") + id := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -36,8 +36,8 @@ func TestNewSlotInstanceID(t *testing.T) { } func TestFormatSlotInstanceID(t *testing.T) { - actual := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId" + actual := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocess.go b/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocess.go index c4580926136..7459e303aab 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocess.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocess.go @@ -133,9 +133,9 @@ func (id SlotInstanceProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), diff --git a/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocess_test.go b/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocess_test.go index 414ffd27054..c10bc2a0fc1 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocess_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceProcessId{} func TestNewSlotInstanceProcessID(t *testing.T) { - id := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") + id := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -40,8 +40,8 @@ func TestNewSlotInstanceProcessID(t *testing.T) { } func TestFormatSlotInstanceProcessID(t *testing.T) { - actual := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId" + actual := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotInstanceProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotInstanceProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocessmodule.go b/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocessmodule.go index a8a8a21466b..ec90a897094 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocessmodule.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocessmodule.go @@ -139,15 +139,15 @@ func (id SlotInstanceProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocessmodule_test.go b/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocessmodule_test.go index db39b7040d2..109eb72ff25 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocessmodule_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotinstanceprocessmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceProcessModuleId{} func TestNewSlotInstanceProcessModuleID(t *testing.T) { - id := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress") + id := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -38,14 +38,14 @@ func TestNewSlotInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatSlotInstanceProcessModuleID(t *testing.T) { - actual := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress" + actual := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseSlotInstanceProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseSlotInstanceProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotnetworkfeature.go b/resource-manager/web/2023-01-01/webapps/id_slotnetworkfeature.go index 4001e74bc53..507114a0bf1 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotnetworkfeature.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotnetworkfeature.go @@ -127,11 +127,11 @@ func (id SlotNetworkFeatureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkFeatures", "networkFeatures", "networkFeatures"), - resourceids.UserSpecifiedSegment("networkFeatureName", "view"), + resourceids.UserSpecifiedSegment("networkFeatureName", "networkFeatureName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotnetworkfeature_test.go b/resource-manager/web/2023-01-01/webapps/id_slotnetworkfeature_test.go index 81f6d914134..3b0cebea96b 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotnetworkfeature_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotnetworkfeature_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotNetworkFeatureId{} func TestNewSlotNetworkFeatureID(t *testing.T) { - id := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view") + id := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotNetworkFeatureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.NetworkFeatureName != "view" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "view") + if id.NetworkFeatureName != "networkFeatureName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "networkFeatureName") } } func TestFormatSlotNetworkFeatureID(t *testing.T) { - actual := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view" + actual := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotNetworkFeatureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - NetworkFeatureName: "view", + SiteName: "siteName", + SlotName: "slotName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotNetworkFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - NetworkFeatureName: "view", + SiteName: "siteName", + SlotName: "slotName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs/vIeW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - NetworkFeatureName: "vIeW", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + NetworkFeatureName: "nEtWoRkFeAtUrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs/vIeW/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotnetworktrace.go b/resource-manager/web/2023-01-01/webapps/id_slotnetworktrace.go index 6bdb88e307e..4e4dd73328e 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotnetworktrace.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotnetworktrace.go @@ -127,9 +127,9 @@ func (id SlotNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkTrace", "networkTrace", "networkTrace"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotnetworktrace_test.go b/resource-manager/web/2023-01-01/webapps/id_slotnetworktrace_test.go index f15a990c005..ef938f160c3 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotnetworktrace_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotnetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotNetworkTraceId{} func TestNewSlotNetworkTraceID(t *testing.T) { - id := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") + id := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.OperationId != "operationId" { @@ -36,8 +36,8 @@ func TestNewSlotNetworkTraceID(t *testing.T) { } func TestFormatSlotNetworkTraceID(t *testing.T) { - actual := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId" + actual := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE/oPeRaTiOnId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotpremieraddon.go b/resource-manager/web/2023-01-01/webapps/id_slotpremieraddon.go index f5dc8ec000c..ca4498c2e93 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotpremieraddon.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotpremieraddon.go @@ -127,11 +127,11 @@ func (id SlotPremierAddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPremierAddons", "premierAddons", "premierAddons"), - resourceids.UserSpecifiedSegment("premierAddonName", "premierAddOnName"), + resourceids.UserSpecifiedSegment("premierAddonName", "premierAddonName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotpremieraddon_test.go b/resource-manager/web/2023-01-01/webapps/id_slotpremieraddon_test.go index abc889fbb30..c6094e0240f 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotpremieraddon_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotpremieraddon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPremierAddonId{} func TestNewSlotPremierAddonID(t *testing.T) { - id := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") + id := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotPremierAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.PremierAddonName != "premierAddOnName" { - t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddOnName") + if id.PremierAddonName != "premierAddonName" { + t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddonName") } } func TestFormatSlotPremierAddonID(t *testing.T) { - actual := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName" + actual := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPremierAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + SlotName: "slotName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPremierAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + SlotName: "slotName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs/pReMiErAdDoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PremierAddonName: "pReMiErAdDoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotprivateendpointconnection.go b/resource-manager/web/2023-01-01/webapps/id_slotprivateendpointconnection.go index 0038074356f..7a29bd7cb8b 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotprivateendpointconnection.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotprivateendpointconnection.go @@ -127,9 +127,9 @@ func (id SlotPrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotprivateendpointconnection_test.go b/resource-manager/web/2023-01-01/webapps/id_slotprivateendpointconnection_test.go index 0315e7236cd..b7c1bd2958c 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotprivateendpointconnection_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPrivateEndpointConnectionId{} func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { - id := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") + id := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -36,8 +36,8 @@ func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { } func TestFormatSlotPrivateEndpointConnectionID(t *testing.T) { - actual := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName" + actual := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotprocess.go b/resource-manager/web/2023-01-01/webapps/id_slotprocess.go index 731a1ee2e66..98487bec6fc 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotprocess.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotprocess.go @@ -127,9 +127,9 @@ func (id SlotProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotprocess_test.go b/resource-manager/web/2023-01-01/webapps/id_slotprocess_test.go index 147a7d6c37a..79324e032ca 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotprocess_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotProcessId{} func TestNewSlotProcessID(t *testing.T) { - id := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") + id := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ProcessId != "processId" { @@ -36,8 +36,8 @@ func TestNewSlotProcessID(t *testing.T) { } func TestFormatSlotProcessID(t *testing.T) { - actual := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId" + actual := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotpubliccertificate.go b/resource-manager/web/2023-01-01/webapps/id_slotpubliccertificate.go index ae44caa811b..45ded508c35 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotpubliccertificate.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotpubliccertificate.go @@ -127,9 +127,9 @@ func (id SlotPublicCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPublicCertificates", "publicCertificates", "publicCertificates"), resourceids.UserSpecifiedSegment("publicCertificateName", "publicCertificateName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotpubliccertificate_test.go b/resource-manager/web/2023-01-01/webapps/id_slotpubliccertificate_test.go index bb6c2deaa4c..31f3e81c0fb 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotpubliccertificate_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotpubliccertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPublicCertificateId{} func TestNewSlotPublicCertificateID(t *testing.T) { - id := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") + id := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotPublicCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.PublicCertificateName != "publicCertificateName" { @@ -36,8 +36,8 @@ func TestNewSlotPublicCertificateID(t *testing.T) { } func TestFormatSlotPublicCertificateID(t *testing.T) { - actual := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName" + actual := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPublicCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPublicCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PublicCertificateName: "pUbLiCcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotsiteextension.go b/resource-manager/web/2023-01-01/webapps/id_slotsiteextension.go index 7c1f34a4ad9..5df295c09ba 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotsiteextension.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotsiteextension.go @@ -127,9 +127,9 @@ func (id SlotSiteExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticSiteExtensions", "siteExtensions", "siteExtensions"), resourceids.UserSpecifiedSegment("siteExtensionId", "siteExtensionId"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotsiteextension_test.go b/resource-manager/web/2023-01-01/webapps/id_slotsiteextension_test.go index bfd22d9db4a..732d09fb195 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotsiteextension_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotsiteextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotSiteExtensionId{} func TestNewSlotSiteExtensionID(t *testing.T) { - id := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") + id := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotSiteExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.SiteExtensionId != "siteExtensionId" { @@ -36,8 +36,8 @@ func TestNewSlotSiteExtensionID(t *testing.T) { } func TestFormatSlotSiteExtensionID(t *testing.T) { - actual := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId" + actual := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotSiteExtensionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotSiteExtensionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS/sItEeXtEnSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", SiteExtensionId: "sItEeXtEnSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slottriggeredwebjob.go b/resource-manager/web/2023-01-01/webapps/id_slottriggeredwebjob.go index f28f3ec88d1..48ba81d16d3 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slottriggeredwebjob.go +++ b/resource-manager/web/2023-01-01/webapps/id_slottriggeredwebjob.go @@ -127,11 +127,11 @@ func (id SlotTriggeredWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slottriggeredwebjob_test.go b/resource-manager/web/2023-01-01/webapps/id_slottriggeredwebjob_test.go index 5fa0bda4915..c7f66afaa1e 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slottriggeredwebjob_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slottriggeredwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotTriggeredWebJobId{} func TestNewSlotTriggeredWebJobID(t *testing.T) { - id := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotTriggeredWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } } func TestFormatSlotTriggeredWebJobID(t *testing.T) { - actual := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName" + actual := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotTriggeredWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotTriggeredWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - TriggeredWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnection.go b/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnection.go index fccaab21b92..637d36cce57 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnection.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnection.go @@ -127,11 +127,11 @@ func (id SlotVirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnection_test.go b/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnection_test.go index e5b2487668b..623d47d5691 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnection_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotVirtualNetworkConnectionId{} func TestNewSlotVirtualNetworkConnectionID(t *testing.T) { - id := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") + id := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatSlotVirtualNetworkConnectionID(t *testing.T) { - actual := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName" + actual := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnectiongateway.go b/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnectiongateway.go index bf748a07cfc..8f808a13188 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnectiongateway.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnectiongateway.go @@ -133,11 +133,11 @@ func (id SlotVirtualNetworkConnectionGatewayId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go b/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go index c577c8452f4..34baec3c9ca 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotVirtualNetworkConnectionGatewayId{} func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { - id := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") + id := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -40,8 +40,8 @@ func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { } func TestFormatSlotVirtualNetworkConnectionGatewayID(t *testing.T) { - actual := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotVirtualNetworkConnectionGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotVirtualNetworkConnectionGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotwebjob.go b/resource-manager/web/2023-01-01/webapps/id_slotwebjob.go index 0c98bdee120..e9ea5bb00fb 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotwebjob.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotwebjob.go @@ -127,9 +127,9 @@ func (id SlotWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticWebJobs", "webJobs", "webJobs"), resourceids.UserSpecifiedSegment("webJobName", "webJobName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotwebjob_test.go b/resource-manager/web/2023-01-01/webapps/id_slotwebjob_test.go index cce85f520c8..66396ef164e 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotwebjob_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotWebJobId{} func TestNewSlotWebJobID(t *testing.T) { - id := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.WebJobName != "webJobName" { @@ -36,8 +36,8 @@ func TestNewSlotWebJobID(t *testing.T) { } func TestFormatSlotWebJobID(t *testing.T) { - actual := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName" + actual := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs/wEbJoBnAmE", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", WebJobName: "wEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs/wEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotworkflow.go b/resource-manager/web/2023-01-01/webapps/id_slotworkflow.go index dd9b29180f7..a14291749c9 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotworkflow.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotworkflow.go @@ -127,9 +127,9 @@ func (id SlotWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticWorkflows", "workflows", "workflows"), resourceids.UserSpecifiedSegment("workflowName", "workflowName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_slotworkflow_test.go b/resource-manager/web/2023-01-01/webapps/id_slotworkflow_test.go index 07f0fdb4bd4..dea7721f260 100644 --- a/resource-manager/web/2023-01-01/webapps/id_slotworkflow_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_slotworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotWorkflowId{} func TestNewSlotWorkflowID(t *testing.T) { - id := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName") + id := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewSlotWorkflowID(t *testing.T) { } func TestFormatSlotWorkflowID(t *testing.T) { - actual := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName" + actual := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs/wOrKfLoWnAmE", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_snapshot.go b/resource-manager/web/2023-01-01/webapps/id_snapshot.go index cbfb755361d..4d03d32a391 100644 --- a/resource-manager/web/2023-01-01/webapps/id_snapshot.go +++ b/resource-manager/web/2023-01-01/webapps/id_snapshot.go @@ -121,7 +121,7 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticWeb", "web", "web"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/web/2023-01-01/webapps/id_snapshot_test.go b/resource-manager/web/2023-01-01/webapps/id_snapshot_test.go index 13b12663c83..266ebd16516 100644 --- a/resource-manager/web/2023-01-01/webapps/id_snapshot_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.SnapshotId != "snapshotId" { @@ -32,8 +32,8 @@ func TestNewSnapshotID(t *testing.T) { } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", SnapshotId: "sNaPsHoTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_triggeredwebjob.go b/resource-manager/web/2023-01-01/webapps/id_triggeredwebjob.go index 81955b7012a..54e4277f8e3 100644 --- a/resource-manager/web/2023-01-01/webapps/id_triggeredwebjob.go +++ b/resource-manager/web/2023-01-01/webapps/id_triggeredwebjob.go @@ -121,9 +121,9 @@ func (id TriggeredWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_triggeredwebjob_test.go b/resource-manager/web/2023-01-01/webapps/id_triggeredwebjob_test.go index 6d4534988a4..f3a39e32c7e 100644 --- a/resource-manager/web/2023-01-01/webapps/id_triggeredwebjob_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_triggeredwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggeredWebJobId{} func TestNewTriggeredWebJobID(t *testing.T) { - id := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTriggeredWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } } func TestFormatTriggeredWebJobID(t *testing.T) { - actual := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName" + actual := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTriggeredWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTriggeredWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - TriggeredWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_triggeredwebjobhistory.go b/resource-manager/web/2023-01-01/webapps/id_triggeredwebjobhistory.go index e9fa5c35137..d43eee154da 100644 --- a/resource-manager/web/2023-01-01/webapps/id_triggeredwebjobhistory.go +++ b/resource-manager/web/2023-01-01/webapps/id_triggeredwebjobhistory.go @@ -133,13 +133,13 @@ func (id TriggeredWebJobHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), resourceids.StaticSegment("staticHistory", "history", "history"), - resourceids.UserSpecifiedSegment("historyName", "id"), + resourceids.UserSpecifiedSegment("historyName", "historyName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_triggeredwebjobhistory_test.go b/resource-manager/web/2023-01-01/webapps/id_triggeredwebjobhistory_test.go index b9f5366fbee..cf92a965a0a 100644 --- a/resource-manager/web/2023-01-01/webapps/id_triggeredwebjobhistory_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_triggeredwebjobhistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggeredWebJobHistoryId{} func TestNewTriggeredWebJobHistoryID(t *testing.T) { - id := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id") + id := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewTriggeredWebJobHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } - if id.HistoryName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "id") + if id.HistoryName != "historyName" { + t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "historyName") } } func TestFormatTriggeredWebJobHistoryID(t *testing.T) { - actual := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id" + actual := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggeredWebJobHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggeredWebJobHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - TriggeredWebJobName: "wEbJoBnAmE", - HistoryName: "iD", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", + HistoryName: "hIsToRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_virtualnetworkconnection.go b/resource-manager/web/2023-01-01/webapps/id_virtualnetworkconnection.go index cfa8b7c17da..0ddc9e9dbc9 100644 --- a/resource-manager/web/2023-01-01/webapps/id_virtualnetworkconnection.go +++ b/resource-manager/web/2023-01-01/webapps/id_virtualnetworkconnection.go @@ -121,9 +121,9 @@ func (id VirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2023-01-01/webapps/id_virtualnetworkconnection_test.go b/resource-manager/web/2023-01-01/webapps/id_virtualnetworkconnection_test.go index 3a30898c989..0696a175e00 100644 --- a/resource-manager/web/2023-01-01/webapps/id_virtualnetworkconnection_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_virtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkConnectionId{} func TestNewVirtualNetworkConnectionID(t *testing.T) { - id := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") + id := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatVirtualNetworkConnectionID(t *testing.T) { - actual := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName" + actual := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_webjob.go b/resource-manager/web/2023-01-01/webapps/id_webjob.go index b7a3e4b53e6..b79bed51622 100644 --- a/resource-manager/web/2023-01-01/webapps/id_webjob.go +++ b/resource-manager/web/2023-01-01/webapps/id_webjob.go @@ -121,7 +121,7 @@ func (id WebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticWebJobs", "webJobs", "webJobs"), resourceids.UserSpecifiedSegment("webJobName", "webJobName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_webjob_test.go b/resource-manager/web/2023-01-01/webapps/id_webjob_test.go index 485279bdb97..092af0c8a38 100644 --- a/resource-manager/web/2023-01-01/webapps/id_webjob_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_webjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebJobId{} func TestNewWebJobID(t *testing.T) { - id := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WebJobName != "webJobName" { @@ -32,8 +32,8 @@ func TestNewWebJobID(t *testing.T) { } func TestFormatWebJobID(t *testing.T) { - actual := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName" + actual := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs/wEbJoBnAmE", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WebJobName: "wEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs/wEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_websnapshot.go b/resource-manager/web/2023-01-01/webapps/id_websnapshot.go index f6bdfdba30b..f878f0869f5 100644 --- a/resource-manager/web/2023-01-01/webapps/id_websnapshot.go +++ b/resource-manager/web/2023-01-01/webapps/id_websnapshot.go @@ -127,9 +127,9 @@ func (id WebSnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticWeb", "web", "web"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/web/2023-01-01/webapps/id_websnapshot_test.go b/resource-manager/web/2023-01-01/webapps/id_websnapshot_test.go index 6c2e08093c4..b63a5759cb5 100644 --- a/resource-manager/web/2023-01-01/webapps/id_websnapshot_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_websnapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebSnapshotId{} func TestNewWebSnapshotID(t *testing.T) { - id := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") + id := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewWebSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.SnapshotId != "snapshotId" { @@ -36,8 +36,8 @@ func TestNewWebSnapshotID(t *testing.T) { } func TestFormatWebSnapshotID(t *testing.T) { - actual := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId" + actual := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseWebSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseWebSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", SnapshotId: "sNaPsHoTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/id_workflow.go b/resource-manager/web/2023-01-01/webapps/id_workflow.go index 61de52f6bbe..b0bd85b2a72 100644 --- a/resource-manager/web/2023-01-01/webapps/id_workflow.go +++ b/resource-manager/web/2023-01-01/webapps/id_workflow.go @@ -121,7 +121,7 @@ func (id WorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticWorkflows", "workflows", "workflows"), resourceids.UserSpecifiedSegment("workflowName", "workflowName"), } diff --git a/resource-manager/web/2023-01-01/webapps/id_workflow_test.go b/resource-manager/web/2023-01-01/webapps/id_workflow_test.go index ae2138b67c4..c687bb8ce0f 100644 --- a/resource-manager/web/2023-01-01/webapps/id_workflow_test.go +++ b/resource-manager/web/2023-01-01/webapps/id_workflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkflowId{} func TestNewWorkflowID(t *testing.T) { - id := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewWorkflowID(t *testing.T) { } func TestFormatWorkflowID(t *testing.T) { - actual := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName" + actual := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs/wOrKfLoWnAmE", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/webapps/method_createorupdatedomainownershipidentifier.go b/resource-manager/web/2023-01-01/webapps/method_createorupdatedomainownershipidentifier.go index 54114dd7cb9..cf70725a9a9 100644 --- a/resource-manager/web/2023-01-01/webapps/method_createorupdatedomainownershipidentifier.go +++ b/resource-manager/web/2023-01-01/webapps/method_createorupdatedomainownershipidentifier.go @@ -18,7 +18,7 @@ type CreateOrUpdateDomainOwnershipIdentifierOperationResponse struct { } // CreateOrUpdateDomainOwnershipIdentifier ... -func (c WebAppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId, input Identifier) (result CreateOrUpdateDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId, input Identifier) (result CreateOrUpdateDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-01-01/webapps/method_deletedomainownershipidentifier.go b/resource-manager/web/2023-01-01/webapps/method_deletedomainownershipidentifier.go index c170a9280d7..06a3c4983b6 100644 --- a/resource-manager/web/2023-01-01/webapps/method_deletedomainownershipidentifier.go +++ b/resource-manager/web/2023-01-01/webapps/method_deletedomainownershipidentifier.go @@ -17,7 +17,7 @@ type DeleteDomainOwnershipIdentifierOperationResponse struct { } // DeleteDomainOwnershipIdentifier ... -func (c WebAppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId) (result DeleteDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId) (result DeleteDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-01-01/webapps/method_getdomainownershipidentifier.go b/resource-manager/web/2023-01-01/webapps/method_getdomainownershipidentifier.go index 44658be8e1a..bc014922e27 100644 --- a/resource-manager/web/2023-01-01/webapps/method_getdomainownershipidentifier.go +++ b/resource-manager/web/2023-01-01/webapps/method_getdomainownershipidentifier.go @@ -18,7 +18,7 @@ type GetDomainOwnershipIdentifierOperationResponse struct { } // GetDomainOwnershipIdentifier ... -func (c WebAppsClient) GetDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId) (result GetDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) GetDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId) (result GetDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-01-01/webapps/method_startnetworktrace.go b/resource-manager/web/2023-01-01/webapps/method_startnetworktrace.go index de35cae8c37..3b1246a0d11 100644 --- a/resource-manager/web/2023-01-01/webapps/method_startnetworktrace.go +++ b/resource-manager/web/2023-01-01/webapps/method_startnetworktrace.go @@ -25,7 +25,7 @@ type StartNetworkTraceOperationResponse struct { type StartNetworkTraceOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartNetworkTraceOperationOptions() StartNetworkTraceOperationOptions { @@ -52,8 +52,8 @@ func (o StartNetworkTraceOperationOptions) ToQuery() *client.QueryParams { if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-01-01/webapps/method_startnetworktraceslot.go b/resource-manager/web/2023-01-01/webapps/method_startnetworktraceslot.go index f4ecbb2878c..72c280deeef 100644 --- a/resource-manager/web/2023-01-01/webapps/method_startnetworktraceslot.go +++ b/resource-manager/web/2023-01-01/webapps/method_startnetworktraceslot.go @@ -24,7 +24,7 @@ type StartNetworkTraceSlotOperationResponse struct { type StartNetworkTraceSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartNetworkTraceSlotOperationOptions() StartNetworkTraceSlotOperationOptions { @@ -51,8 +51,8 @@ func (o StartNetworkTraceSlotOperationOptions) ToQuery() *client.QueryParams { if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktrace.go b/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktrace.go index c4aceaac67a..0feb53df65b 100644 --- a/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktrace.go +++ b/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktrace.go @@ -22,7 +22,7 @@ type StartWebSiteNetworkTraceOperationResponse struct { type StartWebSiteNetworkTraceOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationOptions() StartWebSiteNetworkTraceOperationOptions { @@ -49,8 +49,8 @@ func (o StartWebSiteNetworkTraceOperationOptions) ToQuery() *client.QueryParams if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceoperation.go b/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceoperation.go index c2f83e72964..1a67be6cba1 100644 --- a/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceoperation.go +++ b/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceoperation.go @@ -25,7 +25,7 @@ type StartWebSiteNetworkTraceOperationOperationResponse struct { type StartWebSiteNetworkTraceOperationOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationOperationOptions() StartWebSiteNetworkTraceOperationOperationOptions { @@ -52,8 +52,8 @@ func (o StartWebSiteNetworkTraceOperationOperationOptions) ToQuery() *client.Que if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceoperationslot.go b/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceoperationslot.go index ceb485a4310..90f4cda8f0d 100644 --- a/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceoperationslot.go +++ b/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceoperationslot.go @@ -24,7 +24,7 @@ type StartWebSiteNetworkTraceOperationSlotOperationResponse struct { type StartWebSiteNetworkTraceOperationSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationSlotOperationOptions() StartWebSiteNetworkTraceOperationSlotOperationOptions { @@ -51,8 +51,8 @@ func (o StartWebSiteNetworkTraceOperationSlotOperationOptions) ToQuery() *client if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceslot.go b/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceslot.go index 488181959e2..10467c0eda1 100644 --- a/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceslot.go +++ b/resource-manager/web/2023-01-01/webapps/method_startwebsitenetworktraceslot.go @@ -21,7 +21,7 @@ type StartWebSiteNetworkTraceSlotOperationResponse struct { type StartWebSiteNetworkTraceSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceSlotOperationOptions() StartWebSiteNetworkTraceSlotOperationOptions { @@ -48,8 +48,8 @@ func (o StartWebSiteNetworkTraceSlotOperationOptions) ToQuery() *client.QueryPar if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-01-01/webapps/method_updatedomainownershipidentifier.go b/resource-manager/web/2023-01-01/webapps/method_updatedomainownershipidentifier.go index e9926b92e04..8bb087cd8f8 100644 --- a/resource-manager/web/2023-01-01/webapps/method_updatedomainownershipidentifier.go +++ b/resource-manager/web/2023-01-01/webapps/method_updatedomainownershipidentifier.go @@ -18,7 +18,7 @@ type UpdateDomainOwnershipIdentifierOperationResponse struct { } // UpdateDomainOwnershipIdentifier ... -func (c WebAppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId, input Identifier) (result UpdateDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId, input Identifier) (result UpdateDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-01-01/webapps/model_azureblobstorageapplicationlogsconfig.go b/resource-manager/web/2023-01-01/webapps/model_azureblobstorageapplicationlogsconfig.go index d17b5f8ddb1..37a7b27b3e9 100644 --- a/resource-manager/web/2023-01-01/webapps/model_azureblobstorageapplicationlogsconfig.go +++ b/resource-manager/web/2023-01-01/webapps/model_azureblobstorageapplicationlogsconfig.go @@ -6,5 +6,5 @@ package webapps type AzureBlobStorageApplicationLogsConfig struct { Level *LogLevel `json:"level,omitempty"` RetentionInDays *int64 `json:"retentionInDays,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_azureblobstoragehttplogsconfig.go b/resource-manager/web/2023-01-01/webapps/model_azureblobstoragehttplogsconfig.go index 4bafbbd06e5..74820c0d5ac 100644 --- a/resource-manager/web/2023-01-01/webapps/model_azureblobstoragehttplogsconfig.go +++ b/resource-manager/web/2023-01-01/webapps/model_azureblobstoragehttplogsconfig.go @@ -6,5 +6,5 @@ package webapps type AzureBlobStorageHTTPLogsConfig struct { Enabled *bool `json:"enabled,omitempty"` RetentionInDays *int64 `json:"retentionInDays,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_azuretablestorageapplicationlogsconfig.go b/resource-manager/web/2023-01-01/webapps/model_azuretablestorageapplicationlogsconfig.go index 6a87bfc0dc9..8d8ca355fe4 100644 --- a/resource-manager/web/2023-01-01/webapps/model_azuretablestorageapplicationlogsconfig.go +++ b/resource-manager/web/2023-01-01/webapps/model_azuretablestorageapplicationlogsconfig.go @@ -5,5 +5,5 @@ package webapps type AzureTableStorageApplicationLogsConfig struct { Level *LogLevel `json:"level,omitempty"` - SasUrl string `json:"sasUrl"` + SasURL string `json:"sasUrl"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_backupitemproperties.go b/resource-manager/web/2023-01-01/webapps/model_backupitemproperties.go index 577e4eb1a23..b74153eec80 100644 --- a/resource-manager/web/2023-01-01/webapps/model_backupitemproperties.go +++ b/resource-manager/web/2023-01-01/webapps/model_backupitemproperties.go @@ -22,7 +22,7 @@ type BackupItemProperties struct { Scheduled *bool `json:"scheduled,omitempty"` SizeInBytes *int64 `json:"sizeInBytes,omitempty"` Status *BackupItemStatus `json:"status,omitempty"` - StorageAccountUrl *string `json:"storageAccountUrl,omitempty"` + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` WebsiteSizeInBytes *int64 `json:"websiteSizeInBytes,omitempty"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_backuprequestproperties.go b/resource-manager/web/2023-01-01/webapps/model_backuprequestproperties.go index 8a3f52e475f..0d0229d8c83 100644 --- a/resource-manager/web/2023-01-01/webapps/model_backuprequestproperties.go +++ b/resource-manager/web/2023-01-01/webapps/model_backuprequestproperties.go @@ -8,5 +8,5 @@ type BackupRequestProperties struct { BackupSchedule *BackupSchedule `json:"backupSchedule,omitempty"` Databases *[]DatabaseBackupSetting `json:"databases,omitempty"` Enabled *bool `json:"enabled,omitempty"` - StorageAccountUrl string `json:"storageAccountUrl"` + StorageAccountURL string `json:"storageAccountUrl"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_blobstoragetokenstore.go b/resource-manager/web/2023-01-01/webapps/model_blobstoragetokenstore.go index 002a55f2dad..2cbf67fbeae 100644 --- a/resource-manager/web/2023-01-01/webapps/model_blobstoragetokenstore.go +++ b/resource-manager/web/2023-01-01/webapps/model_blobstoragetokenstore.go @@ -4,5 +4,5 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type BlobStorageTokenStore struct { - SasUrlSettingName *string `json:"sasUrlSettingName,omitempty"` + SasURLSettingName *string `json:"sasUrlSettingName,omitempty"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_githubactioncontainerconfiguration.go b/resource-manager/web/2023-01-01/webapps/model_githubactioncontainerconfiguration.go index 0eb95a29ffb..db70b234959 100644 --- a/resource-manager/web/2023-01-01/webapps/model_githubactioncontainerconfiguration.go +++ b/resource-manager/web/2023-01-01/webapps/model_githubactioncontainerconfiguration.go @@ -6,6 +6,6 @@ package webapps type GitHubActionContainerConfiguration struct { ImageName *string `json:"imageName,omitempty"` Password *string `json:"password,omitempty"` - ServerUrl *string `json:"serverUrl,omitempty"` + ServerURL *string `json:"serverUrl,omitempty"` Username *string `json:"username,omitempty"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_login.go b/resource-manager/web/2023-01-01/webapps/model_login.go index a8fee3b25d9..3e8e040d421 100644 --- a/resource-manager/web/2023-01-01/webapps/model_login.go +++ b/resource-manager/web/2023-01-01/webapps/model_login.go @@ -4,10 +4,10 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Login struct { - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` CookieExpiration *CookieExpiration `json:"cookieExpiration,omitempty"` Nonce *Nonce `json:"nonce,omitempty"` - PreserveUrlFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` + PreserveURLFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` Routes *LoginRoutes `json:"routes,omitempty"` TokenStore *TokenStore `json:"tokenStore,omitempty"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_rampuprule.go b/resource-manager/web/2023-01-01/webapps/model_rampuprule.go index a99e19c5085..2688d09f601 100644 --- a/resource-manager/web/2023-01-01/webapps/model_rampuprule.go +++ b/resource-manager/web/2023-01-01/webapps/model_rampuprule.go @@ -5,7 +5,7 @@ package webapps type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2023-01-01/webapps/model_restorerequestproperties.go b/resource-manager/web/2023-01-01/webapps/model_restorerequestproperties.go index d352f67f61b..ea35e477253 100644 --- a/resource-manager/web/2023-01-01/webapps/model_restorerequestproperties.go +++ b/resource-manager/web/2023-01-01/webapps/model_restorerequestproperties.go @@ -14,5 +14,5 @@ type RestoreRequestProperties struct { OperationType *BackupRestoreOperationType `json:"operationType,omitempty"` Overwrite bool `json:"overwrite"` SiteName *string `json:"siteName,omitempty"` - StorageAccountUrl string `json:"storageAccountUrl"` + StorageAccountURL string `json:"storageAccountUrl"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_siteauthsettingsproperties.go b/resource-manager/web/2023-01-01/webapps/model_siteauthsettingsproperties.go index 46d05a77881..7ad71ad2704 100644 --- a/resource-manager/web/2023-01-01/webapps/model_siteauthsettingsproperties.go +++ b/resource-manager/web/2023-01-01/webapps/model_siteauthsettingsproperties.go @@ -7,7 +7,7 @@ type SiteAuthSettingsProperties struct { AadClaimsAuthorization *string `json:"aadClaimsAuthorization,omitempty"` AdditionalLoginParams *[]string `json:"additionalLoginParams,omitempty"` AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` AuthFilePath *string `json:"authFilePath,omitempty"` ClientId *string `json:"clientId,omitempty"` ClientSecret *string `json:"clientSecret,omitempty"` diff --git a/resource-manager/web/2023-01-01/webapps/model_sitesourcecontrolproperties.go b/resource-manager/web/2023-01-01/webapps/model_sitesourcecontrolproperties.go index f19c33a2a34..9634590165d 100644 --- a/resource-manager/web/2023-01-01/webapps/model_sitesourcecontrolproperties.go +++ b/resource-manager/web/2023-01-01/webapps/model_sitesourcecontrolproperties.go @@ -10,5 +10,5 @@ type SiteSourceControlProperties struct { IsGitHubAction *bool `json:"isGitHubAction,omitempty"` IsManualIntegration *bool `json:"isManualIntegration,omitempty"` IsMercurial *bool `json:"isMercurial,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` } diff --git a/resource-manager/web/2023-01-01/webapps/model_websiteinstancestatusproperties.go b/resource-manager/web/2023-01-01/webapps/model_websiteinstancestatusproperties.go index fac5b723630..f276d7e8f05 100644 --- a/resource-manager/web/2023-01-01/webapps/model_websiteinstancestatusproperties.go +++ b/resource-manager/web/2023-01-01/webapps/model_websiteinstancestatusproperties.go @@ -4,10 +4,10 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WebSiteInstanceStatusProperties struct { - ConsoleUrl *string `json:"consoleUrl,omitempty"` + ConsoleURL *string `json:"consoleUrl,omitempty"` Containers *map[string]ContainerInfo `json:"containers,omitempty"` - DetectorUrl *string `json:"detectorUrl,omitempty"` - HealthCheckUrl *string `json:"healthCheckUrl,omitempty"` + DetectorURL *string `json:"detectorUrl,omitempty"` + HealthCheckURL *string `json:"healthCheckUrl,omitempty"` State *SiteRuntimeState `json:"state,omitempty"` - StatusUrl *string `json:"statusUrl,omitempty"` + StatusURL *string `json:"statusUrl,omitempty"` } diff --git a/resource-manager/web/2023-01-01/workflowrunactions/README.md b/resource-manager/web/2023-01-01/workflowrunactions/README.md index 3d18e8e2884..c69f887a1ed 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/README.md +++ b/resource-manager/web/2023-01-01/workflowrunactions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowrunactions.NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName") read, err := client.CopeRepetitionsGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.CopeRepetitionsList(ctx, id)` can be used to do batched pagination items, err := client.CopeRepetitionsListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowrunactions.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") // alternatively `client.List(ctx, id, workflowrunactions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowrunactions.DefaultListOperationOptions()) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.ListExpressionTraces(ctx, id)` can be used to do batched pagination items, err := client.ListExpressionTracesComplete(ctx, id) @@ -107,7 +107,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") read, err := client.WorkflowRunActionRepetitionsGet(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.WorkflowRunActionRepetitionsList(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsListComplete(ctx, id) @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") // alternatively `client.WorkflowRunActionRepetitionsListExpressionTraces(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsListExpressionTracesComplete(ctx, id) @@ -157,7 +157,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") +id := workflowrunactions.NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") read, err := client.WorkflowRunActionRepetitionsRequestHistoriesGet(ctx, id) if err != nil { @@ -173,7 +173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") // alternatively `client.WorkflowRunActionRepetitionsRequestHistoriesList(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsRequestHistoriesListComplete(ctx, id) diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_action.go b/resource-manager/web/2023-01-01/workflowrunactions/id_action.go index 33762ac4650..d8931531676 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_action.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_action.go @@ -133,7 +133,7 @@ func (id ActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_action_test.go b/resource-manager/web/2023-01-01/workflowrunactions/id_action_test.go index 66b951f306b..1a7cdb61b0c 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_action_test.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_action_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ActionId{} func TestNewActionID(t *testing.T) { - id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") + id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewActionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -40,8 +40,8 @@ func TestNewActionID(t *testing.T) { } func TestFormatActionID(t *testing.T) { - actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName" + actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,71 +95,71 @@ func TestParseActionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -167,7 +167,7 @@ func TestParseActionID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", Error: true, }, } @@ -296,131 +296,131 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -428,16 +428,16 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -445,7 +445,7 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_repetition.go b/resource-manager/web/2023-01-01/workflowrunactions/id_repetition.go index 086a2886207..eea587301e1 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_repetition.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_repetition.go @@ -139,7 +139,7 @@ func (id RepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_repetition_test.go b/resource-manager/web/2023-01-01/workflowrunactions/id_repetition_test.go index 5eaac6da4b7..9b2f3157fe9 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_repetition_test.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_repetition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RepetitionId{} func TestNewRepetitionID(t *testing.T) { - id := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") + id := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -44,8 +44,8 @@ func TestNewRepetitionID(t *testing.T) { } func TestFormatRepetitionID(t *testing.T) { - actual := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName" + actual := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,81 +99,81 @@ func TestParseRepetitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -182,7 +182,7 @@ func TestParseRepetitionID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", Error: true, }, } @@ -315,151 +315,151 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -468,16 +468,16 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -486,7 +486,7 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_requesthistory.go b/resource-manager/web/2023-01-01/workflowrunactions/id_requesthistory.go index f8185100bb8..d15a9523fb5 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_requesthistory.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_requesthistory.go @@ -145,7 +145,7 @@ func (id RequestHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_requesthistory_test.go b/resource-manager/web/2023-01-01/workflowrunactions/id_requesthistory_test.go index c90f9e01823..170be7c8e38 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_requesthistory_test.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_requesthistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RequestHistoryId{} func TestNewRequestHistoryID(t *testing.T) { - id := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") + id := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRequestHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -48,8 +48,8 @@ func TestNewRequestHistoryID(t *testing.T) { } func TestFormatRequestHistoryID(t *testing.T) { - actual := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName" + actual := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -103,91 +103,91 @@ func TestParseRequestHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -197,7 +197,7 @@ func TestParseRequestHistoryID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", Error: true, }, } @@ -334,171 +334,171 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -508,16 +508,16 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -527,7 +527,7 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_run.go b/resource-manager/web/2023-01-01/workflowrunactions/id_run.go index e2ca4c816ca..50398640cd1 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_run.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_run.go @@ -127,7 +127,7 @@ func (id RunId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_run_test.go b/resource-manager/web/2023-01-01/workflowrunactions/id_run_test.go index d5624eb4cef..5b5fc911ae0 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_run_test.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_run_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RunId{} func TestNewRunID(t *testing.T) { - id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") + id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRunID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewRunID(t *testing.T) { } func TestFormatRunID(t *testing.T) { - actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" + actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseRunID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseRunIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_scoperepetition.go b/resource-manager/web/2023-01-01/workflowrunactions/id_scoperepetition.go index 8582cd7f9ec..0e6e953b99e 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_scoperepetition.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_scoperepetition.go @@ -139,7 +139,7 @@ func (id ScopeRepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), @@ -153,7 +153,7 @@ func (id ScopeRepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticActions", "actions", "actions"), resourceids.UserSpecifiedSegment("actionName", "actionName"), resourceids.StaticSegment("staticScopeRepetitions", "scopeRepetitions", "scopeRepetitions"), - resourceids.UserSpecifiedSegment("scopeRepetitionName", "repetitionName"), + resourceids.UserSpecifiedSegment("scopeRepetitionName", "scopeRepetitionName"), } } diff --git a/resource-manager/web/2023-01-01/workflowrunactions/id_scoperepetition_test.go b/resource-manager/web/2023-01-01/workflowrunactions/id_scoperepetition_test.go index 6739a64f8b6..0b1db9c0160 100644 --- a/resource-manager/web/2023-01-01/workflowrunactions/id_scoperepetition_test.go +++ b/resource-manager/web/2023-01-01/workflowrunactions/id_scoperepetition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScopeRepetitionId{} func TestNewScopeRepetitionID(t *testing.T) { - id := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") + id := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewScopeRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -38,14 +38,14 @@ func TestNewScopeRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ActionName'", id.ActionName, "actionName") } - if id.ScopeRepetitionName != "repetitionName" { - t.Fatalf("Expected %q but got %q for Segment 'ScopeRepetitionName'", id.ScopeRepetitionName, "repetitionName") + if id.ScopeRepetitionName != "scopeRepetitionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScopeRepetitionName'", id.ScopeRepetitionName, "scopeRepetitionName") } } func TestFormatScopeRepetitionID(t *testing.T) { - actual := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName" + actual := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,90 +99,90 @@ func TestParseScopeRepetitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", - ScopeRepetitionName: "repetitionName", + ScopeRepetitionName: "scopeRepetitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName/extra", Error: true, }, } @@ -315,178 +315,178 @@ func TestParseScopeRepetitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", - ScopeRepetitionName: "repetitionName", + ScopeRepetitionName: "scopeRepetitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/sCoPeRePeTiTiOnNaMe", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", - ScopeRepetitionName: "rEpEtItIoNnAmE", + ScopeRepetitionName: "sCoPeRePeTiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/rEpEtItIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/sCoPeRePeTiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowruns/README.md b/resource-manager/web/2023-01-01/workflowruns/README.md index a855ed307ad..d376c6ecfb0 100644 --- a/resource-manager/web/2023-01-01/workflowruns/README.md +++ b/resource-manager/web/2023-01-01/workflowruns/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") read, err := client.Cancel(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowruns.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowruns.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowruns.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowruns.DefaultListOperationOptions()) diff --git a/resource-manager/web/2023-01-01/workflowruns/id_managementworkflow.go b/resource-manager/web/2023-01-01/workflowruns/id_managementworkflow.go index 2cb6856b6ec..b87857c4e6f 100644 --- a/resource-manager/web/2023-01-01/workflowruns/id_managementworkflow.go +++ b/resource-manager/web/2023-01-01/workflowruns/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowruns/id_managementworkflow_test.go b/resource-manager/web/2023-01-01/workflowruns/id_managementworkflow_test.go index 4a9b2de9f46..5895776d52c 100644 --- a/resource-manager/web/2023-01-01/workflowruns/id_managementworkflow_test.go +++ b/resource-manager/web/2023-01-01/workflowruns/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowruns/id_run.go b/resource-manager/web/2023-01-01/workflowruns/id_run.go index cbecca55f3c..968133f5c51 100644 --- a/resource-manager/web/2023-01-01/workflowruns/id_run.go +++ b/resource-manager/web/2023-01-01/workflowruns/id_run.go @@ -127,7 +127,7 @@ func (id RunId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowruns/id_run_test.go b/resource-manager/web/2023-01-01/workflowruns/id_run_test.go index a7fb428b8c2..abacc74a502 100644 --- a/resource-manager/web/2023-01-01/workflowruns/id_run_test.go +++ b/resource-manager/web/2023-01-01/workflowruns/id_run_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RunId{} func TestNewRunID(t *testing.T) { - id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") + id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRunID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewRunID(t *testing.T) { } func TestFormatRunID(t *testing.T) { - actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" + actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseRunID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseRunIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflows/README.md b/resource-manager/web/2023-01-01/workflows/README.md index 218ef40f8a1..5ac08e8ec31 100644 --- a/resource-manager/web/2023-01-01/workflows/README.md +++ b/resource-manager/web/2023-01-01/workflows/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") payload := workflows.RegenerateActionParameter{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") payload := workflows.Workflow{ // ... diff --git a/resource-manager/web/2023-01-01/workflows/id_managementworkflow.go b/resource-manager/web/2023-01-01/workflows/id_managementworkflow.go index 7a774f3c589..47ad1eb715b 100644 --- a/resource-manager/web/2023-01-01/workflows/id_managementworkflow.go +++ b/resource-manager/web/2023-01-01/workflows/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflows/id_managementworkflow_test.go b/resource-manager/web/2023-01-01/workflows/id_managementworkflow_test.go index 8240e4e7088..8499136fb32 100644 --- a/resource-manager/web/2023-01-01/workflows/id_managementworkflow_test.go +++ b/resource-manager/web/2023-01-01/workflows/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowtriggerhistories/README.md b/resource-manager/web/2023-01-01/workflowtriggerhistories/README.md index 3d22c90e46a..4bf071218d0 100644 --- a/resource-manager/web/2023-01-01/workflowtriggerhistories/README.md +++ b/resource-manager/web/2023-01-01/workflowtriggerhistories/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") +id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggerhistories.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") // alternatively `client.List(ctx, id, workflowtriggerhistories.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowtriggerhistories.DefaultListOperationOptions()) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") +id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") if err := client.ResubmitThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/web/2023-01-01/workflowtriggerhistories/id_trigger.go b/resource-manager/web/2023-01-01/workflowtriggerhistories/id_trigger.go index 7746c2047d8..185a7964307 100644 --- a/resource-manager/web/2023-01-01/workflowtriggerhistories/id_trigger.go +++ b/resource-manager/web/2023-01-01/workflowtriggerhistories/id_trigger.go @@ -127,7 +127,7 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowtriggerhistories/id_trigger_test.go b/resource-manager/web/2023-01-01/workflowtriggerhistories/id_trigger_test.go index dd1a3ca80d4..a7e902f354d 100644 --- a/resource-manager/web/2023-01-01/workflowtriggerhistories/id_trigger_test.go +++ b/resource-manager/web/2023-01-01/workflowtriggerhistories/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowtriggerhistories/id_triggerhistory.go b/resource-manager/web/2023-01-01/workflowtriggerhistories/id_triggerhistory.go index f5391b27c47..248b48c2216 100644 --- a/resource-manager/web/2023-01-01/workflowtriggerhistories/id_triggerhistory.go +++ b/resource-manager/web/2023-01-01/workflowtriggerhistories/id_triggerhistory.go @@ -133,7 +133,7 @@ func (id TriggerHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowtriggerhistories/id_triggerhistory_test.go b/resource-manager/web/2023-01-01/workflowtriggerhistories/id_triggerhistory_test.go index bf48a873df6..9acaaf52faa 100644 --- a/resource-manager/web/2023-01-01/workflowtriggerhistories/id_triggerhistory_test.go +++ b/resource-manager/web/2023-01-01/workflowtriggerhistories/id_triggerhistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerHistoryId{} func TestNewTriggerHistoryID(t *testing.T) { - id := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") + id := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -40,8 +40,8 @@ func TestNewTriggerHistoryID(t *testing.T) { } func TestFormatTriggerHistoryID(t *testing.T) { - actual := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName" + actual := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,71 +95,71 @@ func TestParseTriggerHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", HistoryName: "historyName", @@ -167,7 +167,7 @@ func TestParseTriggerHistoryID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", Error: true, }, } @@ -296,131 +296,131 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", HistoryName: "historyName", @@ -428,16 +428,16 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", HistoryName: "hIsToRyNaMe", @@ -445,7 +445,7 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowtriggers/README.md b/resource-manager/web/2023-01-01/workflowtriggers/README.md index 83b8aafa756..5e092b10212 100644 --- a/resource-manager/web/2023-01-01/workflowtriggers/README.md +++ b/resource-manager/web/2023-01-01/workflowtriggers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") read, err := client.GetSchemaJson(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowtriggers.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowtriggers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowtriggers.DefaultListOperationOptions()) @@ -69,13 +69,13 @@ for _, item := range items { ``` -### Example Usage: `WorkflowTriggersClient.ListCallbackUrl` +### Example Usage: `WorkflowTriggersClient.ListCallbackURL` ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") -read, err := client.ListCallbackUrl(ctx, id) +read, err := client.ListCallbackURL(ctx, id) if err != nil { // handle the error } @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if err := client.RunThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/web/2023-01-01/workflowtriggers/id_managementworkflow.go b/resource-manager/web/2023-01-01/workflowtriggers/id_managementworkflow.go index 192d552a278..7f55952af52 100644 --- a/resource-manager/web/2023-01-01/workflowtriggers/id_managementworkflow.go +++ b/resource-manager/web/2023-01-01/workflowtriggers/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowtriggers/id_managementworkflow_test.go b/resource-manager/web/2023-01-01/workflowtriggers/id_managementworkflow_test.go index 9eed841e8fe..1ca968f9de0 100644 --- a/resource-manager/web/2023-01-01/workflowtriggers/id_managementworkflow_test.go +++ b/resource-manager/web/2023-01-01/workflowtriggers/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowtriggers/id_trigger.go b/resource-manager/web/2023-01-01/workflowtriggers/id_trigger.go index e25ae7dccb1..3980bdfb0bc 100644 --- a/resource-manager/web/2023-01-01/workflowtriggers/id_trigger.go +++ b/resource-manager/web/2023-01-01/workflowtriggers/id_trigger.go @@ -127,7 +127,7 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowtriggers/id_trigger_test.go b/resource-manager/web/2023-01-01/workflowtriggers/id_trigger_test.go index 094cc4fce14..c101bbec5e7 100644 --- a/resource-manager/web/2023-01-01/workflowtriggers/id_trigger_test.go +++ b/resource-manager/web/2023-01-01/workflowtriggers/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowtriggers/method_listcallbackurl.go b/resource-manager/web/2023-01-01/workflowtriggers/method_listcallbackurl.go index 7e44f7f9763..4fa4045250d 100644 --- a/resource-manager/web/2023-01-01/workflowtriggers/method_listcallbackurl.go +++ b/resource-manager/web/2023-01-01/workflowtriggers/method_listcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListCallbackUrlOperationResponse struct { +type ListCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListCallbackUrl ... -func (c WorkflowTriggersClient) ListCallbackUrl(ctx context.Context, id TriggerId) (result ListCallbackUrlOperationResponse, err error) { +// ListCallbackURL ... +func (c WorkflowTriggersClient) ListCallbackURL(ctx context.Context, id TriggerId) (result ListCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c WorkflowTriggersClient) ListCallbackUrl(ctx context.Context, id TriggerI return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/web/2023-01-01/workflowtriggers/model_workflowtriggercallbackurl.go b/resource-manager/web/2023-01-01/workflowtriggers/model_workflowtriggercallbackurl.go index fd5a9082bd7..710a39b43aa 100644 --- a/resource-manager/web/2023-01-01/workflowtriggers/model_workflowtriggercallbackurl.go +++ b/resource-manager/web/2023-01-01/workflowtriggers/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package workflowtriggers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/web/2023-01-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/web/2023-01-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go index cc3b231968b..f4e969fd7ab 100644 --- a/resource-manager/web/2023-01-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/web/2023-01-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package workflowtriggers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/web/2023-01-01/workflowversions/README.md b/resource-manager/web/2023-01-01/workflowversions/README.md index c5616993e06..2c566965165 100644 --- a/resource-manager/web/2023-01-01/workflowversions/README.md +++ b/resource-manager/web/2023-01-01/workflowversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId") +id := workflowversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowversions.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowversions.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowversions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowversions.DefaultListOperationOptions()) diff --git a/resource-manager/web/2023-01-01/workflowversions/id_managementworkflow.go b/resource-manager/web/2023-01-01/workflowversions/id_managementworkflow.go index 3c4187d53f9..29c5ebda9ab 100644 --- a/resource-manager/web/2023-01-01/workflowversions/id_managementworkflow.go +++ b/resource-manager/web/2023-01-01/workflowversions/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowversions/id_managementworkflow_test.go b/resource-manager/web/2023-01-01/workflowversions/id_managementworkflow_test.go index f90f2845f58..fb252bd145e 100644 --- a/resource-manager/web/2023-01-01/workflowversions/id_managementworkflow_test.go +++ b/resource-manager/web/2023-01-01/workflowversions/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-01-01/workflowversions/id_version.go b/resource-manager/web/2023-01-01/workflowversions/id_version.go index 03a60370e12..d1585eebfb1 100644 --- a/resource-manager/web/2023-01-01/workflowversions/id_version.go +++ b/resource-manager/web/2023-01-01/workflowversions/id_version.go @@ -127,7 +127,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-01-01/workflowversions/id_version_test.go b/resource-manager/web/2023-01-01/workflowversions/id_version_test.go index 232182dab8d..5398d232c03 100644 --- a/resource-manager/web/2023-01-01/workflowversions/id_version_test.go +++ b/resource-manager/web/2023-01-01/workflowversions/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewVersionID(t *testing.T) { } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", VersionId: "versionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", VersionId: "versionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", VersionId: "vErSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appservicecertificateorders/README.md b/resource-manager/web/2023-12-01/appservicecertificateorders/README.md index 17ad0b1f87a..81a621c9f52 100644 --- a/resource-manager/web/2023-12-01/appservicecertificateorders/README.md +++ b/resource-manager/web/2023-12-01/appservicecertificateorders/README.md @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") payload := appservicecertificateorders.AppServiceCertificateResource{ // ... @@ -75,7 +75,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") read, err := client.DeleteCertificate(ctx, id) if err != nil { @@ -107,7 +107,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") read, err := client.GetCertificate(ctx, id) if err != nil { @@ -327,7 +327,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appservicecertificateorders.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +id := appservicecertificateorders.NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") payload := appservicecertificateorders.AppServiceCertificatePatchResource{ // ... diff --git a/resource-manager/web/2023-01-01/appservicecertificateorders/id_certificate.go b/resource-manager/web/2023-12-01/appservicecertificateorders/id_certificateordercertificate.go similarity index 62% rename from resource-manager/web/2023-01-01/appservicecertificateorders/id_certificate.go rename to resource-manager/web/2023-12-01/appservicecertificateorders/id_certificateordercertificate.go index b68393bf88f..91835e730de 100644 --- a/resource-manager/web/2023-01-01/appservicecertificateorders/id_certificate.go +++ b/resource-manager/web/2023-12-01/appservicecertificateorders/id_certificateordercertificate.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&CertificateId{}) + recaser.RegisterResourceId(&CertificateOrderCertificateId{}) } -var _ resourceids.ResourceId = &CertificateId{} +var _ resourceids.ResourceId = &CertificateOrderCertificateId{} -// CertificateId is a struct representing the Resource ID for a Certificate -type CertificateId struct { +// CertificateOrderCertificateId is a struct representing the Resource ID for a Certificate Order Certificate +type CertificateOrderCertificateId struct { SubscriptionId string ResourceGroupName string CertificateOrderName string CertificateName string } -// NewCertificateID returns a new CertificateId struct -func NewCertificateID(subscriptionId string, resourceGroupName string, certificateOrderName string, certificateName string) CertificateId { - return CertificateId{ +// NewCertificateOrderCertificateID returns a new CertificateOrderCertificateId struct +func NewCertificateOrderCertificateID(subscriptionId string, resourceGroupName string, certificateOrderName string, certificateName string) CertificateOrderCertificateId { + return CertificateOrderCertificateId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, CertificateOrderName: certificateOrderName, @@ -35,15 +35,15 @@ func NewCertificateID(subscriptionId string, resourceGroupName string, certifica } } -// ParseCertificateID parses 'input' into a CertificateId -func ParseCertificateID(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) +// ParseCertificateOrderCertificateID parses 'input' into a CertificateOrderCertificateId +func ParseCertificateOrderCertificateID(input string) (*CertificateOrderCertificateId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderCertificateId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := CertificateId{} + id := CertificateOrderCertificateId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseCertificateID(input string) (*CertificateId, error) { return &id, nil } -// ParseCertificateIDInsensitively parses 'input' case-insensitively into a CertificateId +// ParseCertificateOrderCertificateIDInsensitively parses 'input' case-insensitively into a CertificateOrderCertificateId // note: this method should only be used for API response data and not user input -func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) +func ParseCertificateOrderCertificateIDInsensitively(input string) (*CertificateOrderCertificateId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderCertificateId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := CertificateId{} + id := CertificateOrderCertificateId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { return &id, nil } -func (id *CertificateId) FromParseResult(input resourceids.ParseResult) error { +func (id *CertificateOrderCertificateId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *CertificateId) FromParseResult(input resourceids.ParseResult) error { return nil } -// ValidateCertificateID checks that 'input' can be parsed as a Certificate ID -func ValidateCertificateID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateCertificateOrderCertificateID checks that 'input' can be parsed as a Certificate Order Certificate ID +func ValidateCertificateOrderCertificateID(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 := ParseCertificateID(v); err != nil { + if _, err := ParseCertificateOrderCertificateID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Certificate ID -func (id CertificateId) ID() string { +// ID returns the formatted Certificate Order Certificate ID +func (id CertificateOrderCertificateId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.CertificateRegistration/certificateOrders/%s/certificates/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CertificateOrderName, id.CertificateName) } -// Segments returns a slice of Resource ID Segments which comprise this Certificate ID -func (id CertificateId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Certificate Order Certificate ID +func (id CertificateOrderCertificateId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -123,17 +123,17 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticCertificateOrders", "certificateOrders", "certificateOrders"), resourceids.UserSpecifiedSegment("certificateOrderName", "certificateOrderName"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } -// String returns a human-readable description of this Certificate ID -func (id CertificateId) String() string { +// String returns a human-readable description of this Certificate Order Certificate ID +func (id CertificateOrderCertificateId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Certificate Order Name: %q", id.CertificateOrderName), fmt.Sprintf("Certificate Name: %q", id.CertificateName), } - return fmt.Sprintf("Certificate (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Certificate Order Certificate (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2022-09-01/appservicecertificateorders/id_certificate_test.go b/resource-manager/web/2023-12-01/appservicecertificateorders/id_certificateordercertificate_test.go similarity index 87% rename from resource-manager/web/2022-09-01/appservicecertificateorders/id_certificate_test.go rename to resource-manager/web/2023-12-01/appservicecertificateorders/id_certificateordercertificate_test.go index 40bce391166..8b5bb4327c3 100644 --- a/resource-manager/web/2022-09-01/appservicecertificateorders/id_certificate_test.go +++ b/resource-manager/web/2023-12-01/appservicecertificateorders/id_certificateordercertificate_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &CertificateId{} +var _ resourceids.ResourceId = &CertificateOrderCertificateId{} -func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name") +func TestNewCertificateOrderCertificateID(t *testing.T) { + id := NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,24 +26,24 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'CertificateOrderName'", id.CertificateOrderName, "certificateOrderName") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } -func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name" +func TestFormatCertificateOrderCertificateID(t *testing.T) { + actual := NewCertificateOrderCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseCertificateID(t *testing.T) { +func TestParseCertificateOrderCertificateID(t *testing.T) { testData := []struct { Input string Error bool - Expected *CertificateId + Expected *CertificateOrderCertificateId }{ { // Incomplete URI @@ -97,24 +97,24 @@ func TestParseCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name", - Expected: &CertificateId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseCertificateID(v.Input) + actual, err := ParseCertificateOrderCertificateID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseCertificateID(t *testing.T) { } } -func TestParseCertificateIDInsensitively(t *testing.T) { +func TestParseCertificateOrderCertificateIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *CertificateId + Expected *CertificateOrderCertificateId }{ { // Incomplete URI @@ -248,39 +248,39 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name", - Expected: &CertificateId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/nAmE", - Expected: &CertificateId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe", + Expected: &CertificateOrderCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CertificateOrderName: "cErTiFiCaTeOrDeRnAmE", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseCertificateIDInsensitively(v.Input) + actual, err := ParseCertificateOrderCertificateIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseCertificateIDInsensitively(t *testing.T) { } } -func TestSegmentsForCertificateId(t *testing.T) { - segments := CertificateId{}.Segments() +func TestSegmentsForCertificateOrderCertificateId(t *testing.T) { + segments := CertificateOrderCertificateId{}.Segments() if len(segments) == 0 { - t.Fatalf("CertificateId has no segments") + t.Fatalf("CertificateOrderCertificateId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2023-12-01/appservicecertificateorders/method_createorupdatecertificate.go b/resource-manager/web/2023-12-01/appservicecertificateorders/method_createorupdatecertificate.go index f8d50a20ddc..013318e02e8 100644 --- a/resource-manager/web/2023-12-01/appservicecertificateorders/method_createorupdatecertificate.go +++ b/resource-manager/web/2023-12-01/appservicecertificateorders/method_createorupdatecertificate.go @@ -22,7 +22,7 @@ type CreateOrUpdateCertificateOperationResponse struct { } // CreateOrUpdateCertificate ... -func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context.Context, id CertificateId, input AppServiceCertificateResource) (result CreateOrUpdateCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificateResource) (result CreateOrUpdateCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -61,7 +61,7 @@ func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context } // CreateOrUpdateCertificateThenPoll performs CreateOrUpdateCertificate then polls until it's completed -func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificateThenPoll(ctx context.Context, id CertificateId, input AppServiceCertificateResource) error { +func (c AppServiceCertificateOrdersClient) CreateOrUpdateCertificateThenPoll(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificateResource) error { result, err := c.CreateOrUpdateCertificate(ctx, id, input) if err != nil { return fmt.Errorf("performing CreateOrUpdateCertificate: %+v", err) diff --git a/resource-manager/web/2023-12-01/appservicecertificateorders/method_deletecertificate.go b/resource-manager/web/2023-12-01/appservicecertificateorders/method_deletecertificate.go index 1bd00712f78..98b4359fd23 100644 --- a/resource-manager/web/2023-12-01/appservicecertificateorders/method_deletecertificate.go +++ b/resource-manager/web/2023-12-01/appservicecertificateorders/method_deletecertificate.go @@ -17,7 +17,7 @@ type DeleteCertificateOperationResponse struct { } // DeleteCertificate ... -func (c AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, id CertificateId) (result DeleteCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, id CertificateOrderCertificateId) (result DeleteCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-12-01/appservicecertificateorders/method_getcertificate.go b/resource-manager/web/2023-12-01/appservicecertificateorders/method_getcertificate.go index 0418d289349..712789271ae 100644 --- a/resource-manager/web/2023-12-01/appservicecertificateorders/method_getcertificate.go +++ b/resource-manager/web/2023-12-01/appservicecertificateorders/method_getcertificate.go @@ -18,7 +18,7 @@ type GetCertificateOperationResponse struct { } // GetCertificate ... -func (c AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, id CertificateId) (result GetCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, id CertificateOrderCertificateId) (result GetCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-12-01/appservicecertificateorders/method_updatecertificate.go b/resource-manager/web/2023-12-01/appservicecertificateorders/method_updatecertificate.go index 8ebfd637ea5..dbb5136b153 100644 --- a/resource-manager/web/2023-12-01/appservicecertificateorders/method_updatecertificate.go +++ b/resource-manager/web/2023-12-01/appservicecertificateorders/method_updatecertificate.go @@ -18,7 +18,7 @@ type UpdateCertificateOperationResponse struct { } // UpdateCertificate ... -func (c AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, id CertificateId, input AppServiceCertificatePatchResource) (result UpdateCertificateOperationResponse, err error) { +func (c AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, id CertificateOrderCertificateId, input AppServiceCertificatePatchResource) (result UpdateCertificateOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/README.md b/resource-manager/web/2023-12-01/appserviceenvironments/README.md index ff09f3d876f..c8e08882805 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/README.md +++ b/resource-manager/web/2023-12-01/appserviceenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") payload := appserviceenvironments.RemotePrivateEndpointConnectionARMResource{ // ... @@ -98,7 +98,7 @@ if err := client.CreateOrUpdateMultiRolePoolThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") payload := appserviceenvironments.WorkerPoolResource{ // ... @@ -143,7 +143,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName") +id := appserviceenvironments.NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName") read, err := client.GetDiagnosticsItem(ctx, id) if err != nil { @@ -269,7 +269,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := appserviceenvironments.NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -334,7 +334,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") read, err := client.GetWorkerPool(ctx, id) if err != nil { @@ -451,7 +451,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance") +id := appserviceenvironments.NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName") // alternatively `client.ListMultiRolePoolInstanceMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListMultiRolePoolInstanceMetricDefinitionsComplete(ctx, id) @@ -569,7 +569,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWebWorkerMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListWebWorkerMetricDefinitionsComplete(ctx, id) @@ -586,7 +586,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWebWorkerUsages(ctx, id)` can be used to do batched pagination items, err := client.ListWebWorkerUsagesComplete(ctx, id) @@ -603,7 +603,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance") +id := appserviceenvironments.NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName") // alternatively `client.ListWorkerPoolInstanceMetricDefinitions(ctx, id)` can be used to do batched pagination items, err := client.ListWorkerPoolInstanceMetricDefinitionsComplete(ctx, id) @@ -620,7 +620,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") // alternatively `client.ListWorkerPoolSkus(ctx, id)` can be used to do batched pagination items, err := client.ListWorkerPoolSkusComplete(ctx, id) @@ -804,7 +804,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") +id := appserviceenvironments.NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") payload := appserviceenvironments.WorkerPoolResource{ // ... diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_defaultinstance.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_defaultinstance.go index c2d2d2a4659..88c10f8ab90 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_defaultinstance.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_defaultinstance.go @@ -121,11 +121,11 @@ func (id DefaultInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticMultiRolePools", "multiRolePools", "multiRolePools"), resourceids.StaticSegment("staticDefault", "default", "default"), resourceids.StaticSegment("staticInstances", "instances", "instances"), - resourceids.UserSpecifiedSegment("instanceName", "instance"), + resourceids.UserSpecifiedSegment("instanceName", "instanceName"), } } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_defaultinstance_test.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_defaultinstance_test.go index 69c92d45326..a260dfe3401 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_defaultinstance_test.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_defaultinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DefaultInstanceId{} func TestNewDefaultInstanceID(t *testing.T) { - id := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance") + id := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDefaultInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.InstanceName != "instance" { - t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instance") + if id.InstanceName != "instanceName" { + t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instanceName") } } func TestFormatDefaultInstanceID(t *testing.T) { - actual := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instance").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance" + actual := NewDefaultInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "instanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseDefaultInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - InstanceName: "instance", + HostingEnvironmentName: "hostingEnvironmentName", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseDefaultInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - InstanceName: "instance", + HostingEnvironmentName: "hostingEnvironmentName", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/multiRolePools/default/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/multiRolePools/default/instances/instanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcEnAmE", Expected: &DefaultInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", - InstanceName: "iNsTaNcE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", + InstanceName: "iNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/mUlTiRoLePoOlS/dEfAuLt/iNsTaNcEs/iNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go index f30c0af2108..9c0321e3f7a 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentdiagnostic.go @@ -121,9 +121,9 @@ func (id HostingEnvironmentDiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticsName"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go index 50a9f57decc..e998d9bcef1 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentdiagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentDiagnosticId{} func TestNewHostingEnvironmentDiagnosticID(t *testing.T) { - id := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName") + id := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHostingEnvironmentDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.DiagnosticName != "diagnosticsName" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticsName") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatHostingEnvironmentDiagnosticID(t *testing.T) { - actual := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "diagnosticsName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName" + actual := NewHostingEnvironmentDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentDiagnosticID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - DiagnosticName: "diagnosticsName", + HostingEnvironmentName: "hostingEnvironmentName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentDiagnosticIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", - DiagnosticName: "diagnosticsName", + HostingEnvironmentName: "hostingEnvironmentName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/diagnostics/diagnosticsName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs/dIaGnOsTiCsNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &HostingEnvironmentDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", - DiagnosticName: "dIaGnOsTiCsNaMe", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dIaGnOsTiCs/dIaGnOsTiCsNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go index 9e9e3ca4d87..415a31bdc7e 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection.go @@ -121,7 +121,7 @@ func (id HostingEnvironmentPrivateEndpointConnectionId) Segments() []resourceids resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go index 3fdc734c969..f343f7258e6 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_hostingenvironmentprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentPrivateEndpointConnectionId{} func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { - id := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { } func TestFormatHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { - actual := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewHostingEnvironmentPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentPrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentPrivateEndpointConnectionIDInsensitively(t *test }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &HostingEnvironmentPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpool.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpool.go index e477a8499c2..dd10e8ad690 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpool.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpool.go @@ -121,7 +121,7 @@ func (id WorkerPoolId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticWorkerPools", "workerPools", "workerPools"), resourceids.UserSpecifiedSegment("workerPoolName", "workerPoolName"), } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpool_test.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpool_test.go index 9796b8d8b07..df611010d06 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpool_test.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpool_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerPoolId{} func TestNewWorkerPoolID(t *testing.T) { - id := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName") + id := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkerPoolID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.WorkerPoolName != "workerPoolName" { @@ -32,8 +32,8 @@ func TestNewWorkerPoolID(t *testing.T) { } func TestFormatWorkerPoolID(t *testing.T) { - actual := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName" + actual := NewWorkerPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkerPoolID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkerPoolIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", Expected: &WorkerPoolId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", WorkerPoolName: "wOrKeRpOoLnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpoolinstance.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpoolinstance.go index be628dbc4e4..50a42965552 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpoolinstance.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpoolinstance.go @@ -127,11 +127,11 @@ func (id WorkerPoolInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticWorkerPools", "workerPools", "workerPools"), resourceids.UserSpecifiedSegment("workerPoolName", "workerPoolName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), - resourceids.UserSpecifiedSegment("instanceName", "instance"), + resourceids.UserSpecifiedSegment("instanceName", "instanceName"), } } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpoolinstance_test.go b/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpoolinstance_test.go index fd84259fbb8..b23611ebd58 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpoolinstance_test.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/id_workerpoolinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerPoolInstanceId{} func TestNewWorkerPoolInstanceID(t *testing.T) { - id := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance") + id := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewWorkerPoolInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.WorkerPoolName != "workerPoolName" { t.Fatalf("Expected %q but got %q for Segment 'WorkerPoolName'", id.WorkerPoolName, "workerPoolName") } - if id.InstanceName != "instance" { - t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instance") + if id.InstanceName != "instanceName" { + t.Fatalf("Expected %q but got %q for Segment 'InstanceName'", id.InstanceName, "instanceName") } } func TestFormatWorkerPoolInstanceID(t *testing.T) { - actual := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerPoolName", "instance").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance" + actual := NewWorkerPoolInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "workerPoolName", "instanceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseWorkerPoolInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", - InstanceName: "instance", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseWorkerPoolInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", WorkerPoolName: "workerPoolName", - InstanceName: "instance", + InstanceName: "instanceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/workerPools/workerPoolName/instances/instance/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/workerPools/workerPoolName/instances/instanceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcEnAmE", Expected: &WorkerPoolInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", WorkerPoolName: "wOrKeRpOoLnAmE", - InstanceName: "iNsTaNcE", + InstanceName: "iNsTaNcEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/wOrKeRpOoLs/wOrKeRpOoLnAmE/iNsTaNcEs/iNsTaNcEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go b/resource-manager/web/2023-12-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go index 80ac53f7a52..54d57c9d118 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/model_customdnssuffixconfigurationproperties.go @@ -4,7 +4,7 @@ package appserviceenvironments // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type CustomDnsSuffixConfigurationProperties struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` DnsSuffix *string `json:"dnsSuffix,omitempty"` KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` ProvisioningDetails *string `json:"provisioningDetails,omitempty"` diff --git a/resource-manager/web/2023-12-01/appserviceenvironments/model_rampuprule.go b/resource-manager/web/2023-12-01/appserviceenvironments/model_rampuprule.go index ace74b58d88..0db6bb0db58 100644 --- a/resource-manager/web/2023-12-01/appserviceenvironments/model_rampuprule.go +++ b/resource-manager/web/2023-12-01/appserviceenvironments/model_rampuprule.go @@ -5,7 +5,7 @@ package appserviceenvironments type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2023-12-01/appserviceplans/README.md b/resource-manager/web/2023-12-01/appserviceplans/README.md index d60dfef49b2..f0bf5f1c6f6 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/README.md +++ b/resource-manager/web/2023-12-01/appserviceplans/README.md @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") payload := appserviceplans.VnetRoute{ // ... @@ -79,7 +79,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnection(ctx, id) if err != nil { @@ -95,7 +95,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") read, err := client.DeleteVnetRoute(ctx, id) if err != nil { @@ -127,7 +127,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnection(ctx, id) if err != nil { @@ -159,7 +159,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") read, err := client.GetRouteForVnet(ctx, id) if err != nil { @@ -191,7 +191,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") read, err := client.GetVnetFromServerFarm(ctx, id) if err != nil { @@ -207,7 +207,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetGateway(ctx, id) if err != nil { @@ -273,7 +273,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") read, err := client.ListHybridConnectionKeys(ctx, id) if err != nil { @@ -306,7 +306,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") read, err := client.ListRoutesForVnet(ctx, id) if err != nil { @@ -372,7 +372,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") // alternatively `client.ListWebAppsByHybridConnection(ctx, id)` can be used to do batched pagination items, err := client.ListWebAppsByHybridConnectionComplete(ctx, id) @@ -389,7 +389,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := appserviceplans.NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName") +id := appserviceplans.NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName") read, err := client.RebootWorker(ctx, id) if err != nil { @@ -442,7 +442,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") payload := appserviceplans.VnetGateway{ // ... @@ -463,7 +463,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") +id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") payload := appserviceplans.VnetRoute{ // ... diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_hybridconnectionnamespacerelay.go b/resource-manager/web/2023-12-01/appserviceplans/id_hybridconnectionnamespacerelay.go index a674a4cebd6..31cf0010bc4 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_hybridconnectionnamespacerelay.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_hybridconnectionnamespacerelay.go @@ -127,9 +127,9 @@ func (id HybridConnectionNamespaceRelayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go b/resource-manager/web/2023-12-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go index ac6e1d1f4b0..ca8a17b9536 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_hybridconnectionnamespacerelay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HybridConnectionNamespaceRelayId{} func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { - id := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") + id := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -36,8 +36,8 @@ func TestNewHybridConnectionNamespaceRelayID(t *testing.T) { } func TestFormatHybridConnectionNamespaceRelayID(t *testing.T) { - actual := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseHybridConnectionNamespaceRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - HybridConnectionNamespaceName: "namespaceName", + ServerFarmName: "serverFarmName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseHybridConnectionNamespaceRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - HybridConnectionNamespaceName: "namespaceName", + ServerFarmName: "serverFarmName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &HybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + ServerFarmName: "sErVeRfArMnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_route.go b/resource-manager/web/2023-12-01/appserviceplans/id_route.go index 7b34860722d..4368f47c094 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_route.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_route.go @@ -127,9 +127,9 @@ func (id RouteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticRoutes", "routes", "routes"), resourceids.UserSpecifiedSegment("routeName", "routeName"), } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_route_test.go b/resource-manager/web/2023-12-01/appserviceplans/id_route_test.go index d313c62cf7d..ec524514b68 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_route_test.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_route_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RouteId{} func TestNewRouteID(t *testing.T) { - id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName") + id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewRouteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.RouteName != "routeName" { @@ -36,8 +36,8 @@ func TestNewRouteID(t *testing.T) { } func TestFormatRouteID(t *testing.T) { - actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "routeName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName" + actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "routeName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRouteID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", RouteName: "routeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRouteIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", RouteName: "routeName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/routes/routeName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/routes/routeName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS/rOuTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS/rOuTeNaMe", Expected: &RouteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", RouteName: "rOuTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/rOuTeS/rOuTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/rOuTeS/rOuTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go b/resource-manager/web/2023-12-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go index c2948bed06a..5d43668ff23 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_serverfarmvirtualnetworkconnection.go @@ -121,9 +121,9 @@ func (id ServerFarmVirtualNetworkConnectionId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go b/resource-manager/web/2023-12-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go index 13403b364d7..5601db88695 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_serverfarmvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ServerFarmVirtualNetworkConnectionId{} func TestNewServerFarmVirtualNetworkConnectionID(t *testing.T) { - id := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") + id := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewServerFarmVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatServerFarmVirtualNetworkConnectionID(t *testing.T) { - actual := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName" + actual := NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseServerFarmVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseServerFarmVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &ServerFarmVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_virtualnetworkconnectiongateway.go b/resource-manager/web/2023-12-01/appserviceplans/id_virtualnetworkconnectiongateway.go index aee31447cb0..4ccedb2d7ce 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_virtualnetworkconnectiongateway.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_virtualnetworkconnectiongateway.go @@ -127,9 +127,9 @@ func (id VirtualNetworkConnectionGatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go b/resource-manager/web/2023-12-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go index 65d74773465..d542242e414 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_virtualnetworkconnectiongateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkConnectionGatewayId{} func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { - id := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") + id := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -36,8 +36,8 @@ func TestNewVirtualNetworkConnectionGatewayID(t *testing.T) { } func TestFormatVirtualNetworkConnectionGatewayID(t *testing.T) { - actual := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseVirtualNetworkConnectionGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseVirtualNetworkConnectionGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", - VirtualNetworkConnectionName: "vnetName", + ServerFarmName: "serverFarmName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &VirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + ServerFarmName: "sErVeRfArMnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_worker.go b/resource-manager/web/2023-12-01/appserviceplans/id_worker.go index f6e647697b7..31d71dbd008 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_worker.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_worker.go @@ -121,7 +121,7 @@ func (id WorkerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticServerFarms", "serverFarms", "serverFarms"), - resourceids.UserSpecifiedSegment("serverFarmName", "name"), + resourceids.UserSpecifiedSegment("serverFarmName", "serverFarmName"), resourceids.StaticSegment("staticWorkers", "workers", "workers"), resourceids.UserSpecifiedSegment("workerName", "workerName"), } diff --git a/resource-manager/web/2023-12-01/appserviceplans/id_worker_test.go b/resource-manager/web/2023-12-01/appserviceplans/id_worker_test.go index 3d0a5de85c5..9113edebceb 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/id_worker_test.go +++ b/resource-manager/web/2023-12-01/appserviceplans/id_worker_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkerId{} func TestNewWorkerID(t *testing.T) { - id := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName") + id := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ServerFarmName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "name") + if id.ServerFarmName != "serverFarmName" { + t.Fatalf("Expected %q but got %q for Segment 'ServerFarmName'", id.ServerFarmName, "serverFarmName") } if id.WorkerName != "workerName" { @@ -32,8 +32,8 @@ func TestNewWorkerID(t *testing.T) { } func TestFormatWorkerID(t *testing.T) { - actual := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName" + actual := NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmName", "workerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", + ServerFarmName: "serverFarmName", WorkerName: "workerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ServerFarmName: "name", + ServerFarmName: "serverFarmName", WorkerName: "workerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/name/workers/workerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/serverFarms/serverFarmName/workers/workerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs/wOrKeRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs/wOrKeRnAmE", Expected: &WorkerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerFarmName: "nAmE", + ServerFarmName: "sErVeRfArMnAmE", WorkerName: "wOrKeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/nAmE/wOrKeRs/wOrKeRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sErVeRfArMs/sErVeRfArMnAmE/wOrKeRs/wOrKeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/appserviceplans/model_rampuprule.go b/resource-manager/web/2023-12-01/appserviceplans/model_rampuprule.go index a8a0548b489..424344dba00 100644 --- a/resource-manager/web/2023-12-01/appserviceplans/model_rampuprule.go +++ b/resource-manager/web/2023-12-01/appserviceplans/model_rampuprule.go @@ -5,7 +5,7 @@ package appserviceplans type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2023-12-01/certificateordersdiagnostics/README.md b/resource-manager/web/2023-12-01/certificateordersdiagnostics/README.md index 6c49e8e2265..2b09ec1dc50 100644 --- a/resource-manager/web/2023-12-01/certificateordersdiagnostics/README.md +++ b/resource-manager/web/2023-12-01/certificateordersdiagnostics/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificateordersdiagnostics.NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") +id := certificateordersdiagnostics.NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") read, err := client.GetAppServiceCertificateOrderDetectorResponse(ctx, id, certificateordersdiagnostics.DefaultGetAppServiceCertificateOrderDetectorResponseOperationOptions()) if err != nil { diff --git a/resource-manager/web/2022-09-01/certificateordersdiagnostics/id_detector.go b/resource-manager/web/2023-12-01/certificateordersdiagnostics/id_certificateorderdetector.go similarity index 63% rename from resource-manager/web/2022-09-01/certificateordersdiagnostics/id_detector.go rename to resource-manager/web/2023-12-01/certificateordersdiagnostics/id_certificateorderdetector.go index acee2df5ba1..cbb8826cb13 100644 --- a/resource-manager/web/2022-09-01/certificateordersdiagnostics/id_detector.go +++ b/resource-manager/web/2023-12-01/certificateordersdiagnostics/id_certificateorderdetector.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&DetectorId{}) + recaser.RegisterResourceId(&CertificateOrderDetectorId{}) } -var _ resourceids.ResourceId = &DetectorId{} +var _ resourceids.ResourceId = &CertificateOrderDetectorId{} -// DetectorId is a struct representing the Resource ID for a Detector -type DetectorId struct { +// CertificateOrderDetectorId is a struct representing the Resource ID for a Certificate Order Detector +type CertificateOrderDetectorId struct { SubscriptionId string ResourceGroupName string CertificateOrderName string DetectorName string } -// NewDetectorID returns a new DetectorId struct -func NewDetectorID(subscriptionId string, resourceGroupName string, certificateOrderName string, detectorName string) DetectorId { - return DetectorId{ +// NewCertificateOrderDetectorID returns a new CertificateOrderDetectorId struct +func NewCertificateOrderDetectorID(subscriptionId string, resourceGroupName string, certificateOrderName string, detectorName string) CertificateOrderDetectorId { + return CertificateOrderDetectorId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, CertificateOrderName: certificateOrderName, @@ -35,15 +35,15 @@ func NewDetectorID(subscriptionId string, resourceGroupName string, certificateO } } -// ParseDetectorID parses 'input' into a DetectorId -func ParseDetectorID(input string) (*DetectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DetectorId{}) +// ParseCertificateOrderDetectorID parses 'input' into a CertificateOrderDetectorId +func ParseCertificateOrderDetectorID(input string) (*CertificateOrderDetectorId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderDetectorId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DetectorId{} + id := CertificateOrderDetectorId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseDetectorID(input string) (*DetectorId, error) { return &id, nil } -// ParseDetectorIDInsensitively parses 'input' case-insensitively into a DetectorId +// ParseCertificateOrderDetectorIDInsensitively parses 'input' case-insensitively into a CertificateOrderDetectorId // note: this method should only be used for API response data and not user input -func ParseDetectorIDInsensitively(input string) (*DetectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DetectorId{}) +func ParseCertificateOrderDetectorIDInsensitively(input string) (*CertificateOrderDetectorId, error) { + parser := resourceids.NewParserFromResourceIdType(&CertificateOrderDetectorId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DetectorId{} + id := CertificateOrderDetectorId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseDetectorIDInsensitively(input string) (*DetectorId, error) { return &id, nil } -func (id *DetectorId) FromParseResult(input resourceids.ParseResult) error { +func (id *CertificateOrderDetectorId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *DetectorId) FromParseResult(input resourceids.ParseResult) error { return nil } -// ValidateDetectorID checks that 'input' can be parsed as a Detector ID -func ValidateDetectorID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateCertificateOrderDetectorID checks that 'input' can be parsed as a Certificate Order Detector ID +func ValidateCertificateOrderDetectorID(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 := ParseDetectorID(v); err != nil { + if _, err := ParseCertificateOrderDetectorID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Detector ID -func (id DetectorId) ID() string { +// ID returns the formatted Certificate Order Detector ID +func (id CertificateOrderDetectorId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.CertificateRegistration/certificateOrders/%s/detectors/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CertificateOrderName, id.DetectorName) } -// Segments returns a slice of Resource ID Segments which comprise this Detector ID -func (id DetectorId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Certificate Order Detector ID +func (id CertificateOrderDetectorId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -127,13 +127,13 @@ func (id DetectorId) Segments() []resourceids.Segment { } } -// String returns a human-readable description of this Detector ID -func (id DetectorId) String() string { +// String returns a human-readable description of this Certificate Order Detector ID +func (id CertificateOrderDetectorId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Certificate Order Name: %q", id.CertificateOrderName), fmt.Sprintf("Detector Name: %q", id.DetectorName), } - return fmt.Sprintf("Detector (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Certificate Order Detector (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2023-01-01/certificateordersdiagnostics/id_detector_test.go b/resource-manager/web/2023-12-01/certificateordersdiagnostics/id_certificateorderdetector_test.go similarity index 90% rename from resource-manager/web/2023-01-01/certificateordersdiagnostics/id_detector_test.go rename to resource-manager/web/2023-12-01/certificateordersdiagnostics/id_certificateorderdetector_test.go index 067f02845eb..b24ca655c01 100644 --- a/resource-manager/web/2023-01-01/certificateordersdiagnostics/id_detector_test.go +++ b/resource-manager/web/2023-12-01/certificateordersdiagnostics/id_certificateorderdetector_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &DetectorId{} +var _ resourceids.ResourceId = &CertificateOrderDetectorId{} -func TestNewDetectorID(t *testing.T) { - id := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") +func TestNewCertificateOrderDetectorID(t *testing.T) { + id := NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -31,19 +31,19 @@ func TestNewDetectorID(t *testing.T) { } } -func TestFormatDetectorID(t *testing.T) { - actual := NewDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName").ID() +func TestFormatCertificateOrderDetectorID(t *testing.T) { + actual := NewCertificateOrderDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateOrderName", "detectorName").ID() expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseDetectorID(t *testing.T) { +func TestParseCertificateOrderDetectorID(t *testing.T) { testData := []struct { Input string Error bool - Expected *DetectorId + Expected *CertificateOrderDetectorId }{ { // Incomplete URI @@ -98,7 +98,7 @@ func TestParseDetectorID(t *testing.T) { { // Valid URI Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", @@ -114,7 +114,7 @@ func TestParseDetectorID(t *testing.T) { for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDetectorID(v.Input) + actual, err := ParseCertificateOrderDetectorID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseDetectorID(t *testing.T) { } } -func TestParseDetectorIDInsensitively(t *testing.T) { +func TestParseCertificateOrderDetectorIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *DetectorId + Expected *CertificateOrderDetectorId }{ { // Incomplete URI @@ -249,7 +249,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { { // Valid URI Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.CertificateRegistration/certificateOrders/certificateOrderName/detectors/detectorName", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", CertificateOrderName: "certificateOrderName", @@ -264,7 +264,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { { // Valid URI (mIxEd CaSe since this is insensitive) Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cErTiFiCaTeReGiStRaTiOn/cErTiFiCaTeOrDeRs/cErTiFiCaTeOrDeRnAmE/dEtEcToRs/dEtEcToRnAmE", - Expected: &DetectorId{ + Expected: &CertificateOrderDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", CertificateOrderName: "cErTiFiCaTeOrDeRnAmE", @@ -280,7 +280,7 @@ func TestParseDetectorIDInsensitively(t *testing.T) { for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDetectorIDInsensitively(v.Input) + actual, err := ParseCertificateOrderDetectorIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseDetectorIDInsensitively(t *testing.T) { } } -func TestSegmentsForDetectorId(t *testing.T) { - segments := DetectorId{}.Segments() +func TestSegmentsForCertificateOrderDetectorId(t *testing.T) { + segments := CertificateOrderDetectorId{}.Segments() if len(segments) == 0 { - t.Fatalf("DetectorId has no segments") + t.Fatalf("CertificateOrderDetectorId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2023-12-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go b/resource-manager/web/2023-12-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go index 15ff71d98cd..c23cb352353 100644 --- a/resource-manager/web/2023-12-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go +++ b/resource-manager/web/2023-12-01/certificateordersdiagnostics/method_getappservicecertificateorderdetectorresponse.go @@ -55,7 +55,7 @@ func (o GetAppServiceCertificateOrderDetectorResponseOperationOptions) ToQuery() } // GetAppServiceCertificateOrderDetectorResponse ... -func (c CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, id DetectorId, options GetAppServiceCertificateOrderDetectorResponseOperationOptions) (result GetAppServiceCertificateOrderDetectorResponseOperationResponse, err error) { +func (c CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, id CertificateOrderDetectorId, options GetAppServiceCertificateOrderDetectorResponseOperationOptions) (result GetAppServiceCertificateOrderDetectorResponseOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-12-01/certificates/README.md b/resource-manager/web/2023-12-01/certificates/README.md index 93325ba35d1..84f851420f6 100644 --- a/resource-manager/web/2023-12-01/certificates/README.md +++ b/resource-manager/web/2023-12-01/certificates/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") payload := certificates.Certificate{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") read, err := client.Delete(ctx, id) if err != nil { @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") read, err := client.Get(ctx, id) if err != nil { @@ -112,7 +112,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := certificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") payload := certificates.CertificatePatchResource{ // ... diff --git a/resource-manager/web/2023-12-01/certificates/id_certificate.go b/resource-manager/web/2023-12-01/certificates/id_certificate.go index 46aa8344efc..3ef853c576d 100644 --- a/resource-manager/web/2023-12-01/certificates/id_certificate.go +++ b/resource-manager/web/2023-12-01/certificates/id_certificate.go @@ -115,7 +115,7 @@ func (id CertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "name"), + resourceids.UserSpecifiedSegment("certificateName", "certificateName"), } } diff --git a/resource-manager/web/2023-12-01/certificates/id_certificate_test.go b/resource-manager/web/2023-12-01/certificates/id_certificate_test.go index c64fa1af09e..b4d6ef8d3b8 100644 --- a/resource-manager/web/2023-12-01/certificates/id_certificate_test.go +++ b/resource-manager/web/2023-12-01/certificates/id_certificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CertificateId{} func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.CertificateName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "name") + if id.CertificateName != "certificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateName") } } func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name" + actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "certificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseCertificateID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseCertificateIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - CertificateName: "name", + CertificateName: "certificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/certificates/certificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/cErTiFiCaTeNaMe", Expected: &CertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CertificateName: "nAmE", + CertificateName: "cErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cErTiFiCaTeS/cErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/containerapps/README.md b/resource-manager/web/2023-12-01/containerapps/README.md index 74be9a36f76..adbef710110 100644 --- a/resource-manager/web/2023-12-01/containerapps/README.md +++ b/resource-manager/web/2023-12-01/containerapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") payload := containerapps.ContainerApp{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerapps.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "name") +id := containerapps.NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName") read, err := client.ListSecrets(ctx, id) if err != nil { diff --git a/resource-manager/web/2023-12-01/containerapps/id_containerapp.go b/resource-manager/web/2023-12-01/containerapps/id_containerapp.go index 95fa925f7df..3f70ccac898 100644 --- a/resource-manager/web/2023-12-01/containerapps/id_containerapp.go +++ b/resource-manager/web/2023-12-01/containerapps/id_containerapp.go @@ -107,7 +107,7 @@ func (id ContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2023-12-01/containerapps/id_containerapp_test.go b/resource-manager/web/2023-12-01/containerapps/id_containerapp_test.go index d60d389bf8e..7117d5e1f72 100644 --- a/resource-manager/web/2023-12-01/containerapps/id_containerapp_test.go +++ b/resource-manager/web/2023-12-01/containerapps/id_containerapp_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ContainerAppId{} func TestNewContainerAppID(t *testing.T) { - id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "name") + id := NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatContainerAppID(t *testing.T) { - actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name" + actual := NewContainerAppID("12345678-1234-9876-4563-123456789012", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/containerapps/id_providercontainerapp.go b/resource-manager/web/2023-12-01/containerapps/id_providercontainerapp.go index 8ce8585f832..b816f39ada9 100644 --- a/resource-manager/web/2023-12-01/containerapps/id_providercontainerapp.go +++ b/resource-manager/web/2023-12-01/containerapps/id_providercontainerapp.go @@ -115,7 +115,7 @@ func (id ProviderContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2023-12-01/containerapps/id_providercontainerapp_test.go b/resource-manager/web/2023-12-01/containerapps/id_providercontainerapp_test.go index 8b4bc22a85f..55188842290 100644 --- a/resource-manager/web/2023-12-01/containerapps/id_providercontainerapp_test.go +++ b/resource-manager/web/2023-12-01/containerapps/id_providercontainerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderContainerAppId{} func TestNewProviderContainerAppID(t *testing.T) { - id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatProviderContainerAppID(t *testing.T) { - actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name" + actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/containerappsrevisions/README.md b/resource-manager/web/2023-12-01/containerappsrevisions/README.md index e1aeee2752b..f4c87ec7908 100644 --- a/resource-manager/web/2023-12-01/containerappsrevisions/README.md +++ b/resource-manager/web/2023-12-01/containerappsrevisions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.ActivateRevision(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.DeactivateRevision(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.GetRevision(ctx, id) if err != nil { @@ -72,7 +72,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := containerappsrevisions.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := containerappsrevisions.NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") // alternatively `client.ListRevisions(ctx, id)` can be used to do batched pagination items, err := client.ListRevisionsComplete(ctx, id) @@ -89,7 +89,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") +id := containerappsrevisions.NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") read, err := client.RestartRevision(ctx, id) if err != nil { diff --git a/resource-manager/web/2023-12-01/containerappsrevisions/id_providercontainerapp.go b/resource-manager/web/2023-12-01/containerappsrevisions/id_providercontainerapp.go index a590f83df39..b9383d30fbd 100644 --- a/resource-manager/web/2023-12-01/containerappsrevisions/id_providercontainerapp.go +++ b/resource-manager/web/2023-12-01/containerappsrevisions/id_providercontainerapp.go @@ -115,7 +115,7 @@ func (id ProviderContainerAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), - resourceids.UserSpecifiedSegment("containerAppName", "name"), + resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), } } diff --git a/resource-manager/web/2023-12-01/containerappsrevisions/id_providercontainerapp_test.go b/resource-manager/web/2023-12-01/containerappsrevisions/id_providercontainerapp_test.go index 79553ea3764..1ab5644f109 100644 --- a/resource-manager/web/2023-12-01/containerappsrevisions/id_providercontainerapp_test.go +++ b/resource-manager/web/2023-12-01/containerappsrevisions/id_providercontainerapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProviderContainerAppId{} func TestNewProviderContainerAppID(t *testing.T) { - id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewProviderContainerAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.ContainerAppName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "name") + if id.ContainerAppName != "containerAppName" { + t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } } func TestFormatProviderContainerAppID(t *testing.T) { - actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name" + actual := NewProviderContainerAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseProviderContainerAppID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseProviderContainerAppIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - ContainerAppName: "name", + ContainerAppName: "containerAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE", Expected: &ProviderContainerAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ContainerAppName: "nAmE", + ContainerAppName: "cOnTaInErApPnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/containerappsrevisions/id_revision.go b/resource-manager/web/2023-12-01/containerappsrevisions/id_revision.go index b6c364f9728..eee8b68dfe6 100644 --- a/resource-manager/web/2023-12-01/containerappsrevisions/id_revision.go +++ b/resource-manager/web/2023-12-01/containerappsrevisions/id_revision.go @@ -123,7 +123,7 @@ func (id RevisionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticContainerApps", "containerApps", "containerApps"), resourceids.UserSpecifiedSegment("containerAppName", "containerAppName"), resourceids.StaticSegment("staticRevisions", "revisions", "revisions"), - resourceids.UserSpecifiedSegment("revisionName", "name"), + resourceids.UserSpecifiedSegment("revisionName", "revisionName"), } } diff --git a/resource-manager/web/2023-12-01/containerappsrevisions/id_revision_test.go b/resource-manager/web/2023-12-01/containerappsrevisions/id_revision_test.go index bb958a5df26..224a34a6a98 100644 --- a/resource-manager/web/2023-12-01/containerappsrevisions/id_revision_test.go +++ b/resource-manager/web/2023-12-01/containerappsrevisions/id_revision_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RevisionId{} func TestNewRevisionID(t *testing.T) { - id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name") + id := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewRevisionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ContainerAppName'", id.ContainerAppName, "containerAppName") } - if id.RevisionName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RevisionName'", id.RevisionName, "name") + if id.RevisionName != "revisionName" { + t.Fatalf("Expected %q but got %q for Segment 'RevisionName'", id.RevisionName, "revisionName") } } func TestFormatRevisionID(t *testing.T) { - actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name" + actual := NewRevisionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "containerAppName", "revisionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseRevisionID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ContainerAppName: "containerAppName", - RevisionName: "name", + RevisionName: "revisionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseRevisionIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", ContainerAppName: "containerAppName", - RevisionName: "name", + RevisionName: "revisionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/containerApps/containerAppName/revisions/revisionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE", Expected: &RevisionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", ContainerAppName: "cOnTaInErApPnAmE", - RevisionName: "nAmE", + RevisionName: "rEvIsIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/cOnTaInErApPs/cOnTaInErApPnAmE/rEvIsIoNs/rEvIsIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/deletedwebapps/README.md b/resource-manager/web/2023-12-01/deletedwebapps/README.md index d1ae0058c71..aecd11922f5 100644 --- a/resource-manager/web/2023-12-01/deletedwebapps/README.md +++ b/resource-manager/web/2023-12-01/deletedwebapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := deletedwebapps.NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId") +id := deletedwebapps.NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId") read, err := client.GetDeletedWebAppByLocation(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := deletedwebapps.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") +id := deletedwebapps.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination items, err := client.ListByLocationComplete(ctx, id) diff --git a/resource-manager/web/2023-12-01/deletedwebapps/id_locationdeletedsite.go b/resource-manager/web/2023-12-01/deletedwebapps/id_locationdeletedsite.go index 21f68459dcf..28780740879 100644 --- a/resource-manager/web/2023-12-01/deletedwebapps/id_locationdeletedsite.go +++ b/resource-manager/web/2023-12-01/deletedwebapps/id_locationdeletedsite.go @@ -113,7 +113,7 @@ func (id LocationDeletedSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), resourceids.StaticSegment("staticDeletedSites", "deletedSites", "deletedSites"), resourceids.UserSpecifiedSegment("deletedSiteId", "deletedSiteId"), } diff --git a/resource-manager/web/2023-12-01/deletedwebapps/id_locationdeletedsite_test.go b/resource-manager/web/2023-12-01/deletedwebapps/id_locationdeletedsite_test.go index 5747600bb4e..b406ec22fa2 100644 --- a/resource-manager/web/2023-12-01/deletedwebapps/id_locationdeletedsite_test.go +++ b/resource-manager/web/2023-12-01/deletedwebapps/id_locationdeletedsite_test.go @@ -12,14 +12,14 @@ import ( var _ resourceids.ResourceId = &LocationDeletedSiteId{} func TestNewLocationDeletedSiteID(t *testing.T) { - id := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId") + id := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } if id.DeletedSiteId != "deletedSiteId" { @@ -28,8 +28,8 @@ func TestNewLocationDeletedSiteID(t *testing.T) { } func TestFormatLocationDeletedSiteID(t *testing.T) { - actual := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "location", "deletedSiteId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId" + actual := NewLocationDeletedSiteID("12345678-1234-9876-4563-123456789012", "locationName", "deletedSiteId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -73,26 +73,26 @@ func TestParseLocationDeletedSiteID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedSiteId: "deletedSiteId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId/extra", Error: true, }, } @@ -189,50 +189,50 @@ func TestParseLocationDeletedSiteIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", DeletedSiteId: "deletedSiteId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/deletedSites/deletedSiteId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/deletedSites/deletedSiteId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS/dElEtEdSiTeId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS/dElEtEdSiTeId", Expected: &LocationDeletedSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", DeletedSiteId: "dElEtEdSiTeId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/dElEtEdSiTeS/dElEtEdSiTeId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/dElEtEdSiTeS/dElEtEdSiTeId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/deletedwebapps/id_providerlocation.go b/resource-manager/web/2023-12-01/deletedwebapps/id_providerlocation.go index 43c0d30707e..ba6b4940392 100644 --- a/resource-manager/web/2023-12-01/deletedwebapps/id_providerlocation.go +++ b/resource-manager/web/2023-12-01/deletedwebapps/id_providerlocation.go @@ -107,7 +107,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2023-12-01/deletedwebapps/id_providerlocation_test.go b/resource-manager/web/2023-12-01/deletedwebapps/id_providerlocation_test.go index 4577f6b3b52..fb713255a98 100644 --- a/resource-manager/web/2023-12-01/deletedwebapps/id_providerlocation_test.go +++ b/resource-manager/web/2023-12-01/deletedwebapps/id_providerlocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/README.md b/resource-manager/web/2023-12-01/diagnostics/README.md index f6be272bfb0..828281a4ce0 100644 --- a/resource-manager/web/2023-12-01/diagnostics/README.md +++ b/resource-manager/web/2023-12-01/diagnostics/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") +id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") read, err := client.ExecuteSiteAnalysis(ctx, id, diagnostics.DefaultExecuteSiteAnalysisOperationOptions()) if err != nil { @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") +id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") read, err := client.ExecuteSiteAnalysisSlot(ctx, id, diagnostics.DefaultExecuteSiteAnalysisSlotOperationOptions()) if err != nil { @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") +id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") read, err := client.ExecuteSiteDetector(ctx, id, diagnostics.DefaultExecuteSiteDetectorOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") +id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") read, err := client.ExecuteSiteDetectorSlot(ctx, id, diagnostics.DefaultExecuteSiteDetectorSlotOperationOptions()) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName") +id := diagnostics.NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName") read, err := client.GetHostingEnvironmentDetectorResponse(ctx, id, diagnostics.DefaultGetHostingEnvironmentDetectorResponseOperationOptions()) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") +id := diagnostics.NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") read, err := client.GetSiteAnalysis(ctx, id) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") +id := diagnostics.NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") read, err := client.GetSiteAnalysisSlot(ctx, id) if err != nil { @@ -137,7 +137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") +id := diagnostics.NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") read, err := client.GetSiteDetector(ctx, id) if err != nil { @@ -169,7 +169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName") +id := diagnostics.NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName") read, err := client.GetSiteDetectorResponseSlot(ctx, id, diagnostics.DefaultGetSiteDetectorResponseSlotOperationOptions()) if err != nil { @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") +id := diagnostics.NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") read, err := client.GetSiteDetectorSlot(ctx, id) if err != nil { @@ -201,7 +201,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") read, err := client.GetSiteDiagnosticCategory(ctx, id) if err != nil { @@ -217,7 +217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") read, err := client.GetSiteDiagnosticCategorySlot(ctx, id) if err != nil { @@ -250,7 +250,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") // alternatively `client.ListSiteAnalyses(ctx, id)` can be used to do batched pagination items, err := client.ListSiteAnalysesComplete(ctx, id) @@ -267,7 +267,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") // alternatively `client.ListSiteAnalysesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteAnalysesSlotComplete(ctx, id) @@ -301,7 +301,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteDetectorResponsesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorResponsesSlotComplete(ctx, id) @@ -318,7 +318,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") +id := diagnostics.NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") // alternatively `client.ListSiteDetectors(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorsComplete(ctx, id) @@ -335,7 +335,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") +id := diagnostics.NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") // alternatively `client.ListSiteDetectorsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDetectorsSlotComplete(ctx, id) @@ -369,7 +369,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := diagnostics.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteDiagnosticCategoriesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteDiagnosticCategoriesSlotComplete(ctx, id) diff --git a/resource-manager/web/2023-12-01/diagnostics/id_analysis.go b/resource-manager/web/2023-12-01/diagnostics/id_analysis.go index e82e0c867c9..4ad7593663b 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_analysis.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_analysis.go @@ -129,7 +129,7 @@ func (id AnalysisId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticAnalyses", "analyses", "analyses"), resourceids.UserSpecifiedSegment("analysisName", "analysisName"), } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_analysis_test.go b/resource-manager/web/2023-12-01/diagnostics/id_analysis_test.go index fd7c0c72df7..b5a41dcb6b7 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_analysis_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_analysis_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AnalysisId{} func TestNewAnalysisID(t *testing.T) { - id := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName") + id := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewAnalysisID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.AnalysisName != "analysisName" { @@ -36,8 +36,8 @@ func TestNewAnalysisID(t *testing.T) { } func TestFormatAnalysisID(t *testing.T) { - actual := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "analysisName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName" + actual := NewAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "analysisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseAnalysisID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseAnalysisIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE", Expected: &AnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", AnalysisName: "aNaLySiSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_diagnostic.go b/resource-manager/web/2023-12-01/diagnostics/id_diagnostic.go index 7efa9727df5..d8f916e4863 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_diagnostic.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_diagnostic.go @@ -123,7 +123,7 @@ func (id DiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_diagnostic_test.go b/resource-manager/web/2023-12-01/diagnostics/id_diagnostic_test.go index 80cf8522798..f75e156e5bb 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_diagnostic_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_diagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticId{} func TestNewDiagnosticID(t *testing.T) { - id := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory") + id := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatDiagnosticID(t *testing.T) { - actual := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory" + actual := NewDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDiagnosticID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDiagnosticIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &DiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_diagnosticanalysis.go b/resource-manager/web/2023-12-01/diagnostics/id_diagnosticanalysis.go index d3734f88b3d..c2a851a5780 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_diagnosticanalysis.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_diagnosticanalysis.go @@ -135,9 +135,9 @@ func (id DiagnosticAnalysisId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticAnalyses", "analyses", "analyses"), resourceids.UserSpecifiedSegment("analysisName", "analysisName"), } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_diagnosticanalysis_test.go b/resource-manager/web/2023-12-01/diagnostics/id_diagnosticanalysis_test.go index b6036055128..88593f85f7f 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_diagnosticanalysis_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_diagnosticanalysis_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticAnalysisId{} func TestNewDiagnosticAnalysisID(t *testing.T) { - id := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName") + id := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewDiagnosticAnalysisID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.AnalysisName != "analysisName" { @@ -40,8 +40,8 @@ func TestNewDiagnosticAnalysisID(t *testing.T) { } func TestFormatDiagnosticAnalysisID(t *testing.T) { - actual := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "analysisName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName" + actual := NewDiagnosticAnalysisID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "analysisName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseDiagnosticAnalysisID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseDiagnosticAnalysisIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", AnalysisName: "analysisName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/analyses/analysisName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/analyses/analysisName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE", Expected: &DiagnosticAnalysisId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", AnalysisName: "aNaLySiSnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/aNaLySeS/aNaLySiSnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/aNaLySeS/aNaLySiSnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_diagnosticdetector.go b/resource-manager/web/2023-12-01/diagnostics/id_diagnosticdetector.go index 6a09159ddae..cf131c1681f 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_diagnosticdetector.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_diagnosticdetector.go @@ -129,7 +129,7 @@ func (id DiagnosticDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_diagnosticdetector_test.go b/resource-manager/web/2023-12-01/diagnostics/id_diagnosticdetector_test.go index d2ebe8307c9..cd45a7927c0 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_diagnosticdetector_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_diagnosticdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DiagnosticDetectorId{} func TestNewDiagnosticDetectorID(t *testing.T) { - id := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName") + id := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewDiagnosticDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.DetectorName != "detectorName" { @@ -36,8 +36,8 @@ func TestNewDiagnosticDetectorID(t *testing.T) { } func TestFormatDiagnosticDetectorID(t *testing.T) { - actual := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticCategory", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName" + actual := NewDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "diagnosticName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseDiagnosticDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseDiagnosticDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - DiagnosticName: "diagnosticCategory", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &DiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + DiagnosticName: "dIaGnOsTiCnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_hostingenvironmentdetector.go b/resource-manager/web/2023-12-01/diagnostics/id_hostingenvironmentdetector.go index 0860c9bbbe7..617be4bec18 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_hostingenvironmentdetector.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_hostingenvironmentdetector.go @@ -121,7 +121,7 @@ func (id HostingEnvironmentDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), - resourceids.UserSpecifiedSegment("hostingEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_hostingenvironmentdetector_test.go b/resource-manager/web/2023-12-01/diagnostics/id_hostingenvironmentdetector_test.go index 79fa244b352..6063fa9cdc0 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_hostingenvironmentdetector_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_hostingenvironmentdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentDetectorId{} func TestNewHostingEnvironmentDetectorID(t *testing.T) { - id := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName") + id := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHostingEnvironmentDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.HostingEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "name") + if id.HostingEnvironmentName != "hostingEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } if id.DetectorName != "detectorName" { @@ -32,8 +32,8 @@ func TestNewHostingEnvironmentDetectorID(t *testing.T) { } func TestFormatHostingEnvironmentDetectorID(t *testing.T) { - actual := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName" + actual := NewHostingEnvironmentDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostingEnvironmentDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostingEnvironmentDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - HostingEnvironmentName: "name", + HostingEnvironmentName: "hostingEnvironmentName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/name/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &HostingEnvironmentDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - HostingEnvironmentName: "nAmE", + HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/nAmE/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_slot.go b/resource-manager/web/2023-12-01/diagnostics/id_slot.go index 5196f574350..3458e4a3bca 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_slot.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_slot_test.go b/resource-manager/web/2023-12-01/diagnostics/id_slot_test.go index 9c49573511c..591c34ab7b7 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_slot_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_slotdetector.go b/resource-manager/web/2023-12-01/diagnostics/id_slotdetector.go index 29fdc9326fe..287984b0bc5 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_slotdetector.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_slotdetector.go @@ -129,7 +129,7 @@ func (id SlotDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_slotdetector_test.go b/resource-manager/web/2023-12-01/diagnostics/id_slotdetector_test.go index 173c66061d8..32e7f62003b 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_slotdetector_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_slotdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDetectorId{} func TestNewSlotDetectorID(t *testing.T) { - id := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName") + id := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,8 +26,8 @@ func TestNewSlotDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.DetectorName != "detectorName" { @@ -36,8 +36,8 @@ func TestNewSlotDetectorID(t *testing.T) { } func TestFormatSlotDetectorID(t *testing.T) { - actual := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName" + actual := NewSlotDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSlotDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSlotDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &SlotDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnostic.go b/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnostic.go index 6a8e8318ffe..d94b24e79f8 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnostic.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnostic.go @@ -129,9 +129,9 @@ func (id SlotDiagnosticId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), } } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnostic_test.go b/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnostic_test.go index 5e8a1a839e9..af97181d8ad 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnostic_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnostic_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDiagnosticId{} func TestNewSlotDiagnosticID(t *testing.T) { - id := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory") + id := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,18 +26,18 @@ func TestNewSlotDiagnosticID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } } func TestFormatSlotDiagnosticID(t *testing.T) { - actual := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory" + actual := NewSlotDiagnosticID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -101,28 +101,28 @@ func TestParseSlotDiagnosticID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/extra", Error: true, }, } @@ -267,54 +267,54 @@ func TestParseSlotDiagnosticIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Expected: &SlotDiagnosticId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnosticdetector.go b/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnosticdetector.go index 90bf030bdb5..98ccbee3b33 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnosticdetector.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnosticdetector.go @@ -135,9 +135,9 @@ func (id SlotDiagnosticDetectorId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDiagnostics", "diagnostics", "diagnostics"), - resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticCategory"), + resourceids.UserSpecifiedSegment("diagnosticName", "diagnosticName"), resourceids.StaticSegment("staticDetectors", "detectors", "detectors"), resourceids.UserSpecifiedSegment("detectorName", "detectorName"), } diff --git a/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnosticdetector_test.go b/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnosticdetector_test.go index d3d59c9365f..bfb6c97fbd8 100644 --- a/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnosticdetector_test.go +++ b/resource-manager/web/2023-12-01/diagnostics/id_slotdiagnosticdetector_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDiagnosticDetectorId{} func TestNewSlotDiagnosticDetectorID(t *testing.T) { - id := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName") + id := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,12 +26,12 @@ func TestNewSlotDiagnosticDetectorID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DiagnosticName != "diagnosticCategory" { - t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticCategory") + if id.DiagnosticName != "diagnosticName" { + t.Fatalf("Expected %q but got %q for Segment 'DiagnosticName'", id.DiagnosticName, "diagnosticName") } if id.DetectorName != "detectorName" { @@ -40,8 +40,8 @@ func TestNewSlotDiagnosticDetectorID(t *testing.T) { } func TestFormatSlotDiagnosticDetectorID(t *testing.T) { - actual := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot", "diagnosticCategory", "detectorName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName" + actual := NewSlotDiagnosticDetectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "diagnosticName", "detectorName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -105,39 +105,39 @@ func TestParseSlotDiagnosticDetectorID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, } @@ -286,76 +286,76 @@ func TestParseSlotDiagnosticDetectorIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", - DiagnosticName: "diagnosticCategory", + SlotName: "slotName", + DiagnosticName: "diagnosticName", DetectorName: "detectorName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/diagnostics/diagnosticCategory/detectors/detectorName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/diagnostics/diagnosticName/detectors/detectorName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE", Expected: &SlotDiagnosticDetectorId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", - DiagnosticName: "dIaGnOsTiCcAtEgOrY", + SlotName: "sLoTnAmE", + DiagnosticName: "dIaGnOsTiCnAmE", DetectorName: "dEtEcToRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/dIaGnOsTiCs/dIaGnOsTiCcAtEgOrY/dEtEcToRs/dEtEcToRnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dIaGnOsTiCs/dIaGnOsTiCnAmE/dEtEcToRs/dEtEcToRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/domains/README.md b/resource-manager/web/2023-12-01/domains/README.md index b0f57dd4be9..aeff11707e0 100644 --- a/resource-manager/web/2023-12-01/domains/README.md +++ b/resource-manager/web/2023-12-01/domains/README.md @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") payload := domains.DomainOwnershipIdentifier{ // ... @@ -100,7 +100,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") read, err := client.DeleteOwnershipIdentifier(ctx, id) if err != nil { @@ -148,7 +148,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") read, err := client.GetOwnershipIdentifier(ctx, id) if err != nil { @@ -290,7 +290,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") +id := domains.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") payload := domains.DomainOwnershipIdentifier{ // ... diff --git a/resource-manager/web/2023-12-01/domains/id_domainownershipidentifier.go b/resource-manager/web/2023-12-01/domains/id_domainownershipidentifier.go index 3a7b36ae669..d15193f1a7b 100644 --- a/resource-manager/web/2023-12-01/domains/id_domainownershipidentifier.go +++ b/resource-manager/web/2023-12-01/domains/id_domainownershipidentifier.go @@ -123,7 +123,7 @@ func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticDomains", "domains", "domains"), resourceids.UserSpecifiedSegment("domainName", "domainName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), - resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "name"), + resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } } diff --git a/resource-manager/web/2023-12-01/domains/id_domainownershipidentifier_test.go b/resource-manager/web/2023-12-01/domains/id_domainownershipidentifier_test.go index f985e2aa509..14debd4f5fb 100644 --- a/resource-manager/web/2023-12-01/domains/id_domainownershipidentifier_test.go +++ b/resource-manager/web/2023-12-01/domains/id_domainownershipidentifier_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} func TestNewDomainOwnershipIdentifierID(t *testing.T) { - id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name") + id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'DomainName'", id.DomainName, "domainName") } - if id.DomainOwnershipIdentifierName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'DomainOwnershipIdentifierName'", id.DomainOwnershipIdentifierName, "name") + if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { + t.Fatalf("Expected %q but got %q for Segment 'DomainOwnershipIdentifierName'", id.DomainOwnershipIdentifierName, "domainOwnershipIdentifierName") } } func TestFormatDomainOwnershipIdentifierID(t *testing.T) { - actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name" + actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "domainName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - DomainOwnershipIdentifierName: "name", + DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", DomainName: "domainName", - DomainOwnershipIdentifierName: "name", + DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DomainRegistration/domains/domainName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", Expected: &DomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", DomainName: "dOmAiNnAmE", - DomainOwnershipIdentifierName: "nAmE", + DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/dOmAiNs/dOmAiNnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/kubeenvironments/README.md b/resource-manager/web/2023-12-01/kubeenvironments/README.md index e970c16c0d2..6f1352656f8 100644 --- a/resource-manager/web/2023-12-01/kubeenvironments/README.md +++ b/resource-manager/web/2023-12-01/kubeenvironments/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") payload := kubeenvironments.KubeEnvironment{ // ... @@ -42,7 +42,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -54,7 +54,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") read, err := client.Get(ctx, id) if err != nil { @@ -104,7 +104,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := kubeenvironments.NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") payload := kubeenvironments.KubeEnvironmentPatchResource{ // ... diff --git a/resource-manager/web/2023-12-01/kubeenvironments/id_kubeenvironment.go b/resource-manager/web/2023-12-01/kubeenvironments/id_kubeenvironment.go index 6afa2b5aed9..73c1a578e48 100644 --- a/resource-manager/web/2023-12-01/kubeenvironments/id_kubeenvironment.go +++ b/resource-manager/web/2023-12-01/kubeenvironments/id_kubeenvironment.go @@ -115,7 +115,7 @@ func (id KubeEnvironmentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticKubeEnvironments", "kubeEnvironments", "kubeEnvironments"), - resourceids.UserSpecifiedSegment("kubeEnvironmentName", "name"), + resourceids.UserSpecifiedSegment("kubeEnvironmentName", "kubeEnvironmentName"), } } diff --git a/resource-manager/web/2023-12-01/kubeenvironments/id_kubeenvironment_test.go b/resource-manager/web/2023-12-01/kubeenvironments/id_kubeenvironment_test.go index a84ed9fa62d..e209728abab 100644 --- a/resource-manager/web/2023-12-01/kubeenvironments/id_kubeenvironment_test.go +++ b/resource-manager/web/2023-12-01/kubeenvironments/id_kubeenvironment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KubeEnvironmentId{} func TestNewKubeEnvironmentID(t *testing.T) { - id := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewKubeEnvironmentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.KubeEnvironmentName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'KubeEnvironmentName'", id.KubeEnvironmentName, "name") + if id.KubeEnvironmentName != "kubeEnvironmentName" { + t.Fatalf("Expected %q but got %q for Segment 'KubeEnvironmentName'", id.KubeEnvironmentName, "kubeEnvironmentName") } } func TestFormatKubeEnvironmentID(t *testing.T) { - actual := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name" + actual := NewKubeEnvironmentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "kubeEnvironmentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseKubeEnvironmentID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - KubeEnvironmentName: "name", + KubeEnvironmentName: "kubeEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseKubeEnvironmentIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - KubeEnvironmentName: "name", + KubeEnvironmentName: "kubeEnvironmentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/kubeEnvironments/kubeEnvironmentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/kUbEeNvIrOnMeNtNaMe", Expected: &KubeEnvironmentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - KubeEnvironmentName: "nAmE", + KubeEnvironmentName: "kUbEeNvIrOnMeNtNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/kUbEeNvIrOnMeNtS/kUbEeNvIrOnMeNtNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/provider/README.md b/resource-manager/web/2023-12-01/provider/README.md index 80f4f85ad32..d805dfaf113 100644 --- a/resource-manager/web/2023-12-01/provider/README.md +++ b/resource-manager/web/2023-12-01/provider/README.md @@ -76,7 +76,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := provider.NewLocationID("location") +id := provider.NewLocationID("locationName") // alternatively `client.GetFunctionAppStacksForLocation(ctx, id, provider.DefaultGetFunctionAppStacksForLocationOperationOptions())` can be used to do batched pagination items, err := client.GetFunctionAppStacksForLocationComplete(ctx, id, provider.DefaultGetFunctionAppStacksForLocationOperationOptions()) @@ -110,7 +110,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := provider.NewLocationID("location") +id := provider.NewLocationID("locationName") // alternatively `client.GetWebAppStacksForLocation(ctx, id, provider.DefaultGetWebAppStacksForLocationOperationOptions())` can be used to do batched pagination items, err := client.GetWebAppStacksForLocationComplete(ctx, id, provider.DefaultGetWebAppStacksForLocationOperationOptions()) diff --git a/resource-manager/web/2023-12-01/provider/id_location.go b/resource-manager/web/2023-12-01/provider/id_location.go index b2c84698d9e..73ea1c40a58 100644 --- a/resource-manager/web/2023-12-01/provider/id_location.go +++ b/resource-manager/web/2023-12-01/provider/id_location.go @@ -99,7 +99,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2023-12-01/provider/id_location_test.go b/resource-manager/web/2023-12-01/provider/id_location_test.go index d870f55af25..e0391552ed6 100644 --- a/resource-manager/web/2023-12-01/provider/id_location_test.go +++ b/resource-manager/web/2023-12-01/provider/id_location_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("location") + id := NewLocationID("locationName") - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("location").ID() - expected := "/providers/Microsoft.Web/locations/location" + actual := NewLocationID("locationName").ID() + expected := "/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/locations/location", + Input: "/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/locations/location/extra", + Input: "/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/locations/location", + Input: "/providers/Microsoft.Web/locations/locationName", Expected: &LocationId{ - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/locations/location/extra", + Input: "/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/recommendations/README.md b/resource-manager/web/2023-12-01/recommendations/README.md index fdab9ed5b3e..92a7057877b 100644 --- a/resource-manager/web/2023-12-01/recommendations/README.md +++ b/resource-manager/web/2023-12-01/recommendations/README.md @@ -57,7 +57,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") +id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") read, err := client.DisableRecommendationForHostingEnvironment(ctx, id, recommendations.DefaultDisableRecommendationForHostingEnvironmentOperationOptions()) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") +id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") read, err := client.DisableRecommendationForSite(ctx, id) if err != nil { @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewRecommendationID("12345678-1234-9876-4563-123456789012", "name") +id := recommendations.NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName") read, err := client.DisableRecommendationForSubscription(ctx, id) if err != nil { @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") +id := recommendations.NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") read, err := client.GetRuleDetailsByHostingEnvironment(ctx, id, recommendations.DefaultGetRuleDetailsByHostingEnvironmentOperationOptions()) if err != nil { @@ -121,7 +121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") +id := recommendations.NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") read, err := client.GetRuleDetailsByWebApp(ctx, id, recommendations.DefaultGetRuleDetailsByWebAppOperationOptions()) if err != nil { diff --git a/resource-manager/web/2023-12-01/recommendations/id_hostingenvironmentrecommendation.go b/resource-manager/web/2023-12-01/recommendations/id_hostingenvironmentrecommendation.go index 2cdbbdb1c37..6c8bb19b20b 100644 --- a/resource-manager/web/2023-12-01/recommendations/id_hostingenvironmentrecommendation.go +++ b/resource-manager/web/2023-12-01/recommendations/id_hostingenvironmentrecommendation.go @@ -123,7 +123,7 @@ func (id HostingEnvironmentRecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticHostingEnvironments", "hostingEnvironments", "hostingEnvironments"), resourceids.UserSpecifiedSegment("hostingEnvironmentName", "hostingEnvironmentName"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2023-12-01/recommendations/id_hostingenvironmentrecommendation_test.go b/resource-manager/web/2023-12-01/recommendations/id_hostingenvironmentrecommendation_test.go index ec3b68f0c53..89a2959452d 100644 --- a/resource-manager/web/2023-12-01/recommendations/id_hostingenvironmentrecommendation_test.go +++ b/resource-manager/web/2023-12-01/recommendations/id_hostingenvironmentrecommendation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostingEnvironmentRecommendationId{} func TestNewHostingEnvironmentRecommendationID(t *testing.T) { - id := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name") + id := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewHostingEnvironmentRecommendationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'HostingEnvironmentName'", id.HostingEnvironmentName, "hostingEnvironmentName") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatHostingEnvironmentRecommendationID(t *testing.T) { - actual := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name" + actual := NewHostingEnvironmentRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostingEnvironmentName", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseHostingEnvironmentRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostingEnvironmentName: "hostingEnvironmentName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseHostingEnvironmentRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", HostingEnvironmentName: "hostingEnvironmentName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/hostingEnvironments/hostingEnvironmentName/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &HostingEnvironmentRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", HostingEnvironmentName: "hOsTiNgEnViRoNmEnTnAmE", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/hOsTiNgEnViRoNmEnTs/hOsTiNgEnViRoNmEnTnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/recommendations/id_recommendation.go b/resource-manager/web/2023-12-01/recommendations/id_recommendation.go index 25ebd90886f..b42bf6faa1d 100644 --- a/resource-manager/web/2023-12-01/recommendations/id_recommendation.go +++ b/resource-manager/web/2023-12-01/recommendations/id_recommendation.go @@ -107,7 +107,7 @@ func (id RecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2023-12-01/recommendations/id_recommendation_test.go b/resource-manager/web/2023-12-01/recommendations/id_recommendation_test.go index 2966eb11a4c..a6c44f1f14c 100644 --- a/resource-manager/web/2023-12-01/recommendations/id_recommendation_test.go +++ b/resource-manager/web/2023-12-01/recommendations/id_recommendation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &RecommendationId{} func TestNewRecommendationID(t *testing.T) { - id := NewRecommendationID("12345678-1234-9876-4563-123456789012", "name") + id := NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatRecommendationID(t *testing.T) { - actual := NewRecommendationID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name" + actual := NewRecommendationID("12345678-1234-9876-4563-123456789012", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &RecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/recommendations/id_siterecommendation.go b/resource-manager/web/2023-12-01/recommendations/id_siterecommendation.go index 596c056c92b..2876f7cd3e0 100644 --- a/resource-manager/web/2023-12-01/recommendations/id_siterecommendation.go +++ b/resource-manager/web/2023-12-01/recommendations/id_siterecommendation.go @@ -123,7 +123,7 @@ func (id SiteRecommendationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticRecommendations", "recommendations", "recommendations"), - resourceids.UserSpecifiedSegment("recommendationName", "name"), + resourceids.UserSpecifiedSegment("recommendationName", "recommendationName"), } } diff --git a/resource-manager/web/2023-12-01/recommendations/id_siterecommendation_test.go b/resource-manager/web/2023-12-01/recommendations/id_siterecommendation_test.go index f1a3efaeb4c..5bf28fb326c 100644 --- a/resource-manager/web/2023-12-01/recommendations/id_siterecommendation_test.go +++ b/resource-manager/web/2023-12-01/recommendations/id_siterecommendation_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteRecommendationId{} func TestNewSiteRecommendationID(t *testing.T) { - id := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name") + id := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSiteRecommendationID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.RecommendationName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "name") + if id.RecommendationName != "recommendationName" { + t.Fatalf("Expected %q but got %q for Segment 'RecommendationName'", id.RecommendationName, "recommendationName") } } func TestFormatSiteRecommendationID(t *testing.T) { - actual := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name" + actual := NewSiteRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "recommendationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSiteRecommendationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSiteRecommendationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - RecommendationName: "name", + RecommendationName: "recommendationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/recommendations/recommendationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE", Expected: &SiteRecommendationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - RecommendationName: "nAmE", + RecommendationName: "rEcOmMeNdAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/rEcOmMeNdAtIoNs/rEcOmMeNdAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/resourcehealthmetadata/README.md b/resource-manager/web/2023-12-01/resourcehealthmetadata/README.md index c9ad634c344..78d32bcbaf9 100644 --- a/resource-manager/web/2023-12-01/resourcehealthmetadata/README.md +++ b/resource-manager/web/2023-12-01/resourcehealthmetadata/README.md @@ -41,7 +41,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetBySiteSlot(ctx, id) if err != nil { @@ -108,7 +108,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := resourcehealthmetadata.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBySiteSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBySiteSlotComplete(ctx, id) diff --git a/resource-manager/web/2023-12-01/resourcehealthmetadata/id_slot.go b/resource-manager/web/2023-12-01/resourcehealthmetadata/id_slot.go index f588aa1069d..ef1e7ddf14c 100644 --- a/resource-manager/web/2023-12-01/resourcehealthmetadata/id_slot.go +++ b/resource-manager/web/2023-12-01/resourcehealthmetadata/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2023-12-01/resourcehealthmetadata/id_slot_test.go b/resource-manager/web/2023-12-01/resourcehealthmetadata/id_slot_test.go index 78664d5346e..1713ffbdc7d 100644 --- a/resource-manager/web/2023-12-01/resourcehealthmetadata/id_slot_test.go +++ b/resource-manager/web/2023-12-01/resourcehealthmetadata/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/resourceproviders/README.md b/resource-manager/web/2023-12-01/resourceproviders/README.md index 4e3a2d6e6ec..7a8c3bcb2f7 100644 --- a/resource-manager/web/2023-12-01/resourceproviders/README.md +++ b/resource-manager/web/2023-12-01/resourceproviders/README.md @@ -62,7 +62,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceproviders.NewSourceControlID("sourceControlType") +id := resourceproviders.NewSourceControlID("sourceControlName") read, err := client.GetSourceControl(ctx, id) if err != nil { @@ -94,7 +94,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceproviders.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") +id := resourceproviders.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.GetUsagesInLocationlist(ctx, id)` can be used to do batched pagination items, err := client.GetUsagesInLocationlistComplete(ctx, id) @@ -292,7 +292,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := resourceproviders.NewSourceControlID("sourceControlType") +id := resourceproviders.NewSourceControlID("sourceControlName") payload := resourceproviders.SourceControl{ // ... diff --git a/resource-manager/web/2023-12-01/resourceproviders/id_providerlocation.go b/resource-manager/web/2023-12-01/resourceproviders/id_providerlocation.go index fa3481d95ca..93f55de2bf3 100644 --- a/resource-manager/web/2023-12-01/resourceproviders/id_providerlocation.go +++ b/resource-manager/web/2023-12-01/resourceproviders/id_providerlocation.go @@ -107,7 +107,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2023-12-01/resourceproviders/id_providerlocation_test.go b/resource-manager/web/2023-12-01/resourceproviders/id_providerlocation_test.go index bcf968e0624..4d560e91917 100644 --- a/resource-manager/web/2023-12-01/resourceproviders/id_providerlocation_test.go +++ b/resource-manager/web/2023-12-01/resourceproviders/id_providerlocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/resourceproviders/id_sourcecontrol.go b/resource-manager/web/2023-12-01/resourceproviders/id_sourcecontrol.go index 1d19e0304d3..a78436e8801 100644 --- a/resource-manager/web/2023-12-01/resourceproviders/id_sourcecontrol.go +++ b/resource-manager/web/2023-12-01/resourceproviders/id_sourcecontrol.go @@ -99,7 +99,7 @@ func (id SourceControlId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), - resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlType"), + resourceids.UserSpecifiedSegment("sourceControlName", "sourceControlName"), } } diff --git a/resource-manager/web/2023-12-01/resourceproviders/id_sourcecontrol_test.go b/resource-manager/web/2023-12-01/resourceproviders/id_sourcecontrol_test.go index 56f1a7f7d16..a64983484b3 100644 --- a/resource-manager/web/2023-12-01/resourceproviders/id_sourcecontrol_test.go +++ b/resource-manager/web/2023-12-01/resourceproviders/id_sourcecontrol_test.go @@ -12,16 +12,16 @@ import ( var _ resourceids.ResourceId = &SourceControlId{} func TestNewSourceControlID(t *testing.T) { - id := NewSourceControlID("sourceControlType") + id := NewSourceControlID("sourceControlName") - if id.SourceControlName != "sourceControlType" { - t.Fatalf("Expected %q but got %q for Segment 'SourceControlName'", id.SourceControlName, "sourceControlType") + if id.SourceControlName != "sourceControlName" { + t.Fatalf("Expected %q but got %q for Segment 'SourceControlName'", id.SourceControlName, "sourceControlName") } } func TestFormatSourceControlID(t *testing.T) { - actual := NewSourceControlID("sourceControlType").ID() - expected := "/providers/Microsoft.Web/sourceControls/sourceControlType" + actual := NewSourceControlID("sourceControlName").ID() + expected := "/providers/Microsoft.Web/sourceControls/sourceControlName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -55,14 +55,14 @@ func TestParseSourceControlID(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName", Expected: &SourceControlId{ - SourceControlName: "sourceControlType", + SourceControlName: "sourceControlName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType/extra", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName/extra", Error: true, }, } @@ -131,26 +131,26 @@ func TestParseSourceControlIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName", Expected: &SourceControlId{ - SourceControlName: "sourceControlType", + SourceControlName: "sourceControlName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Web/sourceControls/sourceControlType/extra", + Input: "/providers/Microsoft.Web/sourceControls/sourceControlName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlTyPe", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlNaMe", Expected: &SourceControlId{ - SourceControlName: "sOuRcEcOnTrOlTyPe", + SourceControlName: "sOuRcEcOnTrOlNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlTyPe/extra", + Input: "/pRoViDeRs/mIcRoSoFt.wEb/sOuRcEcOnTrOlS/sOuRcEcOnTrOlNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/resourceproviders/model_customdnssuffixconfigurationproperties.go b/resource-manager/web/2023-12-01/resourceproviders/model_customdnssuffixconfigurationproperties.go index ba59ff8812d..cac2d224e58 100644 --- a/resource-manager/web/2023-12-01/resourceproviders/model_customdnssuffixconfigurationproperties.go +++ b/resource-manager/web/2023-12-01/resourceproviders/model_customdnssuffixconfigurationproperties.go @@ -4,7 +4,7 @@ package resourceproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type CustomDnsSuffixConfigurationProperties struct { - CertificateUrl *string `json:"certificateUrl,omitempty"` + CertificateURL *string `json:"certificateUrl,omitempty"` DnsSuffix *string `json:"dnsSuffix,omitempty"` KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` ProvisioningDetails *string `json:"provisioningDetails,omitempty"` diff --git a/resource-manager/web/2023-12-01/resourceproviders/model_premieraddonofferproperties.go b/resource-manager/web/2023-12-01/resourceproviders/model_premieraddonofferproperties.go index 4dcce517ebe..4d6d6786360 100644 --- a/resource-manager/web/2023-12-01/resourceproviders/model_premieraddonofferproperties.go +++ b/resource-manager/web/2023-12-01/resourceproviders/model_premieraddonofferproperties.go @@ -4,10 +4,10 @@ package resourceproviders // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type PremierAddOnOfferProperties struct { - LegalTermsUrl *string `json:"legalTermsUrl,omitempty"` + LegalTermsURL *string `json:"legalTermsUrl,omitempty"` MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` - PrivacyPolicyUrl *string `json:"privacyPolicyUrl,omitempty"` + PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` Product *string `json:"product,omitempty"` PromoCodeRequired *bool `json:"promoCodeRequired,omitempty"` Quota *int64 `json:"quota,omitempty"` diff --git a/resource-manager/web/2023-12-01/resourceproviders/model_validateproperties.go b/resource-manager/web/2023-12-01/resourceproviders/model_validateproperties.go index 390aaea61b0..76c9b025d30 100644 --- a/resource-manager/web/2023-12-01/resourceproviders/model_validateproperties.go +++ b/resource-manager/web/2023-12-01/resourceproviders/model_validateproperties.go @@ -9,7 +9,7 @@ type ValidateProperties struct { ContainerImagePlatform *string `json:"containerImagePlatform,omitempty"` ContainerImageRepository *string `json:"containerImageRepository,omitempty"` ContainerImageTag *string `json:"containerImageTag,omitempty"` - ContainerRegistryBaseUrl *string `json:"containerRegistryBaseUrl,omitempty"` + ContainerRegistryBaseURL *string `json:"containerRegistryBaseUrl,omitempty"` ContainerRegistryPassword *string `json:"containerRegistryPassword,omitempty"` ContainerRegistryUsername *string `json:"containerRegistryUsername,omitempty"` HostingEnvironment *string `json:"hostingEnvironment,omitempty"` diff --git a/resource-manager/web/2023-12-01/staticsites/README.md b/resource-manager/web/2023-12-01/staticsites/README.md index e6daafab8df..17f7250b49b 100644 --- a/resource-manager/web/2023-12-01/staticsites/README.md +++ b/resource-manager/web/2023-12-01/staticsites/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") payload := staticsites.RemotePrivateEndpointConnectionARMResource{ // ... @@ -42,7 +42,7 @@ if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteBasicAuthPropertiesARMResource{ // ... @@ -63,7 +63,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") payload := staticsites.DatabaseConnection{ // ... @@ -84,7 +84,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") payload := staticsites.DatabaseConnection{ // ... @@ -105,7 +105,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteARMResource{ // ... @@ -122,7 +122,7 @@ if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StringDictionary{ // ... @@ -143,7 +143,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StringDictionary{ // ... @@ -164,7 +164,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StringDictionary{ // ... @@ -185,7 +185,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ // ... @@ -202,7 +202,7 @@ if err := client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, payload); ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StringDictionary{ // ... @@ -223,7 +223,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteUserInvitationRequestResource{ // ... @@ -244,7 +244,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteZipDeploymentARMResource{ // ... @@ -261,7 +261,7 @@ if err := client.CreateZipDeploymentForStaticSiteThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") payload := staticsites.StaticSiteZipDeploymentARMResource{ // ... @@ -278,7 +278,7 @@ if err := client.CreateZipDeploymentForStaticSiteBuildThenPoll(ctx, id, payload) ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.DeleteBuildDatabaseConnection(ctx, id) if err != nil { @@ -294,7 +294,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.DeleteDatabaseConnection(ctx, id) if err != nil { @@ -310,7 +310,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -322,7 +322,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if err := client.DeleteStaticSiteThenPoll(ctx, id); err != nil { // handle the error @@ -334,7 +334,7 @@ if err := client.DeleteStaticSiteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") if err := client.DeleteStaticSiteBuildThenPoll(ctx, id); err != nil { // handle the error @@ -346,7 +346,7 @@ if err := client.DeleteStaticSiteBuildThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") if err := client.DeleteStaticSiteCustomDomainThenPoll(ctx, id); err != nil { // handle the error @@ -358,7 +358,7 @@ if err := client.DeleteStaticSiteCustomDomainThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") read, err := client.DeleteStaticSiteUser(ctx, id) if err != nil { @@ -374,7 +374,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if err := client.DetachStaticSiteThenPoll(ctx, id); err != nil { // handle the error @@ -386,7 +386,7 @@ if err := client.DetachStaticSiteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") read, err := client.DetachUserProvidedFunctionAppFromStaticSite(ctx, id) if err != nil { @@ -402,7 +402,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") read, err := client.DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx, id) if err != nil { @@ -418,7 +418,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetBasicAuth(ctx, id) if err != nil { @@ -434,7 +434,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.GetBuildDatabaseConnection(ctx, id) if err != nil { @@ -450,7 +450,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") read, err := client.GetBuildDatabaseConnectionWithDetails(ctx, id) if err != nil { @@ -466,7 +466,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetBuildDatabaseConnections(ctx, id)` can be used to do batched pagination items, err := client.GetBuildDatabaseConnectionsComplete(ctx, id) @@ -483,7 +483,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetBuildDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination items, err := client.GetBuildDatabaseConnectionsWithDetailsComplete(ctx, id) @@ -500,7 +500,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.GetDatabaseConnection(ctx, id) if err != nil { @@ -516,7 +516,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") read, err := client.GetDatabaseConnectionWithDetails(ctx, id) if err != nil { @@ -532,7 +532,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetDatabaseConnections(ctx, id)` can be used to do batched pagination items, err := client.GetDatabaseConnectionsComplete(ctx, id) @@ -549,7 +549,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination items, err := client.GetDatabaseConnectionsWithDetailsComplete(ctx, id) @@ -566,7 +566,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") read, err := client.GetLinkedBackend(ctx, id) if err != nil { @@ -582,7 +582,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") read, err := client.GetLinkedBackendForBuild(ctx, id) if err != nil { @@ -598,7 +598,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetLinkedBackends(ctx, id)` can be used to do batched pagination items, err := client.GetLinkedBackendsComplete(ctx, id) @@ -615,7 +615,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetLinkedBackendsForBuild(ctx, id)` can be used to do batched pagination items, err := client.GetLinkedBackendsForBuildComplete(ctx, id) @@ -632,7 +632,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -648,7 +648,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetPrivateEndpointConnectionList(ctx, id)` can be used to do batched pagination items, err := client.GetPrivateEndpointConnectionListComplete(ctx, id) @@ -665,7 +665,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetPrivateLinkResources(ctx, id) if err != nil { @@ -681,7 +681,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.GetStaticSite(ctx, id) if err != nil { @@ -697,7 +697,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.GetStaticSiteBuild(ctx, id) if err != nil { @@ -713,7 +713,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetStaticSiteBuilds(ctx, id)` can be used to do batched pagination items, err := client.GetStaticSiteBuildsComplete(ctx, id) @@ -730,7 +730,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") read, err := client.GetStaticSiteCustomDomain(ctx, id) if err != nil { @@ -763,7 +763,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") read, err := client.GetUserProvidedFunctionAppForStaticSite(ctx, id) if err != nil { @@ -779,7 +779,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") read, err := client.GetUserProvidedFunctionAppForStaticSiteBuild(ctx, id) if err != nil { @@ -795,7 +795,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.GetUserProvidedFunctionAppsForStaticSite(ctx, id)` can be used to do batched pagination items, err := client.GetUserProvidedFunctionAppsForStaticSiteComplete(ctx, id) @@ -812,7 +812,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.GetUserProvidedFunctionAppsForStaticSiteBuild(ctx, id)` can be used to do batched pagination items, err := client.GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx, id) @@ -829,7 +829,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -846,7 +846,7 @@ if err := client.LinkBackendThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -880,7 +880,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListBasicAuth(ctx, id)` can be used to do batched pagination items, err := client.ListBasicAuthComplete(ctx, id) @@ -897,7 +897,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteAppSettings(ctx, id) if err != nil { @@ -913,7 +913,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.ListStaticSiteBuildAppSettings(ctx, id) if err != nil { @@ -929,7 +929,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") read, err := client.ListStaticSiteBuildFunctionAppSettings(ctx, id) if err != nil { @@ -945,7 +945,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") // alternatively `client.ListStaticSiteBuildFunctions(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteBuildFunctionsComplete(ctx, id) @@ -962,7 +962,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteConfiguredRoles(ctx, id) if err != nil { @@ -978,7 +978,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListStaticSiteCustomDomains(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteCustomDomainsComplete(ctx, id) @@ -995,7 +995,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteFunctionAppSettings(ctx, id) if err != nil { @@ -1011,7 +1011,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") // alternatively `client.ListStaticSiteFunctions(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteFunctionsComplete(ctx, id) @@ -1028,7 +1028,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") read, err := client.ListStaticSiteSecrets(ctx, id) if err != nil { @@ -1044,7 +1044,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider") +id := staticsites.NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName") // alternatively `client.ListStaticSiteUsers(ctx, id)` can be used to do batched pagination items, err := client.ListStaticSiteUsersComplete(ctx, id) @@ -1061,7 +1061,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := staticsites.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") +id := staticsites.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := staticsites.StaticSitesWorkflowPreviewRequest{ // ... @@ -1082,7 +1082,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ // ... @@ -1099,7 +1099,7 @@ if err := client.RegisterUserProvidedFunctionAppWithStaticSiteThenPoll(ctx, id, ```go ctx := context.TODO() -id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ // ... @@ -1116,7 +1116,7 @@ if err := client.RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll(ctx, ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSiteResetPropertiesARMResource{ // ... @@ -1137,7 +1137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") read, err := client.UnlinkBackend(ctx, id, staticsites.DefaultUnlinkBackendOperationOptions()) if err != nil { @@ -1153,7 +1153,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") read, err := client.UnlinkBackendFromBuild(ctx, id, staticsites.DefaultUnlinkBackendFromBuildOperationOptions()) if err != nil { @@ -1169,7 +1169,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") payload := staticsites.DatabaseConnectionPatchRequest{ // ... @@ -1190,7 +1190,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") payload := staticsites.DatabaseConnectionPatchRequest{ // ... @@ -1211,7 +1211,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") payload := staticsites.StaticSitePatchResource{ // ... @@ -1232,7 +1232,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") payload := staticsites.StaticSiteUserARMResource{ // ... @@ -1253,7 +1253,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -1270,7 +1270,7 @@ if err := client.ValidateBackendThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") payload := staticsites.StaticSiteLinkedBackendARMResource{ // ... @@ -1287,7 +1287,7 @@ if err := client.ValidateBackendForBuildThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ // ... diff --git a/resource-manager/web/2023-12-01/staticsites/id_authprovider.go b/resource-manager/web/2023-12-01/staticsites/id_authprovider.go index 19115aee935..73ad2ff2650 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_authprovider.go +++ b/resource-manager/web/2023-12-01/staticsites/id_authprovider.go @@ -121,9 +121,9 @@ func (id AuthProviderId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), - resourceids.UserSpecifiedSegment("authProviderName", "authprovider"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderName"), } } diff --git a/resource-manager/web/2023-12-01/staticsites/id_authprovider_test.go b/resource-manager/web/2023-12-01/staticsites/id_authprovider_test.go index 31016d1fa90..8ea5e3431e0 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_authprovider_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_authprovider_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AuthProviderId{} func TestNewAuthProviderID(t *testing.T) { - id := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider") + id := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewAuthProviderID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.AuthProviderName != "authprovider" { - t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authprovider") + if id.AuthProviderName != "authProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authProviderName") } } func TestFormatAuthProviderID(t *testing.T) { - actual := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider" + actual := NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseAuthProviderID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseAuthProviderIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE", Expected: &AuthProviderId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - AuthProviderName: "aUtHpRoViDeR", + StaticSiteName: "sTaTiCsItEnAmE", + AuthProviderName: "aUtHpRoViDeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_build.go b/resource-manager/web/2023-12-01/staticsites/id_build.go index 112edc411df..9b2d3b3a03d 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_build.go +++ b/resource-manager/web/2023-12-01/staticsites/id_build.go @@ -121,9 +121,9 @@ func (id BuildId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), } } diff --git a/resource-manager/web/2023-12-01/staticsites/id_build_test.go b/resource-manager/web/2023-12-01/staticsites/id_build_test.go index 3f555f12a5c..9f08be01439 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_build_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_build_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildId{} func TestNewBuildID(t *testing.T) { - id := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName") + id := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewBuildID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } } func TestFormatBuildID(t *testing.T) { - actual := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName" + actual := NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBuildID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBuildIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Expected: &BuildId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_builddatabaseconnection.go b/resource-manager/web/2023-12-01/staticsites/id_builddatabaseconnection.go index c3e3d62bd53..660071b7aab 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_builddatabaseconnection.go +++ b/resource-manager/web/2023-12-01/staticsites/id_builddatabaseconnection.go @@ -127,9 +127,9 @@ func (id BuildDatabaseConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionName"), } diff --git a/resource-manager/web/2023-12-01/staticsites/id_builddatabaseconnection_test.go b/resource-manager/web/2023-12-01/staticsites/id_builddatabaseconnection_test.go index 0ef682da792..68f9cc60dd9 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_builddatabaseconnection_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_builddatabaseconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildDatabaseConnectionId{} func TestNewBuildDatabaseConnectionID(t *testing.T) { - id := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName") + id := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewBuildDatabaseConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } if id.DatabaseConnectionName != "databaseConnectionName" { @@ -36,8 +36,8 @@ func TestNewBuildDatabaseConnectionID(t *testing.T) { } func TestFormatBuildDatabaseConnectionID(t *testing.T) { - actual := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "databaseConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName" + actual := NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "databaseConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildDatabaseConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildDatabaseConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/databaseConnections/databaseConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", Expected: &BuildDatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", DatabaseConnectionName: "dAtAbAsEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_buildlinkedbackend.go b/resource-manager/web/2023-12-01/staticsites/id_buildlinkedbackend.go index 448f74335ef..42b3fe8e789 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_buildlinkedbackend.go +++ b/resource-manager/web/2023-12-01/staticsites/id_buildlinkedbackend.go @@ -127,9 +127,9 @@ func (id BuildLinkedBackendId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendName"), } diff --git a/resource-manager/web/2023-12-01/staticsites/id_buildlinkedbackend_test.go b/resource-manager/web/2023-12-01/staticsites/id_buildlinkedbackend_test.go index ffd4e752932..e7a2cb9e253 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_buildlinkedbackend_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_buildlinkedbackend_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildLinkedBackendId{} func TestNewBuildLinkedBackendID(t *testing.T) { - id := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName") + id := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewBuildLinkedBackendID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } if id.LinkedBackendName != "linkedBackendName" { @@ -36,8 +36,8 @@ func TestNewBuildLinkedBackendID(t *testing.T) { } func TestFormatBuildLinkedBackendID(t *testing.T) { - actual := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "linkedBackendName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName" + actual := NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "linkedBackendName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildLinkedBackendID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildLinkedBackendIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/linkedBackends/linkedBackendName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", Expected: &BuildLinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", LinkedBackendName: "lInKeDbAcKeNdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_builduserprovidedfunctionapp.go b/resource-manager/web/2023-12-01/staticsites/id_builduserprovidedfunctionapp.go index 7b84e9b7fb6..23a557f57de 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_builduserprovidedfunctionapp.go +++ b/resource-manager/web/2023-12-01/staticsites/id_builduserprovidedfunctionapp.go @@ -127,11 +127,11 @@ func (id BuildUserProvidedFunctionAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticBuilds", "builds", "builds"), - resourceids.UserSpecifiedSegment("buildName", "environmentName"), + resourceids.UserSpecifiedSegment("buildName", "buildName"), resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), - resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "functionAppName"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppName"), } } diff --git a/resource-manager/web/2023-12-01/staticsites/id_builduserprovidedfunctionapp_test.go b/resource-manager/web/2023-12-01/staticsites/id_builduserprovidedfunctionapp_test.go index 12186ac2cb1..04e65c3a35b 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_builduserprovidedfunctionapp_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_builduserprovidedfunctionapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BuildUserProvidedFunctionAppId{} func TestNewBuildUserProvidedFunctionAppID(t *testing.T) { - id := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName") + id := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewBuildUserProvidedFunctionAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.BuildName != "environmentName" { - t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "environmentName") + if id.BuildName != "buildName" { + t.Fatalf("Expected %q but got %q for Segment 'BuildName'", id.BuildName, "buildName") } - if id.UserProvidedFunctionAppName != "functionAppName" { - t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "functionAppName") + if id.UserProvidedFunctionAppName != "userProvidedFunctionAppName" { + t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "userProvidedFunctionAppName") } } func TestFormatBuildUserProvidedFunctionAppID(t *testing.T) { - actual := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "environmentName", "functionAppName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName" + actual := NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "buildName", "userProvidedFunctionAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseBuildUserProvidedFunctionAppID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseBuildUserProvidedFunctionAppIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - BuildName: "environmentName", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + BuildName: "buildName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/builds/environmentName/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/builds/buildName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe", Expected: &BuildUserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - BuildName: "eNvIrOnMeNtNaMe", - UserProvidedFunctionAppName: "fUnCtIoNaPpNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + BuildName: "bUiLdNaMe", + UserProvidedFunctionAppName: "uSeRpRoViDeDfUnCtIoNaPpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/bUiLdS/eNvIrOnMeNtNaMe/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/bUiLdS/bUiLdNaMe/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_customdomain.go b/resource-manager/web/2023-12-01/staticsites/id_customdomain.go index 7e2c137ab15..52bb3f0abb2 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_customdomain.go +++ b/resource-manager/web/2023-12-01/staticsites/id_customdomain.go @@ -121,9 +121,9 @@ func (id CustomDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), - resourceids.UserSpecifiedSegment("customDomainName", "domainName"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainName"), } } diff --git a/resource-manager/web/2023-12-01/staticsites/id_customdomain_test.go b/resource-manager/web/2023-12-01/staticsites/id_customdomain_test.go index 3b3fa35ee88..64add194b56 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_customdomain_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_customdomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomDomainId{} func TestNewCustomDomainID(t *testing.T) { - id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName") + id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.CustomDomainName != "domainName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "domainName") + if id.CustomDomainName != "customDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "customDomainName") } } func TestFormatCustomDomainID(t *testing.T) { - actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName" + actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "customDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - CustomDomainName: "domainName", + StaticSiteName: "staticSiteName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - CustomDomainName: "domainName", + StaticSiteName: "staticSiteName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/customDomains/domainName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/customDomains/customDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs/dOmAiNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs/cUsToMdOmAiNnAmE", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - CustomDomainName: "dOmAiNnAmE", + StaticSiteName: "sTaTiCsItEnAmE", + CustomDomainName: "cUsToMdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/cUsToMdOmAiNs/dOmAiNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/cUsToMdOmAiNs/cUsToMdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_databaseconnection.go b/resource-manager/web/2023-12-01/staticsites/id_databaseconnection.go index c8977fff4ca..0646be22614 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_databaseconnection.go +++ b/resource-manager/web/2023-12-01/staticsites/id_databaseconnection.go @@ -121,7 +121,7 @@ func (id DatabaseConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionName"), } diff --git a/resource-manager/web/2023-12-01/staticsites/id_databaseconnection_test.go b/resource-manager/web/2023-12-01/staticsites/id_databaseconnection_test.go index f713ec31548..c91658ac616 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_databaseconnection_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_databaseconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DatabaseConnectionId{} func TestNewDatabaseConnectionID(t *testing.T) { - id := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName") + id := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDatabaseConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.DatabaseConnectionName != "databaseConnectionName" { @@ -32,8 +32,8 @@ func TestNewDatabaseConnectionID(t *testing.T) { } func TestFormatDatabaseConnectionID(t *testing.T) { - actual := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "databaseConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName" + actual := NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "databaseConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDatabaseConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDatabaseConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", DatabaseConnectionName: "databaseConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/databaseConnections/databaseConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/databaseConnections/databaseConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE", Expected: &DatabaseConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", DatabaseConnectionName: "dAtAbAsEcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/dAtAbAsEcOnNeCtIoNs/dAtAbAsEcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_linkedbackend.go b/resource-manager/web/2023-12-01/staticsites/id_linkedbackend.go index affdec42c25..2db02661f88 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_linkedbackend.go +++ b/resource-manager/web/2023-12-01/staticsites/id_linkedbackend.go @@ -121,7 +121,7 @@ func (id LinkedBackendId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendName"), } diff --git a/resource-manager/web/2023-12-01/staticsites/id_linkedbackend_test.go b/resource-manager/web/2023-12-01/staticsites/id_linkedbackend_test.go index 8a21c27c9b0..bbbdc7a534f 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_linkedbackend_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_linkedbackend_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &LinkedBackendId{} func TestNewLinkedBackendID(t *testing.T) { - id := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName") + id := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewLinkedBackendID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.LinkedBackendName != "linkedBackendName" { @@ -32,8 +32,8 @@ func TestNewLinkedBackendID(t *testing.T) { } func TestFormatLinkedBackendID(t *testing.T) { - actual := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "linkedBackendName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName" + actual := NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "linkedBackendName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseLinkedBackendID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseLinkedBackendIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", LinkedBackendName: "linkedBackendName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/linkedBackends/linkedBackendName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/linkedBackends/linkedBackendName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe", Expected: &LinkedBackendId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", LinkedBackendName: "lInKeDbAcKeNdNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/lInKeDbAcKeNdS/lInKeDbAcKeNdNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_providerlocation.go b/resource-manager/web/2023-12-01/staticsites/id_providerlocation.go index ba0444d08c2..c53d10beaa5 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_providerlocation.go +++ b/resource-manager/web/2023-12-01/staticsites/id_providerlocation.go @@ -107,7 +107,7 @@ func (id ProviderLocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/web/2023-12-01/staticsites/id_providerlocation_test.go b/resource-manager/web/2023-12-01/staticsites/id_providerlocation_test.go index f0354411445..e48b5f6c6d4 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_providerlocation_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_providerlocation_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &ProviderLocationId{} func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location" + actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseProviderLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseProviderLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Web/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE", Expected: &ProviderLocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wEb/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_staticsite.go b/resource-manager/web/2023-12-01/staticsites/id_staticsite.go index 91e479c7d40..5b7df0899c4 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_staticsite.go +++ b/resource-manager/web/2023-12-01/staticsites/id_staticsite.go @@ -115,7 +115,7 @@ func (id StaticSiteId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), } } diff --git a/resource-manager/web/2023-12-01/staticsites/id_staticsite_test.go b/resource-manager/web/2023-12-01/staticsites/id_staticsite_test.go index d17c986ce1e..429bdfeaed4 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_staticsite_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_staticsite_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StaticSiteId{} func TestNewStaticSiteID(t *testing.T) { - id := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name") + id := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewStaticSiteID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } } func TestFormatStaticSiteID(t *testing.T) { - actual := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name" + actual := NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseStaticSiteID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseStaticSiteIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Expected: &StaticSiteId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_staticsiteprivateendpointconnection.go b/resource-manager/web/2023-12-01/staticsites/id_staticsiteprivateendpointconnection.go index e08cf42aa3c..8c4c4fd7cb9 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_staticsiteprivateendpointconnection.go +++ b/resource-manager/web/2023-12-01/staticsites/id_staticsiteprivateendpointconnection.go @@ -121,7 +121,7 @@ func (id StaticSitePrivateEndpointConnectionId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2023-12-01/staticsites/id_staticsiteprivateendpointconnection_test.go b/resource-manager/web/2023-12-01/staticsites/id_staticsiteprivateendpointconnection_test.go index 9abe6707f50..aef661aa34c 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_staticsiteprivateendpointconnection_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_staticsiteprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &StaticSitePrivateEndpointConnectionId{} func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { - id := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewStaticSitePrivateEndpointConnectionID(t *testing.T) { } func TestFormatStaticSitePrivateEndpointConnectionID(t *testing.T) { - actual := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseStaticSitePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseStaticSitePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", + StaticSiteName: "staticSiteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &StaticSitePrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", + StaticSiteName: "sTaTiCsItEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_user.go b/resource-manager/web/2023-12-01/staticsites/id_user.go index 9f4e54d1075..fe210ef0473 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_user.go +++ b/resource-manager/web/2023-12-01/staticsites/id_user.go @@ -127,11 +127,11 @@ func (id UserId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), - resourceids.UserSpecifiedSegment("authProviderName", "authprovider"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderName"), resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "userid"), + resourceids.UserSpecifiedSegment("userName", "userName"), } } diff --git a/resource-manager/web/2023-12-01/staticsites/id_user_test.go b/resource-manager/web/2023-12-01/staticsites/id_user_test.go index 10f68b3725b..e79e3a28959 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_user_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_user_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserId{} func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid") + id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewUserID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.AuthProviderName != "authprovider" { - t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authprovider") + if id.AuthProviderName != "authProviderName" { + t.Fatalf("Expected %q but got %q for Segment 'AuthProviderName'", id.AuthProviderName, "authProviderName") } - if id.UserName != "userid" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userid") + if id.UserName != "userName" { + t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userName") } } func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "authprovider", "userid").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid" + actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "authProviderName", "userName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseUserID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", - UserName: "userid", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseUserIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - AuthProviderName: "authprovider", - UserName: "userid", + StaticSiteName: "staticSiteName", + AuthProviderName: "authProviderName", + UserName: "userName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/authProviders/authprovider/users/userid/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/authProviders/authProviderName/users/userName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs/uSeRiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs/uSeRnAmE", Expected: &UserId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - AuthProviderName: "aUtHpRoViDeR", - UserName: "uSeRiD", + StaticSiteName: "sTaTiCsItEnAmE", + AuthProviderName: "aUtHpRoViDeRnAmE", + UserName: "uSeRnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/aUtHpRoViDeRs/aUtHpRoViDeR/uSeRs/uSeRiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/aUtHpRoViDeRs/aUtHpRoViDeRnAmE/uSeRs/uSeRnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/id_userprovidedfunctionapp.go b/resource-manager/web/2023-12-01/staticsites/id_userprovidedfunctionapp.go index 44e05595733..ff361f6c538 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_userprovidedfunctionapp.go +++ b/resource-manager/web/2023-12-01/staticsites/id_userprovidedfunctionapp.go @@ -121,9 +121,9 @@ func (id UserProvidedFunctionAppId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), - resourceids.UserSpecifiedSegment("staticSiteName", "name"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteName"), resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), - resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "functionAppName"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppName"), } } diff --git a/resource-manager/web/2023-12-01/staticsites/id_userprovidedfunctionapp_test.go b/resource-manager/web/2023-12-01/staticsites/id_userprovidedfunctionapp_test.go index fe429004412..038fecd6ba1 100644 --- a/resource-manager/web/2023-12-01/staticsites/id_userprovidedfunctionapp_test.go +++ b/resource-manager/web/2023-12-01/staticsites/id_userprovidedfunctionapp_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &UserProvidedFunctionAppId{} func TestNewUserProvidedFunctionAppID(t *testing.T) { - id := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName") + id := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewUserProvidedFunctionAppID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.StaticSiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "name") + if id.StaticSiteName != "staticSiteName" { + t.Fatalf("Expected %q but got %q for Segment 'StaticSiteName'", id.StaticSiteName, "staticSiteName") } - if id.UserProvidedFunctionAppName != "functionAppName" { - t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "functionAppName") + if id.UserProvidedFunctionAppName != "userProvidedFunctionAppName" { + t.Fatalf("Expected %q but got %q for Segment 'UserProvidedFunctionAppName'", id.UserProvidedFunctionAppName, "userProvidedFunctionAppName") } } func TestFormatUserProvidedFunctionAppID(t *testing.T) { - actual := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionAppName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName" + actual := NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteName", "userProvidedFunctionAppName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseUserProvidedFunctionAppID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseUserProvidedFunctionAppIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - StaticSiteName: "name", - UserProvidedFunctionAppName: "functionAppName", + StaticSiteName: "staticSiteName", + UserProvidedFunctionAppName: "userProvidedFunctionAppName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/name/userProvidedFunctionApps/functionAppName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/staticSites/staticSiteName/userProvidedFunctionApps/userProvidedFunctionAppName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe", Expected: &UserProvidedFunctionAppId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StaticSiteName: "nAmE", - UserProvidedFunctionAppName: "fUnCtIoNaPpNaMe", + StaticSiteName: "sTaTiCsItEnAmE", + UserProvidedFunctionAppName: "uSeRpRoViDeDfUnCtIoNaPpNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/nAmE/uSeRpRoViDeDfUnCtIoNaPpS/fUnCtIoNaPpNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sTaTiCsItEs/sTaTiCsItEnAmE/uSeRpRoViDeDfUnCtIoNaPpS/uSeRpRoViDeDfUnCtIoNaPpNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/staticsites/model_staticsite.go b/resource-manager/web/2023-12-01/staticsites/model_staticsite.go index 9fad6989e54..04ffe0c1027 100644 --- a/resource-manager/web/2023-12-01/staticsites/model_staticsite.go +++ b/resource-manager/web/2023-12-01/staticsites/model_staticsite.go @@ -18,7 +18,7 @@ type StaticSite struct { Provider *string `json:"provider,omitempty"` PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` RepositoryToken *string `json:"repositoryToken,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` StagingEnvironmentPolicy *StagingEnvironmentPolicy `json:"stagingEnvironmentPolicy,omitempty"` TemplateProperties *StaticSiteTemplateOptions `json:"templateProperties,omitempty"` UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` diff --git a/resource-manager/web/2023-12-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go b/resource-manager/web/2023-12-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go index 80795463497..e413aa4a9c5 100644 --- a/resource-manager/web/2023-12-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go +++ b/resource-manager/web/2023-12-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go @@ -8,5 +8,5 @@ type StaticSiteBasicAuthPropertiesARMResourceProperties struct { Environments *[]string `json:"environments,omitempty"` Password *string `json:"password,omitempty"` SecretState *string `json:"secretState,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` } diff --git a/resource-manager/web/2023-12-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go b/resource-manager/web/2023-12-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go index bca5c553bc4..c3d04f76a6d 100644 --- a/resource-manager/web/2023-12-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go +++ b/resource-manager/web/2023-12-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go @@ -6,5 +6,5 @@ package staticsites type StaticSitesWorkflowPreviewRequestProperties struct { Branch *string `json:"branch,omitempty"` BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` + RepositoryURL *string `json:"repositoryUrl,omitempty"` } diff --git a/resource-manager/web/2023-12-01/staticsites/model_staticsitetemplateoptions.go b/resource-manager/web/2023-12-01/staticsites/model_staticsitetemplateoptions.go index 5afb0421afc..1f957ada652 100644 --- a/resource-manager/web/2023-12-01/staticsites/model_staticsitetemplateoptions.go +++ b/resource-manager/web/2023-12-01/staticsites/model_staticsitetemplateoptions.go @@ -8,5 +8,5 @@ type StaticSiteTemplateOptions struct { IsPrivate *bool `json:"isPrivate,omitempty"` Owner *string `json:"owner,omitempty"` RepositoryName *string `json:"repositoryName,omitempty"` - TemplateRepositoryUrl *string `json:"templateRepositoryUrl,omitempty"` + TemplateRepositoryURL *string `json:"templateRepositoryUrl,omitempty"` } diff --git a/resource-manager/web/2023-12-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go b/resource-manager/web/2023-12-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go index 674c99a3b50..57c9a2fb872 100644 --- a/resource-manager/web/2023-12-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go +++ b/resource-manager/web/2023-12-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go @@ -11,7 +11,7 @@ import ( type StaticSiteUserInvitationResponseResourceProperties struct { ExpiresOn *string `json:"expiresOn,omitempty"` - InvitationUrl *string `json:"invitationUrl,omitempty"` + InvitationURL *string `json:"invitationUrl,omitempty"` } func (o *StaticSiteUserInvitationResponseResourceProperties) GetExpiresOnAsTime() (*time.Time, error) { diff --git a/resource-manager/web/2023-12-01/staticsites/model_staticsitezipdeployment.go b/resource-manager/web/2023-12-01/staticsites/model_staticsitezipdeployment.go index 29435dc00a6..e91994bd766 100644 --- a/resource-manager/web/2023-12-01/staticsites/model_staticsitezipdeployment.go +++ b/resource-manager/web/2023-12-01/staticsites/model_staticsitezipdeployment.go @@ -4,8 +4,8 @@ package staticsites // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type StaticSiteZipDeployment struct { - ApiZipUrl *string `json:"apiZipUrl,omitempty"` - AppZipUrl *string `json:"appZipUrl,omitempty"` + ApiZipURL *string `json:"apiZipUrl,omitempty"` + AppZipURL *string `json:"appZipUrl,omitempty"` DeploymentTitle *string `json:"deploymentTitle,omitempty"` FunctionLanguage *string `json:"functionLanguage,omitempty"` Provider *string `json:"provider,omitempty"` diff --git a/resource-manager/web/2023-12-01/topleveldomains/README.md b/resource-manager/web/2023-12-01/topleveldomains/README.md index d5016856181..4ee04162f68 100644 --- a/resource-manager/web/2023-12-01/topleveldomains/README.md +++ b/resource-manager/web/2023-12-01/topleveldomains/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") +id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") read, err := client.Get(ctx, id) if err != nil { @@ -58,7 +58,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") +id := topleveldomains.NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") payload := topleveldomains.TopLevelDomainAgreementOption{ // ... diff --git a/resource-manager/web/2023-12-01/topleveldomains/id_topleveldomain.go b/resource-manager/web/2023-12-01/topleveldomains/id_topleveldomain.go index cbe8e0b3066..de4d3235874 100644 --- a/resource-manager/web/2023-12-01/topleveldomains/id_topleveldomain.go +++ b/resource-manager/web/2023-12-01/topleveldomains/id_topleveldomain.go @@ -107,7 +107,7 @@ func (id TopLevelDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftDomainRegistration", "Microsoft.DomainRegistration", "Microsoft.DomainRegistration"), resourceids.StaticSegment("staticTopLevelDomains", "topLevelDomains", "topLevelDomains"), - resourceids.UserSpecifiedSegment("topLevelDomainName", "name"), + resourceids.UserSpecifiedSegment("topLevelDomainName", "topLevelDomainName"), } } diff --git a/resource-manager/web/2023-12-01/topleveldomains/id_topleveldomain_test.go b/resource-manager/web/2023-12-01/topleveldomains/id_topleveldomain_test.go index 196fe20d654..11f286ac04e 100644 --- a/resource-manager/web/2023-12-01/topleveldomains/id_topleveldomain_test.go +++ b/resource-manager/web/2023-12-01/topleveldomains/id_topleveldomain_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &TopLevelDomainId{} func TestNewTopLevelDomainID(t *testing.T) { - id := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name") + id := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.TopLevelDomainName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'TopLevelDomainName'", id.TopLevelDomainName, "name") + if id.TopLevelDomainName != "topLevelDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'TopLevelDomainName'", id.TopLevelDomainName, "topLevelDomainName") } } func TestFormatTopLevelDomainID(t *testing.T) { - actual := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name" + actual := NewTopLevelDomainID("12345678-1234-9876-4563-123456789012", "topLevelDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseTopLevelDomainID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "name", + TopLevelDomainName: "topLevelDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseTopLevelDomainIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "name", + TopLevelDomainName: "topLevelDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.DomainRegistration/topLevelDomains/topLevelDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/tOpLeVeLdOmAiNnAmE", Expected: &TopLevelDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - TopLevelDomainName: "nAmE", + TopLevelDomainName: "tOpLeVeLdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.dOmAiNrEgIsTrAtIoN/tOpLeVeLdOmAiNs/tOpLeVeLdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/README.md b/resource-manager/web/2023-12-01/webapps/README.md index ec2d04a69f0..0d659e282d6 100644 --- a/resource-manager/web/2023-12-01/webapps/README.md +++ b/resource-manager/web/2023-12-01/webapps/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") payload := webapps.PremierAddOn{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") payload := webapps.PremierAddOn{ // ... @@ -83,7 +83,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.AnalyzeCustomHostnameSlot(ctx, id, webapps.DefaultAnalyzeCustomHostnameSlotOperationOptions()) if err != nil { @@ -120,7 +120,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -141,7 +141,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") payload := webapps.RemotePrivateEndpointConnectionARMResource{ // ... @@ -158,7 +158,7 @@ if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") payload := webapps.RemotePrivateEndpointConnectionARMResource{ // ... @@ -196,7 +196,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.BackupRequest{ // ... @@ -217,7 +217,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") payload := webapps.Deployment{ // ... @@ -238,7 +238,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") payload := webapps.Deployment{ // ... @@ -259,7 +259,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") payload := webapps.FunctionEnvelope{ // ... @@ -276,7 +276,7 @@ if err := client.CreateFunctionThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") payload := webapps.FunctionEnvelope{ // ... @@ -293,7 +293,7 @@ if err := client.CreateInstanceFunctionSlotThenPoll(ctx, id, payload); err != ni ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") payload := webapps.MSDeploy{ // ... @@ -310,7 +310,7 @@ if err := client.CreateInstanceMSDeployOperationThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") payload := webapps.MSDeploy{ // ... @@ -344,7 +344,7 @@ if err := client.CreateMSDeployOperationThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.MSDeploy{ // ... @@ -415,7 +415,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteConfigResource{ // ... @@ -436,7 +436,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -457,7 +457,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -478,7 +478,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") +id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") payload := webapps.KeyInfo{ // ... @@ -499,7 +499,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") +id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") payload := webapps.KeyInfo{ // ... @@ -520,7 +520,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") payload := webapps.HostNameBinding{ // ... @@ -541,7 +541,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") payload := webapps.HostNameBinding{ // ... @@ -562,7 +562,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") +id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") payload := webapps.KeyInfo{ // ... @@ -583,7 +583,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") +id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") payload := webapps.KeyInfo{ // ... @@ -604,7 +604,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -625,7 +625,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -646,7 +646,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") payload := webapps.PublicCertificate{ // ... @@ -667,7 +667,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") payload := webapps.PublicCertificate{ // ... @@ -688,7 +688,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -709,7 +709,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -730,7 +730,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "containerName") +id := webapps.NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "sitecontainerName") payload := webapps.SiteContainer{ // ... @@ -751,7 +751,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "containerName") +id := webapps.NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "sitecontainerName") payload := webapps.SiteContainer{ // ... @@ -772,7 +772,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.Site{ // ... @@ -806,7 +806,7 @@ if err := client.CreateOrUpdateSourceControlThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteSourceControl{ // ... @@ -844,7 +844,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SwiftVirtualNetwork{ // ... @@ -865,7 +865,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -886,7 +886,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -907,7 +907,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -928,7 +928,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -965,7 +965,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") read, err := client.DeleteBackup(ctx, id) if err != nil { @@ -997,7 +997,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteBackupConfigurationSlot(ctx, id) if err != nil { @@ -1013,7 +1013,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") read, err := client.DeleteBackupSlot(ctx, id) if err != nil { @@ -1029,7 +1029,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.DeleteContinuousWebJob(ctx, id) if err != nil { @@ -1045,7 +1045,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.DeleteContinuousWebJobSlot(ctx, id) if err != nil { @@ -1061,7 +1061,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.DeleteDeployment(ctx, id) if err != nil { @@ -1077,7 +1077,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.DeleteDeploymentSlot(ctx, id) if err != nil { @@ -1093,7 +1093,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") read, err := client.DeleteDomainOwnershipIdentifier(ctx, id) if err != nil { @@ -1109,7 +1109,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") read, err := client.DeleteDomainOwnershipIdentifierSlot(ctx, id) if err != nil { @@ -1125,7 +1125,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.DeleteFunction(ctx, id) if err != nil { @@ -1141,7 +1141,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") +id := webapps.NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") read, err := client.DeleteFunctionSecret(ctx, id) if err != nil { @@ -1157,7 +1157,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") +id := webapps.NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") read, err := client.DeleteFunctionSecretSlot(ctx, id) if err != nil { @@ -1173,7 +1173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") read, err := client.DeleteHostNameBinding(ctx, id) if err != nil { @@ -1189,7 +1189,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") read, err := client.DeleteHostNameBindingSlot(ctx, id) if err != nil { @@ -1205,7 +1205,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") +id := webapps.NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") read, err := client.DeleteHostSecret(ctx, id) if err != nil { @@ -1221,7 +1221,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") +id := webapps.NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") read, err := client.DeleteHostSecretSlot(ctx, id) if err != nil { @@ -1237,7 +1237,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnection(ctx, id) if err != nil { @@ -1253,7 +1253,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") read, err := client.DeleteHybridConnectionSlot(ctx, id) if err != nil { @@ -1269,7 +1269,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.DeleteInstanceFunctionSlot(ctx, id) if err != nil { @@ -1285,7 +1285,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.DeleteInstanceProcess(ctx, id) if err != nil { @@ -1301,7 +1301,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.DeleteInstanceProcessSlot(ctx, id) if err != nil { @@ -1317,7 +1317,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") read, err := client.DeletePremierAddOn(ctx, id) if err != nil { @@ -1333,7 +1333,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") read, err := client.DeletePremierAddOnSlot(ctx, id) if err != nil { @@ -1349,7 +1349,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { // handle the error @@ -1361,7 +1361,7 @@ if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") if err := client.DeletePrivateEndpointConnectionSlotThenPoll(ctx, id); err != nil { // handle the error @@ -1373,7 +1373,7 @@ if err := client.DeletePrivateEndpointConnectionSlotThenPoll(ctx, id); err != ni ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.DeleteProcess(ctx, id) if err != nil { @@ -1389,7 +1389,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.DeleteProcessSlot(ctx, id) if err != nil { @@ -1405,7 +1405,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") read, err := client.DeletePublicCertificate(ctx, id) if err != nil { @@ -1421,7 +1421,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") read, err := client.DeletePublicCertificateSlot(ctx, id) if err != nil { @@ -1437,7 +1437,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") read, err := client.DeleteRelayServiceConnection(ctx, id) if err != nil { @@ -1453,7 +1453,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") read, err := client.DeleteRelayServiceConnectionSlot(ctx, id) if err != nil { @@ -1469,7 +1469,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "containerName") +id := webapps.NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "sitecontainerName") read, err := client.DeleteSiteContainer(ctx, id) if err != nil { @@ -1485,7 +1485,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "containerName") +id := webapps.NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "sitecontainerName") read, err := client.DeleteSiteContainerSlot(ctx, id) if err != nil { @@ -1501,7 +1501,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") read, err := client.DeleteSiteExtension(ctx, id) if err != nil { @@ -1517,7 +1517,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") read, err := client.DeleteSiteExtensionSlot(ctx, id) if err != nil { @@ -1533,7 +1533,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSlot(ctx, id, webapps.DefaultDeleteSlotOperationOptions()) if err != nil { @@ -1565,7 +1565,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSourceControlSlot(ctx, id, webapps.DefaultDeleteSourceControlSlotOperationOptions()) if err != nil { @@ -1597,7 +1597,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.DeleteSwiftVirtualNetworkSlot(ctx, id) if err != nil { @@ -1613,7 +1613,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.DeleteTriggeredWebJob(ctx, id) if err != nil { @@ -1629,7 +1629,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.DeleteTriggeredWebJobSlot(ctx, id) if err != nil { @@ -1645,7 +1645,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") read, err := client.DeleteVnetConnection(ctx, id) if err != nil { @@ -1661,7 +1661,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") read, err := client.DeleteVnetConnectionSlot(ctx, id) if err != nil { @@ -1698,7 +1698,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.WorkflowArtifacts{ // ... @@ -1740,7 +1740,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.RestoreRequest{ // ... @@ -1777,7 +1777,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GenerateNewSitePublishingPasswordSlot(ctx, id) if err != nil { @@ -1809,7 +1809,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey") +id := webapps.NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey") read, err := client.GetAppSettingKeyVaultReference(ctx, id) if err != nil { @@ -1825,7 +1825,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey") +id := webapps.NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey") read, err := client.GetAppSettingKeyVaultReferenceSlot(ctx, id) if err != nil { @@ -1858,7 +1858,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetAppSettingsKeyVaultReferencesSlot(ctx, id)` can be used to do batched pagination items, err := client.GetAppSettingsKeyVaultReferencesSlotComplete(ctx, id) @@ -1891,7 +1891,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsSlot(ctx, id) if err != nil { @@ -1923,7 +1923,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsV2Slot(ctx, id) if err != nil { @@ -1955,7 +1955,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetAuthSettingsV2WithoutSecretsSlot(ctx, id) if err != nil { @@ -1987,7 +1987,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetBackupConfigurationSlot(ctx, id) if err != nil { @@ -2003,7 +2003,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") read, err := client.GetBackupStatus(ctx, id) if err != nil { @@ -2019,7 +2019,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") read, err := client.GetBackupStatusSlot(ctx, id) if err != nil { @@ -2051,7 +2051,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetConfigurationSlot(ctx, id) if err != nil { @@ -2067,7 +2067,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") +id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") read, err := client.GetConfigurationSnapshot(ctx, id) if err != nil { @@ -2083,7 +2083,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") +id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") read, err := client.GetConfigurationSnapshotSlot(ctx, id) if err != nil { @@ -2115,7 +2115,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetContainerLogsZipSlot(ctx, id) if err != nil { @@ -2131,7 +2131,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.GetContinuousWebJob(ctx, id) if err != nil { @@ -2147,7 +2147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.GetContinuousWebJobSlot(ctx, id) if err != nil { @@ -2163,7 +2163,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.GetDeployment(ctx, id) if err != nil { @@ -2179,7 +2179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.GetDeploymentSlot(ctx, id) if err != nil { @@ -2211,7 +2211,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetDiagnosticLogsConfigurationSlot(ctx, id) if err != nil { @@ -2227,7 +2227,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") read, err := client.GetDomainOwnershipIdentifier(ctx, id) if err != nil { @@ -2243,7 +2243,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") read, err := client.GetDomainOwnershipIdentifierSlot(ctx, id) if err != nil { @@ -2275,7 +2275,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetFtpAllowedSlot(ctx, id) if err != nil { @@ -2291,7 +2291,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.GetFunction(ctx, id) if err != nil { @@ -2323,7 +2323,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetFunctionsAdminTokenSlot(ctx, id) if err != nil { @@ -2339,7 +2339,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") +id := webapps.NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") read, err := client.GetHostNameBinding(ctx, id) if err != nil { @@ -2355,7 +2355,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") +id := webapps.NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") read, err := client.GetHostNameBindingSlot(ctx, id) if err != nil { @@ -2371,7 +2371,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnection(ctx, id) if err != nil { @@ -2387,7 +2387,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") read, err := client.GetHybridConnectionSlot(ctx, id) if err != nil { @@ -2403,7 +2403,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.GetInstanceFunctionSlot(ctx, id) if err != nil { @@ -2419,7 +2419,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceInfo(ctx, id) if err != nil { @@ -2435,7 +2435,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceInfoSlot(ctx, id) if err != nil { @@ -2451,7 +2451,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceMSDeployLog(ctx, id) if err != nil { @@ -2467,7 +2467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceMSDeployLogSlot(ctx, id) if err != nil { @@ -2483,7 +2483,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") read, err := client.GetInstanceMsDeployStatus(ctx, id) if err != nil { @@ -2499,7 +2499,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") read, err := client.GetInstanceMsDeployStatusSlot(ctx, id) if err != nil { @@ -2515,7 +2515,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.GetInstanceProcess(ctx, id) if err != nil { @@ -2531,7 +2531,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") read, err := client.GetInstanceProcessDump(ctx, id) if err != nil { @@ -2547,7 +2547,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.GetInstanceProcessDumpSlot(ctx, id) if err != nil { @@ -2563,7 +2563,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress") +id := webapps.NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName") read, err := client.GetInstanceProcessModule(ctx, id) if err != nil { @@ -2579,7 +2579,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress") +id := webapps.NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName") read, err := client.GetInstanceProcessModuleSlot(ctx, id) if err != nil { @@ -2595,7 +2595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") read, err := client.GetInstanceProcessSlot(ctx, id) if err != nil { @@ -2611,7 +2611,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName") +id := webapps.NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName") read, err := client.GetInstanceWorkflowSlot(ctx, id) if err != nil { @@ -2643,7 +2643,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMSDeployLogSlot(ctx, id) if err != nil { @@ -2675,7 +2675,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMSDeployStatusSlot(ctx, id) if err != nil { @@ -2707,7 +2707,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetMigrateMySqlStatusSlot(ctx, id) if err != nil { @@ -2723,7 +2723,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") +id := webapps.NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") read, err := client.GetNetworkTraces(ctx, id) if err != nil { @@ -2739,7 +2739,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") +id := webapps.NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") read, err := client.GetNetworkTracesSlot(ctx, id) if err != nil { @@ -2755,7 +2755,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") +id := webapps.NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") read, err := client.GetNetworkTracesSlotV2(ctx, id) if err != nil { @@ -2771,7 +2771,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") +id := webapps.NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") read, err := client.GetNetworkTracesV2(ctx, id) if err != nil { @@ -2803,7 +2803,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") read, err := client.GetPremierAddOn(ctx, id) if err != nil { @@ -2819,7 +2819,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") read, err := client.GetPremierAddOnSlot(ctx, id) if err != nil { @@ -2851,7 +2851,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetPrivateAccessSlot(ctx, id) if err != nil { @@ -2867,7 +2867,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") +id := webapps.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnection(ctx, id) if err != nil { @@ -2900,7 +2900,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetPrivateEndpointConnectionListSlot(ctx, id)` can be used to do batched pagination items, err := client.GetPrivateEndpointConnectionListSlotComplete(ctx, id) @@ -2917,7 +2917,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") +id := webapps.NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") read, err := client.GetPrivateEndpointConnectionSlot(ctx, id) if err != nil { @@ -2949,7 +2949,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetPrivateLinkResourcesSlot(ctx, id) if err != nil { @@ -2965,7 +2965,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.GetProcess(ctx, id) if err != nil { @@ -2981,7 +2981,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") read, err := client.GetProcessDump(ctx, id) if err != nil { @@ -2997,7 +2997,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.GetProcessDumpSlot(ctx, id) if err != nil { @@ -3013,7 +3013,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress") +id := webapps.NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName") read, err := client.GetProcessModule(ctx, id) if err != nil { @@ -3029,7 +3029,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress") +id := webapps.NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName") read, err := client.GetProcessModuleSlot(ctx, id) if err != nil { @@ -3045,7 +3045,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") read, err := client.GetProcessSlot(ctx, id) if err != nil { @@ -3061,7 +3061,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") +id := webapps.NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") read, err := client.GetPublicCertificate(ctx, id) if err != nil { @@ -3077,7 +3077,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") +id := webapps.NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") read, err := client.GetPublicCertificateSlot(ctx, id) if err != nil { @@ -3093,7 +3093,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") read, err := client.GetRelayServiceConnection(ctx, id) if err != nil { @@ -3109,7 +3109,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") read, err := client.GetRelayServiceConnectionSlot(ctx, id) if err != nil { @@ -3141,7 +3141,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetScmAllowedSlot(ctx, id) if err != nil { @@ -3157,7 +3157,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey") +id := webapps.NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey") read, err := client.GetSiteConnectionStringKeyVaultReference(ctx, id) if err != nil { @@ -3173,7 +3173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey") +id := webapps.NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey") read, err := client.GetSiteConnectionStringKeyVaultReferenceSlot(ctx, id) if err != nil { @@ -3206,7 +3206,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.GetSiteConnectionStringKeyVaultReferencesSlot(ctx, id)` can be used to do batched pagination items, err := client.GetSiteConnectionStringKeyVaultReferencesSlotComplete(ctx, id) @@ -3223,7 +3223,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "containerName") +id := webapps.NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "sitecontainerName") read, err := client.GetSiteContainer(ctx, id) if err != nil { @@ -3239,7 +3239,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "containerName") +id := webapps.NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "sitecontainerName") read, err := client.GetSiteContainerSlot(ctx, id) if err != nil { @@ -3255,7 +3255,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") read, err := client.GetSiteExtension(ctx, id) if err != nil { @@ -3271,7 +3271,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") read, err := client.GetSiteExtensionSlot(ctx, id) if err != nil { @@ -3303,7 +3303,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSitePhpErrorLogFlagSlot(ctx, id) if err != nil { @@ -3319,7 +3319,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSlot(ctx, id) if err != nil { @@ -3351,7 +3351,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSourceControlSlot(ctx, id) if err != nil { @@ -3383,7 +3383,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetSwiftVirtualNetworkConnectionSlot(ctx, id) if err != nil { @@ -3399,7 +3399,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.GetTriggeredWebJob(ctx, id) if err != nil { @@ -3415,7 +3415,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id") +id := webapps.NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName") read, err := client.GetTriggeredWebJobHistory(ctx, id) if err != nil { @@ -3431,7 +3431,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id") +id := webapps.NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName") read, err := client.GetTriggeredWebJobHistorySlot(ctx, id) if err != nil { @@ -3447,7 +3447,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.GetTriggeredWebJobSlot(ctx, id) if err != nil { @@ -3463,7 +3463,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") read, err := client.GetVnetConnection(ctx, id) if err != nil { @@ -3479,7 +3479,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetConnectionGateway(ctx, id) if err != nil { @@ -3495,7 +3495,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") read, err := client.GetVnetConnectionGatewaySlot(ctx, id) if err != nil { @@ -3511,7 +3511,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") read, err := client.GetVnetConnectionSlot(ctx, id) if err != nil { @@ -3527,7 +3527,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName") read, err := client.GetWebJob(ctx, id) if err != nil { @@ -3543,7 +3543,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName") read, err := client.GetWebJobSlot(ctx, id) if err != nil { @@ -3575,7 +3575,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.GetWebSiteContainerLogsSlot(ctx, id) if err != nil { @@ -3591,7 +3591,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := webapps.NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") read, err := client.GetWorkflow(ctx, id) if err != nil { @@ -3607,7 +3607,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") +id := webapps.NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") if err := client.InstallSiteExtensionThenPoll(ctx, id); err != nil { // handle the error @@ -3619,7 +3619,7 @@ if err := client.InstallSiteExtensionThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") +id := webapps.NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") if err := client.InstallSiteExtensionSlotThenPoll(ctx, id); err != nil { // handle the error @@ -3647,7 +3647,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.IsCloneableSlot(ctx, id) if err != nil { @@ -3696,7 +3696,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListApplicationSettingsSlot(ctx, id) if err != nil { @@ -3728,7 +3728,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListAzureStorageAccountsSlot(ctx, id) if err != nil { @@ -3744,7 +3744,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") payload := webapps.BackupRequest{ // ... @@ -3765,7 +3765,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") payload := webapps.BackupRequest{ // ... @@ -3803,7 +3803,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBackupsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBackupsSlotComplete(ctx, id) @@ -3837,7 +3837,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListBasicPublishingCredentialsPoliciesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListBasicPublishingCredentialsPoliciesSlotComplete(ctx, id) @@ -3888,7 +3888,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListConfigurationSnapshotInfoSlot(ctx, id)` can be used to do batched pagination items, err := client.ListConfigurationSnapshotInfoSlotComplete(ctx, id) @@ -3922,7 +3922,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListConfigurationsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListConfigurationsSlotComplete(ctx, id) @@ -3955,7 +3955,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListConnectionStringsSlot(ctx, id) if err != nil { @@ -3988,7 +3988,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListContinuousWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListContinuousWebJobsSlotComplete(ctx, id) @@ -4005,7 +4005,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") +id := webapps.NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") read, err := client.ListDeploymentLog(ctx, id) if err != nil { @@ -4021,7 +4021,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") +id := webapps.NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") read, err := client.ListDeploymentLogSlot(ctx, id) if err != nil { @@ -4054,7 +4054,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListDeploymentsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListDeploymentsSlotComplete(ctx, id) @@ -4088,7 +4088,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListDomainOwnershipIdentifiersSlot(ctx, id)` can be used to do batched pagination items, err := client.ListDomainOwnershipIdentifiersSlotComplete(ctx, id) @@ -4105,7 +4105,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.ListFunctionKeys(ctx, id) if err != nil { @@ -4121,7 +4121,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.ListFunctionKeysSlot(ctx, id) if err != nil { @@ -4137,7 +4137,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") +id := webapps.NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") read, err := client.ListFunctionSecrets(ctx, id) if err != nil { @@ -4153,7 +4153,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") +id := webapps.NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") read, err := client.ListFunctionSecretsSlot(ctx, id) if err != nil { @@ -4202,7 +4202,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListHostKeysSlot(ctx, id) if err != nil { @@ -4235,7 +4235,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListHostNameBindingsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListHostNameBindingsSlotComplete(ctx, id) @@ -4268,7 +4268,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListHybridConnectionsSlot(ctx, id) if err != nil { @@ -4284,7 +4284,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceFunctionsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceFunctionsSlotComplete(ctx, id) @@ -4318,7 +4318,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceIdentifiersSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceIdentifiersSlotComplete(ctx, id) @@ -4335,7 +4335,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") // alternatively `client.ListInstanceProcessModules(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessModulesComplete(ctx, id) @@ -4352,7 +4352,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") // alternatively `client.ListInstanceProcessModulesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessModulesSlotComplete(ctx, id) @@ -4369,7 +4369,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") +id := webapps.NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") // alternatively `client.ListInstanceProcessThreads(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessThreadsComplete(ctx, id) @@ -4386,7 +4386,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") +id := webapps.NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") // alternatively `client.ListInstanceProcessThreadsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessThreadsSlotComplete(ctx, id) @@ -4403,7 +4403,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") +id := webapps.NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") // alternatively `client.ListInstanceProcesses(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessesComplete(ctx, id) @@ -4420,7 +4420,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") +id := webapps.NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") // alternatively `client.ListInstanceProcessesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceProcessesSlotComplete(ctx, id) @@ -4437,7 +4437,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListInstanceWorkflowsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListInstanceWorkflowsSlotComplete(ctx, id) @@ -4470,7 +4470,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListMetadataSlot(ctx, id) if err != nil { @@ -4486,7 +4486,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view") +id := webapps.NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName") read, err := client.ListNetworkFeatures(ctx, id) if err != nil { @@ -4502,7 +4502,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view") +id := webapps.NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName") read, err := client.ListNetworkFeaturesSlot(ctx, id) if err != nil { @@ -4535,7 +4535,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListPerfMonCountersSlot(ctx, id, webapps.DefaultListPerfMonCountersSlotOperationOptions())` can be used to do batched pagination items, err := client.ListPerfMonCountersSlotComplete(ctx, id, webapps.DefaultListPerfMonCountersSlotOperationOptions()) @@ -4568,7 +4568,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListPremierAddOnsSlot(ctx, id) if err != nil { @@ -4584,7 +4584,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") // alternatively `client.ListProcessModules(ctx, id)` can be used to do batched pagination items, err := client.ListProcessModulesComplete(ctx, id) @@ -4601,7 +4601,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") // alternatively `client.ListProcessModulesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessModulesSlotComplete(ctx, id) @@ -4618,7 +4618,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") +id := webapps.NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") // alternatively `client.ListProcessThreads(ctx, id)` can be used to do batched pagination items, err := client.ListProcessThreadsComplete(ctx, id) @@ -4635,7 +4635,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") +id := webapps.NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") // alternatively `client.ListProcessThreadsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessThreadsSlotComplete(ctx, id) @@ -4669,7 +4669,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListProcessesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListProcessesSlotComplete(ctx, id) @@ -4720,7 +4720,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListPublicCertificatesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListPublicCertificatesSlotComplete(ctx, id) @@ -4749,7 +4749,7 @@ if err := client.ListPublishingCredentialsThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.ListPublishingCredentialsSlotThenPoll(ctx, id); err != nil { // handle the error @@ -4782,7 +4782,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingProfileOptions{ // ... @@ -4819,7 +4819,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListRelayServiceConnectionsSlot(ctx, id) if err != nil { @@ -4852,7 +4852,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteBackupsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteBackupsSlotComplete(ctx, id) @@ -4886,7 +4886,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteContainersSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteContainersSlotComplete(ctx, id) @@ -4920,7 +4920,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSiteExtensionsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSiteExtensionsSlotComplete(ctx, id) @@ -4953,7 +4953,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSitePushSettingsSlot(ctx, id) if err != nil { @@ -5007,7 +5007,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -5029,7 +5029,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSlotSiteDeploymentStatusesSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSlotSiteDeploymentStatusesSlotComplete(ctx, id) @@ -5097,7 +5097,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSnapshotsFromDRSecondarySlot(ctx, id)` can be used to do batched pagination items, err := client.ListSnapshotsFromDRSecondarySlotComplete(ctx, id) @@ -5114,7 +5114,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListSnapshotsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListSnapshotsSlotComplete(ctx, id) @@ -5147,7 +5147,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSyncFunctionTriggersSlot(ctx, id) if err != nil { @@ -5179,7 +5179,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListSyncStatusSlot(ctx, id) if err != nil { @@ -5195,7 +5195,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") // alternatively `client.ListTriggeredWebJobHistory(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobHistoryComplete(ctx, id) @@ -5212,7 +5212,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") // alternatively `client.ListTriggeredWebJobHistorySlot(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobHistorySlotComplete(ctx, id) @@ -5246,7 +5246,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListTriggeredWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListTriggeredWebJobsSlotComplete(ctx, id) @@ -5280,7 +5280,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListUsagesSlot(ctx, id, webapps.DefaultListUsagesSlotOperationOptions())` can be used to do batched pagination items, err := client.ListUsagesSlotComplete(ctx, id, webapps.DefaultListUsagesSlotOperationOptions()) @@ -5313,7 +5313,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListVnetConnectionsSlot(ctx, id) if err != nil { @@ -5346,7 +5346,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") // alternatively `client.ListWebJobsSlot(ctx, id)` can be used to do batched pagination items, err := client.ListWebJobsSlotComplete(ctx, id) @@ -5396,7 +5396,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ListWorkflowsConnectionsSlot(ctx, id) if err != nil { @@ -5467,7 +5467,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.PrivateAccess{ // ... @@ -5488,7 +5488,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") +id := webapps.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") read, err := client.RecoverSiteConfigurationSnapshot(ctx, id) if err != nil { @@ -5504,7 +5504,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") +id := webapps.NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") read, err := client.RecoverSiteConfigurationSnapshotSlot(ctx, id) if err != nil { @@ -5536,7 +5536,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.ResetSlotConfigurationSlot(ctx, id) if err != nil { @@ -5568,7 +5568,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.RestartSlot(ctx, id, webapps.DefaultRestartSlotOperationOptions()) if err != nil { @@ -5584,7 +5584,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") +id := webapps.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") payload := webapps.RestoreRequest{ // ... @@ -5618,7 +5618,7 @@ if err := client.RestoreFromBackupBlobThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.RestoreRequest{ // ... @@ -5652,7 +5652,7 @@ if err := client.RestoreFromDeletedAppThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.DeletedAppRestoreRequest{ // ... @@ -5669,7 +5669,7 @@ if err := client.RestoreFromDeletedAppSlotThenPoll(ctx, id, payload); err != nil ```go ctx := context.TODO() -id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") +id := webapps.NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") payload := webapps.RestoreRequest{ // ... @@ -5703,7 +5703,7 @@ if err := client.RestoreSnapshotThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SnapshotRestoreRequest{ // ... @@ -5720,7 +5720,7 @@ if err := client.RestoreSnapshotSlotThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") read, err := client.RunTriggeredWebJob(ctx, id) if err != nil { @@ -5736,7 +5736,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") read, err := client.RunTriggeredWebJobSlot(ctx, id) if err != nil { @@ -5768,7 +5768,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.StartContinuousWebJob(ctx, id) if err != nil { @@ -5784,7 +5784,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.StartContinuousWebJobSlot(ctx, id) if err != nil { @@ -5812,7 +5812,7 @@ if err := client.StartNetworkTraceThenPoll(ctx, id, webapps.DefaultStartNetworkT ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.StartNetworkTraceSlotThenPoll(ctx, id, webapps.DefaultStartNetworkTraceSlotOperationOptions()); err != nil { // handle the error @@ -5824,7 +5824,7 @@ if err := client.StartNetworkTraceSlotThenPoll(ctx, id, webapps.DefaultStartNetw ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StartSlot(ctx, id) if err != nil { @@ -5868,7 +5868,7 @@ if err := client.StartWebSiteNetworkTraceOperationThenPoll(ctx, id, webapps.Defa ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if err := client.StartWebSiteNetworkTraceOperationSlotThenPoll(ctx, id, webapps.DefaultStartWebSiteNetworkTraceOperationSlotOperationOptions()); err != nil { // handle the error @@ -5880,7 +5880,7 @@ if err := client.StartWebSiteNetworkTraceOperationSlotThenPoll(ctx, id, webapps. ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StartWebSiteNetworkTraceSlot(ctx, id, webapps.DefaultStartWebSiteNetworkTraceSlotOperationOptions()) if err != nil { @@ -5912,7 +5912,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") +id := webapps.NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") read, err := client.StopContinuousWebJob(ctx, id) if err != nil { @@ -5928,7 +5928,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") +id := webapps.NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") read, err := client.StopContinuousWebJobSlot(ctx, id) if err != nil { @@ -5960,7 +5960,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopNetworkTraceSlot(ctx, id) if err != nil { @@ -5976,7 +5976,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopSlot(ctx, id) if err != nil { @@ -6008,7 +6008,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.StopWebSiteNetworkTraceSlot(ctx, id) if err != nil { @@ -6024,7 +6024,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmSlotEntity{ // ... @@ -6074,7 +6074,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncFunctionTriggersSlot(ctx, id) if err != nil { @@ -6106,7 +6106,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncFunctionsSlot(ctx, id) if err != nil { @@ -6138,7 +6138,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") read, err := client.SyncRepositorySlot(ctx, id) if err != nil { @@ -6196,7 +6196,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.StringDictionary{ // ... @@ -6238,7 +6238,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteAuthSettings{ // ... @@ -6280,7 +6280,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteAuthSettingsV2{ // ... @@ -6322,7 +6322,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.AzureStoragePropertyDictionaryResource{ // ... @@ -6364,7 +6364,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.BackupRequest{ // ... @@ -6406,7 +6406,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteConfigResource{ // ... @@ -6448,7 +6448,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.ConnectionStringDictionary{ // ... @@ -6490,7 +6490,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteLogsConfig{ // ... @@ -6511,7 +6511,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +id := webapps.NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -6532,7 +6532,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") +id := webapps.NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") payload := webapps.Identifier{ // ... @@ -6574,7 +6574,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingCredentialsPoliciesEntity{ // ... @@ -6595,7 +6595,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") +id := webapps.NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -6616,7 +6616,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") +id := webapps.NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") payload := webapps.HybridConnection{ // ... @@ -6658,7 +6658,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.StringDictionary{ // ... @@ -6679,7 +6679,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") +id := webapps.NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") payload := webapps.PremierAddOnPatchResource{ // ... @@ -6700,7 +6700,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") +id := webapps.NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") payload := webapps.PremierAddOnPatchResource{ // ... @@ -6721,7 +6721,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") +id := webapps.NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -6742,7 +6742,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") +id := webapps.NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") payload := webapps.RelayServiceConnectionEntity{ // ... @@ -6784,7 +6784,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.CsmPublishingCredentialsPoliciesEntity{ // ... @@ -6826,7 +6826,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.PushSettings{ // ... @@ -6847,7 +6847,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SitePatchResource{ // ... @@ -6910,7 +6910,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SiteSourceControl{ // ... @@ -6952,7 +6952,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") +id := webapps.NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") payload := webapps.SwiftVirtualNetwork{ // ... @@ -6973,7 +6973,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") +id := webapps.NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... @@ -6994,7 +6994,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") +id := webapps.NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -7015,7 +7015,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") +id := webapps.NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") payload := webapps.VnetGateway{ // ... @@ -7036,7 +7036,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") +id := webapps.NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") payload := webapps.VnetInfoResource{ // ... diff --git a/resource-manager/web/2023-12-01/webapps/id_appsetting.go b/resource-manager/web/2023-12-01/webapps/id_appsetting.go index 59084b46370..ecd9386b62d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_appsetting.go +++ b/resource-manager/web/2023-12-01/webapps/id_appsetting.go @@ -121,7 +121,7 @@ func (id AppSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticAppSettings", "appSettings", "appSettings"), diff --git a/resource-manager/web/2023-12-01/webapps/id_appsetting_test.go b/resource-manager/web/2023-12-01/webapps/id_appsetting_test.go index 6dda19ec1e7..b7bbe12fe12 100644 --- a/resource-manager/web/2023-12-01/webapps/id_appsetting_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_appsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &AppSettingId{} func TestNewAppSettingID(t *testing.T) { - id := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey") + id := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewAppSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.AppSettingKey != "appSettingKey" { @@ -32,8 +32,8 @@ func TestNewAppSettingID(t *testing.T) { } func TestFormatAppSettingID(t *testing.T) { - actual := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "appSettingKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey" + actual := NewAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "appSettingKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseAppSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseAppSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", Expected: &AppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", AppSettingKey: "aPpSeTtInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_backup.go b/resource-manager/web/2023-12-01/webapps/id_backup.go index 3ef9859edca..84ecf422bfb 100644 --- a/resource-manager/web/2023-12-01/webapps/id_backup.go +++ b/resource-manager/web/2023-12-01/webapps/id_backup.go @@ -121,7 +121,7 @@ func (id BackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupId", "backupId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_backup_test.go b/resource-manager/web/2023-12-01/webapps/id_backup_test.go index 02c1370b786..5e0f8fc3dab 100644 --- a/resource-manager/web/2023-12-01/webapps/id_backup_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_backup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &BackupId{} func TestNewBackupID(t *testing.T) { - id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId") + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.BackupId != "backupId" { @@ -32,8 +32,8 @@ func TestNewBackupID(t *testing.T) { } func TestFormatBackupID(t *testing.T) { - actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "backupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId" + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "backupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/backups/backupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs/bAcKuPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs/bAcKuPiD", Expected: &BackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", BackupId: "bAcKuPiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/bAcKuPs/bAcKuPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/bAcKuPs/bAcKuPiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_configreferenceappsetting.go b/resource-manager/web/2023-12-01/webapps/id_configreferenceappsetting.go index 532f4c47969..0be15f20c3d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_configreferenceappsetting.go +++ b/resource-manager/web/2023-12-01/webapps/id_configreferenceappsetting.go @@ -127,9 +127,9 @@ func (id ConfigReferenceAppSettingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticAppSettings", "appSettings", "appSettings"), diff --git a/resource-manager/web/2023-12-01/webapps/id_configreferenceappsetting_test.go b/resource-manager/web/2023-12-01/webapps/id_configreferenceappsetting_test.go index d27dfeb32ce..1b5073a3b78 100644 --- a/resource-manager/web/2023-12-01/webapps/id_configreferenceappsetting_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_configreferenceappsetting_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigReferenceAppSettingId{} func TestNewConfigReferenceAppSettingID(t *testing.T) { - id := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey") + id := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewConfigReferenceAppSettingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.AppSettingKey != "appSettingKey" { @@ -36,8 +36,8 @@ func TestNewConfigReferenceAppSettingID(t *testing.T) { } func TestFormatConfigReferenceAppSettingID(t *testing.T) { - actual := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "appSettingKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey" + actual := NewConfigReferenceAppSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "appSettingKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseConfigReferenceAppSettingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseConfigReferenceAppSettingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", AppSettingKey: "appSettingKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/appSettings/appSettingKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/appSettings/appSettingKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy", Expected: &ConfigReferenceAppSettingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", AppSettingKey: "aPpSeTtInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/aPpSeTtInGs/aPpSeTtInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_configreferenceconnectionstring.go b/resource-manager/web/2023-12-01/webapps/id_configreferenceconnectionstring.go index 8d47f02f5a1..63353893f7d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_configreferenceconnectionstring.go +++ b/resource-manager/web/2023-12-01/webapps/id_configreferenceconnectionstring.go @@ -127,9 +127,9 @@ func (id ConfigReferenceConnectionStringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticConnectionStrings", "connectionStrings", "connectionStrings"), diff --git a/resource-manager/web/2023-12-01/webapps/id_configreferenceconnectionstring_test.go b/resource-manager/web/2023-12-01/webapps/id_configreferenceconnectionstring_test.go index b1b2536a50e..a18b81f139f 100644 --- a/resource-manager/web/2023-12-01/webapps/id_configreferenceconnectionstring_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_configreferenceconnectionstring_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConfigReferenceConnectionStringId{} func TestNewConfigReferenceConnectionStringID(t *testing.T) { - id := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey") + id := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewConfigReferenceConnectionStringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ConnectionStringKey != "connectionStringKey" { @@ -36,8 +36,8 @@ func TestNewConfigReferenceConnectionStringID(t *testing.T) { } func TestFormatConfigReferenceConnectionStringID(t *testing.T) { - actual := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "connectionStringKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey" + actual := NewConfigReferenceConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "connectionStringKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseConfigReferenceConnectionStringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseConfigReferenceConnectionStringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", Expected: &ConfigReferenceConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ConnectionStringKey: "cOnNeCtIoNsTrInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_connectionstring.go b/resource-manager/web/2023-12-01/webapps/id_connectionstring.go index 15ab1745be8..5282e76e282 100644 --- a/resource-manager/web/2023-12-01/webapps/id_connectionstring.go +++ b/resource-manager/web/2023-12-01/webapps/id_connectionstring.go @@ -121,7 +121,7 @@ func (id ConnectionStringId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticConfigReferences", "configReferences", "configReferences"), resourceids.StaticSegment("staticConnectionStrings", "connectionStrings", "connectionStrings"), diff --git a/resource-manager/web/2023-12-01/webapps/id_connectionstring_test.go b/resource-manager/web/2023-12-01/webapps/id_connectionstring_test.go index de1af457233..c4310a2bd0d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_connectionstring_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_connectionstring_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ConnectionStringId{} func TestNewConnectionStringID(t *testing.T) { - id := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey") + id := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewConnectionStringID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ConnectionStringKey != "connectionStringKey" { @@ -32,8 +32,8 @@ func TestNewConnectionStringID(t *testing.T) { } func TestFormatConnectionStringID(t *testing.T) { - actual := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "connectionStringKey").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey" + actual := NewConnectionStringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "connectionStringKey").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseConnectionStringID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseConnectionStringIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ConnectionStringKey: "connectionStringKey", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/configReferences/connectionStrings/connectionStringKey/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/configReferences/connectionStrings/connectionStringKey/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy", Expected: &ConnectionStringId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ConnectionStringKey: "cOnNeCtIoNsTrInGkEy", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/cOnFiGrEfErEnCeS/cOnNeCtIoNsTrInGs/cOnNeCtIoNsTrInGkEy/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_continuouswebjob.go b/resource-manager/web/2023-12-01/webapps/id_continuouswebjob.go index a9bf0269a2f..b25215a56ac 100644 --- a/resource-manager/web/2023-12-01/webapps/id_continuouswebjob.go +++ b/resource-manager/web/2023-12-01/webapps/id_continuouswebjob.go @@ -121,9 +121,9 @@ func (id ContinuousWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticContinuousWebJobs", "continuousWebJobs", "continuousWebJobs"), - resourceids.UserSpecifiedSegment("continuousWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("continuousWebJobName", "continuousWebJobName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_continuouswebjob_test.go b/resource-manager/web/2023-12-01/webapps/id_continuouswebjob_test.go index 9cf5e8d6b69..9dbfdc97ffc 100644 --- a/resource-manager/web/2023-12-01/webapps/id_continuouswebjob_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_continuouswebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ContinuousWebJobId{} func TestNewContinuousWebJobID(t *testing.T) { - id := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewContinuousWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.ContinuousWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "webJobName") + if id.ContinuousWebJobName != "continuousWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "continuousWebJobName") } } func TestFormatContinuousWebJobID(t *testing.T) { - actual := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName" + actual := NewContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "continuousWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseContinuousWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseContinuousWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE", Expected: &ContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - ContinuousWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + ContinuousWebJobName: "cOnTiNuOuSwEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnTiNuOuSwEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_default.go b/resource-manager/web/2023-12-01/webapps/id_default.go index 254bc8a89a0..82b1628663d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_default.go +++ b/resource-manager/web/2023-12-01/webapps/id_default.go @@ -127,10 +127,10 @@ func (id DefaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHost", "host", "host"), resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.UserSpecifiedSegment("defaultName", "keyType"), + resourceids.UserSpecifiedSegment("defaultName", "defaultName"), resourceids.UserSpecifiedSegment("keyName", "keyName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_default_test.go b/resource-manager/web/2023-12-01/webapps/id_default_test.go index ba20a5368c1..fb8f07676f0 100644 --- a/resource-manager/web/2023-12-01/webapps/id_default_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_default_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DefaultId{} func TestNewDefaultID(t *testing.T) { - id := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName") + id := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewDefaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DefaultName != "keyType" { - t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "keyType") + if id.DefaultName != "defaultName" { + t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "defaultName") } if id.KeyName != "keyName" { @@ -36,8 +36,8 @@ func TestNewDefaultID(t *testing.T) { } func TestFormatDefaultID(t *testing.T) { - actual := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "keyType", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName" + actual := NewDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "defaultName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseDefaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DefaultName: "keyType", + SiteName: "siteName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseDefaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DefaultName: "keyType", + SiteName: "siteName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/host/default/defaultName/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe", Expected: &DefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - DefaultName: "kEyTyPe", + SiteName: "sItEnAmE", + DefaultName: "dEfAuLtNaMe", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsT/dEfAuLt/kEyTyPe/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_deployment.go b/resource-manager/web/2023-12-01/webapps/id_deployment.go index 5f0c95f64d3..6b9e4f1fdf3 100644 --- a/resource-manager/web/2023-12-01/webapps/id_deployment.go +++ b/resource-manager/web/2023-12-01/webapps/id_deployment.go @@ -121,9 +121,9 @@ func (id DeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), - resourceids.UserSpecifiedSegment("deploymentName", "id"), + resourceids.UserSpecifiedSegment("deploymentName", "deploymentName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_deployment_test.go b/resource-manager/web/2023-12-01/webapps/id_deployment_test.go index d25ecc8b37f..01e80a6d68b 100644 --- a/resource-manager/web/2023-12-01/webapps/id_deployment_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_deployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &DeploymentId{} func TestNewDeploymentID(t *testing.T) { - id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id") + id := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.DeploymentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "id") + if id.DeploymentName != "deploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "deploymentName") } } func TestFormatDeploymentID(t *testing.T) { - actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id" + actual := NewDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DeploymentName: "id", + SiteName: "siteName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - DeploymentName: "id", + SiteName: "siteName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &DeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - DeploymentName: "iD", + SiteName: "sItEnAmE", + DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dEpLoYmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_function.go b/resource-manager/web/2023-12-01/webapps/id_function.go index f13ac6949c4..f616aeae83a 100644 --- a/resource-manager/web/2023-12-01/webapps/id_function.go +++ b/resource-manager/web/2023-12-01/webapps/id_function.go @@ -121,7 +121,7 @@ func (id FunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_function_test.go b/resource-manager/web/2023-12-01/webapps/id_function_test.go index 9380b24f46c..647ee45180b 100644 --- a/resource-manager/web/2023-12-01/webapps/id_function_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_function_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionId{} func TestNewFunctionID(t *testing.T) { - id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName") + id := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.FunctionName != "functionName" { @@ -32,8 +32,8 @@ func TestNewFunctionID(t *testing.T) { } func TestFormatFunctionID(t *testing.T) { - actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName" + actual := NewFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE", Expected: &FunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_functionkey.go b/resource-manager/web/2023-12-01/webapps/id_functionkey.go index 6b146a6c1d6..2c5e6ac58da 100644 --- a/resource-manager/web/2023-12-01/webapps/id_functionkey.go +++ b/resource-manager/web/2023-12-01/webapps/id_functionkey.go @@ -133,9 +133,9 @@ func (id FunctionKeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), diff --git a/resource-manager/web/2023-12-01/webapps/id_functionkey_test.go b/resource-manager/web/2023-12-01/webapps/id_functionkey_test.go index c90a9b7f5bd..d5c2d17970d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_functionkey_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_functionkey_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &FunctionKeyId{} func TestNewFunctionKeyID(t *testing.T) { - id := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName") + id := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewFunctionKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.FunctionName != "functionName" { @@ -40,8 +40,8 @@ func TestNewFunctionKeyID(t *testing.T) { } func TestFormatFunctionKeyID(t *testing.T) { - actual := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName" + actual := NewFunctionKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseFunctionKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseFunctionKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/keys/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", Expected: &FunctionKeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", FunctionName: "fUnCtIoNnAmE", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_gateway.go b/resource-manager/web/2023-12-01/webapps/id_gateway.go index aa57771776c..0d5dc900e0d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_gateway.go +++ b/resource-manager/web/2023-12-01/webapps/id_gateway.go @@ -127,9 +127,9 @@ func (id GatewayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_gateway_test.go b/resource-manager/web/2023-12-01/webapps/id_gateway_test.go index b4b752195f7..7bbd4aac0a9 100644 --- a/resource-manager/web/2023-12-01/webapps/id_gateway_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_gateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &GatewayId{} func TestNewGatewayID(t *testing.T) { - id := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName") + id := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -36,8 +36,8 @@ func TestNewGatewayID(t *testing.T) { } func TestFormatGatewayID(t *testing.T) { - actual := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &GatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_history.go b/resource-manager/web/2023-12-01/webapps/id_history.go index 20c6af22958..c1cc260d497 100644 --- a/resource-manager/web/2023-12-01/webapps/id_history.go +++ b/resource-manager/web/2023-12-01/webapps/id_history.go @@ -127,11 +127,11 @@ func (id HistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), resourceids.StaticSegment("staticHistory", "history", "history"), - resourceids.UserSpecifiedSegment("historyName", "id"), + resourceids.UserSpecifiedSegment("historyName", "historyName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_history_test.go b/resource-manager/web/2023-12-01/webapps/id_history_test.go index 3289e52eac8..d3d2ed22f07 100644 --- a/resource-manager/web/2023-12-01/webapps/id_history_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_history_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HistoryId{} func TestNewHistoryID(t *testing.T) { - id := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id") + id := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } - if id.HistoryName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "id") + if id.HistoryName != "historyName" { + t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "historyName") } } func TestFormatHistoryID(t *testing.T) { - actual := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id" + actual := NewHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe", Expected: &HistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - TriggeredWebJobName: "wEbJoBnAmE", - HistoryName: "iD", + SiteName: "sItEnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", + HistoryName: "hIsToRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_hostdefault.go b/resource-manager/web/2023-12-01/webapps/id_hostdefault.go index 980fea18eb4..d02b1ff58fb 100644 --- a/resource-manager/web/2023-12-01/webapps/id_hostdefault.go +++ b/resource-manager/web/2023-12-01/webapps/id_hostdefault.go @@ -133,12 +133,12 @@ func (id HostDefaultId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHost", "host", "host"), resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.UserSpecifiedSegment("defaultName", "keyType"), + resourceids.UserSpecifiedSegment("defaultName", "defaultName"), resourceids.UserSpecifiedSegment("keyName", "keyName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_hostdefault_test.go b/resource-manager/web/2023-12-01/webapps/id_hostdefault_test.go index 262ebd9947d..4f3bb7c417c 100644 --- a/resource-manager/web/2023-12-01/webapps/id_hostdefault_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_hostdefault_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostDefaultId{} func TestNewHostDefaultID(t *testing.T) { - id := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName") + id := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewHostDefaultID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DefaultName != "keyType" { - t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "keyType") + if id.DefaultName != "defaultName" { + t.Fatalf("Expected %q but got %q for Segment 'DefaultName'", id.DefaultName, "defaultName") } if id.KeyName != "keyName" { @@ -40,8 +40,8 @@ func TestNewHostDefaultID(t *testing.T) { } func TestFormatHostDefaultID(t *testing.T) { - actual := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "keyType", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName" + actual := NewHostDefaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "defaultName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseHostDefaultID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DefaultName: "keyType", + SiteName: "siteName", + SlotName: "slotName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseHostDefaultIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DefaultName: "keyType", + SiteName: "siteName", + SlotName: "slotName", + DefaultName: "defaultName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/host/default/keyType/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/host/default/defaultName/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe", Expected: &HostDefaultId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - DefaultName: "kEyTyPe", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + DefaultName: "dEfAuLtNaMe", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsT/dEfAuLt/kEyTyPe/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsT/dEfAuLt/dEfAuLtNaMe/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_hostnamebinding.go b/resource-manager/web/2023-12-01/webapps/id_hostnamebinding.go index 9959ddc39e8..56a4b8e3fba 100644 --- a/resource-manager/web/2023-12-01/webapps/id_hostnamebinding.go +++ b/resource-manager/web/2023-12-01/webapps/id_hostnamebinding.go @@ -121,9 +121,9 @@ func (id HostNameBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostNameBindings", "hostNameBindings", "hostNameBindings"), - resourceids.UserSpecifiedSegment("hostNameBindingName", "hostName"), + resourceids.UserSpecifiedSegment("hostNameBindingName", "hostNameBindingName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_hostnamebinding_test.go b/resource-manager/web/2023-12-01/webapps/id_hostnamebinding_test.go index ffa929dffdd..a3b55f6e522 100644 --- a/resource-manager/web/2023-12-01/webapps/id_hostnamebinding_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_hostnamebinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HostNameBindingId{} func TestNewHostNameBindingID(t *testing.T) { - id := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName") + id := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHostNameBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HostNameBindingName != "hostName" { - t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostName") + if id.HostNameBindingName != "hostNameBindingName" { + t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostNameBindingName") } } func TestFormatHostNameBindingID(t *testing.T) { - actual := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "hostName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName" + actual := NewHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hostNameBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHostNameBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HostNameBindingName: "hostName", + SiteName: "siteName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHostNameBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HostNameBindingName: "hostName", + SiteName: "siteName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostNameBindings/hostNameBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS/hOsTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe", Expected: &HostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HostNameBindingName: "hOsTnAmE", + SiteName: "sItEnAmE", + HostNameBindingName: "hOsTnAmEbInDiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTnAmEbInDiNgS/hOsTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_hybridconnection.go b/resource-manager/web/2023-12-01/webapps/id_hybridconnection.go index 02bb4f49003..643e1f811d9 100644 --- a/resource-manager/web/2023-12-01/webapps/id_hybridconnection.go +++ b/resource-manager/web/2023-12-01/webapps/id_hybridconnection.go @@ -121,9 +121,9 @@ func (id HybridConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHybridConnection", "hybridConnection", "hybridConnection"), - resourceids.UserSpecifiedSegment("hybridConnectionName", "entityName"), + resourceids.UserSpecifiedSegment("hybridConnectionName", "hybridConnectionName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_hybridconnection_test.go b/resource-manager/web/2023-12-01/webapps/id_hybridconnection_test.go index 5580974235b..db79679c1a3 100644 --- a/resource-manager/web/2023-12-01/webapps/id_hybridconnection_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_hybridconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HybridConnectionId{} func TestNewHybridConnectionID(t *testing.T) { - id := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName") + id := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewHybridConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HybridConnectionName != "entityName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "entityName") + if id.HybridConnectionName != "hybridConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "hybridConnectionName") } } func TestFormatHybridConnectionID(t *testing.T) { - actual := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "entityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName" + actual := NewHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHybridConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionName: "entityName", + SiteName: "siteName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHybridConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionName: "entityName", + SiteName: "siteName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnection/hybridConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN/eNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE", Expected: &HybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HybridConnectionName: "eNtItYnAmE", + SiteName: "sItEnAmE", + HybridConnectionName: "hYbRiDcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoN/eNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_instance.go b/resource-manager/web/2023-12-01/webapps/id_instance.go index 25203793a81..f43fc67da55 100644 --- a/resource-manager/web/2023-12-01/webapps/id_instance.go +++ b/resource-manager/web/2023-12-01/webapps/id_instance.go @@ -121,7 +121,7 @@ func (id InstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_instance_test.go b/resource-manager/web/2023-12-01/webapps/id_instance_test.go index c4429391ddb..34b663d63cc 100644 --- a/resource-manager/web/2023-12-01/webapps/id_instance_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_instance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceId{} func TestNewInstanceID(t *testing.T) { - id := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId") + id := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -32,8 +32,8 @@ func TestNewInstanceID(t *testing.T) { } func TestFormatInstanceID(t *testing.T) { - actual := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId" + actual := NewInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Expected: &InstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_instanceprocess.go b/resource-manager/web/2023-12-01/webapps/id_instanceprocess.go index 55adc768077..86610e6df3c 100644 --- a/resource-manager/web/2023-12-01/webapps/id_instanceprocess.go +++ b/resource-manager/web/2023-12-01/webapps/id_instanceprocess.go @@ -127,7 +127,7 @@ func (id InstanceProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), diff --git a/resource-manager/web/2023-12-01/webapps/id_instanceprocess_test.go b/resource-manager/web/2023-12-01/webapps/id_instanceprocess_test.go index 96f28a0d8b3..dbfed807250 100644 --- a/resource-manager/web/2023-12-01/webapps/id_instanceprocess_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_instanceprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceProcessId{} func TestNewInstanceProcessID(t *testing.T) { - id := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId") + id := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -36,8 +36,8 @@ func TestNewInstanceProcessID(t *testing.T) { } func TestFormatInstanceProcessID(t *testing.T) { - actual := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId" + actual := NewInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseInstanceProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseInstanceProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Expected: &InstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_instanceprocessmodule.go b/resource-manager/web/2023-12-01/webapps/id_instanceprocessmodule.go index 5b146947462..28225e030f5 100644 --- a/resource-manager/web/2023-12-01/webapps/id_instanceprocessmodule.go +++ b/resource-manager/web/2023-12-01/webapps/id_instanceprocessmodule.go @@ -133,13 +133,13 @@ func (id InstanceProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_instanceprocessmodule_test.go b/resource-manager/web/2023-12-01/webapps/id_instanceprocessmodule_test.go index 62ccb13e72d..7e118c5f387 100644 --- a/resource-manager/web/2023-12-01/webapps/id_instanceprocessmodule_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_instanceprocessmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &InstanceProcessModuleId{} func TestNewInstanceProcessModuleID(t *testing.T) { - id := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress") + id := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.InstanceId != "instanceId" { @@ -34,14 +34,14 @@ func TestNewInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatInstanceProcessModuleID(t *testing.T) { - actual := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "instanceId", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress" + actual := NewInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "instanceId", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseInstanceProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseInstanceProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &InstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_key.go b/resource-manager/web/2023-12-01/webapps/id_key.go index c0b37b03506..ca9170618d4 100644 --- a/resource-manager/web/2023-12-01/webapps/id_key.go +++ b/resource-manager/web/2023-12-01/webapps/id_key.go @@ -127,7 +127,7 @@ func (id KeyId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), resourceids.StaticSegment("staticKeys", "keys", "keys"), diff --git a/resource-manager/web/2023-12-01/webapps/id_key_test.go b/resource-manager/web/2023-12-01/webapps/id_key_test.go index 7ebef22f14b..0d951499006 100644 --- a/resource-manager/web/2023-12-01/webapps/id_key_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_key_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &KeyId{} func TestNewKeyID(t *testing.T) { - id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName") + id := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewKeyID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.FunctionName != "functionName" { @@ -36,8 +36,8 @@ func TestNewKeyID(t *testing.T) { } func TestFormatKeyID(t *testing.T) { - actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "functionName", "keyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName" + actual := NewKeyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "functionName", "keyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseKeyID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseKeyIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", FunctionName: "functionName", KeyName: "keyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/functions/functionName/keys/keyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/functions/functionName/keys/keyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe", Expected: &KeyId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", FunctionName: "fUnCtIoNnAmE", KeyName: "kEyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/fUnCtIoNs/fUnCtIoNnAmE/kEyS/kEyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_module.go b/resource-manager/web/2023-12-01/webapps/id_module.go index a4d421216a9..88421388b85 100644 --- a/resource-manager/web/2023-12-01/webapps/id_module.go +++ b/resource-manager/web/2023-12-01/webapps/id_module.go @@ -127,11 +127,11 @@ func (id ModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_module_test.go b/resource-manager/web/2023-12-01/webapps/id_module_test.go index d97537ae112..d5e57223ef0 100644 --- a/resource-manager/web/2023-12-01/webapps/id_module_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_module_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ModuleId{} func TestNewModuleID(t *testing.T) { - id := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress") + id := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ProcessId != "processId" { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatModuleID(t *testing.T) { - actual := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress" + actual := NewModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &ModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_networkfeature.go b/resource-manager/web/2023-12-01/webapps/id_networkfeature.go index fd2923f194e..dc1966efd90 100644 --- a/resource-manager/web/2023-12-01/webapps/id_networkfeature.go +++ b/resource-manager/web/2023-12-01/webapps/id_networkfeature.go @@ -121,9 +121,9 @@ func (id NetworkFeatureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkFeatures", "networkFeatures", "networkFeatures"), - resourceids.UserSpecifiedSegment("networkFeatureName", "view"), + resourceids.UserSpecifiedSegment("networkFeatureName", "networkFeatureName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_networkfeature_test.go b/resource-manager/web/2023-12-01/webapps/id_networkfeature_test.go index 3b6fe10b0f0..1c1bafc5113 100644 --- a/resource-manager/web/2023-12-01/webapps/id_networkfeature_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_networkfeature_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkFeatureId{} func TestNewNetworkFeatureID(t *testing.T) { - id := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view") + id := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewNetworkFeatureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.NetworkFeatureName != "view" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "view") + if id.NetworkFeatureName != "networkFeatureName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "networkFeatureName") } } func TestFormatNetworkFeatureID(t *testing.T) { - actual := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "view").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view" + actual := NewNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "networkFeatureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkFeatureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - NetworkFeatureName: "view", + SiteName: "siteName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - NetworkFeatureName: "view", + SiteName: "siteName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkFeatures/networkFeatureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs/vIeW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE", Expected: &NetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - NetworkFeatureName: "vIeW", + SiteName: "sItEnAmE", + NetworkFeatureName: "nEtWoRkFeAtUrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkFeAtUrEs/vIeW/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_networktrace.go b/resource-manager/web/2023-12-01/webapps/id_networktrace.go index 1e29b968bba..d7b89a69dd1 100644 --- a/resource-manager/web/2023-12-01/webapps/id_networktrace.go +++ b/resource-manager/web/2023-12-01/webapps/id_networktrace.go @@ -121,7 +121,7 @@ func (id NetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkTrace", "networkTrace", "networkTrace"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_networktrace_test.go b/resource-manager/web/2023-12-01/webapps/id_networktrace_test.go index 6147556e678..2ca9e11dd67 100644 --- a/resource-manager/web/2023-12-01/webapps/id_networktrace_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_networktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &NetworkTraceId{} func TestNewNetworkTraceID(t *testing.T) { - id := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") + id := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.OperationId != "operationId" { @@ -32,8 +32,8 @@ func TestNewNetworkTraceID(t *testing.T) { } func TestFormatNetworkTraceID(t *testing.T) { - actual := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId" + actual := NewNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTrace/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE/oPeRaTiOnId", Expected: &NetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_premieraddon.go b/resource-manager/web/2023-12-01/webapps/id_premieraddon.go index f926683223a..e2a7b5cf220 100644 --- a/resource-manager/web/2023-12-01/webapps/id_premieraddon.go +++ b/resource-manager/web/2023-12-01/webapps/id_premieraddon.go @@ -121,9 +121,9 @@ func (id PremierAddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPremierAddons", "premierAddons", "premierAddons"), - resourceids.UserSpecifiedSegment("premierAddonName", "premierAddOnName"), + resourceids.UserSpecifiedSegment("premierAddonName", "premierAddonName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_premieraddon_test.go b/resource-manager/web/2023-12-01/webapps/id_premieraddon_test.go index e14985cf82a..2c292945ce2 100644 --- a/resource-manager/web/2023-12-01/webapps/id_premieraddon_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_premieraddon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PremierAddonId{} func TestNewPremierAddonID(t *testing.T) { - id := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName") + id := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewPremierAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.PremierAddonName != "premierAddOnName" { - t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddOnName") + if id.PremierAddonName != "premierAddonName" { + t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddonName") } } func TestFormatPremierAddonID(t *testing.T) { - actual := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "premierAddOnName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName" + actual := NewPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "premierAddonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePremierAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePremierAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/premierAddons/premierAddonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", Expected: &PremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PremierAddonName: "pReMiErAdDoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_privateendpointconnection.go b/resource-manager/web/2023-12-01/webapps/id_privateendpointconnection.go index 1504e2b3374..c7d9dfbd7e0 100644 --- a/resource-manager/web/2023-12-01/webapps/id_privateendpointconnection.go +++ b/resource-manager/web/2023-12-01/webapps/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_privateendpointconnection_test.go b/resource-manager/web/2023-12-01/webapps/id_privateendpointconnection_test.go index 9a552e2764d..b8561c67c85 100644 --- a/resource-manager/web/2023-12-01/webapps/id_privateendpointconnection_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_process.go b/resource-manager/web/2023-12-01/webapps/id_process.go index 1c2d61493cb..4bd04a2dc5a 100644 --- a/resource-manager/web/2023-12-01/webapps/id_process.go +++ b/resource-manager/web/2023-12-01/webapps/id_process.go @@ -121,7 +121,7 @@ func (id ProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_process_test.go b/resource-manager/web/2023-12-01/webapps/id_process_test.go index 3c86013b33b..01626642762 100644 --- a/resource-manager/web/2023-12-01/webapps/id_process_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_process_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProcessId{} func TestNewProcessID(t *testing.T) { - id := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId") + id := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.ProcessId != "processId" { @@ -32,8 +32,8 @@ func TestNewProcessID(t *testing.T) { } func TestFormatProcessID(t *testing.T) { - actual := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId" + actual := NewProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId", Expected: &ProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_processmodule.go b/resource-manager/web/2023-12-01/webapps/id_processmodule.go index 87b5d659016..5219175f699 100644 --- a/resource-manager/web/2023-12-01/webapps/id_processmodule.go +++ b/resource-manager/web/2023-12-01/webapps/id_processmodule.go @@ -133,13 +133,13 @@ func (id ProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_processmodule_test.go b/resource-manager/web/2023-12-01/webapps/id_processmodule_test.go index 53e7e1765c4..de7af2c9000 100644 --- a/resource-manager/web/2023-12-01/webapps/id_processmodule_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_processmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ProcessModuleId{} func TestNewProcessModuleID(t *testing.T) { - id := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress") + id := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ProcessId != "processId" { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatProcessModuleID(t *testing.T) { - actual := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress" + actual := NewProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &ProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_publiccertificate.go b/resource-manager/web/2023-12-01/webapps/id_publiccertificate.go index 5addcaf8c22..ab810e6cab6 100644 --- a/resource-manager/web/2023-12-01/webapps/id_publiccertificate.go +++ b/resource-manager/web/2023-12-01/webapps/id_publiccertificate.go @@ -121,7 +121,7 @@ func (id PublicCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticPublicCertificates", "publicCertificates", "publicCertificates"), resourceids.UserSpecifiedSegment("publicCertificateName", "publicCertificateName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_publiccertificate_test.go b/resource-manager/web/2023-12-01/webapps/id_publiccertificate_test.go index 53da52ea695..947dd952615 100644 --- a/resource-manager/web/2023-12-01/webapps/id_publiccertificate_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_publiccertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PublicCertificateId{} func TestNewPublicCertificateID(t *testing.T) { - id := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName") + id := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPublicCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.PublicCertificateName != "publicCertificateName" { @@ -32,8 +32,8 @@ func TestNewPublicCertificateID(t *testing.T) { } func TestFormatPublicCertificateID(t *testing.T) { - actual := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "publicCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName" + actual := NewPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "publicCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePublicCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePublicCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/publicCertificates/publicCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", Expected: &PublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", PublicCertificateName: "pUbLiCcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_relay.go b/resource-manager/web/2023-12-01/webapps/id_relay.go index 9396eaf87db..4af77542a26 100644 --- a/resource-manager/web/2023-12-01/webapps/id_relay.go +++ b/resource-manager/web/2023-12-01/webapps/id_relay.go @@ -127,9 +127,9 @@ func (id RelayId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_relay_test.go b/resource-manager/web/2023-12-01/webapps/id_relay_test.go index 858e3cdec80..b0ca40050e1 100644 --- a/resource-manager/web/2023-12-01/webapps/id_relay_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_relay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RelayId{} func TestNewRelayID(t *testing.T) { - id := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName") + id := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -36,8 +36,8 @@ func TestNewRelayID(t *testing.T) { } func TestFormatRelayID(t *testing.T) { - actual := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &RelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + SiteName: "sItEnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_sitecontainer.go b/resource-manager/web/2023-12-01/webapps/id_sitecontainer.go index a4f4bbfb4ce..a6f2cf8a06c 100644 --- a/resource-manager/web/2023-12-01/webapps/id_sitecontainer.go +++ b/resource-manager/web/2023-12-01/webapps/id_sitecontainer.go @@ -121,9 +121,9 @@ func (id SitecontainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSitecontainers", "sitecontainers", "sitecontainers"), - resourceids.UserSpecifiedSegment("sitecontainerName", "containerName"), + resourceids.UserSpecifiedSegment("sitecontainerName", "sitecontainerName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_sitecontainer_test.go b/resource-manager/web/2023-12-01/webapps/id_sitecontainer_test.go index 38c1923f468..cded30dec5d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_sitecontainer_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_sitecontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SitecontainerId{} func TestNewSitecontainerID(t *testing.T) { - id := NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "containerName") + id := NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "sitecontainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewSitecontainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SitecontainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'SitecontainerName'", id.SitecontainerName, "containerName") + if id.SitecontainerName != "sitecontainerName" { + t.Fatalf("Expected %q but got %q for Segment 'SitecontainerName'", id.SitecontainerName, "sitecontainerName") } } func TestFormatSitecontainerID(t *testing.T) { - actual := NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/sitecontainers/containerName" + actual := NewSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "sitecontainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/sitecontainers/sitecontainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSitecontainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/sitecontainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/sitecontainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/sitecontainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/sitecontainers/sitecontainerName", Expected: &SitecontainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SitecontainerName: "containerName", + SiteName: "siteName", + SitecontainerName: "sitecontainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/sitecontainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/sitecontainers/sitecontainerName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSitecontainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/sitecontainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/sitecontainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/sitecontainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/sitecontainers/sitecontainerName", Expected: &SitecontainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SitecontainerName: "containerName", + SiteName: "siteName", + SitecontainerName: "sitecontainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/sitecontainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/sitecontainers/sitecontainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEcOnTaInErS/sItEcOnTaInErNaMe", Expected: &SitecontainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SitecontainerName: "cOnTaInErNaMe", + SiteName: "sItEnAmE", + SitecontainerName: "sItEcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEcOnTaInErS/sItEcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2022-09-01/webapps/id_domainownershipidentifier.go b/resource-manager/web/2023-12-01/webapps/id_sitedomainownershipidentifier.go similarity index 60% rename from resource-manager/web/2022-09-01/webapps/id_domainownershipidentifier.go rename to resource-manager/web/2023-12-01/webapps/id_sitedomainownershipidentifier.go index 3e940af260c..ff59f8417f2 100644 --- a/resource-manager/web/2022-09-01/webapps/id_domainownershipidentifier.go +++ b/resource-manager/web/2023-12-01/webapps/id_sitedomainownershipidentifier.go @@ -12,22 +12,22 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. func init() { - recaser.RegisterResourceId(&DomainOwnershipIdentifierId{}) + recaser.RegisterResourceId(&SiteDomainOwnershipIdentifierId{}) } -var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} +var _ resourceids.ResourceId = &SiteDomainOwnershipIdentifierId{} -// DomainOwnershipIdentifierId is a struct representing the Resource ID for a Domain Ownership Identifier -type DomainOwnershipIdentifierId struct { +// SiteDomainOwnershipIdentifierId is a struct representing the Resource ID for a Site Domain Ownership Identifier +type SiteDomainOwnershipIdentifierId struct { SubscriptionId string ResourceGroupName string SiteName string DomainOwnershipIdentifierName string } -// NewDomainOwnershipIdentifierID returns a new DomainOwnershipIdentifierId struct -func NewDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName string, siteName string, domainOwnershipIdentifierName string) DomainOwnershipIdentifierId { - return DomainOwnershipIdentifierId{ +// NewSiteDomainOwnershipIdentifierID returns a new SiteDomainOwnershipIdentifierId struct +func NewSiteDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName string, siteName string, domainOwnershipIdentifierName string) SiteDomainOwnershipIdentifierId { + return SiteDomainOwnershipIdentifierId{ SubscriptionId: subscriptionId, ResourceGroupName: resourceGroupName, SiteName: siteName, @@ -35,15 +35,15 @@ func NewDomainOwnershipIdentifierID(subscriptionId string, resourceGroupName str } } -// ParseDomainOwnershipIdentifierID parses 'input' into a DomainOwnershipIdentifierId -func ParseDomainOwnershipIdentifierID(input string) (*DomainOwnershipIdentifierId, error) { - parser := resourceids.NewParserFromResourceIdType(&DomainOwnershipIdentifierId{}) +// ParseSiteDomainOwnershipIdentifierID parses 'input' into a SiteDomainOwnershipIdentifierId +func ParseSiteDomainOwnershipIdentifierID(input string) (*SiteDomainOwnershipIdentifierId, error) { + parser := resourceids.NewParserFromResourceIdType(&SiteDomainOwnershipIdentifierId{}) parsed, err := parser.Parse(input, false) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DomainOwnershipIdentifierId{} + id := SiteDomainOwnershipIdentifierId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -51,16 +51,16 @@ func ParseDomainOwnershipIdentifierID(input string) (*DomainOwnershipIdentifierI return &id, nil } -// ParseDomainOwnershipIdentifierIDInsensitively parses 'input' case-insensitively into a DomainOwnershipIdentifierId +// ParseSiteDomainOwnershipIdentifierIDInsensitively parses 'input' case-insensitively into a SiteDomainOwnershipIdentifierId // note: this method should only be used for API response data and not user input -func ParseDomainOwnershipIdentifierIDInsensitively(input string) (*DomainOwnershipIdentifierId, error) { - parser := resourceids.NewParserFromResourceIdType(&DomainOwnershipIdentifierId{}) +func ParseSiteDomainOwnershipIdentifierIDInsensitively(input string) (*SiteDomainOwnershipIdentifierId, error) { + parser := resourceids.NewParserFromResourceIdType(&SiteDomainOwnershipIdentifierId{}) parsed, err := parser.Parse(input, true) if err != nil { return nil, fmt.Errorf("parsing %q: %+v", input, err) } - id := DomainOwnershipIdentifierId{} + id := SiteDomainOwnershipIdentifierId{} if err = id.FromParseResult(*parsed); err != nil { return nil, err } @@ -68,7 +68,7 @@ func ParseDomainOwnershipIdentifierIDInsensitively(input string) (*DomainOwnersh return &id, nil } -func (id *DomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseResult) error { +func (id *SiteDomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseResult) error { var ok bool if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { @@ -90,29 +90,29 @@ func (id *DomainOwnershipIdentifierId) FromParseResult(input resourceids.ParseRe return nil } -// ValidateDomainOwnershipIdentifierID checks that 'input' can be parsed as a Domain Ownership Identifier ID -func ValidateDomainOwnershipIdentifierID(input interface{}, key string) (warnings []string, errors []error) { +// ValidateSiteDomainOwnershipIdentifierID checks that 'input' can be parsed as a Site Domain Ownership Identifier ID +func ValidateSiteDomainOwnershipIdentifierID(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 := ParseDomainOwnershipIdentifierID(v); err != nil { + if _, err := ParseSiteDomainOwnershipIdentifierID(v); err != nil { errors = append(errors, err) } return } -// ID returns the formatted Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) ID() string { +// ID returns the formatted Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) ID() string { fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/sites/%s/domainOwnershipIdentifiers/%s" return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.SiteName, id.DomainOwnershipIdentifierName) } -// Segments returns a slice of Resource ID Segments which comprise this Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { +// Segments returns a slice of Resource ID Segments which comprise this Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) Segments() []resourceids.Segment { return []resourceids.Segment{ resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), @@ -121,19 +121,19 @@ func (id DomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } } -// String returns a human-readable description of this Domain Ownership Identifier ID -func (id DomainOwnershipIdentifierId) String() string { +// String returns a human-readable description of this Site Domain Ownership Identifier ID +func (id SiteDomainOwnershipIdentifierId) String() string { components := []string{ fmt.Sprintf("Subscription: %q", id.SubscriptionId), fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), fmt.Sprintf("Site Name: %q", id.SiteName), fmt.Sprintf("Domain Ownership Identifier Name: %q", id.DomainOwnershipIdentifierName), } - return fmt.Sprintf("Domain Ownership Identifier (%s)", strings.Join(components, "\n")) + return fmt.Sprintf("Site Domain Ownership Identifier (%s)", strings.Join(components, "\n")) } diff --git a/resource-manager/web/2022-09-01/webapps/id_domainownershipidentifier_test.go b/resource-manager/web/2023-12-01/webapps/id_sitedomainownershipidentifier_test.go similarity index 82% rename from resource-manager/web/2022-09-01/webapps/id_domainownershipidentifier_test.go rename to resource-manager/web/2023-12-01/webapps/id_sitedomainownershipidentifier_test.go index fca70ae9b3a..db628c3f6c2 100644 --- a/resource-manager/web/2022-09-01/webapps/id_domainownershipidentifier_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_sitedomainownershipidentifier_test.go @@ -9,10 +9,10 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -var _ resourceids.ResourceId = &DomainOwnershipIdentifierId{} +var _ resourceids.ResourceId = &SiteDomainOwnershipIdentifierId{} -func TestNewDomainOwnershipIdentifierID(t *testing.T) { - id := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName") +func TestNewSiteDomainOwnershipIdentifierID(t *testing.T) { + id := NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { @@ -31,19 +31,19 @@ func TestNewDomainOwnershipIdentifierID(t *testing.T) { } } -func TestFormatDomainOwnershipIdentifierID(t *testing.T) { - actual := NewDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "domainOwnershipIdentifierName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName" +func TestFormatSiteDomainOwnershipIdentifierID(t *testing.T) { + actual := NewSiteDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } } -func TestParseDomainOwnershipIdentifierID(t *testing.T) { +func TestParseSiteDomainOwnershipIdentifierID(t *testing.T) { testData := []struct { Input string Error bool - Expected *DomainOwnershipIdentifierId + Expected *SiteDomainOwnershipIdentifierId }{ { // Incomplete URI @@ -87,34 +87,34 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName", - Expected: &DomainOwnershipIdentifierId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDomainOwnershipIdentifierID(v.Input) + actual, err := ParseSiteDomainOwnershipIdentifierID(v.Input) if err != nil { if v.Error { continue @@ -145,11 +145,11 @@ func TestParseDomainOwnershipIdentifierID(t *testing.T) { } } -func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { +func TestParseSiteDomainOwnershipIdentifierIDInsensitively(t *testing.T) { testData := []struct { Input string Error bool - Expected *DomainOwnershipIdentifierId + Expected *SiteDomainOwnershipIdentifierId }{ { // Incomplete URI @@ -228,59 +228,59 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName", - Expected: &DomainOwnershipIdentifierId{ + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", - Expected: &DomainOwnershipIdentifierId{ + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", + Expected: &SiteDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } for _, v := range testData { t.Logf("[DEBUG] Testing %q", v.Input) - actual, err := ParseDomainOwnershipIdentifierIDInsensitively(v.Input) + actual, err := ParseSiteDomainOwnershipIdentifierIDInsensitively(v.Input) if err != nil { if v.Error { continue @@ -311,10 +311,10 @@ func TestParseDomainOwnershipIdentifierIDInsensitively(t *testing.T) { } } -func TestSegmentsForDomainOwnershipIdentifierId(t *testing.T) { - segments := DomainOwnershipIdentifierId{}.Segments() +func TestSegmentsForSiteDomainOwnershipIdentifierId(t *testing.T) { + segments := SiteDomainOwnershipIdentifierId{}.Segments() if len(segments) == 0 { - t.Fatalf("DomainOwnershipIdentifierId has no segments") + t.Fatalf("SiteDomainOwnershipIdentifierId has no segments") } uniqueNames := make(map[string]struct{}, 0) diff --git a/resource-manager/web/2023-12-01/webapps/id_siteextension.go b/resource-manager/web/2023-12-01/webapps/id_siteextension.go index 17385289ef2..40c85eb38fe 100644 --- a/resource-manager/web/2023-12-01/webapps/id_siteextension.go +++ b/resource-manager/web/2023-12-01/webapps/id_siteextension.go @@ -121,7 +121,7 @@ func (id SiteExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSiteExtensions", "siteExtensions", "siteExtensions"), resourceids.UserSpecifiedSegment("siteExtensionId", "siteExtensionId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_siteextension_test.go b/resource-manager/web/2023-12-01/webapps/id_siteextension_test.go index 47dc5d50a4b..32a89aa57ab 100644 --- a/resource-manager/web/2023-12-01/webapps/id_siteextension_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_siteextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteExtensionId{} func TestNewSiteExtensionID(t *testing.T) { - id := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId") + id := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSiteExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.SiteExtensionId != "siteExtensionId" { @@ -32,8 +32,8 @@ func TestNewSiteExtensionID(t *testing.T) { } func TestFormatSiteExtensionID(t *testing.T) { - actual := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "siteExtensionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId" + actual := NewSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "siteExtensionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSiteExtensionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSiteExtensionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/siteExtensions/siteExtensionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", Expected: &SiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", SiteExtensionId: "sItEeXtEnSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_sitenetworktrace.go b/resource-manager/web/2023-12-01/webapps/id_sitenetworktrace.go index b281890243a..3274d10301d 100644 --- a/resource-manager/web/2023-12-01/webapps/id_sitenetworktrace.go +++ b/resource-manager/web/2023-12-01/webapps/id_sitenetworktrace.go @@ -121,7 +121,7 @@ func (id SiteNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticNetworkTraces", "networkTraces", "networkTraces"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_sitenetworktrace_test.go b/resource-manager/web/2023-12-01/webapps/id_sitenetworktrace_test.go index 29300cecd7f..92c51e2118f 100644 --- a/resource-manager/web/2023-12-01/webapps/id_sitenetworktrace_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_sitenetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteNetworkTraceId{} func TestNewSiteNetworkTraceID(t *testing.T) { - id := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId") + id := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSiteNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.OperationId != "operationId" { @@ -32,8 +32,8 @@ func TestNewSiteNetworkTraceID(t *testing.T) { } func TestFormatSiteNetworkTraceID(t *testing.T) { - actual := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId" + actual := NewSiteNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSiteNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSiteNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/networkTraces/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs/oPeRaTiOnId", Expected: &SiteNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_siteslotnetworktrace.go b/resource-manager/web/2023-12-01/webapps/id_siteslotnetworktrace.go index e5bee7517a2..23fbbbb9eab 100644 --- a/resource-manager/web/2023-12-01/webapps/id_siteslotnetworktrace.go +++ b/resource-manager/web/2023-12-01/webapps/id_siteslotnetworktrace.go @@ -127,9 +127,9 @@ func (id SiteSlotNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkTraces", "networkTraces", "networkTraces"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_siteslotnetworktrace_test.go b/resource-manager/web/2023-12-01/webapps/id_siteslotnetworktrace_test.go index f3c78909b42..33e3ff66202 100644 --- a/resource-manager/web/2023-12-01/webapps/id_siteslotnetworktrace_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_siteslotnetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SiteSlotNetworkTraceId{} func TestNewSiteSlotNetworkTraceID(t *testing.T) { - id := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") + id := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSiteSlotNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.OperationId != "operationId" { @@ -36,8 +36,8 @@ func TestNewSiteSlotNetworkTraceID(t *testing.T) { } func TestFormatSiteSlotNetworkTraceID(t *testing.T) { - actual := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId" + actual := NewSiteSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSiteSlotNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSiteSlotNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTraces/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTraces/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs/oPeRaTiOnId", Expected: &SiteSlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcEs/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcEs/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slot.go b/resource-manager/web/2023-12-01/webapps/id_slot.go index 8e908291c1b..620b8a931e0 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slot.go +++ b/resource-manager/web/2023-12-01/webapps/id_slot.go @@ -123,7 +123,7 @@ func (id SlotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticSites", "sites", "sites"), resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slot_test.go b/resource-manager/web/2023-12-01/webapps/id_slot_test.go index 9c612d86b14..4ef0619f083 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slot_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotId{} func TestNewSlotID(t *testing.T) { - id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot") + id := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -26,14 +26,14 @@ func TestNewSlotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } } func TestFormatSlotID(t *testing.T) { - actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slot").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot" + actual := NewSlotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -97,17 +97,17 @@ func TestParseSlotID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, } @@ -248,32 +248,32 @@ func TestParseSlotIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", SiteName: "siteName", - SlotName: "slot", + SlotName: "slotName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slot/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Expected: &SlotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", SiteName: "sItEnAmE", - SlotName: "sLoT", + SlotName: "sLoTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoT/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotbackup.go b/resource-manager/web/2023-12-01/webapps/id_slotbackup.go index a528a2b155a..1aa5199ef05 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotbackup.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotbackup.go @@ -127,9 +127,9 @@ func (id SlotBackupId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticBackups", "backups", "backups"), resourceids.UserSpecifiedSegment("backupId", "backupId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotbackup_test.go b/resource-manager/web/2023-12-01/webapps/id_slotbackup_test.go index d6aa3483217..56eb5f5933f 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotbackup_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotbackup_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotBackupId{} func TestNewSlotBackupID(t *testing.T) { - id := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId") + id := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotBackupID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.BackupId != "backupId" { @@ -36,8 +36,8 @@ func TestNewSlotBackupID(t *testing.T) { } func TestFormatSlotBackupID(t *testing.T) { - actual := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "backupId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId" + actual := NewSlotBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "backupId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotBackupID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotBackupIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", BackupId: "backupId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/backups/backupId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/backups/backupId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs/bAcKuPiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs/bAcKuPiD", Expected: &SlotBackupId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", BackupId: "bAcKuPiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/bAcKuPs/bAcKuPiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/bAcKuPs/bAcKuPiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotcontinuouswebjob.go b/resource-manager/web/2023-12-01/webapps/id_slotcontinuouswebjob.go index 949c806fd72..6ca39c98b2e 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotcontinuouswebjob.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotcontinuouswebjob.go @@ -127,11 +127,11 @@ func (id SlotContinuousWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticContinuousWebJobs", "continuousWebJobs", "continuousWebJobs"), - resourceids.UserSpecifiedSegment("continuousWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("continuousWebJobName", "continuousWebJobName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotcontinuouswebjob_test.go b/resource-manager/web/2023-12-01/webapps/id_slotcontinuouswebjob_test.go index 9392d248c38..94be6b075f1 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotcontinuouswebjob_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotcontinuouswebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotContinuousWebJobId{} func TestNewSlotContinuousWebJobID(t *testing.T) { - id := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotContinuousWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.ContinuousWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "webJobName") + if id.ContinuousWebJobName != "continuousWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'ContinuousWebJobName'", id.ContinuousWebJobName, "continuousWebJobName") } } func TestFormatSlotContinuousWebJobID(t *testing.T) { - actual := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName" + actual := NewSlotContinuousWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "continuousWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotContinuousWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotContinuousWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - ContinuousWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + ContinuousWebJobName: "continuousWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/continuousWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/continuousWebJobs/continuousWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE", Expected: &SlotContinuousWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - ContinuousWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + ContinuousWebJobName: "cOnTiNuOuSwEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnTiNuOuSwEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnTiNuOuSwEbJoBs/cOnTiNuOuSwEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotdeployment.go b/resource-manager/web/2023-12-01/webapps/id_slotdeployment.go index a3dfd649a34..fe789dce200 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotdeployment.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotdeployment.go @@ -127,11 +127,11 @@ func (id SlotDeploymentId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDeployments", "deployments", "deployments"), - resourceids.UserSpecifiedSegment("deploymentName", "id"), + resourceids.UserSpecifiedSegment("deploymentName", "deploymentName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotdeployment_test.go b/resource-manager/web/2023-12-01/webapps/id_slotdeployment_test.go index aaeb2a4752e..2ddd1a03e78 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotdeployment_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotdeployment_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDeploymentId{} func TestNewSlotDeploymentID(t *testing.T) { - id := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id") + id := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotDeploymentID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.DeploymentName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "id") + if id.DeploymentName != "deploymentName" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentName'", id.DeploymentName, "deploymentName") } } func TestFormatSlotDeploymentID(t *testing.T) { - actual := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id" + actual := NewSlotDeploymentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "deploymentName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotDeploymentID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DeploymentName: "id", + SiteName: "siteName", + SlotName: "slotName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotDeploymentIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - DeploymentName: "id", + SiteName: "siteName", + SlotName: "slotName", + DeploymentName: "deploymentName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/deployments/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/deployments/deploymentName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE", Expected: &SlotDeploymentId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - DeploymentName: "iD", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + DeploymentName: "dEpLoYmEnTnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dEpLoYmEnTs/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dEpLoYmEnTs/dEpLoYmEnTnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotdomainownershipidentifier.go b/resource-manager/web/2023-12-01/webapps/id_slotdomainownershipidentifier.go index 2fc8d9e44ed..1dbb4307122 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotdomainownershipidentifier.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotdomainownershipidentifier.go @@ -127,9 +127,9 @@ func (id SlotDomainOwnershipIdentifierId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticDomainOwnershipIdentifiers", "domainOwnershipIdentifiers", "domainOwnershipIdentifiers"), resourceids.UserSpecifiedSegment("domainOwnershipIdentifierName", "domainOwnershipIdentifierName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotdomainownershipidentifier_test.go b/resource-manager/web/2023-12-01/webapps/id_slotdomainownershipidentifier_test.go index 440a035b88d..7be0f127472 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotdomainownershipidentifier_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotdomainownershipidentifier_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotDomainOwnershipIdentifierId{} func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { - id := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName") + id := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.DomainOwnershipIdentifierName != "domainOwnershipIdentifierName" { @@ -36,8 +36,8 @@ func TestNewSlotDomainOwnershipIdentifierID(t *testing.T) { } func TestFormatSlotDomainOwnershipIdentifierID(t *testing.T) { - actual := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "domainOwnershipIdentifierName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName" + actual := NewSlotDomainOwnershipIdentifierID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "domainOwnershipIdentifierName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotDomainOwnershipIdentifierID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotDomainOwnershipIdentifierIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", DomainOwnershipIdentifierName: "domainOwnershipIdentifierName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/domainOwnershipIdentifiers/domainOwnershipIdentifierName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe", Expected: &SlotDomainOwnershipIdentifierId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", DomainOwnershipIdentifierName: "dOmAiNoWnErShIpIdEnTiFiErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/dOmAiNoWnErShIpIdEnTiFiErS/dOmAiNoWnErShIpIdEnTiFiErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotfunction.go b/resource-manager/web/2023-12-01/webapps/id_slotfunction.go index 117c18780b1..2f9cba6eccc 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotfunction.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotfunction.go @@ -127,9 +127,9 @@ func (id SlotFunctionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticFunctions", "functions", "functions"), resourceids.UserSpecifiedSegment("functionName", "functionName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotfunction_test.go b/resource-manager/web/2023-12-01/webapps/id_slotfunction_test.go index 37def86173d..10315a35c83 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotfunction_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotfunction_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotFunctionId{} func TestNewSlotFunctionID(t *testing.T) { - id := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName") + id := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotFunctionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.FunctionName != "functionName" { @@ -36,8 +36,8 @@ func TestNewSlotFunctionID(t *testing.T) { } func TestFormatSlotFunctionID(t *testing.T) { - actual := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "functionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName" + actual := NewSlotFunctionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "functionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotFunctionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotFunctionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", FunctionName: "functionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/functions/functionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/functions/functionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE", Expected: &SlotFunctionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", FunctionName: "fUnCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/fUnCtIoNs/fUnCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/fUnCtIoNs/fUnCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slothostnamebinding.go b/resource-manager/web/2023-12-01/webapps/id_slothostnamebinding.go index 23702df5875..590d01a4bae 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slothostnamebinding.go +++ b/resource-manager/web/2023-12-01/webapps/id_slothostnamebinding.go @@ -127,11 +127,11 @@ func (id SlotHostNameBindingId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHostNameBindings", "hostNameBindings", "hostNameBindings"), - resourceids.UserSpecifiedSegment("hostNameBindingName", "hostName"), + resourceids.UserSpecifiedSegment("hostNameBindingName", "hostNameBindingName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slothostnamebinding_test.go b/resource-manager/web/2023-12-01/webapps/id_slothostnamebinding_test.go index fa3cbece3e1..d0e372c31e3 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slothostnamebinding_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slothostnamebinding_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHostNameBindingId{} func TestNewSlotHostNameBindingID(t *testing.T) { - id := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName") + id := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotHostNameBindingID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HostNameBindingName != "hostName" { - t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostName") + if id.HostNameBindingName != "hostNameBindingName" { + t.Fatalf("Expected %q but got %q for Segment 'HostNameBindingName'", id.HostNameBindingName, "hostNameBindingName") } } func TestFormatSlotHostNameBindingID(t *testing.T) { - actual := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "hostName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName" + actual := NewSlotHostNameBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hostNameBindingName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotHostNameBindingID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HostNameBindingName: "hostName", + SiteName: "siteName", + SlotName: "slotName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotHostNameBindingIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HostNameBindingName: "hostName", + SiteName: "siteName", + SlotName: "slotName", + HostNameBindingName: "hostNameBindingName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hostNameBindings/hostName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hostNameBindings/hostNameBindingName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS/hOsTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe", Expected: &SlotHostNameBindingId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HostNameBindingName: "hOsTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HostNameBindingName: "hOsTnAmEbInDiNgNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hOsTnAmEbInDiNgS/hOsTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hOsTnAmEbInDiNgS/hOsTnAmEbInDiNgNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slothybridconnection.go b/resource-manager/web/2023-12-01/webapps/id_slothybridconnection.go index 798ce3487e9..c5a95c89142 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slothybridconnection.go +++ b/resource-manager/web/2023-12-01/webapps/id_slothybridconnection.go @@ -127,11 +127,11 @@ func (id SlotHybridConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHybridConnection", "hybridConnection", "hybridConnection"), - resourceids.UserSpecifiedSegment("hybridConnectionName", "entityName"), + resourceids.UserSpecifiedSegment("hybridConnectionName", "hybridConnectionName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slothybridconnection_test.go b/resource-manager/web/2023-12-01/webapps/id_slothybridconnection_test.go index 93c812ff478..30653e42594 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slothybridconnection_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slothybridconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHybridConnectionId{} func TestNewSlotHybridConnectionID(t *testing.T) { - id := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName") + id := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotHybridConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HybridConnectionName != "entityName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "entityName") + if id.HybridConnectionName != "hybridConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionName'", id.HybridConnectionName, "hybridConnectionName") } } func TestFormatSlotHybridConnectionID(t *testing.T) { - actual := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "entityName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName" + actual := NewSlotHybridConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotHybridConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionName: "entityName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotHybridConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionName: "entityName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionName: "hybridConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnection/entityName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnection/hybridConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN/eNtItYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE", Expected: &SlotHybridConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HybridConnectionName: "eNtItYnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HybridConnectionName: "hYbRiDcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoN/eNtItYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoN/hYbRiDcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slothybridconnectionnamespacerelay.go b/resource-manager/web/2023-12-01/webapps/id_slothybridconnectionnamespacerelay.go index a371c335ce1..f2a53e559e0 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slothybridconnectionnamespacerelay.go +++ b/resource-manager/web/2023-12-01/webapps/id_slothybridconnectionnamespacerelay.go @@ -133,11 +133,11 @@ func (id SlotHybridConnectionNamespaceRelayId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticHybridConnectionNamespaces", "hybridConnectionNamespaces", "hybridConnectionNamespaces"), - resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "namespaceName"), + resourceids.UserSpecifiedSegment("hybridConnectionNamespaceName", "hybridConnectionNamespaceName"), resourceids.StaticSegment("staticRelays", "relays", "relays"), resourceids.UserSpecifiedSegment("relayName", "relayName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slothybridconnectionnamespacerelay_test.go b/resource-manager/web/2023-12-01/webapps/id_slothybridconnectionnamespacerelay_test.go index 1f6db182908..c668d1e93bc 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slothybridconnectionnamespacerelay_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slothybridconnectionnamespacerelay_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotHybridConnectionNamespaceRelayId{} func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { - id := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName") + id := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.HybridConnectionNamespaceName != "namespaceName" { - t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "namespaceName") + if id.HybridConnectionNamespaceName != "hybridConnectionNamespaceName" { + t.Fatalf("Expected %q but got %q for Segment 'HybridConnectionNamespaceName'", id.HybridConnectionNamespaceName, "hybridConnectionNamespaceName") } if id.RelayName != "relayName" { @@ -40,8 +40,8 @@ func TestNewSlotHybridConnectionNamespaceRelayID(t *testing.T) { } func TestFormatSlotHybridConnectionNamespaceRelayID(t *testing.T) { - actual := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "namespaceName", "relayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName" + actual := NewSlotHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "hybridConnectionNamespaceName", "relayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotHybridConnectionNamespaceRelayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotHybridConnectionNamespaceRelayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - HybridConnectionNamespaceName: "namespaceName", + SiteName: "siteName", + SlotName: "slotName", + HybridConnectionNamespaceName: "hybridConnectionNamespaceName", RelayName: "relayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/hybridConnectionNamespaces/namespaceName/relays/relayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/hybridConnectionNamespaces/hybridConnectionNamespaceName/relays/relayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe", Expected: &SlotHybridConnectionNamespaceRelayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - HybridConnectionNamespaceName: "nAmEsPaCeNaMe", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + HybridConnectionNamespaceName: "hYbRiDcOnNeCtIoNnAmEsPaCeNaMe", RelayName: "rElAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/hYbRiDcOnNeCtIoNnAmEsPaCeS/nAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/hYbRiDcOnNeCtIoNnAmEsPaCeS/hYbRiDcOnNeCtIoNnAmEsPaCeNaMe/rElAyS/rElAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotinstance.go b/resource-manager/web/2023-12-01/webapps/id_slotinstance.go index d381e0805a5..f6a4b514211 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotinstance.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotinstance.go @@ -127,9 +127,9 @@ func (id SlotInstanceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotinstance_test.go b/resource-manager/web/2023-12-01/webapps/id_slotinstance_test.go index 0474185ff1a..2bd26deb6ee 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotinstance_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotinstance_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceId{} func TestNewSlotInstanceID(t *testing.T) { - id := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId") + id := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -36,8 +36,8 @@ func TestNewSlotInstanceID(t *testing.T) { } func TestFormatSlotInstanceID(t *testing.T) { - actual := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId" + actual := NewSlotInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotInstanceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotInstanceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Expected: &SlotInstanceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocess.go b/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocess.go index c4580926136..7459e303aab 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocess.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocess.go @@ -133,9 +133,9 @@ func (id SlotInstanceProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), diff --git a/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocess_test.go b/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocess_test.go index 414ffd27054..c10bc2a0fc1 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocess_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceProcessId{} func TestNewSlotInstanceProcessID(t *testing.T) { - id := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId") + id := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -40,8 +40,8 @@ func TestNewSlotInstanceProcessID(t *testing.T) { } func TestFormatSlotInstanceProcessID(t *testing.T) { - actual := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId" + actual := NewSlotInstanceProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotInstanceProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotInstanceProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Expected: &SlotInstanceProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocessmodule.go b/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocessmodule.go index a8a8a21466b..ec90a897094 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocessmodule.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocessmodule.go @@ -139,15 +139,15 @@ func (id SlotInstanceProcessModuleId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticInstances", "instances", "instances"), resourceids.UserSpecifiedSegment("instanceId", "instanceId"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), resourceids.StaticSegment("staticModules", "modules", "modules"), - resourceids.UserSpecifiedSegment("moduleName", "baseAddress"), + resourceids.UserSpecifiedSegment("moduleName", "moduleName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocessmodule_test.go b/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocessmodule_test.go index db39b7040d2..109eb72ff25 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocessmodule_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotinstanceprocessmodule_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotInstanceProcessModuleId{} func TestNewSlotInstanceProcessModuleID(t *testing.T) { - id := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress") + id := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.InstanceId != "instanceId" { @@ -38,14 +38,14 @@ func TestNewSlotInstanceProcessModuleID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ProcessId'", id.ProcessId, "processId") } - if id.ModuleName != "baseAddress" { - t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "baseAddress") + if id.ModuleName != "moduleName" { + t.Fatalf("Expected %q but got %q for Segment 'ModuleName'", id.ModuleName, "moduleName") } } func TestFormatSlotInstanceProcessModuleID(t *testing.T) { - actual := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "instanceId", "processId", "baseAddress").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress" + actual := NewSlotInstanceProcessModuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "instanceId", "processId", "moduleName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,60 +99,60 @@ func TestParseSlotInstanceProcessModuleID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, } @@ -285,118 +285,118 @@ func TestParseSlotInstanceProcessModuleIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", InstanceId: "instanceId", ProcessId: "processId", - ModuleName: "baseAddress", + ModuleName: "moduleName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/instances/instanceId/processes/processId/modules/baseAddress/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/instances/instanceId/processes/processId/modules/moduleName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE", Expected: &SlotInstanceProcessModuleId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", InstanceId: "iNsTaNcEiD", ProcessId: "pRoCeSsId", - ModuleName: "bAsEaDdReSs", + ModuleName: "mOdUlEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/bAsEaDdReSs/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/iNsTaNcEs/iNsTaNcEiD/pRoCeSsEs/pRoCeSsId/mOdUlEs/mOdUlEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotnetworkfeature.go b/resource-manager/web/2023-12-01/webapps/id_slotnetworkfeature.go index 4001e74bc53..507114a0bf1 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotnetworkfeature.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotnetworkfeature.go @@ -127,11 +127,11 @@ func (id SlotNetworkFeatureId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkFeatures", "networkFeatures", "networkFeatures"), - resourceids.UserSpecifiedSegment("networkFeatureName", "view"), + resourceids.UserSpecifiedSegment("networkFeatureName", "networkFeatureName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotnetworkfeature_test.go b/resource-manager/web/2023-12-01/webapps/id_slotnetworkfeature_test.go index 81f6d914134..3b0cebea96b 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotnetworkfeature_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotnetworkfeature_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotNetworkFeatureId{} func TestNewSlotNetworkFeatureID(t *testing.T) { - id := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view") + id := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotNetworkFeatureID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.NetworkFeatureName != "view" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "view") + if id.NetworkFeatureName != "networkFeatureName" { + t.Fatalf("Expected %q but got %q for Segment 'NetworkFeatureName'", id.NetworkFeatureName, "networkFeatureName") } } func TestFormatSlotNetworkFeatureID(t *testing.T) { - actual := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "view").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view" + actual := NewSlotNetworkFeatureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "networkFeatureName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotNetworkFeatureID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - NetworkFeatureName: "view", + SiteName: "siteName", + SlotName: "slotName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotNetworkFeatureIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - NetworkFeatureName: "view", + SiteName: "siteName", + SlotName: "slotName", + NetworkFeatureName: "networkFeatureName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkFeatures/view/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkFeatures/networkFeatureName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs/vIeW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE", Expected: &SlotNetworkFeatureId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - NetworkFeatureName: "vIeW", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + NetworkFeatureName: "nEtWoRkFeAtUrEnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkFeAtUrEs/vIeW/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkFeAtUrEs/nEtWoRkFeAtUrEnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotnetworktrace.go b/resource-manager/web/2023-12-01/webapps/id_slotnetworktrace.go index 6bdb88e307e..4e4dd73328e 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotnetworktrace.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotnetworktrace.go @@ -127,9 +127,9 @@ func (id SlotNetworkTraceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticNetworkTrace", "networkTrace", "networkTrace"), resourceids.UserSpecifiedSegment("operationId", "operationId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotnetworktrace_test.go b/resource-manager/web/2023-12-01/webapps/id_slotnetworktrace_test.go index f15a990c005..ef938f160c3 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotnetworktrace_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotnetworktrace_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotNetworkTraceId{} func TestNewSlotNetworkTraceID(t *testing.T) { - id := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId") + id := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotNetworkTraceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.OperationId != "operationId" { @@ -36,8 +36,8 @@ func TestNewSlotNetworkTraceID(t *testing.T) { } func TestFormatSlotNetworkTraceID(t *testing.T) { - actual := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "operationId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId" + actual := NewSlotNetworkTraceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "operationId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotNetworkTraceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotNetworkTraceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", OperationId: "operationId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/networkTrace/operationId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/networkTrace/operationId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE/oPeRaTiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE/oPeRaTiOnId", Expected: &SlotNetworkTraceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", OperationId: "oPeRaTiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/nEtWoRkTrAcE/oPeRaTiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/nEtWoRkTrAcE/oPeRaTiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotpremieraddon.go b/resource-manager/web/2023-12-01/webapps/id_slotpremieraddon.go index f5dc8ec000c..ca4498c2e93 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotpremieraddon.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotpremieraddon.go @@ -127,11 +127,11 @@ func (id SlotPremierAddonId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPremierAddons", "premierAddons", "premierAddons"), - resourceids.UserSpecifiedSegment("premierAddonName", "premierAddOnName"), + resourceids.UserSpecifiedSegment("premierAddonName", "premierAddonName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotpremieraddon_test.go b/resource-manager/web/2023-12-01/webapps/id_slotpremieraddon_test.go index abc889fbb30..c6094e0240f 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotpremieraddon_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotpremieraddon_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPremierAddonId{} func TestNewSlotPremierAddonID(t *testing.T) { - id := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName") + id := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotPremierAddonID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.PremierAddonName != "premierAddOnName" { - t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddOnName") + if id.PremierAddonName != "premierAddonName" { + t.Fatalf("Expected %q but got %q for Segment 'PremierAddonName'", id.PremierAddonName, "premierAddonName") } } func TestFormatSlotPremierAddonID(t *testing.T) { - actual := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "premierAddOnName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName" + actual := NewSlotPremierAddonID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "premierAddonName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPremierAddonID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + SlotName: "slotName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPremierAddonIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - PremierAddonName: "premierAddOnName", + SiteName: "siteName", + SlotName: "slotName", + PremierAddonName: "premierAddonName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/premierAddons/premierAddOnName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/premierAddons/premierAddonName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs/pReMiErAdDoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE", Expected: &SlotPremierAddonId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PremierAddonName: "pReMiErAdDoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pReMiErAdDoNs/pReMiErAdDoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotprivateendpointconnection.go b/resource-manager/web/2023-12-01/webapps/id_slotprivateendpointconnection.go index 0038074356f..7a29bd7cb8b 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotprivateendpointconnection.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotprivateendpointconnection.go @@ -127,9 +127,9 @@ func (id SlotPrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotprivateendpointconnection_test.go b/resource-manager/web/2023-12-01/webapps/id_slotprivateendpointconnection_test.go index 0315e7236cd..b7c1bd2958c 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotprivateendpointconnection_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotprivateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPrivateEndpointConnectionId{} func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { - id := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName") + id := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -36,8 +36,8 @@ func TestNewSlotPrivateEndpointConnectionID(t *testing.T) { } func TestFormatSlotPrivateEndpointConnectionID(t *testing.T) { - actual := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName" + actual := NewSlotPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &SlotPrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotprocess.go b/resource-manager/web/2023-12-01/webapps/id_slotprocess.go index 731a1ee2e66..98487bec6fc 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotprocess.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotprocess.go @@ -127,9 +127,9 @@ func (id SlotProcessId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticProcesses", "processes", "processes"), resourceids.UserSpecifiedSegment("processId", "processId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotprocess_test.go b/resource-manager/web/2023-12-01/webapps/id_slotprocess_test.go index 147a7d6c37a..79324e032ca 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotprocess_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotprocess_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotProcessId{} func TestNewSlotProcessID(t *testing.T) { - id := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId") + id := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotProcessID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.ProcessId != "processId" { @@ -36,8 +36,8 @@ func TestNewSlotProcessID(t *testing.T) { } func TestFormatSlotProcessID(t *testing.T) { - actual := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "processId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId" + actual := NewSlotProcessID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "processId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotProcessID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotProcessIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", ProcessId: "processId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/processes/processId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/processes/processId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId", Expected: &SlotProcessId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", ProcessId: "pRoCeSsId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pRoCeSsEs/pRoCeSsId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pRoCeSsEs/pRoCeSsId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotpubliccertificate.go b/resource-manager/web/2023-12-01/webapps/id_slotpubliccertificate.go index ae44caa811b..45ded508c35 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotpubliccertificate.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotpubliccertificate.go @@ -127,9 +127,9 @@ func (id SlotPublicCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticPublicCertificates", "publicCertificates", "publicCertificates"), resourceids.UserSpecifiedSegment("publicCertificateName", "publicCertificateName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotpubliccertificate_test.go b/resource-manager/web/2023-12-01/webapps/id_slotpubliccertificate_test.go index bb6c2deaa4c..31f3e81c0fb 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotpubliccertificate_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotpubliccertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotPublicCertificateId{} func TestNewSlotPublicCertificateID(t *testing.T) { - id := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName") + id := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotPublicCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.PublicCertificateName != "publicCertificateName" { @@ -36,8 +36,8 @@ func TestNewSlotPublicCertificateID(t *testing.T) { } func TestFormatSlotPublicCertificateID(t *testing.T) { - actual := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "publicCertificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName" + actual := NewSlotPublicCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "publicCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotPublicCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotPublicCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", PublicCertificateName: "publicCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/publicCertificates/publicCertificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/publicCertificates/publicCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe", Expected: &SlotPublicCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", PublicCertificateName: "pUbLiCcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/pUbLiCcErTiFiCaTeS/pUbLiCcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotsitecontainer.go b/resource-manager/web/2023-12-01/webapps/id_slotsitecontainer.go index 51389b2253c..b1b7bd75011 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotsitecontainer.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotsitecontainer.go @@ -127,11 +127,11 @@ func (id SlotSitecontainerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticSitecontainers", "sitecontainers", "sitecontainers"), - resourceids.UserSpecifiedSegment("sitecontainerName", "containerName"), + resourceids.UserSpecifiedSegment("sitecontainerName", "sitecontainerName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotsitecontainer_test.go b/resource-manager/web/2023-12-01/webapps/id_slotsitecontainer_test.go index a7449eaf34e..c09df8600ea 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotsitecontainer_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotsitecontainer_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotSitecontainerId{} func TestNewSlotSitecontainerID(t *testing.T) { - id := NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "containerName") + id := NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "sitecontainerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotSitecontainerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.SitecontainerName != "containerName" { - t.Fatalf("Expected %q but got %q for Segment 'SitecontainerName'", id.SitecontainerName, "containerName") + if id.SitecontainerName != "sitecontainerName" { + t.Fatalf("Expected %q but got %q for Segment 'SitecontainerName'", id.SitecontainerName, "sitecontainerName") } } func TestFormatSlotSitecontainerID(t *testing.T) { - actual := NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "containerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/sitecontainers/containerName" + actual := NewSlotSitecontainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "sitecontainerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/sitecontainers/sitecontainerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotSitecontainerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/sitecontainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/sitecontainers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/sitecontainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/sitecontainers/sitecontainerName", Expected: &SlotSitecontainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - SitecontainerName: "containerName", + SiteName: "siteName", + SlotName: "slotName", + SitecontainerName: "sitecontainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/sitecontainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/sitecontainers/sitecontainerName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotSitecontainerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/sitecontainers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/sitecontainers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEcOnTaInErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEcOnTaInErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/sitecontainers/containerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/sitecontainers/sitecontainerName", Expected: &SlotSitecontainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - SitecontainerName: "containerName", + SiteName: "siteName", + SlotName: "slotName", + SitecontainerName: "sitecontainerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/sitecontainers/containerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/sitecontainers/sitecontainerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEcOnTaInErS/cOnTaInErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEcOnTaInErS/sItEcOnTaInErNaMe", Expected: &SlotSitecontainerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - SitecontainerName: "cOnTaInErNaMe", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + SitecontainerName: "sItEcOnTaInErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEcOnTaInErS/cOnTaInErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEcOnTaInErS/sItEcOnTaInErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotsiteextension.go b/resource-manager/web/2023-12-01/webapps/id_slotsiteextension.go index 7c1f34a4ad9..5df295c09ba 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotsiteextension.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotsiteextension.go @@ -127,9 +127,9 @@ func (id SlotSiteExtensionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticSiteExtensions", "siteExtensions", "siteExtensions"), resourceids.UserSpecifiedSegment("siteExtensionId", "siteExtensionId"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotsiteextension_test.go b/resource-manager/web/2023-12-01/webapps/id_slotsiteextension_test.go index bfd22d9db4a..732d09fb195 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotsiteextension_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotsiteextension_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotSiteExtensionId{} func TestNewSlotSiteExtensionID(t *testing.T) { - id := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId") + id := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotSiteExtensionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.SiteExtensionId != "siteExtensionId" { @@ -36,8 +36,8 @@ func TestNewSlotSiteExtensionID(t *testing.T) { } func TestFormatSlotSiteExtensionID(t *testing.T) { - actual := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "siteExtensionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId" + actual := NewSlotSiteExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "siteExtensionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotSiteExtensionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotSiteExtensionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SiteExtensionId: "siteExtensionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/siteExtensions/siteExtensionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/siteExtensions/siteExtensionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS/sItEeXtEnSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId", Expected: &SlotSiteExtensionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", SiteExtensionId: "sItEeXtEnSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/sItEeXtEnSiOnS/sItEeXtEnSiOnId/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slottriggeredwebjob.go b/resource-manager/web/2023-12-01/webapps/id_slottriggeredwebjob.go index f28f3ec88d1..48ba81d16d3 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slottriggeredwebjob.go +++ b/resource-manager/web/2023-12-01/webapps/id_slottriggeredwebjob.go @@ -127,11 +127,11 @@ func (id SlotTriggeredWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slottriggeredwebjob_test.go b/resource-manager/web/2023-12-01/webapps/id_slottriggeredwebjob_test.go index 5fa0bda4915..c7f66afaa1e 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slottriggeredwebjob_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slottriggeredwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotTriggeredWebJobId{} func TestNewSlotTriggeredWebJobID(t *testing.T) { - id := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotTriggeredWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } } func TestFormatSlotTriggeredWebJobID(t *testing.T) { - actual := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName" + actual := NewSlotTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotTriggeredWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotTriggeredWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Expected: &SlotTriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - TriggeredWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnection.go b/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnection.go index fccaab21b92..637d36cce57 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnection.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnection.go @@ -127,11 +127,11 @@ func (id SlotVirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnection_test.go b/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnection_test.go index e5b2487668b..623d47d5691 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnection_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotVirtualNetworkConnectionId{} func TestNewSlotVirtualNetworkConnectionID(t *testing.T) { - id := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName") + id := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,22 +22,22 @@ func TestNewSlotVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatSlotVirtualNetworkConnectionID(t *testing.T) { - actual := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName" + actual := NewSlotVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &SlotVirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnectiongateway.go b/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnectiongateway.go index bf748a07cfc..8f808a13188 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnectiongateway.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnectiongateway.go @@ -133,11 +133,11 @@ func (id SlotVirtualNetworkConnectionGatewayId) Segments() []resourceids.Segment resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), resourceids.StaticSegment("staticGateways", "gateways", "gateways"), resourceids.UserSpecifiedSegment("gatewayName", "gatewayName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go b/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go index c577c8452f4..34baec3c9ca 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotvirtualnetworkconnectiongateway_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotVirtualNetworkConnectionGatewayId{} func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { - id := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName") + id := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,16 +22,16 @@ func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } if id.GatewayName != "gatewayName" { @@ -40,8 +40,8 @@ func TestNewSlotVirtualNetworkConnectionGatewayID(t *testing.T) { } func TestFormatSlotVirtualNetworkConnectionGatewayID(t *testing.T) { - actual := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "vnetName", "gatewayName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName" + actual := NewSlotVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "virtualNetworkConnectionName", "gatewayName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseSlotVirtualNetworkConnectionGatewayID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseSlotVirtualNetworkConnectionGatewayIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + SlotName: "slotName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", GatewayName: "gatewayName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/virtualNetworkConnections/vnetName/gateways/gatewayName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/virtualNetworkConnections/virtualNetworkConnectionName/gateways/gatewayName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe", Expected: &SlotVirtualNetworkConnectionGatewayId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", GatewayName: "gAtEwAyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/gAtEwAyS/gAtEwAyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/gAtEwAyS/gAtEwAyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotwebjob.go b/resource-manager/web/2023-12-01/webapps/id_slotwebjob.go index 0c98bdee120..e9ea5bb00fb 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotwebjob.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotwebjob.go @@ -127,9 +127,9 @@ func (id SlotWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticWebJobs", "webJobs", "webJobs"), resourceids.UserSpecifiedSegment("webJobName", "webJobName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotwebjob_test.go b/resource-manager/web/2023-12-01/webapps/id_slotwebjob_test.go index cce85f520c8..66396ef164e 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotwebjob_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotWebJobId{} func TestNewSlotWebJobID(t *testing.T) { - id := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName") + id := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.WebJobName != "webJobName" { @@ -36,8 +36,8 @@ func TestNewSlotWebJobID(t *testing.T) { } func TestFormatSlotWebJobID(t *testing.T) { - actual := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName" + actual := NewSlotWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "webJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/webJobs/webJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs/wEbJoBnAmE", Expected: &SlotWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", WebJobName: "wEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wEbJoBs/wEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotworkflow.go b/resource-manager/web/2023-12-01/webapps/id_slotworkflow.go index dd9b29180f7..a14291749c9 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotworkflow.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotworkflow.go @@ -127,9 +127,9 @@ func (id SlotWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticWorkflows", "workflows", "workflows"), resourceids.UserSpecifiedSegment("workflowName", "workflowName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_slotworkflow_test.go b/resource-manager/web/2023-12-01/webapps/id_slotworkflow_test.go index 07f0fdb4bd4..dea7721f260 100644 --- a/resource-manager/web/2023-12-01/webapps/id_slotworkflow_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_slotworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SlotWorkflowId{} func TestNewSlotWorkflowID(t *testing.T) { - id := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName") + id := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewSlotWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewSlotWorkflowID(t *testing.T) { } func TestFormatSlotWorkflowID(t *testing.T) { - actual := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName" + actual := NewSlotWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseSlotWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseSlotWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs/wOrKfLoWnAmE", Expected: &SlotWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_snapshot.go b/resource-manager/web/2023-12-01/webapps/id_snapshot.go index cbfb755361d..4d03d32a391 100644 --- a/resource-manager/web/2023-12-01/webapps/id_snapshot.go +++ b/resource-manager/web/2023-12-01/webapps/id_snapshot.go @@ -121,7 +121,7 @@ func (id SnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticWeb", "web", "web"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/web/2023-12-01/webapps/id_snapshot_test.go b/resource-manager/web/2023-12-01/webapps/id_snapshot_test.go index 13b12663c83..266ebd16516 100644 --- a/resource-manager/web/2023-12-01/webapps/id_snapshot_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_snapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SnapshotId{} func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId") + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.SnapshotId != "snapshotId" { @@ -32,8 +32,8 @@ func TestNewSnapshotID(t *testing.T) { } func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "snapshotId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId" + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "snapshotId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,37 +87,37 @@ func TestParseSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId/extra", Error: true, }, } @@ -238,72 +238,72 @@ func TestParseSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/config/web/snapshots/snapshotId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", Expected: &SnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", SnapshotId: "sNaPsHoTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_triggeredwebjob.go b/resource-manager/web/2023-12-01/webapps/id_triggeredwebjob.go index 81955b7012a..54e4277f8e3 100644 --- a/resource-manager/web/2023-12-01/webapps/id_triggeredwebjob.go +++ b/resource-manager/web/2023-12-01/webapps/id_triggeredwebjob.go @@ -121,9 +121,9 @@ func (id TriggeredWebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_triggeredwebjob_test.go b/resource-manager/web/2023-12-01/webapps/id_triggeredwebjob_test.go index 6d4534988a4..f3a39e32c7e 100644 --- a/resource-manager/web/2023-12-01/webapps/id_triggeredwebjob_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_triggeredwebjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggeredWebJobId{} func TestNewTriggeredWebJobID(t *testing.T) { - id := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewTriggeredWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } } func TestFormatTriggeredWebJobID(t *testing.T) { - actual := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName" + actual := NewTriggeredWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "triggeredWebJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseTriggeredWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseTriggeredWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - TriggeredWebJobName: "webJobName", + SiteName: "siteName", + TriggeredWebJobName: "triggeredWebJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/triggeredWebJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/triggeredWebJobs/triggeredWebJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Expected: &TriggeredWebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - TriggeredWebJobName: "wEbJoBnAmE", + SiteName: "sItEnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/tRiGgErEdWeBjObS/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_triggeredwebjobhistory.go b/resource-manager/web/2023-12-01/webapps/id_triggeredwebjobhistory.go index e9fa5c35137..d43eee154da 100644 --- a/resource-manager/web/2023-12-01/webapps/id_triggeredwebjobhistory.go +++ b/resource-manager/web/2023-12-01/webapps/id_triggeredwebjobhistory.go @@ -133,13 +133,13 @@ func (id TriggeredWebJobHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticTriggeredWebJobs", "triggeredWebJobs", "triggeredWebJobs"), - resourceids.UserSpecifiedSegment("triggeredWebJobName", "webJobName"), + resourceids.UserSpecifiedSegment("triggeredWebJobName", "triggeredWebJobName"), resourceids.StaticSegment("staticHistory", "history", "history"), - resourceids.UserSpecifiedSegment("historyName", "id"), + resourceids.UserSpecifiedSegment("historyName", "historyName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_triggeredwebjobhistory_test.go b/resource-manager/web/2023-12-01/webapps/id_triggeredwebjobhistory_test.go index b9f5366fbee..cf92a965a0a 100644 --- a/resource-manager/web/2023-12-01/webapps/id_triggeredwebjobhistory_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_triggeredwebjobhistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggeredWebJobHistoryId{} func TestNewTriggeredWebJobHistoryID(t *testing.T) { - id := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id") + id := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,26 +22,26 @@ func TestNewTriggeredWebJobHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } - if id.TriggeredWebJobName != "webJobName" { - t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "webJobName") + if id.TriggeredWebJobName != "triggeredWebJobName" { + t.Fatalf("Expected %q but got %q for Segment 'TriggeredWebJobName'", id.TriggeredWebJobName, "triggeredWebJobName") } - if id.HistoryName != "id" { - t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "id") + if id.HistoryName != "historyName" { + t.Fatalf("Expected %q but got %q for Segment 'HistoryName'", id.HistoryName, "historyName") } } func TestFormatTriggeredWebJobHistoryID(t *testing.T) { - actual := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "webJobName", "id").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id" + actual := NewTriggeredWebJobHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "triggeredWebJobName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,49 +95,49 @@ func TestParseTriggeredWebJobHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, } @@ -266,96 +266,96 @@ func TestParseTriggeredWebJobHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", - TriggeredWebJobName: "webJobName", - HistoryName: "id", + SiteName: "siteName", + SlotName: "slotName", + TriggeredWebJobName: "triggeredWebJobName", + HistoryName: "historyName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/triggeredWebJobs/webJobName/history/id/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/triggeredWebJobs/triggeredWebJobName/history/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe", Expected: &TriggeredWebJobHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", - TriggeredWebJobName: "wEbJoBnAmE", - HistoryName: "iD", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", + TriggeredWebJobName: "tRiGgErEdWeBjObNaMe", + HistoryName: "hIsToRyNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/tRiGgErEdWeBjObS/wEbJoBnAmE/hIsToRy/iD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/tRiGgErEdWeBjObS/tRiGgErEdWeBjObNaMe/hIsToRy/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_virtualnetworkconnection.go b/resource-manager/web/2023-12-01/webapps/id_virtualnetworkconnection.go index cfa8b7c17da..0ddc9e9dbc9 100644 --- a/resource-manager/web/2023-12-01/webapps/id_virtualnetworkconnection.go +++ b/resource-manager/web/2023-12-01/webapps/id_virtualnetworkconnection.go @@ -121,9 +121,9 @@ func (id VirtualNetworkConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticVirtualNetworkConnections", "virtualNetworkConnections", "virtualNetworkConnections"), - resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "vnetName"), + resourceids.UserSpecifiedSegment("virtualNetworkConnectionName", "virtualNetworkConnectionName"), } } diff --git a/resource-manager/web/2023-12-01/webapps/id_virtualnetworkconnection_test.go b/resource-manager/web/2023-12-01/webapps/id_virtualnetworkconnection_test.go index 3a30898c989..0696a175e00 100644 --- a/resource-manager/web/2023-12-01/webapps/id_virtualnetworkconnection_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_virtualnetworkconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VirtualNetworkConnectionId{} func TestNewVirtualNetworkConnectionID(t *testing.T) { - id := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName") + id := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewVirtualNetworkConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.VirtualNetworkConnectionName != "vnetName" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "vnetName") + if id.VirtualNetworkConnectionName != "virtualNetworkConnectionName" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkConnectionName'", id.VirtualNetworkConnectionName, "virtualNetworkConnectionName") } } func TestFormatVirtualNetworkConnectionID(t *testing.T) { - actual := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "vnetName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName" + actual := NewVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "virtualNetworkConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseVirtualNetworkConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseVirtualNetworkConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - VirtualNetworkConnectionName: "vnetName", + SiteName: "siteName", + VirtualNetworkConnectionName: "virtualNetworkConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/virtualNetworkConnections/vnetName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/virtualNetworkConnections/virtualNetworkConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE", Expected: &VirtualNetworkConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - VirtualNetworkConnectionName: "vNeTnAmE", + SiteName: "sItEnAmE", + VirtualNetworkConnectionName: "vIrTuAlNeTwOrKcOnNeCtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vNeTnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/vIrTuAlNeTwOrKcOnNeCtIoNs/vIrTuAlNeTwOrKcOnNeCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_webjob.go b/resource-manager/web/2023-12-01/webapps/id_webjob.go index b7a3e4b53e6..b79bed51622 100644 --- a/resource-manager/web/2023-12-01/webapps/id_webjob.go +++ b/resource-manager/web/2023-12-01/webapps/id_webjob.go @@ -121,7 +121,7 @@ func (id WebJobId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticWebJobs", "webJobs", "webJobs"), resourceids.UserSpecifiedSegment("webJobName", "webJobName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_webjob_test.go b/resource-manager/web/2023-12-01/webapps/id_webjob_test.go index 485279bdb97..092af0c8a38 100644 --- a/resource-manager/web/2023-12-01/webapps/id_webjob_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_webjob_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebJobId{} func TestNewWebJobID(t *testing.T) { - id := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName") + id := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWebJobID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WebJobName != "webJobName" { @@ -32,8 +32,8 @@ func TestNewWebJobID(t *testing.T) { } func TestFormatWebJobID(t *testing.T) { - actual := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "webJobName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName" + actual := NewWebJobID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "webJobName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWebJobID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWebJobIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WebJobName: "webJobName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/webJobs/webJobName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/webJobs/webJobName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs/wEbJoBnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs/wEbJoBnAmE", Expected: &WebJobId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WebJobName: "wEbJoBnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wEbJoBs/wEbJoBnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wEbJoBs/wEbJoBnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_websnapshot.go b/resource-manager/web/2023-12-01/webapps/id_websnapshot.go index f6bdfdba30b..f878f0869f5 100644 --- a/resource-manager/web/2023-12-01/webapps/id_websnapshot.go +++ b/resource-manager/web/2023-12-01/webapps/id_websnapshot.go @@ -127,9 +127,9 @@ func (id WebSnapshotId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticSlots", "slots", "slots"), - resourceids.UserSpecifiedSegment("slotName", "slot"), + resourceids.UserSpecifiedSegment("slotName", "slotName"), resourceids.StaticSegment("staticConfig", "config", "config"), resourceids.StaticSegment("staticWeb", "web", "web"), resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), diff --git a/resource-manager/web/2023-12-01/webapps/id_websnapshot_test.go b/resource-manager/web/2023-12-01/webapps/id_websnapshot_test.go index 6c2e08093c4..b63a5759cb5 100644 --- a/resource-manager/web/2023-12-01/webapps/id_websnapshot_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_websnapshot_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebSnapshotId{} func TestNewWebSnapshotID(t *testing.T) { - id := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId") + id := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,12 +22,12 @@ func TestNewWebSnapshotID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } - if id.SlotName != "slot" { - t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slot") + if id.SlotName != "slotName" { + t.Fatalf("Expected %q but got %q for Segment 'SlotName'", id.SlotName, "slotName") } if id.SnapshotId != "snapshotId" { @@ -36,8 +36,8 @@ func TestNewWebSnapshotID(t *testing.T) { } func TestFormatWebSnapshotID(t *testing.T) { - actual := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "slot", "snapshotId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId" + actual := NewWebSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "slotName", "snapshotId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,48 +91,48 @@ func TestParseWebSnapshotID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId/extra", Error: true, }, } @@ -257,94 +257,94 @@ func TestParseWebSnapshotIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", - SlotName: "slot", + SiteName: "siteName", + SlotName: "slotName", SnapshotId: "snapshotId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/slots/slot/config/web/snapshots/snapshotId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/slots/slotName/config/web/snapshots/snapshotId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD", Expected: &WebSnapshotId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", - SlotName: "sLoT", + SiteName: "sItEnAmE", + SlotName: "sLoTnAmE", SnapshotId: "sNaPsHoTiD", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/sLoTs/sLoT/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/sLoTs/sLoTnAmE/cOnFiG/wEb/sNaPsHoTs/sNaPsHoTiD/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/id_workflow.go b/resource-manager/web/2023-12-01/webapps/id_workflow.go index 61de52f6bbe..b0bd85b2a72 100644 --- a/resource-manager/web/2023-12-01/webapps/id_workflow.go +++ b/resource-manager/web/2023-12-01/webapps/id_workflow.go @@ -121,7 +121,7 @@ func (id WorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticWorkflows", "workflows", "workflows"), resourceids.UserSpecifiedSegment("workflowName", "workflowName"), } diff --git a/resource-manager/web/2023-12-01/webapps/id_workflow_test.go b/resource-manager/web/2023-12-01/webapps/id_workflow_test.go index ae2138b67c4..c687bb8ce0f 100644 --- a/resource-manager/web/2023-12-01/webapps/id_workflow_test.go +++ b/resource-manager/web/2023-12-01/webapps/id_workflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WorkflowId{} func TestNewWorkflowID(t *testing.T) { - id := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewWorkflowID(t *testing.T) { } func TestFormatWorkflowID(t *testing.T) { - actual := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName" + actual := NewWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs/wOrKfLoWnAmE", Expected: &WorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/webapps/method_createorupdatedomainownershipidentifier.go b/resource-manager/web/2023-12-01/webapps/method_createorupdatedomainownershipidentifier.go index 54114dd7cb9..cf70725a9a9 100644 --- a/resource-manager/web/2023-12-01/webapps/method_createorupdatedomainownershipidentifier.go +++ b/resource-manager/web/2023-12-01/webapps/method_createorupdatedomainownershipidentifier.go @@ -18,7 +18,7 @@ type CreateOrUpdateDomainOwnershipIdentifierOperationResponse struct { } // CreateOrUpdateDomainOwnershipIdentifier ... -func (c WebAppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId, input Identifier) (result CreateOrUpdateDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId, input Identifier) (result CreateOrUpdateDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-12-01/webapps/method_deletedomainownershipidentifier.go b/resource-manager/web/2023-12-01/webapps/method_deletedomainownershipidentifier.go index c170a9280d7..06a3c4983b6 100644 --- a/resource-manager/web/2023-12-01/webapps/method_deletedomainownershipidentifier.go +++ b/resource-manager/web/2023-12-01/webapps/method_deletedomainownershipidentifier.go @@ -17,7 +17,7 @@ type DeleteDomainOwnershipIdentifierOperationResponse struct { } // DeleteDomainOwnershipIdentifier ... -func (c WebAppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId) (result DeleteDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId) (result DeleteDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-12-01/webapps/method_getdomainownershipidentifier.go b/resource-manager/web/2023-12-01/webapps/method_getdomainownershipidentifier.go index 44658be8e1a..bc014922e27 100644 --- a/resource-manager/web/2023-12-01/webapps/method_getdomainownershipidentifier.go +++ b/resource-manager/web/2023-12-01/webapps/method_getdomainownershipidentifier.go @@ -18,7 +18,7 @@ type GetDomainOwnershipIdentifierOperationResponse struct { } // GetDomainOwnershipIdentifier ... -func (c WebAppsClient) GetDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId) (result GetDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) GetDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId) (result GetDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-12-01/webapps/method_startnetworktrace.go b/resource-manager/web/2023-12-01/webapps/method_startnetworktrace.go index de35cae8c37..3b1246a0d11 100644 --- a/resource-manager/web/2023-12-01/webapps/method_startnetworktrace.go +++ b/resource-manager/web/2023-12-01/webapps/method_startnetworktrace.go @@ -25,7 +25,7 @@ type StartNetworkTraceOperationResponse struct { type StartNetworkTraceOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartNetworkTraceOperationOptions() StartNetworkTraceOperationOptions { @@ -52,8 +52,8 @@ func (o StartNetworkTraceOperationOptions) ToQuery() *client.QueryParams { if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-12-01/webapps/method_startnetworktraceslot.go b/resource-manager/web/2023-12-01/webapps/method_startnetworktraceslot.go index f4ecbb2878c..72c280deeef 100644 --- a/resource-manager/web/2023-12-01/webapps/method_startnetworktraceslot.go +++ b/resource-manager/web/2023-12-01/webapps/method_startnetworktraceslot.go @@ -24,7 +24,7 @@ type StartNetworkTraceSlotOperationResponse struct { type StartNetworkTraceSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartNetworkTraceSlotOperationOptions() StartNetworkTraceSlotOperationOptions { @@ -51,8 +51,8 @@ func (o StartNetworkTraceSlotOperationOptions) ToQuery() *client.QueryParams { if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktrace.go b/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktrace.go index c4aceaac67a..0feb53df65b 100644 --- a/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktrace.go +++ b/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktrace.go @@ -22,7 +22,7 @@ type StartWebSiteNetworkTraceOperationResponse struct { type StartWebSiteNetworkTraceOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationOptions() StartWebSiteNetworkTraceOperationOptions { @@ -49,8 +49,8 @@ func (o StartWebSiteNetworkTraceOperationOptions) ToQuery() *client.QueryParams if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceoperation.go b/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceoperation.go index c2f83e72964..1a67be6cba1 100644 --- a/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceoperation.go +++ b/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceoperation.go @@ -25,7 +25,7 @@ type StartWebSiteNetworkTraceOperationOperationResponse struct { type StartWebSiteNetworkTraceOperationOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationOperationOptions() StartWebSiteNetworkTraceOperationOperationOptions { @@ -52,8 +52,8 @@ func (o StartWebSiteNetworkTraceOperationOperationOptions) ToQuery() *client.Que if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceoperationslot.go b/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceoperationslot.go index ceb485a4310..90f4cda8f0d 100644 --- a/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceoperationslot.go +++ b/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceoperationslot.go @@ -24,7 +24,7 @@ type StartWebSiteNetworkTraceOperationSlotOperationResponse struct { type StartWebSiteNetworkTraceOperationSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceOperationSlotOperationOptions() StartWebSiteNetworkTraceOperationSlotOperationOptions { @@ -51,8 +51,8 @@ func (o StartWebSiteNetworkTraceOperationSlotOperationOptions) ToQuery() *client if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceslot.go b/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceslot.go index 488181959e2..10467c0eda1 100644 --- a/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceslot.go +++ b/resource-manager/web/2023-12-01/webapps/method_startwebsitenetworktraceslot.go @@ -21,7 +21,7 @@ type StartWebSiteNetworkTraceSlotOperationResponse struct { type StartWebSiteNetworkTraceSlotOperationOptions struct { DurationInSeconds *int64 MaxFrameLength *int64 - SasUrl *string + SasURL *string } func DefaultStartWebSiteNetworkTraceSlotOperationOptions() StartWebSiteNetworkTraceSlotOperationOptions { @@ -48,8 +48,8 @@ func (o StartWebSiteNetworkTraceSlotOperationOptions) ToQuery() *client.QueryPar if o.MaxFrameLength != nil { out.Append("maxFrameLength", fmt.Sprintf("%v", *o.MaxFrameLength)) } - if o.SasUrl != nil { - out.Append("sasUrl", fmt.Sprintf("%v", *o.SasUrl)) + if o.SasURL != nil { + out.Append("sasUrl", fmt.Sprintf("%v", *o.SasURL)) } return &out } diff --git a/resource-manager/web/2023-12-01/webapps/method_updatedomainownershipidentifier.go b/resource-manager/web/2023-12-01/webapps/method_updatedomainownershipidentifier.go index e9926b92e04..8bb087cd8f8 100644 --- a/resource-manager/web/2023-12-01/webapps/method_updatedomainownershipidentifier.go +++ b/resource-manager/web/2023-12-01/webapps/method_updatedomainownershipidentifier.go @@ -18,7 +18,7 @@ type UpdateDomainOwnershipIdentifierOperationResponse struct { } // UpdateDomainOwnershipIdentifier ... -func (c WebAppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, id DomainOwnershipIdentifierId, input Identifier) (result UpdateDomainOwnershipIdentifierOperationResponse, err error) { +func (c WebAppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, id SiteDomainOwnershipIdentifierId, input Identifier) (result UpdateDomainOwnershipIdentifierOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ diff --git a/resource-manager/web/2023-12-01/webapps/model_azureblobstorageapplicationlogsconfig.go b/resource-manager/web/2023-12-01/webapps/model_azureblobstorageapplicationlogsconfig.go index d17b5f8ddb1..37a7b27b3e9 100644 --- a/resource-manager/web/2023-12-01/webapps/model_azureblobstorageapplicationlogsconfig.go +++ b/resource-manager/web/2023-12-01/webapps/model_azureblobstorageapplicationlogsconfig.go @@ -6,5 +6,5 @@ package webapps type AzureBlobStorageApplicationLogsConfig struct { Level *LogLevel `json:"level,omitempty"` RetentionInDays *int64 `json:"retentionInDays,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_azureblobstoragehttplogsconfig.go b/resource-manager/web/2023-12-01/webapps/model_azureblobstoragehttplogsconfig.go index 4bafbbd06e5..74820c0d5ac 100644 --- a/resource-manager/web/2023-12-01/webapps/model_azureblobstoragehttplogsconfig.go +++ b/resource-manager/web/2023-12-01/webapps/model_azureblobstoragehttplogsconfig.go @@ -6,5 +6,5 @@ package webapps type AzureBlobStorageHTTPLogsConfig struct { Enabled *bool `json:"enabled,omitempty"` RetentionInDays *int64 `json:"retentionInDays,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` + SasURL *string `json:"sasUrl,omitempty"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_azuretablestorageapplicationlogsconfig.go b/resource-manager/web/2023-12-01/webapps/model_azuretablestorageapplicationlogsconfig.go index 6a87bfc0dc9..8d8ca355fe4 100644 --- a/resource-manager/web/2023-12-01/webapps/model_azuretablestorageapplicationlogsconfig.go +++ b/resource-manager/web/2023-12-01/webapps/model_azuretablestorageapplicationlogsconfig.go @@ -5,5 +5,5 @@ package webapps type AzureTableStorageApplicationLogsConfig struct { Level *LogLevel `json:"level,omitempty"` - SasUrl string `json:"sasUrl"` + SasURL string `json:"sasUrl"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_backupitemproperties.go b/resource-manager/web/2023-12-01/webapps/model_backupitemproperties.go index 577e4eb1a23..b74153eec80 100644 --- a/resource-manager/web/2023-12-01/webapps/model_backupitemproperties.go +++ b/resource-manager/web/2023-12-01/webapps/model_backupitemproperties.go @@ -22,7 +22,7 @@ type BackupItemProperties struct { Scheduled *bool `json:"scheduled,omitempty"` SizeInBytes *int64 `json:"sizeInBytes,omitempty"` Status *BackupItemStatus `json:"status,omitempty"` - StorageAccountUrl *string `json:"storageAccountUrl,omitempty"` + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` WebsiteSizeInBytes *int64 `json:"websiteSizeInBytes,omitempty"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_backuprequestproperties.go b/resource-manager/web/2023-12-01/webapps/model_backuprequestproperties.go index 8a3f52e475f..0d0229d8c83 100644 --- a/resource-manager/web/2023-12-01/webapps/model_backuprequestproperties.go +++ b/resource-manager/web/2023-12-01/webapps/model_backuprequestproperties.go @@ -8,5 +8,5 @@ type BackupRequestProperties struct { BackupSchedule *BackupSchedule `json:"backupSchedule,omitempty"` Databases *[]DatabaseBackupSetting `json:"databases,omitempty"` Enabled *bool `json:"enabled,omitempty"` - StorageAccountUrl string `json:"storageAccountUrl"` + StorageAccountURL string `json:"storageAccountUrl"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_blobstoragetokenstore.go b/resource-manager/web/2023-12-01/webapps/model_blobstoragetokenstore.go index 002a55f2dad..2cbf67fbeae 100644 --- a/resource-manager/web/2023-12-01/webapps/model_blobstoragetokenstore.go +++ b/resource-manager/web/2023-12-01/webapps/model_blobstoragetokenstore.go @@ -4,5 +4,5 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type BlobStorageTokenStore struct { - SasUrlSettingName *string `json:"sasUrlSettingName,omitempty"` + SasURLSettingName *string `json:"sasUrlSettingName,omitempty"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_githubactioncontainerconfiguration.go b/resource-manager/web/2023-12-01/webapps/model_githubactioncontainerconfiguration.go index 0eb95a29ffb..db70b234959 100644 --- a/resource-manager/web/2023-12-01/webapps/model_githubactioncontainerconfiguration.go +++ b/resource-manager/web/2023-12-01/webapps/model_githubactioncontainerconfiguration.go @@ -6,6 +6,6 @@ package webapps type GitHubActionContainerConfiguration struct { ImageName *string `json:"imageName,omitempty"` Password *string `json:"password,omitempty"` - ServerUrl *string `json:"serverUrl,omitempty"` + ServerURL *string `json:"serverUrl,omitempty"` Username *string `json:"username,omitempty"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_login.go b/resource-manager/web/2023-12-01/webapps/model_login.go index a8fee3b25d9..3e8e040d421 100644 --- a/resource-manager/web/2023-12-01/webapps/model_login.go +++ b/resource-manager/web/2023-12-01/webapps/model_login.go @@ -4,10 +4,10 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Login struct { - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` CookieExpiration *CookieExpiration `json:"cookieExpiration,omitempty"` Nonce *Nonce `json:"nonce,omitempty"` - PreserveUrlFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` + PreserveURLFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` Routes *LoginRoutes `json:"routes,omitempty"` TokenStore *TokenStore `json:"tokenStore,omitempty"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_rampuprule.go b/resource-manager/web/2023-12-01/webapps/model_rampuprule.go index a99e19c5085..2688d09f601 100644 --- a/resource-manager/web/2023-12-01/webapps/model_rampuprule.go +++ b/resource-manager/web/2023-12-01/webapps/model_rampuprule.go @@ -5,7 +5,7 @@ package webapps type RampUpRule struct { ActionHostName *string `json:"actionHostName,omitempty"` - ChangeDecisionCallbackUrl *string `json:"changeDecisionCallbackUrl,omitempty"` + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` ChangeIntervalInMinutes *int64 `json:"changeIntervalInMinutes,omitempty"` ChangeStep *float64 `json:"changeStep,omitempty"` MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` diff --git a/resource-manager/web/2023-12-01/webapps/model_restorerequestproperties.go b/resource-manager/web/2023-12-01/webapps/model_restorerequestproperties.go index d352f67f61b..ea35e477253 100644 --- a/resource-manager/web/2023-12-01/webapps/model_restorerequestproperties.go +++ b/resource-manager/web/2023-12-01/webapps/model_restorerequestproperties.go @@ -14,5 +14,5 @@ type RestoreRequestProperties struct { OperationType *BackupRestoreOperationType `json:"operationType,omitempty"` Overwrite bool `json:"overwrite"` SiteName *string `json:"siteName,omitempty"` - StorageAccountUrl string `json:"storageAccountUrl"` + StorageAccountURL string `json:"storageAccountUrl"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_siteauthsettingsproperties.go b/resource-manager/web/2023-12-01/webapps/model_siteauthsettingsproperties.go index 46d05a77881..7ad71ad2704 100644 --- a/resource-manager/web/2023-12-01/webapps/model_siteauthsettingsproperties.go +++ b/resource-manager/web/2023-12-01/webapps/model_siteauthsettingsproperties.go @@ -7,7 +7,7 @@ type SiteAuthSettingsProperties struct { AadClaimsAuthorization *string `json:"aadClaimsAuthorization,omitempty"` AdditionalLoginParams *[]string `json:"additionalLoginParams,omitempty"` AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` - AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + AllowedExternalRedirectURLs *[]string `json:"allowedExternalRedirectUrls,omitempty"` AuthFilePath *string `json:"authFilePath,omitempty"` ClientId *string `json:"clientId,omitempty"` ClientSecret *string `json:"clientSecret,omitempty"` diff --git a/resource-manager/web/2023-12-01/webapps/model_sitesourcecontrolproperties.go b/resource-manager/web/2023-12-01/webapps/model_sitesourcecontrolproperties.go index f19c33a2a34..9634590165d 100644 --- a/resource-manager/web/2023-12-01/webapps/model_sitesourcecontrolproperties.go +++ b/resource-manager/web/2023-12-01/webapps/model_sitesourcecontrolproperties.go @@ -10,5 +10,5 @@ type SiteSourceControlProperties struct { IsGitHubAction *bool `json:"isGitHubAction,omitempty"` IsManualIntegration *bool `json:"isManualIntegration,omitempty"` IsMercurial *bool `json:"isMercurial,omitempty"` - RepoUrl *string `json:"repoUrl,omitempty"` + RepoURL *string `json:"repoUrl,omitempty"` } diff --git a/resource-manager/web/2023-12-01/webapps/model_websiteinstancestatusproperties.go b/resource-manager/web/2023-12-01/webapps/model_websiteinstancestatusproperties.go index fac5b723630..f276d7e8f05 100644 --- a/resource-manager/web/2023-12-01/webapps/model_websiteinstancestatusproperties.go +++ b/resource-manager/web/2023-12-01/webapps/model_websiteinstancestatusproperties.go @@ -4,10 +4,10 @@ package webapps // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type WebSiteInstanceStatusProperties struct { - ConsoleUrl *string `json:"consoleUrl,omitempty"` + ConsoleURL *string `json:"consoleUrl,omitempty"` Containers *map[string]ContainerInfo `json:"containers,omitempty"` - DetectorUrl *string `json:"detectorUrl,omitempty"` - HealthCheckUrl *string `json:"healthCheckUrl,omitempty"` + DetectorURL *string `json:"detectorUrl,omitempty"` + HealthCheckURL *string `json:"healthCheckUrl,omitempty"` State *SiteRuntimeState `json:"state,omitempty"` - StatusUrl *string `json:"statusUrl,omitempty"` + StatusURL *string `json:"statusUrl,omitempty"` } diff --git a/resource-manager/web/2023-12-01/workflowrunactions/README.md b/resource-manager/web/2023-12-01/workflowrunactions/README.md index cc78b33a195..d9c0b79a97e 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/README.md +++ b/resource-manager/web/2023-12-01/workflowrunactions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowrunactions.NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName") read, err := client.CopeRepetitionsGet(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.CopeRepetitionsList(ctx, id)` can be used to do batched pagination items, err := client.CopeRepetitionsListComplete(ctx, id) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") read, err := client.Get(ctx, id) if err != nil { @@ -73,7 +73,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowrunactions.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") // alternatively `client.List(ctx, id, workflowrunactions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowrunactions.DefaultListOperationOptions()) @@ -90,7 +90,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.ListExpressionTraces(ctx, id)` can be used to do batched pagination items, err := client.ListExpressionTracesComplete(ctx, id) @@ -107,7 +107,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") read, err := client.WorkflowRunActionRepetitionsGet(ctx, id) if err != nil { @@ -123,7 +123,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") +id := workflowrunactions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") // alternatively `client.WorkflowRunActionRepetitionsList(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsListComplete(ctx, id) @@ -140,7 +140,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") // alternatively `client.WorkflowRunActionRepetitionsListExpressionTraces(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsListExpressionTracesComplete(ctx, id) @@ -157,7 +157,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowrunactions.NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") +id := workflowrunactions.NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") read, err := client.WorkflowRunActionRepetitionsRequestHistoriesGet(ctx, id) if err != nil { @@ -173,7 +173,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") +id := workflowrunactions.NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") // alternatively `client.WorkflowRunActionRepetitionsRequestHistoriesList(ctx, id)` can be used to do batched pagination items, err := client.WorkflowRunActionRepetitionsRequestHistoriesListComplete(ctx, id) diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_action.go b/resource-manager/web/2023-12-01/workflowrunactions/id_action.go index 33762ac4650..d8931531676 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_action.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_action.go @@ -133,7 +133,7 @@ func (id ActionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_action_test.go b/resource-manager/web/2023-12-01/workflowrunactions/id_action_test.go index 66b951f306b..1a7cdb61b0c 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_action_test.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_action_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ActionId{} func TestNewActionID(t *testing.T) { - id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName") + id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewActionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -40,8 +40,8 @@ func TestNewActionID(t *testing.T) { } func TestFormatActionID(t *testing.T) { - actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName" + actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,71 +95,71 @@ func TestParseActionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -167,7 +167,7 @@ func TestParseActionID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", Error: true, }, } @@ -296,131 +296,131 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -428,16 +428,16 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Expected: &ActionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -445,7 +445,7 @@ func TestParseActionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_repetition.go b/resource-manager/web/2023-12-01/workflowrunactions/id_repetition.go index 086a2886207..eea587301e1 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_repetition.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_repetition.go @@ -139,7 +139,7 @@ func (id RepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_repetition_test.go b/resource-manager/web/2023-12-01/workflowrunactions/id_repetition_test.go index 5eaac6da4b7..9b2f3157fe9 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_repetition_test.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_repetition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RepetitionId{} func TestNewRepetitionID(t *testing.T) { - id := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") + id := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -44,8 +44,8 @@ func TestNewRepetitionID(t *testing.T) { } func TestFormatRepetitionID(t *testing.T) { - actual := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName" + actual := NewRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,81 +99,81 @@ func TestParseRepetitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -182,7 +182,7 @@ func TestParseRepetitionID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", Error: true, }, } @@ -315,151 +315,151 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -468,16 +468,16 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", Expected: &RepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -486,7 +486,7 @@ func TestParseRepetitionIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_requesthistory.go b/resource-manager/web/2023-12-01/workflowrunactions/id_requesthistory.go index f8185100bb8..d15a9523fb5 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_requesthistory.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_requesthistory.go @@ -145,7 +145,7 @@ func (id RequestHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_requesthistory_test.go b/resource-manager/web/2023-12-01/workflowrunactions/id_requesthistory_test.go index c90f9e01823..170be7c8e38 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_requesthistory_test.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_requesthistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RequestHistoryId{} func TestNewRequestHistoryID(t *testing.T) { - id := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") + id := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRequestHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -48,8 +48,8 @@ func TestNewRequestHistoryID(t *testing.T) { } func TestFormatRequestHistoryID(t *testing.T) { - actual := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName" + actual := NewRequestHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "repetitionName", "requestHistoryName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -103,91 +103,91 @@ func TestParseRequestHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -197,7 +197,7 @@ func TestParseRequestHistoryID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", Error: true, }, } @@ -334,171 +334,171 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", @@ -508,16 +508,16 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/repetitions/repetitionName/requestHistories/requestHistoryName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE", Expected: &RequestHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", @@ -527,7 +527,7 @@ func TestParseRequestHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/rEpEtItIoNs/rEpEtItIoNnAmE/rEqUeStHiStOrIeS/rEqUeStHiStOrYnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_run.go b/resource-manager/web/2023-12-01/workflowrunactions/id_run.go index e2ca4c816ca..50398640cd1 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_run.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_run.go @@ -127,7 +127,7 @@ func (id RunId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_run_test.go b/resource-manager/web/2023-12-01/workflowrunactions/id_run_test.go index d5624eb4cef..5b5fc911ae0 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_run_test.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_run_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RunId{} func TestNewRunID(t *testing.T) { - id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") + id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRunID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewRunID(t *testing.T) { } func TestFormatRunID(t *testing.T) { - actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" + actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseRunID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseRunIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_scoperepetition.go b/resource-manager/web/2023-12-01/workflowrunactions/id_scoperepetition.go index 8582cd7f9ec..0e6e953b99e 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_scoperepetition.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_scoperepetition.go @@ -139,7 +139,7 @@ func (id ScopeRepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), @@ -153,7 +153,7 @@ func (id ScopeRepetitionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticActions", "actions", "actions"), resourceids.UserSpecifiedSegment("actionName", "actionName"), resourceids.StaticSegment("staticScopeRepetitions", "scopeRepetitions", "scopeRepetitions"), - resourceids.UserSpecifiedSegment("scopeRepetitionName", "repetitionName"), + resourceids.UserSpecifiedSegment("scopeRepetitionName", "scopeRepetitionName"), } } diff --git a/resource-manager/web/2023-12-01/workflowrunactions/id_scoperepetition_test.go b/resource-manager/web/2023-12-01/workflowrunactions/id_scoperepetition_test.go index 6739a64f8b6..0b1db9c0160 100644 --- a/resource-manager/web/2023-12-01/workflowrunactions/id_scoperepetition_test.go +++ b/resource-manager/web/2023-12-01/workflowrunactions/id_scoperepetition_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ScopeRepetitionId{} func TestNewScopeRepetitionID(t *testing.T) { - id := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName") + id := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewScopeRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -38,14 +38,14 @@ func TestNewScopeRepetitionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ActionName'", id.ActionName, "actionName") } - if id.ScopeRepetitionName != "repetitionName" { - t.Fatalf("Expected %q but got %q for Segment 'ScopeRepetitionName'", id.ScopeRepetitionName, "repetitionName") + if id.ScopeRepetitionName != "scopeRepetitionName" { + t.Fatalf("Expected %q but got %q for Segment 'ScopeRepetitionName'", id.ScopeRepetitionName, "scopeRepetitionName") } } func TestFormatScopeRepetitionID(t *testing.T) { - actual := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName", "actionName", "repetitionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName" + actual := NewScopeRepetitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName", "actionName", "scopeRepetitionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -99,90 +99,90 @@ func TestParseScopeRepetitionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", - ScopeRepetitionName: "repetitionName", + ScopeRepetitionName: "scopeRepetitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName/extra", Error: true, }, } @@ -315,178 +315,178 @@ func TestParseScopeRepetitionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", ActionName: "actionName", - ScopeRepetitionName: "repetitionName", + ScopeRepetitionName: "scopeRepetitionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/repetitionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/actions/actionName/scopeRepetitions/scopeRepetitionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/rEpEtItIoNnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/sCoPeRePeTiTiOnNaMe", Expected: &ScopeRepetitionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", ActionName: "aCtIoNnAmE", - ScopeRepetitionName: "rEpEtItIoNnAmE", + ScopeRepetitionName: "sCoPeRePeTiTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/rEpEtItIoNnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/aCtIoNs/aCtIoNnAmE/sCoPeRePeTiTiOnS/sCoPeRePeTiTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowruns/README.md b/resource-manager/web/2023-12-01/workflowruns/README.md index 30653fb39da..fcd7da2738f 100644 --- a/resource-manager/web/2023-12-01/workflowruns/README.md +++ b/resource-manager/web/2023-12-01/workflowruns/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") read, err := client.Cancel(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") +id := workflowruns.NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") read, err := client.Get(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowruns.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowruns.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowruns.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowruns.DefaultListOperationOptions()) diff --git a/resource-manager/web/2023-12-01/workflowruns/id_managementworkflow.go b/resource-manager/web/2023-12-01/workflowruns/id_managementworkflow.go index 2cb6856b6ec..b87857c4e6f 100644 --- a/resource-manager/web/2023-12-01/workflowruns/id_managementworkflow.go +++ b/resource-manager/web/2023-12-01/workflowruns/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowruns/id_managementworkflow_test.go b/resource-manager/web/2023-12-01/workflowruns/id_managementworkflow_test.go index 4a9b2de9f46..5895776d52c 100644 --- a/resource-manager/web/2023-12-01/workflowruns/id_managementworkflow_test.go +++ b/resource-manager/web/2023-12-01/workflowruns/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowruns/id_run.go b/resource-manager/web/2023-12-01/workflowruns/id_run.go index cbecca55f3c..968133f5c51 100644 --- a/resource-manager/web/2023-12-01/workflowruns/id_run.go +++ b/resource-manager/web/2023-12-01/workflowruns/id_run.go @@ -127,7 +127,7 @@ func (id RunId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowruns/id_run_test.go b/resource-manager/web/2023-12-01/workflowruns/id_run_test.go index a7fb428b8c2..abacc74a502 100644 --- a/resource-manager/web/2023-12-01/workflowruns/id_run_test.go +++ b/resource-manager/web/2023-12-01/workflowruns/id_run_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &RunId{} func TestNewRunID(t *testing.T) { - id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName") + id := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewRunID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewRunID(t *testing.T) { } func TestFormatRunID(t *testing.T) { - actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "runName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" + actual := NewRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "runName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseRunID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseRunIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", RunName: "runName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/runs/runName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe", Expected: &RunId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", RunName: "rUnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/rUnS/rUnNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflows/README.md b/resource-manager/web/2023-12-01/workflows/README.md index d0d0500d913..3fdb153effa 100644 --- a/resource-manager/web/2023-12-01/workflows/README.md +++ b/resource-manager/web/2023-12-01/workflows/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") payload := workflows.RegenerateActionParameter{ // ... @@ -45,7 +45,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflows.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") payload := workflows.Workflow{ // ... diff --git a/resource-manager/web/2023-12-01/workflows/id_managementworkflow.go b/resource-manager/web/2023-12-01/workflows/id_managementworkflow.go index 7a774f3c589..47ad1eb715b 100644 --- a/resource-manager/web/2023-12-01/workflows/id_managementworkflow.go +++ b/resource-manager/web/2023-12-01/workflows/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflows/id_managementworkflow_test.go b/resource-manager/web/2023-12-01/workflows/id_managementworkflow_test.go index 8240e4e7088..8499136fb32 100644 --- a/resource-manager/web/2023-12-01/workflows/id_managementworkflow_test.go +++ b/resource-manager/web/2023-12-01/workflows/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowtriggerhistories/README.md b/resource-manager/web/2023-12-01/workflowtriggerhistories/README.md index 87bb9d9f007..78405d08222 100644 --- a/resource-manager/web/2023-12-01/workflowtriggerhistories/README.md +++ b/resource-manager/web/2023-12-01/workflowtriggerhistories/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") +id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggerhistories.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") // alternatively `client.List(ctx, id, workflowtriggerhistories.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowtriggerhistories.DefaultListOperationOptions()) @@ -57,7 +57,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") +id := workflowtriggerhistories.NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") if err := client.ResubmitThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/web/2023-12-01/workflowtriggerhistories/id_trigger.go b/resource-manager/web/2023-12-01/workflowtriggerhistories/id_trigger.go index 7746c2047d8..185a7964307 100644 --- a/resource-manager/web/2023-12-01/workflowtriggerhistories/id_trigger.go +++ b/resource-manager/web/2023-12-01/workflowtriggerhistories/id_trigger.go @@ -127,7 +127,7 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowtriggerhistories/id_trigger_test.go b/resource-manager/web/2023-12-01/workflowtriggerhistories/id_trigger_test.go index dd1a3ca80d4..a7e902f354d 100644 --- a/resource-manager/web/2023-12-01/workflowtriggerhistories/id_trigger_test.go +++ b/resource-manager/web/2023-12-01/workflowtriggerhistories/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowtriggerhistories/id_triggerhistory.go b/resource-manager/web/2023-12-01/workflowtriggerhistories/id_triggerhistory.go index f5391b27c47..248b48c2216 100644 --- a/resource-manager/web/2023-12-01/workflowtriggerhistories/id_triggerhistory.go +++ b/resource-manager/web/2023-12-01/workflowtriggerhistories/id_triggerhistory.go @@ -133,7 +133,7 @@ func (id TriggerHistoryId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowtriggerhistories/id_triggerhistory_test.go b/resource-manager/web/2023-12-01/workflowtriggerhistories/id_triggerhistory_test.go index bf48a873df6..9acaaf52faa 100644 --- a/resource-manager/web/2023-12-01/workflowtriggerhistories/id_triggerhistory_test.go +++ b/resource-manager/web/2023-12-01/workflowtriggerhistories/id_triggerhistory_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerHistoryId{} func TestNewTriggerHistoryID(t *testing.T) { - id := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName") + id := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerHistoryID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -40,8 +40,8 @@ func TestNewTriggerHistoryID(t *testing.T) { } func TestFormatTriggerHistoryID(t *testing.T) { - actual := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName", "historyName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName" + actual := NewTriggerHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName", "historyName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -95,71 +95,71 @@ func TestParseTriggerHistoryID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", HistoryName: "historyName", @@ -167,7 +167,7 @@ func TestParseTriggerHistoryID(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", Error: true, }, } @@ -296,131 +296,131 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", HistoryName: "historyName", @@ -428,16 +428,16 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/histories/historyName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe", Expected: &TriggerHistoryId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", HistoryName: "hIsToRyNaMe", @@ -445,7 +445,7 @@ func TestParseTriggerHistoryIDInsensitively(t *testing.T) { }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/hIsToRiEs/hIsToRyNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowtriggers/README.md b/resource-manager/web/2023-12-01/workflowtriggers/README.md index 344b0a3a7dd..6ca1dcf18e0 100644 --- a/resource-manager/web/2023-12-01/workflowtriggers/README.md +++ b/resource-manager/web/2023-12-01/workflowtriggers/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") read, err := client.GetSchemaJson(ctx, id) if err != nil { @@ -56,7 +56,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowtriggers.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowtriggers.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowtriggers.DefaultListOperationOptions()) @@ -69,13 +69,13 @@ for _, item := range items { ``` -### Example Usage: `WorkflowTriggersClient.ListCallbackUrl` +### Example Usage: `WorkflowTriggersClient.ListCallbackURL` ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") -read, err := client.ListCallbackUrl(ctx, id) +read, err := client.ListCallbackURL(ctx, id) if err != nil { // handle the error } @@ -89,7 +89,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") +id := workflowtriggers.NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if err := client.RunThenPoll(ctx, id); err != nil { // handle the error diff --git a/resource-manager/web/2023-12-01/workflowtriggers/id_managementworkflow.go b/resource-manager/web/2023-12-01/workflowtriggers/id_managementworkflow.go index 192d552a278..7f55952af52 100644 --- a/resource-manager/web/2023-12-01/workflowtriggers/id_managementworkflow.go +++ b/resource-manager/web/2023-12-01/workflowtriggers/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowtriggers/id_managementworkflow_test.go b/resource-manager/web/2023-12-01/workflowtriggers/id_managementworkflow_test.go index 9eed841e8fe..1ca968f9de0 100644 --- a/resource-manager/web/2023-12-01/workflowtriggers/id_managementworkflow_test.go +++ b/resource-manager/web/2023-12-01/workflowtriggers/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowtriggers/id_trigger.go b/resource-manager/web/2023-12-01/workflowtriggers/id_trigger.go index e25ae7dccb1..3980bdfb0bc 100644 --- a/resource-manager/web/2023-12-01/workflowtriggers/id_trigger.go +++ b/resource-manager/web/2023-12-01/workflowtriggers/id_trigger.go @@ -127,7 +127,7 @@ func (id TriggerId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowtriggers/id_trigger_test.go b/resource-manager/web/2023-12-01/workflowtriggers/id_trigger_test.go index 094cc4fce14..c101bbec5e7 100644 --- a/resource-manager/web/2023-12-01/workflowtriggers/id_trigger_test.go +++ b/resource-manager/web/2023-12-01/workflowtriggers/id_trigger_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &TriggerId{} func TestNewTriggerID(t *testing.T) { - id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName") + id := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewTriggerID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewTriggerID(t *testing.T) { } func TestFormatTriggerID(t *testing.T) { - actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "triggerName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" + actual := NewTriggerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "triggerName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseTriggerID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseTriggerIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", TriggerName: "triggerName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/triggers/triggerName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe", Expected: &TriggerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", TriggerName: "tRiGgErNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/tRiGgErS/tRiGgErNaMe/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowtriggers/method_listcallbackurl.go b/resource-manager/web/2023-12-01/workflowtriggers/method_listcallbackurl.go index 7e44f7f9763..4fa4045250d 100644 --- a/resource-manager/web/2023-12-01/workflowtriggers/method_listcallbackurl.go +++ b/resource-manager/web/2023-12-01/workflowtriggers/method_listcallbackurl.go @@ -12,14 +12,14 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type ListCallbackUrlOperationResponse struct { +type ListCallbackURLOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *WorkflowTriggerCallbackUrl + Model *WorkflowTriggerCallbackURL } -// ListCallbackUrl ... -func (c WorkflowTriggersClient) ListCallbackUrl(ctx context.Context, id TriggerId) (result ListCallbackUrlOperationResponse, err error) { +// ListCallbackURL ... +func (c WorkflowTriggersClient) ListCallbackURL(ctx context.Context, id TriggerId) (result ListCallbackURLOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -44,7 +44,7 @@ func (c WorkflowTriggersClient) ListCallbackUrl(ctx context.Context, id TriggerI return } - var model WorkflowTriggerCallbackUrl + var model WorkflowTriggerCallbackURL result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { return diff --git a/resource-manager/web/2023-12-01/workflowtriggers/model_workflowtriggercallbackurl.go b/resource-manager/web/2023-12-01/workflowtriggers/model_workflowtriggercallbackurl.go index fd5a9082bd7..710a39b43aa 100644 --- a/resource-manager/web/2023-12-01/workflowtriggers/model_workflowtriggercallbackurl.go +++ b/resource-manager/web/2023-12-01/workflowtriggers/model_workflowtriggercallbackurl.go @@ -3,10 +3,10 @@ package workflowtriggers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerCallbackUrl struct { +type WorkflowTriggerCallbackURL struct { BasePath *string `json:"basePath,omitempty"` Method *string `json:"method,omitempty"` - Queries *WorkflowTriggerListCallbackUrlQueries `json:"queries,omitempty"` + Queries *WorkflowTriggerListCallbackURLQueries `json:"queries,omitempty"` RelativePath *string `json:"relativePath,omitempty"` RelativePathParameters *[]string `json:"relativePathParameters,omitempty"` Value *string `json:"value,omitempty"` diff --git a/resource-manager/web/2023-12-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go b/resource-manager/web/2023-12-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go index cc3b231968b..f4e969fd7ab 100644 --- a/resource-manager/web/2023-12-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go +++ b/resource-manager/web/2023-12-01/workflowtriggers/model_workflowtriggerlistcallbackurlqueries.go @@ -3,7 +3,7 @@ package workflowtriggers // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. -type WorkflowTriggerListCallbackUrlQueries struct { +type WorkflowTriggerListCallbackURLQueries struct { ApiVersion *string `json:"api-version,omitempty"` Se *string `json:"se,omitempty"` Sig *string `json:"sig,omitempty"` diff --git a/resource-manager/web/2023-12-01/workflowversions/README.md b/resource-manager/web/2023-12-01/workflowversions/README.md index 6a75bcdffa3..ced34127834 100644 --- a/resource-manager/web/2023-12-01/workflowversions/README.md +++ b/resource-manager/web/2023-12-01/workflowversions/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := workflowversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId") +id := workflowversions.NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId") read, err := client.Get(ctx, id) if err != nil { @@ -40,7 +40,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := workflowversions.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") +id := workflowversions.NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") // alternatively `client.List(ctx, id, workflowversions.DefaultListOperationOptions())` can be used to do batched pagination items, err := client.ListComplete(ctx, id, workflowversions.DefaultListOperationOptions()) diff --git a/resource-manager/web/2023-12-01/workflowversions/id_managementworkflow.go b/resource-manager/web/2023-12-01/workflowversions/id_managementworkflow.go index 3c4187d53f9..29c5ebda9ab 100644 --- a/resource-manager/web/2023-12-01/workflowversions/id_managementworkflow.go +++ b/resource-manager/web/2023-12-01/workflowversions/id_managementworkflow.go @@ -121,7 +121,7 @@ func (id ManagementWorkflowId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowversions/id_managementworkflow_test.go b/resource-manager/web/2023-12-01/workflowversions/id_managementworkflow_test.go index f90f2845f58..fb252bd145e 100644 --- a/resource-manager/web/2023-12-01/workflowversions/id_managementworkflow_test.go +++ b/resource-manager/web/2023-12-01/workflowversions/id_managementworkflow_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ManagementWorkflowId{} func TestNewManagementWorkflowID(t *testing.T) { - id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName") + id := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewManagementWorkflowID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -32,8 +32,8 @@ func TestNewManagementWorkflowID(t *testing.T) { } func TestFormatManagementWorkflowID(t *testing.T) { - actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" + actual := NewManagementWorkflowID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,57 +87,57 @@ func TestParseManagementWorkflowID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, } @@ -258,112 +258,112 @@ func TestParseManagementWorkflowIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Expected: &ManagementWorkflowId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/extra", Error: true, }, } diff --git a/resource-manager/web/2023-12-01/workflowversions/id_version.go b/resource-manager/web/2023-12-01/workflowversions/id_version.go index 03a60370e12..d1585eebfb1 100644 --- a/resource-manager/web/2023-12-01/workflowversions/id_version.go +++ b/resource-manager/web/2023-12-01/workflowversions/id_version.go @@ -127,7 +127,7 @@ func (id VersionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), resourceids.StaticSegment("staticSites", "sites", "sites"), - resourceids.UserSpecifiedSegment("siteName", "name"), + resourceids.UserSpecifiedSegment("siteName", "siteName"), resourceids.StaticSegment("staticHostRuntime", "hostRuntime", "hostRuntime"), resourceids.StaticSegment("staticRuntime", "runtime", "runtime"), resourceids.StaticSegment("staticWebHooks", "webHooks", "webHooks"), diff --git a/resource-manager/web/2023-12-01/workflowversions/id_version_test.go b/resource-manager/web/2023-12-01/workflowversions/id_version_test.go index 232182dab8d..5398d232c03 100644 --- a/resource-manager/web/2023-12-01/workflowversions/id_version_test.go +++ b/resource-manager/web/2023-12-01/workflowversions/id_version_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &VersionId{} func TestNewVersionID(t *testing.T) { - id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId") + id := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewVersionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.SiteName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "name") + if id.SiteName != "siteName" { + t.Fatalf("Expected %q but got %q for Segment 'SiteName'", id.SiteName, "siteName") } if id.WorkflowName != "workflowName" { @@ -36,8 +36,8 @@ func TestNewVersionID(t *testing.T) { } func TestFormatVersionID(t *testing.T) { - actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "name", "workflowName", "versionId").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId" + actual := NewVersionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "siteName", "workflowName", "versionId").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,68 +91,68 @@ func TestParseVersionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", VersionId: "versionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", Error: true, }, } @@ -277,134 +277,134 @@ func TestParseVersionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - SiteName: "name", + SiteName: "siteName", WorkflowName: "workflowName", VersionId: "versionId", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/name/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Web/sites/siteName/hostRuntime/runtime/webHooks/workflow/api/management/workflows/workflowName/versions/versionId/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId", Expected: &VersionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SiteName: "nAmE", + SiteName: "sItEnAmE", WorkflowName: "wOrKfLoWnAmE", VersionId: "vErSiOnId", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/nAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.wEb/sItEs/sItEnAmE/hOsTrUnTiMe/rUnTiMe/wEbHoOkS/wOrKfLoW/aPi/mAnAgEmEnT/wOrKfLoWs/wOrKfLoWnAmE/vErSiOnS/vErSiOnId/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/README.md b/resource-manager/webpubsub/2023-02-01/webpubsub/README.md index 3ccb7d18749..be2bc77a035 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/README.md +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webpubsub.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := webpubsub.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := webpubsub.NameAvailabilityParameters{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") payload := webpubsub.WebPubSubResource{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName") payload := webpubsub.CustomCertificate{ // ... @@ -80,7 +80,7 @@ if err := client.CustomCertificatesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName") read, err := client.CustomCertificatesDelete(ctx, id) if err != nil { @@ -96,7 +96,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName") read, err := client.CustomCertificatesGet(ctx, id) if err != nil { @@ -112,7 +112,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.CustomCertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CustomCertificatesListComplete(ctx, id) @@ -129,7 +129,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName") payload := webpubsub.CustomDomain{ // ... @@ -146,7 +146,7 @@ if err := client.CustomDomainsCreateOrUpdateThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName") if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -158,7 +158,7 @@ if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName") read, err := client.CustomDomainsGet(ctx, id) if err != nil { @@ -174,7 +174,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.CustomDomainsList(ctx, id)` can be used to do batched pagination items, err := client.CustomDomainsListComplete(ctx, id) @@ -191,7 +191,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") read, err := client.Get(ctx, id) if err != nil { @@ -219,7 +219,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName") +id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName") payload := webpubsub.WebPubSubHub{ // ... @@ -236,7 +236,7 @@ if err := client.HubsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName") +id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName") if err := client.HubsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -248,7 +248,7 @@ if err := client.HubsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName") +id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName") read, err := client.HubsGet(ctx, id) if err != nil { @@ -264,7 +264,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.HubsList(ctx, id)` can be used to do batched pagination items, err := client.HubsListComplete(ctx, id) @@ -315,7 +315,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -331,7 +331,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.ListSkus(ctx, id)` can be used to do batched pagination items, err := client.ListSkusComplete(ctx, id) @@ -348,7 +348,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName") if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -360,7 +360,7 @@ if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName") read, err := client.PrivateEndpointConnectionsGet(ctx, id) if err != nil { @@ -376,7 +376,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.PrivateEndpointConnectionsList(ctx, id)` can be used to do batched pagination items, err := client.PrivateEndpointConnectionsListComplete(ctx, id) @@ -393,7 +393,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName") payload := webpubsub.PrivateEndpointConnection{ // ... @@ -414,7 +414,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.PrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.PrivateLinkResourcesListComplete(ctx, id) @@ -431,7 +431,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") payload := webpubsub.RegenerateKeyParameters{ // ... @@ -448,7 +448,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -460,7 +460,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName") payload := webpubsub.SharedPrivateLinkResource{ // ... @@ -477,7 +477,7 @@ if err := client.SharedPrivateLinkResourcesCreateOrUpdateThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName") if err := client.SharedPrivateLinkResourcesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -489,7 +489,7 @@ if err := client.SharedPrivateLinkResourcesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName") read, err := client.SharedPrivateLinkResourcesGet(ctx, id) if err != nil { @@ -505,7 +505,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.SharedPrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.SharedPrivateLinkResourcesListComplete(ctx, id) @@ -522,7 +522,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") payload := webpubsub.WebPubSubResource{ // ... @@ -539,7 +539,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := webpubsub.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.UsagesList(ctx, id)` can be used to do batched pagination items, err := client.UsagesListComplete(ctx, id) diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_customcertificate.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_customcertificate.go index be2b49a0cbd..6385eb780ea 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_customcertificate.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_customcertificate.go @@ -121,9 +121,9 @@ func (id CustomCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticCustomCertificates", "customCertificates", "customCertificates"), - resourceids.UserSpecifiedSegment("customCertificateName", "certificateName"), + resourceids.UserSpecifiedSegment("customCertificateName", "customCertificateName"), } } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_customcertificate_test.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_customcertificate_test.go index f993aa09fde..07c91d71ad9 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_customcertificate_test.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_customcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomCertificateId{} func TestNewCustomCertificateID(t *testing.T) { - id := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") + id := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } - if id.CustomCertificateName != "certificateName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomCertificateName'", id.CustomCertificateName, "certificateName") + if id.CustomCertificateName != "customCertificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomCertificateName'", id.CustomCertificateName, "customCertificateName") } } func TestFormatCustomCertificateID(t *testing.T) { - actual := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName" + actual := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", - CustomCertificateName: "certificateName", + WebPubSubName: "webPubSubName", + CustomCertificateName: "customCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", - CustomCertificateName: "certificateName", + WebPubSubName: "webPubSubName", + CustomCertificateName: "customCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMcErTiFiCaTeS/cUsToMcErTiFiCaTeNaMe", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", - CustomCertificateName: "cErTiFiCaTeNaMe", + WebPubSubName: "wEbPuBsUbNaMe", + CustomCertificateName: "cUsToMcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMcErTiFiCaTeS/cUsToMcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_customdomain.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_customdomain.go index 93ae8679af0..9a983c516da 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_customdomain.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_customdomain.go @@ -121,9 +121,9 @@ func (id CustomDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), - resourceids.UserSpecifiedSegment("customDomainName", "name"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainName"), } } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_customdomain_test.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_customdomain_test.go index bc46a110206..3986e185979 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_customdomain_test.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_customdomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomDomainId{} func TestNewCustomDomainID(t *testing.T) { - id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") + id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } - if id.CustomDomainName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "name") + if id.CustomDomainName != "customDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "customDomainName") } } func TestFormatCustomDomainID(t *testing.T) { - actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name" + actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", - CustomDomainName: "name", + WebPubSubName: "webPubSubName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMdOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMdOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", - CustomDomainName: "name", + WebPubSubName: "webPubSubName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMdOmAiNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMdOmAiNs/cUsToMdOmAiNnAmE", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", - CustomDomainName: "nAmE", + WebPubSubName: "wEbPuBsUbNaMe", + CustomDomainName: "cUsToMdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMdOmAiNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMdOmAiNs/cUsToMdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_hub.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_hub.go index 6aecee9da87..7e5c2d839ea 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_hub.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_hub.go @@ -121,7 +121,7 @@ func (id HubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticHubs", "hubs", "hubs"), resourceids.UserSpecifiedSegment("hubName", "hubName"), } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_hub_test.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_hub_test.go index 99fd07fff35..65a16508fa9 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_hub_test.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_hub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubId{} func TestNewHubID(t *testing.T) { - id := NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName") + id := NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } if id.HubName != "hubName" { @@ -32,8 +32,8 @@ func TestNewHubID(t *testing.T) { } func TestFormatHubID(t *testing.T) { - actual := NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName" + actual := NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHubID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName", Expected: &HubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", HubName: "hubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHubIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/hUbS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/hUbS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName", Expected: &HubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", HubName: "hubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/hUbS/hUbNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/hUbS/hUbNaMe", Expected: &HubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", HubName: "hUbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/hUbS/hUbNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/hUbS/hUbNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_location.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_location.go index 15635cec2b5..edda1420a81 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_location.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_location_test.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_location_test.go index 49f2dbcfd7b..5bcd860289d 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_location_test.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_privateendpointconnection.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_privateendpointconnection.go index 06064a29aad..69248121ecf 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_privateendpointconnection.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_privateendpointconnection_test.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_privateendpointconnection_test.go index bb4d7a4bbcc..2fa17beaab7 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_privateendpointconnection_test.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_sharedprivatelinkresource.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_sharedprivatelinkresource.go index db19823b8c1..92044e4d4a8 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_sharedprivatelinkresource.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_sharedprivatelinkresource.go @@ -121,7 +121,7 @@ func (id SharedPrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticSharedPrivateLinkResources", "sharedPrivateLinkResources", "sharedPrivateLinkResources"), resourceids.UserSpecifiedSegment("sharedPrivateLinkResourceName", "sharedPrivateLinkResourceName"), } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_sharedprivatelinkresource_test.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_sharedprivatelinkresource_test.go index 6cd062bef03..a02dddb15e3 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_sharedprivatelinkresource_test.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_sharedprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SharedPrivateLinkResourceId{} func TestNewSharedPrivateLinkResourceID(t *testing.T) { - id := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") + id := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSharedPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } if id.SharedPrivateLinkResourceName != "sharedPrivateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewSharedPrivateLinkResourceID(t *testing.T) { } func TestFormatSharedPrivateLinkResourceID(t *testing.T) { - actual := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" + actual := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSharedPrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSharedPrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/sHaReDpRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", SharedPrivateLinkResourceName: "sHaReDpRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_webpubsub.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_webpubsub.go index 99039e4ded5..466f35ecd1d 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_webpubsub.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_webpubsub.go @@ -115,7 +115,7 @@ func (id WebPubSubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), } } diff --git a/resource-manager/webpubsub/2023-02-01/webpubsub/id_webpubsub_test.go b/resource-manager/webpubsub/2023-02-01/webpubsub/id_webpubsub_test.go index 18e68948fad..cdb83314932 100644 --- a/resource-manager/webpubsub/2023-02-01/webpubsub/id_webpubsub_test.go +++ b/resource-manager/webpubsub/2023-02-01/webpubsub/id_webpubsub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebPubSubId{} func TestNewWebPubSubID(t *testing.T) { - id := NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewWebPubSubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } } func TestFormatWebPubSubID(t *testing.T) { - actual := NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName" + actual := NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseWebPubSubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Expected: &WebPubSubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseWebPubSubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Expected: &WebPubSubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Expected: &WebPubSubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/README.md b/resource-manager/webpubsub/2024-03-01/webpubsub/README.md index 622fd15c3de..d7db65d4661 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/README.md +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/README.md @@ -25,7 +25,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := webpubsub.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := webpubsub.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := webpubsub.NameAvailabilityParameters{ // ... @@ -46,7 +46,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") payload := webpubsub.WebPubSubResource{ // ... @@ -63,7 +63,7 @@ if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName") payload := webpubsub.CustomCertificate{ // ... @@ -80,7 +80,7 @@ if err := client.CustomCertificatesCreateOrUpdateThenPoll(ctx, id, payload); err ```go ctx := context.TODO() -id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName") read, err := client.CustomCertificatesDelete(ctx, id) if err != nil { @@ -96,7 +96,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") +id := webpubsub.NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName") read, err := client.CustomCertificatesGet(ctx, id) if err != nil { @@ -112,7 +112,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.CustomCertificatesList(ctx, id)` can be used to do batched pagination items, err := client.CustomCertificatesListComplete(ctx, id) @@ -129,7 +129,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName") payload := webpubsub.CustomDomain{ // ... @@ -146,7 +146,7 @@ if err := client.CustomDomainsCreateOrUpdateThenPoll(ctx, id, payload); err != n ```go ctx := context.TODO() -id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName") if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -158,7 +158,7 @@ if err := client.CustomDomainsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") +id := webpubsub.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName") read, err := client.CustomDomainsGet(ctx, id) if err != nil { @@ -174,7 +174,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.CustomDomainsList(ctx, id)` can be used to do batched pagination items, err := client.CustomDomainsListComplete(ctx, id) @@ -191,7 +191,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") if err := client.DeleteThenPoll(ctx, id); err != nil { // handle the error @@ -203,7 +203,7 @@ if err := client.DeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") read, err := client.Get(ctx, id) if err != nil { @@ -219,7 +219,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName") +id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName") payload := webpubsub.WebPubSubHub{ // ... @@ -236,7 +236,7 @@ if err := client.HubsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName") +id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName") if err := client.HubsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -248,7 +248,7 @@ if err := client.HubsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName") +id := webpubsub.NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName") read, err := client.HubsGet(ctx, id) if err != nil { @@ -264,7 +264,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.HubsList(ctx, id)` can be used to do batched pagination items, err := client.HubsListComplete(ctx, id) @@ -315,7 +315,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") read, err := client.ListKeys(ctx, id) if err != nil { @@ -331,7 +331,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName") // alternatively `client.ListReplicaSkus(ctx, id)` can be used to do batched pagination items, err := client.ListReplicaSkusComplete(ctx, id) @@ -348,7 +348,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.ListSkus(ctx, id)` can be used to do batched pagination items, err := client.ListSkusComplete(ctx, id) @@ -365,7 +365,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName") if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -377,7 +377,7 @@ if err := client.PrivateEndpointConnectionsDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName") read, err := client.PrivateEndpointConnectionsGet(ctx, id) if err != nil { @@ -393,7 +393,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.PrivateEndpointConnectionsList(ctx, id)` can be used to do batched pagination items, err := client.PrivateEndpointConnectionsListComplete(ctx, id) @@ -410,7 +410,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") +id := webpubsub.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName") payload := webpubsub.PrivateEndpointConnection{ // ... @@ -431,7 +431,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.PrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.PrivateLinkResourcesListComplete(ctx, id) @@ -448,7 +448,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") payload := webpubsub.RegenerateKeyParameters{ // ... @@ -465,7 +465,7 @@ if err := client.RegenerateKeyThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName", "sharedPrivateLinkResourceName") +id := webpubsub.NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName", "sharedPrivateLinkResourceName") payload := webpubsub.SharedPrivateLinkResource{ // ... @@ -482,7 +482,7 @@ if err := client.ReplicaSharedPrivateLinkResourcesCreateOrUpdateThenPoll(ctx, id ```go ctx := context.TODO() -id := webpubsub.NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName", "sharedPrivateLinkResourceName") +id := webpubsub.NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName", "sharedPrivateLinkResourceName") read, err := client.ReplicaSharedPrivateLinkResourcesGet(ctx, id) if err != nil { @@ -498,7 +498,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName") // alternatively `client.ReplicaSharedPrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.ReplicaSharedPrivateLinkResourcesListComplete(ctx, id) @@ -515,7 +515,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName") payload := webpubsub.Replica{ // ... @@ -532,7 +532,7 @@ if err := client.ReplicasCreateOrUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName") read, err := client.ReplicasDelete(ctx, id) if err != nil { @@ -548,7 +548,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName") read, err := client.ReplicasGet(ctx, id) if err != nil { @@ -564,7 +564,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.ReplicasList(ctx, id)` can be used to do batched pagination items, err := client.ReplicasListComplete(ctx, id) @@ -581,7 +581,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName") if err := client.ReplicasRestartThenPoll(ctx, id); err != nil { // handle the error @@ -593,7 +593,7 @@ if err := client.ReplicasRestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") +id := webpubsub.NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName") payload := webpubsub.Replica{ // ... @@ -610,7 +610,7 @@ if err := client.ReplicasUpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") if err := client.RestartThenPoll(ctx, id); err != nil { // handle the error @@ -622,7 +622,7 @@ if err := client.RestartThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName") payload := webpubsub.SharedPrivateLinkResource{ // ... @@ -639,7 +639,7 @@ if err := client.SharedPrivateLinkResourcesCreateOrUpdateThenPoll(ctx, id, paylo ```go ctx := context.TODO() -id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName") if err := client.SharedPrivateLinkResourcesDeleteThenPoll(ctx, id); err != nil { // handle the error @@ -651,7 +651,7 @@ if err := client.SharedPrivateLinkResourcesDeleteThenPoll(ctx, id); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") +id := webpubsub.NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName") read, err := client.SharedPrivateLinkResourcesGet(ctx, id) if err != nil { @@ -667,7 +667,7 @@ if model := read.Model; model != nil { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") // alternatively `client.SharedPrivateLinkResourcesList(ctx, id)` can be used to do batched pagination items, err := client.SharedPrivateLinkResourcesListComplete(ctx, id) @@ -684,7 +684,7 @@ for _, item := range items { ```go ctx := context.TODO() -id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") +id := webpubsub.NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") payload := webpubsub.WebPubSubResource{ // ... @@ -701,7 +701,7 @@ if err := client.UpdateThenPoll(ctx, id, payload); err != nil { ```go ctx := context.TODO() -id := webpubsub.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := webpubsub.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") // alternatively `client.UsagesList(ctx, id)` can be used to do batched pagination items, err := client.UsagesListComplete(ctx, id) diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_customcertificate.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_customcertificate.go index be2b49a0cbd..6385eb780ea 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_customcertificate.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_customcertificate.go @@ -121,9 +121,9 @@ func (id CustomCertificateId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticCustomCertificates", "customCertificates", "customCertificates"), - resourceids.UserSpecifiedSegment("customCertificateName", "certificateName"), + resourceids.UserSpecifiedSegment("customCertificateName", "customCertificateName"), } } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_customcertificate_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_customcertificate_test.go index f993aa09fde..07c91d71ad9 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_customcertificate_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_customcertificate_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomCertificateId{} func TestNewCustomCertificateID(t *testing.T) { - id := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName") + id := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomCertificateID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } - if id.CustomCertificateName != "certificateName" { - t.Fatalf("Expected %q but got %q for Segment 'CustomCertificateName'", id.CustomCertificateName, "certificateName") + if id.CustomCertificateName != "customCertificateName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomCertificateName'", id.CustomCertificateName, "customCertificateName") } } func TestFormatCustomCertificateID(t *testing.T) { - actual := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "certificateName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName" + actual := NewCustomCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customCertificateName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomCertificateID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", - CustomCertificateName: "certificateName", + WebPubSubName: "webPubSubName", + CustomCertificateName: "customCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomCertificateIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMcErTiFiCaTeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", - CustomCertificateName: "certificateName", + WebPubSubName: "webPubSubName", + CustomCertificateName: "customCertificateName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customCertificates/certificateName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customCertificates/customCertificateName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS/cErTiFiCaTeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMcErTiFiCaTeS/cUsToMcErTiFiCaTeNaMe", Expected: &CustomCertificateId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", - CustomCertificateName: "cErTiFiCaTeNaMe", + WebPubSubName: "wEbPuBsUbNaMe", + CustomCertificateName: "cUsToMcErTiFiCaTeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMcErTiFiCaTeS/cErTiFiCaTeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMcErTiFiCaTeS/cUsToMcErTiFiCaTeNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_customdomain.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_customdomain.go index 93ae8679af0..9a983c516da 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_customdomain.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_customdomain.go @@ -121,9 +121,9 @@ func (id CustomDomainId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), - resourceids.UserSpecifiedSegment("customDomainName", "name"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainName"), } } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_customdomain_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_customdomain_test.go index bc46a110206..3986e185979 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_customdomain_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_customdomain_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &CustomDomainId{} func TestNewCustomDomainID(t *testing.T) { - id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name") + id := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,18 +22,18 @@ func TestNewCustomDomainID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } - if id.CustomDomainName != "name" { - t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "name") + if id.CustomDomainName != "customDomainName" { + t.Fatalf("Expected %q but got %q for Segment 'CustomDomainName'", id.CustomDomainName, "customDomainName") } } func TestFormatCustomDomainID(t *testing.T) { - actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "name").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name" + actual := NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "customDomainName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseCustomDomainID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", - CustomDomainName: "name", + WebPubSubName: "webPubSubName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseCustomDomainIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMdOmAiNs", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMdOmAiNs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", - CustomDomainName: "name", + WebPubSubName: "webPubSubName", + CustomDomainName: "customDomainName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/customDomains/name/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/customDomains/customDomainName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMdOmAiNs/nAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMdOmAiNs/cUsToMdOmAiNnAmE", Expected: &CustomDomainId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", - CustomDomainName: "nAmE", + WebPubSubName: "wEbPuBsUbNaMe", + CustomDomainName: "cUsToMdOmAiNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/cUsToMdOmAiNs/nAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/cUsToMdOmAiNs/cUsToMdOmAiNnAmE/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_hub.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_hub.go index 6aecee9da87..7e5c2d839ea 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_hub.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_hub.go @@ -121,7 +121,7 @@ func (id HubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticHubs", "hubs", "hubs"), resourceids.UserSpecifiedSegment("hubName", "hubName"), } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_hub_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_hub_test.go index 99fd07fff35..65a16508fa9 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_hub_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_hub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &HubId{} func TestNewHubID(t *testing.T) { - id := NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName") + id := NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewHubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } if id.HubName != "hubName" { @@ -32,8 +32,8 @@ func TestNewHubID(t *testing.T) { } func TestFormatHubID(t *testing.T) { - actual := NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "hubName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName" + actual := NewHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "hubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseHubID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName", Expected: &HubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", HubName: "hubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseHubIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/hUbS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/hUbS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName", Expected: &HubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", HubName: "hubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/hubs/hubName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/hubs/hubName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/hUbS/hUbNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/hUbS/hUbNaMe", Expected: &HubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", HubName: "hUbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/hUbS/hUbNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/hUbS/hUbNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_location.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_location.go index 15635cec2b5..edda1420a81 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_location.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_location_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_location_test.go index 49f2dbcfd7b..5bcd860289d 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_location_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.SignalRService/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_privateendpointconnection.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_privateendpointconnection.go index 06064a29aad..69248121ecf 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_privateendpointconnection.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_privateendpointconnection.go @@ -121,7 +121,7 @@ func (id PrivateEndpointConnectionId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionName"), } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_privateendpointconnection_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_privateendpointconnection_test.go index bb4d7a4bbcc..2fa17beaab7 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_privateendpointconnection_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_privateendpointconnection_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &PrivateEndpointConnectionId{} func TestNewPrivateEndpointConnectionID(t *testing.T) { - id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName") + id := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } if id.PrivateEndpointConnectionName != "privateEndpointConnectionName" { @@ -32,8 +32,8 @@ func TestNewPrivateEndpointConnectionID(t *testing.T) { } func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "privateEndpointConnectionName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName" + actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "privateEndpointConnectionName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParsePrivateEndpointConnectionID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParsePrivateEndpointConnectionIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", PrivateEndpointConnectionName: "privateEndpointConnectionName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/privateEndpointConnections/privateEndpointConnectionName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/privateEndpointConnections/privateEndpointConnectionName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", Expected: &PrivateEndpointConnectionId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_replica.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_replica.go index f7a98a4fa85..d928754698a 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_replica.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_replica.go @@ -121,7 +121,7 @@ func (id ReplicaId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticReplicas", "replicas", "replicas"), resourceids.UserSpecifiedSegment("replicaName", "replicaName"), } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_replica_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_replica_test.go index e69722c0a87..6980dd43642 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_replica_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_replica_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicaId{} func TestNewReplicaID(t *testing.T) { - id := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName") + id := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewReplicaID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } if id.ReplicaName != "replicaName" { @@ -32,8 +32,8 @@ func TestNewReplicaID(t *testing.T) { } func TestFormatReplicaID(t *testing.T) { - actual := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName" + actual := NewReplicaID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseReplicaID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", ReplicaName: "replicaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseReplicaIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/rEpLiCaS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/rEpLiCaS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", ReplicaName: "replicaName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/rEpLiCaS/rEpLiCaNaMe", Expected: &ReplicaId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", ReplicaName: "rEpLiCaNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/rEpLiCaS/rEpLiCaNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_replicasharedprivatelinkresource.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_replicasharedprivatelinkresource.go index 0b7c5c2cde2..a5f8ca74311 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_replicasharedprivatelinkresource.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_replicasharedprivatelinkresource.go @@ -127,7 +127,7 @@ func (id ReplicaSharedPrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticReplicas", "replicas", "replicas"), resourceids.UserSpecifiedSegment("replicaName", "replicaName"), resourceids.StaticSegment("staticSharedPrivateLinkResources", "sharedPrivateLinkResources", "sharedPrivateLinkResources"), diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_replicasharedprivatelinkresource_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_replicasharedprivatelinkresource_test.go index b21cebcf7a8..8f3ff4749cb 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_replicasharedprivatelinkresource_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_replicasharedprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &ReplicaSharedPrivateLinkResourceId{} func TestNewReplicaSharedPrivateLinkResourceID(t *testing.T) { - id := NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName", "sharedPrivateLinkResourceName") + id := NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName", "sharedPrivateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewReplicaSharedPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } if id.ReplicaName != "replicaName" { @@ -36,8 +36,8 @@ func TestNewReplicaSharedPrivateLinkResourceID(t *testing.T) { } func TestFormatReplicaSharedPrivateLinkResourceID(t *testing.T) { - actual := NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "replicaName", "sharedPrivateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" + actual := NewReplicaSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "replicaName", "sharedPrivateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -91,38 +91,38 @@ func TestParseReplicaSharedPrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/sharedPrivateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &ReplicaSharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", ReplicaName: "replicaName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, } @@ -247,74 +247,74 @@ func TestParseReplicaSharedPrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/rEpLiCaS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/rEpLiCaS", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/rEpLiCaS/rEpLiCaNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/sharedPrivateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &ReplicaSharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", ReplicaName: "replicaName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/replicas/replicaName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", Expected: &ReplicaSharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", ReplicaName: "rEpLiCaNaMe", SharedPrivateLinkResourceName: "sHaReDpRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/rEpLiCaS/rEpLiCaNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_sharedprivatelinkresource.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_sharedprivatelinkresource.go index db19823b8c1..92044e4d4a8 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_sharedprivatelinkresource.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_sharedprivatelinkresource.go @@ -121,7 +121,7 @@ func (id SharedPrivateLinkResourceId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), resourceids.StaticSegment("staticSharedPrivateLinkResources", "sharedPrivateLinkResources", "sharedPrivateLinkResources"), resourceids.UserSpecifiedSegment("sharedPrivateLinkResourceName", "sharedPrivateLinkResourceName"), } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_sharedprivatelinkresource_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_sharedprivatelinkresource_test.go index 6cd062bef03..a02dddb15e3 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_sharedprivatelinkresource_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_sharedprivatelinkresource_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &SharedPrivateLinkResourceId{} func TestNewSharedPrivateLinkResourceID(t *testing.T) { - id := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName") + id := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,8 +22,8 @@ func TestNewSharedPrivateLinkResourceID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } if id.SharedPrivateLinkResourceName != "sharedPrivateLinkResourceName" { @@ -32,8 +32,8 @@ func TestNewSharedPrivateLinkResourceID(t *testing.T) { } func TestFormatSharedPrivateLinkResourceID(t *testing.T) { - actual := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName", "sharedPrivateLinkResourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" + actual := NewSharedPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName", "sharedPrivateLinkResourceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -87,27 +87,27 @@ func TestParseSharedPrivateLinkResourceID(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, } @@ -228,52 +228,52 @@ func TestParseSharedPrivateLinkResourceIDInsensitively(t *testing.T) { }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Error: true, }, { // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources", Error: true, }, { // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/sHaReDpRiVaTeLiNkReSoUrCeS", Error: true, }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", SharedPrivateLinkResourceName: "sharedPrivateLinkResourceName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/sharedPrivateLinkResources/sharedPrivateLinkResourceName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe", Expected: &SharedPrivateLinkResourceId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", SharedPrivateLinkResourceName: "sHaReDpRiVaTeLiNkReSoUrCeNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/sHaReDpRiVaTeLiNkReSoUrCeS/sHaReDpRiVaTeLiNkReSoUrCeNaMe/extra", Error: true, }, } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_webpubsub.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_webpubsub.go index 99039e4ded5..466f35ecd1d 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_webpubsub.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_webpubsub.go @@ -115,7 +115,7 @@ func (id WebPubSubId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftSignalRService", "Microsoft.SignalRService", "Microsoft.SignalRService"), resourceids.StaticSegment("staticWebPubSub", "webPubSub", "webPubSub"), - resourceids.UserSpecifiedSegment("webPubSubName", "resourceName"), + resourceids.UserSpecifiedSegment("webPubSubName", "webPubSubName"), } } diff --git a/resource-manager/webpubsub/2024-03-01/webpubsub/id_webpubsub_test.go b/resource-manager/webpubsub/2024-03-01/webpubsub/id_webpubsub_test.go index 18e68948fad..cdb83314932 100644 --- a/resource-manager/webpubsub/2024-03-01/webpubsub/id_webpubsub_test.go +++ b/resource-manager/webpubsub/2024-03-01/webpubsub/id_webpubsub_test.go @@ -12,7 +12,7 @@ import ( var _ resourceids.ResourceId = &WebPubSubId{} func TestNewWebPubSubID(t *testing.T) { - id := NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName") + id := NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") @@ -22,14 +22,14 @@ func TestNewWebPubSubID(t *testing.T) { t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") } - if id.WebPubSubName != "resourceName" { - t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "resourceName") + if id.WebPubSubName != "webPubSubName" { + t.Fatalf("Expected %q but got %q for Segment 'WebPubSubName'", id.WebPubSubName, "webPubSubName") } } func TestFormatWebPubSubID(t *testing.T) { - actual := NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourceName").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName" + actual := NewWebPubSubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "webPubSubName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -83,16 +83,16 @@ func TestParseWebPubSubID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Expected: &WebPubSubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/extra", Error: true, }, } @@ -209,30 +209,30 @@ func TestParseWebPubSubIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName", Expected: &WebPubSubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "example-resource-group", - WebPubSubName: "resourceName", + WebPubSubName: "webPubSubName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/resourceName/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.SignalRService/webPubSub/webPubSubName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe", Expected: &WebPubSubId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WebPubSubName: "rEsOuRcEnAmE", + WebPubSubName: "wEbPuBsUbNaMe", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/rEsOuRcEnAmE/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sIgNaLrSeRvIcE/wEbPuBsUb/wEbPuBsUbNaMe/extra", Error: true, }, } diff --git a/resource-manager/workloads/2023-04-01/providerinstances/model_prometheushaclusterproviderinstanceproperties.go b/resource-manager/workloads/2023-04-01/providerinstances/model_prometheushaclusterproviderinstanceproperties.go index 780a595bd5e..84347114a80 100644 --- a/resource-manager/workloads/2023-04-01/providerinstances/model_prometheushaclusterproviderinstanceproperties.go +++ b/resource-manager/workloads/2023-04-01/providerinstances/model_prometheushaclusterproviderinstanceproperties.go @@ -13,7 +13,7 @@ var _ ProviderSpecificProperties = PrometheusHaClusterProviderInstanceProperties type PrometheusHaClusterProviderInstanceProperties struct { ClusterName *string `json:"clusterName,omitempty"` Hostname *string `json:"hostname,omitempty"` - PrometheusUrl *string `json:"prometheusUrl,omitempty"` + PrometheusURL *string `json:"prometheusUrl,omitempty"` Sid *string `json:"sid,omitempty"` SslCertificateUri *string `json:"sslCertificateUri,omitempty"` SslPreference *SslPreference `json:"sslPreference,omitempty"` diff --git a/resource-manager/workloads/2023-04-01/providerinstances/model_prometheusosproviderinstanceproperties.go b/resource-manager/workloads/2023-04-01/providerinstances/model_prometheusosproviderinstanceproperties.go index e48c43db546..068a1196b0b 100644 --- a/resource-manager/workloads/2023-04-01/providerinstances/model_prometheusosproviderinstanceproperties.go +++ b/resource-manager/workloads/2023-04-01/providerinstances/model_prometheusosproviderinstanceproperties.go @@ -11,7 +11,7 @@ import ( var _ ProviderSpecificProperties = PrometheusOSProviderInstanceProperties{} type PrometheusOSProviderInstanceProperties struct { - PrometheusUrl *string `json:"prometheusUrl,omitempty"` + PrometheusURL *string `json:"prometheusUrl,omitempty"` SapSid *string `json:"sapSid,omitempty"` SslCertificateUri *string `json:"sslCertificateUri,omitempty"` SslPreference *SslPreference `json:"sslPreference,omitempty"` diff --git a/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/README.md b/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/README.md index 793b9b41740..6e71154cfa8 100644 --- a/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/README.md +++ b/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sapavailabilityzonedetails.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := sapavailabilityzonedetails.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := sapavailabilityzonedetails.SAPAvailabilityZoneDetailsRequest{ // ... diff --git a/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/id_location.go b/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/id_location.go index 23e3e46c924..faf9a6de7ff 100644 --- a/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/id_location.go +++ b/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWorkloads", "Microsoft.Workloads", "Microsoft.Workloads"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/id_location_test.go b/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/id_location_test.go index a512042f5b4..b51f3617a91 100644 --- a/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/id_location_test.go +++ b/resource-manager/workloads/2023-04-01/sapavailabilityzonedetails/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/workloads/2023-04-01/sapdiskconfigurations/README.md b/resource-manager/workloads/2023-04-01/sapdiskconfigurations/README.md index 4049b9303a3..0a5732c327e 100644 --- a/resource-manager/workloads/2023-04-01/sapdiskconfigurations/README.md +++ b/resource-manager/workloads/2023-04-01/sapdiskconfigurations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sapdiskconfigurations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := sapdiskconfigurations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := sapdiskconfigurations.SAPDiskConfigurationsRequest{ // ... diff --git a/resource-manager/workloads/2023-04-01/sapdiskconfigurations/id_location.go b/resource-manager/workloads/2023-04-01/sapdiskconfigurations/id_location.go index 2be06f8b73f..0f5a0abfd09 100644 --- a/resource-manager/workloads/2023-04-01/sapdiskconfigurations/id_location.go +++ b/resource-manager/workloads/2023-04-01/sapdiskconfigurations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWorkloads", "Microsoft.Workloads", "Microsoft.Workloads"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/workloads/2023-04-01/sapdiskconfigurations/id_location_test.go b/resource-manager/workloads/2023-04-01/sapdiskconfigurations/id_location_test.go index 2ccaaf59591..22e5263fee9 100644 --- a/resource-manager/workloads/2023-04-01/sapdiskconfigurations/id_location_test.go +++ b/resource-manager/workloads/2023-04-01/sapdiskconfigurations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/workloads/2023-04-01/saprecommendations/README.md b/resource-manager/workloads/2023-04-01/saprecommendations/README.md index 1fc43602acc..1523bbc40bf 100644 --- a/resource-manager/workloads/2023-04-01/saprecommendations/README.md +++ b/resource-manager/workloads/2023-04-01/saprecommendations/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := saprecommendations.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := saprecommendations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := saprecommendations.SAPSizingRecommendationRequest{ // ... diff --git a/resource-manager/workloads/2023-04-01/saprecommendations/id_location.go b/resource-manager/workloads/2023-04-01/saprecommendations/id_location.go index 7ab88eff87b..5212ec26396 100644 --- a/resource-manager/workloads/2023-04-01/saprecommendations/id_location.go +++ b/resource-manager/workloads/2023-04-01/saprecommendations/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWorkloads", "Microsoft.Workloads", "Microsoft.Workloads"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/workloads/2023-04-01/saprecommendations/id_location_test.go b/resource-manager/workloads/2023-04-01/saprecommendations/id_location_test.go index cb3c5c81a4f..a4f4713f512 100644 --- a/resource-manager/workloads/2023-04-01/saprecommendations/id_location_test.go +++ b/resource-manager/workloads/2023-04-01/saprecommendations/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/workloads/2023-04-01/sapsupportedsku/README.md b/resource-manager/workloads/2023-04-01/sapsupportedsku/README.md index c6574e81e51..e922fc79caf 100644 --- a/resource-manager/workloads/2023-04-01/sapsupportedsku/README.md +++ b/resource-manager/workloads/2023-04-01/sapsupportedsku/README.md @@ -24,7 +24,7 @@ client.Client.Authorizer = authorizer ```go ctx := context.TODO() -id := sapsupportedsku.NewLocationID("12345678-1234-9876-4563-123456789012", "location") +id := sapsupportedsku.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") payload := sapsupportedsku.SAPSupportedSkusRequest{ // ... diff --git a/resource-manager/workloads/2023-04-01/sapsupportedsku/id_location.go b/resource-manager/workloads/2023-04-01/sapsupportedsku/id_location.go index f6741537a20..470dbe8cc3a 100644 --- a/resource-manager/workloads/2023-04-01/sapsupportedsku/id_location.go +++ b/resource-manager/workloads/2023-04-01/sapsupportedsku/id_location.go @@ -107,7 +107,7 @@ func (id LocationId) Segments() []resourceids.Segment { resourceids.StaticSegment("staticProviders", "providers", "providers"), resourceids.ResourceProviderSegment("staticMicrosoftWorkloads", "Microsoft.Workloads", "Microsoft.Workloads"), resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "location"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), } } diff --git a/resource-manager/workloads/2023-04-01/sapsupportedsku/id_location_test.go b/resource-manager/workloads/2023-04-01/sapsupportedsku/id_location_test.go index 79d6de8c8eb..6483a55453e 100644 --- a/resource-manager/workloads/2023-04-01/sapsupportedsku/id_location_test.go +++ b/resource-manager/workloads/2023-04-01/sapsupportedsku/id_location_test.go @@ -12,20 +12,20 @@ import ( var _ resourceids.ResourceId = &LocationId{} func TestNewLocationID(t *testing.T) { - id := NewLocationID("12345678-1234-9876-4563-123456789012", "location") + id := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") } - if id.LocationName != "location" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "location") + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") } } func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "location").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location" + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName" if actual != expected { t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) } @@ -69,15 +69,15 @@ func TestParseLocationID(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName/extra", Error: true, }, } @@ -170,28 +170,28 @@ func TestParseLocationIDInsensitively(t *testing.T) { }, { // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "location", + LocationName: "locationName", }, }, { // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/location/extra", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Workloads/locations/locationName/extra", Error: true, }, { // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoN", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoNnAmE", Expected: &LocationId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoN", + LocationName: "lOcAtIoNnAmE", }, }, { // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoN/extra", + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.wOrKlOaDs/lOcAtIoNs/lOcAtIoNnAmE/extra", Error: true, }, } diff --git a/resource-manager/workloads/2023-04-01/sapvirtualinstances/model_sapinstallwithoutosconfigsoftwareconfiguration.go b/resource-manager/workloads/2023-04-01/sapvirtualinstances/model_sapinstallwithoutosconfigsoftwareconfiguration.go index 20516b1c968..14cfc6b9ba8 100644 --- a/resource-manager/workloads/2023-04-01/sapvirtualinstances/model_sapinstallwithoutosconfigsoftwareconfiguration.go +++ b/resource-manager/workloads/2023-04-01/sapvirtualinstances/model_sapinstallwithoutosconfigsoftwareconfiguration.go @@ -11,7 +11,7 @@ import ( var _ SoftwareConfiguration = SAPInstallWithoutOSConfigSoftwareConfiguration{} type SAPInstallWithoutOSConfigSoftwareConfiguration struct { - BomUrl string `json:"bomUrl"` + BomURL string `json:"bomUrl"` HighAvailabilitySoftwareConfiguration *HighAvailabilitySoftwareConfiguration `json:"highAvailabilitySoftwareConfiguration,omitempty"` SapBitsStorageAccountId string `json:"sapBitsStorageAccountId"` SoftwareVersion string `json:"softwareVersion"` diff --git a/resource-manager/workloads/2023-04-01/sapvirtualinstances/model_serviceinitiatedsoftwareconfiguration.go b/resource-manager/workloads/2023-04-01/sapvirtualinstances/model_serviceinitiatedsoftwareconfiguration.go index 134133ef7ec..0f1ff942c7f 100644 --- a/resource-manager/workloads/2023-04-01/sapvirtualinstances/model_serviceinitiatedsoftwareconfiguration.go +++ b/resource-manager/workloads/2023-04-01/sapvirtualinstances/model_serviceinitiatedsoftwareconfiguration.go @@ -11,7 +11,7 @@ import ( var _ SoftwareConfiguration = ServiceInitiatedSoftwareConfiguration{} type ServiceInitiatedSoftwareConfiguration struct { - BomUrl string `json:"bomUrl"` + BomURL string `json:"bomUrl"` HighAvailabilitySoftwareConfiguration *HighAvailabilitySoftwareConfiguration `json:"highAvailabilitySoftwareConfiguration,omitempty"` SapBitsStorageAccountId string `json:"sapBitsStorageAccountId"` SapFqdn string `json:"sapFqdn"`